Comparing version 5.0.0 to 5.0.1
export * from "./deep-object-assign"; | ||
export * from "./random"; | ||
export * from "./shared"; | ||
export * from "./util"; | ||
//# sourceMappingURL=entry-esnext.d.ts.map |
@@ -7,4 +7,4 @@ /** | ||
* | ||
* @version 5.0.0 | ||
* @date 2021-01-08T09:53:38.982Z | ||
* @version 5.0.1 | ||
* @date 2021-01-08T16:32:03.971Z | ||
* | ||
@@ -27,3 +27,3 @@ * @copyright (c) 2011-2017 Almende B.V, http://almende.com | ||
*/ | ||
const t=Symbol("DELETE");function e(t,...e){return r({},t,...e)}function r(...t){const e=n(...t);return i(e),e}function n(...e){if(e.length<2)return e[0];if(e.length>2)return n(r(e[0],e[1]),...e.slice(2));const i=e[0],u=e[1];for(const e of Reflect.ownKeys(u))Object.prototype.propertyIsEnumerable.call(u,e)&&(u[e]===t?delete i[e]:null===i[e]||null===u[e]||"object"!=typeof i[e]||"object"!=typeof u[e]||Array.isArray(i[e])||Array.isArray(u[e])?i[e]=o(u[e]):i[e]=n(i[e],u[e]));return i}function o(t){return Array.isArray(t)?t.map((t=>o(t))):"object"==typeof t&&null!==t?n({},t):t}function i(e){for(const r of Object.keys(e))e[r]===t?delete e[r]:"object"==typeof e[r]&&null!==e[r]&&i(e[r])}function u(...t){return function(t){let[e,r,n]=function(...t){const e=function(){let t=4022871197;return function(e){const r=e.toString();for(let e=0;e<r.length;e++){t+=r.charCodeAt(e);let n=.02519603282416938*t;t=n>>>0,n-=t,n*=t,t=n>>>0,n-=t,t+=4294967296*n}return 2.3283064365386963e-10*(t>>>0)}}();let r=e(" "),n=e(" "),o=e(" ");for(let i=0;i<t.length;i++)r-=e(t[i]),r<0&&(r+=1),n-=e(t[i]),n<0&&(n+=1),o-=e(t[i]),o<0&&(o+=1);return[r,n,o]}(t),o=1;const i=()=>{const t=2091639*e+2.3283064365386963e-10*o;return e=r,r=n,n=t-(o=0|t)};return i.uint32=()=>4294967296*i(),i.fract53=()=>i()+11102230246251565e-32*(2097152*i()|0),i.algorithm="Alea",i.seed=t,i.version="0.9",i}(t.length?t:[Date.now()])}const c=/^\/?Date\((-?\d+)/i,l=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,a=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,s=/^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,f=/^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 h(t){return t instanceof Number||"number"==typeof t}function d(t){if(t)for(;!0===t.hasChildNodes();){const e=t.firstChild;e&&(d(e),t.removeChild(e))}}function b(t){return t instanceof String||"string"==typeof t}function g(t){return"object"==typeof t&&null!==t}function p(t){if(t instanceof Date)return!0;if(b(t)){if(c.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1}function y(t,e,r,n){let o=!1;!0===n&&(o=null===e[r]&&void 0!==t[r]),o?delete t[r]:t[r]=e[r]}function v(t,e,r=!1){for(const n in t)if(void 0!==e[n])if(null===e[n]||"object"!=typeof e[n])y(t,e,n,r);else{const o=t[n],i=e[n];g(o)&&g(i)&&v(o,i,r)}}const m=Object.assign;function O(t,e,...r){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(const n of r)for(let r=0;r<t.length;r++){const o=t[r];n&&Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}function j(t,e,r,n=!1){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(let o=0;o<t.length;o++){const i=t[o];if(Object.prototype.hasOwnProperty.call(r,i))if(r[i]&&r[i].constructor===Object)void 0===e[i]&&(e[i]={}),e[i].constructor===Object?A(e[i],r[i],!1,n):y(e,r,i,n);else{if(Array.isArray(r[i]))throw new TypeError("Arrays are not supported by deepExtend");y(e,r,i,n)}}return e}function w(t,e,r,n=!1){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(const o in r)if(Object.prototype.hasOwnProperty.call(r,o)&&!t.includes(o))if(r[o]&&r[o].constructor===Object)void 0===e[o]&&(e[o]={}),e[o].constructor===Object?A(e[o],r[o]):y(e,r,o,n);else if(Array.isArray(r[o])){e[o]=[];for(let t=0;t<r[o].length;t++)e[o].push(r[o][t])}else y(e,r,o,n);return e}function A(t,e,r=!1,n=!1){for(const o in e)(Object.prototype.hasOwnProperty.call(e,o)||!0===r)&&("object"==typeof e[o]&&null!==e[o]&&Object.getPrototypeOf(e[o])===Object.prototype?void 0===t[o]?t[o]=A({},e[o],r):"object"==typeof t[o]&&null!==t[o]&&Object.getPrototypeOf(t[o])===Object.prototype?A(t[o],e[o],r):y(t,e,o,n):Array.isArray(e[o])?t[o]=e[o].slice():y(t,e,o,n));return t}function k(t,e){if(t.length!==e.length)return!1;for(let r=0,n=t.length;r<n;r++)if(t[r]!=e[r])return!1;return!0}function E(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e}function x(t,e){return[...t,e]}function M(t){return t.slice()}function I(t){return t.getBoundingClientRect().left}function N(t){return t.getBoundingClientRect().right}function P(t){return t.getBoundingClientRect().top}function C(t,e){let r=t.className.split(" ");const n=e.split(" ");r=r.concat(n.filter((function(t){return!r.includes(t)}))),t.className=r.join(" ")}function S(t,e){let r=t.className.split(" ");const n=e.split(" ");r=r.filter((function(t){return!n.includes(t)})),t.className=r.join(" ")}function T(t,e){if(Array.isArray(t)){const r=t.length;for(let n=0;n<r;n++)e(t[n],n,t)}else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&e(t[r],r,t)}const D=Object.values;function Q(t,e,r){return t[e]!==r&&(t[e]=r,!0)}function B(t){let e=!1;return()=>{e||(e=!0,requestAnimationFrame((()=>{e=!1,t()})))}}function $(t,e,r,n){t.addEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.addEventListener(e,r,n)):t.attachEvent("on"+e,r)}function F(t,e,r,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.removeEventListener(e,r,n)):t.detachEvent("on"+e,r)}function L(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)}function R(t=window.event){let 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,e instanceof Element))?e:null}function W(t,e){let r=t;for(;r;){if(r===e)return!0;if(!r.parentNode)return!1;r=r.parentNode}return!1}const q={asBoolean:(t,e)=>("function"==typeof t&&(t=t()),null!=t?0!=t:e||null),asNumber:(t,e)=>("function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null),asString:(t,e)=>("function"==typeof t&&(t=t()),null!=t?String(t):e||null),asSize:(t,e)=>("function"==typeof t&&(t=t()),b(t)?t:h(t)?t+"px":e||null),asElement:(t,e)=>("function"==typeof t&&(t=t()),t||e||null)};function z(t){let e;switch(t.length){case 3:case 4:return e=a.exec(t),e?{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16)}:null;case 6:case 7:return e=l.exec(t),e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null;default:return null}}function K(t,e){if(t.includes("rgba"))return t;if(t.includes("rgb")){const r=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+r[0]+","+r[1]+","+r[2]+","+e+")"}{const r=z(t);return null==r?t:"rgba("+r.r+","+r.g+","+r.b+","+e+")"}}function V(t,e,r){return"#"+((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)}function G(t,e){if(b(t)){let e=t;if(et(e)){const t=e.substr(4).substr(0,e.length-5).split(",").map((function(t){return parseInt(t)}));e=V(t[0],t[1],t[2])}if(!0===tt(e)){const t=_(e),r={h:t.h,s:.8*t.s,v:Math.min(1,1.02*t.v)},n={h:t.h,s:Math.min(1,1.25*t.s),v:.8*t.v},o=Z(n.h,n.s,n.v),i=Z(r.h,r.s,r.v);return{background:e,border:o,highlight:{background:i,border:o},hover:{background:i,border:o}}}return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}if(e){return{background:t.background||e.background,border:t.border||e.border,highlight:b(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:b(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}}}return{background:t.background||void 0,border:t.border||void 0,highlight:b(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:b(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}}function H(t,e,r){t/=255,e/=255,r/=255;const n=Math.min(t,Math.min(e,r)),o=Math.max(t,Math.max(e,r));if(n===o)return{h:0,s:0,v:n};return{h:60*((t===n?3:r===n?1:5)-(t===n?e-r:r===n?t-e:r-t)/(o-n))/360,s:(o-n)/o,v:o}}const J={split(t){const e={};return t.split(";").forEach((t=>{if(""!=t.trim()){const r=t.split(":"),n=r[0].trim(),o=r[1].trim();e[n]=o}})),e},join:t=>Object.keys(t).map((function(e){return e+": "+t[e]})).join("; ")};function U(t,e){const r={...J.split(t.style.cssText),...J.split(e)};t.style.cssText=J.join(r)}function X(t,e){const r=J.split(t.style.cssText),n=J.split(e);for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&delete r[t];t.style.cssText=J.join(r)}function Y(t,e,r){let n,o,i;const u=Math.floor(6*t),c=6*t-u,l=r*(1-e),a=r*(1-c*e),s=r*(1-(1-c)*e);switch(u%6){case 0:n=r,o=s,i=l;break;case 1:n=a,o=r,i=l;break;case 2:n=l,o=r,i=s;break;case 3:n=l,o=a,i=r;break;case 4:n=s,o=l,i=r;break;case 5:n=r,o=l,i=a}return{r:Math.floor(255*n),g:Math.floor(255*o),b:Math.floor(255*i)}}function Z(t,e,r){const n=Y(t,e,r);return V(n.r,n.g,n.b)}function _(t){const e=z(t);if(!e)throw new TypeError(`'${t}' is not a valid color.`);return H(e.r,e.g,e.b)}function tt(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}function et(t){return s.test(t)}function rt(t){return f.test(t)}function nt(t,e){if(null!==e&&"object"==typeof e){const r=Object.create(e);for(let n=0;n<t.length;n++)Object.prototype.hasOwnProperty.call(e,t[n])&&"object"==typeof e[t[n]]&&(r[t[n]]=ot(e[t[n]]));return r}return null}function ot(t){if(null===t||"object"!=typeof t)return null;if(t instanceof Element)return t;const e=Object.create(t);for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&"object"==typeof t[r]&&(e[r]=ot(t[r]));return e}function it(t,e){for(let r=0;r<t.length;r++){const n=t[r];let o;for(o=r;o>0&&e(n,t[o-1])<0;o--)t[o]=t[o-1];t[o]=n}return t}function ut(t,e,r,n={}){const o=function(t){return null!=t},i=function(t){return null!==t&&"object"==typeof t};if(!i(t))throw new Error("Parameter mergeTarget must be an object");if(!i(e))throw new Error("Parameter options must be an object");if(!o(r))throw new Error("Parameter option must have a value");if(!i(n))throw new Error("Parameter globalOptions must be an object");const u=e[r],c=i(n)&&!function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(n)?n[r]:void 0,l=c?c.enabled:void 0;if(void 0===u)return;if("boolean"==typeof u)return i(t[r])||(t[r]={}),void(t[r].enabled=u);if(null===u&&!i(t[r])){if(!o(c))return;t[r]=Object.create(c)}if(!i(u))return;let a=!0;void 0!==u.enabled?a=u.enabled:void 0!==l&&(a=c.enabled),function(t,e,r){i(t[r])||(t[r]={});const n=e[r],o=t[r];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(o[t]=n[t])}(t,e,r),t[r].enabled=a}function ct(t,e,r,n){let o=0,i=0,u=t.length-1;for(;i<=u&&o<1e4;){const c=Math.floor((i+u)/2),l=t[c],a=e(void 0===n?l[r]:l[r][n]);if(0==a)return c;-1==a?i=c+1:u=c-1,o++}return-1}function lt(t,e,r,n,o){let i,u,c,l,a=0,s=0,f=t.length-1;for(o=null!=o?o:function(t,e){return t==e?0:t<e?-1:1};s<=f&&a<1e4;){if(l=Math.floor(.5*(f+s)),i=t[Math.max(0,l-1)][r],u=t[l][r],c=t[Math.min(t.length-1,l+1)][r],0==o(u,e))return l;if(o(i,e)<0&&o(u,e)>0)return"before"==n?Math.max(0,l-1):l;if(o(u,e)<0&&o(c,e)>0)return"before"==n?l:Math.min(t.length-1,l+1);o(u,e)<0?s=l+1:f=l-1,a++}return-1}const at={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1- --t*t*t*t,easeInOutQuart:t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1+--t*t*t*t*t,easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};function st(){const t=document.createElement("p");t.style.width="100%",t.style.height="200px";const 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);const r=t.offsetWidth;e.style.overflow="scroll";let n=t.offsetWidth;return r==n&&(n=e.clientWidth),document.body.removeChild(e),r-n}function ft(t,e){let r;Array.isArray(e)||(e=[e]);for(const n of t)if(n){r=n[e[0]];for(let t=1;t<e.length;t++)r&&(r=r[e[t]]);if(void 0!==r)break}return r}export{u as Alea,t as DELETE,Z as HSVToHex,Y as HSVToRGB,H as RGBToHSV,V as RGBToHex,C as addClassName,U as addCssText,$ as addEventListener,ct as binarySearchCustom,lt as binarySearchValue,ot as bridgeObject,x as copyAndExtendArray,M as copyArray,A as deepExtend,r as deepObjectAssign,at as easingFunctions,k as equalArray,m as extend,v as fillIfDefined,T as forEach,I as getAbsoluteLeft,N as getAbsoluteRight,P as getAbsoluteTop,st as getScrollBarWidth,R as getTarget,E as getType,W as hasParent,_ as hexToHSV,z as hexToRGB,it as insertSort,p as isDate,h as isNumber,g as isObject,b as isString,tt as isValidHex,et as isValidRGB,rt as isValidRGBA,ut as mergeOptions,q as option,K as overrideOpacity,G as parseColor,L as preventDefault,e as pureDeepObjectAssign,d as recursiveDOMDelete,S as removeClassName,X as removeCssText,F as removeEventListener,nt as selectiveBridgeObject,j as selectiveDeepExtend,O as selectiveExtend,w as selectiveNotDeepExtend,B as throttle,D as toArray,ft as topMost,Q as updateProperty}; | ||
import t from"component-emitter";import e from"@egjs/hammerjs";const i=Symbol("DELETE");function o(t,...e){return n({},t,...e)}function n(...t){const e=r(...t);return a(e),e}function r(...t){if(t.length<2)return t[0];if(t.length>2)return r(n(t[0],t[1]),...t.slice(2));const e=t[0],o=t[1];for(const t of Reflect.ownKeys(o))Object.prototype.propertyIsEnumerable.call(o,t)&&(o[t]===i?delete e[t]:null===e[t]||null===o[t]||"object"!=typeof e[t]||"object"!=typeof o[t]||Array.isArray(e[t])||Array.isArray(o[t])?e[t]=s(o[t]):e[t]=r(e[t],o[t]));return e}function s(t){return Array.isArray(t)?t.map((t=>s(t))):"object"==typeof t&&null!==t?r({},t):t}function a(t){for(const e of Object.keys(t))t[e]===i?delete t[e]:"object"==typeof t[e]&&null!==t[e]&&a(t[e])}function l(...t){return function(t){let[e,i,o]=function(...t){const e=function(){let t=4022871197;return function(e){const i=e.toString();for(let e=0;e<i.length;e++){t+=i.charCodeAt(e);let o=.02519603282416938*t;t=o>>>0,o-=t,o*=t,t=o>>>0,o-=t,t+=4294967296*o}return 2.3283064365386963e-10*(t>>>0)}}();let i=e(" "),o=e(" "),n=e(" ");for(let r=0;r<t.length;r++)i-=e(t[r]),i<0&&(i+=1),o-=e(t[r]),o<0&&(o+=1),n-=e(t[r]),n<0&&(n+=1);return[i,o,n]}(t),n=1;const r=()=>{const t=2091639*e+2.3283064365386963e-10*n;return e=i,i=o,o=t-(n=0|t)};return r.uint32=()=>4294967296*r(),r.fract53=()=>r()+11102230246251565e-32*(2097152*r()|0),r.algorithm="Alea",r.seed=t,r.version="0.9",r}(t.length?t:[Date.now()])}const c="undefined"!=typeof window?window.Hammer||e:function(){return function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:()=>({set:t})}}()};function h(t){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((()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)}));const e=c(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push((()=>{e.destroy()}));["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((t=>{e.on(t,(t=>{t.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=e=>{(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push((()=>{document.body.removeEventListener("click",this._onClick)}))),this._escListener=t=>{("key"in t?"Escape"===t.key:27===t.keyCode)&&this.deactivate()}}t(h.prototype),h.current=null,h.prototype.destroy=function(){this.deactivate();for(const t of this._cleanupQueue.splice(0).reverse())t()},h.prototype.activate=function(){h.current&&h.current.deactivate(),h.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)},h.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")},h.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};const d=/^\/?Date\((-?\d+)/i,u=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,p=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,f=/^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,g=/^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 m(t){return t instanceof Number||"number"==typeof t}function v(t){if(t)for(;!0===t.hasChildNodes();){const e=t.firstChild;e&&(v(e),t.removeChild(e))}}function b(t){return t instanceof String||"string"==typeof t}function y(t){return"object"==typeof t&&null!==t}function k(t){if(t instanceof Date)return!0;if(b(t)){if(d.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1}function C(t,e,i,o){let n=!1;!0===o&&(n=null===e[i]&&void 0!==t[i]),n?delete t[i]:t[i]=e[i]}function F(t,e,i=!1){for(const o in t)if(void 0!==e[o])if(null===e[o]||"object"!=typeof e[o])C(t,e,o,i);else{const n=t[o],r=e[o];y(n)&&y(r)&&F(n,r,i)}}const _=Object.assign;function w(t,e,...i){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(const o of i)for(let i=0;i<t.length;i++){const n=t[i];o&&Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}function E(t,e,i,o=!1){if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(let n=0;n<t.length;n++){const r=t[n];if(Object.prototype.hasOwnProperty.call(i,r))if(i[r]&&i[r].constructor===Object)void 0===e[r]&&(e[r]={}),e[r].constructor===Object?D(e[r],i[r],!1,o):C(e,i,r,o);else{if(Array.isArray(i[r]))throw new TypeError("Arrays are not supported by deepExtend");C(e,i,r,o)}}return e}function x(t,e,i,o=!1){if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&!t.includes(n))if(i[n]&&i[n].constructor===Object)void 0===e[n]&&(e[n]={}),e[n].constructor===Object?D(e[n],i[n]):C(e,i,n,o);else if(Array.isArray(i[n])){e[n]=[];for(let t=0;t<i[n].length;t++)e[n].push(i[n][t])}else C(e,i,n,o);return e}function D(t,e,i=!1,o=!1){for(const n in e)(Object.prototype.hasOwnProperty.call(e,n)||!0===i)&&("object"==typeof e[n]&&null!==e[n]&&Object.getPrototypeOf(e[n])===Object.prototype?void 0===t[n]?t[n]=D({},e[n],i):"object"==typeof t[n]&&null!==t[n]&&Object.getPrototypeOf(t[n])===Object.prototype?D(t[n],e[n],i):C(t,e,n,o):Array.isArray(e[n])?t[n]=e[n].slice():C(t,e,n,o));return t}function O(t,e){if(t.length!==e.length)return!1;for(let i=0,o=t.length;i<o;i++)if(t[i]!=e[i])return!1;return!0}function P(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e}function A(t,e){return[...t,e]}function B(t){return t.slice()}function j(t){return t.getBoundingClientRect().left}function R(t){return t.getBoundingClientRect().right}function N(t){return t.getBoundingClientRect().top}function S(t,e){let i=t.className.split(" ");const o=e.split(" ");i=i.concat(o.filter((function(t){return!i.includes(t)}))),t.className=i.join(" ")}function T(t,e){let i=t.className.split(" ");const o=e.split(" ");i=i.filter((function(t){return!o.includes(t)})),t.className=i.join(" ")}function M(t,e){if(Array.isArray(t)){const i=t.length;for(let o=0;o<i;o++)e(t[o],o,t)}else for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&e(t[i],i,t)}const I=Object.values;function L(t,e,i){return t[e]!==i&&(t[e]=i,!0)}function H(t){let e=!1;return()=>{e||(e=!0,requestAnimationFrame((()=>{e=!1,t()})))}}function Q(t,e,i,o){t.addEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)}function q(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)}function W(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)}function z(t=window.event){let 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,e instanceof Element))?e:null}function V(t,e){let i=t;for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}return!1}const $={asBoolean:(t,e)=>("function"==typeof t&&(t=t()),null!=t?0!=t:e||null),asNumber:(t,e)=>("function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null),asString:(t,e)=>("function"==typeof t&&(t=t()),null!=t?String(t):e||null),asSize:(t,e)=>("function"==typeof t&&(t=t()),b(t)?t:m(t)?t+"px":e||null),asElement:(t,e)=>("function"==typeof t&&(t=t()),t||e||null)};function U(t){let e;switch(t.length){case 3:case 4:return e=p.exec(t),e?{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16)}:null;case 6:case 7:return e=u.exec(t),e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null;default:return null}}function J(t,e){if(t.includes("rgba"))return t;if(t.includes("rgb")){const i=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+e+")"}{const i=U(t);return null==i?t:"rgba("+i.r+","+i.g+","+i.b+","+e+")"}}function K(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)}function Y(t,e){if(b(t)){let e=t;if(rt(e)){const t=e.substr(4).substr(0,e.length-5).split(",").map((function(t){return parseInt(t)}));e=K(t[0],t[1],t[2])}if(!0===nt(e)){const t=ot(e),i={h:t.h,s:.8*t.s,v:Math.min(1,1.02*t.v)},o={h:t.h,s:Math.min(1,1.25*t.s),v:.8*t.v},n=it(o.h,o.s,o.v),r=it(i.h,i.s,i.v);return{background:e,border:n,highlight:{background:r,border:n},hover:{background:r,border:n}}}return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}if(e){return{background:t.background||e.background,border:t.border||e.border,highlight:b(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:b(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}}}return{background:t.background||void 0,border:t.border||void 0,highlight:b(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:b(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}}function G(t,e,i){t/=255,e/=255,i/=255;const o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o===n)return{h:0,s:0,v:o};return{h:60*((t===o?3:i===o?1:5)-(t===o?e-i:i===o?t-e:i-t)/(n-o))/360,s:(n-o)/n,v:n}}const X={split(t){const e={};return t.split(";").forEach((t=>{if(""!=t.trim()){const i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}})),e},join:t=>Object.keys(t).map((function(e){return e+": "+t[e]})).join("; ")};function Z(t,e){const i={...X.split(t.style.cssText),...X.split(e)};t.style.cssText=X.join(i)}function tt(t,e){const i=X.split(t.style.cssText),o=X.split(e);for(const t in o)Object.prototype.hasOwnProperty.call(o,t)&&delete i[t];t.style.cssText=X.join(i)}function et(t,e,i){let o,n,r;const s=Math.floor(6*t),a=6*t-s,l=i*(1-e),c=i*(1-a*e),h=i*(1-(1-a)*e);switch(s%6){case 0:o=i,n=h,r=l;break;case 1:o=c,n=i,r=l;break;case 2:o=l,n=i,r=h;break;case 3:o=l,n=c,r=i;break;case 4:o=h,n=l,r=i;break;case 5:o=i,n=l,r=c}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*r)}}function it(t,e,i){const o=et(t,e,i);return K(o.r,o.g,o.b)}function ot(t){const e=U(t);if(!e)throw new TypeError(`'${t}' is not a valid color.`);return G(e.r,e.g,e.b)}function nt(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}function rt(t){return f.test(t)}function st(t){return g.test(t)}function at(t,e){if(null!==e&&"object"==typeof e){const i=Object.create(e);for(let o=0;o<t.length;o++)Object.prototype.hasOwnProperty.call(e,t[o])&&"object"==typeof e[t[o]]&&(i[t[o]]=lt(e[t[o]]));return i}return null}function lt(t){if(null===t||"object"!=typeof t)return null;if(t instanceof Element)return t;const e=Object.create(t);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"object"==typeof t[i]&&(e[i]=lt(t[i]));return e}function ct(t,e){for(let i=0;i<t.length;i++){const o=t[i];let n;for(n=i;n>0&&e(o,t[n-1])<0;n--)t[n]=t[n-1];t[n]=o}return t}function ht(t,e,i,o={}){const n=function(t){return null!=t},r=function(t){return null!==t&&"object"==typeof t};if(!r(t))throw new Error("Parameter mergeTarget must be an object");if(!r(e))throw new Error("Parameter options must be an object");if(!n(i))throw new Error("Parameter option must have a value");if(!r(o))throw new Error("Parameter globalOptions must be an object");const s=e[i],a=r(o)&&!function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(o)?o[i]:void 0,l=a?a.enabled:void 0;if(void 0===s)return;if("boolean"==typeof s)return r(t[i])||(t[i]={}),void(t[i].enabled=s);if(null===s&&!r(t[i])){if(!n(a))return;t[i]=Object.create(a)}if(!r(s))return;let c=!0;void 0!==s.enabled?c=s.enabled:void 0!==l&&(c=a.enabled),function(t,e,i){r(t[i])||(t[i]={});const o=e[i],n=t[i];for(const t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[t]=o[t])}(t,e,i),t[i].enabled=c}function dt(t,e,i,o){let n=0,r=0,s=t.length-1;for(;r<=s&&n<1e4;){const a=Math.floor((r+s)/2),l=t[a],c=e(void 0===o?l[i]:l[i][o]);if(0==c)return a;-1==c?r=a+1:s=a-1,n++}return-1}function ut(t,e,i,o,n){let r,s,a,l,c=0,h=0,d=t.length-1;for(n=null!=n?n:function(t,e){return t==e?0:t<e?-1:1};h<=d&&c<1e4;){if(l=Math.floor(.5*(d+h)),r=t[Math.max(0,l-1)][i],s=t[l][i],a=t[Math.min(t.length-1,l+1)][i],0==n(s,e))return l;if(n(r,e)<0&&n(s,e)>0)return"before"==o?Math.max(0,l-1):l;if(n(s,e)<0&&n(a,e)>0)return"before"==o?l:Math.min(t.length-1,l+1);n(s,e)<0?h=l+1:d=l-1,c++}return-1}const pt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1- --t*t*t*t,easeInOutQuart:t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1+--t*t*t*t*t,easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};function ft(){const t=document.createElement("p");t.style.width="100%",t.style.height="200px";const 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);const i=t.offsetWidth;e.style.overflow="scroll";let o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),i-o}function gt(t,e){let i;Array.isArray(e)||(e=[e]);for(const o of t)if(o){i=o[e[0]];for(let t=1;t<e.length;t++)i&&(i=i[e[t]]);if(void 0!==i)break}return i}const mt={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"};class vt{constructor(t=1){this.pixelRatio=t,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=()=>{},this.closeCallback=()=>{},this._create()}insertTo(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}setCloseCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}_isColorString(t){if("string"==typeof t)return mt[t]}setColor(t,e=!0){if("none"===t)return;let i;const o=this._isColorString(t);if(void 0!==o&&(t=o),!0===b(t)){if(!0===rt(t)){const e=t.substr(4).substr(0,t.length-5).split(",");i={r:e[0],g:e[1],b:e[2],a:1}}else if(!0===st(t)){const e=t.substr(5).substr(0,t.length-6).split(",");i={r:e[0],g:e[1],b:e[2],a:e[3]}}else if(!0===nt(t)){const e=U(t);i={r:e.r,g:e.g,b:e.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){const e=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:e}}if(void 0===i)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: "+JSON.stringify(t));this._setColor(i,e)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(t=!0){!0===t&&(this.previousColor=Object.assign({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout((()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)}),0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(t,e=!0){!0===e&&(this.initialColor=Object.assign({},t)),this.color=t;const i=G(t.r,t.g,t.b),o=2*Math.PI,n=this.r*i.s,r=this.centerCoordinates.x+n*Math.sin(o*i.h),s=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=r-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=s-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}_setOpacity(t){this.color.a=t/100,this._updatePicker(this.color)}_setBrightness(t){const e=G(this.color.r,this.color.g,this.color.b);e.v=t/100;const i=et(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(t=this.color){const e=G(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),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+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){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){const t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}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);const t=this;this.opacityRange.onchange=function(){t._setOpacity(this.value)},this.opacityRange.oninput=function(){t._setOpacity(this.value)},this.brightnessRange.onchange=function(){t._setBrightness(this.value)},this.brightnessRange.oninput=function(){t._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=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=this._loadLast.bind(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)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new c(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(t=>{t.isFirst&&this._moveSelector(t)})),this.hammer.on("tap",(t=>{this._moveSelector(t)})),this.hammer.on("panstart",(t=>{this._moveSelector(t)})),this.hammer.on("panmove",(t=>{this._moveSelector(t)})),this.hammer.on("panend",(t=>{this._moveSelector(t)}))}_generateHueCircle(){if(!1===this.generated){const 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);const e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;let o,n,r,s;t.clearRect(0,0,e,i),this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;const a=2*Math.PI/360,l=1/360,c=1/this.r;let h;for(r=0;r<360;r++)for(s=0;s<this.r;s++)o=this.centerCoordinates.x+s*Math.sin(a*r),n=this.centerCoordinates.y+s*Math.cos(a*r),h=et(r*l,s*c,1),t.fillStyle="rgb("+h.r+","+h.g+","+h.b+")",t.fillRect(o-.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,e,i)}this.generated=!0}_moveSelector(t){const e=this.colorPickerDiv.getBoundingClientRect(),i=t.center.x-e.left,o=t.center.y-e.top,n=.5*this.colorPickerDiv.clientHeight,r=.5*this.colorPickerDiv.clientWidth,s=i-r,a=o-n,l=Math.atan2(s,a),c=.98*Math.min(Math.sqrt(s*s+a*a),r),h=Math.cos(l)*c+n,d=Math.sin(l)*c+r;this.colorPickerSelector.style.top=h-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=d-.5*this.colorPickerSelector.clientWidth+"px";let u=l/(2*Math.PI);u=u<0?u+1:u;const p=c/this.r,f=G(this.color.r,this.color.g,this.color.b);f.h=u,f.s=p;const g=et(f.h,f.s,f.v);g.a=this.color.a,this.color=g,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+")"}}function bt(...t){if(t.length<1)throw new TypeError("Invalid arguments.");if(1===t.length)return document.createTextNode(t[0]);{const e=document.createElement(t[0]);return e.appendChild(bt(...t.slice(1))),e}}let yt,kt=!1;class Ct{static validate(t,e,i){kt=!1,yt=e;let o=e;return void 0!==i&&(o=e[i]),Ct.parse(t,o,[]),kt}static parse(t,e,i){for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&Ct.check(o,t,e,i)}static check(t,e,i,o){if(void 0===i[t]&&void 0===i.__any__)return void Ct.getSuggestion(t,i,o);let n=t,r=!0;void 0===i[t]&&void 0!==i.__any__&&(n="__any__",r="object"===Ct.getType(e[t]));let s=i[n];r&&void 0!==s.__type__&&(s=s.__type__),Ct.checkFields(t,e,i,n,s,o)}static checkFields(t,e,i,o,n,r){const s=function(e){console.error("%c"+e+Ct.printLocation(r,t),"background: #FFeeee; color: #dd0000")},a=Ct.getType(e[t]),l=n[a];void 0!==l?"array"===Ct.getType(l)&&-1===l.indexOf(e[t])?(s('Invalid option detected in "'+t+'". Allowed values are:'+Ct.print(l)+' not "'+e[t]+'". '),kt=!0):"object"===a&&"__any__"!==o&&(r=A(r,t),Ct.parse(e[t],i[o],r)):void 0===n.any&&(s('Invalid type received for "'+t+'". Expected: '+Ct.print(Object.keys(n))+". Received ["+a+'] "'+e[t]+'"'),kt=!0)}static getType(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(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}static getSuggestion(t,e,i){const o=Ct.findInOptions(t,e,i,!1),n=Ct.findInOptions(t,yt,[],!0);let r;r=void 0!==o.indexMatch?" in "+Ct.printLocation(o.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+'"?\n\n':n.distance<=4&&o.distance>n.distance?" in "+Ct.printLocation(o.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+Ct.printLocation(n.path,n.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+Ct.printLocation(o.path,t):". Did you mean one of these: "+Ct.print(Object.keys(e))+Ct.printLocation(i,t),console.error('%cUnknown option detected: "'+t+'"'+r,"background: #FFeeee; color: #dd0000"),kt=!0}static findInOptions(t,e,i,o=!1){let n=1e9,r="",s=[];const a=t.toLowerCase();let l;for(const c in e){let h;if(void 0!==e[c].__type__&&!0===o){const o=Ct.findInOptions(t,e[c],A(i,c));n>o.distance&&(r=o.closestMatch,s=o.path,n=o.distance,l=o.indexMatch)}else-1!==c.toLowerCase().indexOf(a)&&(l=c),h=Ct.levenshteinDistance(t,c),n>h&&(r=c,s=B(i),n=h)}return{closestMatch:r,path:s,distance:n,indexMatch:l}}static printLocation(t,e,i="Problem value found at: \n"){let o="\n\n"+i+"options = {\n";for(let e=0;e<t.length;e++){for(let t=0;t<e+1;t++)o+=" ";o+=t[e]+": {\n"}for(let e=0;e<t.length+1;e++)o+=" ";o+=e+"\n";for(let e=0;e<t.length+1;e++){for(let i=0;i<t.length-e;i++)o+=" ";o+="}\n"}return o+"\n\n"}static print(t){return JSON.stringify(t).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const i=[];let o,n;for(o=0;o<=e.length;o++)i[o]=[o];for(n=0;n<=t.length;n++)i[0][n]=n;for(o=1;o<=e.length;o++)for(n=1;n<=t.length;n++)e.charAt(o-1)==t.charAt(n-1)?i[o][n]=i[o-1][n-1]:i[o][n]=Math.min(i[o-1][n-1]+1,Math.min(i[o][n-1]+1,i[o-1][n]+1));return i[e.length][t.length]}}const Ft=h,_t=vt,wt=class{constructor(t,e,i,o=1,n=(()=>!1)){this.parent=t,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=n,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Object.assign(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new vt(o),this.wrapper=void 0}setOptions(t){if(void 0!==t){this.popupHistory={},this._removePopup();let e=!0;if("string"==typeof t)this.options.filter=t;else if(Array.isArray(t))this.options.filter=t.join();else if("object"==typeof t){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),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===this.options.filter&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const t=this.options.filter;let e=0,i=!1;for(const o in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,o)&&(this.allowCreation=!1,i=!1,"function"==typeof t?(i=t(o,[]),i=i||this._handleObject(this.configureOptions[o],[o],!0)):!0!==t&&-1===t.indexOf(o)||(i=!0),!1!==i&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(o),this._handleObject(this.configureOptions[o],[o])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let t=0;t<this.domElements.length;t++)this.wrapper.appendChild(this.domElements[t]);this._showPopupIfNeeded()}_clean(){for(let 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()}_getValue(t){let e=this.moduleOptions;for(let i=0;i<t.length;i++){if(void 0===e[t[i]]){e=void 0;break}e=e[t[i]]}return e}_makeItem(t,...e){if(!0===this.allowCreation){const i=document.createElement("div");return i.className="vis-configuration vis-config-item vis-config-s"+t.length,e.forEach((t=>{i.appendChild(t)})),this.domElements.push(i),this.domElements.length}return 0}_makeHeader(t){const e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerText=t,this._makeItem([],e)}_makeLabel(t,e,i=!1){const o=document.createElement("div");if(o.className="vis-configuration vis-config-label vis-config-s"+e.length,!0===i){for(;o.firstChild;)o.removeChild(o.firstChild);o.appendChild(bt("i","b",t))}else o.innerText=t+":";return o}_makeDropdown(t,e,i){const o=document.createElement("select");o.className="vis-configuration vis-config-select";let n=0;void 0!==e&&-1!==t.indexOf(e)&&(n=t.indexOf(e));for(let e=0;e<t.length;e++){const i=document.createElement("option");i.value=t[e],e===n&&(i.selected="selected"),i.innerText=t[e],o.appendChild(i)}const r=this;o.onchange=function(){r._update(this.value,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_makeRange(t,e,i){const o=t[0],n=t[1],r=t[2],s=t[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=n,a.max=r}catch(t){}a.step=s;let l="",c=0;if(void 0!==e){const t=1.2;e<0&&e*t<n?(a.min=Math.ceil(e*t),c=a.min,l="range increased"):e/t<n&&(a.min=Math.ceil(e/t),c=a.min,l="range increased"),e*t>r&&1!==r&&(a.max=Math.ceil(e*t),c=a.max,l="range increased"),a.value=e}else a.value=o;const h=document.createElement("input");h.className="vis-configuration vis-config-rangeinput",h.value=a.value;const d=this;a.onchange=function(){h.value=this.value,d._update(Number(this.value),i)},a.oninput=function(){h.value=this.value};const u=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,u,a,h);""!==l&&this.popupHistory[p]!==c&&(this.popupHistory[p]=c,this._setupPopup(l,p))}_makeButton(){if(!0===this.options.showButton){const t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=()=>{this._printOptions()},t.onmouseover=()=>{t.className="vis-configuration vis-config-button hover"},t.onmouseout=()=>{t.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(t)}}_setupPopup(t,e){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){const i=document.createElement("div");i.id="vis-configuration-popup",i.className="vis-configuration-popup",i.innerText=t,i.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:e}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout((()=>{this.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=setTimeout((()=>{this._removePopup()}),1800)}}_makeCheckbox(t,e,i){const o=document.createElement("input");o.type="checkbox",o.className="vis-configuration vis-config-checkbox",o.checked=t,void 0!==e&&(o.checked=e,e!==t&&("object"==typeof t?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));const n=this;o.onchange=function(){n._update(this.checked,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,o)}_makeTextInput(t,e,i){const o=document.createElement("input");o.type="text",o.className="vis-configuration vis-config-text",o.value=e,e!==t&&this.changedOptions.push({path:i,value:e});const n=this;o.onchange=function(){n._update(this.value,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,o)}_makeColorField(t,e,i){const o=t[1],n=document.createElement("div");"none"!==(e=void 0===e?o:e)?(n.className="vis-configuration vis-config-colorBlock",n.style.backgroundColor=e):n.className="vis-configuration vis-config-colorBlock none",e=void 0===e?o:e,n.onclick=()=>{this._showColorPicker(e,n,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,n)}_showColorPicker(t,e,i){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback((t=>{const o="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=o,this._update(o,i)})),this.colorPicker.setCloseCallback((()=>{e.onclick=()=>{this._showColorPicker(t,e,i)}}))}_handleObject(t,e=[],i=!1){let o=!1;const n=this.options.filter;let r=!1;for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){o=!0;const a=t[s],l=A(e,s);if("function"==typeof n&&(o=n(s,e),!1===o&&!Array.isArray(a)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,l,!0),this.allowCreation=!1===i)),!1!==o){r=!0;const t=this._getValue(l);if(Array.isArray(a))this._handleArray(a,t,l);else if("string"==typeof a)this._makeTextInput(a,t,l);else if("boolean"==typeof a)this._makeCheckbox(a,t,l);else if(a instanceof Object){if(!this.hideOption(e,s,this.moduleOptions))if(void 0!==a.enabled){const t=A(l,"enabled"),e=this._getValue(t);if(!0===e){const t=this._makeLabel(s,l,!0);this._makeItem(l,t),r=this._handleObject(a,l)||r}else this._makeCheckbox(a,e,l)}else{const t=this._makeLabel(s,l,!0);this._makeItem(l,t),r=this._handleObject(a,l)||r}}else console.error("dont know how to handle",a,s,l)}}return r}_handleArray(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}_update(t,e){const i=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(t,e,i={}){let o=i;t="false"!==(t="true"===t||t)&&t;for(let i=0;i<e.length;i++)"global"!==e[i]&&(void 0===o[e[i]]&&(o[e[i]]={}),i!==e.length-1?o=o[e[i]]:o[e[i]]=t);return i}_printOptions(){const t=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(bt("pre","const options = "+JSON.stringify(t,null,2)))}getOptions(){const t={};for(let e=0;e<this.changedOptions.length;e++)this._constructOptions(this.changedOptions[e].value,this.changedOptions[e].path,t);return t}},Et=c,xt=class{constructor(t,e){this.container=t,this.overflowMethod=e||"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)}setPosition(t,e){this.x=parseInt(t),this.y=parseInt(e)}setText(t){if(t instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(t)}else this.frame.innerText=t}show(t){if(void 0===t&&(t=!0),!0===t){const t=this.frame.clientHeight,e=this.frame.clientWidth,i=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth;let n=0,r=0;if("flip"==this.overflowMethod){let i=!1,s=!0;this.y-t<this.padding&&(s=!1),this.x+e>o-this.padding&&(i=!0),n=i?this.x-e:this.x,r=s?this.y-t:this.y}else r=this.y-t,r+t+this.padding>i&&(r=i-t-this.padding),r<this.padding&&(r=this.padding),n=this.x,n+e+this.padding>o&&(n=o-e-this.padding),n<this.padding&&(n=this.padding);this.frame.style.left=n+"px",this.frame.style.top=r+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},Dt="background: #FFeeee; color: #dd0000",Ot=Ct;export{Ft as Activator,l as Alea,_t as ColorPicker,wt as Configurator,i as DELETE,it as HSVToHex,et as HSVToRGB,Et as Hammer,xt as Popup,G as RGBToHSV,K as RGBToHex,Dt as VALIDATOR_PRINT_STYLE,Ot as Validator,S as addClassName,Z as addCssText,Q as addEventListener,dt as binarySearchCustom,ut as binarySearchValue,lt as bridgeObject,A as copyAndExtendArray,B as copyArray,D as deepExtend,n as deepObjectAssign,pt as easingFunctions,O as equalArray,_ as extend,F as fillIfDefined,M as forEach,j as getAbsoluteLeft,R as getAbsoluteRight,N as getAbsoluteTop,ft as getScrollBarWidth,z as getTarget,P as getType,V as hasParent,ot as hexToHSV,U as hexToRGB,ct as insertSort,k as isDate,m as isNumber,y as isObject,b as isString,nt as isValidHex,rt as isValidRGB,st as isValidRGBA,ht as mergeOptions,$ as option,J as overrideOpacity,Y as parseColor,W as preventDefault,o as pureDeepObjectAssign,v as recursiveDOMDelete,T as removeClassName,tt as removeCssText,q as removeEventListener,at as selectiveBridgeObject,E as selectiveDeepExtend,w as selectiveExtend,x as selectiveNotDeepExtend,H as throttle,I as toArray,gt as topMost,L as updateProperty}; | ||
//# sourceMappingURL=vis-util.min.js.map |
@@ -7,4 +7,4 @@ /** | ||
* | ||
* @version 5.0.0 | ||
* @date 2021-01-08T09:53:38.982Z | ||
* @version 5.0.1 | ||
* @date 2021-01-08T16:32:03.971Z | ||
* | ||
@@ -27,3 +27,3 @@ * @copyright (c) 2011-2017 Almende B.V, http://almende.com | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vis=e.vis||{})}(this,(function(e){const t=Symbol("DELETE");function r(...e){const t=n(...e);return i(t),t}function n(...e){if(e.length<2)return e[0];if(e.length>2)return n(r(e[0],e[1]),...e.slice(2));const i=e[0],c=e[1];for(const e of Reflect.ownKeys(c))Object.prototype.propertyIsEnumerable.call(c,e)&&(c[e]===t?delete i[e]:null===i[e]||null===c[e]||"object"!=typeof i[e]||"object"!=typeof c[e]||Array.isArray(i[e])||Array.isArray(c[e])?i[e]=o(c[e]):i[e]=n(i[e],c[e]));return i}function o(e){return Array.isArray(e)?e.map((e=>o(e))):"object"==typeof e&&null!==e?n({},e):e}function i(e){for(const r of Object.keys(e))e[r]===t?delete e[r]:"object"==typeof e[r]&&null!==e[r]&&i(e[r])}const c=/^\/?Date\((-?\d+)/i,u=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,l=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,s=/^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,a=/^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 f(e){return e instanceof Number||"number"==typeof e}function d(e){return e instanceof String||"string"==typeof e}function h(e){return"object"==typeof e&&null!==e}function b(e,t,r,n){let o=!1;!0===n&&(o=null===t[r]&&void 0!==e[r]),o?delete e[r]:e[r]=t[r]}const p=Object.assign;function g(e,t,r=!1,n=!1){for(const o in t)(Object.prototype.hasOwnProperty.call(t,o)||!0===r)&&("object"==typeof t[o]&&null!==t[o]&&Object.getPrototypeOf(t[o])===Object.prototype?void 0===e[o]?e[o]=g({},t[o],r):"object"==typeof e[o]&&null!==e[o]&&Object.getPrototypeOf(e[o])===Object.prototype?g(e[o],t[o],r):b(e,t,o,n):Array.isArray(t[o])?e[o]=t[o].slice():b(e,t,o,n));return e}const y=Object.values;const v={asBoolean:(e,t)=>("function"==typeof e&&(e=e()),null!=e?0!=e:t||null),asNumber:(e,t)=>("function"==typeof e&&(e=e()),null!=e?Number(e)||t||null:t||null),asString:(e,t)=>("function"==typeof e&&(e=e()),null!=e?String(e):t||null),asSize:(e,t)=>("function"==typeof e&&(e=e()),d(e)?e:f(e)?e+"px":t||null),asElement:(e,t)=>("function"==typeof e&&(e=e()),e||t||null)};function m(e){let t;switch(e.length){case 3:case 4:return t=l.exec(e),t?{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16)}:null;case 6:case 7:return t=u.exec(e),t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null;default:return null}}function O(e,t,r){return"#"+((1<<24)+(e<<16)+(t<<8)+r).toString(16).slice(1)}function j(e,t,r){e/=255,t/=255,r/=255;const n=Math.min(e,Math.min(t,r)),o=Math.max(e,Math.max(t,r));if(n===o)return{h:0,s:0,v:n};return{h:60*((e===n?3:r===n?1:5)-(e===n?t-r:r===n?e-t:r-e)/(o-n))/360,s:(o-n)/o,v:o}}const A={split(e){const t={};return e.split(";").forEach((e=>{if(""!=e.trim()){const r=e.split(":"),n=r[0].trim(),o=r[1].trim();t[n]=o}})),t},join:e=>Object.keys(e).map((function(t){return t+": "+e[t]})).join("; ")};function w(e,t,r){let n,o,i;const c=Math.floor(6*e),u=6*e-c,l=r*(1-t),s=r*(1-u*t),a=r*(1-(1-u)*t);switch(c%6){case 0:n=r,o=a,i=l;break;case 1:n=s,o=r,i=l;break;case 2:n=l,o=r,i=a;break;case 3:n=l,o=s,i=r;break;case 4:n=a,o=l,i=r;break;case 5:n=r,o=l,i=s}return{r:Math.floor(255*n),g:Math.floor(255*o),b:Math.floor(255*i)}}function E(e,t,r){const n=w(e,t,r);return O(n.r,n.g,n.b)}function x(e){const t=m(e);if(!t)throw new TypeError(`'${e}' is not a valid color.`);return j(t.r,t.g,t.b)}function k(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)}function T(e){return s.test(e)}function M(e){if(null===e||"object"!=typeof e)return null;if(e instanceof Element)return e;const t=Object.create(e);for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&"object"==typeof e[r]&&(t[r]=M(e[r]));return t}const S={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1+--e*e*e*e*e,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e};e.Alea=function(...e){return function(e){let[t,r,n]=function(...e){const t=function(){let e=4022871197;return function(t){const r=t.toString();for(let t=0;t<r.length;t++){e+=r.charCodeAt(t);let n=.02519603282416938*e;e=n>>>0,n-=e,n*=e,e=n>>>0,n-=e,e+=4294967296*n}return 2.3283064365386963e-10*(e>>>0)}}();let r=t(" "),n=t(" "),o=t(" ");for(let i=0;i<e.length;i++)r-=t(e[i]),r<0&&(r+=1),n-=t(e[i]),n<0&&(n+=1),o-=t(e[i]),o<0&&(o+=1);return[r,n,o]}(e),o=1;const i=()=>{const e=2091639*t+2.3283064365386963e-10*o;return t=r,r=n,n=e-(o=0|e)};return i.uint32=()=>4294967296*i(),i.fract53=()=>i()+11102230246251565e-32*(2097152*i()|0),i.algorithm="Alea",i.seed=e,i.version="0.9",i}(e.length?e:[Date.now()])},e.DELETE=t,e.HSVToHex=E,e.HSVToRGB=w,e.RGBToHSV=j,e.RGBToHex=O,e.addClassName=function(e,t){let r=e.className.split(" ");const n=t.split(" ");r=r.concat(n.filter((function(e){return!r.includes(e)}))),e.className=r.join(" ")},e.addCssText=function(e,t){const r={...A.split(e.style.cssText),...A.split(t)};e.style.cssText=A.join(r)},e.addEventListener=function(e,t,r,n){e.addEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&navigator.userAgent.includes("Firefox")&&(t="DOMMouseScroll"),e.addEventListener(t,r,n)):e.attachEvent("on"+t,r)},e.binarySearchCustom=function(e,t,r,n){let o=0,i=0,c=e.length-1;for(;i<=c&&o<1e4;){const u=Math.floor((i+c)/2),l=e[u],s=t(void 0===n?l[r]:l[r][n]);if(0==s)return u;-1==s?i=u+1:c=u-1,o++}return-1},e.binarySearchValue=function(e,t,r,n,o){let i,c,u,l,s=0,a=0,f=e.length-1;for(o=null!=o?o:function(e,t){return e==t?0:e<t?-1:1};a<=f&&s<1e4;){if(l=Math.floor(.5*(f+a)),i=e[Math.max(0,l-1)][r],c=e[l][r],u=e[Math.min(e.length-1,l+1)][r],0==o(c,t))return l;if(o(i,t)<0&&o(c,t)>0)return"before"==n?Math.max(0,l-1):l;if(o(c,t)<0&&o(u,t)>0)return"before"==n?l:Math.min(e.length-1,l+1);o(c,t)<0?a=l+1:f=l-1,s++}return-1},e.bridgeObject=M,e.copyAndExtendArray=function(e,t){return[...e,t]},e.copyArray=function(e){return e.slice()},e.deepExtend=g,e.deepObjectAssign=r,e.easingFunctions=S,e.equalArray=function(e,t){if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(e[r]!=t[r])return!1;return!0},e.extend=p,e.fillIfDefined=function e(t,r,n=!1){for(const o in t)if(void 0!==r[o])if(null===r[o]||"object"!=typeof r[o])b(t,r,o,n);else{const i=t[o],c=r[o];h(i)&&h(c)&&e(i,c,n)}},e.forEach=function(e,t){if(Array.isArray(e)){const r=e.length;for(let n=0;n<r;n++)t(e[n],n,e)}else for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(e[r],r,e)},e.getAbsoluteLeft=function(e){return e.getBoundingClientRect().left},e.getAbsoluteRight=function(e){return e.getBoundingClientRect().right},e.getAbsoluteTop=function(e){return e.getBoundingClientRect().top},e.getScrollBarWidth=function(){const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);const r=e.offsetWidth;t.style.overflow="scroll";let n=e.offsetWidth;return r==n&&(n=t.clientWidth),document.body.removeChild(t),r-n},e.getTarget=function(e=window.event){let t=null;return e&&(e.target?t=e.target:e.srcElement&&(t=e.srcElement)),t instanceof Element&&(null==t.nodeType||3!=t.nodeType||(t=t.parentNode,t instanceof Element))?t:null},e.getType=function(e){const t=typeof e;return"object"===t?null===e?"null":e instanceof Boolean?"Boolean":e instanceof Number?"Number":e instanceof String?"String":Array.isArray(e)?"Array":e instanceof Date?"Date":"Object":"number"===t?"Number":"boolean"===t?"Boolean":"string"===t?"String":void 0===t?"undefined":t},e.hasParent=function(e,t){let r=e;for(;r;){if(r===t)return!0;if(!r.parentNode)return!1;r=r.parentNode}return!1},e.hexToHSV=x,e.hexToRGB=m,e.insertSort=function(e,t){for(let r=0;r<e.length;r++){const n=e[r];let o;for(o=r;o>0&&t(n,e[o-1])<0;o--)e[o]=e[o-1];e[o]=n}return e},e.isDate=function(e){if(e instanceof Date)return!0;if(d(e)){if(c.exec(e))return!0;if(!isNaN(Date.parse(e)))return!0}return!1},e.isNumber=f,e.isObject=h,e.isString=d,e.isValidHex=k,e.isValidRGB=T,e.isValidRGBA=function(e){return a.test(e)},e.mergeOptions=function(e,t,r,n={}){const o=function(e){return null!=e},i=function(e){return null!==e&&"object"==typeof e};if(!i(e))throw new Error("Parameter mergeTarget must be an object");if(!i(t))throw new Error("Parameter options must be an object");if(!o(r))throw new Error("Parameter option must have a value");if(!i(n))throw new Error("Parameter globalOptions must be an object");const c=t[r],u=i(n)&&!function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(n)?n[r]:void 0,l=u?u.enabled:void 0;if(void 0===c)return;if("boolean"==typeof c)return i(e[r])||(e[r]={}),void(e[r].enabled=c);if(null===c&&!i(e[r])){if(!o(u))return;e[r]=Object.create(u)}if(!i(c))return;let s=!0;void 0!==c.enabled?s=c.enabled:void 0!==l&&(s=u.enabled),function(e,t,r){i(e[r])||(e[r]={});const n=t[r],o=e[r];for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(o[e]=n[e])}(e,t,r),e[r].enabled=s},e.option=v,e.overrideOpacity=function(e,t){if(e.includes("rgba"))return e;if(e.includes("rgb")){const r=e.substr(e.indexOf("(")+1).replace(")","").split(",");return"rgba("+r[0]+","+r[1]+","+r[2]+","+t+")"}{const r=m(e);return null==r?e:"rgba("+r.r+","+r.g+","+r.b+","+t+")"}},e.parseColor=function(e,t){if(d(e)){let t=e;if(T(t)){const e=t.substr(4).substr(0,t.length-5).split(",").map((function(e){return parseInt(e)}));t=O(e[0],e[1],e[2])}if(!0===k(t)){const e=x(t),r={h:e.h,s:.8*e.s,v:Math.min(1,1.02*e.v)},n={h:e.h,s:Math.min(1,1.25*e.s),v:.8*e.v},o=E(n.h,n.s,n.v),i=E(r.h,r.s,r.v);return{background:t,border:o,highlight:{background:i,border:o},hover:{background:i,border:o}}}return{background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}if(t){return{background:e.background||t.background,border:e.border||t.border,highlight:d(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||t.highlight.background,border:e.highlight&&e.highlight.border||t.highlight.border},hover:d(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||t.hover.border,background:e.hover&&e.hover.background||t.hover.background}}}return{background:e.background||void 0,border:e.border||void 0,highlight:d(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||void 0,border:e.highlight&&e.highlight.border||void 0},hover:d(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||void 0,background:e.hover&&e.hover.background||void 0}}},e.preventDefault=function(e){e||(e=window.event),e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},e.pureDeepObjectAssign=function(e,...t){return r({},e,...t)},e.recursiveDOMDelete=function e(t){if(t)for(;!0===t.hasChildNodes();){const r=t.firstChild;r&&(e(r),t.removeChild(r))}},e.removeClassName=function(e,t){let r=e.className.split(" ");const n=t.split(" ");r=r.filter((function(e){return!n.includes(e)})),e.className=r.join(" ")},e.removeCssText=function(e,t){const r=A.split(e.style.cssText),n=A.split(t);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete r[e];e.style.cssText=A.join(r)},e.removeEventListener=function(e,t,r,n){e.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&navigator.userAgent.includes("Firefox")&&(t="DOMMouseScroll"),e.removeEventListener(t,r,n)):e.detachEvent("on"+t,r)},e.selectiveBridgeObject=function(e,t){if(null!==t&&"object"==typeof t){const r=Object.create(t);for(let n=0;n<e.length;n++)Object.prototype.hasOwnProperty.call(t,e[n])&&"object"==typeof t[e[n]]&&(r[e[n]]=M(t[e[n]]));return r}return null},e.selectiveDeepExtend=function(e,t,r,n=!1){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(let o=0;o<e.length;o++){const i=e[o];if(Object.prototype.hasOwnProperty.call(r,i))if(r[i]&&r[i].constructor===Object)void 0===t[i]&&(t[i]={}),t[i].constructor===Object?g(t[i],r[i],!1,n):b(t,r,i,n);else{if(Array.isArray(r[i]))throw new TypeError("Arrays are not supported by deepExtend");b(t,r,i,n)}}return t},e.selectiveExtend=function(e,t,...r){if(!Array.isArray(e))throw new Error("Array with property names expected as first argument");for(const n of r)for(let r=0;r<e.length;r++){const o=e[r];n&&Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.selectiveNotDeepExtend=function(e,t,r,n=!1){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(const o in r)if(Object.prototype.hasOwnProperty.call(r,o)&&!e.includes(o))if(r[o]&&r[o].constructor===Object)void 0===t[o]&&(t[o]={}),t[o].constructor===Object?g(t[o],r[o]):b(t,r,o,n);else if(Array.isArray(r[o])){t[o]=[];for(let e=0;e<r[o].length;e++)t[o].push(r[o][e])}else b(t,r,o,n);return t},e.throttle=function(e){let t=!1;return()=>{t||(t=!0,requestAnimationFrame((()=>{t=!1,e()})))}},e.toArray=y,e.topMost=function(e,t){let r;Array.isArray(t)||(t=[t]);for(const n of e)if(n){r=n[t[0]];for(let e=1;e<t.length;e++)r&&(r=r[t[e]]);if(void 0!==r)break}return r},e.updateProperty=function(e,t,r){return e[t]!==r&&(e[t]=r,!0)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("component-emitter"),require("@egjs/hammerjs")):"function"==typeof define&&define.amd?define(["exports","component-emitter","@egjs/hammerjs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vis=t.vis||{},t.Emitter,t.Hammer)}(this,(function(t,e,i){function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=o(e),r=o(i);const s=Symbol("DELETE");function a(...t){const e=l(...t);return h(e),e}function l(...t){if(t.length<2)return t[0];if(t.length>2)return l(a(t[0],t[1]),...t.slice(2));const e=t[0],i=t[1];for(const t of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,t)&&(i[t]===s?delete e[t]:null===e[t]||null===i[t]||"object"!=typeof e[t]||"object"!=typeof i[t]||Array.isArray(e[t])||Array.isArray(i[t])?e[t]=c(i[t]):e[t]=l(e[t],i[t]));return e}function c(t){return Array.isArray(t)?t.map((t=>c(t))):"object"==typeof t&&null!==t?l({},t):t}function h(t){for(const e of Object.keys(t))t[e]===s?delete t[e]:"object"==typeof t[e]&&null!==t[e]&&h(t[e])}const d="undefined"!=typeof window?window.Hammer||r.default:function(){return function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:()=>({set:t})}}()};function u(t){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((()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)}));const e=d(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push((()=>{e.destroy()}));["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((t=>{e.on(t,(t=>{t.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=e=>{(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push((()=>{document.body.removeEventListener("click",this._onClick)}))),this._escListener=t=>{("key"in t?"Escape"===t.key:27===t.keyCode)&&this.deactivate()}}n.default(u.prototype),u.current=null,u.prototype.destroy=function(){this.deactivate();for(const t of this._cleanupQueue.splice(0).reverse())t()},u.prototype.activate=function(){u.current&&u.current.deactivate(),u.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)},u.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")},u.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};const p=/^\/?Date\((-?\d+)/i,f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,g=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,m=/^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,v=/^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 b(t){return t instanceof Number||"number"==typeof t}function y(t){return t instanceof String||"string"==typeof t}function k(t){return"object"==typeof t&&null!==t}function C(t,e,i,o){let n=!1;!0===o&&(n=null===e[i]&&void 0!==t[i]),n?delete t[i]:t[i]=e[i]}const F=Object.assign;function _(t,e,i=!1,o=!1){for(const n in e)(Object.prototype.hasOwnProperty.call(e,n)||!0===i)&&("object"==typeof e[n]&&null!==e[n]&&Object.getPrototypeOf(e[n])===Object.prototype?void 0===t[n]?t[n]=_({},e[n],i):"object"==typeof t[n]&&null!==t[n]&&Object.getPrototypeOf(t[n])===Object.prototype?_(t[n],e[n],i):C(t,e,n,o):Array.isArray(e[n])?t[n]=e[n].slice():C(t,e,n,o));return t}function E(t,e){return[...t,e]}function w(t){return t.slice()}const x=Object.values;const D={asBoolean:(t,e)=>("function"==typeof t&&(t=t()),null!=t?0!=t:e||null),asNumber:(t,e)=>("function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null),asString:(t,e)=>("function"==typeof t&&(t=t()),null!=t?String(t):e||null),asSize:(t,e)=>("function"==typeof t&&(t=t()),y(t)?t:b(t)?t+"px":e||null),asElement:(t,e)=>("function"==typeof t&&(t=t()),t||e||null)};function O(t){let e;switch(t.length){case 3:case 4:return e=g.exec(t),e?{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16)}:null;case 6:case 7:return e=f.exec(t),e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null;default:return null}}function P(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)}function A(t,e,i){t/=255,e/=255,i/=255;const o=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(o===n)return{h:0,s:0,v:o};return{h:60*((t===o?3:i===o?1:5)-(t===o?e-i:i===o?t-e:i-t)/(n-o))/360,s:(n-o)/n,v:n}}const B={split(t){const e={};return t.split(";").forEach((t=>{if(""!=t.trim()){const i=t.split(":"),o=i[0].trim(),n=i[1].trim();e[o]=n}})),e},join:t=>Object.keys(t).map((function(e){return e+": "+t[e]})).join("; ")};function j(t,e,i){let o,n,r;const s=Math.floor(6*t),a=6*t-s,l=i*(1-e),c=i*(1-a*e),h=i*(1-(1-a)*e);switch(s%6){case 0:o=i,n=h,r=l;break;case 1:o=c,n=i,r=l;break;case 2:o=l,n=i,r=h;break;case 3:o=l,n=c,r=i;break;case 4:o=h,n=l,r=i;break;case 5:o=i,n=l,r=c}return{r:Math.floor(255*o),g:Math.floor(255*n),b:Math.floor(255*r)}}function R(t,e,i){const o=j(t,e,i);return P(o.r,o.g,o.b)}function T(t){const e=O(t);if(!e)throw new TypeError(`'${t}' is not a valid color.`);return A(e.r,e.g,e.b)}function N(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}function S(t){return m.test(t)}function M(t){return v.test(t)}function L(t){if(null===t||"object"!=typeof t)return null;if(t instanceof Element)return t;const e=Object.create(t);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"object"==typeof t[i]&&(e[i]=L(t[i]));return e}const I={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1- --t*t*t*t,easeInOutQuart:t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1+--t*t*t*t*t,easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};const H={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"};class V{constructor(t=1){this.pixelRatio=t,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=()=>{},this.closeCallback=()=>{},this._create()}insertTo(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}setCloseCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}_isColorString(t){if("string"==typeof t)return H[t]}setColor(t,e=!0){if("none"===t)return;let i;const o=this._isColorString(t);if(void 0!==o&&(t=o),!0===y(t)){if(!0===S(t)){const e=t.substr(4).substr(0,t.length-5).split(",");i={r:e[0],g:e[1],b:e[2],a:1}}else if(!0===M(t)){const e=t.substr(5).substr(0,t.length-6).split(",");i={r:e[0],g:e[1],b:e[2],a:e[3]}}else if(!0===N(t)){const e=O(t);i={r:e.r,g:e.g,b:e.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){const e=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:e}}if(void 0===i)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: "+JSON.stringify(t));this._setColor(i,e)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(t=!0){!0===t&&(this.previousColor=Object.assign({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout((()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)}),0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(t,e=!0){!0===e&&(this.initialColor=Object.assign({},t)),this.color=t;const i=A(t.r,t.g,t.b),o=2*Math.PI,n=this.r*i.s,r=this.centerCoordinates.x+n*Math.sin(o*i.h),s=this.centerCoordinates.y+n*Math.cos(o*i.h);this.colorPickerSelector.style.left=r-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=s-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}_setOpacity(t){this.color.a=t/100,this._updatePicker(this.color)}_setBrightness(t){const e=A(this.color.r,this.color.g,this.color.b);e.v=t/100;const i=j(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(t=this.color){const e=A(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const o=this.colorPickerCanvas.clientWidth,n=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,n),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),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+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){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){const t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}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);const t=this;this.opacityRange.onchange=function(){t._setOpacity(this.value)},this.opacityRange.oninput=function(){t._setOpacity(this.value)},this.brightnessRange.onchange=function(){t._setBrightness(this.value)},this.brightnessRange.oninput=function(){t._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=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=this._loadLast.bind(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)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new d(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(t=>{t.isFirst&&this._moveSelector(t)})),this.hammer.on("tap",(t=>{this._moveSelector(t)})),this.hammer.on("panstart",(t=>{this._moveSelector(t)})),this.hammer.on("panmove",(t=>{this._moveSelector(t)})),this.hammer.on("panend",(t=>{this._moveSelector(t)}))}_generateHueCircle(){if(!1===this.generated){const 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);const e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;let o,n,r,s;t.clearRect(0,0,e,i),this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;const a=2*Math.PI/360,l=1/360,c=1/this.r;let h;for(r=0;r<360;r++)for(s=0;s<this.r;s++)o=this.centerCoordinates.x+s*Math.sin(a*r),n=this.centerCoordinates.y+s*Math.cos(a*r),h=j(r*l,s*c,1),t.fillStyle="rgb("+h.r+","+h.g+","+h.b+")",t.fillRect(o-.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,e,i)}this.generated=!0}_moveSelector(t){const e=this.colorPickerDiv.getBoundingClientRect(),i=t.center.x-e.left,o=t.center.y-e.top,n=.5*this.colorPickerDiv.clientHeight,r=.5*this.colorPickerDiv.clientWidth,s=i-r,a=o-n,l=Math.atan2(s,a),c=.98*Math.min(Math.sqrt(s*s+a*a),r),h=Math.cos(l)*c+n,d=Math.sin(l)*c+r;this.colorPickerSelector.style.top=h-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=d-.5*this.colorPickerSelector.clientWidth+"px";let u=l/(2*Math.PI);u=u<0?u+1:u;const p=c/this.r,f=A(this.color.r,this.color.g,this.color.b);f.h=u,f.s=p;const g=j(f.h,f.s,f.v);g.a=this.color.a,this.color=g,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+")"}}function q(...t){if(t.length<1)throw new TypeError("Invalid arguments.");if(1===t.length)return document.createTextNode(t[0]);{const e=document.createElement(t[0]);return e.appendChild(q(...t.slice(1))),e}}let Q,W=!1;const z="background: #FFeeee; color: #dd0000";class ${static validate(t,e,i){W=!1,Q=e;let o=e;return void 0!==i&&(o=e[i]),$.parse(t,o,[]),W}static parse(t,e,i){for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&$.check(o,t,e,i)}static check(t,e,i,o){if(void 0===i[t]&&void 0===i.__any__)return void $.getSuggestion(t,i,o);let n=t,r=!0;void 0===i[t]&&void 0!==i.__any__&&(n="__any__",r="object"===$.getType(e[t]));let s=i[n];r&&void 0!==s.__type__&&(s=s.__type__),$.checkFields(t,e,i,n,s,o)}static checkFields(t,e,i,o,n,r){const s=function(e){console.error("%c"+e+$.printLocation(r,t),z)},a=$.getType(e[t]),l=n[a];void 0!==l?"array"===$.getType(l)&&-1===l.indexOf(e[t])?(s('Invalid option detected in "'+t+'". Allowed values are:'+$.print(l)+' not "'+e[t]+'". '),W=!0):"object"===a&&"__any__"!==o&&(r=E(r,t),$.parse(e[t],i[o],r)):void 0===n.any&&(s('Invalid type received for "'+t+'". Expected: '+$.print(Object.keys(n))+". Received ["+a+'] "'+e[t]+'"'),W=!0)}static getType(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(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}static getSuggestion(t,e,i){const o=$.findInOptions(t,e,i,!1),n=$.findInOptions(t,Q,[],!0);let r;r=void 0!==o.indexMatch?" in "+$.printLocation(o.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+'"?\n\n':n.distance<=4&&o.distance>n.distance?" in "+$.printLocation(o.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+$.printLocation(n.path,n.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+$.printLocation(o.path,t):". Did you mean one of these: "+$.print(Object.keys(e))+$.printLocation(i,t),console.error('%cUnknown option detected: "'+t+'"'+r,z),W=!0}static findInOptions(t,e,i,o=!1){let n=1e9,r="",s=[];const a=t.toLowerCase();let l;for(const c in e){let h;if(void 0!==e[c].__type__&&!0===o){const o=$.findInOptions(t,e[c],E(i,c));n>o.distance&&(r=o.closestMatch,s=o.path,n=o.distance,l=o.indexMatch)}else-1!==c.toLowerCase().indexOf(a)&&(l=c),h=$.levenshteinDistance(t,c),n>h&&(r=c,s=w(i),n=h)}return{closestMatch:r,path:s,distance:n,indexMatch:l}}static printLocation(t,e,i="Problem value found at: \n"){let o="\n\n"+i+"options = {\n";for(let e=0;e<t.length;e++){for(let t=0;t<e+1;t++)o+=" ";o+=t[e]+": {\n"}for(let e=0;e<t.length+1;e++)o+=" ";o+=e+"\n";for(let e=0;e<t.length+1;e++){for(let i=0;i<t.length-e;i++)o+=" ";o+="}\n"}return o+"\n\n"}static print(t){return JSON.stringify(t).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const i=[];let o,n;for(o=0;o<=e.length;o++)i[o]=[o];for(n=0;n<=t.length;n++)i[0][n]=n;for(o=1;o<=e.length;o++)for(n=1;n<=t.length;n++)e.charAt(o-1)==t.charAt(n-1)?i[o][n]=i[o-1][n-1]:i[o][n]=Math.min(i[o-1][n-1]+1,Math.min(i[o][n-1]+1,i[o-1][n]+1));return i[e.length][t.length]}}const G=u,U=V,J=class{constructor(t,e,i,o=1,n=(()=>!1)){this.parent=t,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=n,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Object.assign(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new V(o),this.wrapper=void 0}setOptions(t){if(void 0!==t){this.popupHistory={},this._removePopup();let e=!0;if("string"==typeof t)this.options.filter=t;else if(Array.isArray(t))this.options.filter=t.join();else if("object"==typeof t){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),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===this.options.filter&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const t=this.options.filter;let e=0,i=!1;for(const o in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,o)&&(this.allowCreation=!1,i=!1,"function"==typeof t?(i=t(o,[]),i=i||this._handleObject(this.configureOptions[o],[o],!0)):!0!==t&&-1===t.indexOf(o)||(i=!0),!1!==i&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(o),this._handleObject(this.configureOptions[o],[o])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let t=0;t<this.domElements.length;t++)this.wrapper.appendChild(this.domElements[t]);this._showPopupIfNeeded()}_clean(){for(let 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()}_getValue(t){let e=this.moduleOptions;for(let i=0;i<t.length;i++){if(void 0===e[t[i]]){e=void 0;break}e=e[t[i]]}return e}_makeItem(t,...e){if(!0===this.allowCreation){const i=document.createElement("div");return i.className="vis-configuration vis-config-item vis-config-s"+t.length,e.forEach((t=>{i.appendChild(t)})),this.domElements.push(i),this.domElements.length}return 0}_makeHeader(t){const e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerText=t,this._makeItem([],e)}_makeLabel(t,e,i=!1){const o=document.createElement("div");if(o.className="vis-configuration vis-config-label vis-config-s"+e.length,!0===i){for(;o.firstChild;)o.removeChild(o.firstChild);o.appendChild(q("i","b",t))}else o.innerText=t+":";return o}_makeDropdown(t,e,i){const o=document.createElement("select");o.className="vis-configuration vis-config-select";let n=0;void 0!==e&&-1!==t.indexOf(e)&&(n=t.indexOf(e));for(let e=0;e<t.length;e++){const i=document.createElement("option");i.value=t[e],e===n&&(i.selected="selected"),i.innerText=t[e],o.appendChild(i)}const r=this;o.onchange=function(){r._update(this.value,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_makeRange(t,e,i){const o=t[0],n=t[1],r=t[2],s=t[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=n,a.max=r}catch(t){}a.step=s;let l="",c=0;if(void 0!==e){const t=1.2;e<0&&e*t<n?(a.min=Math.ceil(e*t),c=a.min,l="range increased"):e/t<n&&(a.min=Math.ceil(e/t),c=a.min,l="range increased"),e*t>r&&1!==r&&(a.max=Math.ceil(e*t),c=a.max,l="range increased"),a.value=e}else a.value=o;const h=document.createElement("input");h.className="vis-configuration vis-config-rangeinput",h.value=a.value;const d=this;a.onchange=function(){h.value=this.value,d._update(Number(this.value),i)},a.oninput=function(){h.value=this.value};const u=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,u,a,h);""!==l&&this.popupHistory[p]!==c&&(this.popupHistory[p]=c,this._setupPopup(l,p))}_makeButton(){if(!0===this.options.showButton){const t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=()=>{this._printOptions()},t.onmouseover=()=>{t.className="vis-configuration vis-config-button hover"},t.onmouseout=()=>{t.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(t)}}_setupPopup(t,e){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){const i=document.createElement("div");i.id="vis-configuration-popup",i.className="vis-configuration-popup",i.innerText=t,i.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:e}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout((()=>{this.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=setTimeout((()=>{this._removePopup()}),1800)}}_makeCheckbox(t,e,i){const o=document.createElement("input");o.type="checkbox",o.className="vis-configuration vis-config-checkbox",o.checked=t,void 0!==e&&(o.checked=e,e!==t&&("object"==typeof t?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));const n=this;o.onchange=function(){n._update(this.checked,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,o)}_makeTextInput(t,e,i){const o=document.createElement("input");o.type="text",o.className="vis-configuration vis-config-text",o.value=e,e!==t&&this.changedOptions.push({path:i,value:e});const n=this;o.onchange=function(){n._update(this.value,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,o)}_makeColorField(t,e,i){const o=t[1],n=document.createElement("div");"none"!==(e=void 0===e?o:e)?(n.className="vis-configuration vis-config-colorBlock",n.style.backgroundColor=e):n.className="vis-configuration vis-config-colorBlock none",e=void 0===e?o:e,n.onclick=()=>{this._showColorPicker(e,n,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,n)}_showColorPicker(t,e,i){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback((t=>{const o="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=o,this._update(o,i)})),this.colorPicker.setCloseCallback((()=>{e.onclick=()=>{this._showColorPicker(t,e,i)}}))}_handleObject(t,e=[],i=!1){let o=!1;const n=this.options.filter;let r=!1;for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){o=!0;const a=t[s],l=E(e,s);if("function"==typeof n&&(o=n(s,e),!1===o&&!Array.isArray(a)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,o=this._handleObject(a,l,!0),this.allowCreation=!1===i)),!1!==o){r=!0;const t=this._getValue(l);if(Array.isArray(a))this._handleArray(a,t,l);else if("string"==typeof a)this._makeTextInput(a,t,l);else if("boolean"==typeof a)this._makeCheckbox(a,t,l);else if(a instanceof Object){if(!this.hideOption(e,s,this.moduleOptions))if(void 0!==a.enabled){const t=E(l,"enabled"),e=this._getValue(t);if(!0===e){const t=this._makeLabel(s,l,!0);this._makeItem(l,t),r=this._handleObject(a,l)||r}else this._makeCheckbox(a,e,l)}else{const t=this._makeLabel(s,l,!0);this._makeItem(l,t),r=this._handleObject(a,l)||r}}else console.error("dont know how to handle",a,s,l)}}return r}_handleArray(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}_update(t,e){const i=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(t,e,i={}){let o=i;t="false"!==(t="true"===t||t)&&t;for(let i=0;i<e.length;i++)"global"!==e[i]&&(void 0===o[e[i]]&&(o[e[i]]={}),i!==e.length-1?o=o[e[i]]:o[e[i]]=t);return i}_printOptions(){const t=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(q("pre","const options = "+JSON.stringify(t,null,2)))}getOptions(){const t={};for(let e=0;e<this.changedOptions.length;e++)this._constructOptions(this.changedOptions[e].value,this.changedOptions[e].path,t);return t}},K=d,Y=class{constructor(t,e){this.container=t,this.overflowMethod=e||"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)}setPosition(t,e){this.x=parseInt(t),this.y=parseInt(e)}setText(t){if(t instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(t)}else this.frame.innerText=t}show(t){if(void 0===t&&(t=!0),!0===t){const t=this.frame.clientHeight,e=this.frame.clientWidth,i=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth;let n=0,r=0;if("flip"==this.overflowMethod){let i=!1,s=!0;this.y-t<this.padding&&(s=!1),this.x+e>o-this.padding&&(i=!0),n=i?this.x-e:this.x,r=s?this.y-t:this.y}else r=this.y-t,r+t+this.padding>i&&(r=i-t-this.padding),r<this.padding&&(r=this.padding),n=this.x,n+e+this.padding>o&&(n=o-e-this.padding),n<this.padding&&(n=this.padding);this.frame.style.left=n+"px",this.frame.style.top=r+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},X=$;t.Activator=G,t.Alea=function(...t){return function(t){let[e,i,o]=function(...t){const e=function(){let t=4022871197;return function(e){const i=e.toString();for(let e=0;e<i.length;e++){t+=i.charCodeAt(e);let o=.02519603282416938*t;t=o>>>0,o-=t,o*=t,t=o>>>0,o-=t,t+=4294967296*o}return 2.3283064365386963e-10*(t>>>0)}}();let i=e(" "),o=e(" "),n=e(" ");for(let r=0;r<t.length;r++)i-=e(t[r]),i<0&&(i+=1),o-=e(t[r]),o<0&&(o+=1),n-=e(t[r]),n<0&&(n+=1);return[i,o,n]}(t),n=1;const r=()=>{const t=2091639*e+2.3283064365386963e-10*n;return e=i,i=o,o=t-(n=0|t)};return r.uint32=()=>4294967296*r(),r.fract53=()=>r()+11102230246251565e-32*(2097152*r()|0),r.algorithm="Alea",r.seed=t,r.version="0.9",r}(t.length?t:[Date.now()])},t.ColorPicker=U,t.Configurator=J,t.DELETE=s,t.HSVToHex=R,t.HSVToRGB=j,t.Hammer=K,t.Popup=Y,t.RGBToHSV=A,t.RGBToHex=P,t.VALIDATOR_PRINT_STYLE="background: #FFeeee; color: #dd0000",t.Validator=X,t.addClassName=function(t,e){let i=t.className.split(" ");const o=e.split(" ");i=i.concat(o.filter((function(t){return!i.includes(t)}))),t.className=i.join(" ")},t.addCssText=function(t,e){const i={...B.split(t.style.cssText),...B.split(e)};t.style.cssText=B.join(i)},t.addEventListener=function(t,e,i,o){t.addEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},t.binarySearchCustom=function(t,e,i,o){let n=0,r=0,s=t.length-1;for(;r<=s&&n<1e4;){const a=Math.floor((r+s)/2),l=t[a],c=e(void 0===o?l[i]:l[i][o]);if(0==c)return a;-1==c?r=a+1:s=a-1,n++}return-1},t.binarySearchValue=function(t,e,i,o,n){let r,s,a,l,c=0,h=0,d=t.length-1;for(n=null!=n?n:function(t,e){return t==e?0:t<e?-1:1};h<=d&&c<1e4;){if(l=Math.floor(.5*(d+h)),r=t[Math.max(0,l-1)][i],s=t[l][i],a=t[Math.min(t.length-1,l+1)][i],0==n(s,e))return l;if(n(r,e)<0&&n(s,e)>0)return"before"==o?Math.max(0,l-1):l;if(n(s,e)<0&&n(a,e)>0)return"before"==o?l:Math.min(t.length-1,l+1);n(s,e)<0?h=l+1:d=l-1,c++}return-1},t.bridgeObject=L,t.copyAndExtendArray=E,t.copyArray=w,t.deepExtend=_,t.deepObjectAssign=a,t.easingFunctions=I,t.equalArray=function(t,e){if(t.length!==e.length)return!1;for(let i=0,o=t.length;i<o;i++)if(t[i]!=e[i])return!1;return!0},t.extend=F,t.fillIfDefined=function t(e,i,o=!1){for(const n in e)if(void 0!==i[n])if(null===i[n]||"object"!=typeof i[n])C(e,i,n,o);else{const r=e[n],s=i[n];k(r)&&k(s)&&t(r,s,o)}},t.forEach=function(t,e){if(Array.isArray(t)){const i=t.length;for(let o=0;o<i;o++)e(t[o],o,t)}else for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&e(t[i],i,t)},t.getAbsoluteLeft=function(t){return t.getBoundingClientRect().left},t.getAbsoluteRight=function(t){return t.getBoundingClientRect().right},t.getAbsoluteTop=function(t){return t.getBoundingClientRect().top},t.getScrollBarWidth=function(){const t=document.createElement("p");t.style.width="100%",t.style.height="200px";const 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);const i=t.offsetWidth;e.style.overflow="scroll";let o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),i-o},t.getTarget=function(t=window.event){let 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,e instanceof Element))?e:null},t.getType=function(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e},t.hasParent=function(t,e){let i=t;for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}return!1},t.hexToHSV=T,t.hexToRGB=O,t.insertSort=function(t,e){for(let i=0;i<t.length;i++){const o=t[i];let n;for(n=i;n>0&&e(o,t[n-1])<0;n--)t[n]=t[n-1];t[n]=o}return t},t.isDate=function(t){if(t instanceof Date)return!0;if(y(t)){if(p.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1},t.isNumber=b,t.isObject=k,t.isString=y,t.isValidHex=N,t.isValidRGB=S,t.isValidRGBA=M,t.mergeOptions=function(t,e,i,o={}){const n=function(t){return null!=t},r=function(t){return null!==t&&"object"==typeof t};if(!r(t))throw new Error("Parameter mergeTarget must be an object");if(!r(e))throw new Error("Parameter options must be an object");if(!n(i))throw new Error("Parameter option must have a value");if(!r(o))throw new Error("Parameter globalOptions must be an object");const s=e[i],a=r(o)&&!function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(o)?o[i]:void 0,l=a?a.enabled:void 0;if(void 0===s)return;if("boolean"==typeof s)return r(t[i])||(t[i]={}),void(t[i].enabled=s);if(null===s&&!r(t[i])){if(!n(a))return;t[i]=Object.create(a)}if(!r(s))return;let c=!0;void 0!==s.enabled?c=s.enabled:void 0!==l&&(c=a.enabled),function(t,e,i){r(t[i])||(t[i]={});const o=e[i],n=t[i];for(const t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[t]=o[t])}(t,e,i),t[i].enabled=c},t.option=D,t.overrideOpacity=function(t,e){if(t.includes("rgba"))return t;if(t.includes("rgb")){const i=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+e+")"}{const i=O(t);return null==i?t:"rgba("+i.r+","+i.g+","+i.b+","+e+")"}},t.parseColor=function(t,e){if(y(t)){let e=t;if(S(e)){const t=e.substr(4).substr(0,e.length-5).split(",").map((function(t){return parseInt(t)}));e=P(t[0],t[1],t[2])}if(!0===N(e)){const t=T(e),i={h:t.h,s:.8*t.s,v:Math.min(1,1.02*t.v)},o={h:t.h,s:Math.min(1,1.25*t.s),v:.8*t.v},n=R(o.h,o.s,o.v),r=R(i.h,i.s,i.v);return{background:e,border:n,highlight:{background:r,border:n},hover:{background:r,border:n}}}return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}if(e){return{background:t.background||e.background,border:t.border||e.border,highlight:y(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:y(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}}}return{background:t.background||void 0,border:t.border||void 0,highlight:y(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:y(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}},t.preventDefault=function(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},t.pureDeepObjectAssign=function(t,...e){return a({},t,...e)},t.recursiveDOMDelete=function t(e){if(e)for(;!0===e.hasChildNodes();){const i=e.firstChild;i&&(t(i),e.removeChild(i))}},t.removeClassName=function(t,e){let i=t.className.split(" ");const o=e.split(" ");i=i.filter((function(t){return!o.includes(t)})),t.className=i.join(" ")},t.removeCssText=function(t,e){const i=B.split(t.style.cssText),o=B.split(e);for(const t in o)Object.prototype.hasOwnProperty.call(o,t)&&delete i[t];t.style.cssText=B.join(i)},t.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},t.selectiveBridgeObject=function(t,e){if(null!==e&&"object"==typeof e){const i=Object.create(e);for(let o=0;o<t.length;o++)Object.prototype.hasOwnProperty.call(e,t[o])&&"object"==typeof e[t[o]]&&(i[t[o]]=L(e[t[o]]));return i}return null},t.selectiveDeepExtend=function(t,e,i,o=!1){if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(let n=0;n<t.length;n++){const r=t[n];if(Object.prototype.hasOwnProperty.call(i,r))if(i[r]&&i[r].constructor===Object)void 0===e[r]&&(e[r]={}),e[r].constructor===Object?_(e[r],i[r],!1,o):C(e,i,r,o);else{if(Array.isArray(i[r]))throw new TypeError("Arrays are not supported by deepExtend");C(e,i,r,o)}}return e},t.selectiveExtend=function(t,e,...i){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(const o of i)for(let i=0;i<t.length;i++){const n=t[i];o&&Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},t.selectiveNotDeepExtend=function(t,e,i,o=!1){if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&!t.includes(n))if(i[n]&&i[n].constructor===Object)void 0===e[n]&&(e[n]={}),e[n].constructor===Object?_(e[n],i[n]):C(e,i,n,o);else if(Array.isArray(i[n])){e[n]=[];for(let t=0;t<i[n].length;t++)e[n].push(i[n][t])}else C(e,i,n,o);return e},t.throttle=function(t){let e=!1;return()=>{e||(e=!0,requestAnimationFrame((()=>{e=!1,t()})))}},t.toArray=x,t.topMost=function(t,e){let i;Array.isArray(e)||(e=[e]);for(const o of t)if(o){i=o[e[0]];for(let t=1;t<e.length;t++)i&&(i=i[e[t]]);if(void 0!==i)break}return i},t.updateProperty=function(t,e,i){return t[e]!==i&&(t[e]=i,!0)},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=vis-util.min.js.map |
{ | ||
"name": "vis-util", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "utilitie collection for visjs", | ||
@@ -5,0 +5,0 @@ "browser": "peer/umd/vis-util.min.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
7061503
48664
1