WLED/wled00/data/index.htm
2020-02-15 16:18:06 +01:00

1458 lines
70 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta charset="utf-8">
<meta name="theme-color" content="#222222">
<meta content="yes" name="apple-mobile-web-app-capable">
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAGACGAAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAE1JREFUOI1j/P//PwOxgNGeAUMxE9G6cQCKDWAhpADZ2f8PMjBS3QW08QK20KaZC2gfC9hCnqouoNgARgY7zMxAyNlUdQHlXiAlO2MDAD63EVqNHAe0AAAAAElFTkSuQmCC"/>
<title>WLED</title>
<script>function feedback(){}</script>
<style>
@font-face {
font-family: "WIcons";
src: url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABsAAAsAAAAAGrQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgD50AIWNtYXAAAAFoAAABRAAAAURfBgSRZ2FzcAAAAqwAAAAIAAAACAAAABBnbHlmAAACtAAAFWQAABVkn5Xq/GhlYWQAABgYAAAANgAAADYXA6M1aGhlYQAAGFAAAAAkAAAAJAcYA19obXR4AAAYdAAAAKgAAAConAAT3mxvY2EAABkcAAAAVgAAAFZwmGsgbWF4cAAAGXQAAAAgAAAAIAA0AF1uYW1lAAAZlAAAAUoAAAFKQULQ4XBvc3QAABrgAAAAIAAAACAAAwAAAAMEAAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA5BADM/80AMwDMwDMAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEASgAAABGAEAABQAGAAEAIOA34DngPOBM4I/gouCp4Lvg1ODp4RbhOeE/4XzhiuIt4j3iouKm4rPixuLk4yXjM+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
}
html {
touch-action: manipulation;
}
body {
margin: 0;
background-color: #111;
font-family: Helvetica, Verdana, sans-serif;
font-size: 17px;
color: white;
text-align: center;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
html,
body {
height: 100%;
width: 100%;
position: fixed;
overscroll-behavior: none;
}
p {
margin: 10px 0 2px 0;
color: #ddd;
}
td {
text-align: center;
text-transform: uppercase;
font-size: 14px;
}
button {
outline: none;
cursor: pointer;
}
.labels {
margin: 0;
padding: 8px 0 2px 0;
}
#namelabel {
position: fixed;
bottom: 72px;
right: 4px;
color: #666;
writing-mode: vertical-rl;
}
.bri {
padding: 4px;
}
.wrapper {
position: fixed;
top: 0;
left: 0;
right: 0;
background: #222;
z-index: 1;
}
.icons {
font-family: 'WIcons';
font-style: normal;
font-size: 24px;
line-height: 1;
display: inline-block;
margin: -2px 0 4px 0;
}
table {
table-layout: fixed;
width: 76%;
}
td {
text-align: center;
}
.slider-icon
{
transform: translateY(3px);
color: #ddd;
}
.sel-icon {
margin: -1px 2px 5px 0;
vertical-align: middle;
color: #ddd;
}
.flr {
float: right;
cursor: pointer;
margin: 0;
color: #fff;
transform: rotate(0deg);
transition: transform 0.3s;
}
.exp {
transform: rotate(180deg);
}
.il {
display: inline-block;
vertical-align: middle;
}
#liveview {
height: 4px;
display: none;
width: 100%;
border: 0px;
}
.tab {
background-color: #222;
color: #ddd;
//filter: drop-shadow(0px 0px 2px #000);
}
.bot {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
}
.tab button {
background-color: inherit;
float: left;
border: none;
transition: 0.3s;
font-size: 17px;
color: #ccc;
}
.top button {
padding: 14px 14px 10px 14px;
}
.bot button {
padding: 10px 0 8px 0;
width:25%;
}
.tab button:hover {
background-color: #333;
color: #eee;
}
.tab button.active {
background-color: #666;
color: #fff;
}
.active {
background-color: #666 !important;
color: #fff;
}
.container {
--n: 1;
width: 100%;
width: calc(var(--n)*100%);
height: calc(100% - var(--tp, 60px) - var(--bt, 60px));
margin-top: var(--tp, 60px);
transform: translate(calc(var(--tx, 0px) + var(--i, 0)/var(--n)*-100%));
overscroll-behavior: none;
}
.tabcontent {
float: left;
position: relative;
width: 100%;
width: calc(100%/var(--n));
padding: 11px 0;
box-sizing: border-box;
border: 0px;
overflow: auto;
height: 100%;
overscroll-behavior: none;
}
#Effects {
padding-top: 0;
border-top: 11px solid #111;
}
.smooth { transition: transform calc(var(--f, 1)*.5s) ease-out }
.tab-label {
margin: 0 0 -5px 0;
padding-bottom: 4px;
}
.overlay {
position: fixed;
height: 100%;
width: 100%;
top: 0;
left: 0;
background-color: #333;
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
z-index: 11;
opacity: 0.95;
transition: 0.7s;
pointer-events: none;
}
.staytop {
display: block;
position: -webkit-sticky;
position: sticky;
background: #111;
top: 0px;
z-index: 1;
}
#staytop1 {
top: 29px;
}
#staytop2 {
top: 58px;
}
#toast {
opacity: 0;
background-color: #555;
max-width: 90%;
color: #fff;
text-align: center;
border-radius: 2px;
padding: 16px;
position: fixed;
z-index: 2;
left: 50%;
transform: translateX(-50%);
bottom: 100px;
font-size: 17px;
pointer-events: none;
}
#toast.show {
opacity: 1;
animation: fadein 0.5s, fadein 0.5s 2.5s reverse;
}
#toast.error {
opacity: 1;
background-color: #b21;
animation: fadein 0.5s;
}
@keyframes fadein {
from {bottom: 0; opacity: 0;}
to {bottom: 100px; opacity: 1;}
}
.sliderdisplay {
content:'';
position: absolute;
top: 13px; bottom: 13px;
left: 10px; right: 10px;
background: #444;
border-radius: 17px;
pointer-events: none;
z-index: -1;
}
input[type=range] {
-webkit-appearance: none;
width: 220px;
padding: 0px;
margin: 0px 10px 0px 10px;
background-color: transparent;
cursor: pointer;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 30px;
cursor: pointer;
background: rgba(0, 0, 0, 0);
}
input[type=range]::-webkit-slider-thumb {
height: 16px;
width: 16px;
border-radius: 17px;
background: #fff;
cursor: pointer;
-webkit-appearance: none;
margin-top: 7px;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 30px;
background-color: rgba(0, 0, 0, 0);
}
input[type=range]::-moz-range-thumb {
border: 0px solid rgba(0, 0, 0, 0);
height: 16px;
width: 16px;
border-radius: 17px;
background: #fff;
transform: translateY(7px);
}
input[type=range]::-ms-track {
width: 100%;
height: 30px;
background: transparent;
border-color: transparent;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: transparent;
}
input[type=range]::-ms-fill-upper {
background: transparent;
}
input[type=range]::-ms-thumb {
height: 16px;
width: 16px;
border-radius: 16px;
background: #fff;
margin-top: -12px;
}
#wwrap {
display: none;
}
.sliderwrap {
height: 30px;
width: 240px;
position: relative;
}
#briwrap {
float: right;
}
#picker {
margin: 10px auto;
width: 260px;
filter: drop-shadow(0px 0px 2px #000);
}
.btn {
padding: 8px;
margin: 10px;
width: 230px;
font-size: 19px;
background-color: #333;
color: white;
border: 0px solid white;
border-radius: 25px;
filter: drop-shadow(0px 0px 2px #000);
transition-duration: 0.5s;
-webkit-backface-visibility: hidden;
-webkit-transform:translate3d(0,0,0);
}
.btn-i {
padding-bottom: 4px;
width: 276px;
background-color: #222;
}
.btn-icon {
margin: 0px 8px 5px 0;
vertical-align: middle;
}
.qcs-w {
margin-top: 10px;
}
.qcs {
padding: 14px;
margin: 2px;
border-radius: 14px;
display: inline-block;
}
.qcsb {
padding: 13px;
border: 1px solid white;
}
.cl {
width: 42px;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='white'><polygon points='0,0 100,0 50,50'/></svg>") no-repeat;
background-size: 12px;
background-position: 206px 16px;
padding-left: 12px !important;
background-repeat: no-repeat;
outline: none;
}
select:-moz-focusring {
transition-duration: 0s;
color: transparent;
text-shadow: 0 0 0 #fff;
}
option {
background-color: #333;
color: #fff;
}
input[type=number] {
background: #333;
color: white;
border: 0px solid white;
border-radius: 5px;
padding: 8px;
margin: 6px 6px 6px 0;
font-size: 19px;
transition: background 0.2s;
outline: none;
width: 50px;
-webkit-appearance: textfield;
-moz-appearance: textfield;
appearance: textfield;
}
input[type=number]:focus {
background: #666;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
}
.segn {
margin: 3px 0 6px 0 !important;
}
.ic {
padding: 6px 0 0 0;
}
.xxs {
width: 40px;
margin: 6px;
}
.rect {
border-radius: 5px;
}
.psts {
background-color: #222;
color: #888;
cursor: default;
}
.stored {
background-color: #333;
color: white;
cursor: pointer;
}
.saving {
background-color: #333;
color: white;
cursor: pointer;
}
.stored.saving {
background-color: #831;
color: white;
}
.cnf {
position: absolute;
top: 66px;
right: 28px;
color: #fff;
cursor: pointer;
background: #333;
padding: 43px 6px;
border-radius: 5px;
}
.half {
padding: 6px 6px;
top: 64px;
}
.del {
position: absolute;
bottom: 8px;
right: 8px;
color: #fff;
cursor: pointer;
}
.check {
display: inline-block;
position: relative;
padding-bottom: 32px;
margin-bottom: 14px;
cursor: pointer;
text-align: center;
}
.schkl {
padding: 2px 70px 0px 35px;
margin-bottom: 0px;
}
.revchkl {
padding: 2px 0px 0px 35px;
margin-bottom: 0px;
}
.check input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.checkmark {
position: absolute;
bottom: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #333;
border-radius: 5px;
}
.schk {
top: 0;
}
.psv {
left: initial;
bottom: initial;
top: 0;
right: 0;
}
.psvl {
padding: 2px 35px 10px 0px;
margin-top: 10px;
margin-bottom: 0px;
}
.check:hover input ~ .checkmark {
background-color: #444;
}
.check input:checked ~ .checkmark {
background-color: #666;
}
.checkmark:after {
content: "";
position: absolute;
display: none;
}
.check input:checked ~ .checkmark:after {
display: block;
}
.check .checkmark:after {
left: 9px;
top: 5px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 3px 3px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.h {
font-size: 13px;
text-align: center;
color: #bbb;
}
.bp {
margin-bottom: 5px;
}
.seg {
position: relative;
display: inline-block;
padding: 8px;
margin: 10px;
width: 260px;
font-size: 19px;
background-color: #222;
color: white;
border: 0px solid white;
border-radius: 5px;
filter: drop-shadow(0px 0px 2px #000);
text-align: left;
}
.segin {
padding: 8px 8px 4px 8px;
display: none;
}
.expanded {
display: block;
}
@media all and (max-width: 645px) {
.top button {
width: 20%;
padding: 8px 0 4px 0;
}
.hd {
display: none;
}
#briwrap {
float: none;
}
}
</style>
</head>
<body onload="onLoad()">
<div id="cv" class="overlay">Loading WLED UI...</div>
<noscript><div class="overlay" style="opacity:1;">Sorry, WLED UI needs JavaScript!</div></noscript>
<div class="wrapper" id="top">
<div class="tab top">
<div class="btnwrap">
<button id="buttonPower" onclick="togglePower()" class="tgl"><i class="icons">&#xe08f;</i><p class="tab-label">Power</p></button>
<button id="buttonNl" onclick="toggleNl()"><i class="icons">&#xe2a2;</i><p class="tab-label">Timer</p></button>
<button id="buttonSync" onclick="toggleSync()"><i class="icons">&#xe116;</i><p class="tab-label">Sync</p></button>
<button id="buttonSr" onclick="toggleLiveview()"><i class="icons">&#xe410;</i><p class="tab-label">Preview</p></button>
<button onclick="window.location.href = '/settings';"><i class="icons">&#xe0a2;</i><p class="tab-label">Config</p></button>
</div>
<div id="briwrap">
<p class="hd">Brightness</p>
<div class="il">
<i class="icons slider-icon">&#xe2a6;</i>
<div class="sliderwrap il">
<input id="sliderBri" onchange="setBri()" oninput="updateTrail(this)" max="255" min="1" type="range" value="128" />
<div class="sliderdisplay"></div>
</div>
</div>
</div>
<iframe id="liveview" src="about:blank"></iframe>
</div>
</div>
<div class ="container">
<div id="Colors" class="tabcontent">
<div id="picker" class="noslide"></div>
<div id="wwrap">
<p class="labels">White channel</p>
<div class="sliderwrap il">
<input id="sliderW" class="noslide" onchange="setColor(false)" oninput="updateTrail(this)" max="255" min="0" type="range" value="128" />
<div class="sliderdisplay"></div>
</div>
</div>
<div class="qcs-w">
<div class="qcs" onclick="pC('#ff0000');" style="background-color:#ff0000;"></div>
<div class="qcs" onclick="pC('#ffa000');" style="background-color:#ffa000;"></div>
<div class="qcs" onclick="pC('#ffc800');" style="background-color:#ffc800;"></div>
<div class="qcs" onclick="pC('#fff0a0');" style="background-color:#fff0a0;"></div>
<div class="qcs" onclick="pC('#ffffff');" style="background-color:#ffffff;"></div>
<div class="qcs qcsb" onclick="pC('#000000');" style="background-color:#000000;"></div><br>
<div class="qcs" onclick="pC('#ff00ff');" style="background-color:#ff00ff;"></div>
<div class="qcs" onclick="pC('#0000ff');" style="background-color:#0000ff;"></div>
<div class="qcs" onclick="pC('#00ffc8');" style="background-color:#00ffc8;"></div>
<div class="qcs" onclick="pC('#08ff00');" style="background-color:#08ff00;"></div>
<div class="qcs" onclick="pC('rnd');" style="background-color:#333; padding: 4px 8px; transform: translateY(-10px);">R</div>
</div>
<div id="csl">
<button class="xxs cl btn" onclick="selectSlot(0);">1</button>
<button class="xxs cl btn" onclick="selectSlot(1);">2</button>
<button class="xxs cl btn" onclick="selectSlot(2);">3</button>
</div>
<p class="labels">Color palette</p>
<div class="il">
<i class="icons sel-icon">&#xe2b3;</i>
<select class="btn sel" id="selectPalette" onchange="setPalette()">
<option>Default</option>
<option>Error!</option>
</select>
</div>
</div>
<div id="Effects" class="tabcontent">
<p class="labels">Effect speed</p>
<div class="staytop">
<i class="icons slider-icon">&#xe325;</i>
<div class="sliderwrap il">
<input id="sliderSpeed" class="noslide" onchange="setSpeed()" oninput="updateTrail(this)" max="255" min="0" type="range" value="128" />
<div class="sliderdisplay"></div>
</div>
</div>
<p class="labels">Effect intensity</p>
<div class="staytop" id="staytop1">
<i class="icons slider-icon">&#xe409;</i>
<div class="sliderwrap il">
<input id="sliderIntensity" class="noslide" onchange="setIntensity()" oninput="updateTrail(this)" max="255" min="0" type="range" value="128" />
<div class="sliderdisplay"></div>
</div>
</div>
<p class="labels">Effect mode</p>
<div class="staytop" id="staytop2">
<button class="btn" id="fxb0" onclick="setX(0);">Solid</button>
</div>
<div id="fxlist">
Loading...
</div>
<br>
</div>
<div id="Segments" class="tabcontent">
<div id="segcont">
Loading...
</div>
<div id="segutil">
</div>
</div>
<div id="Favorites" class="tabcontent">
<p id="psLabel" class="labels">Load from slot</p>
<button class="xxs btn psts" onclick="setPreset(1);">1</button>
<button class="xxs btn psts" onclick="setPreset(2);">2</button>
<button class="xxs btn psts" onclick="setPreset(3);">3</button>
<button class="xxs btn psts" onclick="setPreset(4);">4</button><br>
<button class="xxs btn psts" onclick="setPreset(5);">5</button>
<button class="xxs btn psts" onclick="setPreset(6);">6</button>
<button class="xxs btn psts" onclick="setPreset(7);">7</button>
<button class="xxs btn psts" onclick="setPreset(8);">8</button><br>
<button class="xxs btn psts" onclick="setPreset(9);">9</button>
<button class="xxs btn psts" onclick="setPreset(10);">10</button>
<button class="xxs btn psts" onclick="setPreset(11);">11</button>
<button class="xxs btn psts" onclick="setPreset(12);">12</button><br>
<button class="xxs btn psts" onclick="setPreset(13);">13</button>
<button class="xxs btn psts" onclick="setPreset(14);">14</button>
<button class="xxs btn psts" onclick="setPreset(15);">15</button>
<button class="xxs btn psts" onclick="setPreset(16);">16</button><br>
<label class="check psvl">
Saving mode
<input type="checkbox" id="psToggle" onchange="togglePS()">
<span class="checkmark psv"></span>
</label><br>
<span class="h">Slot 16 can save all segments.</span><br><br>
<label class="check psvl">
Preset cycle
<input type="checkbox" id="cyToggle" onchange="toggleCY()">
<span class="checkmark psv"></span>
</label><br>
First preset: <input id="cycs" class="noslide" type="number" min="1" max="14" value="1"><br>
Last preset: <input id="cyce" class="noslide" type="number" min="2" max="15" value="3"><br>
Time per preset: <input id="cyct" class="noslide" type="number" min="0.2" max="65.5" step="0.1" value="1.2">s<br>
Transition: <input id="cyctt" class="noslide" type="number" min="0" max="65.5" step="0.1" value="0.7">s
</div>
</div>
<div class="tab bot" id="bot">
<button class="tablinks" onclick="openTab(0)"><i class="icons">&#xe2b3;</i><p class="tab-label">Colors</p></button>
<button class="tablinks" onclick="openTab(1)"><i class="icons">&#xe23d;</i><p class="tab-label">Effects</p></button>
<button class="tablinks" onclick="openTab(2)"><i class="icons">&#xe34b;</i><p class="tab-label">Segments</p></button>
<button class="tablinks" onclick="openTab(3)"><i class="icons">&#xe04c;</i><p class="tab-label">Favorites</p></button>
</div>
<div id="toast"></div>
<div id="namelabel"></div>
<script>
/*!
* iro.js v4.4.0
* 2016-2019 James Daniel
* Licensed under MPL 2.0
* github.com/jaames/iro.js
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.iro=e()}(this,function(){"use strict";var c=function(){},i={},h=[],u=[];function p(t,e){var o,n,r,i,s=arguments,a=u;for(i=arguments.length;2<i--;)h.push(s[i]);for(e&&null!=e.children&&(h.length||h.push(e.children),delete e.children);h.length;)if((n=h.pop())&&void 0!==n.pop)for(i=n.length;i--;)h.push(n[i]);else"boolean"==typeof n&&(n=null),(r="function"!=typeof t)&&(null==n?n="":"number"==typeof n?n=String(n):"string"!=typeof n&&(r=!1)),r&&o?a[a.length-1]+=n:a===u?a=[n]:a.push(n),o=r;var l=new c;return l.nodeName=t,l.children=a,l.attributes=null==e?void 0:e,l.key=null==e?void 0:e.key,l}function M(t,e){for(var o in e)t[o]=e[o];return t}function l(t,e){null!=t&&("function"==typeof t?t(e):t.current=e)}var e="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,f=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,o=[];function s(t){!t._dirty&&(t._dirty=!0)&&1==o.push(t)&&e(n)}function n(){for(var t;t=o.pop();)t._dirty&&I(t)}function S(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function E(t){var e=M({},t.attributes);e.children=t.children;var o=t.nodeName.defaultProps;if(void 0!==o)for(var n in o)void 0===e[n]&&(e[n]=o[n]);return e}function N(t){var e=t.parentNode;e&&e.removeChild(t)}function v(t,e,o,n,r){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)l(o,null),l(n,t);else if("class"!==e||r)if("style"===e){if(n&&"string"!=typeof n&&"string"!=typeof o||(t.style.cssText=n||""),n&&"object"==typeof n){if("string"!=typeof o)for(var i in o)i in n||(t.style[i]="");for(var i in n)t.style[i]="number"==typeof n[i]&&!1===f.test(i)?n[i]+"px":n[i]}}else if("dangerouslySetInnerHTML"===e)n&&(t.innerHTML=n.__html||"");else if("o"==e[0]&&"n"==e[1]){var s=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),n?o||t.addEventListener(e,d,s):t.removeEventListener(e,d,s),(t._listeners||(t._listeners={}))[e]=n}else if("list"!==e&&"type"!==e&&!r&&e in t){try{t[e]=null==n?"":n}catch(t){}null!=n&&!1!==n||"spellcheck"==e||t.removeAttribute(e)}else{var a=r&&e!==(e=e.replace(/^xlink:?/,""));null==n||!1===n?a?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof n&&(a?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),n):t.setAttribute(e,n))}else t.className=n||""}function d(t){return this._listeners[t.type](t)}var H=[],T=0,g=!1,_=!1;function P(){for(var t;t=H.shift();)t.componentDidMount&&t.componentDidMount()}function A(t,e,o,n,r,i){T++||(g=null!=r&&void 0!==r.ownerSVGElement,_=null!=t&&!("__preactattr_"in t));var s=U(t,e,o,n,i);return r&&s.parentNode!==r&&r.appendChild(s),--T||(_=!1,i||P()),s}function U(t,e,o,n,r){var i=t,s=g;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||r)?t.nodeValue!=e&&(t.nodeValue=e):(i=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(i,t),O(t,!0))),i.__preactattr_=!0,i;var a,l,c=e.nodeName;if("function"==typeof c)return function(t,e,o,n){var r=t&&t._component,i=r,s=t,a=r&&t._componentConstructor===e.nodeName,l=a,c=E(e);for(;r&&!l&&(r=r._parentComponent);)l=r.constructor===e.nodeName;r&&l&&(!n||r._component)?(j(r,c,3,o,n),t=r.base):(i&&!a&&(L(i),t=s=null),r=R(e.nodeName,c,o),t&&!r.nextBase&&(r.nextBase=t,s=null),j(r,c,1,o,n),t=r.base,s&&t!==s&&(s._component=null,O(s,!1)));return t}(t,e,o,n);if(g="svg"===c||"foreignObject"!==c&&g,c=String(c),(!t||!S(t,c))&&(a=c,(l=g?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,i=l,t)){for(;t.firstChild;)i.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(i,t),O(t,!0)}var h=i.firstChild,u=i.__preactattr_,p=e.children;if(null==u){u=i.__preactattr_={};for(var f=i.attributes,d=f.length;d--;)u[f[d].name]=f[d].value}return!_&&p&&1===p.length&&"string"==typeof p[0]&&null!=h&&void 0!==h.splitText&&null==h.nextSibling?h.nodeValue!=p[0]&&(h.nodeValue=p[0]):(p&&p.length||null!=h)&&function(t,e,o,n,r){var i,s,a,l,c,h=t.childNodes,u=[],p={},f=0,d=0,v=h.length,g=0,_=e?e.length:0;if(0!==v)for(var m=0;m<v;m++){var y=h[m],b=y.__preactattr_,w=_&&b?y._component?y._component.__key:b.key:null;null!=w?(f++,p[w]=y):(b||(void 0!==y.splitText?!r||y.nodeValue.trim():r))&&(u[g++]=y)}if(0!==_)for(var m=0;m<_;m++){l=e[m],c=null;var w=l.key;if(null!=w)f&&void 0!==p[w]&&(c=p[w],p[w]=void 0,f--);else if(d<g)for(i=d;i<g;i++)if(void 0!==u[i]&&(x=s=u[i],C=r,"string"==typeof(k=l)||"number"==typeof k?void 0!==x.splitText:"string"==typeof k.nodeName?!x._componentConstructor&&S(x,k.nodeName):C||x._componentConstructor===k.nodeName)){c=s,u[i]=void 0,i===g-1&&g--,i===d&&d++;break}c=U(c,l,o,n),a=h[m],c&&c!==t&&c!==a&&(null==a?t.appendChild(c):c===a.nextSibling?N(a):t.insertBefore(c,a))}var x,k,C;if(f)for(var m in p)void 0!==p[m]&&O(p[m],!1);for(;d<=g;)void 0!==(c=u[g--])&&O(c,!1)}(i,p,o,n,_||null!=u.dangerouslySetInnerHTML),function(t,e,o){var n;for(n in o)e&&null!=e[n]||null==o[n]||v(t,n,o[n],o[n]=void 0,g);for(n in e)"children"===n||"innerHTML"===n||n in o&&e[n]===("value"===n||"checked"===n?t[n]:o[n])||v(t,n,o[n],o[n]=e[n],g)}(i,e.attributes,u),g=s,i}function O(t,e){var o=t._component;o?L(o):(null!=t.__preactattr_&&l(t.__preactattr_.ref,null),!1!==e&&null!=t.__preactattr_||N(t),r(t))}function r(t){for(t=t.lastChild;t;){var e=t.previousSibling;O(t,!0),t=e}}var a=[];function R(t,e,o){var n,r=a.length;for(t.prototype&&t.prototype.render?(n=new t(e,o),y.call(n,e,o)):((n=new y(e,o)).constructor=t,n.render=m);r--;)if(a[r].constructor===t)return n.nextBase=a[r].nextBase,a.splice(r,1),n;return n}function m(t,e,o){return this.constructor(t,o)}function j(t,e,o,n,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,n)),n&&n!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=n),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==o&&(1!==o&&!1===i.syncComponentUpdates&&t.base?s(t):I(t,1,r)),l(t.__ref,t))}function I(t,e,o,n){if(!t._disable){var r,i,s,a=t.props,l=t.state,c=t.context,h=t.prevProps||a,u=t.prevState||l,p=t.prevContext||c,f=t.base,d=t.nextBase,v=f||d,g=t._component,_=!1,m=p;if(t.constructor.getDerivedStateFromProps&&(l=M(M({},l),t.constructor.getDerivedStateFromProps(a,l)),t.state=l),f&&(t.props=h,t.state=u,t.context=p,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(a,l,c)?_=!0:t.componentWillUpdate&&t.componentWillUpdate(a,l,c),t.props=a,t.state=l,t.context=c),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!_){r=t.render(a,l,c),t.getChildContext&&(c=M(M({},c),t.getChildContext())),f&&t.getSnapshotBeforeUpdate&&(m=t.getSnapshotBeforeUpdate(h,u));var y,b,w=r&&r.nodeName;if("function"==typeof w){var x=E(r);(i=g)&&i.constructor===w&&x.key==i.__key?j(i,x,1,c,!1):(y=i,t._component=i=R(w,x,c),i.nextBase=i.nextBase||d,i._parentComponent=t,j(i,x,0,c,!1),I(i,1,o,!0)),b=i.base}else s=v,(y=g)&&(s=t._component=null),(v||1===e)&&(s&&(s._component=null),b=A(s,r,c,o||!f,v&&v.parentNode,!0));if(v&&b!==v&&i!==g){var k=v.parentNode;k&&b!==k&&(k.replaceChild(b,v),y||(v._component=null,O(v,!1)))}if(y&&L(y),(t.base=b)&&!n){for(var C=t,S=t;S=S._parentComponent;)(C=S).base=b;b._component=C,b._componentConstructor=C.constructor}}for(!f||o?H.push(t):_||t.componentDidUpdate&&t.componentDidUpdate(h,u,m);t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);T||n||P()}}function L(t){var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var o=t._component;o?L(o):e&&(null!=e.__preactattr_&&l(e.__preactattr_.ref,null),N(t.nextBase=e),a.push(t),r(e)),l(t.__ref,null)}function y(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function b(t,e,o,n){void 0===n&&(n={});for(var r=0;r<e.length;r++)t.addEventListener(e[r],o,n)}function w(t,e,o,n){void 0===n&&(n={});for(var r=0;r<e.length;r++)t.removeEventListener(e[r],o,n)}M(y.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=M(M({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),s(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),I(this,2)},render:function(){}});var x="mousedown",k="mousemove",C="mouseup",D="touchstart",W="touchmove",B="touchend",t=function(e){function t(t){e.call(this,t),this.uid=(Math.random()+1).toString(36).substring(5)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.componentDidMount=function(){b(this.base,[x,D],this,{passive:!1})},t.prototype.componentWillUnmount=function(){w(this.base,[x,D],this)},t.prototype.handleEvent=function(t){t.preventDefault();var e=t.touches?t.changedTouches[0]:t,o=e.clientX,n=e.clientY,r=this.base.getBoundingClientRect();switch(t.type){case x:case D:b(document,[k,W,C,B],this,{passive:!1}),this.handleInput(o,n,r,"START");break;case k:case W:this.handleInput(o,n,r,"MOVE");break;case C:case B:this.handleInput(o,n,r,"END"),w(document,[k,W,C,B],this,{passive:!1})}},t}(y);function V(t){var e=window.navigator.userAgent,o=/^((?!chrome|android).)*safari/i.test(e),n=/iPhone|iPod|iPad/i.test(e),r=window.location;return o||n?r.protocol+"//"+r.host+r.pathname+r.search+t:t}function F(t,e,o,n,r){var i=r-n<=180?0:1;return n*=Math.PI/180,r*=Math.PI/180,"M "+(t+o*Math.cos(r))+" "+(e+o*Math.sin(r))+" A "+o+" "+o+" 0 "+i+" 0 "+(t+o*Math.cos(n))+" "+(e+o*Math.sin(n))}function $(t){var e=t.r,o=t.url;return p("svg",{class:"iro__handle",x:t.x,y:t.y,style:{overflow:"visible"}},o&&p("use",Object.assign({},{xlinkHref:V(o)},t.origin)),!o&&p("circle",{class:"iro__handle__inner",r:e,fill:"none","stroke-width":2,stroke:"#000"}),!o&&p("circle",{class:"iro__handle__outer",r:e-2,fill:"none","stroke-width":2,stroke:"#fff"}))}$.defaultProps={x:0,y:0,r:8,url:null,origin:{x:0,y:0}};var G=Array.apply(null,{length:360}).map(function(t,e){return e}),z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._transformAngle=function(t,e){var o=this.props.wheelAngle;return((t="clockwise"===this.props.wheelDirection?-360+t-(e?-o:o):o-t)%360+360)%360},e.prototype.render=function(t){var e=this,o=t.width,n=t.borderWidth,r=t.handleRadius,i=t.color.hsv,s=o/2-n,a=this._transformAngle(i.h,!0)*(Math.PI/180),l=i.s/100*(s-t.padding-r-n),c=s+n,h=s+n;return p("svg",{class:"iro__wheel",width:o,height:o,style:{overflow:"visible",display:"block"}},p("defs",null,p("radialGradient",{id:this.uid},p("stop",{offset:"0%","stop-color":"#fff"}),p("stop",{offset:"100%","stop-color":"#fff","stop-opacity":"0"}))),p("g",{class:"iro__wheel__hue","stroke-width":s,fill:"none"},G.map(function(t){return p("path",{key:t,d:F(c,h,s/2,t,t+1.5),stroke:"hsl("+e._transformAngle(t)+", 100%, 50%)"})})),p("circle",{class:"iro__wheel__saturation",cx:c,cy:h,r:s,fill:"url("+V("#"+this.uid)+")"}),t.wheelLightness&&p("circle",{class:"iro__wheel__lightness",cx:c,cy:h,r:s,fill:"#000",opacity:1-i.v/100}),p("circle",{class:"iro__wheel__border",cx:c,cy:h,r:s,fill:"none",stroke:t.borderColor,"stroke-width":n}),p($,{r:r,url:t.handleSvg,origin:t.handleOrigin,x:c+l*Math.cos(a),y:h+l*Math.sin(a)}))},e.prototype.handleInput=function(t,e,o,n){var r=o.left,i=o.top,s=this.props,a=s.width/2,l=a-s.padding-s.handleRadius-s.borderWidth;t=a-(t-r),e=a-(e-i);var c=Math.atan2(e,t),h=this._transformAngle(Math.round(c*(180/Math.PI))+180),u=Math.min(Math.sqrt(t*t+e*e),l);s.onInput(n,{h:h,s:Math.round(100/l*u)})},e}(t);function q(t,e){var o=-1<t.indexOf("%"),n=parseFloat(t);return o?e/100*n:n}function X(t){return parseInt(t,16)}function Y(t){return t.toString(16).padStart(2,"0")}var J="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",K="[\\s|\\(]+("+J+")[,|\\s]+("+J+")[,|\\s]+("+J+")\\s*\\)?",Q="[\\s|\\(]+("+J+")[,|\\s]+("+J+")[,|\\s]+("+J+")[,|\\s]+("+J+")\\s*\\)?",Z=new RegExp("rgb"+K),tt=new RegExp("rgba"+Q),et=new RegExp("hsl"+K),ot=new RegExp("hsla"+Q),nt="^(?:#?|0x?)",rt="([0-9a-fA-F]{1})",it="([0-9a-fA-F]{2})",st=new RegExp(""+nt+rt+rt+rt+"$"),at=new RegExp(""+nt+rt+rt+rt+rt+"$"),lt=new RegExp(""+nt+it+it+it+"$"),ct=new RegExp(""+nt+it+it+it+it+"$"),ht=function(t){this._onChange=!1,this._value={h:0,s:0,v:0,a:1},t&&this.set(t)},ut={hsv:{configurable:!0},rgb:{configurable:!0},hsl:{configurable:!0},rgbString:{configurable:!0},hexString:{configurable:!0},hslString:{configurable:!0}};ht.prototype.set=function(t){var e="string"==typeof t,o="object"==typeof t;if(e&&/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(t))this.hexString=t;else if(e&&/^rgba?/.test(t))this.rgbString=t;else if(e&&/^hsla?/.test(t))this.hslString=t;else if(o&&t instanceof ht)this.hsv=t.hsv;else if(o&&"r"in t&&"g"in t&&"b"in t)this.rgb=t;else if(o&&"h"in t&&"s"in t&&"v"in t)this.hsv=t;else{if(!(o&&"h"in t&&"s"in t&&"l"in t))throw new Error("invalid color value");this.hsl=t}},ht.prototype.setChannel=function(t,e,o){var n;this[t]=Object.assign({},this[t],((n={})[e]=o,n))},ht.prototype.clone=function(){return new ht(this)},ht.hsvToRgb=function(t){var e=t.h/60,o=t.s/100,n=t.v/100,r=Math.floor(e),i=e-r,s=n*(1-o),a=n*(1-i*o),l=n*(1-(1-i)*o),c=r%6;return{r:255*[n,a,s,s,l,n][c],g:255*[l,n,n,a,s,s][c],b:255*[s,s,l,n,n,a][c]}},ht.rgbToHsv=function(t){var e,o=t.r/255,n=t.g/255,r=t.b/255,i=Math.max(o,n,r),s=Math.min(o,n,r),a=i-s,l=i,c=0===i?0:a/i;switch(i){case s:e=0;break;case o:e=(n-r)/a+(n<r?6:0);break;case n:e=(r-o)/a+2;break;case r:e=(o-n)/a+4}return{h:60*e,s:100*c,v:100*l}},ht.hsvToHsl=function(t){var e=t.s/100,o=t.v/100,n=(2-e)*o,r=n<=1?n:2-n,i=r<1e-9?0:e*o/r;return{h:t.h,s:100*i,l:50*n}},ht.hslToHsv=function(t){var e=2*t.l,o=t.s*(e<=100?e:200-e)/100,n=e+o<1e-9?0:2*o/(e+o);return{h:t.h,s:100*n,v:(e+o)/2}},ut.hsv.get=function(){var t=this._value;return{h:t.h,s:t.s,v:t.v}},ut.hsv.set=function(t){var e=this._value;if(t=Object.assign({},e,t),this._onChange){var o={};for(var n in e)o[n]=t[n]!=e[n];this._value=t,(o.h||o.s||o.v||o.a)&&this._onChange(this,o)}else this._value=t},ut.rgb.get=function(){var t=ht.hsvToRgb(this._value),e=t.r,o=t.g,n=t.b;return{r:Math.round(e),g:Math.round(o),b:Math.round(n)}},ut.rgb.set=function(t){this.hsv=Object.assign({},ht.rgbToHsv(t),{a:void 0===t.a?1:t.a})},ut.hsl.get=function(){var t=ht.hsvToHsl(this._value),e=t.h,o=t.s,n=t.l;return{h:Math.round(e),s:Math.round(o),l:Math.round(n)}},ut.hsl.set=function(t){this.hsv=Object.assign({},ht.hslToHsv(t),{a:void 0===t.a?1:t.a})},ut.rgbString.get=function(){var t=this.rgb;return"rgb("+t.r+", "+t.g+", "+t.b+")"},ut.rgbString.set=function(t){var e,o,n,r,i=1;if((e=Z.exec(t))?(o=q(e[1],255),n=q(e[2],255),r=q(e[3],255)):(e=tt.exec(t))&&(o=q(e[1],255),n=q(e[2],255),r=q(e[3],255),i=q(e[4],1)),!e)throw new Error("invalid rgb string");this.rgb={r:o,g:n,b:r,a:i}},ut.hexString.get=function(){var t=this.rgb;return"#"+Y(t.r)+Y(t.g)+Y(t.b)},ut.hexString.set=function(t){var e,o,n,r,i=255;if((e=st.exec(t))?(o=17*X(e[1]),n=17*X(e[2]),r=17*X(e[3])):(e=at.exec(t))?(o=17*X(e[1]),n=17*X(e[2]),r=17*X(e[3]),i=17*X(e[4])):(e=lt.exec(t))?(o=X(e[1]),n=X(e[2]),r=X(e[3])):(e=ct.exec(t))&&(o=X(e[1]),n=X(e[2]),r=X(e[3]),i=X(e[4])),!e)throw new Error("invalid hex string");this.rgb={r:o,g:n,b:r,a:i/255}},ut.hslString.get=function(){var t=this.hsl;return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},ut.hslString.set=function(t){var e,o,n,r,i=1;if((e=et.exec(t))?(o=q(e[1],360),n=q(e[2],100),r=q(e[3],100)):(e=ot.exec(t))&&(o=q(e[1],360),n=q(e[2],100),r=q(e[3],100),i=q(e[4],1)),!e)throw new Error("invalid hsl string");this.hsl={h:o,s:n,l:r,a:i}},Object.defineProperties(ht.prototype,ut);var pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.renderGradient=function(t){var e=t.color.hsv,o=[];switch(t.sliderType){case"hue":o=[{offset:"0",color:"#f00"},{offset:"16.666",color:"#ff0"},{offset:"33.333",color:"#0f0"},{offset:"50",color:"#0ff"},{offset:"66.666",color:"#00f"},{offset:"83.333",color:"#f0f"},{offset:"100",color:"#f00"}];break;case"saturation":var n=ht.hsvToHsl({h:e.h,s:0,v:e.v}),r=ht.hsvToHsl({h:e.h,s:100,v:e.v});o=[{offset:"0",color:"hsl("+n.h+", "+n.s+"%, "+n.l+"%)"},{offset:"100",color:"hsl("+r.h+", "+r.s+"%, "+r.l+"%)"}];break;case"value":default:var i=ht.hsvToHsl({h:e.h,s:e.s,v:100});o=[{offset:"0",color:"#000"},{offset:"100",color:"hsl("+i.h+", "+i.s+"%, "+i.l+"%)"}]}return p("linearGradient",{id:this.uid},o.map(function(t){return p("stop",{offset:t.offset+"%","stop-color":t.color})}))},e.prototype.render=function(t){var e=t.width,o=t.sliderHeight,n=t.borderWidth,r=t.handleRadius;o=o||2*t.padding+2*r+2*n,this.width=e;var i,s=(this.height=o)/2,a=e-2*s,l=t.color.hsv;switch(t.sliderType){case"hue":i=l.h/=3.6;break;case"saturation":i=l.s;break;case"value":default:i=l.v}return p("svg",{class:"iro__slider",width:e,height:o,style:{marginTop:t.sliderMargin,overflow:"visible",display:"block"}},p("defs",null,this.renderGradient(t)),p("rect",{class:"iro__slider__value",rx:s,ry:s,x:n/2,y:n/2,width:e-n,height:o-n,"stroke-width":n,stroke:t.borderColor,fill:"url("+V("#"+this.uid)+")"}),p($,{r:r,url:t.handleSvg,origin:t.handleOrigin,x:s+i/100*a,y:o/2}))},e.prototype.getValueFromPoint=function(t,e,o){var n=o.left,r=this.width-this.height;t-=n+this.height/2;var i=Math.max(Math.min(t,r),0);return Math.round(100/r*i)},e.prototype.handleInput=function(t,e,o,n){var r,i,s=this.getValueFromPoint(t,e,o);switch(this.props.sliderType){case"hue":i="h",s*=3.6;break;case"saturation":i="s";break;case"value":default:i="v"}this.props.onInput(n,((r={})[i]=s,r))},e}(t);var ft=function(e){function i(t){e.call(this,t),this.emitHook("init:before"),this._events={},this._deferredEvents={},this._colorUpdateActive=!1,this._colorUpdateSrc=null,this.color=new ht(t.color),this.deferredEmit("color:init",this.color,{h:!1,s:!1,v:!1,a:!1}),this.color._onChange=this.updateColor.bind(this),this.state=Object.assign({},t,{color:this.color}),this.emitHook("init:state"),t.layout?this.layout=t.layout:this.layout=[{component:z,options:{}},{component:pt,options:{}}],this.emitHook("init:after")}return e&&(i.__proto__=e),((i.prototype=Object.create(e&&e.prototype)).constructor=i).prototype.on=function(t,e){var o=this,n=this._events;(Array.isArray(t)?t:[t]).forEach(function(t){o.emitHook("event:on",t,e),(n[t]||(n[t]=[])).push(e),o._deferredEvents[t]&&(o._deferredEvents[t].forEach(function(t){e.apply(null,t)}),o._deferredEvents[t]=[])})},i.prototype.off=function(t,o){var n=this;(Array.isArray(t)?t:[t]).forEach(function(t){var e=n._events[t];n.emitHook("event:off",t,o),e&&e.splice(e.indexOf(o),1)})},i.prototype.emit=function(t){for(var e,o=[],n=arguments.length-1;0<n--;)o[n]=arguments[n+1];(e=this).emitHook.apply(e,[t].concat(o));for(var r=this._events[t]||[],i=0;i<r.length;i++)r[i].apply(null,o)},i.prototype.deferredEmit=function(t){for(var e,o=[],n=arguments.length-1;0<n--;)o[n]=arguments[n+1];var r=this._deferredEvents;(e=this).emit.apply(e,[t].concat(o)),(r[t]||(r[t]=[])).push(o)},i.prototype.resize=function(t){this.setState({width:t})},i.prototype.reset=function(){this.color.set(this.props.color)},i.addHook=function(t,e){var o=i.pluginHooks;(o[t]||(o[t]=[])).push(e)},i.prototype.emitHook=function(t){for(var e=[],o=arguments.length-1;0<o--;)e[o]=arguments[o+1];for(var n=i.pluginHooks[t]||[],r=0;r<n.length;r++)n[r].apply(this,e)},i.prototype.onMount=function(t){this.el=t,this.deferredEmit("mount",this)},i.prototype.updateColor=function(t,e){this.emitHook("color:beforeUpdate",t,e),this.setState({color:t}),this.emitHook("color:afterUpdate",t,e),this._colorUpdateActive||(this._colorUpdateActive=!0,"input"==this._colorUpdateSrc&&this.emit("input:change",t,e),this.emit("color:change",t,e),this._colorUpdateActive=!1)},i.prototype.handleInput=function(t,e){"START"===t&&this.emit("input:start",this.color),"MOVE"===t&&this.emit("input:move",this.color),this._colorUpdateSrc="input",this.color.hsv=e,"END"===t&&this.emit("input:end",this.color),this._colorUpdateSrc=null},i.prototype.render=function(t,n){var r=this;return p("div",{class:"iro__colorPicker",style:{display:n.display,width:n.width}},this.layout.map(function(t){var e=t.component,o=t.options;return p(e,Object.assign({},n,o,{onInput:function(t,e){return r.handleInput(t,e)},parent:r}))}))},i}(y);ft.pluginHooks={},ft.defaultProps={width:300,height:300,handleRadius:8,handleSvg:null,handleOrigin:{x:0,y:0},color:"#fff",borderColor:"#fff",borderWidth:0,display:"block",wheelLightness:!0,wheelAngle:0,wheelDirection:"anticlockwise",sliderHeight:null,sliderMargin:12,padding:6,layout:null};var dt,vt,gt,_t,mt=((vt=function(e,t){var o,n,r,i=null,s=document.createElement("div");return o=p(dt,Object.assign({},{ref:function(t){return i=t}},t)),A(n,o,{},!1,s,!1),r=function(){var t=e instanceof Element?e:document.querySelector(e);t.appendChild(i.base),i.onMount(t)},"loading"!==document.readyState?r():b(document,["DOMContentLoaded"],r),i}).prototype=(dt=ft).prototype,Object.assign(vt,dt),vt.__component=dt,vt);return _t=[],(gt={Color:ht,ColorPicker:mt,ui:{h:p,Component:t,Handle:$,Slider:pt,Wheel:z},util:{resolveUrl:V,createArcPath:F,parseUnit:q,parseHexInt:X,intToHex:Y},version:"4.4.0"}).use=function(t,e){void 0===e&&(e={}),-1<_t.indexOf(t)||(t(gt,e),_t.push(t))},gt.installedPlugins=_t,gt});
/*!
* RangeTouch v2.0
* https://github.com/sampotts/rangetouch
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("RangeTouch",t):e.RangeTouch=t()}(this,function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var t={addCSS:!0,thumbWidth:15,watch:!0};var n=function(e){return null!=e?e.constructor:null},r=function(e,t){return!!(e&&t&&e instanceof t)},u=function(e){return null==e},i=function(e){return n(e)===Object},o=function(e){return n(e)===String},a=function(e){return Array.isArray(e)},c=function(e){return r(e,NodeList)},l={nullOrUndefined:u,object:i,number:function(e){return n(e)===Number&&!Number.isNaN(e)},string:o,boolean:function(e){return n(e)===Boolean},function:function(e){return n(e)===Function},array:a,nodeList:c,element:function(e){return r(e,Element)},event:function(e){return r(e,Event)},empty:function(e){return u(e)||(o(e)||a(e)||c(e))&&!e.length||i(e)&&!Object.keys(e).length}};function s(e,t){if(1>t){var n=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(n))}return Math.round(e/t)*t}return function(){function n(e,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,n),l.element(e)?this.element=e:l.string(e)&&(this.element=document.querySelector(e)),l.element(this.element)&&l.empty(this.element.rangeTouch)&&(this.config=Object.assign({},t,r),this.init())}return r=n,i=[{key:"setup",value:function(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},u=null;if(l.empty(e)||l.string(e)?u=Array.from(document.querySelectorAll(l.string(e)?e:'input[type="range"]')):l.element(e)?u=[e]:l.nodeList(e)?u=Array.from(e):l.array(e)&&(u=e.filter(l.element)),l.empty(u))return null;var i=Object.assign({},t,r);l.string(e)&&i.watch&&new MutationObserver(function(t){Array.from(t).forEach(function(t){Array.from(t.addedNodes).forEach(function(t){l.element(t)&&function(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}(t,e)&&new n(t,i)})})}).observe(document.body,{childList:!0,subtree:!0});return u.map(function(e){return new n(e,r)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}],(u=[{key:"init",value:function(){n.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){n.enabled&&(this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,n=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(e){t.element[n](e,function(e){return t.set(e)},!1)})}},{key:"get",value:function(e){if(!n.enabled||!l.event(e))return null;var t,r=e.target,u=e.changedTouches[0],i=parseFloat(r.getAttribute("min"))||0,o=parseFloat(r.getAttribute("max"))||100,a=parseFloat(r.getAttribute("step"))||1,c=r.getBoundingClientRect(),f=100/c.width*(this.config.thumbWidth/2)/100;return 0>(t=100/c.width*(u.clientX-c.left))?t=0:100<t&&(t=100),50>t?t-=(100-2*t)*f:50<t&&(t+=2*(t-50)*f),i+s(t/100*(o-i),a)}},{key:"set",value:function(e){n.enabled&&l.event(e)&&!e.target.disabled&&(e.preventDefault(),e.target.value=this.get(e),function(e,t){if(e&&t){var n=new Event(t);e.dispatchEvent(n)}}(e.target,"touchend"===e.type?"change":"input"))}}])&&e(r.prototype,u),i&&e(r,i),n;var r,u,i}()});
//page js
var ps = false, noNewSegs = false;
var isOn = false, nlA = false, isLv = false, syncSend = false, syncTglRecv = true, isRgbw = false;
var whites = [0,0,0];
var expanded = [false];
var nlDur = 60;
var selectedFx = 0;
var csel = 0;
var savedPresets = 0;
var currentPreset = -1;
var lastUpdate = 0;
var segCount = 0, ledCount = 0, lowestUnused = 0, maxSeg = 0;
var d = document;
const ranges = RangeTouch.setup('input[type="range"]', {});
var cpick = new iro.ColorPicker("#picker", {
width: 260,
wheelLightness: false
});
function handleVisibilityChange() {
if (!document.hidden && new Date () - lastUpdate > 3000) {
requestJson({}, true);
}
}
function onLoad() {
size();
var cd = d.getElementById('csl').children;
for (i = 0; i < cd.length; i++) {
cd[i].style.backgroundColor = "rgb(0, 0, 0)";
}
selectSlot(0);
updateTablinks(0);
resetUtil();
cpick.on("input:end", function() {
setColor(true);
});
setTimeout(requestJson, 25);
d.addEventListener("visibilitychange", handleVisibilityChange, false);
d.getElementById("cv").style.opacity=0;
}
function updateTablinks(tabI)
{
tablinks = d.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
tablinks[tabI].className += " active";
}
function openTab(tabI) {
var i, tabcontent, tablinks;
iSlide = tabI;
_C.classList.toggle('smooth', false);
_C.style.setProperty('--i', iSlide);
updateTablinks(tabI);
}
var timeout;
function showToast(text, error = false) {
var x = d.getElementById("toast");
x.innerHTML = text;
x.className = error ? "error":"show";
clearTimeout(timeout);
x.style.animation = 'none';
x.offsetHeight;
x.style.animation = null;
timeout = setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2900);
}
function showErrorToast() {
showToast('Connection to light failed. Please refresh the page. If the issue persists, reboot your ESP.', true);
}
function clearErrorToast() {
d.getElementById("toast").className = d.getElementById("toast").className.replace("error", "");
}
function populateSegments(s)
{
var cn = "";
segCount = 0, lowestUnused = 0;
for (y in s.seg)
{
segCount++;
var inst=s.seg[y];
var i = parseInt(inst.id);
if (i == lowestUnused) lowestUnused = i+1;
cn += `<div class="seg">
<label class="check schkl">
Segment ${i}
<input type="checkbox" id="seg${i}sel" onchange="selSeg(${i})" ${inst.sel ? "checked":""}>
<span class="checkmark schk"></span>
</label>
<i class="icons slider-icon flr ${expanded[i] ? "exp":""}" id="sege${i}" onclick="expand(${i})">&#xe395;</i>
<div class="segin ${expanded[i] ? "expanded":""}" id="seg${i}">
<table>
<tr>
<td>Start LED</td>
<td>Stop LED</td>
</tr>
<tr>
<td><input class="noslide segn" id="seg${i}s" type="number" min="0" max="${ledCount-1}" value="${inst.start}" oninput="updateLen(${i})"></td>
<td><input class="noslide segn" id="seg${i}e" type="number" min="0" max="${ledCount}" value="${inst.stop}" oninput="updateLen(${i})"></td>
</tr>
</table>
<table>
<tr>
<td>Grouping</td>
<td>Spacing</td>
</tr>
<tr>
<td><input class="noslide segn" id="seg${i}grp" type="number" min="1" max="255" value="${inst.grp}" oninput="updateLen(${i})"></td>
<td><input class="noslide segn" id="seg${i}spc" type="number" min="0" max="255" value="${inst.spc}" oninput="updateLen(${i})"></td>
</tr>
</table>
<div class="h bp" id="seg${i}len">${inst.stop - inst.start} LED${inst.stop - inst.start > 1 ? "s":""} (${Math.ceil((inst.stop - inst.start)/(inst.grp + inst.spc))} virtual)</div>
<i class="icons slider-icon cnf" id="segc${i}" onclick="setSeg(${i})">&#xe390;</i>
<i class="icons slider-icon del" id="segd${i}" onclick="delSeg(${i})">&#xe037;</i>
<label class="check revchkl">
Reverse direction
<input type="checkbox" id="seg${i}rev" onchange="setRev(${i})" ${inst.rev ? "checked":""}>
<span class="checkmark schk"></span>
</label>
</div>
</div><br>`;
}
d.getElementById('segcont').innerHTML = cn;
if (lowestUnused >= maxSeg) {
d.getElementById('segutil').innerHTML = '<span class="h">Maximum number of segments reached.</span>';
noNewSegs = true;
} else if (noNewSegs) {
resetUtil();
noNewSegs = false;
}
}
function updateTrail(e)
{
var progress = e.value *100 /255;
progress = parseInt(progress);
var val = `linear-gradient(90deg, white ${progress}%, #444 ${progress}%)`;
e.parentNode.getElementsByClassName('sliderdisplay')[0].style.background = val;
}
function updateLen(s)
{
var start = parseInt(d.getElementById(`seg${s}s`).value);
var stop = parseInt(d.getElementById(`seg${s}e`).value);
var len = stop - start;
var out = "(delete)"
if (len > 1) {
out = `${len} LEDs`;
} else if (len == 1) {
out = "1 LED"
}
if (d.getElementById(`seg${s}grp`) != null)
{
var grp = parseInt(d.getElementById(`seg${s}grp`).value);
var spc = parseInt(d.getElementById(`seg${s}spc`).value);
if (grp == 0) grp = 1;
var virt = Math.ceil(len/(grp + spc));
if (!isNaN(virt) && (grp > 1 || spc > 0)) out += ` (${virt} virtual)`;
}
d.getElementById(`seg${s}len`).innerHTML = out;
}
function updateUI()
{
d.getElementById('buttonPower').className = (isOn) ? "active":"";
d.getElementById('buttonNl').className = (nlA) ? "active":"";
d.getElementById('buttonSync').className = (syncSend) ? "active":"";
d.getElementById('fxb' + selectedFx).style.backgroundColor = "#666";
updateTrail(d.getElementById('sliderBri'));
updateTrail(d.getElementById('sliderSpeed'));
updateTrail(d.getElementById('sliderIntensity'));
updateTrail(d.getElementById('sliderW'));
if (isRgbw) d.getElementById('wwrap').style.display = "block";
var btns = document.getElementsByClassName("psts");
for (i = 0; i < btns.length; i++) {
btns[i].className = btns[i].className.replace(" active", "");
if ((savedPresets >> i) & 0x01) btns[i].className += " stored";
}
if (currentPreset > 0 && currentPreset <= btns.length) btns[currentPreset -1].className += " active";
spal = d.getElementById("selectPalette");
spal.style.backgroundColor = (spal.selectedIndex > 0) ? "#666":"#333";
}
function compare(a, b) {
if (a.name < b.name){
return -1;
}
return 1;
}
var jsonTimeout;
function requestJson(command, verbose = true) {
lastUpdate = new Date();
if (!jsonTimeout) jsonTimeout = setTimeout(showErrorToast, 3000);
var req = null;
e1 = d.getElementById('fxlist');
e2 = d.getElementById('selectPalette');
url = command ? 'http://10.10.1.26/json/state':'http://10.10.1.26/json';
type = command ? 'post':'get';
if (command)
{
command.v = verbose;
req = JSON.stringify(command);
}
fetch
(url, {
method: type,
headers: {
"Content-type": "application/json; charset=UTF-8"
},
body: req
})
.then(res => {
if (!res.ok) {
showErrorToast();
}
return res.json();
})
.then(json => {
clearTimeout(jsonTimeout);
jsonTimeout = null;
clearErrorToast();
if (!json) showToast('Empty response', true);
if (json.success) return;
var s = json;
if (!command) {
var x='',y='<option value="0">Default</option>';
json.effects.shift(); //remove solid
for (i in json.effects) json.effects[i] = {"id": parseInt(i)+1, "name":json.effects[i]};
json.effects.sort(compare);
for (i in json.effects) {
x += '<button class="btn" id="fxb'+ json.effects[i].id +'" onclick="setX('+ json.effects[i].id +');">'+ json.effects[i].name +'</button><br>';
}
json.palettes.shift(); //remove default
for (i in json.palettes) json.palettes[i] = {"id": parseInt(i)+1, "name":json.palettes[i]};
json.palettes.sort(compare);
for (i in json.palettes) {
y += '<option value="'+json.palettes[i].id+'">'+json.palettes[i].name+'</option>';
}
e1.innerHTML=x; e2.innerHTML=y;
var info = json.info;
var name = info.name;
d.getElementById('namelabel').innerHTML = name;
if (name === "Dinnerbone") d.documentElement.style.transform = "rotate(180deg)";
if (info.live) name = "(Live) " + name;
d.title = name;
isRgbw = info.leds.wv;
ledCount = info.leds.count;
syncTglRecv = info.str;
maxSeg = info.leds.maxseg;
s = json.state;
}
isOn = s.on;
d.getElementById('sliderBri').value= s.bri;
nlA = s.nl.on;
nlDur = s.nl.dur;
syncSend = s.udpn.send;
savedPresets = s.pss;
currentPreset = s.ps;
d.getElementById('cyToggle').checked = (s.pl < 0) ? false : true;
d.getElementById('cycs').value = s.ccnf.min;
d.getElementById('cyce').value = s.ccnf.max;
d.getElementById('cyct').value = s.ccnf.time /10;
d.getElementById('cyctt').value = s.transition /10;
var selc=0; var ind=0;
populateSegments(s);
for (i in s.seg)
{
if(s.seg[i].sel) {selc = ind; break;} ind++;
}
var i=s.seg[selc];
if (!i) {
showToast('No Segments!', true);
updateUI();
return;
}
var cd = d.getElementById('csl').children;
for (e = 2; e >= 0; e--)
{
cd[e].style.backgroundColor = "rgb(" + i.col[e][0] + "," + i.col[e][1] + "," + i.col[e][2] + ")";
if (isRgbw) whites[e] = i.col[e][3];
selectSlot(csel);
}
d.getElementById('sliderSpeed').value = whites[csel];
d.getElementById('sliderSpeed').value = i.sx;
d.getElementById('sliderIntensity').value = i.ix;
d.getElementById('fxb' + selectedFx).style.backgroundColor = "#333";
selectedFx = i.fx;
e2.value = i.pal;
if (!command) d.getElementById('Effects').scrollTop = d.getElementById('fxb' + selectedFx).offsetTop - d.getElementById('Effects').clientHeight/1.8;
if (s.error) showToast('WLED error ' + s.error, true);
updateUI();
})
.catch(function (error) {
showToast(error, true);
})
}
function togglePower() {
isOn = !isOn;
var obj = {"on": isOn};
obj.transition = parseInt(d.getElementById('cyctt').value*10);
requestJson(obj);
}
function toggleNl() {
nlA = !nlA;
if (nlA)
{
showToast('Nightlight active. Your light will turn off after ' + nlDur + ' minutes.');
} else {
showToast('Nightlight deactivated.');
}
var obj = {"nl": {"on": nlA}};
requestJson(obj);
}
function toggleSync() {
syncSend = !syncSend;
if (syncSend)
{
showToast('Other lights in the network will now sync to this one.');
} else {
showToast('This light and other lights in the network will no longer sync.');
}
var obj = {"udpn": {"send": syncSend}};
if (syncTglRecv) obj.udpn.recv = syncSend;
requestJson(obj);
}
function toggleLiveview() {
isLv = !isLv;
d.getElementById('liveview').style.display = (isLv) ? "block":"none";
d.getElementById('liveview').src = (isLv) ? "/liveview":"about:blank";
d.getElementById('buttonSr').className = (isLv) ? "active":"";
}
function makeSeg() {
var ns = 0;
if (lowestUnused > 0) {
var pend = d.getElementById(`seg${lowestUnused -1}e`).value;
if (pend < ledCount) ns = pend;
}
var cn = `<div class="seg">
<label>
Segment ${lowestUnused} (new)
</label>
<div class="segin expanded">
<table>
<tr>
<td>Start LED</td>
<td>Stop LED</td>
</tr>
<tr>
<td><input class="noslide segn" id="seg${lowestUnused}s" type="number" min="0" max="${ledCount-1}" value="${ns}" oninput="updateLen(${lowestUnused})"></td>
<td><input class="noslide segn" id="seg${lowestUnused}e" type="number" min="0" max="${ledCount}" value="${ledCount}" oninput="updateLen(${lowestUnused})"></td>
</tr>
</table>
<div class="h" id="seg${lowestUnused}len">${ledCount - ns} LEDs</div>
<i class="icons slider-icon cnf half" id="segc${lowestUnused}" onclick="setSeg(${lowestUnused}); resetUtil();">&#xe390;</i>
</div>
</div>`;
d.getElementById('segutil').innerHTML = cn;
}
function resetUtil() {
var cn = `<button class="btn btn-i rect" onclick="makeSeg()"><i class="icons btn-icon">&#xe18a;</i>Add segment</button><br>`;
d.getElementById('segutil').innerHTML = cn;
}
function selSeg(s){
var sel = d.getElementById(`seg${s}sel`).checked;
var obj = {"seg": {"id": s, "sel": sel}};
requestJson(obj);
}
function setSeg(s){
var start = parseInt(d.getElementById(`seg${s}s`).value);
var stop = parseInt(d.getElementById(`seg${s}e`).value);
if (stop <= start) {delSeg(s); return;};
var obj = {"seg": {"id": s, "start": start, "stop": stop}};
if (d.getElementById(`seg${s}grp`))
{
var grp = parseInt(d.getElementById(`seg${s}grp`).value);
var spc = parseInt(d.getElementById(`seg${s}spc`).value);
obj.seg.grp = grp;
obj.seg.spc = spc;
}
requestJson(obj);
}
function delSeg(s){
if (segCount < 2) {
showToast("You need to have multiple segments in order to delete one.");
return;
}
expanded[s] = false;
segCount--;
var obj = {"seg": {"id": s, "stop": 0}};
requestJson(obj);
}
function setRev(s){
var rev = d.getElementById(`seg${s}rev`).checked;
var obj = {"seg": {"id": s, "rev": rev}};
requestJson(obj);
}
function setX(ind) {
var obj = {"seg": {"fx": parseInt(ind)}};
requestJson(obj);
}
function setPalette()
{
var obj = {"seg": {"pal": parseInt(d.getElementById('selectPalette').value)}};
requestJson(obj);
}
function setBri() {
var obj = {"bri": parseInt(d.getElementById('sliderBri').value)};
obj.transition = parseInt(d.getElementById('cyctt').value*10);
requestJson(obj);
}
function setSpeed() {
var obj = {"seg": {"sx": parseInt(d.getElementById('sliderSpeed').value)}};
requestJson(obj);
}
function setIntensity() {
var obj = {"seg": {"ix": parseInt(d.getElementById('sliderIntensity').value)}};
requestJson(obj);
}
function toggleCY() {
var obj = {"pl" : -1};
if (d.getElementById('cyToggle').checked)
{
obj = {"pl": 0, "ccnf": {"min": parseInt(d.getElementById('cycs').value), "max": parseInt(d.getElementById('cyce').value), "time": parseInt(d.getElementById('cyct').value*10)}};
obj.transition = parseInt(d.getElementById('cyctt').value*10);
}
requestJson(obj);
}
function togglePS() {
ps = !ps;
var btns = document.getElementsByClassName("psts");
for (i = 0; i < btns.length; i++) {
if (ps) {
btns[i].className += " saving";
} else {
btns[i].className = btns[i].className.replace(" saving", "");
}
}
d.getElementById("psLabel").innerHTML = (ps) ? "Save to slot":"Load from slot";
}
function setPreset(i) {
var obj = {"ps": i}
if ((savedPresets >> (i-1)) & 0x01) {
showToast("Loading config from slot " + i +".");
} else {
showToast("Slot " + i +" is empty! Use saving mode to save the current config to it.");
}
if (ps) {
obj = {"psave": i};
showToast("Saving config to slot " + i +".");
}
requestJson(obj);
}
function selectSlot(b) {
csel = b;
var cd = d.getElementById('csl').children;
for (i = 0; i < cd.length; i++) {
cd[i].style.border="2px solid white";
cd[i].style.margin="5px";
cd[i].style.width="42px";
}
cd[csel].style.border="5px solid white";
cd[csel].style.margin="2px";
cd[csel].style.width="50px";
if (cpick.color.rgbString !== cd[csel].style.backgroundColor) {
cpick.color.set(cd[csel].style.backgroundColor);
}
d.getElementById('sliderW').value = whites[csel];
updateTrail(d.getElementById('sliderW'));
}
var lasth = 0;
function pC(col)
{
if (col == "rnd")
{
col = {h: 0, s: 0, v: 100};
col.s = Math.floor((Math.random() * 50) + 50);
do {
col.h = Math.floor(Math.random() * 360);
} while (Math.abs(col.h - lasth) < 50);
lasth = col.h;
}
cpick.color.set(col);
setColor(false);
}
function setColor(fromPicker) {
var cd = d.getElementById('csl').children;
if (fromPicker && cd[csel].style.backgroundColor == 'rgb(0, 0, 0)') cpick.color.setChannel('hsv', 'v', 100);
cd[csel].style.backgroundColor = cpick.color.rgbString;
whites[csel] = d.getElementById('sliderW').value;
var col = cpick.color.rgb;
var obj = {"seg": {"col": [[col.r, col.g, col.b, whites[csel]],[],[]]}};
if (csel == 1) {
obj = {"seg": {"col": [[],[col.r, col.g, col.b, whites[csel]],[]]}};
} else if (csel == 2) {
obj = {"seg": {"col": [[],[],[col.r, col.g, col.b, whites[csel]]]}};
}
obj.transition = parseInt(d.getElementById('cyctt').value*10);
if (d.getElementById('selectPalette').value > 5) {
d.getElementById('selectPalette').value = 0;
obj.seg.pal = 0;
}
requestJson(obj);
}
function expand(i)
{
expanded[i] = !expanded[i];
d.getElementById('seg' +i).style.display = (expanded[i]) ? "block":"none";
d.getElementById('sege' +i).style.transform = (expanded[i]) ? "rotate(180deg)":"rotate(0deg)"
}
function unfocusSliders() {
d.getElementById("sliderBri").blur();
d.getElementById("sliderSpeed").blur();
d.getElementById("sliderIntensity").blur();
}
//sliding UI
const _C = document.querySelector('.container'), N = 4;
let iSlide = 0, x0 = null, y0 = null, scrollS = 0, locked = false, w;
function unify(e) { return e.changedTouches ? e.changedTouches[0] : e }
function lock(e) {
var l = e.target.classList;
if (l.contains('noslide') || l.contains('iro__wheel__saturation') || l.contains('iro__slider__value') || l.contains('iro__slider')) return;
x0 = unify(e).clientX;
y0 = unify(e).clientY;
scrollS = d.getElementsByClassName("tabcontent")[iSlide].scrollTop;
_C.classList.toggle('smooth', !(locked = true))
}
function drag(e) {
if (!locked) return;
if (d.getElementsByClassName("tabcontent")[iSlide].scrollTop != scrollS) {
move(e); return;
}
//if (Math.abs(unify(e).clientX - x0) > Math.abs(unify(e).clientY - y0)) {
//if (e.cancelable) e.preventDefault();
//}
_C.style.setProperty('--tx', `${Math.round(unify(e).clientX - x0)}px`)
}
function move(e) {
if(!locked) return;
var dx = unify(e).clientX - x0, s = Math.sign(dx),
f = +(s*dx/w).toFixed(2);
if((iSlide > 0 || s < 0) && (iSlide < N - 1 || s > 0) && f > .12) {
_C.style.setProperty('--i', iSlide -= s);
f = 1 - f;
updateTablinks(iSlide);
}
_C.style.setProperty('--tx', '0px');
_C.style.setProperty('--f', f);
_C.classList.toggle('smooth', !(locked = false));
x0 = null
}
function size() {
w = window.innerWidth;
_C.style.setProperty('--tp', d.getElementById('top').clientHeight + "px");
_C.style.setProperty('--bt', d.getElementById('bot').clientHeight + "px");
}
size();
_C.style.setProperty('--n', N);
window.addEventListener('resize', size, false);
_C.addEventListener('mousedown', lock, false);
_C.addEventListener('touchstart', lock, false);
_C.addEventListener('mousemove', drag, false);
_C.addEventListener('touchmove', drag, false);
_C.addEventListener('mouseout', move, false);
_C.addEventListener('mouseup', move, false);
_C.addEventListener('touchend', move, false);
</script>
</body>
</html>