UNPKG

203 kBJavaScriptView Raw
1/**
2 * vis-graph3d
3 * https://visjs.github.io/vis-graph3d/
4 *
5 * Create interactive, animated 3d graphs. Surfaces, lines, dots and block styling out of the box.
6 *
7 * @version 6.0.2
8 * @date 2021-08-22T15:02:30.974Z
9 *
10 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
11 * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
12 *
13 * @license
14 * vis.js is dual licensed under both
15 *
16 * 1. The Apache 2.0 License
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * and
20 *
21 * 2. The MIT License
22 * http://opensource.org/licenses/MIT
23 *
24 * vis.js may be distributed under either license.
25 */
26!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vis=t.vis||{})}(this,(function(t){"use strict";var e=Math.ceil,n=Math.floor,r=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)},i={},o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function s(t,e){return t(e={exports:{}},e.exports),e.exports}function l(t){return t&&t.default||t}var u,c,h=function(t){return t&&t.Math==Math&&t},f=h("object"==typeof globalThis&&globalThis)||h("object"==typeof window&&window)||h("object"==typeof self&&self)||h("object"==typeof o&&o)||function(){return this}()||Function("return this")(),d=function(t){return"function"==typeof t?t:void 0},p=function(t,e){return arguments.length<2?d(i[t])||d(f[t]):i[t]&&i[t][e]||f[t]&&f[t][e]},v=p("navigator","userAgent")||"",y=f.process,m=f.Deno,g=y&&y.versions||m&&m.version,b=g&&g.v8;b?c=(u=b.split("."))[0]<4?1:u[0]+u[1]:v&&(!(u=v.match(/Edge\/(\d+)/))||u[1]>=74)&&(u=v.match(/Chrome\/(\d+)/))&&(c=u[1]);var _=c&&+c,x=function(t){try{return!!t()}catch(t){return!0}},w=!!Object.getOwnPropertySymbols&&!x((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&_&&_<41})),k=w&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,C=k?function(t){return"symbol"==typeof t}:function(t){var e=p("Symbol");return"function"==typeof e&&Object(t)instanceof e},E=function(t){if(C(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},S=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},T=function(t){return function(e,n){var i,o,a=E(S(e)),s=r(n),l=a.length;return s<0||s>=l?t?"":void 0:(i=a.charCodeAt(s))<55296||i>56319||s+1===l||(o=a.charCodeAt(s+1))<56320||o>57343?t?a.charAt(s):i:t?a.slice(s,s+2):o-56320+(i-55296<<10)+65536}},A={codeAt:T(!1),charAt:T(!0)},O="__core-js_shared__",P=f[O]||function(t,e){try{Object.defineProperty(f,t,{value:e,configurable:!0,writable:!0})}catch(n){f[t]=e}return e}(O,{}),D=Function.toString;"function"!=typeof P.inspectSource&&(P.inspectSource=function(t){return D.call(t)});var L,M,F,R=P.inspectSource,I=f.WeakMap,j="function"==typeof I&&/native code/.test(R(I)),z=function(t){return"object"==typeof t?null!==t:"function"==typeof t},B=!x((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),N=f.document,W=z(N)&&z(N.createElement),Y=function(t){return W?N.createElement(t):{}},G=!B&&!x((function(){return 7!=Object.defineProperty(Y("div"),"a",{get:function(){return 7}}).a})),V=function(t){if(!z(t))throw TypeError(String(t)+" is not an object");return t},X=s((function(t){(t.exports=function(t,e){return P[t]||(P[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.1",mode:"pure",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),H=function(t){return Object(S(t))},U={}.hasOwnProperty,q=Object.hasOwn||function(t,e){return U.call(H(t),e)},Z=0,$=Math.random(),Q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++Z+$).toString(36)},K=X("wks"),J=f.Symbol,tt=k?J:J&&J.withoutSetter||Q,et=function(t){return q(K,t)&&(w||"string"==typeof K[t])||(w&&q(J,t)?K[t]=J[t]:K[t]=tt("Symbol."+t)),K[t]},nt=et("toPrimitive"),rt=function(t,e){if(!z(t)||C(t))return t;var n,r=t[nt];if(void 0!==r){if(void 0===e&&(e="default"),n=r.call(t,e),!z(n)||C(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var n,r;if("string"===e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!z(r=n.call(t)))return r;if("string"!==e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}(t,e)},it=function(t){var e=rt(t,"string");return C(e)?e:String(e)},ot=Object.defineProperty,at={f:B?ot:function(t,e,n){if(V(t),e=it(e),V(n),G)try{return ot(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},st=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},lt=B?function(t,e,n){return at.f(t,e,st(1,n))}:function(t,e,n){return t[e]=n,t},ut=X("keys"),ct=function(t){return ut[t]||(ut[t]=Q(t))},ht={},ft="Object already initialized",dt=f.WeakMap;if(j||P.state){var pt=P.state||(P.state=new dt),vt=pt.get,yt=pt.has,mt=pt.set;L=function(t,e){if(yt.call(pt,t))throw new TypeError(ft);return e.facade=t,mt.call(pt,t,e),e},M=function(t){return vt.call(pt,t)||{}},F=function(t){return yt.call(pt,t)}}else{var gt=ct("state");ht[gt]=!0,L=function(t,e){if(q(t,gt))throw new TypeError(ft);return e.facade=t,lt(t,gt,e),e},M=function(t){return q(t,gt)?t[gt]:{}},F=function(t){return q(t,gt)}}var bt,_t,xt,wt={set:L,get:M,has:F,enforce:function(t){return F(t)?M(t):L(t,{})},getterFor:function(t){return function(e){var n;if(!z(e)||(n=M(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},kt={}.propertyIsEnumerable,Ct=Object.getOwnPropertyDescriptor,Et={f:Ct&&!kt.call({1:2},1)?function(t){var e=Ct(this,t);return!!e&&e.enumerable}:kt},St={}.toString,Tt=function(t){return St.call(t).slice(8,-1)},At="".split,Ot=x((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==Tt(t)?At.call(t,""):Object(t)}:Object,Pt=function(t){return Ot(S(t))},Dt=Object.getOwnPropertyDescriptor,Lt={f:B?Dt:function(t,e){if(t=Pt(t),e=it(e),G)try{return Dt(t,e)}catch(t){}if(q(t,e))return st(!Et.f.call(t,e),t[e])}},Mt=/#|\.prototype\./,Ft=function(t,e){var n=It[Rt(t)];return n==zt||n!=jt&&("function"==typeof e?x(e):!!e)},Rt=Ft.normalize=function(t){return String(t).replace(Mt,".").toLowerCase()},It=Ft.data={},jt=Ft.NATIVE="N",zt=Ft.POLYFILL="P",Bt=Ft,Nt=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Wt=function(t,e,n){if(Nt(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}},Yt=Lt.f,Gt=function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e},Vt=function(t,e){var n,r,o,a,s,l,u,c,h=t.target,d=t.global,p=t.stat,v=t.proto,y=d?f:p?f[h]:(f[h]||{}).prototype,m=d?i:i[h]||(i[h]={}),g=m.prototype;for(o in e)n=!Bt(d?o:h+(p?".":"#")+o,t.forced)&&y&&q(y,o),s=m[o],n&&(l=t.noTargetGet?(c=Yt(y,o))&&c.value:y[o]),a=n&&l?l:e[o],n&&typeof s==typeof a||(u=t.bind&&n?Wt(a,f):t.wrap&&n?Gt(a):v&&"function"==typeof a?Wt(Function.call,a):a,(t.sham||a&&a.sham||s&&s.sham)&&lt(u,"sham",!0),m[o]=u,v&&(q(i,r=h+"Prototype")||lt(i,r,{}),i[r][o]=a,t.real&&g&&!g[o]&&lt(g,o,a)))},Xt=!x((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ht=ct("IE_PROTO"),Ut=Object.prototype,qt=Xt?Object.getPrototypeOf:function(t){return t=H(t),q(t,Ht)?t[Ht]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ut:null},Zt=et("iterator"),$t=!1;[].keys&&("next"in(xt=[].keys())?(_t=qt(qt(xt)))!==Object.prototype&&(bt=_t):$t=!0);var Qt=null==bt||x((function(){var t={};return bt[Zt].call(t)!==t}));Qt&&(bt={}),Qt&&!q(bt,Zt)&&lt(bt,Zt,(function(){return this}));var Kt,Jt={IteratorPrototype:bt,BUGGY_SAFARI_ITERATORS:$t},te=Math.min,ee=function(t){return t>0?te(r(t),9007199254740991):0},ne=Math.max,re=Math.min,ie=function(t,e){var n=r(t);return n<0?ne(n+e,0):re(n,e)},oe=function(t){return function(e,n,r){var i,o=Pt(e),a=ee(o.length),s=ie(r,a);if(t&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((t||s in o)&&o[s]===n)return t||s||0;return!t&&-1}},ae={includes:oe(!0),indexOf:oe(!1)},se=ae.indexOf,le=function(t,e){var n,r=Pt(t),i=0,o=[];for(n in r)!q(ht,n)&&q(r,n)&&o.push(n);for(;e.length>i;)q(r,n=e[i++])&&(~se(o,n)||o.push(n));return o},ue=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ce=Object.keys||function(t){return le(t,ue)},he=B?Object.defineProperties:function(t,e){V(t);for(var n,r=ce(e),i=r.length,o=0;i>o;)at.f(t,n=r[o++],e[n]);return t},fe=p("document","documentElement"),de=ct("IE_PROTO"),pe=function(){},ve=function(t){return"<script>"+t+"</"+"script>"},ye=function(t){t.write(ve("")),t.close();var e=t.parentWindow.Object;return t=null,e},me=function(){try{Kt=new ActiveXObject("htmlfile")}catch(t){}me=document.domain&&Kt?ye(Kt):function(){var t,e=Y("iframe");if(e.style)return e.style.display="none",fe.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(ve("document.F=Object")),t.close(),t.F}()||ye(Kt);for(var t=ue.length;t--;)delete me.prototype[ue[t]];return me()};ht[de]=!0;var ge=Object.create||function(t,e){var n;return null!==t?(pe.prototype=V(t),n=new pe,pe.prototype=null,n[de]=t):n=me(),void 0===e?n:he(n,e)},be={};be[et("toStringTag")]="z";var _e="[object z]"===String(be),xe=et("toStringTag"),we="Arguments"==Tt(function(){return arguments}()),ke=_e?Tt:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),xe))?n:we?Tt(e):"Object"==(r=Tt(e))&&"function"==typeof e.callee?"Arguments":r},Ce=_e?{}.toString:function(){return"[object "+ke(this)+"]"},Ee=at.f,Se=et("toStringTag"),Te=function(t,e,n,r){if(t){var i=n?t:t.prototype;q(i,Se)||Ee(i,Se,{configurable:!0,value:e}),r&&!_e&&lt(i,"toString",Ce)}},Ae={},Oe=Jt.IteratorPrototype,Pe=function(){return this},De=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return V(n),function(t){if(!z(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),Le=function(t,e,n,r){r&&r.enumerable?t[e]=n:lt(t,e,n)},Me=Jt.IteratorPrototype,Fe=Jt.BUGGY_SAFARI_ITERATORS,Re=et("iterator"),Ie="keys",je="values",ze="entries",Be=function(){return this},Ne=function(t,e,n,r,i,o,a){!function(t,e,n){var r=e+" Iterator";t.prototype=ge(Oe,{next:st(1,n)}),Te(t,r,!1,!0),Ae[r]=Pe}(n,e,r);var s,l,u,c=function(t){if(t===i&&v)return v;if(!Fe&&t in d)return d[t];switch(t){case Ie:case je:case ze:return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+" Iterator",f=!1,d=t.prototype,p=d[Re]||d["@@iterator"]||i&&d[i],v=!Fe&&p||c(i),y="Array"==e&&d.entries||p;if(y&&(s=qt(y.call(new t)),Me!==Object.prototype&&s.next&&(Te(s,h,!0,!0),Ae[h]=Be)),i==je&&p&&p.name!==je&&(f=!0,v=function(){return p.call(this)}),a&&d[Re]!==v&&lt(d,Re,v),Ae[e]=v,i)if(l={values:c(je),keys:o?v:c(Ie),entries:c(ze)},a)for(u in l)(Fe||f||!(u in d))&&Le(d,u,l[u]);else Vt({target:e,proto:!0,forced:Fe||f},l);return l},We=A.charAt,Ye="String Iterator",Ge=wt.set,Ve=wt.getterFor(Ye);Ne(String,"String",(function(t){Ge(this,{type:Ye,string:E(t),index:0})}),(function(){var t,e=Ve(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=We(n,r),e.index+=t.length,{value:t,done:!1})}));var Xe=function(t){var e=t.return;if(void 0!==e)return V(e.call(t)).value},He=function(t,e,n,r){try{return r?e(V(n)[0],n[1]):e(n)}catch(e){throw Xe(t),e}},Ue=et("iterator"),qe=Array.prototype,Ze=function(t){return void 0!==t&&(Ae.Array===t||qe[Ue]===t)},$e=function(t,e,n){var r=it(e);r in t?at.f(t,r,st(0,n)):t[r]=n},Qe=et("iterator"),Ke=function(t){if(null!=t)return t[Qe]||t["@@iterator"]||Ae[ke(t)]},Je=et("iterator"),tn=!1;try{var en=0,nn={next:function(){return{done:!!en++}},return:function(){tn=!0}};nn[Je]=function(){return this},Array.from(nn,(function(){throw 2}))}catch(t){}var rn=!function(t,e){if(!e&&!tn)return!1;var n=!1;try{var r={};r[Je]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){Array.from(t)}));Vt({target:"Array",stat:!0,forced:rn},{from:function(t){var e,n,r,i,o,a,s=H(t),l="function"==typeof this?this:Array,u=arguments.length,c=u>1?arguments[1]:void 0,h=void 0!==c,f=Ke(s),d=0;if(h&&(c=Wt(c,u>2?arguments[2]:void 0,2)),null==f||l==Array&&Ze(f))for(n=new l(e=ee(s.length));e>d;d++)a=h?c(s[d],d):s[d],$e(n,d,a);else for(o=(i=f.call(s)).next,n=new l;!(r=o.call(i)).done;d++)a=h?He(i,c,[r.value,d],!0):r.value,$e(n,d,a);return n.length=d,n}});var on=i.Array.from,an=on,sn="Array Iterator",ln=wt.set,un=wt.getterFor(sn);Ne(Array,"Array",(function(t,e){ln(this,{type:sn,target:Pt(t),index:0,kind:e})}),(function(){var t=un(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),Ae.Arguments=Ae.Array;var cn=Ke,hn=et("toStringTag");for(var fn in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var dn=f[fn],pn=dn&&dn.prototype;pn&&ke(pn)!==hn&&lt(pn,hn,fn),Ae[fn]=Ae.Array}var vn=cn,yn=Array.isArray||function(t){return"Array"==Tt(t)},mn=ue.concat("length","prototype"),gn={f:Object.getOwnPropertyNames||function(t){return le(t,mn)}},bn=gn.f,_n={}.toString,xn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],wn={f:function(t){return xn&&"[object Window]"==_n.call(t)?function(t){try{return bn(t)}catch(t){return xn.slice()}}(t):bn(Pt(t))}},kn={f:Object.getOwnPropertySymbols},Cn={f:et},En=at.f,Sn=function(t){var e=i.Symbol||(i.Symbol={});q(e,t)||En(e,t,{value:Cn.f(t)})},Tn=et("species"),An=function(t,e){return new(function(t){var e;return yn(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!yn(e.prototype)?z(e)&&null===(e=e[Tn])&&(e=void 0):e=void 0),void 0===e?Array:e}(t))(0===e?0:e)},On=[].push,Pn=function(t){var e=1==t,n=2==t,r=3==t,i=4==t,o=6==t,a=7==t,s=5==t||o;return function(l,u,c,h){for(var f,d,p=H(l),v=Ot(p),y=Wt(u,c,3),m=ee(v.length),g=0,b=h||An,_=e?b(l,m):n||a?b(l,0):void 0;m>g;g++)if((s||g in v)&&(d=y(f=v[g],g,p),t))if(e)_[g]=d;else if(d)switch(t){case 3:return!0;case 5:return f;case 6:return g;case 2:On.call(_,f)}else switch(t){case 4:return!1;case 7:On.call(_,f)}return o?-1:r||i?i:_}},Dn={forEach:Pn(0),map:Pn(1),filter:Pn(2),some:Pn(3),every:Pn(4),find:Pn(5),findIndex:Pn(6),filterReject:Pn(7)},Ln=Dn.forEach,Mn=ct("hidden"),Fn="Symbol",Rn=et("toPrimitive"),In=wt.set,jn=wt.getterFor(Fn),zn=Object.prototype,Bn=f.Symbol,Nn=p("JSON","stringify"),Wn=Lt.f,Yn=at.f,Gn=wn.f,Vn=Et.f,Xn=X("symbols"),Hn=X("op-symbols"),Un=X("string-to-symbol-registry"),qn=X("symbol-to-string-registry"),Zn=X("wks"),$n=f.QObject,Qn=!$n||!$n.prototype||!$n.prototype.findChild,Kn=B&&x((function(){return 7!=ge(Yn({},"a",{get:function(){return Yn(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=Wn(zn,e);r&&delete zn[e],Yn(t,e,n),r&&t!==zn&&Yn(zn,e,r)}:Yn,Jn=function(t,e){var n=Xn[t]=ge(Bn.prototype);return In(n,{type:Fn,tag:t,description:e}),B||(n.description=e),n},tr=function(t,e,n){t===zn&&tr(Hn,e,n),V(t);var r=it(e);return V(n),q(Xn,r)?(n.enumerable?(q(t,Mn)&&t[Mn][r]&&(t[Mn][r]=!1),n=ge(n,{enumerable:st(0,!1)})):(q(t,Mn)||Yn(t,Mn,st(1,{})),t[Mn][r]=!0),Kn(t,r,n)):Yn(t,r,n)},er=function(t,e){V(t);var n=Pt(e),r=ce(n).concat(or(n));return Ln(r,(function(e){B&&!nr.call(n,e)||tr(t,e,n[e])})),t},nr=function(t){var e=it(t),n=Vn.call(this,e);return!(this===zn&&q(Xn,e)&&!q(Hn,e))&&(!(n||!q(this,e)||!q(Xn,e)||q(this,Mn)&&this[Mn][e])||n)},rr=function(t,e){var n=Pt(t),r=it(e);if(n!==zn||!q(Xn,r)||q(Hn,r)){var i=Wn(n,r);return!i||!q(Xn,r)||q(n,Mn)&&n[Mn][r]||(i.enumerable=!0),i}},ir=function(t){var e=Gn(Pt(t)),n=[];return Ln(e,(function(t){q(Xn,t)||q(ht,t)||n.push(t)})),n},or=function(t){var e=t===zn,n=Gn(e?Hn:Pt(t)),r=[];return Ln(n,(function(t){!q(Xn,t)||e&&!q(zn,t)||r.push(Xn[t])})),r};if(w||(Le((Bn=function(){if(this instanceof Bn)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?E(arguments[0]):void 0,e=Q(t),n=function(t){this===zn&&n.call(Hn,t),q(this,Mn)&&q(this[Mn],e)&&(this[Mn][e]=!1),Kn(this,e,st(1,t))};return B&&Qn&&Kn(zn,e,{configurable:!0,set:n}),Jn(e,t)}).prototype,"toString",(function(){return jn(this).tag})),Le(Bn,"withoutSetter",(function(t){return Jn(Q(t),t)})),Et.f=nr,at.f=tr,Lt.f=rr,gn.f=wn.f=ir,kn.f=or,Cn.f=function(t){return Jn(et(t),t)},B&&Yn(Bn.prototype,"description",{configurable:!0,get:function(){return jn(this).description}})),Vt({global:!0,wrap:!0,forced:!w,sham:!w},{Symbol:Bn}),Ln(ce(Zn),(function(t){Sn(t)})),Vt({target:Fn,stat:!0,forced:!w},{for:function(t){var e=E(t);if(q(Un,e))return Un[e];var n=Bn(e);return Un[e]=n,qn[n]=e,n},keyFor:function(t){if(!C(t))throw TypeError(t+" is not a symbol");if(q(qn,t))return qn[t]},useSetter:function(){Qn=!0},useSimple:function(){Qn=!1}}),Vt({target:"Object",stat:!0,forced:!w,sham:!B},{create:function(t,e){return void 0===e?ge(t):er(ge(t),e)},defineProperty:tr,defineProperties:er,getOwnPropertyDescriptor:rr}),Vt({target:"Object",stat:!0,forced:!w},{getOwnPropertyNames:ir,getOwnPropertySymbols:or}),Vt({target:"Object",stat:!0,forced:x((function(){kn.f(1)}))},{getOwnPropertySymbols:function(t){return kn.f(H(t))}}),Nn){var ar=!w||x((function(){var t=Bn();return"[null]"!=Nn([t])||"{}"!=Nn({a:t})||"{}"!=Nn(Object(t))}));Vt({target:"JSON",stat:!0,forced:ar},{stringify:function(t,e,n){for(var r,i=[t],o=1;arguments.length>o;)i.push(arguments[o++]);if(r=e,(z(e)||void 0!==t)&&!C(t))return yn(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!C(e))return e}),i[1]=e,Nn.apply(null,i)}})}Bn.prototype[Rn]||lt(Bn.prototype,Rn,Bn.prototype.valueOf),Te(Bn,Fn),ht[Mn]=!0;var sr=i.Object.getOwnPropertySymbols,lr=Lt.f,ur=x((function(){lr(1)}));Vt({target:"Object",stat:!0,forced:!B||ur,sham:!B},{getOwnPropertyDescriptor:function(t,e){return lr(Pt(t),e)}});var cr=s((function(t){var e=i.Object,n=t.exports=function(t,n){return e.getOwnPropertyDescriptor(t,n)};e.getOwnPropertyDescriptor.sham&&(n.sham=!0)})),hr=p("Reflect","ownKeys")||function(t){var e=gn.f(V(t)),n=kn.f;return n?e.concat(n(t)):e};Vt({target:"Object",stat:!0,sham:!B},{getOwnPropertyDescriptors:function(t){for(var e,n,r=Pt(t),i=Lt.f,o=hr(r),a={},s=0;o.length>s;)void 0!==(n=i(r,e=o[s++]))&&$e(a,e,n);return a}});var fr=i.Object.getOwnPropertyDescriptors;Vt({target:"Object",stat:!0,forced:!B,sham:!B},{defineProperties:he});var dr=s((function(t){var e=i.Object,n=t.exports=function(t,n){return e.defineProperties(t,n)};e.defineProperties.sham&&(n.sham=!0)}));Vt({target:"Object",stat:!0,forced:!B,sham:!B},{defineProperty:at.f});var pr=s((function(t){var e=i.Object,n=t.exports=function(t,n,r){return e.defineProperty(t,n,r)};e.defineProperty.sham&&(n.sham=!0)})),vr=pr,yr=a(s((function(t){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0}))),mr=pr,gr=a(s((function(t){function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),mr(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t},t.exports.default=t.exports,t.exports.__esModule=!0}))),br=a(s((function(t){t.exports=function(t,e,n){return e in t?mr(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0})));Vt({target:"Array",stat:!0},{isArray:yn});var _r=i.Array.isArray,xr=_r,wr=s((function(t){t.exports=function(t){if(xr(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0}));a(wr);var kr=et("species"),Cr=function(t){return _>=51||!x((function(){var e=[];return(e.constructor={})[kr]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Er=et("isConcatSpreadable"),Sr=9007199254740991,Tr="Maximum allowed index exceeded",Ar=_>=51||!x((function(){var t=[];return t[Er]=!1,t.concat()[0]!==t})),Or=Cr("concat"),Pr=function(t){if(!z(t))return!1;var e=t[Er];return void 0!==e?!!e:yn(t)};Vt({target:"Array",proto:!0,forced:!Ar||!Or},{concat:function(t){var e,n,r,i,o,a=H(this),s=An(a,0),l=0;for(e=-1,r=arguments.length;e<r;e++)if(Pr(o=-1===e?a:arguments[e])){if(l+(i=ee(o.length))>Sr)throw TypeError(Tr);for(n=0;n<i;n++,l++)n in o&&$e(s,l,o[n])}else{if(l>=Sr)throw TypeError(Tr);$e(s,l++,o)}return s.length=l,s}});var Dr=Object.freeze({__proto__:null});Sn("asyncIterator");var Lr=Object.freeze({__proto__:null});Sn("hasInstance"),Sn("isConcatSpreadable"),Sn("iterator"),Sn("match"),Sn("matchAll"),Sn("replace"),Sn("search"),Sn("species"),Sn("split"),Sn("toPrimitive"),Sn("toStringTag"),Sn("unscopables"),Te(f.JSON,"JSON",!0);var Mr=Object.freeze({__proto__:null}),Fr=Object.freeze({__proto__:null});l(Dr),l(Lr),l(Mr),l(Fr);var Rr=i.Symbol;Sn("asyncDispose"),Sn("dispose"),Sn("matcher"),Sn("metadata"),Sn("observable"),Sn("patternMatch"),Sn("replaceAll");var Ir=Rr,jr=s((function(t){t.exports=function(t,e){var n=null==t?null:void 0!==Ir&&vn(t)||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0}));a(jr);var zr=Cr("slice"),Br=et("species"),Nr=[].slice,Wr=Math.max;Vt({target:"Array",proto:!0,forced:!zr},{slice:function(t,e){var n,r,i,o=Pt(this),a=ee(o.length),s=ie(t,a),l=ie(void 0===e?a:e,a);if(yn(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!yn(n.prototype)?z(n)&&null===(n=n[Br])&&(n=void 0):n=void 0,n===Array||void 0===n))return Nr.call(o,s,l);for(r=new(void 0===n?Array:n)(Wr(l-s,0)),i=0;s<l;s++,i++)s in o&&$e(r,i,o[s]);return r.length=i,r}});var Yr=function(t){return i[t+"Prototype"]},Gr=Yr("Array").slice,Vr=Array.prototype,Xr=function(t){var e=t.slice;return t===Vr||t instanceof Array&&e===Vr.slice?Gr:e},Hr=Xr,Ur=on,qr=s((function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},t.exports.default=t.exports,t.exports.__esModule=!0}));a(qr);var Zr=s((function(t){t.exports=function(t,e){var n;if(t){if("string"==typeof t)return qr(t,e);var r=Hr(n=Object.prototype.toString.call(t)).call(n,8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Ur(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qr(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0}));a(Zr);var $r=s((function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0}));a($r);var Qr=a(s((function(t){t.exports=function(t,e){return wr(t)||jr(t,e)||Zr(t,e)||$r()},t.exports.default=t.exports,t.exports.__esModule=!0}))),Kr=Cn.f("iterator"),Jr=Kr,ti=s((function(t){function e(n){return"function"==typeof Ir&&"symbol"==typeof Jr?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Ir&&t.constructor===Ir&&t!==Ir.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0})),ei=a(ti),ni=s((function(t){t.exports=function(t){if(xr(t))return qr(t)},t.exports.default=t.exports,t.exports.__esModule=!0}));a(ni);var ri=s((function(t){t.exports=function(t){if(void 0!==Ir&&null!=vn(t)||null!=t["@@iterator"])return Ur(t)},t.exports.default=t.exports,t.exports.__esModule=!0}));a(ri);var ii=s((function(t){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0}));a(ii);var oi=a(s((function(t){t.exports=function(t){return ni(t)||ri(t)||Zr(t)||ii()},t.exports.default=t.exports,t.exports.__esModule=!0}))),ai=Rr,si=Yr("Array").concat,li=Array.prototype,ui=function(t){var e=t.concat;return t===li||t instanceof Array&&e===li.concat?si:e},ci=Xr;Vt({target:"Reflect",stat:!0},{ownKeys:hr});var hi=i.Reflect.ownKeys,fi=_r,di=Dn.map,pi=Cr("map");Vt({target:"Array",proto:!0,forced:!pi},{map:function(t){return di(this,t,arguments.length>1?arguments[1]:void 0)}});var vi=Yr("Array").map,yi=Array.prototype,mi=function(t){var e=t.map;return t===yi||t instanceof Array&&e===yi.map?vi:e},gi=x((function(){ce(1)}));Vt({target:"Object",stat:!0,forced:gi},{keys:function(t){return ce(H(t))}});var bi=i.Object.keys;Vt({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}});var _i=i.Date.now,xi=[].slice,wi={},ki=function(t,e,n){if(!(e in wi)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";wi[e]=Function("C,a","return new C("+r.join(",")+")")}return wi[e](t,n)},Ci=Function.bind||function(t){var e=Nt(this),n=xi.call(arguments,1),r=function(){var i=n.concat(xi.call(arguments));return this instanceof r?ki(e,i.length,i):e.apply(t,i)};return z(e.prototype)&&(r.prototype=e.prototype),r};Vt({target:"Function",proto:!0},{bind:Ci});var Ei=Yr("Function").bind,Si=Function.prototype,Ti=function(t){var e=t.bind;return t===Si||t instanceof Function&&e===Si.bind?Ei:e},Ai=function(t,e){var n=[][t];return!!n&&x((function(){n.call(null,e||function(){throw 1},1)}))},Oi=Dn.forEach,Pi=Ai("forEach")?[].forEach:function(t){return Oi(this,t,arguments.length>1?arguments[1]:void 0)};Vt({target:"Array",proto:!0,forced:[].forEach!=Pi},{forEach:Pi});var Di=Yr("Array").forEach,Li=Array.prototype,Mi={DOMTokenList:!0,NodeList:!0},Fi=function(t){var e=t.forEach;return t===Li||t instanceof Array&&e===Li.forEach||Mi.hasOwnProperty(ke(t))?Di:e},Ri=[].reverse,Ii=[1,2];Vt({target:"Array",proto:!0,forced:String(Ii)===String(Ii.reverse())},{reverse:function(){return yn(this)&&(this.length=this.length),Ri.call(this)}});var ji=Yr("Array").reverse,zi=Array.prototype,Bi=function(t){var e=t.reverse;return t===zi||t instanceof Array&&e===zi.reverse?ji:e},Ni=Cr("splice"),Wi=Math.max,Yi=Math.min,Gi=9007199254740991,Vi="Maximum allowed length exceeded";Vt({target:"Array",proto:!0,forced:!Ni},{splice:function(t,e){var n,i,o,a,s,l,u=H(this),c=ee(u.length),h=ie(t,c),f=arguments.length;if(0===f?n=i=0:1===f?(n=0,i=c-h):(n=f-2,i=Yi(Wi(r(e),0),c-h)),c+n-i>Gi)throw TypeError(Vi);for(o=An(u,i),a=0;a<i;a++)(s=h+a)in u&&$e(o,a,u[s]);if(o.length=i,n<i){for(a=h;a<c-i;a++)l=a+n,(s=a+i)in u?u[l]=u[s]:delete u[l];for(a=c;a>c-i+n;a--)delete u[a-1]}else if(n>i)for(a=c-i;a>h;a--)l=a+n-1,(s=a+i-1)in u?u[l]=u[s]:delete u[l];for(a=0;a<n;a++)u[a+h]=arguments[a+2];return u.length=c-i+n,o}});var Xi=Yr("Array").splice,Hi=Array.prototype,Ui=function(t){var e=t.splice;return t===Hi||t instanceof Array&&e===Hi.splice?Xi:e},qi=Object.assign,Zi=Object.defineProperty,$i=!qi||x((function(){if(B&&1!==qi({b:1},qi(Zi({},"a",{enumerable:!0,get:function(){Zi(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=qi({},t)[n]||ce(qi({},e)).join("")!=r}))?function(t,e){for(var n=H(t),r=arguments.length,i=1,o=kn.f,a=Et.f;r>i;)for(var s,l=Ot(arguments[i++]),u=o?ce(l).concat(o(l)):ce(l),c=u.length,h=0;c>h;)s=u[h++],B&&!a.call(l,s)||(n[s]=l[s]);return n}:qi;Vt({target:"Object",stat:!0,forced:Object.assign!==$i},{assign:$i});var Qi=i.Object.assign,Ki=ae.includes;Vt({target:"Array",proto:!0},{includes:function(t){return Ki(this,t,arguments.length>1?arguments[1]:void 0)}});var Ji=Yr("Array").includes,to=et("match"),eo=function(t){if(function(t){var e;return z(t)&&(void 0!==(e=t[to])?!!e:"RegExp"==Tt(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},no=et("match");Vt({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[no]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~E(S(this)).indexOf(E(eo(t)),arguments.length>1?arguments[1]:void 0)}});var ro=Yr("String").includes,io=Array.prototype,oo=String.prototype,ao=function(t){var e=t.includes;return t===io||t instanceof Array&&e===io.includes?Ji:"string"==typeof t||t===oo||t instanceof String&&e===oo.includes?ro:e},so=x((function(){qt(1)}));Vt({target:"Object",stat:!0,forced:so,sham:!Xt},{getPrototypeOf:function(t){return qt(H(t))}});var lo=i.Object.getPrototypeOf,uo=lo,co=Dn.filter,ho=Cr("filter");Vt({target:"Array",proto:!0,forced:!ho},{filter:function(t){return co(this,t,arguments.length>1?arguments[1]:void 0)}});var fo=Yr("Array").filter,po=Array.prototype,vo=function(t){var e=t.filter;return t===po||t instanceof Array&&e===po.filter?fo:e},yo=Et.f,mo=function(t){return function(e){for(var n,r=Pt(e),i=ce(r),o=i.length,a=0,s=[];o>a;)n=i[a++],B&&!yo.call(r,n)||s.push(t?[n,r[n]]:r[n]);return s}},go={entries:mo(!0),values:mo(!1)}.values;Vt({target:"Object",stat:!0},{values:function(t){return go(t)}});var bo=i.Object.values,_o="\t\n\v\f\r                 \u2028\u2029\ufeff",xo="["+_o+"]",wo=RegExp("^"+xo+xo+"*"),ko=RegExp(xo+xo+"*$"),Co=function(t){return function(e){var n=E(S(e));return 1&t&&(n=n.replace(wo,"")),2&t&&(n=n.replace(ko,"")),n}},Eo={start:Co(1),end:Co(2),trim:Co(3)},So=Eo.trim,To=f.parseInt,Ao=/^[+-]?0[Xx]/,Oo=8!==To(_o+"08")||22!==To(_o+"0x16")?function(t,e){var n=So(E(t));return To(n,e>>>0||(Ao.test(n)?16:10))}:To;Vt({global:!0,forced:parseInt!=Oo},{parseInt:Oo});var Po=i.parseInt,Do=ae.indexOf,Lo=[].indexOf,Mo=!!Lo&&1/[1].indexOf(1,-0)<0,Fo=Ai("indexOf");Vt({target:"Array",proto:!0,forced:Mo||!Fo},{indexOf:function(t){return Mo?Lo.apply(this,arguments)||0:Do(this,t,arguments.length>1?arguments[1]:void 0)}});var Ro,Io=Yr("Array").indexOf,jo=Array.prototype,zo=function(t){var e=t.indexOf;return t===jo||t instanceof Array&&e===jo.indexOf?Io:e},Bo=Eo.trim;Vt({target:"String",proto:!0,forced:(Ro="trim",x((function(){return!!_o[Ro]()||"​…᠎"!="​…᠎"[Ro]()||_o[Ro].name!==Ro})))},{trim:function(){return Bo(this)}});var No=Yr("String").trim,Wo=String.prototype,Yo=function(t){var e=t.trim;return"string"==typeof t||t===Wo||t instanceof String&&e===Wo.trim?No:e};Vt({target:"Object",stat:!0,sham:!B},{create:ge});var Go=i.Object,Vo=function(t,e){return Go.create(t,e)},Xo=Vo,Ho=p("JSON","stringify"),Uo=/[\uD800-\uDFFF]/g,qo=/^[\uD800-\uDBFF]$/,Zo=/^[\uDC00-\uDFFF]$/,$o=function(t,e,n){var r=n.charAt(e-1),i=n.charAt(e+1);return qo.test(t)&&!Zo.test(i)||Zo.test(t)&&!qo.test(r)?"\\u"+t.charCodeAt(0).toString(16):t},Qo=x((function(){return'"\\udf06\\ud834"'!==Ho("\udf06\ud834")||'"\\udead"'!==Ho("\udead")}));Ho&&Vt({target:"JSON",stat:!0,forced:Qo},{stringify:function(t,e,n){var r=Ho.apply(null,arguments);return"string"==typeof r?r.replace(Uo,$o):r}}),i.JSON||(i.JSON={stringify:JSON.stringify});var Ko=function(t,e,n){return i.JSON.stringify.apply(null,arguments)},Jo=[].slice,ta=/MSIE .\./.test(v),ea=function(t){return function(e,n){var r=arguments.length>2,i=r?Jo.call(arguments,2):void 0;return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,n)}};Vt({global:!0,bind:!0,forced:ta},{setTimeout:ea(f.setTimeout),setInterval:ea(f.setInterval)});var na=i.setTimeout;Vt({target:"Array",proto:!0},{fill:function(t){for(var e=H(this),n=ee(e.length),r=arguments.length,i=ie(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,a=void 0===o?n:ie(o,n);a>i;)e[i++]=t;return e}});var ra=Yr("Array").fill,ia=Array.prototype,oa=function(t){var e=t.fill;return t===ia||t instanceof Array&&e===ia.fill?ra:e},aa=s((function(t){function e(t){if(t)return function(t){for(var n in e.prototype)t[n]=e.prototype[n];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}}));function sa(){return(sa=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function la(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function ua(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var ca,ha="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign,fa=["","webkit","Moz","MS","ms","o"],da="undefined"==typeof document?{style:{}}:document.createElement("div"),pa=Math.round,va=Math.abs,ya=Date.now;function ma(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<fa.length;){if((r=(n=fa[o])?n+i:e)in t)return r;o++}}ca="undefined"==typeof window?{}:window;var ga=ma(da.style,"touchAction"),ba=void 0!==ga;var _a="compute",xa="auto",wa="manipulation",ka="none",Ca="pan-x",Ea="pan-y",Sa=function(){if(!ba)return!1;var t={},e=ca.CSS&&ca.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){return t[n]=!e||ca.CSS.supports("touch-action",n)})),t}(),Ta="ontouchstart"in ca,Aa=void 0!==ma(ca,"PointerEvent"),Oa=Ta&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),Pa="touch",Da="mouse",La=16,Ma=24,Fa=["x","y"],Ra=["clientX","clientY"];function Ia(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function ja(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function za(t,e){return t.indexOf(e)>-1}var Ba=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===_a&&(t=this.compute()),ba&&this.manager.element.style&&Sa[t]&&(this.manager.element.style[ga]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Ia(this.manager.recognizers,(function(e){ja(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(za(t,ka))return ka;var e=za(t,Ca),n=za(t,Ea);return e&&n?ka:e||n?e?Ca:Ea:za(t,wa)?wa:xa}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var r=this.actions,i=za(r,ka)&&!Sa.none,o=za(r,Ea)&&!Sa["pan-y"],a=za(r,Ca)&&!Sa["pan-x"];if(i){var s=1===t.pointers.length,l=t.distance<2,u=t.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return i||o&&6&n||a&&n&Ma?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function Na(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Wa(t){var e=t.length;if(1===e)return{x:pa(t[0].clientX),y:pa(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:pa(n/e),y:pa(r/e)}}function Ya(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:pa(t.pointers[n].clientX),clientY:pa(t.pointers[n].clientY)},n++;return{timeStamp:ya(),pointers:e,center:Wa(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Ga(t,e,n){n||(n=Fa);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function Va(t,e,n){n||(n=Fa);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}function Xa(t,e){return t===e?1:va(t)>=va(e)?t<0?2:4:e<0?8:La}function Ha(t,e,n){return{x:e/t||0,y:n/t||0}}function Ua(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=Ya(e)),i>1&&!n.firstMultiple?n.firstMultiple=Ya(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,l=e.center=Wa(r);e.timeStamp=ya(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=Va(s,l),e.distance=Ga(s,l),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=Xa(e.deltaX,e.deltaY);var u,c,h=Ha(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=va(h.x)>va(h.y)?h.x:h.y,e.scale=a?(u=a.pointers,Ga((c=r)[0],c[1],Ra)/Ga(u[0],u[1],Ra)):1,e.rotation=a?function(t,e){return Va(e[1],e[0],Ra)+Va(t[1],t[0],Ra)}(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,r,i,o,a=t.lastInterval||e,s=e.timeStamp-a.timeStamp;if(8!==e.eventType&&(s>25||void 0===a.velocity)){var l=e.deltaX-a.deltaX,u=e.deltaY-a.deltaY,c=Ha(s,l,u);r=c.x,i=c.y,n=va(c.x)>va(c.y)?c.x:c.y,o=Xa(l,u),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}(n,e);var f,d=t.element,p=e.srcEvent;Na(f=p.composedPath?p.composedPath()[0]:p.path?p.path[0]:p.target,d)&&(d=f),e.target=d}function qa(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,o=1&e&&r-i==0,a=12&e&&r-i==0;n.isFirst=!!o,n.isFinal=!!a,o&&(t.session={}),n.eventType=e,Ua(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function Za(t){return t.trim().split(/\s+/g)}function $a(t,e,n){Ia(Za(e),(function(e){t.addEventListener(e,n,!1)}))}function Qa(t,e,n){Ia(Za(e),(function(e){t.removeEventListener(e,n,!1)}))}function Ka(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var Ja=function(){function t(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){ja(t.options.enable,[t])&&n.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&$a(this.element,this.evEl,this.domHandler),this.evTarget&&$a(this.target,this.evTarget,this.domHandler),this.evWin&&$a(Ka(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Qa(this.element,this.evEl,this.domHandler),this.evTarget&&Qa(this.target,this.evTarget,this.domHandler),this.evWin&&Qa(Ka(this.element),this.evWin,this.domHandler)},t}();function ts(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}var es={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ns={2:Pa,3:"pen",4:Da,5:"kinect"},rs="pointerdown",is="pointermove pointerup pointercancel";ca.MSPointerEvent&&!ca.PointerEvent&&(rs="MSPointerDown",is="MSPointerMove MSPointerUp MSPointerCancel");var os=function(t){function e(){var n,r=e.prototype;return r.evEl=rs,r.evWin=is,(n=t.apply(this,arguments)||this).store=n.manager.session.pointerEvents=[],n}return la(e,t),e.prototype.handler=function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=es[r],o=ns[t.pointerType]||t.pointerType,a=o===Pa,s=ts(e,t.pointerId,"pointerId");1&i&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&i&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))},e}(Ja);function as(t){return Array.prototype.slice.call(t,0)}function ss(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];ts(i,a)<0&&r.push(t[o]),i[o]=a,o++}return n&&(r=e?r.sort((function(t,n){return t[e]>n[e]})):r.sort()),r}var ls={touchstart:1,touchmove:2,touchend:4,touchcancel:8},us="touchstart touchmove touchend touchcancel",cs=function(t){function e(){var n;return e.prototype.evTarget=us,(n=t.apply(this,arguments)||this).targetIds={},n}return la(e,t),e.prototype.handler=function(t){var e=ls[t.type],n=hs.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:Pa,srcEvent:t})},e}(Ja);function hs(t,e){var n,r,i=as(t.touches),o=this.targetIds;if(3&e&&1===i.length)return o[i[0].identifier]=!0,[i,i];var a=as(t.changedTouches),s=[],l=this.target;if(r=i.filter((function(t){return Na(t.target,l)})),1===e)for(n=0;n<r.length;)o[r[n].identifier]=!0,n++;for(n=0;n<a.length;)o[a[n].identifier]&&s.push(a[n]),12&e&&delete o[a[n].identifier],n++;return s.length?[ss(r.concat(s),"identifier",!0),s]:void 0}var fs={mousedown:1,mousemove:2,mouseup:4},ds="mousedown",ps="mousemove mouseup",vs=function(t){function e(){var n,r=e.prototype;return r.evEl=ds,r.evWin=ps,(n=t.apply(this,arguments)||this).pressed=!1,n}return la(e,t),e.prototype.handler=function(t){var e=fs[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:Da,srcEvent:t}))},e}(Ja);function ys(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY},r=this.lastTouches;this.lastTouches.push(n);setTimeout((function(){var t=r.indexOf(n);t>-1&&r.splice(t,1)}),2500)}}function ms(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,ys.call(this,e)):12&t&&ys.call(this,e)}function gs(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(e-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}var bs=function(){return function(t){function e(e,n){var r;return(r=t.call(this,e,n)||this).handler=function(t,e,n){var i=n.pointerType===Pa,o=n.pointerType===Da;if(!(o&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)ms.call(ua(ua(r)),e,n);else if(o&&gs.call(ua(ua(r)),n))return;r.callback(t,e,n)}},r.touch=new cs(r.manager,r.handler),r.mouse=new vs(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}return la(e,t),e.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(Ja)}();function _s(t,e,n){return!!Array.isArray(t)&&(Ia(t,n[e],n),!0)}var xs=32,ws=1;function ks(t,e){var n=e.manager;return n?n.get(t):t}function Cs(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var Es=function(){function t(t){void 0===t&&(t={}),this.options=sa({enable:!0},t),this.id=ws++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return ha(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(_s(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=ks(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return _s(t,"dropRecognizeWith",this)||(t=ks(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(_s(t,"requireFailure",this))return this;var e=this.requireFail;return-1===ts(e,t=ks(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(_s(t,"dropRequireFailure",this))return this;t=ks(t,this);var e=ts(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var e=this,n=this.state;function r(n){e.manager.emit(n,t)}n<8&&r(e.options.event+Cs(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(e.options.event+Cs(n))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=xs},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){var e=ha({},t);if(!ja(this.options.enable,[this,e]))return this.reset(),void(this.state=xs);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},t}(),Ss=function(t){function e(e){var n;return void 0===e&&(e={}),(n=t.call(this,sa({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},e))||this).pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}la(e,t);var n=e.prototype;return n.getTouchAction=function(){return[wa]},n.process=function(t){var e=this,n=this.options,r=t.pointers.length===n.pointers,i=t.distance<n.threshold,o=t.deltaTime<n.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(i&&o&&r){if(4!==t.eventType)return this.failTimeout();var a=!this.pTime||t.timeStamp-this.pTime<n.interval,s=!this.pCenter||Ga(this.pCenter,t.center)<n.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&a?this.count+=1:this.count=1,this._input=t,0===this.count%n.taps)return this.hasRequireFailures()?(this._timer=setTimeout((function(){e.state=8,e.tryEmit()}),n.interval),2):8}return xs},n.failTimeout=function(){var t=this;return this._timer=setTimeout((function(){t.state=xs}),this.options.interval),xs},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){8===this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Es),Ts=function(t){function e(e){return void 0===e&&(e={}),t.call(this,sa({pointers:1},e))||this}la(e,t);var n=e.prototype;return n.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},n.process=function(t){var e=this.state,n=t.eventType,r=6&e,i=this.attrTest(t);return r&&(8&n||!i)?16|e:r||i?4&n?8|e:2&e?4|e:2:xs},e}(Es);function As(t){return t===La?"down":8===t?"up":2===t?"left":4===t?"right":""}var Os=function(t){function e(e){var n;return void 0===e&&(e={}),(n=t.call(this,sa({event:"pan",threshold:10,pointers:1,direction:30},e))||this).pX=null,n.pY=null,n}la(e,t);var n=e.prototype;return n.getTouchAction=function(){var t=this.options.direction,e=[];return 6&t&&e.push(Ea),t&Ma&&e.push(Ca),e},n.directionTest=function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(6&e.direction?(i=0===o?1:o<0?2:4,n=o!==this.pX,r=Math.abs(t.deltaX)):(i=0===a?1:a<0?8:La,n=a!==this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},n.attrTest=function(t){return Ts.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},n.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var n=As(e.direction);n&&(e.additionalEvent=this.options.event+n),t.prototype.emit.call(this,e)},e}(Ts),Ps=function(t){function e(e){return void 0===e&&(e={}),t.call(this,sa({event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},e))||this}la(e,t);var n=e.prototype;return n.getTouchAction=function(){return Os.prototype.getTouchAction.call(this)},n.attrTest=function(e){var n,r=this.options.direction;return 30&r?n=e.overallVelocity:6&r?n=e.overallVelocityX:r&Ma&&(n=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&va(n)>this.options.velocity&&4&e.eventType},n.emit=function(t){var e=As(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(Ts),Ds=function(t){function e(e){return void 0===e&&(e={}),t.call(this,sa({event:"pinch",threshold:0,pointers:2},e))||this}la(e,t);var n=e.prototype;return n.getTouchAction=function(){return[ka]},n.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},n.emit=function(e){if(1!==e.scale){var n=e.scale<1?"in":"out";e.additionalEvent=this.options.event+n}t.prototype.emit.call(this,e)},e}(Ts),Ls=function(t){function e(e){return void 0===e&&(e={}),t.call(this,sa({event:"rotate",threshold:0,pointers:2},e))||this}la(e,t);var n=e.prototype;return n.getTouchAction=function(){return[ka]},n.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)},e}(Ts),Ms=function(t){function e(e){var n;return void 0===e&&(e={}),(n=t.call(this,sa({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,n._input=null,n}la(e,t);var n=e.prototype;return n.getTouchAction=function(){return[xa]},n.process=function(t){var e=this,n=this.options,r=t.pointers.length===n.pointers,i=t.distance<n.threshold,o=t.deltaTime>n.time;if(this._input=t,!i||!r||12&t.eventType&&!o)this.reset();else if(1&t.eventType)this.reset(),this._timer=setTimeout((function(){e.state=8,e.tryEmit()}),n.time);else if(4&t.eventType)return 8;return xs},n.reset=function(){clearTimeout(this._timer)},n.emit=function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=ya(),this.manager.emit(this.options.event,this._input)))},e}(Es),Fs={domEvents:!1,touchAction:_a,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Rs=[[Ls,{enable:!1}],[Ds,{enable:!1},["rotate"]],[Ps,{direction:6}],[Os,{direction:6},["swipe"]],[Ss],[Ss,{event:"doubletap",taps:2},["tap"]],[Ms]];function Is(t,e){var n,r=t.element;r.style&&(Ia(t.options.cssProps,(function(i,o){n=ma(r.style,o),e?(t.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=t.oldCssProps[n]||""})),e||(t.oldCssProps={}))}var js=function(){function t(t,e){var n,r=this;this.options=ha({},Fs,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((n=this).options.inputClass||(Aa?os:Oa?cs:Ta?bs:vs))(n,qa),this.touchAction=new Ba(this,this.options.touchAction),Is(this,!0),Ia(this.options.recognizers,(function(t){var e=r.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}var e=t.prototype;return e.set=function(t){return ha(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var r=this.recognizers,i=e.curRecognizer;(!i||i&&8&i.state)&&(e.curRecognizer=null,i=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!==i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&14&n.state&&(e.curRecognizer=n,i=n),o++}},e.get=function(t){if(t instanceof Es)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event===t)return e[n];return null},e.add=function(t){if(_s(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(_s(t,"remove",this))return this;var e=this.get(t);if(t){var n=this.recognizers,r=ts(n,e);-1!==r&&(n.splice(r,1),this.touchAction.update())}return this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var n=this.handlers;return Ia(Za(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this},e.off=function(t,e){if(void 0===t)return this;var n=this.handlers;return Ia(Za(t),(function(t){e?n[t]&&n[t].splice(ts(n[t],e),1):delete n[t]})),this},e.emit=function(t,e){this.options.domEvents&&function(t,e){var n=document.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},e.destroy=function(){this.element&&Is(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),zs={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Bs="touchstart",Ns="touchstart touchmove touchend touchcancel",Ws=function(t){function e(){var n,r=e.prototype;return r.evTarget=Bs,r.evWin=Ns,(n=t.apply(this,arguments)||this).started=!1,n}return la(e,t),e.prototype.handler=function(t){var e=zs[t.type];if(1===e&&(this.started=!0),this.started){var n=Ys.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:Pa,srcEvent:t})}},e}(Ja);function Ys(t,e){var n=as(t.touches),r=as(t.changedTouches);return 12&e&&(n=ss(n.concat(r),"identifier",!0)),[n,r]}function Gs(t,e,n){var r="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=window.console&&(window.console.warn||window.console.log);return i&&i.call(window.console,r,n),t.apply(this,arguments)}}var Vs=Gs((function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&void 0===t[r[i]])&&(t[r[i]]=e[r[i]]),i++;return t}),"extend","Use `assign`."),Xs=Gs((function(t,e){return Vs(t,e,!0)}),"merge","Use `assign`.");function Hs(t,e,n){var r,i=e.prototype;(r=t.prototype=Object.create(i)).constructor=t,r._super=i,n&&ha(r,n)}function Us(t,e){return function(){return t.apply(e,arguments)}}var qs=function(){var t=function(t,e){return void 0===e&&(e={}),new js(t,sa({recognizers:Rs.concat()},e))};return t.VERSION="2.0.17-rc",t.DIRECTION_ALL=30,t.DIRECTION_DOWN=La,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=Ma,t.DIRECTION_NONE=1,t.DIRECTION_DOWN=La,t.INPUT_START=1,t.INPUT_MOVE=2,t.INPUT_END=4,t.INPUT_CANCEL=8,t.STATE_POSSIBLE=1,t.STATE_BEGAN=2,t.STATE_CHANGED=4,t.STATE_ENDED=8,t.STATE_RECOGNIZED=8,t.STATE_CANCELLED=16,t.STATE_FAILED=xs,t.Manager=js,t.Input=Ja,t.TouchAction=Ba,t.TouchInput=cs,t.MouseInput=vs,t.PointerEventInput=os,t.TouchMouseInput=bs,t.SingleTouchInput=Ws,t.Recognizer=Es,t.AttrRecognizer=Ts,t.Tap=Ss,t.Pan=Os,t.Swipe=Ps,t.Pinch=Ds,t.Rotate=Ls,t.Press=Ms,t.on=$a,t.off=Qa,t.each=Ia,t.merge=Xs,t.extend=Vs,t.bindFn=Us,t.assign=ha,t.inherit=Hs,t.bindFn=Us,t.prefixed=ma,t.toArray=as,t.inArray=ts,t.uniqueArray=ss,t.splitStr=Za,t.boolOrFn=ja,t.hasParent=Na,t.addEventListeners=$a,t.removeEventListeners=Qa,t.defaults=ha({},Fs,{preset:Rs}),t}();function Zs(t,e){var n=bi(t);if(sr){var r=sr(t);e&&(r=vo(r).call(r,(function(e){return cr(t,e).enumerable}))),n.push.apply(n,r)}return n}function $s(t){for(var e=1;e<arguments.length;e++){var n,r=null!=arguments[e]?arguments[e]:{};if(e%2)Fi(n=Zs(Object(r),!0)).call(n,(function(e){br(t,e,r[e])}));else if(fr)dr(t,fr(r));else{var i;Fi(i=Zs(Object(r))).call(i,(function(e){vr(t,e,cr(r,e))}))}}return t}function Qs(t,e){var n=void 0!==ai&&vn(t)||t["@@iterator"];if(!n){if(fi(t)||(n=function(t,e){var n;if(!t)return;if("string"==typeof t)return Ks(t,e);var r=ci(n=Object.prototype.toString.call(t)).call(n,8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return an(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ks(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ks(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Js=ai("DELETE");function tl(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return el.apply(void 0,ui(e=[{},t]).call(e,r))}function el(){var t=nl.apply(void 0,arguments);return il(t),t}function nl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(e.length<2)return e[0];var r;if(e.length>2)return nl.apply(void 0,ui(r=[el(e[0],e[1])]).call(r,oi(ci(e).call(e,2))));var i,o=e[0],a=e[1],s=Qs(hi(a));try{for(s.s();!(i=s.n()).done;){var l=i.value;Object.prototype.propertyIsEnumerable.call(a,l)&&(a[l]===Js?delete o[l]:null===o[l]||null===a[l]||"object"!==ei(o[l])||"object"!==ei(a[l])||fi(o[l])||fi(a[l])?o[l]=rl(a[l]):o[l]=nl(o[l],a[l]))}}catch(t){s.e(t)}finally{s.f()}return o}function rl(t){return fi(t)?mi(t).call(t,(function(t){return rl(t)})):"object"===ei(t)&&null!==t?nl({},t):t}function il(t){for(var e=0,n=bi(t);e<n.length;e++){var r=n[e];t[r]===Js?delete t[r]:"object"===ei(t[r])&&null!==t[r]&&il(t[r])}}function ol(t){var e=function(){for(var t=al(),e=t(" "),n=t(" "),r=t(" "),i=0;i<arguments.length;i++)(e-=t(i<0||arguments.length<=i?void 0:arguments[i]))<0&&(e+=1),(n-=t(i<0||arguments.length<=i?void 0:arguments[i]))<0&&(n+=1),(r-=t(i<0||arguments.length<=i?void 0:arguments[i]))<0&&(r+=1);return[e,n,r]}(t),n=Qr(e,3),r=n[0],i=n[1],o=n[2],a=1,s=function(){var t=2091639*r+2.3283064365386963e-10*a;return r=i,i=o,o=t-(a=0|t)};return s.uint32=function(){return 4294967296*s()},s.fract53=function(){return s()+11102230246251565e-32*(2097152*s()|0)},s.algorithm="Alea",s.seed=t,s.version="0.9",s}function al(){var t=4022871197;return function(e){for(var n=e.toString(),r=0;r<n.length;r++){var i=.02519603282416938*(t+=n.charCodeAt(r));i-=t=i>>>0,t=(i*=t)>>>0,t+=4294967296*(i-=t)}return 2.3283064365386963e-10*(t>>>0)}}var sl="undefined"!=typeof window?window.Hammer||qs:function(){return{on:t=function(){},off:t,destroy:t,emit:t,get:function(){return{set:t}}};var t};function ll(t){var e,n=this;this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((function(){n._dom.overlay.parentNode.removeChild(n._dom.overlay)}));var r=sl(this._dom.overlay);r.on("tap",Ti(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push((function(){r.destroy()}));var i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];Fi(i).call(i,(function(t){r.on(t,(function(t){t.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=function(e){(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||n.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push((function(){document.body.removeEventListener("click",n._onClick)}))),this._escListener=function(t){("key"in t?"Escape"===t.key:27===t.keyCode)&&n.deactivate()}}aa(ll.prototype),ll.current=null,ll.prototype.destroy=function(){var t,e;this.deactivate();var n,r=Qs(Bi(t=Ui(e=this._cleanupQueue).call(e,0)).call(t));try{for(r.s();!(n=r.n()).done;){(0,n.value)()}}catch(t){r.e(t)}finally{r.f()}},ll.prototype.activate=function(){ll.current&&ll.current.deactivate(),ll.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},ll.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},ll.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};var ul=/^\/?Date\((-?\d+)/i,cl=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,hl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,fl=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,dl=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function pl(t){return t instanceof Number||"number"==typeof t}function vl(t){return t instanceof String||"string"==typeof t}function yl(t){return"object"===ei(t)&&null!==t}function ml(t,e,n,r){var i=!1;!0===r&&(i=null===e[n]&&void 0!==t[n]),i?delete t[n]:t[n]=e[n]}var gl=Qi;function bl(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(fi(n))throw new TypeError("Arrays are not supported by deepExtend");for(var i=0;i<t.length;i++){var o=t[i];if(Object.prototype.hasOwnProperty.call(n,o))if(n[o]&&n[o].constructor===Object)void 0===e[o]&&(e[o]={}),e[o].constructor===Object?_l(e[o],n[o],!1,r):ml(e,n,o,r);else{if(fi(n[o]))throw new TypeError("Arrays are not supported by deepExtend");ml(e,n,o,r)}}return e}function _l(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)||!0===n)if("object"===ei(e[i])&&null!==e[i]&&uo(e[i])===Object.prototype)void 0===t[i]?t[i]=_l({},e[i],n):"object"===ei(t[i])&&null!==t[i]&&uo(t[i])===Object.prototype?_l(t[i],e[i],n):ml(t,e,i,r);else if(fi(e[i])){var o;t[i]=ci(o=e[i]).call(o)}else ml(t,e,i,r);return t}function xl(t,e){var n;return ui(n=[]).call(n,oi(t),[e])}function wl(t){return ci(t).call(t)}var kl=bo;function Cl(t,e,n,r){var i;t.addEventListener?(void 0===r&&(r=!1),"mousewheel"===e&&ao(i=navigator.userAgent).call(i,"Firefox")&&(e="DOMMouseScroll"),t.addEventListener(e,n,r)):t.attachEvent("on"+e,n)}function El(t,e,n,r){var i;t.removeEventListener?(void 0===r&&(r=!1),"mousewheel"===e&&ao(i=navigator.userAgent).call(i,"Firefox")&&(e="DOMMouseScroll"),t.removeEventListener(e,n,r)):t.detachEvent("on"+e,n)}function Sl(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)}var Tl={asBoolean:function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},asNumber:function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},asString:function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},asSize:function(t,e){return"function"==typeof t&&(t=t()),vl(t)?t:pl(t)?t+"px":e||null},asElement:function(t,e){return"function"==typeof t&&(t=t()),t||e||null}};function Al(t){var e;switch(t.length){case 3:case 4:return(e=hl.exec(t))?{r:Po(e[1]+e[1],16),g:Po(e[2]+e[2],16),b:Po(e[3]+e[3],16)}:null;case 6:case 7:return(e=cl.exec(t))?{r:Po(e[1],16),g:Po(e[2],16),b:Po(e[3],16)}:null;default:return null}}function Ol(t,e,n){var r;return"#"+ci(r=((1<<24)+(t<<16)+(e<<8)+n).toString(16)).call(r,1)}function Pl(t,e,n){t/=255,e/=255,n/=255;var r=Math.min(t,Math.min(e,n)),i=Math.max(t,Math.max(e,n));return r===i?{h:0,s:0,v:r}:{h:60*((t===r?3:n===r?1:5)-(t===r?e-n:n===r?t-e:n-t)/(i-r))/360,s:(i-r)/i,v:i}}var Dl=function(t){var e,n={};return Fi(e=t.split(";")).call(e,(function(t){if(""!=Yo(t).call(t)){var e,r,i=t.split(":"),o=Yo(e=i[0]).call(e),a=Yo(r=i[1]).call(r);n[o]=a}})),n},Ll=function(t){var e;return mi(e=bi(t)).call(e,(function(e){return e+": "+t[e]})).join("; ")};function Ml(t,e,n){var r,i,o,a=Math.floor(6*t),s=6*t-a,l=n*(1-e),u=n*(1-s*e),c=n*(1-(1-s)*e);switch(a%6){case 0:r=n,i=c,o=l;break;case 1:r=u,i=n,o=l;break;case 2:r=l,i=n,o=c;break;case 3:r=l,i=u,o=n;break;case 4:r=c,i=l,o=n;break;case 5:r=n,i=l,o=u}return{r:Math.floor(255*r),g:Math.floor(255*i),b:Math.floor(255*o)}}function Fl(t,e,n){var r=Ml(t,e,n);return Ol(r.r,r.g,r.b)}function Rl(t){var e=Al(t);if(!e)throw new TypeError("'".concat(t,"' is not a valid color."));return Pl(e.r,e.g,e.b)}function Il(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}function jl(t){return fl.test(t)}function zl(t){return dl.test(t)}function Bl(t){if(null===t||"object"!==ei(t))return null;if(t instanceof Element)return t;var e=Xo(t);for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&"object"==ei(t[n])&&(e[n]=Bl(t[n]));return e}var Nl={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"},Wl=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;yr(this,t),this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return gr(t,[{key:"insertTo",value:function(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}},{key:"setCloseCallback",value:function(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}},{key:"_isColorString",value:function(t){if("string"==typeof t)return Nl[t]}},{key:"setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var n,r=this._isColorString(t);if(void 0!==r&&(t=r),!0===vl(t)){if(!0===jl(t)){var i=t.substr(4).substr(0,t.length-5).split(",");n={r:i[0],g:i[1],b:i[2],a:1}}else if(!0===zl(t)){var o=t.substr(5).substr(0,t.length-6).split(",");n={r:o[0],g:o[1],b:o[2],a:o[3]}}else if(!0===Il(t)){var a=Al(t);n={r:a.r,g:a.g,b:a.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){var s=void 0!==t.a?t.a:"1.0";n={r:t.r,g:t.g,b:t.b,a:s}}if(void 0===n)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+Ko(t));this._setColor(n,e)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];!0===e&&(this.previousColor=Qi({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",na((function(){void 0!==t.closeCallback&&(t.closeCallback(),t.closeCallback=void 0)}),0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}},{key:"_setColor",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!0===e&&(this.initialColor=Qi({},t)),this.color=t;var n=Pl(t.r,t.g,t.b),r=2*Math.PI,i=this.r*n.s,o=this.centerCoordinates.x+i*Math.sin(r*n.h),a=this.centerCoordinates.y+i*Math.cos(r*n.h);this.colorPickerSelector.style.left=o-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=a-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}},{key:"_setOpacity",value:function(t){this.color.a=t/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(t){var e=Pl(this.color.r,this.color.g,this.color.b);e.v=t/100;var n=Ml(e.h,e.s,e.v);n.a=this.color.a,this.color=n,this._updatePicker()}},{key:"_updatePicker",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,e=Pl(t.r,t.g,t.b),n=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1)),n.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var r=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;n.clearRect(0,0,r,i),n.putImageData(this.hueCircle,0,0),n.fillStyle="rgba(0,0,0,"+(1-e.v)+")",n.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),oa(n).call(n),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*t.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){var t,e,n,r;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){var i=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var o=document.createElement("DIV");o.style.color="red",o.style.fontWeight="bold",o.style.padding="10px",o.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(o)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(t){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var a=this;this.opacityRange.onchange=function(){a._setOpacity(this.value)},this.opacityRange.oninput=function(){a._setOpacity(this.value)},this.brightnessRange.onchange=function(){a._setBrightness(this.value)},this.brightnessRange.oninput=function(){a._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=Ti(t=this._hide).call(t,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=Ti(e=this._apply).call(e,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=Ti(n=this._save).call(n,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=Ti(r=this._loadLast).call(r,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var t=this;this.drag={},this.pinch={},this.hammer=new sl(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(function(e){e.isFirst&&t._moveSelector(e)})),this.hammer.on("tap",(function(e){t._moveSelector(e)})),this.hammer.on("panstart",(function(e){t._moveSelector(e)})),this.hammer.on("panmove",(function(e){t._moveSelector(e)})),this.hammer.on("panend",(function(e){t._moveSelector(e)}))}},{key:"_generateHueCircle",value:function(){if(!1===this.generated){var t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var e,n,r,i,o=this.colorPickerCanvas.clientWidth,a=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,o,a),this.centerCoordinates={x:.5*o,y:.5*a},this.r=.49*o;var s,l=2*Math.PI/360,u=1/this.r;for(r=0;r<360;r++)for(i=0;i<this.r;i++)e=this.centerCoordinates.x+i*Math.sin(l*r),n=this.centerCoordinates.y+i*Math.cos(l*r),s=Ml(.002777777777777778*r,i*u,1),t.fillStyle="rgb("+s.r+","+s.g+","+s.b+")",t.fillRect(e-.5,n-.5,2,2);t.strokeStyle="rgba(0,0,0,1)",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),t.stroke(),this.hueCircle=t.getImageData(0,0,o,a)}this.generated=!0}},{key:"_moveSelector",value:function(t){var e=this.colorPickerDiv.getBoundingClientRect(),n=t.center.x-e.left,r=t.center.y-e.top,i=.5*this.colorPickerDiv.clientHeight,o=.5*this.colorPickerDiv.clientWidth,a=n-o,s=r-i,l=Math.atan2(a,s),u=.98*Math.min(Math.sqrt(a*a+s*s),o),c=Math.cos(l)*u+i,h=Math.sin(l)*u+o;this.colorPickerSelector.style.top=c-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=h-.5*this.colorPickerSelector.clientWidth+"px";var f=l/(2*Math.PI);f=f<0?f+1:f;var d=u/this.r,p=Pl(this.color.r,this.color.g,this.color.b);p.h=f,p.s=d;var v=Ml(p.h,p.s,p.v);v.a=this.color.a,this.color=v,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),t}();function Yl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(e.length<1)throw new TypeError("Invalid arguments.");if(1===e.length)return document.createTextNode(e[0]);var r=document.createElement(e[0]);return r.appendChild(Yl.apply(void 0,oi(ci(e).call(e,1)))),r}var Gl,Vl=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1};yr(this,t),this.parent=e,this.changedOptions=[],this.container=n,this.allowCreation=!1,this.hideOption=o,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Qi(this.options,this.defaultOptions),this.configureOptions=r,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Wl(i),this.wrapper=void 0}return gr(t,[{key:"setOptions",value:function(t){if(void 0!==t){this.popupHistory={},this._removePopup();var e=!0;if("string"==typeof t)this.options.filter=t;else if(fi(t))this.options.filter=t.join();else if("object"===ei(t)){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==vo(t)&&(this.options.filter=vo(t)),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)}else"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0);!1===vo(this.options)&&(e=!1),this.options.enabled=e}this._clean()}},{key:"setModuleOptions",value:function(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var t=vo(this.options),e=0,n=!1;for(var r in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,r)&&(this.allowCreation=!1,n=!1,"function"==typeof t?n=(n=t(r,[]))||this._handleObject(this.configureOptions[r],[r],!0):!0!==t&&-1===zo(t).call(t,r)||(n=!0),!1!==n&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(r),this._handleObject(this.configureOptions[r],[r])),e++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t<this.domElements.length;t++)this.wrapper.appendChild(this.domElements[t]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var t=0;t<this.domElements.length;t++)this.wrapper.removeChild(this.domElements[t]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:"_getValue",value:function(t){for(var e=this.moduleOptions,n=0;n<t.length;n++){if(void 0===e[t[n]]){e=void 0;break}e=e[t[n]]}return e}},{key:"_makeItem",value:function(t){if(!0===this.allowCreation){var e=document.createElement("div");e.className="vis-configuration vis-config-item vis-config-s"+t.length;for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Fi(r).call(r,(function(t){e.appendChild(t)})),this.domElements.push(e),this.domElements.length}return 0}},{key:"_makeHeader",value:function(t){var e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerText=t,this._makeItem([],e)}},{key:"_makeLabel",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=document.createElement("div");if(r.className="vis-configuration vis-config-label vis-config-s"+e.length,!0===n){for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(Yl("i","b",t))}else r.innerText=t+":";return r}},{key:"_makeDropdown",value:function(t,e,n){var r=document.createElement("select");r.className="vis-configuration vis-config-select";var i=0;void 0!==e&&-1!==zo(t).call(t,e)&&(i=zo(t).call(t,e));for(var o=0;o<t.length;o++){var a=document.createElement("option");a.value=t[o],o===i&&(a.selected="selected"),a.innerText=t[o],r.appendChild(a)}var s=this;r.onchange=function(){s._update(this.value,n)};var l=this._makeLabel(n[n.length-1],n);this._makeItem(n,l,r)}},{key:"_makeRange",value:function(t,e,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=document.createElement("input");s.className="vis-configuration vis-config-range";try{s.type="range",s.min=i,s.max=o}catch(t){}s.step=a;var l="",u=0;if(void 0!==e){var c=1.2;e<0&&e*c<i?(s.min=Math.ceil(e*c),u=s.min,l="range increased"):e/c<i&&(s.min=Math.ceil(e/c),u=s.min,l="range increased"),e*c>o&&1!==o&&(s.max=Math.ceil(e*c),u=s.max,l="range increased"),s.value=e}else s.value=r;var h=document.createElement("input");h.className="vis-configuration vis-config-rangeinput",h.value=s.value;var f=this;s.onchange=function(){h.value=this.value,f._update(Number(this.value),n)},s.oninput=function(){h.value=this.value};var d=this._makeLabel(n[n.length-1],n),p=this._makeItem(n,d,s,h);""!==l&&this.popupHistory[p]!==u&&(this.popupHistory[p]=u,this._setupPopup(l,p))}},{key:"_makeButton",value:function(){var t=this;if(!0===this.options.showButton){var e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=function(){t._printOptions()},e.onmouseover=function(){e.className="vis-configuration vis-config-button hover"},e.onmouseout=function(){e.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(e)}}},{key:"_setupPopup",value:function(t,e){var n=this;if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){var r=document.createElement("div");r.id="vis-configuration-popup",r.className="vis-configuration-popup",r.innerText=t,r.onclick=function(){n._removePopup()},this.popupCounter+=1,this.popupDiv={html:r,index:e}}}},{key:"_removePopup",value:function(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:"_showPopupIfNeeded",value:function(){var t=this;if(void 0!==this.popupDiv.html){var e=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=e.left+"px",this.popupDiv.html.style.top=e.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=na((function(){t.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=na((function(){t._removePopup()}),1800)}}},{key:"_makeCheckbox",value:function(t,e,n){var r=document.createElement("input");r.type="checkbox",r.className="vis-configuration vis-config-checkbox",r.checked=t,void 0!==e&&(r.checked=e,e!==t&&("object"===ei(t)?e!==t.enabled&&this.changedOptions.push({path:n,value:e}):this.changedOptions.push({path:n,value:e})));var i=this;r.onchange=function(){i._update(this.checked,n)};var o=this._makeLabel(n[n.length-1],n);this._makeItem(n,o,r)}},{key:"_makeTextInput",value:function(t,e,n){var r=document.createElement("input");r.type="text",r.className="vis-configuration vis-config-text",r.value=e,e!==t&&this.changedOptions.push({path:n,value:e});var i=this;r.onchange=function(){i._update(this.value,n)};var o=this._makeLabel(n[n.length-1],n);this._makeItem(n,o,r)}},{key:"_makeColorField",value:function(t,e,n){var r=this,i=t[1],o=document.createElement("div");"none"!==(e=void 0===e?i:e)?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=e):o.className="vis-configuration vis-config-colorBlock none",e=void 0===e?i:e,o.onclick=function(){r._showColorPicker(e,o,n)};var a=this._makeLabel(n[n.length-1],n);this._makeItem(n,a,o)}},{key:"_showColorPicker",value:function(t,e,n){var r=this;e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback((function(t){var i="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=i,r._update(i,n)})),this.colorPicker.setCloseCallback((function(){e.onclick=function(){r._showColorPicker(t,e,n)}}))}},{key:"_handleObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!1,i=vo(this.options),o=!1;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){r=!0;var s=t[a],l=xl(e,a);if("function"==typeof i&&!1===(r=i(a,e))&&!fi(s)&&"string"!=typeof s&&"boolean"!=typeof s&&s instanceof Object&&(this.allowCreation=!1,r=this._handleObject(s,l,!0),this.allowCreation=!1===n),!1!==r){o=!0;var u=this._getValue(l);if(fi(s))this._handleArray(s,u,l);else if("string"==typeof s)this._makeTextInput(s,u,l);else if("boolean"==typeof s)this._makeCheckbox(s,u,l);else if(s instanceof Object){if(!this.hideOption(e,a,this.moduleOptions))if(void 0!==s.enabled){var c=xl(l,"enabled"),h=this._getValue(c);if(!0===h){var f=this._makeLabel(a,l,!0);this._makeItem(l,f),o=this._handleObject(s,l)||o}else this._makeCheckbox(s,h,l)}else{var d=this._makeLabel(a,l,!0);this._makeItem(l,d),o=this._handleObject(s,l)||o}}else console.error("dont know how to handle",s,a,l)}}return o}},{key:"_handleArray",value:function(t,e,n){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,n),t[1]!==e&&this.changedOptions.push({path:n,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,n),t[0]!==e&&this.changedOptions.push({path:n,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,n),t[0]!==e&&this.changedOptions.push({path:n,value:Number(e)}))}},{key:"_update",value:function(t,e){var n=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",n),this.initialized=!0,this.parent.setOptions(n)}},{key:"_constructOptions",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n;t="false"!==(t="true"===t||t)&&t;for(var i=0;i<e.length;i++)"global"!==e[i]&&(void 0===r[e[i]]&&(r[e[i]]={}),i!==e.length-1?r=r[e[i]]:r[e[i]]=t);return n}},{key:"_printOptions",value:function(){for(var t=this.getOptions();this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(Yl("pre","const options = "+Ko(t,null,2)))}},{key:"getOptions",value:function(){for(var t={},e=0;e<this.changedOptions.length;e++)this._constructOptions(this.changedOptions[e].value,this.changedOptions[e].path,t);return t}}]),t}(),Xl=!1,Hl="background: #FFeeee; color: #dd0000",Ul=ll,ql=Wl,Zl=Vl,$l=sl,Ql=function(){function t(e,n){yr(this,t),this.container=e,this.overflowMethod=n||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}return gr(t,[{key:"setPosition",value:function(t,e){this.x=Po(t),this.y=Po(e)}},{key:"setText",value:function(t){if(t instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(t)}else this.frame.innerText=t}},{key:"show",value:function(t){if(void 0===t&&(t=!0),!0===t){var e=this.frame.clientHeight,n=this.frame.clientWidth,r=this.frame.parentNode.clientHeight,i=this.frame.parentNode.clientWidth,o=0,a=0;if("flip"==this.overflowMethod){var s=!1,l=!0;this.y-e<this.padding&&(l=!1),this.x+n>i-this.padding&&(s=!0),o=s?this.x-n:this.x,a=l?this.y-e:this.y}else(a=this.y-e)+e+this.padding>r&&(a=r-e-this.padding),a<this.padding&&(a=this.padding),(o=this.x)+n+this.padding>i&&(o=i-n-this.padding),o<this.padding&&(o=this.padding);this.frame.style.left=o+"px",this.frame.style.top=a+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}},{key:"hide",value:function(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}},{key:"destroy",value:function(){this.frame.parentNode.removeChild(this.frame)}}]),t}(),Kl=Hl,Jl=function(){function t(){yr(this,t)}return gr(t,null,[{key:"validate",value:function(e,n,r){Xl=!1,Gl=n;var i=n;return void 0!==r&&(i=n[r]),t.parse(e,i,[]),Xl}},{key:"parse",value:function(e,n,r){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.check(i,e,n,r)}},{key:"check",value:function(e,n,r,i){if(void 0!==r[e]||void 0!==r.__any__){var o=e,a=!0;void 0===r[e]&&void 0!==r.__any__&&(o="__any__",a="object"===t.getType(n[e]));var s=r[o];a&&void 0!==s.__type__&&(s=s.__type__),t.checkFields(e,n,r,o,s,i)}else t.getSuggestion(e,r,i)}},{key:"checkFields",value:function(e,n,r,i,o,a){var s=function(n){console.error("%c"+n+t.printLocation(a,e),Hl)},l=t.getType(n[e]),u=o[l];void 0!==u?"array"===t.getType(u)&&-1===zo(u).call(u,n[e])?(s('Invalid option detected in "'+e+'". Allowed values are:'+t.print(u)+' not "'+n[e]+'". '),Xl=!0):"object"===l&&"__any__"!==i&&(a=xl(a,e),t.parse(n[e],r[i],a)):void 0===o.any&&(s('Invalid type received for "'+e+'". Expected: '+t.print(bi(o))+". Received ["+l+'] "'+n[e]+'"'),Xl=!0)}},{key:"getType",value:function(t){var e=ei(t);return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":fi(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}},{key:"getSuggestion",value:function(e,n,r){var i,o=t.findInOptions(e,n,r,!1),a=t.findInOptions(e,Gl,[],!0);i=void 0!==o.indexMatch?" in "+t.printLocation(o.path,e,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+'"?\n\n':a.distance<=4&&o.distance>a.distance?" in "+t.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(a.path,a.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+t.printLocation(o.path,e):". Did you mean one of these: "+t.print(bi(n))+t.printLocation(r,e),console.error('%cUnknown option detected: "'+e+'"'+i,Hl),Xl=!0}},{key:"findInOptions",value:function(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=1e9,a="",s=[],l=e.toLowerCase(),u=void 0;for(var c in n){var h=void 0;if(void 0!==n[c].__type__&&!0===i){var f=t.findInOptions(e,n[c],xl(r,c));o>f.distance&&(a=f.closestMatch,s=f.path,o=f.distance,u=f.indexMatch)}else{var d;-1!==zo(d=c.toLowerCase()).call(d,l)&&(u=c),o>(h=t.levenshteinDistance(e,c))&&(a=c,s=wl(r),o=h)}}return{closestMatch:a,path:s,distance:o,indexMatch:u}}},{key:"printLocation",value:function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",r="\n\n"+n+"options = {\n",i=0;i<t.length;i++){for(var o=0;o<i+1;o++)r+=" ";r+=t[i]+": {\n"}for(var a=0;a<t.length+1;a++)r+=" ";r+=e+"\n";for(var s=0;s<t.length+1;s++){for(var l=0;l<t.length-s;l++)r+=" ";r+="}\n"}return r+"\n\n"}},{key:"print",value:function(t){return Ko(t).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}},{key:"levenshteinDistance",value:function(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;var n,r,i=[];for(n=0;n<=e.length;n++)i[n]=[n];for(r=0;r<=t.length;r++)i[0][r]=r;for(n=1;n<=e.length;n++)for(r=1;r<=t.length;r++)e.charAt(n-1)==t.charAt(r-1)?i[n][r]=i[n-1][r-1]:i[n][r]=Math.min(i[n-1][r-1]+1,Math.min(i[n][r-1]+1,i[n-1][r]+1));return i[e.length][t.length]}}]),t}(),tu=Object.freeze({__proto__:null,Activator:Ul,Alea:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ol(e.length?e:[_i()])},ColorPicker:ql,Configurator:Zl,DELETE:Js,HSVToHex:Fl,HSVToRGB:Ml,Hammer:$l,Popup:Ql,RGBToHSV:Pl,RGBToHex:Ol,VALIDATOR_PRINT_STYLE:Kl,Validator:Jl,addClassName:function(t,e){var n=t.className.split(" "),r=e.split(" ");n=ui(n).call(n,vo(r).call(r,(function(t){return!ao(n).call(n,t)}))),t.className=n.join(" ")},addCssText:function(t,e){var n=Dl(t.style.cssText),r=Dl(e),i=$s($s({},n),r);t.style.cssText=Ll(i)},addEventListener:Cl,binarySearchCustom:function(t,e,n,r){for(var i=0,o=0,a=t.length-1;o<=a&&i<1e4;){var s=Math.floor((o+a)/2),l=t[s],u=e(void 0===r?l[n]:l[n][r]);if(0==u)return s;-1==u?o=s+1:a=s-1,i++}return-1},binarySearchValue:function(t,e,n,r,i){var o,a,s,l,u=0,c=0,h=t.length-1;for(i=null!=i?i:function(t,e){return t==e?0:t<e?-1:1};c<=h&&u<1e4;){if(l=Math.floor(.5*(h+c)),o=t[Math.max(0,l-1)][n],a=t[l][n],s=t[Math.min(t.length-1,l+1)][n],0==i(a,e))return l;if(i(o,e)<0&&i(a,e)>0)return"before"==r?Math.max(0,l-1):l;if(i(a,e)<0&&i(s,e)>0)return"before"==r?l:Math.min(t.length-1,l+1);i(a,e)<0?c=l+1:h=l-1,u++}return-1},bridgeObject:Bl,copyAndExtendArray:xl,copyArray:wl,deepExtend:_l,deepObjectAssign:el,easingFunctions:{linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},equalArray:function(t,e){if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!=e[n])return!1;return!0},extend:gl,fillIfDefined:function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var i in e)if(void 0!==n[i])if(null===n[i]||"object"!==ei(n[i]))ml(e,n,i,r);else{var o=e[i],a=n[i];yl(o)&&yl(a)&&t(o,a,r)}},forEach:function(t,e){if(fi(t))for(var n=t.length,r=0;r<n;r++)e(t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e(t[i],i,t)},getAbsoluteLeft:function(t){return t.getBoundingClientRect().left},getAbsoluteRight:function(t){return t.getBoundingClientRect().right},getAbsoluteTop:function(t){return t.getBoundingClientRect().top},getScrollBarWidth:function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var n=t.offsetWidth;e.style.overflow="scroll";var r=t.offsetWidth;return n==r&&(r=e.clientWidth),document.body.removeChild(e),n-r},getTarget:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,e=null;return t&&(t.target?e=t.target:t.srcElement&&(e=t.srcElement)),e instanceof Element&&(null==e.nodeType||3!=e.nodeType||(e=e.parentNode)instanceof Element)?e:null},getType:function(t){var e=ei(t);return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":fi(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e},hasParent:function(t,e){for(var n=t;n;){if(n===e)return!0;if(!n.parentNode)return!1;n=n.parentNode}return!1},hexToHSV:Rl,hexToRGB:Al,insertSort:function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=void 0;for(i=n;i>0&&e(r,t[i-1])<0;i--)t[i]=t[i-1];t[i]=r}return t},isDate:function(t){if(t instanceof Date)return!0;if(vl(t)){if(ul.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1},isNumber:pl,isObject:yl,isString:vl,isValidHex:Il,isValidRGB:jl,isValidRGBA:zl,mergeOptions:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=function(t){return null!=t},o=function(t){return null!==t&&"object"===ei(t)},a=function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0};if(!o(t))throw new Error("Parameter mergeTarget must be an object");if(!o(e))throw new Error("Parameter options must be an object");if(!i(n))throw new Error("Parameter option must have a value");if(!o(r))throw new Error("Parameter globalOptions must be an object");var s=function(t,e,n){o(t[n])||(t[n]={});var r=e[n],i=t[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a])},l=e[n],u=o(r)&&!a(r),c=u?r[n]:void 0,h=c?c.enabled:void 0;if(void 0!==l){if("boolean"==typeof l)return o(t[n])||(t[n]={}),void(t[n].enabled=l);if(null===l&&!o(t[n])){if(!i(c))return;t[n]=Xo(c)}if(o(l)){var f=!0;void 0!==l.enabled?f=l.enabled:void 0!==h&&(f=c.enabled),s(t,e,n),t[n].enabled=f}}},option:Tl,overrideOpacity:function(t,e){if(ao(t).call(t,"rgba"))return t;if(ao(t).call(t,"rgb")){var n=t.substr(zo(t).call(t,"(")+1).replace(")","").split(",");return"rgba("+n[0]+","+n[1]+","+n[2]+","+e+")"}var r=Al(t);return null==r?t:"rgba("+r.r+","+r.g+","+r.b+","+e+")"},parseColor:function(t,e){if(vl(t)){var n=t;if(jl(n)){var r,i=mi(r=n.substr(4).substr(0,n.length-5).split(",")).call(r,(function(t){return Po(t)}));n=Ol(i[0],i[1],i[2])}if(!0===Il(n)){var o=Rl(n),a={h:o.h,s:.8*o.s,v:Math.min(1,1.02*o.v)},s={h:o.h,s:Math.min(1,1.25*o.s),v:.8*o.v},l=Fl(s.h,s.s,s.v),u=Fl(a.h,a.s,a.v);return{background:n,border:l,highlight:{background:u,border:l},hover:{background:u,border:l}}}return{background:n,border:n,highlight:{background:n,border:n},hover:{background:n,border:n}}}return e?{background:t.background||e.background,border:t.border||e.border,highlight:vl(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||e.highlight.background,border:t.highlight&&t.highlight.border||e.highlight.border},hover:vl(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||e.hover.border,background:t.hover&&t.hover.background||e.hover.background}}:{background:t.background||void 0,border:t.border||void 0,highlight:vl(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||void 0,border:t.highlight&&t.highlight.border||void 0},hover:vl(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}},preventDefault:Sl,pureDeepObjectAssign:tl,recursiveDOMDelete:function t(e){if(e)for(;!0===e.hasChildNodes();){var n=e.firstChild;n&&(t(n),e.removeChild(n))}},removeClassName:function(t,e){var n=t.className.split(" "),r=e.split(" ");n=vo(n).call(n,(function(t){return!ao(r).call(r,t)})),t.className=n.join(" ")},removeCssText:function(t,e){var n=Dl(t.style.cssText),r=Dl(e);for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&delete n[i];t.style.cssText=Ll(n)},removeEventListener:El,selectiveBridgeObject:function(t,e){if(null!==e&&"object"===ei(e)){for(var n=Xo(e),r=0;r<t.length;r++)Object.prototype.hasOwnProperty.call(e,t[r])&&"object"==ei(e[t[r]])&&(n[t[r]]=Bl(e[t[r]]));return n}return null},selectiveDeepExtend:bl,selectiveExtend:function(t,e){if(!fi(t))throw new Error("Array with property names expected as first argument");for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];for(var o=0,a=r;o<a.length;o++)for(var s=a[o],l=0;l<t.length;l++){var u=t[l];s&&Object.prototype.hasOwnProperty.call(s,u)&&(e[u]=s[u])}return e},selectiveNotDeepExtend:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(fi(n))throw new TypeError("Arrays are not supported by deepExtend");for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&!ao(t).call(t,i))if(n[i]&&n[i].constructor===Object)void 0===e[i]&&(e[i]={}),e[i].constructor===Object?_l(e[i],n[i]):ml(e,n,i,r);else if(fi(n[i])){e[i]=[];for(var o=0;o<n[i].length;o++)e[i].push(n[i][o])}else ml(e,n,i,r);return e},throttle:function(t){var e=!1;return function(){e||(e=!0,requestAnimationFrame((function(){e=!1,t()})))}},toArray:kl,topMost:function(t,e){var n;fi(e)||(e=[e]);var r,i=Qs(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o){n=o[e[0]];for(var a=1;a<e.length;a++)n&&(n=n[e[a]]);if(void 0!==n)break}}}catch(t){i.e(t)}finally{i.f()}return n},updateProperty:function(t,e,n){return t[e]!==n&&(t[e]=n,!0)}}),eu=s((function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var n=0;n<t[e].redundant.length;n++)t[e].redundant[n].parentNode.removeChild(t[e].redundant[n]);t[e].redundant=[]}},e.resetElements=function(t){e.prepareElements(t),e.cleanupElements(t),e.prepareElements(t)},e.getSVGElement=function(t,e,n){var r;return e.hasOwnProperty(t)?e[t].redundant.length>0?(r=e[t].redundant[0],e[t].redundant.shift()):(r=document.createElementNS("http://www.w3.org/2000/svg",t),n.appendChild(r)):(r=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},n.appendChild(r)),e[t].used.push(r),r},e.getDOMElement=function(t,e,n,r){var i;return e.hasOwnProperty(t)?e[t].redundant.length>0?(i=e[t].redundant[0],e[t].redundant.shift()):(i=document.createElement(t),void 0!==r?n.insertBefore(i,r):n.appendChild(i)):(i=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==r?n.insertBefore(i,r):n.appendChild(i)),e[t].used.push(i),i},e.drawPoint=function(t,n,r,i,o,a){var s;if("circle"==r.style?((s=e.getSVGElement("circle",i,o)).setAttributeNS(null,"cx",t),s.setAttributeNS(null,"cy",n),s.setAttributeNS(null,"r",.5*r.size)):((s=e.getSVGElement("rect",i,o)).setAttributeNS(null,"x",t-.5*r.size),s.setAttributeNS(null,"y",n-.5*r.size),s.setAttributeNS(null,"width",r.size),s.setAttributeNS(null,"height",r.size)),void 0!==r.styles&&s.setAttributeNS(null,"style",r.styles),s.setAttributeNS(null,"class",r.className+" vis-point"),a){var l=e.getSVGElement("text",i,o);a.xOffset&&(t+=a.xOffset),a.yOffset&&(n+=a.yOffset),a.content&&(l.textContent=a.content),a.className&&l.setAttributeNS(null,"class",a.className+" vis-label"),l.setAttributeNS(null,"x",t),l.setAttributeNS(null,"y",n)}return s},e.drawBar=function(t,n,r,i,o,a,s,l){if(0!=i){i<0&&(n-=i*=-1);var u=e.getSVGElement("rect",a,s);u.setAttributeNS(null,"x",t-.5*r),u.setAttributeNS(null,"y",n),u.setAttributeNS(null,"width",r),u.setAttributeNS(null,"height",i),u.setAttributeNS(null,"class",o),l&&u.setAttributeNS(null,"style",l)}}}));eu.prepareElements,eu.cleanupElements,eu.resetElements,eu.getSVGElement,eu.getDOMElement,eu.drawPoint,eu.drawBar;var nu=p("Reflect","construct"),ru=x((function(){function t(){}return!(nu((function(){}),[],t)instanceof t)})),iu=!x((function(){nu((function(){}))})),ou=ru||iu;Vt({target:"Reflect",stat:!0,forced:ou,sham:ou},{construct:function(t,e){Nt(t),V(e);var n=arguments.length<3?t:Nt(arguments[2]);if(iu&&!ru)return nu(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(Ci.apply(t,r))}var i=n.prototype,o=ge(z(i)?i:Object.prototype),a=Function.apply.call(t,o,e);return z(a)?a:o}});var au=i.Reflect.construct,su=s((function(t){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0})),lu=a(su),uu=Vo;Vt({target:"Object",stat:!0},{setPrototypeOf:De});var cu=i.Object.setPrototypeOf,hu=s((function(t){function e(n,r){return t.exports=e=cu||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,e(n,r)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0}));a(hu);var fu=a(s((function(t){t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=uu(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&hu(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0}))),du=a(s((function(t){var e=ti.default;t.exports=function(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return su(t)},t.exports.default=t.exports,t.exports.__esModule=!0}))),pu=lo,vu=a(s((function(t){function e(n){return t.exports=e=cu?pu:function(t){return t.__proto__||pu(t)},t.exports.default=t.exports,t.exports.__esModule=!0,e(n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0}))),yu=s((function(t){var e=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),a=new A(r||[]);return o._invoke=function(t,e,n){var r=h;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var l=c(t,e,n);if("normal"===l.type){if(r=n.done?p:f,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=p,n.method="throw",n.arg=l.arg)}}}(t,n,a),o}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h="suspendedStart",f="suspendedYield",d="executing",p="completed",v={};function y(){}function m(){}function g(){}var b={};b[o]=function(){return this};var _=Object.getPrototypeOf,x=_&&_(_(O([])));x&&x!==n&&r.call(x,o)&&(b=x);var w=g.prototype=y.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){var n;this._invoke=function(i,o){function a(){return new e((function(n,a){!function n(i,o,a,s){var l=c(t[i],t,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(l.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function E(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=c(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function O(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:P}}function P(){return{value:e,done:!0}}return m.prototype=w.constructor=g,g.constructor=m,m.displayName=l(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},k(C.prototype),C.prototype[a]=function(){return this},t.AsyncIterator=C,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new C(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(w),l(w,s,"Generator"),w[o]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:O(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}})),mu=function(t){return function(e,n,r,i){Nt(n);var o=H(e),a=Ot(o),s=ee(o.length),l=t?s-1:0,u=t?-1:1;if(r<2)for(;;){if(l in a){i=a[l],l+=u;break}if(l+=u,t?l<0:s<=l)throw TypeError("Reduce of empty array with no initial value")}for(;t?l>=0:s>l;l+=u)l in a&&(i=n(i,a[l],l,o));return i}},gu={left:mu(!1),right:mu(!0)},bu="process"==Tt(f.process),_u=gu.left,xu=Ai("reduce");Vt({target:"Array",proto:!0,forced:!xu||!bu&&_>79&&_<83},{reduce:function(t){return _u(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var wu=Yr("Array").reduce,ku=Array.prototype,Cu=function(t){var e=t.reduce;return t===ku||t instanceof Array&&e===ku.reduce?wu:e},Eu=function(t,e,n,r,i,o,a,s){for(var l,u=i,c=0,h=!!a&&Wt(a,s,3);c<r;){if(c in n){if(l=h?h(n[c],c,e):n[c],o>0&&yn(l))u=Eu(t,e,l,ee(l.length),u,o-1)-1;else{if(u>=9007199254740991)throw TypeError("Exceed the acceptable array length");t[u]=l}u++}c++}return u},Su=Eu;Vt({target:"Array",proto:!0},{flatMap:function(t){var e,n=H(this),r=ee(n.length);return Nt(t),(e=An(n,0)).length=Su(e,n,n,r,0,1,t,arguments.length>1?arguments[1]:void 0),e}});var Tu=Yr("Array").flatMap,Au=Array.prototype,Ou=function(t){var e=t.flatMap;return t===Au||t instanceof Array&&e===Au.flatMap?Tu:e},Pu=!x((function(){return Object.isExtensible(Object.preventExtensions({}))})),Du=s((function(t){var e=at.f,n=!1,r=Q("meta"),i=0,o=Object.isExtensible||function(){return!0},a=function(t){e(t,r,{value:{objectID:"O"+i++,weakData:{}}})},s=t.exports={enable:function(){s.enable=function(){},n=!0;var t=gn.f,e=[].splice,i={};i[r]=1,t(i).length&&(gn.f=function(n){for(var i=t(n),o=0,a=i.length;o<a;o++)if(i[o]===r){e.call(i,o,1);break}return i},Vt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:wn.f}))},fastKey:function(t,e){if(!z(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!q(t,r)){if(!o(t))return"F";if(!e)return"E";a(t)}return t[r].objectID},getWeakData:function(t,e){if(!q(t,r)){if(!o(t))return!0;if(!e)return!1;a(t)}return t[r].weakData},onFreeze:function(t){return Pu&&n&&o(t)&&!q(t,r)&&a(t),t}};ht[r]=!0}));Du.enable,Du.fastKey,Du.getWeakData,Du.onFreeze;var Lu=function(t,e){this.stopped=t,this.result=e},Mu=function(t,e,n){var r,i,o,a,s,l,u,c=n&&n.that,h=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_ITERATOR),d=!(!n||!n.INTERRUPTED),p=Wt(e,c,1+h+d),v=function(t){return r&&Xe(r),new Lu(!0,t)},y=function(t){return h?(V(t),d?p(t[0],t[1],v):p(t[0],t[1])):d?p(t,v):p(t)};if(f)r=t;else{if("function"!=typeof(i=Ke(t)))throw TypeError("Target is not iterable");if(Ze(i)){for(o=0,a=ee(t.length);a>o;o++)if((s=y(t[o]))&&s instanceof Lu)return s;return new Lu(!1)}r=i.call(t)}for(l=r.next;!(u=l.call(r)).done;){try{s=y(u.value)}catch(t){throw Xe(r),t}if("object"==typeof s&&s&&s instanceof Lu)return s}return new Lu(!1)},Fu=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t},Ru=at.f,Iu=Dn.forEach,ju=wt.set,zu=wt.getterFor,Bu=function(t,e,n){var r,i=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),a=i?"set":"add",s=f[t],l=s&&s.prototype,u={};if(B&&"function"==typeof s&&(o||l.forEach&&!x((function(){(new s).entries().next()})))){r=e((function(e,n){ju(Fu(e,r,t),{type:t,collection:new s}),null!=n&&Mu(n,e[a],{that:e,AS_ENTRIES:i})}));var c=zu(t);Iu(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var e="add"==t||"set"==t;!(t in l)||o&&"clear"==t||lt(r.prototype,t,(function(n,r){var i=c(this).collection;if(!e&&o&&!z(n))return"get"==t&&void 0;var a=i[t](0===n?0:n,r);return e?this:a}))})),o||Ru(r.prototype,"size",{configurable:!0,get:function(){return c(this).collection.size}})}else r=n.getConstructor(e,t,i,a),Du.enable();return Te(r,t,!1,!0),u[t]=r,Vt({global:!0,forced:!0},u),o||n.setStrong(r,t,i),r},Nu=function(t,e,n){for(var r in e)n&&n.unsafe&&t[r]?t[r]=e[r]:Le(t,r,e[r],n);return t},Wu=et("species"),Yu=at.f,Gu=Du.fastKey,Vu=wt.set,Xu=wt.getterFor,Hu={getConstructor:function(t,e,n,r){var i=t((function(t,o){Fu(t,i,e),Vu(t,{type:e,index:ge(null),first:void 0,last:void 0,size:0}),B||(t.size=0),null!=o&&Mu(o,t[r],{that:t,AS_ENTRIES:n})})),o=Xu(e),a=function(t,e,n){var r,i,a=o(t),l=s(t,e);return l?l.value=n:(a.last=l={index:i=Gu(e,!0),key:e,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=l),r&&(r.next=l),B?a.size++:t.size++,"F"!==i&&(a.index[i]=l)),t},s=function(t,e){var n,r=o(t),i=Gu(e);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==e)return n};return Nu(i.prototype,{clear:function(){for(var t=o(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,B?t.size=0:this.size=0},delete:function(t){var e=this,n=o(e),r=s(e,t);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first==r&&(n.first=i),n.last==r&&(n.last=a),B?n.size--:e.size--}return!!r},forEach:function(t){for(var e,n=o(this),r=Wt(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!s(this,t)}}),Nu(i.prototype,n?{get:function(t){var e=s(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),B&&Yu(i.prototype,"size",{get:function(){return o(this).size}}),i},setStrong:function(t,e,n){var r=e+" Iterator",i=Xu(e),o=Xu(r);Ne(t,e,(function(t,e){Vu(this,{type:r,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),function(t){var e=p(t),n=at.f;B&&e&&!e[Wu]&&n(e,Wu,{configurable:!0,get:function(){return this}})}(e)}};Bu("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Hu);var Uu=i.Map;Bu("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Hu);var qu=i.Set,Zu=Kr,$u=function(t){var e=Ke(t);if("function"!=typeof e)throw TypeError(String(t)+" is not iterable");return V(e.call(t))},Qu=Math.floor,Ku=function(t,e){var n=t.length,r=Qu(n/2);return n<8?Ju(t,e):tc(Ku(t.slice(0,r),e),Ku(t.slice(r),e),e)},Ju=function(t,e){for(var n,r,i=t.length,o=1;o<i;){for(r=o,n=t[o];r&&e(t[r-1],n)>0;)t[r]=t[--r];r!==o++&&(t[r]=n)}return t},tc=function(t,e,n){for(var r=t.length,i=e.length,o=0,a=0,s=[];o<r||a<i;)o<r&&a<i?s.push(n(t[o],e[a])<=0?t[o++]:e[a++]):s.push(o<r?t[o++]:e[a++]);return s},ec=Ku,nc=v.match(/firefox\/(\d+)/i),rc=!!nc&&+nc[1],ic=/MSIE|Trident/.test(v),oc=v.match(/AppleWebKit\/(\d+)\./),ac=!!oc&&+oc[1],sc=[],lc=sc.sort,uc=x((function(){sc.sort(void 0)})),cc=x((function(){sc.sort(null)})),hc=Ai("sort"),fc=!x((function(){if(_)return _<70;if(!(rc&&rc>3)){if(ic)return!0;if(ac)return ac<603;var t,e,n,r,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)sc.push({k:e+r,v:n})}for(sc.sort((function(t,e){return e.v-t.v})),r=0;r<sc.length;r++)e=sc[r].k.charAt(0),i.charAt(i.length-1)!==e&&(i+=e);return"DGBEFHACIJK"!==i}}));Vt({target:"Array",proto:!0,forced:uc||!cc||!hc||!fc},{sort:function(t){void 0!==t&&Nt(t);var e=H(this);if(fc)return void 0===t?lc.call(e):lc.call(e,t);var n,r,i=[],o=ee(e.length);for(r=0;r<o;r++)r in e&&i.push(e[r]);for(n=(i=ec(i,function(t){return function(e,n){return void 0===n?-1:void 0===e?1:void 0!==t?+t(e,n)||0:E(e)>E(n)?1:-1}}(t))).length,r=0;r<n;)e[r]=i[r++];for(;r<o;)delete e[r++];return e}});var dc=Yr("Array").sort,pc=Array.prototype,vc=function(t){var e=t.sort;return t===pc||t instanceof Array&&e===pc.sort?dc:e},yc=Dn.some,mc=Ai("some");Vt({target:"Array",proto:!0,forced:!mc},{some:function(t){return yc(this,t,arguments.length>1?arguments[1]:void 0)}});var gc,bc=Yr("Array").some,_c=Array.prototype,xc=function(t){var e=t.some;return t===_c||t instanceof Array&&e===_c.some?bc:e},wc=Yr("Array").keys,kc=Array.prototype,Cc={DOMTokenList:!0,NodeList:!0},Ec=function(t){var e=t.keys;return t===kc||t instanceof Array&&e===kc.keys||Cc.hasOwnProperty(ke(t))?wc:e},Sc=Yr("Array").values,Tc=Array.prototype,Ac={DOMTokenList:!0,NodeList:!0},Oc=function(t){var e=t.values;return t===Tc||t instanceof Array&&e===Tc.values||Ac.hasOwnProperty(ke(t))?Sc:e},Pc=Yr("Array").entries,Dc=Array.prototype,Lc={DOMTokenList:!0,NodeList:!0},Mc=function(t){var e=t.entries;return t===Dc||t instanceof Array&&e===Dc.entries||Lc.hasOwnProperty(ke(t))?Pc:e},Fc=new Uint8Array(16);function Rc(){if(!gc&&!(gc="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gc(Fc)}var Ic=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function jc(t){return"string"==typeof t&&Ic.test(t)}for(var zc=[],Bc=0;Bc<256;++Bc)zc.push((Bc+256).toString(16).substr(1));function Nc(t,e,n){var r=(t=t||{}).random||(t.rng||Rc)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(zc[t[e+0]]+zc[t[e+1]]+zc[t[e+2]]+zc[t[e+3]]+"-"+zc[t[e+4]]+zc[t[e+5]]+"-"+zc[t[e+6]]+zc[t[e+7]]+"-"+zc[t[e+8]]+zc[t[e+9]]+"-"+zc[t[e+10]]+zc[t[e+11]]+zc[t[e+12]]+zc[t[e+13]]+zc[t[e+14]]+zc[t[e+15]]).toLowerCase();if(!jc(n))throw TypeError("Stringified UUID is invalid");return n}(r)}function Wc(t,e){var n=bi(t);if(sr){var r=sr(t);e&&(r=vo(r).call(r,(function(e){return cr(t,e).enumerable}))),n.push.apply(n,r)}return n}function Yc(t){for(var e=1;e<arguments.length;e++){var n,r=null!=arguments[e]?arguments[e]:{};if(e%2)Fi(n=Wc(Object(r),!0)).call(n,(function(e){br(t,e,r[e])}));else if(fr)dr(t,fr(r));else{var i;Fi(i=Wc(Object(r))).call(i,(function(e){vr(t,e,cr(r,e))}))}}return t}function Gc(t){var e=function(){if("undefined"==typeof Reflect||!au)return!1;if(au.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(au(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=vu(t);if(e){var i=vu(this).constructor;n=au(r,arguments,i)}else n=r.apply(this,arguments);return du(this,n)}}function Vc(t,e){var n=void 0!==ai&&vn(t)||t["@@iterator"];if(!n){if(fi(t)||(n=function(t,e){var n;if(!t)return;if("string"==typeof t)return Xc(t,e);var r=ci(n=Object.prototype.toString.call(t)).call(n,8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return an(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Xc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Hc=function(){function t(e,n,r){var i,o,a;yr(this,t),this._source=e,this._transformers=n,this._target=r,this._listeners={add:Ti(i=this._add).call(i,this),remove:Ti(o=this._remove).call(o,this),update:Ti(a=this._update).call(a,this)}}return gr(t,[{key:"all",value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:"start",value:function(){return this._source.on("add",this._listeners.add),this._source.on("remove",this._listeners.remove),this._source.on("update",this._listeners.update),this}},{key:"stop",value:function(){return this._source.off("add",this._listeners.add),this._source.off("remove",this._listeners.remove),this._source.off("update",this._listeners.update),this}},{key:"_transformItems",value:function(t){var e;return Cu(e=this._transformers).call(e,(function(t,e){return e(t)}),t)}},{key:"_add",value:function(t,e){null!=e&&this._target.add(this._transformItems(this._source.get(e.items)))}},{key:"_update",value:function(t,e){null!=e&&this._target.update(this._transformItems(this._source.get(e.items)))}},{key:"_remove",value:function(t,e){null!=e&&this._target.remove(this._transformItems(e.oldData))}}]),t}(),Uc=function(){function t(e){yr(this,t),this._source=e,this._transformers=[]}return gr(t,[{key:"filter",value:function(t){return this._transformers.push((function(e){return vo(e).call(e,t)})),this}},{key:"map",value:function(t){return this._transformers.push((function(e){return mi(e).call(e,t)})),this}},{key:"flatMap",value:function(t){return this._transformers.push((function(e){return Ou(e).call(e,t)})),this}},{key:"to",value:function(t){return new Hc(this._source,this._transformers,t)}}]),t}();function qc(t){return"string"==typeof t||"number"==typeof t}var Zc=function(){function t(e){yr(this,t),this._queue=[],this._timeout=null,this._extended=null,this.delay=null,this.max=1/0,this.setOptions(e)}return gr(t,[{key:"setOptions",value:function(t){t&&void 0!==t.delay&&(this.delay=t.delay),t&&void 0!==t.max&&(this.max=t.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var t=this._extended.object,e=this._extended.methods,n=0;n<e.length;n++){var r=e[n];r.original?t[r.name]=r.original:delete t[r.name]}this._extended=null}}},{key:"replace",value:function(t,e){var n=this,r=t[e];if(!r)throw new Error("Method "+e+" undefined");t[e]=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];n.queue({args:e,fn:r,context:this})}}},{key:"queue",value:function(t){"function"==typeof t?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var t=this;this._queue.length>this.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=na((function(){t.flush()}),this.delay))}},{key:"flush",value:function(){var t,e;Fi(t=Ui(e=this._queue).call(e,0)).call(t,(function(t){t.fn.apply(t.context||t.fn,t.args||[])}))}}],[{key:"extend",value:function(e,n){var r=new t(n);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){r.flush()};var i=[{name:"flush",original:void 0}];if(n&&n.replace)for(var o=0;o<n.replace.length;o++){var a=n.replace[o];i.push({name:a,original:e[a]}),r.replace(e,a)}return r._extended={object:e,methods:i},r}}]),t}(),$c=function(){function t(){yr(this,t),this._subscribers={"*":[],add:[],remove:[],update:[]},this.subscribe=t.prototype.on,this.unsubscribe=t.prototype.off}return gr(t,[{key:"_trigger",value:function(t,e,n){var r,i;if("*"===t)throw new Error("Cannot trigger event *");Fi(r=ui(i=[]).call(i,oi(this._subscribers[t]),oi(this._subscribers["*"]))).call(r,(function(r){r(t,e,null!=n?n:null)}))}},{key:"on",value:function(t,e){"function"==typeof e&&this._subscribers[t].push(e)}},{key:"off",value:function(t,e){var n;this._subscribers[t]=vo(n=this._subscribers[t]).call(n,(function(t){return t!==e}))}}]),t}(),Qc=function(t){function e(t){yr(this,e),this._pairs=t}return gr(e,[{key:t,value:yu.mark((function t(){var e,n,r,i,o;return yu.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=Vc(this._pairs),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=9;break}return r=Qr(n.value,2),i=r[0],o=r[1],t.next=7,[i,o];case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"entries",value:yu.mark((function t(){var e,n,r,i,o;return yu.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=Vc(this._pairs),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=9;break}return r=Qr(n.value,2),i=r[0],o=r[1],t.next=7,[i,o];case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"keys",value:yu.mark((function t(){var e,n,r,i;return yu.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=Vc(this._pairs),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=9;break}return r=Qr(n.value,1),i=r[0],t.next=7,i;case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"values",value:yu.mark((function t(){var e,n,r,i;return yu.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=Vc(this._pairs),t.prev=1,e.s();case 3:if((n=e.n()).done){t.next=9;break}return r=Qr(n.value,2),i=r[1],t.next=7,i;case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"toIdArray",value:function(){var t;return mi(t=oi(this._pairs)).call(t,(function(t){return t[0]}))}},{key:"toItemArray",value:function(){var t;return mi(t=oi(this._pairs)).call(t,(function(t){return t[1]}))}},{key:"toEntryArray",value:function(){return oi(this._pairs)}},{key:"toObjectMap",value:function(){var t,e=Xo(null),n=Vc(this._pairs);try{for(n.s();!(t=n.n()).done;){var r=Qr(t.value,2),i=r[0],o=r[1];e[i]=o}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"toMap",value:function(){return new Uu(this._pairs)}},{key:"toIdSet",value:function(){return new qu(this.toIdArray())}},{key:"toItemSet",value:function(){return new qu(this.toItemArray())}},{key:"cache",value:function(){return new e(oi(this._pairs))}},{key:"distinct",value:function(t){var e,n=new qu,r=Vc(this._pairs);try{for(r.s();!(e=r.n()).done;){var i=Qr(e.value,2),o=i[0],a=i[1];n.add(t(a,o))}}catch(t){r.e(t)}finally{r.f()}return n}},{key:"filter",value:function(t){var n=this._pairs;return new e(br({},Zu,yu.mark((function e(){var r,i,o,a,s;return yu.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Vc(n),e.prev=1,r.s();case 3:if((i=r.n()).done){e.next=10;break}if(o=Qr(i.value,2),a=o[0],s=o[1],!t(s,a)){e.next=8;break}return e.next=8,[a,s];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),r.e(e.t0);case 15:return e.prev=15,r.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])}))))}},{key:"forEach",value:function(t){var e,n=Vc(this._pairs);try{for(n.s();!(e=n.n()).done;){var r=Qr(e.value,2),i=r[0];t(r[1],i)}}catch(t){n.e(t)}finally{n.f()}}},{key:"map",value:function(t){var n=this._pairs;return new e(br({},Zu,yu.mark((function e(){var r,i,o,a,s;return yu.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Vc(n),e.prev=1,r.s();case 3:if((i=r.n()).done){e.next=9;break}return o=Qr(i.value,2),a=o[0],s=o[1],e.next=7,[a,t(s,a)];case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),r.e(e.t0);case 14:return e.prev=14,r.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])}))))}},{key:"max",value:function(t){var e=$u(this._pairs),n=e.next();if(n.done)return null;for(var r=n.value[1],i=t(n.value[1],n.value[0]);!(n=e.next()).done;){var o=Qr(n.value,2),a=o[0],s=o[1],l=t(s,a);l>i&&(i=l,r=s)}return r}},{key:"min",value:function(t){var e=$u(this._pairs),n=e.next();if(n.done)return null;for(var r=n.value[1],i=t(n.value[1],n.value[0]);!(n=e.next()).done;){var o=Qr(n.value,2),a=o[0],s=o[1],l=t(s,a);l<i&&(i=l,r=s)}return r}},{key:"reduce",value:function(t,e){var n,r=Vc(this._pairs);try{for(r.s();!(n=r.n()).done;){var i=Qr(n.value,2),o=i[0];e=t(e,i[1],o)}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"sort",value:function(t){var n=this;return new e(br({},Zu,(function(){var e;return $u(vc(e=oi(n._pairs)).call(e,(function(e,n){var r=Qr(e,2),i=r[0],o=r[1],a=Qr(n,2),s=a[0],l=a[1];return t(o,l,i,s)})))})))}}]),e}(Zu);var Kc=function(t){fu(n,t);var e=Gc(n);function n(t,r){var i;return yr(this,n),(i=e.call(this))._queue=null,t&&!fi(t)&&(r=t,t=[]),i._options=r||{},i._data=new Uu,i.length=0,i._idProp=i._options.fieldId||"id",t&&t.length&&i.add(t),i.setOptions(r),i}return gr(n,[{key:"idProp",get:function(){return this._idProp}},{key:"setOptions",value:function(t){t&&void 0!==t.queue&&(!1===t.queue?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Zc.extend(this,{replace:["add","update","remove"]})),t.queue&&"object"===ei(t.queue)&&this._queue.setOptions(t.queue)))}},{key:"add",value:function(t,e){var n,r=this,i=[];if(fi(t)){var o=mi(t).call(t,(function(t){return t[r._idProp]}));if(xc(o).call(o,(function(t){return r._data.has(t)})))throw new Error("A duplicate id was found in the parameter array.");for(var a=0,s=t.length;a<s;a++)n=this._addItem(t[a]),i.push(n)}else{if(!t||"object"!==ei(t))throw new Error("Unknown dataType");n=this._addItem(t),i.push(n)}return i.length&&this._trigger("add",{items:i},e),i}},{key:"update",value:function(t,e){var n=this,r=[],i=[],o=[],a=[],s=this._idProp,l=function(t){var e=t[s];if(null!=e&&n._data.has(e)){var l=t,u=Qi({},n._data.get(e)),c=n._updateItem(l);i.push(c),a.push(l),o.push(u)}else{var h=n._addItem(t);r.push(h)}};if(fi(t))for(var u=0,c=t.length;u<c;u++)t[u]&&"object"===ei(t[u])?l(t[u]):console.warn("Ignoring input item, which is not an object at index "+u);else{if(!t||"object"!==ei(t))throw new Error("Unknown dataType");l(t)}if(r.length&&this._trigger("add",{items:r},e),i.length){var h={items:i,oldData:o,data:a};this._trigger("update",h,e)}return ui(r).call(r,i)}},{key:"updateOnly",value:function(t,e){var n,r=this;fi(t)||(t=[t]);var i=mi(n=mi(t).call(t,(function(t){var e=r._data.get(t[r._idProp]);if(null==e)throw new Error("Updating non-existent items is not allowed.");return{oldData:e,update:t}}))).call(n,(function(t){var e=t.oldData,n=t.update,i=e[r._idProp],o=tl(e,n);return r._data.set(i,o),{id:i,oldData:e,updatedData:o}}));if(i.length){var o={items:mi(i).call(i,(function(t){return t.id})),oldData:mi(i).call(i,(function(t){return t.oldData})),data:mi(i).call(i,(function(t){return t.updatedData}))};return this._trigger("update",o,e),o.items}return[]}},{key:"get",value:function(t,e){var n=void 0,r=void 0,i=void 0;qc(t)?(n=t,i=e):fi(t)?(r=t,i=e):i=t;var o,a=i&&"Object"===i.returnType?"Object":"Array",s=i&&vo(i),l=[],u=void 0,c=void 0,h=void 0;if(null!=n)(u=this._data.get(n))&&s&&!s(u)&&(u=void 0);else if(null!=r)for(var f=0,d=r.length;f<d;f++)null==(u=this._data.get(r[f]))||s&&!s(u)||l.push(u);else for(var p,v=0,y=(c=oi(Ec(p=this._data).call(p))).length;v<y;v++)h=c[v],null==(u=this._data.get(h))||s&&!s(u)||l.push(u);if(i&&i.order&&null==n&&this._sort(l,i.order),i&&i.fields){var m=i.fields;if(null!=n&&null!=u)u=this._filterFields(u,m);else for(var g=0,b=l.length;g<b;g++)l[g]=this._filterFields(l[g],m)}if("Object"==a){for(var _={},x=0,w=l.length;x<w;x++){var k=l[x];_[k[this._idProp]]=k}return _}return null!=n?null!==(o=u)&&void 0!==o?o:null:l}},{key:"getIds",value:function(t){var e=this._data,n=t&&vo(t),r=t&&t.order,i=oi(Ec(e).call(e)),o=[];if(n)if(r){for(var a=[],s=0,l=i.length;s<l;s++){var u=i[s],c=this._data.get(u);null!=c&&n(c)&&a.push(c)}this._sort(a,r);for(var h=0,f=a.length;h<f;h++)o.push(a[h][this._idProp])}else for(var d=0,p=i.length;d<p;d++){var v=i[d],y=this._data.get(v);null!=y&&n(y)&&o.push(y[this._idProp])}else if(r){for(var m=[],g=0,b=i.length;g<b;g++){var _=i[g];m.push(e.get(_))}this._sort(m,r);for(var x=0,w=m.length;x<w;x++)o.push(m[x][this._idProp])}else for(var k=0,C=i.length;k<C;k++){var E=i[k],S=e.get(E);null!=S&&o.push(S[this._idProp])}return o}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(t,e){var n=e&&vo(e),r=this._data,i=oi(Ec(r).call(r));if(e&&e.order)for(var o=this.get(e),a=0,s=o.length;a<s;a++){var l=o[a];t(l,l[this._idProp])}else for(var u=0,c=i.length;u<c;u++){var h=i[u],f=this._data.get(h);null==f||n&&!n(f)||t(f,h)}}},{key:"map",value:function(t,e){for(var n=e&&vo(e),r=[],i=this._data,o=oi(Ec(i).call(i)),a=0,s=o.length;a<s;a++){var l=o[a],u=this._data.get(l);null==u||n&&!n(u)||r.push(t(u,l))}return e&&e.order&&this._sort(r,e.order),r}},{key:"_filterFields",value:function(t,e){var n;return t?Cu(n=fi(e)?e:bi(e)).call(n,(function(e,n){return e[n]=t[n],e}),{}):t}},{key:"_sort",value:function(t,e){if("string"==typeof e){var n=e;vc(t).call(t,(function(t,e){var r=t[n],i=e[n];return r>i?1:r<i?-1:0}))}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");vc(t).call(t,e)}}},{key:"remove",value:function(t,e){for(var n=[],r=[],i=fi(t)?t:[t],o=0,a=i.length;o<a;o++){var s=this._remove(i[o]);if(s){var l=s[this._idProp];null!=l&&(n.push(l),r.push(s))}}return n.length&&this._trigger("remove",{items:n,oldData:r},e),n}},{key:"_remove",value:function(t){var e;if(qc(t)?e=t:t&&"object"===ei(t)&&(e=t[this._idProp]),null!=e&&this._data.has(e)){var n=this._data.get(e)||null;return this._data.delete(e),--this.length,n}return null}},{key:"clear",value:function(t){for(var e,n=oi(Ec(e=this._data).call(e)),r=[],i=0,o=n.length;i<o;i++)r.push(this._data.get(n[i]));return this._data.clear(),this.length=0,this._trigger("remove",{items:n,oldData:r},t),n}},{key:"max",value:function(t){var e,n,r=null,i=null,o=Vc(Oc(e=this._data).call(e));try{for(o.s();!(n=o.n()).done;){var a=n.value,s=a[t];"number"==typeof s&&(null==i||s>i)&&(r=a,i=s)}}catch(t){o.e(t)}finally{o.f()}return r||null}},{key:"min",value:function(t){var e,n,r=null,i=null,o=Vc(Oc(e=this._data).call(e));try{for(o.s();!(n=o.n()).done;){var a=n.value,s=a[t];"number"==typeof s&&(null==i||s<i)&&(r=a,i=s)}}catch(t){o.e(t)}finally{o.f()}return r||null}},{key:"distinct",value:function(t){for(var e=this._data,n=oi(Ec(e).call(e)),r=[],i=0,o=0,a=n.length;o<a;o++){for(var s=n[o],l=e.get(s)[t],u=!1,c=0;c<i;c++)if(r[c]==l){u=!0;break}u||void 0===l||(r[i]=l,i++)}return r}},{key:"_addItem",value:function(t){var e=function(t,e){return null==t[e]&&(t[e]=Nc()),t}(t,this._idProp),n=e[this._idProp];if(this._data.has(n))throw new Error("Cannot add item: item with id "+n+" already exists");return this._data.set(n,e),++this.length,n}},{key:"_updateItem",value:function(t){var e=t[this._idProp];if(null==e)throw new Error("Cannot update item: item has no id (item: "+Ko(t)+")");var n=this._data.get(e);if(!n)throw new Error("Cannot update item: no item with id "+e+" found");return this._data.set(e,Yc(Yc({},n),t)),e}},{key:"stream",value:function(t){if(t){var e=this._data;return new Qc(br({},Zu,yu.mark((function n(){var r,i,o,a;return yu.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=Vc(t),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=11;break}if(o=i.value,null==(a=e.get(o))){n.next=9;break}return n.next=9,[o,a];case 9:n.next=3;break;case 11:n.next=16;break;case 13:n.prev=13,n.t0=n.catch(1),r.e(n.t0);case 16:return n.prev=16,r.f(),n.finish(16);case 19:case"end":return n.stop()}}),n,null,[[1,13,16,19]])}))))}var n;return new Qc(br({},Zu,Ti(n=Mc(this._data)).call(n,this._data)))}}]),n}($c),Jc=function(t){fu(n,t);var e=Gc(n);function n(t,r){var i,o;return yr(this,n),(o=e.call(this)).length=0,o._ids=new qu,o._options=r||{},o._listener=Ti(i=o._onEvent).call(i,lu(o)),o.setData(t),o}return gr(n,[{key:"idProp",get:function(){return this.getDataSet().idProp}},{key:"setData",value:function(t){if(this._data){this._data.off&&this._data.off("*",this._listener);var e=this._data.getIds({filter:vo(this._options)}),n=this._data.get(e);this._ids.clear(),this.length=0,this._trigger("remove",{items:e,oldData:n})}if(null!=t){this._data=t;for(var r=this._data.getIds({filter:vo(this._options)}),i=0,o=r.length;i<o;i++){var a=r[i];this._ids.add(a)}this.length=r.length,this._trigger("add",{items:r})}else this._data=new Kc;this._data.on&&this._data.on("*",this._listener)}},{key:"refresh",value:function(){for(var t=this._data.getIds({filter:vo(this._options)}),e=oi(this._ids),n={},r=[],i=[],o=[],a=0,s=t.length;a<s;a++){var l=t[a];n[l]=!0,this._ids.has(l)||(r.push(l),this._ids.add(l))}for(var u=0,c=e.length;u<c;u++){var h=e[u],f=this._data.get(h);null==f?console.error("If you see this, report it please."):n[h]||(i.push(h),o.push(f),this._ids.delete(h))}this.length+=r.length-i.length,r.length&&this._trigger("add",{items:r}),i.length&&this._trigger("remove",{items:i,oldData:o})}},{key:"get",value:function(t,e){if(null==this._data)return null;var n,r=null;qc(t)||fi(t)?(r=t,n=e):n=t;var i=Qi({},this._options,n),o=vo(this._options),a=n&&vo(n);return o&&a&&(i.filter=function(t){return o(t)&&a(t)}),null==r?this._data.get(i):this._data.get(r,i)}},{key:"getIds",value:function(t){if(this._data.length){var e,n=vo(this._options),r=null!=t?vo(t):null;return e=r?n?function(t){return n(t)&&r(t)}:r:n,this._data.getIds({filter:e,order:t&&t.order})}return[]}},{key:"forEach",value:function(t,e){if(this._data){var n,r,i=vo(this._options),o=e&&vo(e);r=o?i?function(t){return i(t)&&o(t)}:o:i,Fi(n=this._data).call(n,t,{filter:r,order:e&&e.order})}}},{key:"map",value:function(t,e){if(this._data){var n,r,i=vo(this._options),o=e&&vo(e);return r=o?i?function(t){return i(t)&&o(t)}:o:i,mi(n=this._data).call(n,t,{filter:r,order:e&&e.order})}return[]}},{key:"getDataSet",value:function(){return this._data.getDataSet()}},{key:"stream",value:function(t){var e;return this._data.stream(t||br({},Zu,Ti(e=Ec(this._ids)).call(e,this._ids)))}},{key:"dispose",value:function(){var t;null!==(t=this._data)&&void 0!==t&&t.off&&this._data.off("*",this._listener);var e,r="This data view has already been disposed of.",i={get:function(){throw new Error(r)},set:function(){throw new Error(r)},configurable:!1},o=Vc(hi(n.prototype));try{for(o.s();!(e=o.n()).done;){var a=e.value;vr(this,a,i)}}catch(t){o.e(t)}finally{o.f()}}},{key:"_onEvent",value:function(t,e,n){if(e&&e.items&&this._data){var r=e.items,i=[],o=[],a=[],s=[],l=[],u=[];switch(t){case"add":for(var c=0,h=r.length;c<h;c++){var f=r[c];this.get(f)&&(this._ids.add(f),i.push(f))}break;case"update":for(var d=0,p=r.length;d<p;d++){var v=r[d];this.get(v)?this._ids.has(v)?(o.push(v),l.push(e.data[d]),s.push(e.oldData[d])):(this._ids.add(v),i.push(v)):this._ids.has(v)&&(this._ids.delete(v),a.push(v),u.push(e.oldData[d]))}break;case"remove":for(var y=0,m=r.length;y<m;y++){var g=r[y];this._ids.has(g)&&(this._ids.delete(g),a.push(g),u.push(e.oldData[y]))}}this.length+=i.length-a.length,i.length&&this._trigger("add",{items:i},n),o.length&&this._trigger("update",{items:o,oldData:s,data:l},n),a.length&&this._trigger("remove",{items:a,oldData:u},n)}}}]),n}($c);function th(t,e){return"object"===ei(e)&&null!==e&&t===e.idProp&&"function"==typeof e.add&&"function"==typeof e.clear&&"function"==typeof e.distinct&&"function"==typeof Fi(e)&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof mi(e)&&"function"==typeof e.max&&"function"==typeof e.min&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.remove&&"function"==typeof e.setOptions&&"function"==typeof e.stream&&"function"==typeof e.update&&"function"==typeof e.updateOnly}var eh=Object.freeze({__proto__:null,DELETE:Js,DataSet:Kc,DataStream:Qc,DataView:Jc,Queue:Zc,createNewDataPipeFrom:function(t){return new Uc(t)},isDataSetLike:th,isDataViewLike:function(t,e){return"object"===ei(e)&&null!==e&&t===e.idProp&&"function"==typeof Fi(e)&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof mi(e)&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.stream&&th(t,e.getDataSet())}}),nh=Eo.trim,rh=f.parseFloat,ih=1/rh(_o+"-0")!=-1/0?function(t){var e=nh(E(t)),n=rh(e);return 0===n&&"-"==e.charAt(0)?-0:n}:rh;Vt({global:!0,forced:parseFloat!=ih},{parseFloat:ih});var oh=i.parseFloat;Vt({target:"Number",stat:!0},{isNaN:function(t){return t!=t}});var ah=i.Number.isNaN;function sh(t,e,n){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0,this.z=void 0!==n?n:0}sh.subtract=function(t,e){var n=new sh;return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},sh.add=function(t,e){var n=new sh;return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},sh.avg=function(t,e){return new sh((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2)},sh.scalarProduct=function(t,e){return new sh(t.x*e,t.y*e,t.z*e)},sh.dotProduct=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},sh.crossProduct=function(t,e){var n=new sh;return n.x=t.y*e.z-t.z*e.y,n.y=t.z*e.x-t.x*e.z,n.z=t.x*e.y-t.y*e.x,n},sh.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},sh.prototype.normalize=function(){return sh.scalarProduct(this,1/this.length())};var lh=sh;var uh=function(t,e){this.x=void 0!==t?t:0,this.y=void 0!==e?e:0};function ch(t,e){if(void 0===t)throw new Error("No container element defined");if(this.container=t,this.visible=!e||null==e.visible||e.visible,this.visible){this.frame=document.createElement("DIV"),this.frame.style.width="100%",this.frame.style.position="relative",this.container.appendChild(this.frame),this.frame.prev=document.createElement("INPUT"),this.frame.prev.type="BUTTON",this.frame.prev.value="Prev",this.frame.appendChild(this.frame.prev),this.frame.play=document.createElement("INPUT"),this.frame.play.type="BUTTON",this.frame.play.value="Play",this.frame.appendChild(this.frame.play),this.frame.next=document.createElement("INPUT"),this.frame.next.type="BUTTON",this.frame.next.value="Next",this.frame.appendChild(this.frame.next),this.frame.bar=document.createElement("INPUT"),this.frame.bar.type="BUTTON",this.frame.bar.style.position="absolute",this.frame.bar.style.border="1px solid red",this.frame.bar.style.width="100px",this.frame.bar.style.height="6px",this.frame.bar.style.borderRadius="2px",this.frame.bar.style.MozBorderRadius="2px",this.frame.bar.style.border="1px solid #7F7F7F",this.frame.bar.style.backgroundColor="#E5E5E5",this.frame.appendChild(this.frame.bar),this.frame.slide=document.createElement("INPUT"),this.frame.slide.type="BUTTON",this.frame.slide.style.margin="0px",this.frame.slide.value=" ",this.frame.slide.style.position="relative",this.frame.slide.style.left="-100px",this.frame.appendChild(this.frame.slide);var n=this;this.frame.slide.onmousedown=function(t){n._onMouseDown(t)},this.frame.prev.onclick=function(t){n.prev(t)},this.frame.play.onclick=function(t){n.togglePlay(t)},this.frame.next.onclick=function(t){n.next(t)}}this.onChangeCallback=void 0,this.values=[],this.index=void 0,this.playTimeout=void 0,this.playInterval=1e3,this.playLoop=!0}ch.prototype.prev=function(){var t=this.getIndex();t>0&&(t--,this.setIndex(t))},ch.prototype.next=function(){var t=this.getIndex();t<Oc(this).length-1&&(t++,this.setIndex(t))},ch.prototype.playNext=function(){var t=new Date,e=this.getIndex();e<Oc(this).length-1?(e++,this.setIndex(e)):this.playLoop&&(e=0,this.setIndex(e));var n=new Date-t,r=Math.max(this.playInterval-n,0),i=this;this.playTimeout=na((function(){i.playNext()}),r)},ch.prototype.togglePlay=function(){void 0===this.playTimeout?this.play():this.stop()},ch.prototype.play=function(){this.playTimeout||(this.playNext(),this.frame&&(this.frame.play.value="Stop"))},ch.prototype.stop=function(){clearInterval(this.playTimeout),this.playTimeout=void 0,this.frame&&(this.frame.play.value="Play")},ch.prototype.setOnChangeCallback=function(t){this.onChangeCallback=t},ch.prototype.setPlayInterval=function(t){this.playInterval=t},ch.prototype.getPlayInterval=function(){return this.playInterval},ch.prototype.setPlayLoop=function(t){this.playLoop=t},ch.prototype.onChange=function(){void 0!==this.onChangeCallback&&this.onChangeCallback()},ch.prototype.redraw=function(){if(this.frame){this.frame.bar.style.top=this.frame.clientHeight/2-this.frame.bar.offsetHeight/2+"px",this.frame.bar.style.width=this.frame.clientWidth-this.frame.prev.clientWidth-this.frame.play.clientWidth-this.frame.next.clientWidth-30+"px";var t=this.indexToLeft(this.index);this.frame.slide.style.left=t+"px"}},ch.prototype.setValues=function(t){this.values=t,Oc(this).length>0?this.setIndex(0):this.index=void 0},ch.prototype.setIndex=function(t){if(!(t<Oc(this).length))throw new Error("Index out of range");this.index=t,this.redraw(),this.onChange()},ch.prototype.getIndex=function(){return this.index},ch.prototype.get=function(){return Oc(this)[this.index]},ch.prototype._onMouseDown=function(t){if(t.which?1===t.which:1===t.button){this.startClientX=t.clientX,this.startSlideX=oh(this.frame.slide.style.left),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},Cl(document,"mousemove",this.onmousemove),Cl(document,"mouseup",this.onmouseup),Sl(t)}},ch.prototype.leftToIndex=function(t){var e=oh(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,n=t-3,r=Math.round(n/e*(Oc(this).length-1));return r<0&&(r=0),r>Oc(this).length-1&&(r=Oc(this).length-1),r},ch.prototype.indexToLeft=function(t){var e=oh(this.frame.bar.style.width)-this.frame.slide.clientWidth-10;return t/(Oc(this).length-1)*e+3},ch.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,n=this.startSlideX+e,r=this.leftToIndex(n);this.setIndex(r),Sl()},ch.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",El(document,"mousemove",this.onmousemove),El(document,"mouseup",this.onmouseup),Sl()};var hh=Object.freeze({__proto__:null,default:ch});function fh(t,e,n,r){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,n,r)}fh.prototype.isNumeric=function(t){return!isNaN(oh(t))&&isFinite(t)},fh.prototype.setRange=function(t,e,n,r){if(!this.isNumeric(t))throw new Error("Parameter 'start' is not numeric; value: "+t);if(!this.isNumeric(e))throw new Error("Parameter 'end' is not numeric; value: "+t);if(!this.isNumeric(n))throw new Error("Parameter 'step' is not numeric; value: "+t);this._start=t||0,this._end=e||0,this.setStep(n,r)},fh.prototype.setStep=function(t,e){void 0===t||t<=0||(void 0!==e&&(this.prettyStep=e),!0===this.prettyStep?this._step=fh.calculatePrettyStep(t):this._step=t)},fh.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},n=Math.pow(10,Math.round(e(t))),r=2*Math.pow(10,Math.round(e(t/2))),i=5*Math.pow(10,Math.round(e(t/5))),o=n;return Math.abs(r-t)<=Math.abs(o-t)&&(o=r),Math.abs(i-t)<=Math.abs(o-t)&&(o=i),o<=0&&(o=1),o},fh.prototype.getCurrent=function(){return oh(this._current.toPrecision(this.precision))},fh.prototype.getStep=function(){return this._step},fh.prototype.start=function(t){void 0===t&&(t=!1),this._current=this._start-this._start%this._step,t&&this.getCurrent()<this._start&&this.next()},fh.prototype.next=function(){this._current+=this._step},fh.prototype.end=function(){return this._current>this._end};var dh=fh,ph=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1};Vt({target:"Math",stat:!0},{sign:ph});var vh=i.Math.sign;function yh(){this.armLocation=new lh,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraOffset=new lh,this.offsetMultiplier=.6,this.cameraLocation=new lh,this.cameraRotation=new lh(.5*Math.PI,0,0),this.calculateCameraOrientation()}yh.prototype.setOffset=function(t,e){var n=Math.abs,r=vh,i=this.offsetMultiplier,o=this.armLength*i;n(t)>o&&(t=r(t)*o),n(e)>o&&(e=r(e)*o),this.cameraOffset.x=t,this.cameraOffset.y=e,this.calculateCameraOrientation()},yh.prototype.getOffset=function(){return this.cameraOffset},yh.prototype.setArmLocation=function(t,e,n){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=n,this.calculateCameraOrientation()},yh.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),void 0===t&&void 0===e||this.calculateCameraOrientation()},yh.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},yh.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.setOffset(this.cameraOffset.x,this.cameraOffset.y),this.calculateCameraOrientation())},yh.prototype.getArmLength=function(){return this.armLength},yh.prototype.getCameraLocation=function(){return this.cameraLocation},yh.prototype.getCameraRotation=function(){return this.cameraRotation},yh.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal;var t=this.cameraRotation.x,e=this.cameraRotation.z,n=this.cameraOffset.x,r=this.cameraOffset.y,i=Math.sin,o=Math.cos;this.cameraLocation.x=this.cameraLocation.x+n*o(e)+r*-i(e)*o(t),this.cameraLocation.y=this.cameraLocation.y+n*i(e)+r*o(e)*o(t),this.cameraLocation.z=this.cameraLocation.z+r*i(t)};var mh=Object.freeze({__proto__:null,default:yh}),gh={BAR:0,BARCOLOR:1,BARSIZE:2,DOT:3,DOTLINE:4,DOTCOLOR:5,DOTSIZE:6,GRID:7,LINE:8,SURFACE:9},bh={dot:gh.DOT,"dot-line":gh.DOTLINE,"dot-color":gh.DOTCOLOR,"dot-size":gh.DOTSIZE,line:gh.LINE,grid:gh.GRID,surface:gh.SURFACE,bar:gh.BAR,"bar-color":gh.BARCOLOR,"bar-size":gh.BARSIZE},_h=["width","height","filterLabel","legendLabel","xLabel","yLabel","zLabel","xValueLabel","yValueLabel","zValueLabel","showXAxis","showYAxis","showZAxis","showGrayBottom","showGrid","showPerspective","showShadow","showSurfaceGrid","keepAspectRatio","rotateAxisLabels","verticalRatio","dotSizeRatio","dotSizeMinFraction","dotSizeMaxFraction","showAnimationControls","animationInterval","animationPreload","animationAutoStart","axisColor","axisFontSize","axisFontType","gridColor","xCenter","yCenter","zoomable","tooltipDelay","ctrlToZoom"],xh=["xBarWidth","yBarWidth","valueMin","valueMax","xMin","xMax","xStep","yMin","yMax","yStep","zMin","zMax","zStep"],wh=void 0;function kh(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}function Ch(t,e){return void 0===t||""===t?e:t+(void 0===(n=e)||""===n||"string"!=typeof n?n:n.charAt(0).toUpperCase()+ci(n).call(n,1));var n}function Eh(t,e,n,r){for(var i,o=0;o<n.length;++o)e[Ch(r,i=n[o])]=t[i]}function Sh(t,e,n,r){for(var i,o=0;o<n.length;++o)void 0!==t[i=n[o]]&&(e[Ch(r,i)]=t[i])}function Th(t,e){if(void 0!==t.backgroundColor&&function(t,e){var n="white",r="gray",i=1;if("string"==typeof t)n=t,r="none",i=0;else{if("object"!==ei(t))throw new Error("Unsupported type of backgroundColor");void 0!==oa(t)&&(n=oa(t)),void 0!==t.stroke&&(r=t.stroke),void 0!==t.strokeWidth&&(i=t.strokeWidth)}e.frame.style.backgroundColor=n,e.frame.style.borderColor=r,e.frame.style.borderWidth=i+"px",e.frame.style.borderStyle="solid"}(t.backgroundColor,e),function(t,e){if(void 0===t)return;void 0===e.dataColor&&(e.dataColor={});"string"==typeof t?(e.dataColor.fill=t,e.dataColor.stroke=t):(oa(t)&&(e.dataColor.fill=oa(t)),t.stroke&&(e.dataColor.stroke=t.stroke),void 0!==t.strokeWidth&&(e.dataColor.strokeWidth=t.strokeWidth))}(t.dataColor,e),function(t,e){if(void 0===t)return;var n;if("string"==typeof t){if(-1===(n=function(t){var e=bh[t];if(void 0===e)return-1;return e}(t)))throw new Error("Style '"+t+"' is invalid")}else{if(!function(t){var e=!1;for(var n in gh)if(gh[n]===t){e=!0;break}return e}(t))throw new Error("Style '"+t+"' is invalid");n=t}e.style=n}(t.style,e),void 0!==t.surfaceColors){if(console.warn("`options.surfaceColors` is deprecated and may be removed in a future version. Please use `options.colormap` instead. Note that the `colormap` option uses the inverse array ordering (running from vMin to vMax)."),void 0!==t.colormap)throw new Error("The `colormap` and `surfaceColors` options are mutually exclusive.");"surface"!==e.style?console.warn("Ignoring `surfaceColors` in graph style `"+e.style+"` for backward compatibility (only effective in `surface` plots)."):function(t,e){if(void 0===t||!0===t)return;if(!1===t)return void(e.surfaceColors=void 0);void 0===e.surfaceColors&&(e.surfaceColors={});var n;if(fi(t))n=Ah(t);else{if("object"!==ei(t))throw new Error("Unsupported type of surfaceColors");n=Oh(t.hue)}Bi(n).call(n),e.colormap=n}(t.surfaceColors,e)}else!function(t,e){if(void 0===t)return;var n;if(fi(t))n=Ah(t);else if("object"===ei(t))n=Oh(t.hue);else{if("function"!=typeof t)throw new Error("Unsupported type of colormap");n=t}e.colormap=n}(t.colormap,e);!function(t,e){if(void 0===t){if(void 0===wh.showLegend){var n=e.style===gh.DOTCOLOR||e.style===gh.DOTSIZE;e.showLegend=n}}else e.showLegend=t}(t.showLegend,e),Ph(t.cameraPosition,e),void 0!==t.tooltip&&(e.showTooltip=t.tooltip),null!=t.onclick&&(e.onclick_callback=t.onclick,console.warn("`options.onclick` is deprecated and may be removed in a future version. Please use `Graph3d.on('click', handler)` instead.")),void 0!==t.tooltipStyle&&bl(["tooltipStyle"],e,t)}function Ah(t){if(t.length<2)throw new Error("Colormap array length must be 2 or above.");return mi(t).call(t,(function(t){if(!Il(t))throw new Error("Invalid hex color code supplied to colormap.");return Al(t)}))}function Oh(t){if(void 0===t)throw new Error("Unsupported type of colormap");if(!(t.saturation>=0&&t.saturation<=100))throw new Error("Saturation is out of bounds. Expected range is 0-100.");if(!(t.brightness>=0&&t.brightness<=100))throw new Error("Brightness is out of bounds. Expected range is 0-100.");if(!(t.colorStops>=2))throw new Error("colorStops is out of bounds. Expected 2 or above.");for(var e=(t.end-t.start)/(t.colorStops-1),n=[],r=0;r<t.colorStops;++r){var i=(t.start+e*r)%360/360;n.push(Ml(i<0?i+1:i,t.saturation/100,t.brightness/100))}return n}function Ph(t,e){var n=t;void 0!==n&&(void 0===e.camera&&(e.camera=new yh),e.camera.setArmRotation(n.horizontal,n.vertical),e.camera.setArmLength(n.distance))}var Dh="string",Lh="boolean",Mh="number",Fh="object",Rh="array",Ih={fill:{string:Dh},stroke:{string:Dh},strokeWidth:{number:Mh},__type__:{string:Dh,object:Fh,undefined:"undefined"}},jh={animationAutoStart:{boolean:Lh,undefined:"undefined"},animationInterval:{number:Mh},animationPreload:{boolean:Lh},axisColor:{string:Dh},axisFontSize:{number:Mh},axisFontType:{string:Dh},backgroundColor:Ih,xBarWidth:{number:Mh,undefined:"undefined"},yBarWidth:{number:Mh,undefined:"undefined"},cameraPosition:{distance:{number:Mh},horizontal:{number:Mh},vertical:{number:Mh},__type__:{object:Fh}},zoomable:{boolean:Lh},ctrlToZoom:{boolean:Lh},xCenter:{string:Dh},yCenter:{string:Dh},colormap:{hue:{start:{number:Mh},end:{number:Mh},saturation:{number:Mh},brightness:{number:Mh},colorStops:{number:Mh},__type__:{object:Fh}},__type__:{array:Rh,object:Fh,function:"function",undefined:"undefined"}},dataColor:Ih,dotSizeMinFraction:{number:Mh},dotSizeMaxFraction:{number:Mh},dotSizeRatio:{number:Mh},filterLabel:{string:Dh},gridColor:{string:Dh},onclick:{function:"function"},keepAspectRatio:{boolean:Lh},xLabel:{string:Dh},yLabel:{string:Dh},zLabel:{string:Dh},legendLabel:{string:Dh},xMin:{number:Mh,undefined:"undefined"},yMin:{number:Mh,undefined:"undefined"},zMin:{number:Mh,undefined:"undefined"},xMax:{number:Mh,undefined:"undefined"},yMax:{number:Mh,undefined:"undefined"},zMax:{number:Mh,undefined:"undefined"},showAnimationControls:{boolean:Lh,undefined:"undefined"},showGrayBottom:{boolean:Lh},showGrid:{boolean:Lh},showLegend:{boolean:Lh,undefined:"undefined"},showPerspective:{boolean:Lh},showShadow:{boolean:Lh},showSurfaceGrid:{boolean:Lh},showXAxis:{boolean:Lh},showYAxis:{boolean:Lh},showZAxis:{boolean:Lh},rotateAxisLabels:{boolean:Lh},surfaceColors:{hue:{start:{number:Mh},end:{number:Mh},saturation:{number:Mh},brightness:{number:Mh},colorStops:{number:Mh},__type__:{object:Fh}},__type__:{boolean:Lh,array:Rh,object:Fh,undefined:"undefined"}},xStep:{number:Mh,undefined:"undefined"},yStep:{number:Mh,undefined:"undefined"},zStep:{number:Mh,undefined:"undefined"},style:{number:Mh,string:["bar","bar-color","bar-size","dot","dot-line","dot-color","dot-size","line","grid","surface"]},tooltip:{boolean:Lh,function:"function"},tooltipDelay:{number:Mh},tooltipStyle:{content:{color:{string:Dh},background:{string:Dh},border:{string:Dh},borderRadius:{string:Dh},boxShadow:{string:Dh},padding:{string:Dh},__type__:{object:Fh}},line:{borderLeft:{string:Dh},height:{string:Dh},width:{string:Dh},pointerEvents:{string:Dh},__type__:{object:Fh}},dot:{border:{string:Dh},borderRadius:{string:Dh},height:{string:Dh},width:{string:Dh},pointerEvents:{string:Dh},__type__:{object:Fh}},__type__:{object:Fh}},xValueLabel:{function:"function"},yValueLabel:{function:"function"},zValueLabel:{function:"function"},valueMax:{number:Mh,undefined:"undefined"},valueMin:{number:Mh,undefined:"undefined"},verticalRatio:{number:Mh},height:{string:Dh},width:{string:Dh},__type__:{object:Fh}};function zh(){this.min=void 0,this.max=void 0}zh.prototype.adjust=function(t){void 0!==t&&((void 0===this.min||this.min>t)&&(this.min=t),(void 0===this.max||this.max<t)&&(this.max=t))},zh.prototype.combine=function(t){this.add(t.min),this.add(t.max)},zh.prototype.expand=function(t){if(void 0!==t){var e=this.min-t,n=this.max+t;if(e>n)throw new Error("Passed expansion value makes range invalid");this.min=e,this.max=n}},zh.prototype.range=function(){return this.max-this.min},zh.prototype.center=function(){return(this.min+this.max)/2};var Bh=zh;function Nh(t,e,n){this.dataGroup=t,this.column=e,this.graph=n,this.index=void 0,this.value=void 0,this.values=t.getDistinctValues(this.column),Oc(this).length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,n.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}Nh.prototype.isLoaded=function(){return this.loaded},Nh.prototype.getLoadedProgress=function(){for(var t=Oc(this).length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},Nh.prototype.getLabel=function(){return this.graph.filterLabel},Nh.prototype.getColumn=function(){return this.column},Nh.prototype.getSelectedValue=function(){if(void 0!==this.index)return Oc(this)[this.index]},Nh.prototype.getValues=function(){return Oc(this)},Nh.prototype.getValue=function(t){if(t>=Oc(this).length)throw new Error("Index out of range");return Oc(this)[t]},Nh.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t];else{var n={};n.column=this.column,n.value=Oc(this)[t];var r=new Jc(this.dataGroup.getDataSet(),{filter:function(t){return t[n.column]==n.value}}).get();e=this.dataGroup._getDataPoints(r),this.dataPoints[t]=e}return e},Nh.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},Nh.prototype.selectValue=function(t){if(t>=Oc(this).length)throw new Error("Index out of range");this.index=t,this.value=Oc(this)[t]},Nh.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t<Oc(this).length){void 0===e.progress&&(e.progress=document.createElement("DIV"),e.progress.style.position="absolute",e.progress.style.color="gray",e.appendChild(e.progress));var n=this.getLoadedProgress();e.progress.innerHTML="Loading animation... "+n+"%",e.progress.style.bottom="60px",e.progress.style.left="10px";var r=this;na((function(){r.loadInBackground(t+1)}),10),this.loaded=!1}else this.loaded=!0,void 0!==e.progress&&(e.removeChild(e.progress),e.progress=void 0),this.onLoadCallback&&this.onLoadCallback()};var Wh=Object.freeze({__proto__:null,default:Nh});function Yh(){this.dataTable=null}Yh.prototype.initializeData=function(t,e,n){if(void 0!==e){var r;if(fi(e)&&(e=new Kc(e)),!(e instanceof Kc||e instanceof Jc))throw new Error("Array, DataSet, or DataView expected");if(0!=(r=e.get()).length){this.style=n,this.dataSet&&this.dataSet.off("*",this._onChange),this.dataSet=e,this.dataTable=r;var i=this;this._onChange=function(){t.setData(i.dataSet)},this.dataSet.on("*",this._onChange),this.colX="x",this.colY="y",this.colZ="z";var o=t.hasBars(n);if(o&&(void 0!==t.defaultXBarWidth?this.xBarWidth=t.defaultXBarWidth:this.xBarWidth=this.getSmallestDifference(r,this.colX)||1,void 0!==t.defaultYBarWidth?this.yBarWidth=t.defaultYBarWidth:this.yBarWidth=this.getSmallestDifference(r,this.colY)||1),this._initializeRange(r,this.colX,t,o),this._initializeRange(r,this.colY,t,o),this._initializeRange(r,this.colZ,t,!1),r[0].hasOwnProperty("style")){this.colValue="style";var a=this.getColumnRange(r,this.colValue);this._setRangeDefaults(a,t.defaultValueMin,t.defaultValueMax),this.valueRange=a}else this.colValue="z",this.valueRange=this.zRange;return this.getDataTable()[0].hasOwnProperty("filter")&&void 0===this.dataFilter&&(this.dataFilter=new Nh(this,"filter",t),this.dataFilter.setOnLoadCallback((function(){t.redraw()}))),this.dataFilter?this.dataFilter._getDataPoints():this._getDataPoints(this.getDataTable())}}},Yh.prototype._collectRangeSettings=function(t,e){var n;if(-1==zo(n=["x","y","z"]).call(n,t))throw new Error("Column '"+t+"' invalid");var r=t.toUpperCase();return{barWidth:this[t+"BarWidth"],min:e["default"+r+"Min"],max:e["default"+r+"Max"],step:e["default"+r+"Step"],range_label:t+"Range",step_label:t+"Step"}},Yh.prototype._initializeRange=function(t,e,n,r){var i=this._collectRangeSettings(e,n),o=this.getColumnRange(t,e);r&&"z"!=e&&o.expand(i.barWidth/2),this._setRangeDefaults(o,i.min,i.max),this[i.range_label]=o,this[i.step_label]=void 0!==i.step?i.step:o.range()/5},Yh.prototype.getDistinctValues=function(t,e){void 0===e&&(e=this.dataTable);for(var n=[],r=0;r<e.length;r++){var i=e[r][t]||0;-1===zo(n).call(n,i)&&n.push(i)}return vc(n).call(n,(function(t,e){return t-e}))},Yh.prototype.getSmallestDifference=function(t,e){for(var n=this.getDistinctValues(t,e),r=null,i=1;i<n.length;i++){var o=n[i]-n[i-1];(null==r||r>o)&&(r=o)}return r},Yh.prototype.getColumnRange=function(t,e){for(var n=new Bh,r=0;r<t.length;r++){var i=t[r][e];n.adjust(i)}return n},Yh.prototype.getNumberOfRows=function(){return this.dataTable.length},Yh.prototype._setRangeDefaults=function(t,e,n){void 0!==e&&(t.min=e),void 0!==n&&(t.max=n),t.max<=t.min&&(t.max=t.min+1)},Yh.prototype.getDataTable=function(){return this.dataTable},Yh.prototype.getDataSet=function(){return this.dataSet},Yh.prototype.getDataPoints=function(t){for(var e=[],n=0;n<t.length;n++){var r=new lh;r.x=t[n][this.colX]||0,r.y=t[n][this.colY]||0,r.z=t[n][this.colZ]||0,r.data=t[n],r.value=t[n][this.colValue]||0;var i={};i.point=r,i.bottom=new lh(r.x,r.y,this.zRange.min),i.trans=void 0,i.screen=void 0,e.push(i)}return e},Yh.prototype.initDataAsMatrix=function(t){var e,n,r,i,o=this.getDistinctValues(this.colX,t),a=this.getDistinctValues(this.colY,t),s=this.getDataPoints(t),l=[];for(r=0;r<s.length;r++){i=s[r];var u=zo(o).call(o,i.point.x),c=zo(a).call(a,i.point.y);void 0===l[u]&&(l[u]=[]),l[u][c]=i}for(e=0;e<l.length;e++)for(n=0;n<l[e].length;n++)l[e][n]&&(l[e][n].pointRight=e<l.length-1?l[e+1][n]:void 0,l[e][n].pointTop=n<l[e].length-1?l[e][n+1]:void 0,l[e][n].pointCross=e<l.length-1&&n<l[e].length-1?l[e+1][n+1]:void 0);return s},Yh.prototype.getInfo=function(){var t=this.dataFilter;if(t)return t.getLabel()+": "+t.getSelectedValue()},Yh.prototype.reload=function(){this.dataTable&&this.setData(this.dataTable)},Yh.prototype._getDataPoints=function(t){var e=[];if(this.style===gh.GRID||this.style===gh.SURFACE)e=this.initDataAsMatrix(t);else if(e=this.getDataPoints(t),this.style===gh.LINE)for(var n=0;n<e.length;n++)n>0&&(e[n-1].pointNext=e[n]);return e},Vh.STYLE=gh;var Gh=void 0;function Vh(t,e,n){if(!(this instanceof Vh))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.dataGroup=new Yh,this.dataPoints=null,this.create(),function(t,e){if(void 0===t||kh(t))throw new Error("No DEFAULTS passed");if(void 0===e)throw new Error("No dst passed");wh=t,Eh(t,e,_h),Eh(t,e,xh,"default"),Th(t,e),e.margin=10,e.showTooltip=!1,e.onclick_callback=null,e.eye=new lh(0,0,-1)}(Vh.DEFAULTS,this),this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.setOptions(n),this.setData(e)}function Xh(t){return"clientX"in t?t.clientX:t.targetTouches[0]&&t.targetTouches[0].clientX||0}function Hh(t){return"clientY"in t?t.clientY:t.targetTouches[0]&&t.targetTouches[0].clientY||0}Vh.DEFAULTS={width:"400px",height:"400px",filterLabel:"time",legendLabel:"value",xLabel:"x",yLabel:"y",zLabel:"z",xValueLabel:function(t){return t},yValueLabel:function(t){return t},zValueLabel:function(t){return t},showXAxis:!0,showYAxis:!0,showZAxis:!0,showGrayBottom:!1,showGrid:!0,showPerspective:!0,showShadow:!1,showSurfaceGrid:!0,keepAspectRatio:!0,rotateAxisLabels:!0,verticalRatio:.5,dotSizeRatio:.02,dotSizeMinFraction:.5,dotSizeMaxFraction:2.5,showAnimationControls:Gh,animationInterval:1e3,animationPreload:!1,animationAutoStart:Gh,axisFontSize:14,axisFontType:"arial",axisColor:"#4D4D4D",gridColor:"#D3D3D3",xCenter:"55%",yCenter:"50%",style:Vh.STYLE.DOT,tooltip:!1,tooltipDelay:300,tooltipStyle:{content:{padding:"10px",border:"1px solid #4d4d4d",color:"#1a1a1a",background:"rgba(255,255,255,0.7)",borderRadius:"2px",boxShadow:"5px 5px 10px rgba(128,128,128,0.5)"},line:{height:"40px",width:"0",borderLeft:"1px solid #4d4d4d",pointerEvents:"none"},dot:{height:"0",width:"0",border:"5px solid #4d4d4d",borderRadius:"5px",pointerEvents:"none"}},dataColor:{fill:"#7DC1FF",stroke:"#3267D2",strokeWidth:1},surfaceColors:Gh,colormap:Gh,cameraPosition:{horizontal:1,vertical:.5,distance:1.7},zoomable:!0,ctrlToZoom:!1,showLegend:Gh,backgroundColor:Gh,xBarWidth:Gh,yBarWidth:Gh,valueMin:Gh,valueMax:Gh,xMin:Gh,xMax:Gh,xStep:Gh,yMin:Gh,yMax:Gh,yStep:Gh,zMin:Gh,zMax:Gh,zStep:Gh},aa(Vh.prototype),Vh.prototype._setScale=function(){this.scale=new lh(1/this.xRange.range(),1/this.yRange.range(),1/this.zRange.range()),this.keepAspectRatio&&(this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y),this.scale.z*=this.verticalRatio,void 0!==this.valueRange&&(this.scale.value=1/this.valueRange.range());var t=this.xRange.center()*this.scale.x,e=this.yRange.center()*this.scale.y,n=this.zRange.center()*this.scale.z;this.camera.setArmLocation(t,e,n)},Vh.prototype._convert3Dto2D=function(t){var e=this._convertPointToTranslation(t);return this._convertTranslationToScreen(e)},Vh.prototype._convertPointToTranslation=function(t){var e=this.camera.getCameraLocation(),n=this.camera.getCameraRotation(),r=t.x*this.scale.x,i=t.y*this.scale.y,o=t.z*this.scale.z,a=e.x,s=e.y,l=e.z,u=Math.sin(n.x),c=Math.cos(n.x),h=Math.sin(n.y),f=Math.cos(n.y),d=Math.sin(n.z),p=Math.cos(n.z);return new lh(f*(d*(i-s)+p*(r-a))-h*(o-l),u*(f*(o-l)+h*(d*(i-s)+p*(r-a)))+c*(p*(i-s)-d*(r-a)),c*(f*(o-l)+h*(d*(i-s)+p*(r-a)))-u*(p*(i-s)-d*(r-a)))},Vh.prototype._convertTranslationToScreen=function(t){var e,n,r=this.eye.x,i=this.eye.y,o=this.eye.z,a=t.x,s=t.y,l=t.z;return this.showPerspective?(e=o/l*(a-r),n=o/l*(s-i)):(e=a*(-o/this.camera.getArmLength()),n=s*(-o/this.camera.getArmLength())),new uh(this.currentXCenter+e*this.frame.canvas.clientWidth,this.currentYCenter-n*this.frame.canvas.clientWidth)},Vh.prototype._calcTranslations=function(t){for(var e=0;e<t.length;e++){var n=t[e];n.trans=this._convertPointToTranslation(n.point),n.screen=this._convertTranslationToScreen(n.trans);var r=this._convertPointToTranslation(n.bottom);n.dist=this.showPerspective?r.length():-r.z}vc(t).call(t,(function(t,e){return e.dist-t.dist}))},Vh.prototype._initializeRanges=function(){var t=this.dataGroup;this.xRange=t.xRange,this.yRange=t.yRange,this.zRange=t.zRange,this.valueRange=t.valueRange,this.xStep=t.xStep,this.yStep=t.yStep,this.zStep=t.zStep,this.xBarWidth=t.xBarWidth,this.yBarWidth=t.yBarWidth,this.colX=t.colX,this.colY=t.colY,this.colZ=t.colZ,this.colValue=t.colValue,this._setScale()},Vh.prototype.getDataPoints=function(t){for(var e=[],n=0;n<t.length;n++){var r=new lh;r.x=t[n][this.colX]||0,r.y=t[n][this.colY]||0,r.z=t[n][this.colZ]||0,r.data=t[n],r.value=t[n][this.colValue]||0;var i={};i.point=r,i.bottom=new lh(r.x,r.y,this.zRange.min),i.trans=void 0,i.screen=void 0,e.push(i)}return e},Vh.prototype._getDataPoints=function(t){var e,n,r,i,o=[];if(this.style===Vh.STYLE.GRID||this.style===Vh.STYLE.SURFACE){var a=this.dataGroup.getDistinctValues(this.colX,t),s=this.dataGroup.getDistinctValues(this.colY,t);o=this.getDataPoints(t);var l=[];for(r=0;r<o.length;r++){i=o[r];var u=zo(a).call(a,i.point.x),c=zo(s).call(s,i.point.y);void 0===l[u]&&(l[u]=[]),l[u][c]=i}for(e=0;e<l.length;e++)for(n=0;n<l[e].length;n++)l[e][n]&&(l[e][n].pointRight=e<l.length-1?l[e+1][n]:void 0,l[e][n].pointTop=n<l[e].length-1?l[e][n+1]:void 0,l[e][n].pointCross=e<l.length-1&&n<l[e].length-1?l[e+1][n+1]:void 0)}else if(o=this.getDataPoints(t),this.style===Vh.STYLE.LINE)for(r=0;r<o.length;r++)r>0&&(o[r-1].pointNext=o[r]);return o},Vh.prototype.create=function(){for(;this.containerElement.hasChildNodes();)this.containerElement.removeChild(this.containerElement.firstChild);this.frame=document.createElement("div"),this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas);var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t),this.frame.filter=document.createElement("div"),vo(this.frame).style.position="absolute",vo(this.frame).style.bottom="0px",vo(this.frame).style.left="0px",vo(this.frame).style.width="100%",this.frame.appendChild(vo(this.frame));var e=this;Cl(this.frame.canvas,"mousedown",(function(t){e._onMouseDown(t)})),Cl(this.frame.canvas,"touchstart",(function(t){e._onTouchStart(t)})),Cl(this.frame.canvas,"mousewheel",(function(t){e._onWheel(t)})),Cl(this.frame.canvas,"mousemove",(function(t){e._onTooltip(t)})),Cl(this.frame.canvas,"click",(function(t){e._onClick(t)})),this.containerElement.appendChild(this.frame)},Vh.prototype._setSize=function(t,e){this.frame.style.width=t,this.frame.style.height=e,this._resizeCanvas()},Vh.prototype._resizeCanvas=function(){this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth,this.frame.canvas.height=this.frame.canvas.clientHeight,vo(this.frame).style.width=this.frame.canvas.clientWidth-20+"px"},Vh.prototype.animationStart=function(){if(this.animationAutoStart&&this.dataGroup.dataFilter){if(!vo(this.frame)||!vo(this.frame).slider)throw new Error("No animation available");vo(this.frame).slider.play()}},Vh.prototype.animationStop=function(){vo(this.frame)&&vo(this.frame).slider&&vo(this.frame).slider.stop()},Vh.prototype._resizeCenter=function(){"%"===this.xCenter.charAt(this.xCenter.length-1)?this.currentXCenter=oh(this.xCenter)/100*this.frame.canvas.clientWidth:this.currentXCenter=oh(this.xCenter),"%"===this.yCenter.charAt(this.yCenter.length-1)?this.currentYCenter=oh(this.yCenter)/100*(this.frame.canvas.clientHeight-vo(this.frame).clientHeight):this.currentYCenter=oh(this.yCenter)},Vh.prototype.getCameraPosition=function(){var t=this.camera.getArmRotation();return t.distance=this.camera.getArmLength(),t},Vh.prototype._readData=function(t){this.dataPoints=this.dataGroup.initializeData(this,t,this.style),this._initializeRanges(),this._redrawFilter()},Vh.prototype.setData=function(t){null!=t&&(this._readData(t),this.redraw(),this.animationStart())},Vh.prototype.setOptions=function(t){void 0!==t&&(!0===Jl.validate(t,jh)&&console.log("%cErrors have been found in the supplied options object.",Kl),this.animationStop(),function(t,e){if(void 0!==t){if(void 0===e)throw new Error("No dst passed");if(void 0===wh||kh(wh))throw new Error("DEFAULTS not set for module Settings");Sh(t,e,_h),Sh(t,e,xh,"default"),Th(t,e)}}(t,this),this.setPointDrawingMethod(),this._setSize(this.width,this.height),this.setAxisLabelMethod(),this.setData(this.dataGroup.getDataTable()),this.animationStart())},Vh.prototype.setPointDrawingMethod=function(){var t=void 0;switch(this.style){case Vh.STYLE.BAR:t=this._redrawBarGraphPoint;break;case Vh.STYLE.BARCOLOR:t=this._redrawBarColorGraphPoint;break;case Vh.STYLE.BARSIZE:t=this._redrawBarSizeGraphPoint;break;case Vh.STYLE.DOT:t=this._redrawDotGraphPoint;break;case Vh.STYLE.DOTLINE:t=this._redrawDotLineGraphPoint;break;case Vh.STYLE.DOTCOLOR:t=this._redrawDotColorGraphPoint;break;case Vh.STYLE.DOTSIZE:t=this._redrawDotSizeGraphPoint;break;case Vh.STYLE.SURFACE:t=this._redrawSurfaceGraphPoint;break;case Vh.STYLE.GRID:t=this._redrawGridGraphPoint;break;case Vh.STYLE.LINE:t=this._redrawLineGraphPoint;break;default:throw new Error("Can not determine point drawing method for graph style '"+this.style+"'")}this._pointDrawingMethod=t},Vh.prototype.setAxisLabelMethod=function(){this.rotateAxisLabels?(this._drawAxisLabelX=this.drawAxisLabelXRotate,this._drawAxisLabelY=this.drawAxisLabelYRotate,this._drawAxisLabelZ=this.drawAxisLabelZRotate):(this._drawAxisLabelX=this.drawAxisLabelX,this._drawAxisLabelY=this.drawAxisLabelY,this._drawAxisLabelZ=this.drawAxisLabelZ)},Vh.prototype.redraw=function(){if(void 0===this.dataPoints)throw new Error("Graph data not initialized");this._resizeCanvas(),this._resizeCenter(),this._redrawSlider(),this._redrawClear(),this._redrawAxis(),this._redrawDataGraph(),this._redrawInfo(),this._redrawLegend()},Vh.prototype._getContext=function(){var t=this.frame.canvas.getContext("2d");return t.lineJoin="round",t.lineCap="round",t},Vh.prototype._redrawClear=function(){var t=this.frame.canvas;t.getContext("2d").clearRect(0,0,t.width,t.height)},Vh.prototype._dotSize=function(){return this.frame.clientWidth*this.dotSizeRatio},Vh.prototype._getLegendWidth=function(){var t;this.style===Vh.STYLE.DOTSIZE?t=this._dotSize()*this.dotSizeMaxFraction:t=this.style===Vh.STYLE.BARSIZE?this.xBarWidth:20;return t},Vh.prototype._redrawLegend=function(){if(!0===this.showLegend&&this.style!==Vh.STYLE.LINE&&this.style!==Vh.STYLE.BARSIZE){var t=this.style===Vh.STYLE.BARSIZE||this.style===Vh.STYLE.DOTSIZE,e=this.style===Vh.STYLE.DOTSIZE||this.style===Vh.STYLE.DOTCOLOR||this.style===Vh.STYLE.SURFACE||this.style===Vh.STYLE.BARCOLOR,n=Math.max(.25*this.frame.clientHeight,100),r=this.margin,i=this._getLegendWidth(),o=this.frame.clientWidth-this.margin,a=o-i,s=r+n,l=this._getContext();if(l.lineWidth=1,l.font="14px arial",!1===t){var u,c=n;for(u=0;u<c;u++){var h=1-(u-0)/(c-0),f=this._colormap(h,1);l.strokeStyle=f,l.beginPath(),l.moveTo(a,r+u),l.lineTo(o,r+u),l.stroke()}l.strokeStyle=this.axisColor,l.strokeRect(a,r,i,n)}else{var d;this.style===Vh.STYLE.DOTSIZE?d=i*(this.dotSizeMinFraction/this.dotSizeMaxFraction):(this.style,Vh.STYLE.BARSIZE),l.strokeStyle=this.axisColor,l.fillStyle=oa(this.dataColor),l.beginPath(),l.moveTo(a,r),l.lineTo(o,r),l.lineTo(a+d,s),l.lineTo(a,s),l.closePath(),oa(l).call(l),l.stroke()}var p,v,y=e?this.valueRange.min:this.zRange.min,m=e?this.valueRange.max:this.zRange.max,g=new dh(y,m,(m-y)/5,!0);for(g.start(!0);!g.end();)u=s-(g.getCurrent()-y)/(m-y)*n,p=new uh(a-5,u),v=new uh(a,u),this._line(l,p,v),l.textAlign="right",l.textBaseline="middle",l.fillStyle=this.axisColor,l.fillText(g.getCurrent(),a-10,u),g.next();l.textAlign="right",l.textBaseline="top";var b=this.legendLabel;l.fillText(b,o,s+this.margin)}},Vh.prototype._redrawFilter=function(){var t=this.dataGroup.dataFilter,e=vo(this.frame);if(e.innerHTML="",t){var n=new ch(e,{visible:this.showAnimationControls});e.slider=n,e.style.padding="10px",n.setValues(Oc(t)),n.setPlayInterval(this.animationInterval);var r=this;n.setOnChangeCallback((function(){var t=r.dataGroup.dataFilter,e=n.getIndex();t.selectValue(e),r.dataPoints=t._getDataPoints(),r.redraw()}))}else e.slider=void 0},Vh.prototype._redrawSlider=function(){void 0!==vo(this.frame).slider&&vo(this.frame).slider.redraw()},Vh.prototype._redrawInfo=function(){var t=this.dataGroup.getInfo();if(void 0!==t){var e=this._getContext();e.font="14px arial",e.lineStyle="gray",e.fillStyle="gray",e.textAlign="left",e.textBaseline="top";var n=this.margin,r=this.margin;e.fillText(t,n,r)}},Vh.prototype._line=function(t,e,n,r){void 0!==r&&(t.strokeStyle=r),t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(n.x,n.y),t.stroke()},Vh.prototype.drawAxisLabelX=function(t,e,n,r,i){void 0===i&&(i=0);var o=this._convert3Dto2D(e);Math.cos(2*r)>0?(t.textAlign="center",t.textBaseline="top",o.y+=i):Math.sin(2*r)<0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(n,o.x,o.y)},Vh.prototype.drawAxisLabelY=function(t,e,n,r,i){void 0===i&&(i=0);var o=this._convert3Dto2D(e);Math.cos(2*r)<0?(t.textAlign="center",t.textBaseline="top",o.y+=i):Math.sin(2*r)>0?(t.textAlign="right",t.textBaseline="middle"):(t.textAlign="left",t.textBaseline="middle"),t.fillStyle=this.axisColor,t.fillText(n,o.x,o.y)},Vh.prototype.drawAxisLabelZ=function(t,e,n,r){void 0===r&&(r=0);var i=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(n,i.x-r,i.y)},Vh.prototype.drawAxisLabelXRotate=function(t,e,n,r,i){var o=this._convert3Dto2D(e);Math.cos(2*r)>0?(t.save(),t.translate(o.x,o.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(n,0,0),t.restore()):Math.sin(2*r)<0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(n,o.x,o.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(n,o.x,o.y))},Vh.prototype.drawAxisLabelYRotate=function(t,e,n,r,i){var o=this._convert3Dto2D(e);Math.cos(2*r)<0?(t.save(),t.translate(o.x,o.y),t.rotate(-Math.PI/2),t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(n,0,0),t.restore()):Math.sin(2*r)>0?(t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(n,o.x,o.y)):(t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(n,o.x,o.y))},Vh.prototype.drawAxisLabelZRotate=function(t,e,n,r){void 0===r&&(r=0);var i=this._convert3Dto2D(e);t.textAlign="right",t.textBaseline="middle",t.fillStyle=this.axisColor,t.fillText(n,i.x-r,i.y)},Vh.prototype._line3d=function(t,e,n,r){var i=this._convert3Dto2D(e),o=this._convert3Dto2D(n);this._line(t,i,o,r)},Vh.prototype._redrawAxis=function(){var t,e,n,r,i,o,a,s,l,u,c=this._getContext();c.font=this.axisFontSize/this.camera.getArmLength()+"px "+this.axisFontType;var h,f,d,p=.025/this.scale.x,v=.025/this.scale.y,y=5/this.camera.getArmLength(),m=this.camera.getArmRotation().horizontal,g=new uh(Math.cos(m),Math.sin(m)),b=this.xRange,_=this.yRange,x=this.zRange;for(c.lineWidth=1,r=void 0===this.defaultXStep,(n=new dh(b.min,b.max,this.xStep,r)).start(!0);!n.end();){var w=n.getCurrent();if(this.showGrid?(t=new lh(w,_.min,x.min),e=new lh(w,_.max,x.min),this._line3d(c,t,e,this.gridColor)):this.showXAxis&&(t=new lh(w,_.min,x.min),e=new lh(w,_.min+p,x.min),this._line3d(c,t,e,this.axisColor),t=new lh(w,_.max,x.min),e=new lh(w,_.max-p,x.min),this._line3d(c,t,e,this.axisColor)),this.showXAxis){a=g.x>0?_.min:_.max,h=new lh(w,a,x.min);var k=" "+this.xValueLabel(w)+" ";this._drawAxisLabelX.call(this,c,h,k,m,y)}n.next()}for(c.lineWidth=1,r=void 0===this.defaultYStep,(n=new dh(_.min,_.max,this.yStep,r)).start(!0);!n.end();){var C=n.getCurrent();if(this.showGrid?(t=new lh(b.min,C,x.min),e=new lh(b.max,C,x.min),this._line3d(c,t,e,this.gridColor)):this.showYAxis&&(t=new lh(b.min,C,x.min),e=new lh(b.min+v,C,x.min),this._line3d(c,t,e,this.axisColor),t=new lh(b.max,C,x.min),e=new lh(b.max-v,C,x.min),this._line3d(c,t,e,this.axisColor)),this.showYAxis){o=g.y>0?b.min:b.max,h=new lh(o,C,x.min);var E=" "+this.yValueLabel(C)+" ";this._drawAxisLabelY.call(this,c,h,E,m,y)}n.next()}if(this.showZAxis){for(c.lineWidth=1,r=void 0===this.defaultZStep,(n=new dh(x.min,x.max,this.zStep,r)).start(!0),o=g.x>0?b.min:b.max,a=g.y<0?_.min:_.max;!n.end();){var S=n.getCurrent(),T=new lh(o,a,S),A=this._convert3Dto2D(T);e=new uh(A.x-y,A.y),this._line(c,A,e,this.axisColor);var O=this.zValueLabel(S)+" ";this._drawAxisLabelZ.call(this,c,T,O,5),n.next()}c.lineWidth=1,t=new lh(o,a,x.min),e=new lh(o,a,x.max),this._line3d(c,t,e,this.axisColor)}this.showXAxis&&(c.lineWidth=1,f=new lh(b.min,_.min,x.min),d=new lh(b.max,_.min,x.min),this._line3d(c,f,d,this.axisColor),f=new lh(b.min,_.max,x.min),d=new lh(b.max,_.max,x.min),this._line3d(c,f,d,this.axisColor));this.showYAxis&&(c.lineWidth=1,t=new lh(b.min,_.min,x.min),e=new lh(b.min,_.max,x.min),this._line3d(c,t,e,this.axisColor),t=new lh(b.max,_.min,x.min),e=new lh(b.max,_.max,x.min),this._line3d(c,t,e,this.axisColor));var P=this.xLabel;P.length>0&&this.showXAxis&&(u=.1/this.scale.y,o=(b.max+3*b.min)/4,a=g.x>0?_.min-u:_.max+u,i=new lh(o,a,x.min),this.drawAxisLabelX(c,i,P,m));var D=this.yLabel;D.length>0&&this.showYAxis&&(l=.1/this.scale.x,o=g.y>0?b.min-l:b.max+l,a=(_.max+3*_.min)/4,i=new lh(o,a,x.min),this.drawAxisLabelY(c,i,D,m));var L=this.zLabel;L.length>0&&this.showZAxis&&(30,o=g.x>0?b.min:b.max,a=g.y<0?_.min:_.max,s=(x.max+3*x.min)/4,i=new lh(o,a,s),this.drawAxisLabelZ(c,i,L,30))},Vh.prototype._getStrokeWidth=function(t){return void 0!==t?this.showPerspective?1/-t.trans.z*this.dataColor.strokeWidth:-this.eye.z/this.camera.getArmLength()*this.dataColor.strokeWidth:this.dataColor.strokeWidth},Vh.prototype._redrawBar=function(t,e,n,r,i,o){var a,s=this,l=e.point,u=this.zRange.min,c=[{point:new lh(l.x-n,l.y-r,l.z)},{point:new lh(l.x+n,l.y-r,l.z)},{point:new lh(l.x+n,l.y+r,l.z)},{point:new lh(l.x-n,l.y+r,l.z)}],h=[{point:new lh(l.x-n,l.y-r,u)},{point:new lh(l.x+n,l.y-r,u)},{point:new lh(l.x+n,l.y+r,u)},{point:new lh(l.x-n,l.y+r,u)}];Fi(c).call(c,(function(t){t.screen=s._convert3Dto2D(t.point)})),Fi(h).call(h,(function(t){t.screen=s._convert3Dto2D(t.point)}));var f=[{corners:c,center:lh.avg(h[0].point,h[2].point)},{corners:[c[0],c[1],h[1],h[0]],center:lh.avg(h[1].point,h[0].point)},{corners:[c[1],c[2],h[2],h[1]],center:lh.avg(h[2].point,h[1].point)},{corners:[c[2],c[3],h[3],h[2]],center:lh.avg(h[3].point,h[2].point)},{corners:[c[3],c[0],h[0],h[3]],center:lh.avg(h[0].point,h[3].point)}];e.surfaces=f;for(var d=0;d<f.length;d++){a=f[d];var p=this._convertPointToTranslation(a.center);a.dist=this.showPerspective?p.length():-p.z}vc(f).call(f,(function(t,e){var n=e.dist-t.dist;return n||(t.corners===c?1:e.corners===c?-1:0)})),t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=o,t.fillStyle=i;for(var v=2;v<f.length;v++)a=f[v],this._polygon(t,a.corners)},Vh.prototype._polygon=function(t,e,n,r){if(!(e.length<2)){void 0!==n&&(t.fillStyle=n),void 0!==r&&(t.strokeStyle=r),t.beginPath(),t.moveTo(e[0].screen.x,e[0].screen.y);for(var i=1;i<e.length;++i){var o=e[i];t.lineTo(o.screen.x,o.screen.y)}t.closePath(),oa(t).call(t),t.stroke()}},Vh.prototype._drawCircle=function(t,e,n,r,i){var o=this._calcRadius(e,i);t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=r,t.fillStyle=n,t.beginPath(),t.arc(e.screen.x,e.screen.y,o,0,2*Math.PI,!0),oa(t).call(t),t.stroke()},Vh.prototype._getColorsRegular=function(t){var e=(t.point.value-this.valueRange.min)*this.scale.value;return{fill:this._colormap(e,1),border:this._colormap(e,.8)}},Vh.prototype._getColorsColor=function(t){var e,n,r;if(t&&t.point&&t.point.data&&t.point.data.style&&(r=t.point.data.style),r&&"object"===ei(r)&&oa(r)&&r.stroke)return{fill:oa(r),border:r.stroke};if("string"==typeof t.point.value)e=t.point.value,n=t.point.value;else{var i=(t.point.value-this.valueRange.min)*this.scale.value;e=this._colormap(i,1),n=this._colormap(i,.8)}return{fill:e,border:n}},Vh.prototype._getColorsSize=function(){return{fill:oa(this.dataColor),border:this.dataColor.stroke}},Vh.prototype._colormap=function(t){var e,n,r,i,o,a,s,l,u,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,h=this.colormap;if(fi(h)){var f=h.length-1,d=Math.max(Math.floor(t*f),0),p=Math.min(d+1,f),v=t*f-d,y=h[d],m=h[p];e=y.r+v*(m.r-y.r),n=y.g+v*(m.g-y.g),r=y.b+v*(m.b-y.b)}else if("function"==typeof h){var g=h(t);e=g.r,n=g.g,r=g.b,i=g.a}else{var b=240*(1-t),_=Ml(b/360,1,1);e=_.r,n=_.g,r=_.b}return"number"!=typeof i||ah(i)?ui(o=ui(a="RGB(".concat(Math.round(e*c),", ")).call(a,Math.round(n*c),", ")).call(o,Math.round(r*c),")"):ui(s=ui(l=ui(u="RGBA(".concat(Math.round(e*c),", ")).call(u,Math.round(n*c),", ")).call(l,Math.round(r*c),", ")).call(s,i,")")},Vh.prototype._calcRadius=function(t,e){var n;return void 0===e&&(e=this._dotSize()),(n=this.showPerspective?e/-t.trans.z:e*(-this.eye.z/this.camera.getArmLength()))<0&&(n=0),n},Vh.prototype._redrawBarGraphPoint=function(t,e){var n=this.xBarWidth/2,r=this.yBarWidth/2,i=this._getColorsRegular(e);this._redrawBar(t,e,n,r,oa(i),i.border)},Vh.prototype._redrawBarColorGraphPoint=function(t,e){var n=this.xBarWidth/2,r=this.yBarWidth/2,i=this._getColorsColor(e);this._redrawBar(t,e,n,r,oa(i),i.border)},Vh.prototype._redrawBarSizeGraphPoint=function(t,e){var n=(e.point.value-this.valueRange.min)/this.valueRange.range(),r=this.xBarWidth/2*(.8*n+.2),i=this.yBarWidth/2*(.8*n+.2),o=this._getColorsSize();this._redrawBar(t,e,r,i,oa(o),o.border)},Vh.prototype._redrawDotGraphPoint=function(t,e){var n=this._getColorsRegular(e);this._drawCircle(t,e,oa(n),n.border)},Vh.prototype._redrawDotLineGraphPoint=function(t,e){var n=this._convert3Dto2D(e.bottom);t.lineWidth=1,this._line(t,n,e.screen,this.gridColor),this._redrawDotGraphPoint(t,e)},Vh.prototype._redrawDotColorGraphPoint=function(t,e){var n=this._getColorsColor(e);this._drawCircle(t,e,oa(n),n.border)},Vh.prototype._redrawDotSizeGraphPoint=function(t,e){var n=this._dotSize(),r=(e.point.value-this.valueRange.min)/this.valueRange.range(),i=n*this.dotSizeMinFraction,o=i+(n*this.dotSizeMaxFraction-i)*r,a=this._getColorsSize();this._drawCircle(t,e,oa(a),a.border,o)},Vh.prototype._redrawSurfaceGraphPoint=function(t,e){var n=e.pointRight,r=e.pointTop,i=e.pointCross;if(void 0!==e&&void 0!==n&&void 0!==r&&void 0!==i){var o,a,s,l=!0;if(this.showGrayBottom||this.showShadow){var u=lh.subtract(i.trans,e.trans),c=lh.subtract(r.trans,n.trans),h=lh.crossProduct(u,c);if(this.showPerspective){var f=lh.avg(lh.avg(e.trans,i.trans),lh.avg(n.trans,r.trans));s=-lh.dotProduct(h.normalize(),f.normalize())}else s=h.z/h.length();l=s>0}if(l||!this.showGrayBottom){var d=((e.point.value+n.point.value+r.point.value+i.point.value)/4-this.valueRange.min)*this.scale.value,p=this.showShadow?(1+s)/2:1;o=this._colormap(d,p)}else o="gray";a=this.showSurfaceGrid?this.axisColor:o,t.lineWidth=this._getStrokeWidth(e);var v=[e,n,i,r];this._polygon(t,v,o,a)}},Vh.prototype._drawGridLine=function(t,e,n){if(void 0!==e&&void 0!==n){var r=((e.point.value+n.point.value)/2-this.valueRange.min)*this.scale.value;t.lineWidth=2*this._getStrokeWidth(e),t.strokeStyle=this._colormap(r,1),this._line(t,e.screen,n.screen)}},Vh.prototype._redrawGridGraphPoint=function(t,e){this._drawGridLine(t,e,e.pointRight),this._drawGridLine(t,e,e.pointTop)},Vh.prototype._redrawLineGraphPoint=function(t,e){void 0!==e.pointNext&&(t.lineWidth=this._getStrokeWidth(e),t.strokeStyle=this.dataColor.stroke,this._line(t,e.screen,e.pointNext.screen))},Vh.prototype._redrawDataGraph=function(){var t,e=this._getContext();if(!(void 0===this.dataPoints||this.dataPoints.length<=0))for(this._calcTranslations(this.dataPoints),t=0;t<this.dataPoints.length;t++){var n=this.dataPoints[t];this._pointDrawingMethod.call(this,e,n)}},Vh.prototype._storeMousePosition=function(t){this.startMouseX=Xh(t),this.startMouseY=Hh(t),this._startCameraOffset=this.camera.getOffset()},Vh.prototype._onMouseDown=function(t){if(t=t||window.event,this.leftButtonDown&&this._onMouseUp(t),this.leftButtonDown=t.which?1===t.which:1===t.button,this.leftButtonDown||this.touchDown){this._storeMousePosition(t),this.startStart=new Date(this.start),this.startEnd=new Date(this.end),this.startArmRotation=this.camera.getArmRotation(),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},Cl(document,"mousemove",e.onmousemove),Cl(document,"mouseup",e.onmouseup),Sl(t)}},Vh.prototype._onMouseMove=function(t){this.moving=!0,t=t||window.event;var e=oh(Xh(t))-this.startMouseX,n=oh(Hh(t))-this.startMouseY;if(t&&!0===t.ctrlKey){var r=.5*this.frame.clientWidth,i=.5*this.frame.clientHeight,o=(this._startCameraOffset.x||0)-e/r*this.camera.armLength*.8,a=(this._startCameraOffset.y||0)+n/i*this.camera.armLength*.8;this.camera.setOffset(o,a),this._storeMousePosition(t)}else{var s=this.startArmRotation.horizontal+e/200,l=this.startArmRotation.vertical+n/200,u=Math.sin(4/360*2*Math.PI);Math.abs(Math.sin(s))<u&&(s=Math.round(s/Math.PI)*Math.PI-.001),Math.abs(Math.cos(s))<u&&(s=(Math.round(s/Math.PI-.5)+.5)*Math.PI-.001),Math.abs(Math.sin(l))<u&&(l=Math.round(l/Math.PI)*Math.PI),Math.abs(Math.cos(l))<u&&(l=(Math.round(l/Math.PI-.5)+.5)*Math.PI),this.camera.setArmRotation(s,l)}this.redraw();var c=this.getCameraPosition();this.emit("cameraPositionChange",c),Sl(t)},Vh.prototype._onMouseUp=function(t){this.frame.style.cursor="auto",this.leftButtonDown=!1,El(document,"mousemove",this.onmousemove),El(document,"mouseup",this.onmouseup),Sl(t)},Vh.prototype._onClick=function(t){if(this.onclick_callback||this.hasListeners("click")){if(this.moving)this.moving=!1;else{var e=this.frame.getBoundingClientRect(),n=Xh(t)-e.left,r=Hh(t)-e.top,i=this._dataPointFromXY(n,r);i&&(this.onclick_callback&&this.onclick_callback(i.point.data),this.emit("click",i.point.data))}Sl(t)}},Vh.prototype._onTooltip=function(t){var e=this.tooltipDelay,n=this.frame.getBoundingClientRect(),r=Xh(t)-n.left,i=Hh(t)-n.top;if(this.showTooltip)if(this.tooltipTimeout&&clearTimeout(this.tooltipTimeout),this.leftButtonDown)this._hideTooltip();else if(this.tooltip&&this.tooltip.dataPoint){var o=this._dataPointFromXY(r,i);o!==this.tooltip.dataPoint&&(o?this._showTooltip(o):this._hideTooltip())}else{var a=this;this.tooltipTimeout=na((function(){a.tooltipTimeout=null;var t=a._dataPointFromXY(r,i);t&&a._showTooltip(t)}),e)}},Vh.prototype._onTouchStart=function(t){this.touchDown=!0;var e=this;this.ontouchmove=function(t){e._onTouchMove(t)},this.ontouchend=function(t){e._onTouchEnd(t)},Cl(document,"touchmove",e.ontouchmove),Cl(document,"touchend",e.ontouchend),this._onMouseDown(t)},Vh.prototype._onTouchMove=function(t){this._onMouseMove(t)},Vh.prototype._onTouchEnd=function(t){this.touchDown=!1,El(document,"touchmove",this.ontouchmove),El(document,"touchend",this.ontouchend),this._onMouseUp(t)},Vh.prototype._onWheel=function(t){if(t||(t=window.event),this.zoomable&&(!this.ctrlToZoom||t.ctrlKey)){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var n=this.camera.getArmLength()*(1-e/10);this.camera.setArmLength(n),this.redraw(),this._hideTooltip()}var r=this.getCameraPosition();this.emit("cameraPositionChange",r),Sl(t)}},Vh.prototype._insideTriangle=function(t,e){var n=e[0],r=e[1],i=e[2];function o(t){return t>0?1:t<0?-1:0}var a=o((r.x-n.x)*(t.y-n.y)-(r.y-n.y)*(t.x-n.x)),s=o((i.x-r.x)*(t.y-r.y)-(i.y-r.y)*(t.x-r.x)),l=o((n.x-i.x)*(t.y-i.y)-(n.y-i.y)*(t.x-i.x));return!(0!=a&&0!=s&&a!=s||0!=s&&0!=l&&s!=l||0!=a&&0!=l&&a!=l)},Vh.prototype._dataPointFromXY=function(t,e){var n,r=null,i=null,o=null,a=new uh(t,e);if(this.style===Vh.STYLE.BAR||this.style===Vh.STYLE.BARCOLOR||this.style===Vh.STYLE.BARSIZE)for(n=this.dataPoints.length-1;n>=0;n--){var s=(r=this.dataPoints[n]).surfaces;if(s)for(var l=s.length-1;l>=0;l--){var u=s[l].corners,c=[u[0].screen,u[1].screen,u[2].screen],h=[u[2].screen,u[3].screen,u[0].screen];if(this._insideTriangle(a,c)||this._insideTriangle(a,h))return r}}else for(n=0;n<this.dataPoints.length;n++){var f=(r=this.dataPoints[n]).screen;if(f){var d=Math.abs(t-f.x),p=Math.abs(e-f.y),v=Math.sqrt(d*d+p*p);(null===o||v<o)&&v<100&&(o=v,i=r)}}return i},Vh.prototype.hasBars=function(t){return t==Vh.STYLE.BAR||t==Vh.STYLE.BARCOLOR||t==Vh.STYLE.BARSIZE},Vh.prototype._showTooltip=function(t){var e,n,r;this.tooltip?(e=this.tooltip.dom.content,n=this.tooltip.dom.line,r=this.tooltip.dom.dot):(e=document.createElement("div"),Qi(e.style,{},this.tooltipStyle.content),e.style.position="absolute",n=document.createElement("div"),Qi(n.style,{},this.tooltipStyle.line),n.style.position="absolute",r=document.createElement("div"),Qi(r.style,{},this.tooltipStyle.dot),r.style.position="absolute",this.tooltip={dataPoint:null,dom:{content:e,line:n,dot:r}}),this._hideTooltip(),this.tooltip.dataPoint=t,"function"==typeof this.showTooltip?e.innerHTML=this.showTooltip(t.point):e.innerHTML="<table><tr><td>"+this.xLabel+":</td><td>"+t.point.x+"</td></tr><tr><td>"+this.yLabel+":</td><td>"+t.point.y+"</td></tr><tr><td>"+this.zLabel+":</td><td>"+t.point.z+"</td></tr></table>",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(n),this.frame.appendChild(r);var i=e.offsetWidth,o=e.offsetHeight,a=n.offsetHeight,s=r.offsetWidth,l=r.offsetHeight,u=t.screen.x-i/2;u=Math.min(Math.max(u,10),this.frame.clientWidth-10-i),n.style.left=t.screen.x+"px",n.style.top=t.screen.y-a+"px",e.style.left=u+"px",e.style.top=t.screen.y-a-o+"px",r.style.left=t.screen.x-s/2+"px",r.style.top=t.screen.y-l/2+"px"},Vh.prototype._hideTooltip=function(){if(this.tooltip)for(var t in this.tooltip.dataPoint=null,this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}},Vh.prototype.setCameraPosition=function(t){Ph(t,this),this.redraw()},Vh.prototype.setSize=function(t,e){this._setSize(t,e),this.redraw()};var Uh=Object.freeze({__proto__:null,default:Vh});var qh=Object.freeze({__proto__:null,default:function(t){var e,n=t&&t.preventDefault||!1,r=t&&t.container||window,i={},o={keydown:{},keyup:{}},a={};for(e=97;e<=122;e++)a[String.fromCharCode(e)]={code:e-97+65,shift:!1};for(e=65;e<=90;e++)a[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;e<=9;e++)a[""+e]={code:48+e,shift:!1};for(e=1;e<=12;e++)a["F"+e]={code:111+e,shift:!1};for(e=0;e<=9;e++)a["num"+e]={code:96+e,shift:!1};a["num*"]={code:106,shift:!1},a["num+"]={code:107,shift:!1},a["num-"]={code:109,shift:!1},a["num/"]={code:111,shift:!1},a["num."]={code:110,shift:!1},a.left={code:37,shift:!1},a.up={code:38,shift:!1},a.right={code:39,shift:!1},a.down={code:40,shift:!1},a.space={code:32,shift:!1},a.enter={code:13,shift:!1},a.shift={code:16,shift:void 0},a.esc={code:27,shift:!1},a.backspace={code:8,shift:!1},a.tab={code:9,shift:!1},a.ctrl={code:17,shift:!1},a.alt={code:18,shift:!1},a.delete={code:46,shift:!1},a.pageup={code:33,shift:!1},a.pagedown={code:34,shift:!1},a["="]={code:187,shift:!1},a["-"]={code:189,shift:!1},a["]"]={code:221,shift:!1},a["["]={code:219,shift:!1};var s=function(t){u(t,"keydown")},l=function(t){u(t,"keyup")},u=function(t,e){if(void 0!==o[e][t.keyCode]){for(var r=o[e][t.keyCode],i=0;i<r.length;i++)(void 0===r[i].shift||1==r[i].shift&&1==t.shiftKey||0==r[i].shift&&0==t.shiftKey)&&r[i].fn(t);1==n&&t.preventDefault()}};return i.bind=function(t,e,n){if(void 0===n&&(n="keydown"),void 0===a[t])throw new Error("unsupported key: "+t);void 0===o[n][a[t].code]&&(o[n][a[t].code]=[]),o[n][a[t].code].push({fn:e,shift:a[t].shift})},i.bindAll=function(t,e){for(var n in void 0===e&&(e="keydown"),a)a.hasOwnProperty(n)&&i.bind(n,t,e)},i.getKey=function(t){for(var e in a)if(a.hasOwnProperty(e)){if(1==t.shiftKey&&1==a[e].shift&&t.keyCode==a[e].code)return e;if(0==t.shiftKey&&0==a[e].shift&&t.keyCode==a[e].code)return e;if(t.keyCode==a[e].code&&"shift"==e)return e}return"unknown key, currently not supported"},i.unbind=function(t,e,n){if(void 0===n&&(n="keydown"),void 0===a[t])throw new Error("unsupported key: "+t);if(void 0!==e){var r=[],i=o[n][a[t].code];if(void 0!==i)for(var s=0;s<i.length;s++)i[s].fn==e&&i[s].shift==a[t].shift||r.push(o[n][a[t].code][s]);o[n][a[t].code]=r}else o[n][a[t].code]=[]},i.reset=function(){o={keydown:{},keyup:{}}},i.destroy=function(){o={keydown:{},keyup:{}},r.removeEventListener("keydown",s,!0),r.removeEventListener("keyup",l,!0)},r.addEventListener("keydown",s,!0),r.addEventListener("keyup",l,!0),i}}),Zh=l(tu),$h=l(eh),Qh=l(Uh),Kh=l(mh),Jh=l(Wh),tf=l(hh),ef=l(qh),nf=Zh,rf=eu,of=$h.DataSet,af=$h.DataView,sf=$h.Queue,lf=Qh,uf={Camera:Kh,Filter:Jh,Point2d:uh,Point3d:lh,Slider:tf,StepNumber:dh},cf=Zh.Hammer,hf=ef,ff={util:nf,DOMutil:rf,DataSet:of,DataView:af,Queue:sf,Graph3d:lf,graph3d:uf,Hammer:cf,keycharm:hf};t.DOMutil=rf,t.DataSet=of,t.DataView=af,t.Graph3d=lf,t.Hammer=cf,t.Queue=sf,t.default=ff,t.graph3d=uf,t.keycharm=hf,t.util=nf,Object.defineProperty(t,"__esModule",{value:!0})}));
27//# sourceMappingURL=vis-graph3d.min.js.map