From a5f93d98b8b92912ccecb0dc81295ad5e56f938e Mon Sep 17 00:00:00 2001 From: Blackwhitebear8 Date: Wed, 13 Aug 2025 21:01:37 +0200 Subject: [PATCH] Upload files to "static/js" --- static/js/bootstrap.bundle.min.js | 7 + static/js/looking_glass.js | 294 ++++++++++++++++++++++++++++++ static/js/materialize.min.js | 6 + static/js/validation.js | 36 ++++ static/js/vis-network.min.js | 34 ++++ 5 files changed, 377 insertions(+) create mode 100644 static/js/bootstrap.bundle.min.js create mode 100644 static/js/looking_glass.js create mode 100644 static/js/materialize.min.js create mode 100644 static/js/validation.js create mode 100644 static/js/vis-network.min.js diff --git a/static/js/bootstrap.bundle.min.js b/static/js/bootstrap.bundle.min.js new file mode 100644 index 0000000..da8d852 --- /dev/null +++ b/static/js/bootstrap.bundle.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v5.3.0-alpha1 (https://getbootstrap.com/) + * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t="transitionend",e=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),i=e=>{e.dispatchEvent(new Event(t))},n=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),s=t=>n(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(e(t)):null,o=t=>{if(!n(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},r=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),a=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?a(t.parentNode):null},l=()=>{},c=t=>{t.offsetHeight},h=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,d=[],u=()=>"rtl"===document.documentElement.dir,f=t=>{var e;e=()=>{const e=h();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(d.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of d)t()})),d.push(e)):e()},p=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,m=(e,n,s=!0)=>{if(!s)return void p(e);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(n)+5;let r=!1;const a=({target:i})=>{i===n&&(r=!0,n.removeEventListener(t,a),p(e))};n.addEventListener(t,a),setTimeout((()=>{r||i(n)}),o)},g=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},_=/[^.]*(?=\..*)\.|.*/,b=/\..*/,v=/::\d+$/,y={};let w=1;const A={mouseenter:"mouseover",mouseleave:"mouseout"},E=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function T(t,e){return e&&`${e}::${w++}`||t.uidEvent||w++}function C(t){const e=T(t);return t.uidEvent=e,y[e]=y[e]||{},y[e]}function O(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function x(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=D(t);return E.has(o)||(o=t),[n,s,o]}function k(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=x(e,i,n);if(e in A){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=C(t),c=l[a]||(l[a]={}),h=O(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=T(r,e.replace(_,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return N(s,{delegateTarget:r}),n.oneOff&&I.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return N(n,{delegateTarget:t}),i.oneOff&&I.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function L(t,e,i,n,s){const o=O(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function S(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&L(t,e,i,r.callable,r.delegationSelector)}function D(t){return t=t.replace(b,""),A[t]||t}const I={on(t,e,i,n){k(t,e,i,n,!1)},one(t,e,i,n){k(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=x(e,i,n),a=r!==e,l=C(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))S(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(v,"");a&&!e.includes(s)||L(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;L(t,l,r,o,s?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=h();let s=null,o=!0,r=!0,a=!1;e!==D(e)&&n&&(s=n.Event(e,i),n(t).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());let l=new Event(e,{bubbles:o,cancelable:!0});return l=N(l,i),a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function N(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}const P=new Map,j={set(t,e,i){P.has(t)||P.set(t,new Map);const n=P.get(t);n.has(e)||0===n.size?n.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(t,e)=>P.has(t)&&P.get(t).get(e)||null,remove(t,e){if(!P.has(t))return;const i=P.get(t);i.delete(e),0===i.size&&P.delete(t)}};function M(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function F(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const H={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${F(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${F(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),e[i]=M(t.dataset[n])}return e},getDataAttribute:(t,e)=>M(t.getAttribute(`data-bs-${F(e)}`))};class ${static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=n(e)?H.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...n(e)?H.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[s,o]of Object.entries(e)){const e=t[s],r=n(e)?"element":null==(i=e)?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${s}" provided type "${r}" but expected type "${o}".`)}var i}}class W extends ${constructor(t,e){super(),(t=s(t))&&(this._element=t,this._config=this._getConfig(e),j.set(this._element,this.constructor.DATA_KEY,this))}dispose(){j.remove(this._element,this.constructor.DATA_KEY),I.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){m(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return j.get(s(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.0-alpha1"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const B=t=>{let i=t.getAttribute("data-bs-target");if(!i||"#"===i){let e=t.getAttribute("href");if(!e||!e.includes("#")&&!e.startsWith("."))return null;e.includes("#")&&!e.startsWith("#")&&(e=`#${e.split("#")[1]}`),i=e&&"#"!==e?e.trim():null}return e(i)},z={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!r(t)&&o(t)))},getSelectorFromElement(t){const e=B(t);return e&&z.findOne(e)?e:null},getElementFromSelector(t){const e=B(t);return e?z.findOne(e):null},getMultipleElementsFromSelector(t){const e=B(t);return e?z.find(e):[]}},R=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;I.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),r(this))return;const s=z.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(s)[e]()}))};class q extends W{static get NAME(){return"alert"}close(){if(I.trigger(this._element,"close.bs.alert").defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),I.trigger(this._element,"closed.bs.alert"),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=q.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}R(q,"close"),f(q);const V='[data-bs-toggle="button"]';class K extends W{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=K.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}I.on(document,"click.bs.button.data-api",V,(t=>{t.preventDefault();const e=t.target.closest(V);K.getOrCreateInstance(e).toggle()})),f(K);const Q={endCallback:null,leftCallback:null,rightCallback:null},X={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Y extends ${constructor(t,e){super(),this._element=t,t&&Y.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Q}static get DefaultType(){return X}static get NAME(){return"swipe"}dispose(){I.off(this._element,".bs.swipe")}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),p(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&p(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(I.on(this._element,"pointerdown.bs.swipe",(t=>this._start(t))),I.on(this._element,"pointerup.bs.swipe",(t=>this._end(t))),this._element.classList.add("pointer-event")):(I.on(this._element,"touchstart.bs.swipe",(t=>this._start(t))),I.on(this._element,"touchmove.bs.swipe",(t=>this._move(t))),I.on(this._element,"touchend.bs.swipe",(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const U="next",G="prev",J="left",Z="right",tt="slid.bs.carousel",et="carousel",it="active",nt={ArrowLeft:Z,ArrowRight:J},st={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},ot={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class rt extends W{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=z.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===et&&this.cycle()}static get Default(){return st}static get DefaultType(){return ot}static get NAME(){return"carousel"}next(){this._slide(U)}nextWhenVisible(){!document.hidden&&o(this._element)&&this.next()}prev(){this._slide(G)}pause(){this._isSliding&&i(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?I.one(this._element,tt,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void I.one(this._element,tt,(()=>this.to(t)));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?U:G;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&I.on(this._element,"keydown.bs.carousel",(t=>this._keydown(t))),"hover"===this._config.pause&&(I.on(this._element,"mouseenter.bs.carousel",(()=>this.pause())),I.on(this._element,"mouseleave.bs.carousel",(()=>this._maybeEnableCycle()))),this._config.touch&&Y.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of z.find(".carousel-item img",this._element))I.on(t,"dragstart.bs.carousel",(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(J)),rightCallback:()=>this._slide(this._directionToOrder(Z)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new Y(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=nt[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=z.findOne(".active",this._indicatorsElement);e.classList.remove(it),e.removeAttribute("aria-current");const i=z.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(it),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===U,s=e||g(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=e=>I.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r("slide.bs.carousel").defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",h=n?"carousel-item-next":"carousel-item-prev";s.classList.add(h),c(s),i.classList.add(l),s.classList.add(l),this._queueCallback((()=>{s.classList.remove(l,h),s.classList.add(it),i.classList.remove(it,h,l),this._isSliding=!1,r(tt)}),i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return z.findOne(".active.carousel-item",this._element)}_getItems(){return z.find(".carousel-item",this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return u()?t===J?G:U:t===J?U:G}_orderToDirection(t){return u()?t===G?J:Z:t===G?Z:J}static jQueryInterface(t){return this.each((function(){const e=rt.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}I.on(document,"click.bs.carousel.data-api","[data-bs-slide], [data-bs-slide-to]",(function(t){const e=z.getElementFromSelector(this);if(!e||!e.classList.contains(et))return;t.preventDefault();const i=rt.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===H.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),I.on(window,"load.bs.carousel.data-api",(()=>{const t=z.find('[data-bs-ride="carousel"]');for(const e of t)rt.getOrCreateInstance(e)})),f(rt);const at="show",lt="collapse",ct="collapsing",ht='[data-bs-toggle="collapse"]',dt={parent:null,toggle:!0},ut={parent:"(null|element)",toggle:"boolean"};class ft extends W{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=z.find(ht);for(const t of i){const e=z.getSelectorFromElement(t),i=z.find(e).filter((t=>t===this._element));null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return dt}static get DefaultType(){return ut}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((t=>t!==this._element)).map((t=>ft.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(I.trigger(this._element,"show.bs.collapse").defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(lt),this._element.classList.add(ct),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(ct),this._element.classList.add(lt,at),this._element.style[e]="",I.trigger(this._element,"shown.bs.collapse")}),this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(I.trigger(this._element,"hide.bs.collapse").defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,c(this._element),this._element.classList.add(ct),this._element.classList.remove(lt,at);for(const t of this._triggerArray){const e=z.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(ct),this._element.classList.add(lt),I.trigger(this._element,"hidden.bs.collapse")}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(at)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=s(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(ht);for(const e of t){const t=z.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=z.find(":scope .collapse .collapse",this._config.parent);return z.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const i=ft.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}I.on(document,"click.bs.collapse.data-api",ht,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of z.getMultipleElementsFromSelector(this))ft.getOrCreateInstance(t,{toggle:!1}).toggle()})),f(ft);var pt="top",mt="bottom",gt="right",_t="left",bt="auto",vt=[pt,mt,gt,_t],yt="start",wt="end",At="clippingParents",Et="viewport",Tt="popper",Ct="reference",Ot=vt.reduce((function(t,e){return t.concat([e+"-"+yt,e+"-"+wt])}),[]),xt=[].concat(vt,[bt]).reduce((function(t,e){return t.concat([e,e+"-"+yt,e+"-"+wt])}),[]),kt="beforeRead",Lt="read",St="afterRead",Dt="beforeMain",It="main",Nt="afterMain",Pt="beforeWrite",jt="write",Mt="afterWrite",Ft=[kt,Lt,St,Dt,It,Nt,Pt,jt,Mt];function Ht(t){return t?(t.nodeName||"").toLowerCase():null}function $t(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Wt(t){return t instanceof $t(t).Element||t instanceof Element}function Bt(t){return t instanceof $t(t).HTMLElement||t instanceof HTMLElement}function zt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof $t(t).ShadowRoot||t instanceof ShadowRoot)}const Rt={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];Bt(s)&&Ht(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});Bt(n)&&Ht(n)&&(Object.assign(n.style,o),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function qt(t){return t.split("-")[0]}var Vt=Math.max,Kt=Math.min,Qt=Math.round;function Xt(){var t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Yt(){return!/^((?!chrome|android).)*safari/i.test(Xt())}function Ut(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&Bt(t)&&(s=t.offsetWidth>0&&Qt(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Qt(n.height)/t.offsetHeight||1);var r=(Wt(t)?$t(t):window).visualViewport,a=!Yt()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Gt(t){var e=Ut(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Jt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&zt(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Zt(t){return $t(t).getComputedStyle(t)}function te(t){return["table","td","th"].indexOf(Ht(t))>=0}function ee(t){return((Wt(t)?t.ownerDocument:t.document)||window.document).documentElement}function ie(t){return"html"===Ht(t)?t:t.assignedSlot||t.parentNode||(zt(t)?t.host:null)||ee(t)}function ne(t){return Bt(t)&&"fixed"!==Zt(t).position?t.offsetParent:null}function se(t){for(var e=$t(t),i=ne(t);i&&te(i)&&"static"===Zt(i).position;)i=ne(i);return i&&("html"===Ht(i)||"body"===Ht(i)&&"static"===Zt(i).position)?e:i||function(t){var e=/firefox/i.test(Xt());if(/Trident/i.test(Xt())&&Bt(t)&&"fixed"===Zt(t).position)return null;var i=ie(t);for(zt(i)&&(i=i.host);Bt(i)&&["html","body"].indexOf(Ht(i))<0;){var n=Zt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function oe(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function re(t,e,i){return Vt(t,Kt(e,i))}function ae(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function le(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}const ce={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=qt(i.placement),l=oe(a),c=[_t,gt].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return ae("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:le(t,vt))}(s.padding,i),d=Gt(o),u="y"===l?pt:_t,f="y"===l?mt:gt,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],m=r[l]-i.rects.reference[l],g=se(o),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=p/2-m/2,v=h[u],y=_-d[c]-h[f],w=_/2-d[c]/2+b,A=re(v,w,y),E=l;i.modifiersData[n]=((e={})[E]=A,e.centerOffset=A-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Jt(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function he(t){return t.split("-")[1]}var de={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ue(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,m=void 0===p?0:p,g="function"==typeof h?h({x:f,y:m}):{x:f,y:m};f=g.x,m=g.y;var _=r.hasOwnProperty("x"),b=r.hasOwnProperty("y"),v=_t,y=pt,w=window;if(c){var A=se(i),E="clientHeight",T="clientWidth";A===$t(i)&&"static"!==Zt(A=ee(i)).position&&"absolute"===a&&(E="scrollHeight",T="scrollWidth"),(s===pt||(s===_t||s===gt)&&o===wt)&&(y=mt,m-=(d&&A===w&&w.visualViewport?w.visualViewport.height:A[E])-n.height,m*=l?1:-1),s!==_t&&(s!==pt&&s!==mt||o!==wt)||(v=gt,f-=(d&&A===w&&w.visualViewport?w.visualViewport.width:A[T])-n.width,f*=l?1:-1)}var C,O=Object.assign({position:a},c&&de),x=!0===h?function(t){var e=t.x,i=t.y,n=window.devicePixelRatio||1;return{x:Qt(e*n)/n||0,y:Qt(i*n)/n||0}}({x:f,y:m}):{x:f,y:m};return f=x.x,m=x.y,l?Object.assign({},O,((C={})[y]=b?"0":"",C[v]=_?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",C)):Object.assign({},O,((e={})[y]=b?m+"px":"",e[v]=_?f+"px":"",e.transform="",e))}const fe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:qt(e.placement),variation:he(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,ue(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,ue(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var pe={passive:!0};const me={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=$t(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,pe)})),a&&l.addEventListener("resize",i.update,pe),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,pe)})),a&&l.removeEventListener("resize",i.update,pe)}},data:{}};var ge={left:"right",right:"left",bottom:"top",top:"bottom"};function _e(t){return t.replace(/left|right|bottom|top/g,(function(t){return ge[t]}))}var be={start:"end",end:"start"};function ve(t){return t.replace(/start|end/g,(function(t){return be[t]}))}function ye(t){var e=$t(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function we(t){return Ut(ee(t)).left+ye(t).scrollLeft}function Ae(t){var e=Zt(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Ee(t){return["html","body","#document"].indexOf(Ht(t))>=0?t.ownerDocument.body:Bt(t)&&Ae(t)?t:Ee(ie(t))}function Te(t,e){var i;void 0===e&&(e=[]);var n=Ee(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=$t(n),r=s?[o].concat(o.visualViewport||[],Ae(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(Te(ie(r)))}function Ce(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Oe(t,e,i){return e===Et?Ce(function(t,e){var i=$t(t),n=ee(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Yt();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+we(t),y:l}}(t,i)):Wt(e)?function(t,e){var i=Ut(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Ce(function(t){var e,i=ee(t),n=ye(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=Vt(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=Vt(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+we(t),l=-n.scrollTop;return"rtl"===Zt(s||i).direction&&(a+=Vt(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(ee(t)))}function xe(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?qt(s):null,r=s?he(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case pt:e={x:a,y:i.y-n.height};break;case mt:e={x:a,y:i.y+i.height};break;case gt:e={x:i.x+i.width,y:l};break;case _t:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?oe(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case yt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case wt:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function ke(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?At:a,c=i.rootBoundary,h=void 0===c?Et:c,d=i.elementContext,u=void 0===d?Tt:d,f=i.altBoundary,p=void 0!==f&&f,m=i.padding,g=void 0===m?0:m,_=ae("number"!=typeof g?g:le(g,vt)),b=u===Tt?Ct:Tt,v=t.rects.popper,y=t.elements[p?b:u],w=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=Te(ie(t)),i=["absolute","fixed"].indexOf(Zt(t).position)>=0&&Bt(t)?se(t):t;return Wt(i)?e.filter((function(t){return Wt(t)&&Jt(t,i)&&"body"!==Ht(t)})):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce((function(e,i){var s=Oe(t,i,n);return e.top=Vt(s.top,e.top),e.right=Kt(s.right,e.right),e.bottom=Kt(s.bottom,e.bottom),e.left=Vt(s.left,e.left),e}),Oe(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(Wt(y)?y:y.contextElement||ee(t.elements.popper),l,h,r),A=Ut(t.elements.reference),E=xe({reference:A,element:v,strategy:"absolute",placement:s}),T=Ce(Object.assign({},v,E)),C=u===Tt?T:A,O={top:w.top-C.top+_.top,bottom:C.bottom-w.bottom+_.bottom,left:w.left-C.left+_.left,right:C.right-w.right+_.right},x=t.modifiersData.offset;if(u===Tt&&x){var k=x[s];Object.keys(O).forEach((function(t){var e=[gt,mt].indexOf(t)>=0?1:-1,i=[pt,mt].indexOf(t)>=0?"y":"x";O[t]+=k[i]*e}))}return O}function Le(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?xt:l,h=he(n),d=h?a?Ot:Ot.filter((function(t){return he(t)===h})):vt,u=d.filter((function(t){return c.indexOf(t)>=0}));0===u.length&&(u=d);var f=u.reduce((function(e,i){return e[i]=ke(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[qt(i)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}const Se={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,m=i.allowedAutoPlacements,g=e.options.placement,_=qt(g),b=l||(_!==g&&p?function(t){if(qt(t)===bt)return[];var e=_e(t);return[ve(t),e,ve(e)]}(g):[_e(g)]),v=[g].concat(b).reduce((function(t,i){return t.concat(qt(i)===bt?Le(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):i)}),[]),y=e.rects.reference,w=e.rects.popper,A=new Map,E=!0,T=v[0],C=0;C=0,S=L?"width":"height",D=ke(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),I=L?k?gt:_t:k?mt:pt;y[S]>w[S]&&(I=_e(I));var N=_e(I),P=[];if(o&&P.push(D[x]<=0),a&&P.push(D[I]<=0,D[N]<=0),P.every((function(t){return t}))){T=O,E=!1;break}A.set(O,P)}if(E)for(var j=function(t){var e=v.find((function(e){var i=A.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return T=e,"break"},M=p?3:1;M>0&&"break"!==j(M);M--);e.placement!==T&&(e.modifiersData[n]._skip=!0,e.placement=T,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function De(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Ie(t){return[pt,gt,mt,_t].some((function(e){return t[e]>=0}))}const Ne={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=ke(e,{elementContext:"reference"}),a=ke(e,{altBoundary:!0}),l=De(r,n),c=De(a,s,o),h=Ie(l),d=Ie(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}},Pe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=xt.reduce((function(t,i){return t[i]=function(t,e,i){var n=qt(t),s=[_t,pt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[_t,gt].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t}),{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}},je={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=xe({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},Me={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,m=void 0===p?0:p,g=ke(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),_=qt(e.placement),b=he(e.placement),v=!b,y=oe(_),w="x"===y?"y":"x",A=e.modifiersData.popperOffsets,E=e.rects.reference,T=e.rects.popper,C="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,O="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),x=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(A){if(o){var L,S="y"===y?pt:_t,D="y"===y?mt:gt,I="y"===y?"height":"width",N=A[y],P=N+g[S],j=N-g[D],M=f?-T[I]/2:0,F=b===yt?E[I]:T[I],H=b===yt?-T[I]:-E[I],$=e.elements.arrow,W=f&&$?Gt($):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=B[S],R=B[D],q=re(0,E[I],W[I]),V=v?E[I]/2-M-q-z-O.mainAxis:F-q-z-O.mainAxis,K=v?-E[I]/2+M+q+R+O.mainAxis:H+q+R+O.mainAxis,Q=e.elements.arrow&&se(e.elements.arrow),X=Q?"y"===y?Q.clientTop||0:Q.clientLeft||0:0,Y=null!=(L=null==x?void 0:x[y])?L:0,U=N+K-Y,G=re(f?Kt(P,N+V-Y-X):P,N,f?Vt(j,U):j);A[y]=G,k[y]=G-N}if(a){var J,Z="x"===y?pt:_t,tt="x"===y?mt:gt,et=A[w],it="y"===w?"height":"width",nt=et+g[Z],st=et-g[tt],ot=-1!==[pt,_t].indexOf(_),rt=null!=(J=null==x?void 0:x[w])?J:0,at=ot?nt:et-E[it]-T[it]-rt+O.altAxis,lt=ot?et+E[it]+T[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=re(t,e,i);return n>i?i:n}(at,et,lt):re(f?at:nt,et,f?lt:st);A[w]=ct,k[w]=ct-et}e.modifiersData[n]=k}},requiresIfExists:["offset"]};function Fe(t,e,i){void 0===i&&(i=!1);var n,s,o=Bt(e),r=Bt(e)&&function(t){var e=t.getBoundingClientRect(),i=Qt(e.width)/t.offsetWidth||1,n=Qt(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=ee(e),l=Ut(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==Ht(e)||Ae(a))&&(c=(n=e)!==$t(n)&&Bt(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:ye(n)),Bt(e)?((h=Ut(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=we(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function He(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var $e={placement:"bottom",modifiers:[],strategy:"absolute"};function We(){for(var t=arguments.length,e=new Array(t),i=0;iNumber.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(H.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...p(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const i=z.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((t=>o(t)));i.length&&g(i,e,t===Xe,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=ci.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=z.find(Ze);for(const i of e){const e=ci.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),s=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[Qe,Xe].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const s=this.matches(Je)?this:z.prev(this,Je)[0]||z.next(this,Je)[0]||z.findOne(Je,t.delegateTarget.parentNode),o=ci.getOrCreateInstance(s);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),s.focus())}}I.on(document,Ue,Je,ci.dataApiKeydownHandler),I.on(document,Ue,ti,ci.dataApiKeydownHandler),I.on(document,Ye,ci.clearMenus),I.on(document,"keyup.bs.dropdown.data-api",ci.clearMenus),I.on(document,Ye,Je,(function(t){t.preventDefault(),ci.getOrCreateInstance(this).toggle()})),f(ci);const hi=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",di=".sticky-top",ui="padding-right",fi="margin-right";class pi{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,ui,(e=>e+t)),this._setElementAttributes(hi,ui,(e=>e+t)),this._setElementAttributes(di,fi,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,ui),this._resetElementAttributes(hi,ui),this._resetElementAttributes(di,fi)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(s))}px`)}))}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&H.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=H.getDataAttribute(t,e);null!==i?(H.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)}))}_applyManipulationCallback(t,e){if(n(t))e(t);else for(const i of z.find(t,this._element))e(i)}}const mi="show",gi="mousedown.bs.backdrop",_i={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},bi={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class vi extends ${constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return _i}static get DefaultType(){return bi}static get NAME(){return"backdrop"}show(t){if(!this._config.isVisible)return void p(t);this._append();const e=this._getElement();this._config.isAnimated&&c(e),e.classList.add(mi),this._emulateAnimation((()=>{p(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(mi),this._emulateAnimation((()=>{this.dispose(),p(t)}))):p(t)}dispose(){this._isAppended&&(I.off(this._element,gi),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=s(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),I.on(t,gi,(()=>{p(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){m(t,this._getElement(),this._config.isAnimated)}}const yi=".bs.focustrap",wi="backward",Ai={autofocus:!0,trapElement:null},Ei={autofocus:"boolean",trapElement:"element"};class Ti extends ${constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Ai}static get DefaultType(){return Ei}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),I.off(document,yi),I.on(document,"focusin.bs.focustrap",(t=>this._handleFocusin(t))),I.on(document,"keydown.tab.bs.focustrap",(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,I.off(document,yi))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=z.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===wi?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?wi:"forward")}}const Ci="hidden.bs.modal",Oi="show.bs.modal",xi="modal-open",ki="show",Li="modal-static",Si={backdrop:!0,focus:!0,keyboard:!0},Di={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Ii extends W{constructor(t,e){super(t,e),this._dialog=z.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new pi,this._addEventListeners()}static get Default(){return Si}static get DefaultType(){return Di}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||I.trigger(this._element,Oi,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(xi),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){this._isShown&&!this._isTransitioning&&(I.trigger(this._element,"hide.bs.modal").defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(ki),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){for(const t of[window,this._dialog])I.off(t,".bs.modal");this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new vi({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Ti({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=z.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),c(this._element),this._element.classList.add(ki),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,I.trigger(this._element,"shown.bs.modal",{relatedTarget:t})}),this._dialog,this._isAnimated())}_addEventListeners(){I.on(this._element,"keydown.dismiss.bs.modal",(t=>{if("Escape"===t.key)return this._config.keyboard?(t.preventDefault(),void this.hide()):void this._triggerBackdropTransition()})),I.on(window,"resize.bs.modal",(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),I.on(this._element,"mousedown.dismiss.bs.modal",(t=>{I.one(this._element,"click.dismiss.bs.modal",(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(xi),this._resetAdjustments(),this._scrollBar.reset(),I.trigger(this._element,Ci)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(I.trigger(this._element,"hidePrevented.bs.modal").defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(Li)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Li),this._queueCallback((()=>{this._element.classList.remove(Li),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=u()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=u()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=Ii.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}I.on(document,"click.bs.modal.data-api",'[data-bs-toggle="modal"]',(function(t){const e=z.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),I.one(e,Oi,(t=>{t.defaultPrevented||I.one(e,Ci,(()=>{o(this)&&this.focus()}))}));const i=z.findOne(".modal.show");i&&Ii.getInstance(i).hide(),Ii.getOrCreateInstance(e).toggle(this)})),R(Ii),f(Ii);const Ni="show",Pi="showing",ji="hiding",Mi=".offcanvas.show",Fi="hidePrevented.bs.offcanvas",Hi="hidden.bs.offcanvas",$i={backdrop:!0,keyboard:!0,scroll:!1},Wi={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Bi extends W{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return $i}static get DefaultType(){return Wi}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||I.trigger(this._element,"show.bs.offcanvas",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new pi).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Pi),this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Ni),this._element.classList.remove(Pi),I.trigger(this._element,"shown.bs.offcanvas",{relatedTarget:t})}),this._element,!0))}hide(){this._isShown&&(I.trigger(this._element,"hide.bs.offcanvas").defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(ji),this._backdrop.hide(),this._queueCallback((()=>{this._element.classList.remove(Ni,ji),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new pi).reset(),I.trigger(this._element,Hi)}),this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new vi({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():I.trigger(this._element,Fi)}:null})}_initializeFocusTrap(){return new Ti({trapElement:this._element})}_addEventListeners(){I.on(this._element,"keydown.dismiss.bs.offcanvas",(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():I.trigger(this._element,Fi))}))}static jQueryInterface(t){return this.each((function(){const e=Bi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}I.on(document,"click.bs.offcanvas.data-api",'[data-bs-toggle="offcanvas"]',(function(t){const e=z.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),r(this))return;I.one(e,Hi,(()=>{o(this)&&this.focus()}));const i=z.findOne(Mi);i&&i!==e&&Bi.getInstance(i).hide(),Bi.getOrCreateInstance(e).toggle(this)})),I.on(window,"load.bs.offcanvas.data-api",(()=>{for(const t of z.find(Mi))Bi.getOrCreateInstance(t).show()})),I.on(window,"resize.bs.offcanvas",(()=>{for(const t of z.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Bi.getOrCreateInstance(t).hide()})),R(Bi),f(Bi);const zi=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Ri=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i,qi=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i,Vi=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!zi.has(i)||Boolean(Ri.test(t.nodeValue)||qi.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))},Ki={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Qi={allowList:Ki,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Xi={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Yi={entry:"(string|element|function|null)",selector:"(string|element)"};class Ui extends ${constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Qi}static get DefaultType(){return Xi}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},Yi)}_setContent(t,e,i){const o=z.findOne(i,t);o&&((e=this._resolvePossibleFunction(e))?n(e)?this._putElementInTemplate(s(e),o):this._config.html?o.innerHTML=this._maybeSanitize(e):o.textContent=e:o.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const t of s){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Vi(e,s)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return p(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Gi=new Set(["sanitize","allowList","sanitizeFn"]),Ji="fade",Zi="show",tn=".modal",en="hide.bs.modal",nn="hover",sn="focus",on={AUTO:"auto",TOP:"top",RIGHT:u()?"left":"right",BOTTOM:"bottom",LEFT:u()?"right":"left"},rn={allowList:Ki,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,0],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},an={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class ln extends W{constructor(t,e){if(void 0===Ve)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return rn}static get DefaultType(){return an}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),I.off(this._element.closest(tn),en,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=I.trigger(this._element,this.constructor.eventName("show")),e=(a(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),I.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(Zi),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))I.on(t,"mouseover",l);this._queueCallback((()=>{I.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(this._isShown()&&!I.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Zi),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))I.off(t,"mouseover",l);this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this._isHovered=null,this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),I.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(Ji,Zi),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(Ji),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Ui({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Ji)}_isShown(){return this.tip&&this.tip.classList.contains(Zi)}_createPopper(t){const e=p(this._config.placement,[this,t,this._element]),i=on[e.toUpperCase()];return qe(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return p(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...p(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)I.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if("manual"!==e){const t=e===nn?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===nn?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");I.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?sn:nn]=!0,e._enter()})),I.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?sn:nn]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},I.on(this._element.closest(tn),en,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=H.getDataAttributes(this._element);for(const t of Object.keys(e))Gi.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:s(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=ln.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}f(ln);const cn={...ln.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},hn={...ln.DefaultType,content:"(null|string|element|function)"};class dn extends ln{static get Default(){return cn}static get DefaultType(){return hn}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=dn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}f(dn);const un="click.bs.scrollspy",fn="active",pn="[href]",mn={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},gn={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class _n extends W{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return mn}static get DefaultType(){return gn}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=s(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(I.off(this._config.target,un),I.on(this._config.target,un,pn,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(i(o),!n)return}else s||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=z.find(pn,this._config.target);for(const e of t){if(!e.hash||r(e))continue;const t=z.findOne(e.hash,this._element);o(t)&&(this._targetLinks.set(e.hash,e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(fn),this._activateParents(t),I.trigger(this._element,"activate.bs.scrollspy",{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))z.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(fn);else for(const e of z.parents(t,".nav, .list-group"))for(const t of z.prev(e,".nav-link, .nav-item > .nav-link, .list-group-item"))t.classList.add(fn)}_clearActiveClass(t){t.classList.remove(fn);const e=z.find("[href].active",t);for(const t of e)t.classList.remove(fn)}static jQueryInterface(t){return this.each((function(){const e=_n.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}I.on(window,"load.bs.scrollspy.data-api",(()=>{for(const t of z.find('[data-bs-spy="scroll"]'))_n.getOrCreateInstance(t)})),f(_n);const bn="ArrowLeft",vn="ArrowRight",yn="ArrowUp",wn="ArrowDown",An="active",En="fade",Tn="show",Cn='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',On=`.nav-link:not(.dropdown-toggle), .list-group-item:not(.dropdown-toggle), [role="tab"]:not(.dropdown-toggle), ${Cn}`;class xn extends W{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),I.on(this._element,"keydown.bs.tab",(t=>this._keydown(t))))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?I.trigger(e,"hide.bs.tab",{relatedTarget:t}):null;I.trigger(t,"show.bs.tab",{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(An),this._activate(z.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),I.trigger(t,"shown.bs.tab",{relatedTarget:e})):t.classList.add(Tn)}),t,t.classList.contains(En)))}_deactivate(t,e){t&&(t.classList.remove(An),t.blur(),this._deactivate(z.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),I.trigger(t,"hidden.bs.tab",{relatedTarget:e})):t.classList.remove(Tn)}),t,t.classList.contains(En)))}_keydown(t){if(![bn,vn,yn,wn].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=[vn,wn].includes(t.key),i=g(this._getChildren().filter((t=>!r(t))),t.target,e,!0);i&&(i.focus({preventScroll:!0}),xn.getOrCreateInstance(i).show())}_getChildren(){return z.find(On,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=z.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`#${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const s=z.findOne(t,i);s&&s.classList.toggle(n,e)};n(".dropdown-toggle",An),n(".dropdown-menu",Tn),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(An)}_getInnerElement(t){return t.matches(On)?t:z.findOne(On,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each((function(){const e=xn.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}I.on(document,"click.bs.tab",Cn,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),r(this)||xn.getOrCreateInstance(this).show()})),I.on(window,"load.bs.tab",(()=>{for(const t of z.find('.active[data-bs-toggle="tab"], .active[data-bs-toggle="pill"], .active[data-bs-toggle="list"]'))xn.getOrCreateInstance(t)})),f(xn);const kn="hide",Ln="show",Sn="showing",Dn={animation:"boolean",autohide:"boolean",delay:"number"},In={animation:!0,autohide:!0,delay:5e3};class Nn extends W{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return In}static get DefaultType(){return Dn}static get NAME(){return"toast"}show(){I.trigger(this._element,"show.bs.toast").defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(kn),c(this._element),this._element.classList.add(Ln,Sn),this._queueCallback((()=>{this._element.classList.remove(Sn),I.trigger(this._element,"shown.bs.toast"),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this.isShown()&&(I.trigger(this._element,"hide.bs.toast").defaultPrevented||(this._element.classList.add(Sn),this._queueCallback((()=>{this._element.classList.add(kn),this._element.classList.remove(Sn,Ln),I.trigger(this._element,"hidden.bs.toast")}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Ln),super.dispose()}isShown(){return this._element.classList.contains(Ln)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){I.on(this._element,"mouseover.bs.toast",(t=>this._onInteraction(t,!0))),I.on(this._element,"mouseout.bs.toast",(t=>this._onInteraction(t,!1))),I.on(this._element,"focusin.bs.toast",(t=>this._onInteraction(t,!0))),I.on(this._element,"focusout.bs.toast",(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=Nn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return R(Nn),f(Nn),{Alert:q,Button:K,Carousel:rt,Collapse:ft,Dropdown:ci,Modal:Ii,Offcanvas:Bi,Popover:dn,ScrollSpy:_n,Tab:xn,Toast:Nn,Tooltip:ln}})); +//# sourceMappingURL=bootstrap.bundle.min.js.map \ No newline at end of file diff --git a/static/js/looking_glass.js b/static/js/looking_glass.js new file mode 100644 index 0000000..9a27600 --- /dev/null +++ b/static/js/looking_glass.js @@ -0,0 +1,294 @@ +'use strict'; + +document.addEventListener('DOMContentLoaded', function() { + const lgForm = document.getElementById('lg-form'); + const executeBtn = document.getElementById('execute-btn'); + const methodSelect = document.getElementById('method'); + const outputConsole = document.getElementById('output-console'); + const visualizerContainer = document.getElementById('visualizer-container'); + const networkContainer = document.getElementById('mynetwork'); + const alertModal = new bootstrap.Modal(document.getElementById('alertModal')); + const alertModalBody = document.getElementById('alertModalBody'); + const mainLocationSelector = document.getElementById('main-location-selector'); + const locationsDropdownMenu = document.getElementById('locations-dropdown-menu'); + const locationNameDisplay = document.getElementById('location-name-display'); + const facilityNameDisplay = document.getElementById('facility-name-display'); + const mapLinkBtn = document.getElementById('map-link-btn'); + const peeringdbLinkBtn = document.getElementById('peeringdb-link-btn'); + const lgIpv4Input = document.getElementById('lg-ipv4'); + const lgIpv6Input = document.getElementById('lg-ipv6'); + const clientIpv4Input = document.getElementById('client-ipv4'); + const clientIpv6Input = document.getElementById('client-ipv6'); + const iperfInInput = document.getElementById('iperf-in'); + const iperfOutInput = document.getElementById('iperf-out'); + const speedtestLinksContainer = document.getElementById('speedtest-links'); + let network = null; + let allLocationsData = {}; + let clientIpApiUrls = {}; + + fetch('/api/locations') + .then(response => { + if (!response.ok) { + throw new Error(`HTTP error! Status: ${response.status}`); + } + return response.json(); + }) + .then(config => { + if (config.error) { + throw new Error(config.error); + } + allLocationsData = config.locations; + clientIpApiUrls = config.client_ip_api; + + populateLocationSelectors(); + updateLocationInfo(); + fetchClientIPs(); + }) + .catch(error => { + console.error('Fatal Error: Could not fetch initial configuration:', error); + lgForm.innerHTML = `
Could not load application configuration. Please check the server logs and your .env file.
`; + }); + + lgForm.addEventListener('submit', async function(event) { + event.preventDefault(); + + const target = document.getElementById('target').value.trim(); + const method = methodSelect.value; + + if (!target) { + showModalAlert('Please enter a target.'); + return; + } + + let isValid = false; + if (method === 'visualize') { + isValid = isValidIpOrCidr(target); + if (!isValid) { + showModalAlert('Invalid input for Visualizer. Please provide a valid IPv4/IPv6 address or CIDR prefix.'); + return; + } + } else { + const isSingleIp = isValidIPv4(target) || isValidIPv6(target); + const isHostname = isValidFqdn(target); + isValid = isSingleIp || isHostname; + + if (!isValid) { + showModalAlert('Invalid input. For this method, please provide a valid IP address (without a prefix) or a fully qualified domain name.'); + return; + } + } + + setLoadingState(true); + + if (method === 'visualize') { + handleVisualize(target); + } else { + handleCommand(method, target); + } + }); + + mainLocationSelector.addEventListener('change', updateLocationInfo); + locationsDropdownMenu.addEventListener('click', function(e) { + if (e.target.matches('a.dropdown-item')) { + e.preventDefault(); + mainLocationSelector.value = e.target.dataset.location; + mainLocationSelector.dispatchEvent(new Event('change')); + } + }); + + async function handleCommand(method, target) { + visualizerContainer.style.display = 'none'; + outputConsole.style.display = 'block'; + outputConsole.textContent = `Executing ${method} on ${target}...\n\nThis may take a few moments. Please wait.`; + + try { + const response = await fetch('/api/execute', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ method, target }) + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(errorText); + } + + const reader = response.body.getReader(); + const decoder = new TextDecoder(); + + outputConsole.textContent = ''; + + while (true) { + const { value, done } = await reader.read(); + if (done) break; + outputConsole.textContent += decoder.decode(value, { stream: true }); + outputConsole.scrollTop = outputConsole.scrollHeight; + } + + } catch (error) { + outputConsole.textContent = `--- ERROR ---\n${error.message}`; + } finally { + setLoadingState(false); + } + } + + function handleVisualize(target) { + outputConsole.style.display = 'none'; + visualizerContainer.style.display = 'block'; + + const loader = document.getElementById('visualizer-loader'); + if (network) { + network.destroy(); + } + networkContainer.innerHTML = ''; + loader.style.display = 'block'; + + fetch('/api/visualize', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ ip_address: target }) + }) + .then(response => response.json().then(data => ({ ok: response.ok, data }))) + .then(({ ok, data }) => { + if (!ok || data.error) { + throw new Error(data.error || 'Failed to retrieve visualization data.'); + } + + if (data.not_found) { + visualizerContainer.style.display = 'none'; + showModalAlert(`Route information not found for: ${data.target}`); + return; + } + + const pathCount = data.path_count || 0; + const dynamicHeight = Math.max(400, 200 + (pathCount * 150)); + networkContainer.style.height = `${dynamicHeight}px`; + + network = new vis.Network(networkContainer, data, { + layout: { hierarchical: false }, + edges: { + arrows: { to: { enabled: true, scaleFactor: 0.7 } }, + smooth: { enabled: true, type: "cubicBezier", forceDirection: "horizontal", roundness: 0.85 } + }, + nodes: { + shape: 'box', margin: 15, + font: { size: 14, color: '#343a40', multi: 'html', align: 'left' }, + borderWidth: 2 + }, + physics: { enabled: false } + }); + }) + .catch(error => { + visualizerContainer.style.display = 'none'; + outputConsole.style.display = 'block'; + outputConsole.textContent = `Visualization Error: ${error.message}`; + }) + .finally(() => { + loader.style.display = 'none'; + setLoadingState(false); + }); + } + + function showModalAlert(message) { + alertModalBody.textContent = message; + alertModal.show(); + } + + function populateLocationSelectors() { + mainLocationSelector.innerHTML = ''; + locationsDropdownMenu.innerHTML = ''; + for (const locationName in allLocationsData) { + const option = document.createElement('option'); + option.value = locationName; + option.textContent = locationName; + mainLocationSelector.appendChild(option); + + const li = document.createElement('li'); + const a = document.createElement('a'); + a.className = 'dropdown-item'; + a.href = '#'; + a.textContent = locationName; + a.dataset.location = locationName; + li.appendChild(a); + locationsDropdownMenu.appendChild(li); + } + } + + function updateLocationInfo() { + const selectedLocationName = mainLocationSelector.value; + const locationInfo = allLocationsData[selectedLocationName]; + if (!locationInfo) return; + + locationNameDisplay.value = selectedLocationName; + facilityNameDisplay.value = locationInfo.facility || 'N/A'; + mapLinkBtn.href = `https://www.openstreetmap.org/search?query=${encodeURIComponent(selectedLocationName)}`; + peeringdbLinkBtn.href = locationInfo.peeringdb_url || '#'; + peeringdbLinkBtn.classList.toggle('disabled', !locationInfo.peeringdb_url); + lgIpv4Input.value = locationInfo.ipv4 || 'N/A'; + lgIpv6Input.value = locationInfo.ipv6 || 'N/A'; + iperfInInput.value = locationInfo.iperf_in || 'N/A'; + iperfOutInput.value = locationInfo.iperf_out || 'N/A'; + + speedtestLinksContainer.innerHTML = ''; + if (locationInfo.speedtest_url_base && locationInfo.speedtest_files) { + locationInfo.speedtest_files.forEach(fileName => { + const link = document.createElement('a'); + link.href = locationInfo.speedtest_url_base + fileName; + link.textContent = fileName.replace('.bin', '').toUpperCase(); + link.className = 'btn btn-sm btn-outline-secondary'; + link.target = '_blank'; + speedtestLinksContainer.appendChild(link); + }); + } + } + + function fetchClientIPs() { + clientIpv4Input.value = 'Detecting...'; + clientIpv6Input.value = 'Detecting...'; + + if (clientIpApiUrls && clientIpApiUrls.v4) { + fetch(clientIpApiUrls.v4) + .then(response => response.json()) + .then(data => { clientIpv4Input.value = data.ip || 'Unavailable'; }) + .catch(() => { clientIpv4Input.value = 'Unavailable'; }); + } else { + clientIpv4Input.value = 'Not Configured'; + } + + if (clientIpApiUrls && clientIpApiUrls.v6) { + fetch(clientIpApiUrls.v6) + .then(response => response.json()) + .then(data => { clientIpv6Input.value = data.ip || 'Unavailable'; }) + .catch(() => { clientIpv6Input.value = 'Unavailable'; }); + } else { + clientIpv6Input.value = 'Not Configured'; + } + } + + function setLoadingState(isLoading) { + executeBtn.disabled = isLoading; + executeBtn.innerHTML = isLoading + ? ` Executing...` + : 'Execute'; + } +}); + +window.copyToClipboard = function(elementId) { + const input = document.getElementById(elementId); + if (!input) return; + + const copyButton = input.nextElementSibling; + input.select(); + input.setSelectionRange(0, 99999); + + try { + document.execCommand('copy'); + if (copyButton) { + const originalText = copyButton.textContent; + copyButton.textContent = 'Copied!'; + setTimeout(() => { copyButton.textContent = originalText; }, 2000); + } + } catch (err) { + console.error('Failed to copy text: ', err); + } +} \ No newline at end of file diff --git a/static/js/materialize.min.js b/static/js/materialize.min.js new file mode 100644 index 0000000..7d80c93 --- /dev/null +++ b/static/js/materialize.min.js @@ -0,0 +1,6 @@ +/*! + * Materialize v1.0.0 (http://materializecss.com) + * Copyright 2014-2017 Materialize + * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE) + */ +var _get=function t(e,i,n){null===e&&(e=Function.prototype);var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,i,n)}if("value"in s)return s.value;var a=s.get;return void 0!==a?a.call(n):void 0},_createClass=function(){function n(t,e){for(var i=0;i/,p=/^\w+$/;function v(t,e){e=e||o;var i=u.test(t)?e.getElementsByClassName(t.slice(1)):p.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t);return i}function f(t){if(!i){var e=(i=o.implementation.createHTMLDocument(null)).createElement("base");e.href=o.location.href,i.head.appendChild(e)}return i.body.innerHTML=t,i.body.childNodes}function m(t){"loading"!==o.readyState?t():o.addEventListener("DOMContentLoaded",t)}function g(t,e){if(!t)return this;if(t.cash&&t!==a)return t;var i,n=t,s=0;if(d(t))n=l.test(t)?o.getElementById(t.slice(1)):c.test(t)?f(t):v(t,e);else if(h(t))return m(t),this;if(!n)return this;if(n.nodeType||n===a)this[0]=n,this.length=1;else for(i=this.length=n.length;ss.right-i||l+e.width>window.innerWidth-i)&&(n.right=!0),(ho-i||h+e.height>window.innerHeight-i)&&(n.bottom=!0),n},M.checkPossibleAlignments=function(t,e,i,n){var s={top:!0,right:!0,bottom:!0,left:!0,spaceOnTop:null,spaceOnRight:null,spaceOnBottom:null,spaceOnLeft:null},o="visible"===getComputedStyle(e).overflow,a=e.getBoundingClientRect(),r=Math.min(a.height,window.innerHeight),l=Math.min(a.width,window.innerWidth),h=t.getBoundingClientRect(),d=e.scrollLeft,u=e.scrollTop,c=i.left-d,p=i.top-u,v=i.top+h.height-u;return s.spaceOnRight=o?window.innerWidth-(h.left+i.width):l-(c+i.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=o?h.right-i.width:c-i.width+h.width,s.spaceOnLeft<0&&(s.right=!1),s.spaceOnBottom=o?window.innerHeight-(h.top+i.height+n):r-(p+i.height+n),s.spaceOnBottom<0&&(s.top=!1),s.spaceOnTop=o?h.bottom-(i.height+n):v-(i.height-n),s.spaceOnTop<0&&(s.bottom=!1),s},M.getOverflowParent=function(t){return null==t?null:t===document.body||"visible"!==getComputedStyle(t).overflow?t:M.getOverflowParent(t.parentElement)},M.getIdFromTrigger=function(t){var e=t.getAttribute("data-target");return e||(e=(e=t.getAttribute("href"))?e.slice(1):""),e},M.getDocumentScrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},M.getDocumentScrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0};var getTime=Date.now||function(){return(new Date).getTime()};M.throttle=function(i,n,s){var o=void 0,a=void 0,r=void 0,l=null,h=0;s||(s={});var d=function(){h=!1===s.leading?0:getTime(),l=null,r=i.apply(o,a),o=a=null};return function(){var t=getTime();h||!1!==s.leading||(h=t);var e=n-(t-h);return o=this,a=arguments,e<=0?(clearTimeout(l),l=null,h=t,r=i.apply(o,a),o=a=null):l||!1===s.trailing||(l=setTimeout(d,e)),r}};var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,i){if(i.get||i.set)throw new TypeError("ES3 does not support getters and setters.");t!=Array.prototype&&t!=Object.prototype&&(t[e]=i.value)},$jscomp.getGlobal=function(t){return"undefined"!=typeof window&&window===t?t:"undefined"!=typeof global&&null!=global?global:t},$jscomp.global=$jscomp.getGlobal(this),$jscomp.SYMBOL_PREFIX="jscomp_symbol_",$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){},$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)},$jscomp.symbolCounter_=0,$jscomp.Symbol=function(t){return $jscomp.SYMBOL_PREFIX+(t||"")+$jscomp.symbolCounter_++},$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var t=$jscomp.global.Symbol.iterator;t||(t=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&$jscomp.defineProperty(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}}),$jscomp.initSymbolIterator=function(){}},$jscomp.arrayIterator=function(t){var e=0;return $jscomp.iteratorPrototype(function(){return e=k.currentTime)for(var h=0;ht&&(s.duration=e.duration),s.children.push(e)}),s.seek(0),s.reset(),s.autoplay&&s.restart(),s},s},O.random=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},O}(),function(r,l){"use strict";var e={accordion:!0,onOpenStart:void 0,onOpenEnd:void 0,onCloseStart:void 0,onCloseEnd:void 0,inDuration:300,outDuration:300},t=function(t){function s(t,e){_classCallCheck(this,s);var i=_possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,s,t,e));(i.el.M_Collapsible=i).options=r.extend({},s.defaults,e),i.$headers=i.$el.children("li").children(".collapsible-header"),i.$headers.attr("tabindex",0),i._setupEventHandlers();var n=i.$el.children("li.active").children(".collapsible-body");return i.options.accordion?n.first().css("display","block"):n.css("display","block"),i}return _inherits(s,Component),_createClass(s,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_Collapsible=void 0}},{key:"_setupEventHandlers",value:function(){var e=this;this._handleCollapsibleClickBound=this._handleCollapsibleClick.bind(this),this._handleCollapsibleKeydownBound=this._handleCollapsibleKeydown.bind(this),this.el.addEventListener("click",this._handleCollapsibleClickBound),this.$headers.each(function(t){t.addEventListener("keydown",e._handleCollapsibleKeydownBound)})}},{key:"_removeEventHandlers",value:function(){var e=this;this.el.removeEventListener("click",this._handleCollapsibleClickBound),this.$headers.each(function(t){t.removeEventListener("keydown",e._handleCollapsibleKeydownBound)})}},{key:"_handleCollapsibleClick",value:function(t){var e=r(t.target).closest(".collapsible-header");if(t.target&&e.length){var i=e.closest(".collapsible");if(i[0]===this.el){var n=e.closest("li"),s=i.children("li"),o=n[0].classList.contains("active"),a=s.index(n);o?this.close(a):this.open(a)}}}},{key:"_handleCollapsibleKeydown",value:function(t){13===t.keyCode&&this._handleCollapsibleClickBound(t)}},{key:"_animateIn",value:function(t){var e=this,i=this.$el.children("li").eq(t);if(i.length){var n=i.children(".collapsible-body");l.remove(n[0]),n.css({display:"block",overflow:"hidden",height:0,paddingTop:"",paddingBottom:""});var s=n.css("padding-top"),o=n.css("padding-bottom"),a=n[0].scrollHeight;n.css({paddingTop:0,paddingBottom:0}),l({targets:n[0],height:a,paddingTop:s,paddingBottom:o,duration:this.options.inDuration,easing:"easeInOutCubic",complete:function(t){n.css({overflow:"",paddingTop:"",paddingBottom:"",height:""}),"function"==typeof e.options.onOpenEnd&&e.options.onOpenEnd.call(e,i[0])}})}}},{key:"_animateOut",value:function(t){var e=this,i=this.$el.children("li").eq(t);if(i.length){var n=i.children(".collapsible-body");l.remove(n[0]),n.css("overflow","hidden"),l({targets:n[0],height:0,paddingTop:0,paddingBottom:0,duration:this.options.outDuration,easing:"easeInOutCubic",complete:function(){n.css({height:"",overflow:"",padding:"",display:""}),"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e,i[0])}})}}},{key:"open",value:function(t){var i=this,e=this.$el.children("li").eq(t);if(e.length&&!e[0].classList.contains("active")){if("function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,e[0]),this.options.accordion){var n=this.$el.children("li");this.$el.children("li.active").each(function(t){var e=n.index(r(t));i.close(e)})}e[0].classList.add("active"),this._animateIn(t)}}},{key:"close",value:function(t){var e=this.$el.children("li").eq(t);e.length&&e[0].classList.contains("active")&&("function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,e[0]),e[0].classList.remove("active"),this._animateOut(t))}}],[{key:"init",value:function(t,e){return _get(s.__proto__||Object.getPrototypeOf(s),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Collapsible}},{key:"defaults",get:function(){return e}}]),s}();M.Collapsible=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"collapsible","M_Collapsible")}(cash,M.anime),function(h,i){"use strict";var e={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!0,closeOnClick:!0,hover:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return i.el.M_Dropdown=i,n._dropdowns.push(i),i.id=M.getIdFromTrigger(t),i.dropdownEl=document.getElementById(i.id),i.$dropdownEl=h(i.dropdownEl),i.options=h.extend({},n.defaults,e),i.isOpen=!1,i.isScrollable=!1,i.isTouchMoving=!1,i.focusedIndex=-1,i.filterQuery=[],i.options.container?h(i.options.container).append(i.dropdownEl):i.$el.after(i.dropdownEl),i._makeDropdownFocusable(),i._resetFilterQueryBound=i._resetFilterQuery.bind(i),i._handleDocumentClickBound=i._handleDocumentClick.bind(i),i._handleDocumentTouchmoveBound=i._handleDocumentTouchmove.bind(i),i._handleDropdownClickBound=i._handleDropdownClick.bind(i),i._handleDropdownKeydownBound=i._handleDropdownKeydown.bind(i),i._handleTriggerKeydownBound=i._handleTriggerKeydown.bind(i),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){this._resetDropdownStyles(),this._removeEventHandlers(),n._dropdowns.splice(n._dropdowns.indexOf(this),1),this.el.M_Dropdown=void 0}},{key:"_setupEventHandlers",value:function(){this.el.addEventListener("keydown",this._handleTriggerKeydownBound),this.dropdownEl.addEventListener("click",this._handleDropdownClickBound),this.options.hover?(this._handleMouseEnterBound=this._handleMouseEnter.bind(this),this.el.addEventListener("mouseenter",this._handleMouseEnterBound),this._handleMouseLeaveBound=this._handleMouseLeave.bind(this),this.el.addEventListener("mouseleave",this._handleMouseLeaveBound),this.dropdownEl.addEventListener("mouseleave",this._handleMouseLeaveBound)):(this._handleClickBound=this._handleClick.bind(this),this.el.addEventListener("click",this._handleClickBound))}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("keydown",this._handleTriggerKeydownBound),this.dropdownEl.removeEventListener("click",this._handleDropdownClickBound),this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnterBound),this.el.removeEventListener("mouseleave",this._handleMouseLeaveBound),this.dropdownEl.removeEventListener("mouseleave",this._handleMouseLeaveBound)):this.el.removeEventListener("click",this._handleClickBound)}},{key:"_setupTemporaryEventHandlers",value:function(){document.body.addEventListener("click",this._handleDocumentClickBound,!0),document.body.addEventListener("touchend",this._handleDocumentClickBound),document.body.addEventListener("touchmove",this._handleDocumentTouchmoveBound),this.dropdownEl.addEventListener("keydown",this._handleDropdownKeydownBound)}},{key:"_removeTemporaryEventHandlers",value:function(){document.body.removeEventListener("click",this._handleDocumentClickBound,!0),document.body.removeEventListener("touchend",this._handleDocumentClickBound),document.body.removeEventListener("touchmove",this._handleDocumentTouchmoveBound),this.dropdownEl.removeEventListener("keydown",this._handleDropdownKeydownBound)}},{key:"_handleClick",value:function(t){t.preventDefault(),this.open()}},{key:"_handleMouseEnter",value:function(){this.open()}},{key:"_handleMouseLeave",value:function(t){var e=t.toElement||t.relatedTarget,i=!!h(e).closest(".dropdown-content").length,n=!1,s=h(e).closest(".dropdown-trigger");s.length&&s[0].M_Dropdown&&s[0].M_Dropdown.isOpen&&(n=!0),n||i||this.close()}},{key:"_handleDocumentClick",value:function(t){var e=this,i=h(t.target);this.options.closeOnClick&&i.closest(".dropdown-content").length&&!this.isTouchMoving?setTimeout(function(){e.close()},0):!i.closest(".dropdown-trigger").length&&i.closest(".dropdown-content").length||setTimeout(function(){e.close()},0),this.isTouchMoving=!1}},{key:"_handleTriggerKeydown",value:function(t){t.which!==M.keys.ARROW_DOWN&&t.which!==M.keys.ENTER||this.isOpen||(t.preventDefault(),this.open())}},{key:"_handleDocumentTouchmove",value:function(t){h(t.target).closest(".dropdown-content").length&&(this.isTouchMoving=!0)}},{key:"_handleDropdownClick",value:function(t){if("function"==typeof this.options.onItemClick){var e=h(t.target).closest("li")[0];this.options.onItemClick.call(this,e)}}},{key:"_handleDropdownKeydown",value:function(t){if(t.which===M.keys.TAB)t.preventDefault(),this.close();else if(t.which!==M.keys.ARROW_DOWN&&t.which!==M.keys.ARROW_UP||!this.isOpen)if(t.which===M.keys.ENTER&&this.isOpen){var e=this.dropdownEl.children[this.focusedIndex],i=h(e).find("a, button").first();i.length?i[0].click():e&&e.click()}else t.which===M.keys.ESC&&this.isOpen&&(t.preventDefault(),this.close());else{t.preventDefault();var n=t.which===M.keys.ARROW_DOWN?1:-1,s=this.focusedIndex,o=!1;do{if(s+=n,this.dropdownEl.children[s]&&-1!==this.dropdownEl.children[s].tabIndex){o=!0;break}}while(sl.spaceOnBottom?(h="bottom",i+=l.spaceOnTop,o-=l.spaceOnTop):i+=l.spaceOnBottom)),!l[d]){var u="left"===d?"right":"left";l[u]?d=u:l.spaceOnLeft>l.spaceOnRight?(d="right",n+=l.spaceOnLeft,s-=l.spaceOnLeft):(d="left",n+=l.spaceOnRight)}return"bottom"===h&&(o=o-e.height+(this.options.coverTrigger?t.height:0)),"right"===d&&(s=s-e.width+t.width),{x:s,y:o,verticalAlignment:h,horizontalAlignment:d,height:i,width:n}}},{key:"_animateIn",value:function(){var e=this;i.remove(this.dropdownEl),i({targets:this.dropdownEl,opacity:{value:[0,1],easing:"easeOutQuad"},scaleX:[.3,1],scaleY:[.3,1],duration:this.options.inDuration,easing:"easeOutQuint",complete:function(t){e.options.autoFocus&&e.dropdownEl.focus(),"function"==typeof e.options.onOpenEnd&&e.options.onOpenEnd.call(e,e.el)}})}},{key:"_animateOut",value:function(){var e=this;i.remove(this.dropdownEl),i({targets:this.dropdownEl,opacity:{value:0,easing:"easeOutQuint"},scaleX:.3,scaleY:.3,duration:this.options.outDuration,easing:"easeOutQuint",complete:function(t){e._resetDropdownStyles(),"function"==typeof e.options.onCloseEnd&&e.options.onCloseEnd.call(e,e.el)}})}},{key:"_placeDropdown",value:function(){var t=this.options.constrainWidth?this.el.getBoundingClientRect().width:this.dropdownEl.getBoundingClientRect().width;this.dropdownEl.style.width=t+"px";var e=this._getDropdownPosition();this.dropdownEl.style.left=e.x+"px",this.dropdownEl.style.top=e.y+"px",this.dropdownEl.style.height=e.height+"px",this.dropdownEl.style.width=e.width+"px",this.dropdownEl.style.transformOrigin=("left"===e.horizontalAlignment?"0":"100%")+" "+("top"===e.verticalAlignment?"0":"100%")}},{key:"open",value:function(){this.isOpen||(this.isOpen=!0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el),this._resetDropdownStyles(),this.dropdownEl.style.display="block",this._placeDropdown(),this._animateIn(),this._setupTemporaryEventHandlers())}},{key:"close",value:function(){this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),this._animateOut(),this._removeTemporaryEventHandlers(),this.options.autoFocus&&this.el.focus())}},{key:"recalculateDimensions",value:function(){this.isOpen&&(this.$dropdownEl.css({width:"",height:"",left:"",top:"","transform-origin":""}),this._placeDropdown())}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Dropdown}},{key:"defaults",get:function(){return e}}]),n}();t._dropdowns=[],M.Dropdown=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"dropdown","M_Dropdown")}(cash,M.anime),function(s,i){"use strict";var e={opacity:.5,inDuration:250,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,preventScrolling:!0,dismissible:!0,startingTop:"4%",endingTop:"10%"},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_Modal=i).options=s.extend({},n.defaults,e),i.isOpen=!1,i.id=i.$el.attr("id"),i._openingTrigger=void 0,i.$overlay=s(''),i.el.tabIndex=0,i._nthModalOpened=0,n._count++,i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){n._count--,this._removeEventHandlers(),this.el.removeAttribute("style"),this.$overlay.remove(),this.el.M_Modal=void 0}},{key:"_setupEventHandlers",value:function(){this._handleOverlayClickBound=this._handleOverlayClick.bind(this),this._handleModalCloseClickBound=this._handleModalCloseClick.bind(this),1===n._count&&document.body.addEventListener("click",this._handleTriggerClick),this.$overlay[0].addEventListener("click",this._handleOverlayClickBound),this.el.addEventListener("click",this._handleModalCloseClickBound)}},{key:"_removeEventHandlers",value:function(){0===n._count&&document.body.removeEventListener("click",this._handleTriggerClick),this.$overlay[0].removeEventListener("click",this._handleOverlayClickBound),this.el.removeEventListener("click",this._handleModalCloseClickBound)}},{key:"_handleTriggerClick",value:function(t){var e=s(t.target).closest(".modal-trigger");if(e.length){var i=M.getIdFromTrigger(e[0]),n=document.getElementById(i).M_Modal;n&&n.open(e),t.preventDefault()}}},{key:"_handleOverlayClick",value:function(){this.options.dismissible&&this.close()}},{key:"_handleModalCloseClick",value:function(t){s(t.target).closest(".modal-close").length&&this.close()}},{key:"_handleKeydown",value:function(t){27===t.keyCode&&this.options.dismissible&&this.close()}},{key:"_handleFocus",value:function(t){this.el.contains(t.target)||this._nthModalOpened!==n._modalsOpen||this.el.focus()}},{key:"_animateIn",value:function(){var t=this;s.extend(this.el.style,{display:"block",opacity:0}),s.extend(this.$overlay[0].style,{display:"block",opacity:0}),i({targets:this.$overlay[0],opacity:this.options.opacity,duration:this.options.inDuration,easing:"easeOutQuad"});var e={targets:this.el,duration:this.options.inDuration,easing:"easeOutCubic",complete:function(){"function"==typeof t.options.onOpenEnd&&t.options.onOpenEnd.call(t,t.el,t._openingTrigger)}};this.el.classList.contains("bottom-sheet")?s.extend(e,{bottom:0,opacity:1}):s.extend(e,{top:[this.options.startingTop,this.options.endingTop],opacity:1,scaleX:[.8,1],scaleY:[.8,1]}),i(e)}},{key:"_animateOut",value:function(){var t=this;i({targets:this.$overlay[0],opacity:0,duration:this.options.outDuration,easing:"easeOutQuart"});var e={targets:this.el,duration:this.options.outDuration,easing:"easeOutCubic",complete:function(){t.el.style.display="none",t.$overlay.remove(),"function"==typeof t.options.onCloseEnd&&t.options.onCloseEnd.call(t,t.el)}};this.el.classList.contains("bottom-sheet")?s.extend(e,{bottom:"-100%",opacity:0}):s.extend(e,{top:[this.options.endingTop,this.options.startingTop],opacity:0,scaleX:.8,scaleY:.8}),i(e)}},{key:"open",value:function(t){if(!this.isOpen)return this.isOpen=!0,n._modalsOpen++,this._nthModalOpened=n._modalsOpen,this.$overlay[0].style.zIndex=1e3+2*n._modalsOpen,this.el.style.zIndex=1e3+2*n._modalsOpen+1,this._openingTrigger=t?t[0]:void 0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el,this._openingTrigger),this.options.preventScrolling&&(document.body.style.overflow="hidden"),this.el.classList.add("open"),this.el.insertAdjacentElement("afterend",this.$overlay[0]),this.options.dismissible&&(this._handleKeydownBound=this._handleKeydown.bind(this),this._handleFocusBound=this._handleFocus.bind(this),document.addEventListener("keydown",this._handleKeydownBound),document.addEventListener("focus",this._handleFocusBound,!0)),i.remove(this.el),i.remove(this.$overlay[0]),this._animateIn(),this.el.focus(),this}},{key:"close",value:function(){if(this.isOpen)return this.isOpen=!1,n._modalsOpen--,this._nthModalOpened=0,"function"==typeof this.options.onCloseStart&&this.options.onCloseStart.call(this,this.el),this.el.classList.remove("open"),0===n._modalsOpen&&(document.body.style.overflow=""),this.options.dismissible&&(document.removeEventListener("keydown",this._handleKeydownBound),document.removeEventListener("focus",this._handleFocusBound,!0)),i.remove(this.el),i.remove(this.$overlay[0]),this._animateOut(),this}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Modal}},{key:"defaults",get:function(){return e}}]),n}();t._modalsOpen=0,t._count=0,M.Modal=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"modal","M_Modal")}(cash,M.anime),function(o,a){"use strict";var e={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_Materialbox=i).options=o.extend({},n.defaults,e),i.overlayActive=!1,i.doneAnimating=!0,i.placeholder=o("
").addClass("material-placeholder"),i.originalWidth=0,i.originalHeight=0,i.originInlineStyles=i.$el.attr("style"),i.caption=i.el.getAttribute("data-caption")||"",i.$el.before(i.placeholder),i.placeholder.append(i.$el),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_Materialbox=void 0,o(this.placeholder).after(this.el).remove(),this.$el.removeAttr("style")}},{key:"_setupEventHandlers",value:function(){this._handleMaterialboxClickBound=this._handleMaterialboxClick.bind(this),this.el.addEventListener("click",this._handleMaterialboxClickBound)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleMaterialboxClickBound)}},{key:"_handleMaterialboxClick",value:function(t){!1===this.doneAnimating||this.overlayActive&&this.doneAnimating?this.close():this.open()}},{key:"_handleWindowScroll",value:function(){this.overlayActive&&this.close()}},{key:"_handleWindowResize",value:function(){this.overlayActive&&this.close()}},{key:"_handleWindowEscape",value:function(t){27===t.keyCode&&this.doneAnimating&&this.overlayActive&&this.close()}},{key:"_makeAncestorsOverflowVisible",value:function(){this.ancestorsChanged=o();for(var t=this.placeholder[0].parentNode;null!==t&&!o(t).is(document);){var e=o(t);"visible"!==e.css("overflow")&&(e.css("overflow","visible"),void 0===this.ancestorsChanged?this.ancestorsChanged=e:this.ancestorsChanged=this.ancestorsChanged.add(e)),t=t.parentNode}}},{key:"_animateImageIn",value:function(){var t=this,e={targets:this.el,height:[this.originalHeight,this.newHeight],width:[this.originalWidth,this.newWidth],left:M.getDocumentScrollLeft()+this.windowWidth/2-this.placeholder.offset().left-this.newWidth/2,top:M.getDocumentScrollTop()+this.windowHeight/2-this.placeholder.offset().top-this.newHeight/2,duration:this.options.inDuration,easing:"easeOutQuad",complete:function(){t.doneAnimating=!0,"function"==typeof t.options.onOpenEnd&&t.options.onOpenEnd.call(t,t.el)}};this.maxWidth=this.$el.css("max-width"),this.maxHeight=this.$el.css("max-height"),"none"!==this.maxWidth&&(e.maxWidth=this.newWidth),"none"!==this.maxHeight&&(e.maxHeight=this.newHeight),a(e)}},{key:"_animateImageOut",value:function(){var t=this,e={targets:this.el,width:this.originalWidth,height:this.originalHeight,left:0,top:0,duration:this.options.outDuration,easing:"easeOutQuad",complete:function(){t.placeholder.css({height:"",width:"",position:"",top:"",left:""}),t.attrWidth&&t.$el.attr("width",t.attrWidth),t.attrHeight&&t.$el.attr("height",t.attrHeight),t.$el.removeAttr("style"),t.originInlineStyles&&t.$el.attr("style",t.originInlineStyles),t.$el.removeClass("active"),t.doneAnimating=!0,t.ancestorsChanged.length&&t.ancestorsChanged.css("overflow",""),"function"==typeof t.options.onCloseEnd&&t.options.onCloseEnd.call(t,t.el)}};a(e)}},{key:"_updateVars",value:function(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}},{key:"open",value:function(){var t=this;this._updateVars(),this.originalWidth=this.el.getBoundingClientRect().width,this.originalHeight=this.el.getBoundingClientRect().height,this.doneAnimating=!1,this.$el.addClass("active"),this.overlayActive=!0,"function"==typeof this.options.onOpenStart&&this.options.onOpenStart.call(this,this.el),this.placeholder.css({width:this.placeholder[0].getBoundingClientRect().width+"px",height:this.placeholder[0].getBoundingClientRect().height+"px",position:"relative",top:0,left:0}),this._makeAncestorsOverflowVisible(),this.$el.css({position:"absolute","z-index":1e3,"will-change":"left, top, width, height"}),this.attrWidth=this.$el.attr("width"),this.attrHeight=this.$el.attr("height"),this.attrWidth&&(this.$el.css("width",this.attrWidth+"px"),this.$el.removeAttr("width")),this.attrHeight&&(this.$el.css("width",this.attrHeight+"px"),this.$el.removeAttr("height")),this.$overlay=o('
').css({opacity:0}).one("click",function(){t.doneAnimating&&t.close()}),this.$el.before(this.$overlay);var e=this.$overlay[0].getBoundingClientRect();this.$overlay.css({width:this.windowWidth+"px",height:this.windowHeight+"px",left:-1*e.left+"px",top:-1*e.top+"px"}),a.remove(this.el),a.remove(this.$overlay[0]),a({targets:this.$overlay[0],opacity:1,duration:this.options.inDuration,easing:"easeOutQuad"}),""!==this.caption&&(this.$photocaption&&a.remove(this.$photoCaption[0]),this.$photoCaption=o('
'),this.$photoCaption.text(this.caption),o("body").append(this.$photoCaption),this.$photoCaption.css({display:"inline"}),a({targets:this.$photoCaption[0],opacity:1,duration:this.options.inDuration,easing:"easeOutQuad"}));var i=0,n=this.originalWidth/this.windowWidth,s=this.originalHeight/this.windowHeight;this.newWidth=0,this.newHeight=0,si.options.responsiveThreshold,i.$img=i.$el.find("img").first(),i.$img.each(function(){this.complete&&s(this).trigger("load")}),i._updateParallax(),i._setupEventHandlers(),i._setupStyles(),n._parallaxes.push(i),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){n._parallaxes.splice(n._parallaxes.indexOf(this),1),this.$img[0].style.transform="",this._removeEventHandlers(),this.$el[0].M_Parallax=void 0}},{key:"_setupEventHandlers",value:function(){this._handleImageLoadBound=this._handleImageLoad.bind(this),this.$img[0].addEventListener("load",this._handleImageLoadBound),0===n._parallaxes.length&&(n._handleScrollThrottled=M.throttle(n._handleScroll,5),window.addEventListener("scroll",n._handleScrollThrottled),n._handleWindowResizeThrottled=M.throttle(n._handleWindowResize,5),window.addEventListener("resize",n._handleWindowResizeThrottled))}},{key:"_removeEventHandlers",value:function(){this.$img[0].removeEventListener("load",this._handleImageLoadBound),0===n._parallaxes.length&&(window.removeEventListener("scroll",n._handleScrollThrottled),window.removeEventListener("resize",n._handleWindowResizeThrottled))}},{key:"_setupStyles",value:function(){this.$img[0].style.opacity=1}},{key:"_handleImageLoad",value:function(){this._updateParallax()}},{key:"_updateParallax",value:function(){var t=0e.options.responsiveThreshold}}},{key:"defaults",get:function(){return e}}]),n}();t._parallaxes=[],M.Parallax=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"parallax","M_Parallax")}(cash),function(a,s){"use strict";var e={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_Tabs=i).options=a.extend({},n.defaults,e),i.$tabLinks=i.$el.children("li.tab").children("a"),i.index=0,i._setupActiveTabLink(),i.options.swipeable?i._setupSwipeableTabs():i._setupNormalTabs(),i._setTabsAndTabWidth(),i._createIndicator(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){this._removeEventHandlers(),this._indicator.parentNode.removeChild(this._indicator),this.options.swipeable?this._teardownSwipeableTabs():this._teardownNormalTabs(),this.$el[0].M_Tabs=void 0}},{key:"_setupEventHandlers",value:function(){this._handleWindowResizeBound=this._handleWindowResize.bind(this),window.addEventListener("resize",this._handleWindowResizeBound),this._handleTabClickBound=this._handleTabClick.bind(this),this.el.addEventListener("click",this._handleTabClickBound)}},{key:"_removeEventHandlers",value:function(){window.removeEventListener("resize",this._handleWindowResizeBound),this.el.removeEventListener("click",this._handleTabClickBound)}},{key:"_handleWindowResize",value:function(){this._setTabsAndTabWidth(),0!==this.tabWidth&&0!==this.tabsWidth&&(this._indicator.style.left=this._calcLeftPos(this.$activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this.$activeTabLink)+"px")}},{key:"_handleTabClick",value:function(t){var e=this,i=a(t.target).closest("li.tab"),n=a(t.target).closest("a");if(n.length&&n.parent().hasClass("tab"))if(i.hasClass("disabled"))t.preventDefault();else if(!n.attr("target")){this.$activeTabLink.removeClass("active");var s=this.$content;this.$activeTabLink=n,this.$content=a(M.escapeHash(n[0].hash)),this.$tabLinks=this.$el.children("li.tab").children("a"),this.$activeTabLink.addClass("active");var o=this.index;this.index=Math.max(this.$tabLinks.index(n),0),this.options.swipeable?this._tabsCarousel&&this._tabsCarousel.set(this.index,function(){"function"==typeof e.options.onShow&&e.options.onShow.call(e,e.$content[0])}):this.$content.length&&(this.$content[0].style.display="block",this.$content.addClass("active"),"function"==typeof this.options.onShow&&this.options.onShow.call(this,this.$content[0]),s.length&&!s.is(this.$content)&&(s[0].style.display="none",s.removeClass("active"))),this._setTabsAndTabWidth(),this._animateIndicator(o),t.preventDefault()}}},{key:"_createIndicator",value:function(){var t=this,e=document.createElement("li");e.classList.add("indicator"),this.el.appendChild(e),this._indicator=e,setTimeout(function(){t._indicator.style.left=t._calcLeftPos(t.$activeTabLink)+"px",t._indicator.style.right=t._calcRightPos(t.$activeTabLink)+"px"},0)}},{key:"_setupActiveTabLink",value:function(){this.$activeTabLink=a(this.$tabLinks.filter('[href="'+location.hash+'"]')),0===this.$activeTabLink.length&&(this.$activeTabLink=this.$el.children("li.tab").children("a.active").first()),0===this.$activeTabLink.length&&(this.$activeTabLink=this.$el.children("li.tab").children("a").first()),this.$tabLinks.removeClass("active"),this.$activeTabLink[0].classList.add("active"),this.index=Math.max(this.$tabLinks.index(this.$activeTabLink),0),this.$activeTabLink.length&&(this.$content=a(M.escapeHash(this.$activeTabLink[0].hash)),this.$content.addClass("active"))}},{key:"_setupSwipeableTabs",value:function(){var i=this;window.innerWidth>this.options.responsiveThreshold&&(this.options.swipeable=!1);var n=a();this.$tabLinks.each(function(t){var e=a(M.escapeHash(t.hash));e.addClass("carousel-item"),n=n.add(e)});var t=a('');n.first().before(t),t.append(n),n[0].style.display="";var e=this.$activeTabLink.closest(".tab").index();this._tabsCarousel=M.Carousel.init(t[0],{fullWidth:!0,noWrap:!0,onCycleTo:function(t){var e=i.index;i.index=a(t).index(),i.$activeTabLink.removeClass("active"),i.$activeTabLink=i.$tabLinks.eq(i.index),i.$activeTabLink.addClass("active"),i._animateIndicator(e),"function"==typeof i.options.onShow&&i.options.onShow.call(i,i.$content[0])}}),this._tabsCarousel.set(e)}},{key:"_teardownSwipeableTabs",value:function(){var t=this._tabsCarousel.$el;this._tabsCarousel.destroy(),t.after(t.children()),t.remove()}},{key:"_setupNormalTabs",value:function(){this.$tabLinks.not(this.$activeTabLink).each(function(t){if(t.hash){var e=a(M.escapeHash(t.hash));e.length&&(e[0].style.display="none")}})}},{key:"_teardownNormalTabs",value:function(){this.$tabLinks.each(function(t){if(t.hash){var e=a(M.escapeHash(t.hash));e.length&&(e[0].style.display="")}})}},{key:"_setTabsAndTabWidth",value:function(){this.tabsWidth=this.$el.width(),this.tabWidth=Math.max(this.tabsWidth,this.el.scrollWidth)/this.$tabLinks.length}},{key:"_calcRightPos",value:function(t){return Math.ceil(this.tabsWidth-t.position().left-t[0].getBoundingClientRect().width)}},{key:"_calcLeftPos",value:function(t){return Math.floor(t.position().left)}},{key:"updateTabIndicator",value:function(){this._setTabsAndTabWidth(),this._animateIndicator(this.index)}},{key:"_animateIndicator",value:function(t){var e=0,i=0;0<=this.index-t?e=90:i=90;var n={targets:this._indicator,left:{value:this._calcLeftPos(this.$activeTabLink),delay:e},right:{value:this._calcRightPos(this.$activeTabLink),delay:i},duration:this.options.duration,easing:"easeOutQuad"};s.remove(this._indicator),s(n)}},{key:"select",value:function(t){var e=this.$tabLinks.filter('[href="#'+t+'"]');e.length&&e.trigger("click")}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Tabs}},{key:"defaults",get:function(){return e}}]),n}();M.Tabs=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"tabs","M_Tabs")}(cash,M.anime),function(d,e){"use strict";var i={exitDelay:200,enterDelay:0,html:null,margin:5,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_Tooltip=i).options=d.extend({},n.defaults,e),i.isOpen=!1,i.isHovered=!1,i.isFocused=!1,i._appendTooltipEl(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){d(this.tooltipEl).remove(),this._removeEventHandlers(),this.el.M_Tooltip=void 0}},{key:"_appendTooltipEl",value:function(){var t=document.createElement("div");t.classList.add("material-tooltip"),this.tooltipEl=t;var e=document.createElement("div");e.classList.add("tooltip-content"),e.innerHTML=this.options.html,t.appendChild(e),document.body.appendChild(t)}},{key:"_updateTooltipContent",value:function(){this.tooltipEl.querySelector(".tooltip-content").innerHTML=this.options.html}},{key:"_setupEventHandlers",value:function(){this._handleMouseEnterBound=this._handleMouseEnter.bind(this),this._handleMouseLeaveBound=this._handleMouseLeave.bind(this),this._handleFocusBound=this._handleFocus.bind(this),this._handleBlurBound=this._handleBlur.bind(this),this.el.addEventListener("mouseenter",this._handleMouseEnterBound),this.el.addEventListener("mouseleave",this._handleMouseLeaveBound),this.el.addEventListener("focus",this._handleFocusBound,!0),this.el.addEventListener("blur",this._handleBlurBound,!0)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("mouseenter",this._handleMouseEnterBound),this.el.removeEventListener("mouseleave",this._handleMouseLeaveBound),this.el.removeEventListener("focus",this._handleFocusBound,!0),this.el.removeEventListener("blur",this._handleBlurBound,!0)}},{key:"open",value:function(t){this.isOpen||(t=void 0===t||void 0,this.isOpen=!0,this.options=d.extend({},this.options,this._getAttributeOptions()),this._updateTooltipContent(),this._setEnterDelayTimeout(t))}},{key:"close",value:function(){this.isOpen&&(this.isHovered=!1,this.isFocused=!1,this.isOpen=!1,this._setExitDelayTimeout())}},{key:"_setExitDelayTimeout",value:function(){var t=this;clearTimeout(this._exitDelayTimeout),this._exitDelayTimeout=setTimeout(function(){t.isHovered||t.isFocused||t._animateOut()},this.options.exitDelay)}},{key:"_setEnterDelayTimeout",value:function(t){var e=this;clearTimeout(this._enterDelayTimeout),this._enterDelayTimeout=setTimeout(function(){(e.isHovered||e.isFocused||t)&&e._animateIn()},this.options.enterDelay)}},{key:"_positionTooltip",value:function(){var t,e=this.el,i=this.tooltipEl,n=e.offsetHeight,s=e.offsetWidth,o=i.offsetHeight,a=i.offsetWidth,r=this.options.margin,l=void 0,h=void 0;this.xMovement=0,this.yMovement=0,l=e.getBoundingClientRect().top+M.getDocumentScrollTop(),h=e.getBoundingClientRect().left+M.getDocumentScrollLeft(),"top"===this.options.position?(l+=-o-r,h+=s/2-a/2,this.yMovement=-this.options.transitionMovement):"right"===this.options.position?(l+=n/2-o/2,h+=s+r,this.xMovement=this.options.transitionMovement):"left"===this.options.position?(l+=n/2-o/2,h+=-a-r,this.xMovement=-this.options.transitionMovement):(l+=n+r,h+=s/2-a/2,this.yMovement=this.options.transitionMovement),t=this._repositionWithinScreen(h,l,a,o),d(i).css({top:t.y+"px",left:t.x+"px"})}},{key:"_repositionWithinScreen",value:function(t,e,i,n){var s=M.getDocumentScrollLeft(),o=M.getDocumentScrollTop(),a=t-s,r=e-o,l={left:a,top:r,width:i,height:n},h=this.options.margin+this.options.transitionMovement,d=M.checkWithinContainer(document.body,l,h);return d.left?a=h:d.right&&(a-=a+i-window.innerWidth),d.top?r=h:d.bottom&&(r-=r+n-window.innerHeight),{x:a+s,y:r+o}}},{key:"_animateIn",value:function(){this._positionTooltip(),this.tooltipEl.style.visibility="visible",e.remove(this.tooltipEl),e({targets:this.tooltipEl,opacity:1,translateX:this.xMovement,translateY:this.yMovement,duration:this.options.inDuration,easing:"easeOutCubic"})}},{key:"_animateOut",value:function(){e.remove(this.tooltipEl),e({targets:this.tooltipEl,opacity:0,translateX:0,translateY:0,duration:this.options.outDuration,easing:"easeOutCubic"})}},{key:"_handleMouseEnter",value:function(){this.isHovered=!0,this.isFocused=!1,this.open(!1)}},{key:"_handleMouseLeave",value:function(){this.isHovered=!1,this.isFocused=!1,this.close()}},{key:"_handleFocus",value:function(){M.tabPressed&&(this.isFocused=!0,this.open(!1))}},{key:"_handleBlur",value:function(){this.isFocused=!1,this.close()}},{key:"_getAttributeOptions",value:function(){var t={},e=this.el.getAttribute("data-tooltip"),i=this.el.getAttribute("data-position");return e&&(t.html=e),i&&(t.position=i),t}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Tooltip}},{key:"defaults",get:function(){return i}}]),n}();M.Tooltip=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"tooltip","M_Tooltip")}(cash,M.anime),function(i){"use strict";var t=t||{},e=document.querySelectorAll.bind(document);function m(t){var e="";for(var i in t)t.hasOwnProperty(i)&&(e+=i+":"+t[i]+";");return e}var g={duration:750,show:function(t,e){if(2===t.button)return!1;var i=e||this,n=document.createElement("div");n.className="waves-ripple",i.appendChild(n);var s,o,a,r,l,h,d,u=(h={top:0,left:0},d=(s=i)&&s.ownerDocument,o=d.documentElement,void 0!==s.getBoundingClientRect&&(h=s.getBoundingClientRect()),a=null!==(l=r=d)&&l===l.window?r:9===r.nodeType&&r.defaultView,{top:h.top+a.pageYOffset-o.clientTop,left:h.left+a.pageXOffset-o.clientLeft}),c=t.pageY-u.top,p=t.pageX-u.left,v="scale("+i.clientWidth/100*10+")";"touches"in t&&(c=t.touches[0].pageY-u.top,p=t.touches[0].pageX-u.left),n.setAttribute("data-hold",Date.now()),n.setAttribute("data-scale",v),n.setAttribute("data-x",p),n.setAttribute("data-y",c);var f={top:c+"px",left:p+"px"};n.className=n.className+" waves-notransition",n.setAttribute("style",m(f)),n.className=n.className.replace("waves-notransition",""),f["-webkit-transform"]=v,f["-moz-transform"]=v,f["-ms-transform"]=v,f["-o-transform"]=v,f.transform=v,f.opacity="1",f["-webkit-transition-duration"]=g.duration+"ms",f["-moz-transition-duration"]=g.duration+"ms",f["-o-transition-duration"]=g.duration+"ms",f["transition-duration"]=g.duration+"ms",f["-webkit-transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",f["-moz-transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",f["-o-transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",f["transition-timing-function"]="cubic-bezier(0.250, 0.460, 0.450, 0.940)",n.setAttribute("style",m(f))},hide:function(t){l.touchup(t);var e=this,i=(e.clientWidth,null),n=e.getElementsByClassName("waves-ripple");if(!(0i||1"+o+""+a+""+r+""),i.length&&e.prepend(i)}},{key:"_resetCurrentElement",value:function(){this.activeIndex=-1,this.$active.removeClass("active")}},{key:"_resetAutocomplete",value:function(){h(this.container).empty(),this._resetCurrentElement(),this.oldVal=null,this.isOpen=!1,this._mousedown=!1}},{key:"selectOption",value:function(t){var e=t.text().trim();this.el.value=e,this.$el.trigger("change"),this._resetAutocomplete(),this.close(),"function"==typeof this.options.onAutocomplete&&this.options.onAutocomplete.call(this,e)}},{key:"_renderDropdown",value:function(t,i){var n=this;this._resetAutocomplete();var e=[];for(var s in t)if(t.hasOwnProperty(s)&&-1!==s.toLowerCase().indexOf(i)){if(this.count>=this.options.limit)break;var o={data:t[s],key:s};e.push(o),this.count++}if(this.options.sortFunction){e.sort(function(t,e){return n.options.sortFunction(t.key.toLowerCase(),e.key.toLowerCase(),i.toLowerCase())})}for(var a=0;a");r.data?l.append(''+r.key+""):l.append(""+r.key+""),h(this.container).append(l),this._highlight(i,l)}}},{key:"open",value:function(){var t=this.el.value.toLowerCase();this._resetAutocomplete(),t.length>=this.options.minLength&&(this.isOpen=!0,this._renderDropdown(this.options.data,t)),this.dropdown.isOpen?this.dropdown.recalculateDimensions():this.dropdown.open()}},{key:"close",value:function(){this.dropdown.close()}},{key:"updateData",value:function(t){var e=this.el.value.toLowerCase();this.options.data=t,this.isOpen&&this._renderDropdown(t,e)}}],[{key:"init",value:function(t,e){return _get(s.__proto__||Object.getPrototypeOf(s),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Autocomplete}},{key:"defaults",get:function(){return e}}]),s}();t._keydown=!1,M.Autocomplete=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"autocomplete","M_Autocomplete")}(cash),function(d){M.updateTextFields=function(){d("input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=time], textarea").each(function(t,e){var i=d(this);0'),d("body").append(e));var i=t.css("font-family"),n=t.css("font-size"),s=t.css("line-height"),o=t.css("padding-top"),a=t.css("padding-right"),r=t.css("padding-bottom"),l=t.css("padding-left");n&&e.css("font-size",n),i&&e.css("font-family",i),s&&e.css("line-height",s),o&&e.css("padding-top",o),a&&e.css("padding-right",a),r&&e.css("padding-bottom",r),l&&e.css("padding-left",l),t.data("original-height")||t.data("original-height",t.height()),"off"===t.attr("wrap")&&e.css("overflow-wrap","normal").css("white-space","pre"),e.text(t[0].value+"\n");var h=e.html().replace(/\n/g,"
");e.html(h),0'),this.$slides.each(function(t,e){var i=s('
  • ');n.$indicators.append(i[0])}),this.$el.append(this.$indicators[0]),this.$indicators=this.$indicators.children("li.indicator-item"))}},{key:"_removeIndicators",value:function(){this.$el.find("ul.indicators").remove()}},{key:"set",value:function(t){var e=this;if(t>=this.$slides.length?t=0:t<0&&(t=this.$slides.length-1),this.activeIndex!=t){this.$active=this.$slides.eq(this.activeIndex);var i=this.$active.find(".caption");this.$active.removeClass("active"),o({targets:this.$active[0],opacity:0,duration:this.options.duration,easing:"easeOutQuad",complete:function(){e.$slides.not(".active").each(function(t){o({targets:t,opacity:0,translateX:0,translateY:0,duration:0,easing:"easeOutQuad"})})}}),this._animateCaptionIn(i[0],this.options.duration),this.options.indicators&&(this.$indicators.eq(this.activeIndex).removeClass("active"),this.$indicators.eq(t).addClass("active")),o({targets:this.$slides.eq(t)[0],opacity:1,duration:this.options.duration,easing:"easeOutQuad"}),o({targets:this.$slides.eq(t).find(".caption")[0],opacity:1,translateX:0,translateY:0,duration:this.options.duration,delay:this.options.duration,easing:"easeOutQuad"}),this.$slides.eq(t).addClass("active"),this.activeIndex=t,this.start()}}},{key:"pause",value:function(){clearInterval(this.interval)}},{key:"start",value:function(){clearInterval(this.interval),this.interval=setInterval(this._handleIntervalBound,this.options.duration+this.options.interval)}},{key:"next",value:function(){var t=this.activeIndex+1;t>=this.$slides.length?t=0:t<0&&(t=this.$slides.length-1),this.set(t)}},{key:"prev",value:function(){var t=this.activeIndex-1;t>=this.$slides.length?t=0:t<0&&(t=this.$slides.length-1),this.set(t)}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Slider}},{key:"defaults",get:function(){return e}}]),n}();M.Slider=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"slider","M_Slider")}(cash,M.anime),function(n,s){n(document).on("click",".card",function(t){if(n(this).children(".card-reveal").length){var i=n(t.target).closest(".card");void 0===i.data("initialOverflow")&&i.data("initialOverflow",void 0===i.css("overflow")?"":i.css("overflow"));var e=n(this).find(".card-reveal");n(t.target).is(n(".card-reveal .card-title"))||n(t.target).is(n(".card-reveal .card-title i"))?s({targets:e[0],translateY:0,duration:225,easing:"easeInOutQuad",complete:function(t){var e=t.animatables[0].target;n(e).css({display:"none"}),i.css("overflow",i.data("initialOverflow"))}}):(n(t.target).is(n(".card .activator"))||n(t.target).is(n(".card .activator i")))&&(i.css("overflow","hidden"),e.css({display:"block"}),s({targets:e[0],translateY:"-100%",duration:300,easing:"easeInOutQuad"}))}})}(cash,M.anime),function(h){"use strict";var e={data:[],placeholder:"",secondaryPlaceholder:"",autocompleteOptions:{},limit:1/0,onChipAdd:null,onChipSelect:null,onChipDelete:null},t=function(t){function l(t,e){_classCallCheck(this,l);var i=_possibleConstructorReturn(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l,t,e));return(i.el.M_Chips=i).options=h.extend({},l.defaults,e),i.$el.addClass("chips input-field"),i.chipsData=[],i.$chips=h(),i._setupInput(),i.hasAutocomplete=0"),this.$el.append(this.$input)),this.$input.addClass("input")}},{key:"_setupLabel",value:function(){this.$label=this.$el.find("label"),this.$label.length&&this.$label.setAttribute("for",this.$input.attr("id"))}},{key:"_setPlaceholder",value:function(){void 0!==this.chipsData&&!this.chipsData.length&&this.options.placeholder?h(this.$input).prop("placeholder",this.options.placeholder):(void 0===this.chipsData||this.chipsData.length)&&this.options.secondaryPlaceholder&&h(this.$input).prop("placeholder",this.options.secondaryPlaceholder)}},{key:"_isValid",value:function(t){if(t.hasOwnProperty("tag")&&""!==t.tag){for(var e=!1,i=0;i=this.options.limit)){var e=this._renderChip(t);this.$chips.add(e),this.chipsData.push(t),h(this.$input).before(e),this._setPlaceholder(),"function"==typeof this.options.onChipAdd&&this.options.onChipAdd.call(this,this.$el,e)}}},{key:"deleteChip",value:function(t){var e=this.$chips.eq(t);this.$chips.eq(t).remove(),this.$chips=this.$chips.filter(function(t){return 0<=h(t).index()}),this.chipsData.splice(t,1),this._setPlaceholder(),"function"==typeof this.options.onChipDelete&&this.options.onChipDelete.call(this,this.$el,e[0])}},{key:"selectChip",value:function(t){var e=this.$chips.eq(t);(this._selectedChip=e)[0].focus(),"function"==typeof this.options.onChipSelect&&this.options.onChipSelect.call(this,this.$el,e[0])}}],[{key:"init",value:function(t,e){return _get(l.__proto__||Object.getPrototypeOf(l),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Chips}},{key:"_handleChipsKeydown",value:function(t){l._keydown=!0;var e=h(t.target).closest(".chips"),i=t.target&&e.length;if(!h(t.target).is("input, textarea")&&i){var n=e[0].M_Chips;if(8===t.keyCode||46===t.keyCode){t.preventDefault();var s=n.chipsData.length;if(n._selectedChip){var o=n._selectedChip.index();n.deleteChip(o),n._selectedChip=null,s=Math.max(o-1,0)}n.chipsData.length&&n.selectChip(s)}else if(37===t.keyCode){if(n._selectedChip){var a=n._selectedChip.index()-1;if(a<0)return;n.selectChip(a)}}else if(39===t.keyCode&&n._selectedChip){var r=n._selectedChip.index()+1;r>=n.chipsData.length?n.$input[0].focus():n.selectChip(r)}}}},{key:"_handleChipsKeyup",value:function(t){l._keydown=!1}},{key:"_handleChipsBlur",value:function(t){l._keydown||(h(t.target).closest(".chips")[0].M_Chips._selectedChip=null)}},{key:"defaults",get:function(){return e}}]),l}();t._keydown=!1,M.Chips=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"chips","M_Chips"),h(document).ready(function(){h(document.body).on("click",".chip .close",function(){var t=h(this).closest(".chips");t.length&&t[0].M_Chips||h(this).closest(".chip").remove()})})}(cash),function(s){"use strict";var e={top:0,bottom:1/0,offset:0,onPositionChange:null},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_Pushpin=i).options=s.extend({},n.defaults,e),i.originalOffset=i.el.offsetTop,n._pushpins.push(i),i._setupEventHandlers(),i._updatePosition(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){this.el.style.top=null,this._removePinClasses(),this._removeEventHandlers();var t=n._pushpins.indexOf(this);n._pushpins.splice(t,1)}},{key:"_setupEventHandlers",value:function(){document.addEventListener("scroll",n._updateElements)}},{key:"_removeEventHandlers",value:function(){document.removeEventListener("scroll",n._updateElements)}},{key:"_updatePosition",value:function(){var t=M.getDocumentScrollTop()+this.options.offset;this.options.top<=t&&this.options.bottom>=t&&!this.el.classList.contains("pinned")&&(this._removePinClasses(),this.el.style.top=this.options.offset+"px",this.el.classList.add("pinned"),"function"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,"pinned")),tthis.options.bottom&&!this.el.classList.contains("pin-bottom")&&(this._removePinClasses(),this.el.classList.add("pin-bottom"),this.el.style.top=this.options.bottom-this.originalOffset+"px","function"==typeof this.options.onPositionChange&&this.options.onPositionChange.call(this,"pin-bottom"))}},{key:"_removePinClasses",value:function(){this.el.classList.remove("pin-top"),this.el.classList.remove("pinned"),this.el.classList.remove("pin-bottom")}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Pushpin}},{key:"_updateElements",value:function(){for(var t in n._pushpins){n._pushpins[t]._updatePosition()}}},{key:"defaults",get:function(){return e}}]),n}();t._pushpins=[],M.Pushpin=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"pushpin","M_Pushpin")}(cash),function(r,s){"use strict";var e={direction:"top",hoverEnabled:!0,toolbarEnabled:!1};r.fn.reverse=[].reverse;var t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_FloatingActionButton=i).options=r.extend({},n.defaults,e),i.isOpen=!1,i.$anchor=i.$el.children("a").first(),i.$menu=i.$el.children("ul").first(),i.$floatingBtns=i.$el.find("ul .btn-floating"),i.$floatingBtnsReverse=i.$el.find("ul .btn-floating").reverse(),i.offsetY=0,i.offsetX=0,i.$el.addClass("direction-"+i.options.direction),"top"===i.options.direction?i.offsetY=40:"right"===i.options.direction?i.offsetX=-40:"bottom"===i.options.direction?i.offsetY=-40:i.offsetX=40,i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_FloatingActionButton=void 0}},{key:"_setupEventHandlers",value:function(){this._handleFABClickBound=this._handleFABClick.bind(this),this._handleOpenBound=this.open.bind(this),this._handleCloseBound=this.close.bind(this),this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.addEventListener("mouseenter",this._handleOpenBound),this.el.addEventListener("mouseleave",this._handleCloseBound)):this.el.addEventListener("click",this._handleFABClickBound)}},{key:"_removeEventHandlers",value:function(){this.options.hoverEnabled&&!this.options.toolbarEnabled?(this.el.removeEventListener("mouseenter",this._handleOpenBound),this.el.removeEventListener("mouseleave",this._handleCloseBound)):this.el.removeEventListener("click",this._handleFABClickBound)}},{key:"_handleFABClick",value:function(){this.isOpen?this.close():this.open()}},{key:"_handleDocumentClick",value:function(t){r(t.target).closest(this.$menu).length||this.close()}},{key:"open",value:function(){this.isOpen||(this.options.toolbarEnabled?this._animateInToolbar():this._animateInFAB(),this.isOpen=!0)}},{key:"close",value:function(){this.isOpen&&(this.options.toolbarEnabled?(window.removeEventListener("scroll",this._handleCloseBound,!0),document.body.removeEventListener("click",this._handleDocumentClickBound,!0),this._animateOutToolbar()):this._animateOutFAB(),this.isOpen=!1)}},{key:"_animateInFAB",value:function(){var e=this;this.$el.addClass("active");var i=0;this.$floatingBtnsReverse.each(function(t){s({targets:t,opacity:1,scale:[.4,1],translateY:[e.offsetY,0],translateX:[e.offsetX,0],duration:275,delay:i,easing:"easeInOutQuad"}),i+=40})}},{key:"_animateOutFAB",value:function(){var e=this;this.$floatingBtnsReverse.each(function(t){s.remove(t),s({targets:t,opacity:0,scale:.4,translateY:e.offsetY,translateX:e.offsetX,duration:175,easing:"easeOutQuad",complete:function(){e.$el.removeClass("active")}})})}},{key:"_animateInToolbar",value:function(){var t,e=this,i=window.innerWidth,n=window.innerHeight,s=this.el.getBoundingClientRect(),o=r('
    '),a=this.$anchor.css("background-color");this.$anchor.append(o),this.offsetX=s.left-i/2+s.width/2,this.offsetY=n-s.bottom,t=i/o[0].clientWidth,this.btnBottom=s.bottom,this.btnLeft=s.left,this.btnWidth=s.width,this.$el.addClass("active"),this.$el.css({"text-align":"center",width:"100%",bottom:0,left:0,transform:"translateX("+this.offsetX+"px)",transition:"none"}),this.$anchor.css({transform:"translateY("+-this.offsetY+"px)",transition:"none"}),o.css({"background-color":a}),setTimeout(function(){e.$el.css({transform:"",transition:"transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s"}),e.$anchor.css({overflow:"visible",transform:"",transition:"transform .2s"}),setTimeout(function(){e.$el.css({overflow:"hidden","background-color":a}),o.css({transform:"scale("+t+")",transition:"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)"}),e.$menu.children("li").children("a").css({opacity:1}),e._handleDocumentClickBound=e._handleDocumentClick.bind(e),window.addEventListener("scroll",e._handleCloseBound,!0),document.body.addEventListener("click",e._handleDocumentClickBound,!0)},100)},0)}},{key:"_animateOutToolbar",value:function(){var t=this,e=window.innerWidth,i=window.innerHeight,n=this.$el.find(".fab-backdrop"),s=this.$anchor.css("background-color");this.offsetX=this.btnLeft-e/2+this.btnWidth/2,this.offsetY=i-this.btnBottom,this.$el.removeClass("active"),this.$el.css({"background-color":"transparent",transition:"none"}),this.$anchor.css({transition:"none"}),n.css({transform:"scale(0)","background-color":s}),this.$menu.children("li").children("a").css({opacity:""}),setTimeout(function(){n.remove(),t.$el.css({"text-align":"",width:"",bottom:"",left:"",overflow:"","background-color":"",transform:"translate3d("+-t.offsetX+"px,0,0)"}),t.$anchor.css({overflow:"",transform:"translate3d(0,"+t.offsetY+"px,0)"}),setTimeout(function(){t.$el.css({transform:"translate3d(0,0,0)",transition:"transform .2s"}),t.$anchor.css({transform:"translate3d(0,0,0)",transition:"transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)"})},20)},200)}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_FloatingActionButton}},{key:"defaults",get:function(){return e}}]),n}();M.FloatingActionButton=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"floatingActionButton","M_FloatingActionButton")}(cash,M.anime),function(g){"use strict";var e={autoClose:!1,format:"mmm dd, yyyy",parse:null,defaultDate:null,setDefaultDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,container:null,showClearBtn:!1,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"‹",nextMonth:"›",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null},t=function(t){function B(t,e){_classCallCheck(this,B);var i=_possibleConstructorReturn(this,(B.__proto__||Object.getPrototypeOf(B)).call(this,B,t,e));(i.el.M_Datepicker=i).options=g.extend({},B.defaults,e),e&&e.hasOwnProperty("i18n")&&"object"==typeof e.i18n&&(i.options.i18n=g.extend({},B.defaults.i18n,e.i18n)),i.options.minDate&&i.options.minDate.setHours(0,0,0,0),i.options.maxDate&&i.options.maxDate.setHours(0,0,0,0),i.id=M.guid(),i._setupVariables(),i._insertHTMLIntoDOM(),i._setupModal(),i._setupEventHandlers(),i.options.defaultDate||(i.options.defaultDate=new Date(Date.parse(i.el.value)));var n=i.options.defaultDate;return B._isDate(n)?i.options.setDefaultDate?(i.setDate(n,!0),i.setInputValue()):i.gotoDate(n):i.gotoDate(new Date),i.isOpen=!1,i}return _inherits(B,Component),_createClass(B,[{key:"destroy",value:function(){this._removeEventHandlers(),this.modal.destroy(),g(this.modalEl).remove(),this.destroySelects(),this.el.M_Datepicker=void 0}},{key:"destroySelects",value:function(){var t=this.calendarEl.querySelector(".orig-select-year");t&&M.FormSelect.getInstance(t).destroy();var e=this.calendarEl.querySelector(".orig-select-month");e&&M.FormSelect.getInstance(e).destroy()}},{key:"_insertHTMLIntoDOM",value:function(){this.options.showClearBtn&&(g(this.clearBtn).css({visibility:""}),this.clearBtn.innerHTML=this.options.i18n.clear),this.doneBtn.innerHTML=this.options.i18n.done,this.cancelBtn.innerHTML=this.options.i18n.cancel,this.options.container?this.$modalEl.appendTo(this.options.container):this.$modalEl.insertBefore(this.el)}},{key:"_setupModal",value:function(){var t=this;this.modalEl.id="modal-"+this.id,this.modal=M.Modal.init(this.modalEl,{onCloseEnd:function(){t.isOpen=!1}})}},{key:"toString",value:function(t){var e=this;return t=t||this.options.format,B._isDate(this.date)?t.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(function(t){return e.formats[t]?e.formats[t]():t}).join(""):""}},{key:"setDate",value:function(t,e){if(!t)return this.date=null,this._renderDateDisplay(),this.draw();if("string"==typeof t&&(t=new Date(Date.parse(t))),B._isDate(t)){var i=this.options.minDate,n=this.options.maxDate;B._isDate(i)&&tn.maxDate||n.disableWeekends&&B._isWeekend(y)||n.disableDayFn&&n.disableDayFn(y),isEmpty:C,isStartRange:x,isEndRange:L,isInRange:T,showDaysInNextAndPreviousMonths:n.showDaysInNextAndPreviousMonths};l.push(this.renderDay($)),7==++_&&(r.push(this.renderRow(l,n.isRTL,m)),_=0,m=!(l=[]))}return this.renderTable(n,r,i)}},{key:"renderDay",value:function(t){var e=[],i="false";if(t.isEmpty){if(!t.showDaysInNextAndPreviousMonths)return'';e.push("is-outside-current-month"),e.push("is-selection-disabled")}return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),i="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'"}},{key:"renderRow",value:function(t,e,i){return''+(e?t.reverse():t).join("")+""}},{key:"renderTable",value:function(t,e,i){return'
    '+this.renderHead(t)+this.renderBody(e)+"
    "}},{key:"renderHead",value:function(t){var e=void 0,i=[];for(e=0;e<7;e++)i.push(''+this.renderDayName(t,e,!0)+"");return""+(t.isRTL?i.reverse():i).join("")+""}},{key:"renderBody",value:function(t){return""+t.join("")+""}},{key:"renderTitle",value:function(t,e,i,n,s,o){var a,r,l=void 0,h=void 0,d=void 0,u=this.options,c=i===u.minYear,p=i===u.maxYear,v='
    ',f=!0,m=!0;for(d=[],l=0;l<12;l++)d.push('");for(a='",g.isArray(u.yearRange)?(l=u.yearRange[0],h=u.yearRange[1]+1):(l=i-u.yearRange,h=1+i+u.yearRange),d=[];l=u.minYear&&d.push('");r='";v+='',v+='
    ',u.showMonthAfterYear?v+=r+a:v+=a+r,v+="
    ",c&&(0===n||u.minMonth>=n)&&(f=!1),p&&(11===n||u.maxMonth<=n)&&(m=!1);return(v+='')+"
    "}},{key:"draw",value:function(t){if(this.isOpen||t){var e,i=this.options,n=i.minYear,s=i.maxYear,o=i.minMonth,a=i.maxMonth,r="";this._y<=n&&(this._y=n,!isNaN(o)&&this._m=s&&(this._y=s,!isNaN(a)&&this._m>a&&(this._m=a)),e="datepicker-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var l=0;l<1;l++)this._renderDateDisplay(),r+=this.renderTitle(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,e)+this.render(this.calendars[l].year,this.calendars[l].month,e);this.destroySelects(),this.calendarEl.innerHTML=r;var h=this.calendarEl.querySelector(".orig-select-year"),d=this.calendarEl.querySelector(".orig-select-month");M.FormSelect.init(h,{classes:"select-year",dropdownOptions:{container:document.body,constrainWidth:!1}}),M.FormSelect.init(d,{classes:"select-month",dropdownOptions:{container:document.body,constrainWidth:!1}}),h.addEventListener("change",this._handleYearChange.bind(this)),d.addEventListener("change",this._handleMonthChange.bind(this)),"function"==typeof this.options.onDraw&&this.options.onDraw(this)}}},{key:"_setupEventHandlers",value:function(){this._handleInputKeydownBound=this._handleInputKeydown.bind(this),this._handleInputClickBound=this._handleInputClick.bind(this),this._handleInputChangeBound=this._handleInputChange.bind(this),this._handleCalendarClickBound=this._handleCalendarClick.bind(this),this._finishSelectionBound=this._finishSelection.bind(this),this._handleMonthChange=this._handleMonthChange.bind(this),this._closeBound=this.close.bind(this),this.el.addEventListener("click",this._handleInputClickBound),this.el.addEventListener("keydown",this._handleInputKeydownBound),this.el.addEventListener("change",this._handleInputChangeBound),this.calendarEl.addEventListener("click",this._handleCalendarClickBound),this.doneBtn.addEventListener("click",this._finishSelectionBound),this.cancelBtn.addEventListener("click",this._closeBound),this.options.showClearBtn&&(this._handleClearClickBound=this._handleClearClick.bind(this),this.clearBtn.addEventListener("click",this._handleClearClickBound))}},{key:"_setupVariables",value:function(){var e=this;this.$modalEl=g(B._template),this.modalEl=this.$modalEl[0],this.calendarEl=this.modalEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.modalEl.querySelector(".year-text"),this.dateTextEl=this.modalEl.querySelector(".date-text"),this.options.showClearBtn&&(this.clearBtn=this.modalEl.querySelector(".datepicker-clear")),this.doneBtn=this.modalEl.querySelector(".datepicker-done"),this.cancelBtn=this.modalEl.querySelector(".datepicker-cancel"),this.formats={d:function(){return e.date.getDate()},dd:function(){var t=e.date.getDate();return(t<10?"0":"")+t},ddd:function(){return e.options.i18n.weekdaysShort[e.date.getDay()]},dddd:function(){return e.options.i18n.weekdays[e.date.getDay()]},m:function(){return e.date.getMonth()+1},mm:function(){var t=e.date.getMonth()+1;return(t<10?"0":"")+t},mmm:function(){return e.options.i18n.monthsShort[e.date.getMonth()]},mmmm:function(){return e.options.i18n.months[e.date.getMonth()]},yy:function(){return(""+e.date.getFullYear()).slice(2)},yyyy:function(){return e.date.getFullYear()}}}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleInputClickBound),this.el.removeEventListener("keydown",this._handleInputKeydownBound),this.el.removeEventListener("change",this._handleInputChangeBound),this.calendarEl.removeEventListener("click",this._handleCalendarClickBound)}},{key:"_handleInputClick",value:function(){this.open()}},{key:"_handleInputKeydown",value:function(t){t.which===M.keys.ENTER&&(t.preventDefault(),this.open())}},{key:"_handleCalendarClick",value:function(t){if(this.isOpen){var e=g(t.target);e.hasClass("is-disabled")||(!e.hasClass("datepicker-day-button")||e.hasClass("is-empty")||e.parent().hasClass("is-disabled")?e.closest(".month-prev").length?this.prevMonth():e.closest(".month-next").length&&this.nextMonth():(this.setDate(new Date(t.target.getAttribute("data-year"),t.target.getAttribute("data-month"),t.target.getAttribute("data-day"))),this.options.autoClose&&this._finishSelection()))}}},{key:"_handleClearClick",value:function(){this.date=null,this.setInputValue(),this.close()}},{key:"_handleMonthChange",value:function(t){this.gotoMonth(t.target.value)}},{key:"_handleYearChange",value:function(t){this.gotoYear(t.target.value)}},{key:"gotoMonth",value:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}},{key:"gotoYear",value:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}},{key:"_handleInputChange",value:function(t){var e=void 0;t.firedBy!==this&&(e=this.options.parse?this.options.parse(this.el.value,this.options.format):new Date(Date.parse(this.el.value)),B._isDate(e)&&this.setDate(e))}},{key:"renderDayName",value:function(t,e,i){for(e+=t.firstDay;7<=e;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}},{key:"_finishSelection",value:function(){this.setInputValue(),this.close()}},{key:"open",value:function(){if(!this.isOpen)return this.isOpen=!0,"function"==typeof this.options.onOpen&&this.options.onOpen.call(this),this.draw(),this.modal.open(),this}},{key:"close",value:function(){if(this.isOpen)return this.isOpen=!1,"function"==typeof this.options.onClose&&this.options.onClose.call(this),this.modal.close(),this}}],[{key:"init",value:function(t,e){return _get(B.__proto__||Object.getPrototypeOf(B),"init",this).call(this,this,t,e)}},{key:"_isDate",value:function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}},{key:"_isWeekend",value:function(t){var e=t.getDay();return 0===e||6===e}},{key:"_setToStartOfDay",value:function(t){B._isDate(t)&&t.setHours(0,0,0,0)}},{key:"_getDaysInMonth",value:function(t,e){return[31,B._isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}},{key:"_isLeapYear",value:function(t){return t%4==0&&t%100!=0||t%400==0}},{key:"_compareDates",value:function(t,e){return t.getTime()===e.getTime()}},{key:"_setToStartOfDay",value:function(t){B._isDate(t)&&t.setHours(0,0,0,0)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Datepicker}},{key:"defaults",get:function(){return e}}]),B}();t._template=['"].join(""),M.Datepicker=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"datepicker","M_Datepicker")}(cash),function(h){"use strict";var e={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok"},autoClose:!1,twelveHour:!0,vibrate:!0,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onSelect:null},t=function(t){function f(t,e){_classCallCheck(this,f);var i=_possibleConstructorReturn(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,f,t,e));return(i.el.M_Timepicker=i).options=h.extend({},f.defaults,e),i.id=M.guid(),i._insertHTMLIntoDOM(),i._setupModal(),i._setupVariables(),i._setupEventHandlers(),i._clockSetup(),i._pickerSetup(),i}return _inherits(f,Component),_createClass(f,[{key:"destroy",value:function(){this._removeEventHandlers(),this.modal.destroy(),h(this.modalEl).remove(),this.el.M_Timepicker=void 0}},{key:"_setupEventHandlers",value:function(){this._handleInputKeydownBound=this._handleInputKeydown.bind(this),this._handleInputClickBound=this._handleInputClick.bind(this),this._handleClockClickStartBound=this._handleClockClickStart.bind(this),this._handleDocumentClickMoveBound=this._handleDocumentClickMove.bind(this),this._handleDocumentClickEndBound=this._handleDocumentClickEnd.bind(this),this.el.addEventListener("click",this._handleInputClickBound),this.el.addEventListener("keydown",this._handleInputKeydownBound),this.plate.addEventListener("mousedown",this._handleClockClickStartBound),this.plate.addEventListener("touchstart",this._handleClockClickStartBound),h(this.spanHours).on("click",this.showView.bind(this,"hours")),h(this.spanMinutes).on("click",this.showView.bind(this,"minutes"))}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleInputClickBound),this.el.removeEventListener("keydown",this._handleInputKeydownBound)}},{key:"_handleInputClick",value:function(){this.open()}},{key:"_handleInputKeydown",value:function(t){t.which===M.keys.ENTER&&(t.preventDefault(),this.open())}},{key:"_handleClockClickStart",value:function(t){t.preventDefault();var e=this.plate.getBoundingClientRect(),i=e.left,n=e.top;this.x0=i+this.options.dialRadius,this.y0=n+this.options.dialRadius,this.moved=!1;var s=f._Pos(t);this.dx=s.x-this.x0,this.dy=s.y-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("mousemove",this._handleDocumentClickMoveBound),document.addEventListener("touchmove",this._handleDocumentClickMoveBound),document.addEventListener("mouseup",this._handleDocumentClickEndBound),document.addEventListener("touchend",this._handleDocumentClickEndBound)}},{key:"_handleDocumentClickMove",value:function(t){t.preventDefault();var e=f._Pos(t),i=e.x-this.x0,n=e.y-this.y0;this.moved=!0,this.setHand(i,n,!1,!0)}},{key:"_handleDocumentClickEnd",value:function(t){var e=this;t.preventDefault(),document.removeEventListener("mouseup",this._handleDocumentClickEndBound),document.removeEventListener("touchend",this._handleDocumentClickEndBound);var i=f._Pos(t),n=i.x-this.x0,s=i.y-this.y0;this.moved&&n===this.dx&&s===this.dy&&this.setHand(n,s),"hours"===this.currentView?this.showView("minutes",this.options.duration/2):this.options.autoClose&&(h(this.minutesView).addClass("timepicker-dial-out"),setTimeout(function(){e.done()},this.options.duration/2)),"function"==typeof this.options.onSelect&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("mousemove",this._handleDocumentClickMoveBound),document.removeEventListener("touchmove",this._handleDocumentClickMoveBound)}},{key:"_insertHTMLIntoDOM",value:function(){this.$modalEl=h(f._template),this.modalEl=this.$modalEl[0],this.modalEl.id="modal-"+this.id;var t=document.querySelector(this.options.container);this.options.container&&t?this.$modalEl.appendTo(t):this.$modalEl.insertBefore(this.el)}},{key:"_setupModal",value:function(){var t=this;this.modal=M.Modal.init(this.modalEl,{onOpenStart:this.options.onOpenStart,onOpenEnd:this.options.onOpenEnd,onCloseStart:this.options.onCloseStart,onCloseEnd:function(){"function"==typeof t.options.onCloseEnd&&t.options.onCloseEnd.call(t),t.isOpen=!1}})}},{key:"_setupVariables",value:function(){this.currentView="hours",this.vibrate=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,this._canvas=this.modalEl.querySelector(".timepicker-canvas"),this.plate=this.modalEl.querySelector(".timepicker-plate"),this.hoursView=this.modalEl.querySelector(".timepicker-hours"),this.minutesView=this.modalEl.querySelector(".timepicker-minutes"),this.spanHours=this.modalEl.querySelector(".timepicker-span-hours"),this.spanMinutes=this.modalEl.querySelector(".timepicker-span-minutes"),this.spanAmPm=this.modalEl.querySelector(".timepicker-span-am-pm"),this.footer=this.modalEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}},{key:"_pickerSetup",value:function(){var t=h('").appendTo(this.footer).on("click",this.clear.bind(this));this.options.showClearBtn&&t.css({visibility:""});var e=h('
    ');h('").appendTo(e).on("click",this.close.bind(this)),h('").appendTo(e).on("click",this.done.bind(this)),e.appendTo(this.footer)}},{key:"_clockSetup",value:function(){this.options.twelveHour&&(this.$amBtn=h('
    AM
    '),this.$pmBtn=h('
    PM
    '),this.$amBtn.on("click",this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm),this.$pmBtn.on("click",this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}},{key:"_buildSVGClock",value:function(){var t=this.options.dialRadius,e=this.options.tickRadius,i=2*t,n=f._createSVGEl("svg");n.setAttribute("class","timepicker-svg"),n.setAttribute("width",i),n.setAttribute("height",i);var s=f._createSVGEl("g");s.setAttribute("transform","translate("+t+","+t+")");var o=f._createSVGEl("circle");o.setAttribute("class","timepicker-canvas-bearing"),o.setAttribute("cx",0),o.setAttribute("cy",0),o.setAttribute("r",4);var a=f._createSVGEl("line");a.setAttribute("x1",0),a.setAttribute("y1",0);var r=f._createSVGEl("circle");r.setAttribute("class","timepicker-canvas-bg"),r.setAttribute("r",e),s.appendChild(a),s.appendChild(r),s.appendChild(o),n.appendChild(s),this._canvas.appendChild(n),this.hand=a,this.bg=r,this.bearing=o,this.g=s}},{key:"_buildHoursView",value:function(){var t=h('
    ');if(this.options.twelveHour)for(var e=1;e<13;e+=1){var i=t.clone(),n=e/6*Math.PI,s=this.options.outerRadius;i.css({left:this.options.dialRadius+Math.sin(n)*s-this.options.tickRadius+"px",top:this.options.dialRadius-Math.cos(n)*s-this.options.tickRadius+"px"}),i.html(0===e?"00":e),this.hoursView.appendChild(i[0])}else for(var o=0;o<24;o+=1){var a=t.clone(),r=o/6*Math.PI,l=0'),e=0;e<60;e+=5){var i=t.clone(),n=e/30*Math.PI;i.css({left:this.options.dialRadius+Math.sin(n)*this.options.outerRadius-this.options.tickRadius+"px",top:this.options.dialRadius-Math.cos(n)*this.options.outerRadius-this.options.tickRadius+"px"}),i.html(f._addLeadingZero(e)),this.minutesView.appendChild(i[0])}}},{key:"_handleAmPmClick",value:function(t){var e=h(t.target);this.amOrPm=e.hasClass("am-btn")?"AM":"PM",this._updateAmPmView()}},{key:"_updateAmPmView",value:function(){this.options.twelveHour&&(this.$amBtn.toggleClass("text-primary","AM"===this.amOrPm),this.$pmBtn.toggleClass("text-primary","PM"===this.amOrPm))}},{key:"_updateTimeFromInput",value:function(){var t=((this.el.value||this.options.defaultTime||"")+"").split(":");if(this.options.twelveHour&&void 0!==t[1]&&(0','",""].join(""),M.Timepicker=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"timepicker","M_Timepicker")}(cash),function(s){"use strict";var e={},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_CharacterCounter=i).options=s.extend({},n.defaults,e),i.isInvalid=!1,i.isValidLength=!1,i._setupCounter(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.CharacterCounter=void 0,this._removeCounter()}},{key:"_setupEventHandlers",value:function(){this._handleUpdateCounterBound=this.updateCounter.bind(this),this.el.addEventListener("focus",this._handleUpdateCounterBound,!0),this.el.addEventListener("input",this._handleUpdateCounterBound,!0)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("focus",this._handleUpdateCounterBound,!0),this.el.removeEventListener("input",this._handleUpdateCounterBound,!0)}},{key:"_setupCounter",value:function(){this.counterEl=document.createElement("span"),s(this.counterEl).addClass("character-counter").css({float:"right","font-size":"12px",height:1}),this.$el.parent().append(this.counterEl)}},{key:"_removeCounter",value:function(){s(this.counterEl).remove()}},{key:"updateCounter",value:function(){var t=+this.$el.attr("data-length"),e=this.el.value.length;this.isValidLength=e<=t;var i=e;t&&(i+="/"+t,this._validateInput()),s(this.counterEl).html(i)}},{key:"_validateInput",value:function(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.$el.removeClass("invalid")):this.isValidLength||this.isInvalid||(this.isInvalid=!0,this.$el.removeClass("valid"),this.$el.addClass("invalid"))}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_CharacterCounter}},{key:"defaults",get:function(){return e}}]),n}();M.CharacterCounter=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"characterCounter","M_CharacterCounter")}(cash),function(b){"use strict";var e={duration:200,dist:-100,shift:0,padding:0,numVisible:5,fullWidth:!1,indicators:!1,noWrap:!1,onCycleTo:null},t=function(t){function i(t,e){_classCallCheck(this,i);var n=_possibleConstructorReturn(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,i,t,e));return(n.el.M_Carousel=n).options=b.extend({},i.defaults,e),n.hasMultipleSlides=1'),n.$el.find(".carousel-item").each(function(t,e){if(n.images.push(t),n.showIndicators){var i=b('
  • ');0===e&&i[0].classList.add("active"),n.$indicators.append(i)}}),n.showIndicators&&n.$el.append(n.$indicators),n.count=n.images.length,n.options.numVisible=Math.min(n.count,n.options.numVisible),n.xform="transform",["webkit","Moz","O","ms"].every(function(t){var e=t+"Transform";return void 0===document.body.style[e]||(n.xform=e,!1)}),n._setupEventHandlers(),n._scroll(n.offset),n}return _inherits(i,Component),_createClass(i,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.M_Carousel=void 0}},{key:"_setupEventHandlers",value:function(){var i=this;this._handleCarouselTapBound=this._handleCarouselTap.bind(this),this._handleCarouselDragBound=this._handleCarouselDrag.bind(this),this._handleCarouselReleaseBound=this._handleCarouselRelease.bind(this),this._handleCarouselClickBound=this._handleCarouselClick.bind(this),void 0!==window.ontouchstart&&(this.el.addEventListener("touchstart",this._handleCarouselTapBound),this.el.addEventListener("touchmove",this._handleCarouselDragBound),this.el.addEventListener("touchend",this._handleCarouselReleaseBound)),this.el.addEventListener("mousedown",this._handleCarouselTapBound),this.el.addEventListener("mousemove",this._handleCarouselDragBound),this.el.addEventListener("mouseup",this._handleCarouselReleaseBound),this.el.addEventListener("mouseleave",this._handleCarouselReleaseBound),this.el.addEventListener("click",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&(this._handleIndicatorClickBound=this._handleIndicatorClick.bind(this),this.$indicators.find(".indicator-item").each(function(t,e){t.addEventListener("click",i._handleIndicatorClickBound)}));var t=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=t.bind(this),window.addEventListener("resize",this._handleThrottledResizeBound)}},{key:"_removeEventHandlers",value:function(){var i=this;void 0!==window.ontouchstart&&(this.el.removeEventListener("touchstart",this._handleCarouselTapBound),this.el.removeEventListener("touchmove",this._handleCarouselDragBound),this.el.removeEventListener("touchend",this._handleCarouselReleaseBound)),this.el.removeEventListener("mousedown",this._handleCarouselTapBound),this.el.removeEventListener("mousemove",this._handleCarouselDragBound),this.el.removeEventListener("mouseup",this._handleCarouselReleaseBound),this.el.removeEventListener("mouseleave",this._handleCarouselReleaseBound),this.el.removeEventListener("click",this._handleCarouselClickBound),this.showIndicators&&this.$indicators&&this.$indicators.find(".indicator-item").each(function(t,e){t.removeEventListener("click",i._handleIndicatorClickBound)}),window.removeEventListener("resize",this._handleThrottledResizeBound)}},{key:"_handleCarouselTap",value:function(t){"mousedown"===t.type&&b(t.target).is("img")&&t.preventDefault(),this.pressed=!0,this.dragged=!1,this.verticalDragged=!1,this.reference=this._xpos(t),this.referenceY=this._ypos(t),this.velocity=this.amplitude=0,this.frame=this.offset,this.timestamp=Date.now(),clearInterval(this.ticker),this.ticker=setInterval(this._trackBound,100)}},{key:"_handleCarouselDrag",value:function(t){var e=void 0,i=void 0,n=void 0;if(this.pressed)if(e=this._xpos(t),i=this._ypos(t),n=this.reference-e,Math.abs(this.referenceY-i)<30&&!this.verticalDragged)(2=this.dim*(this.count-1)?this.target=this.dim*(this.count-1):this.target<0&&(this.target=0)),this.amplitude=this.target-this.offset,this.timestamp=Date.now(),requestAnimationFrame(this._autoScrollBound),this.dragged&&(t.preventDefault(),t.stopPropagation()),!1}},{key:"_handleCarouselClick",value:function(t){if(this.dragged)return t.preventDefault(),t.stopPropagation(),!1;if(!this.options.fullWidth){var e=b(t.target).closest(".carousel-item").index();0!==this._wrap(this.center)-e&&(t.preventDefault(),t.stopPropagation()),this._cycleTo(e)}}},{key:"_handleIndicatorClick",value:function(t){t.stopPropagation();var e=b(t.target).closest(".indicator-item");e.length&&this._cycleTo(e.index())}},{key:"_handleResize",value:function(t){this.options.fullWidth?(this.itemWidth=this.$el.find(".carousel-item").first().innerWidth(),this.imageHeight=this.$el.find(".carousel-item.active").height(),this.dim=2*this.itemWidth+this.options.padding,this.offset=2*this.center*this.itemWidth,this.target=this.offset,this._setCarouselHeight(!0)):this._scroll()}},{key:"_setCarouselHeight",value:function(t){var i=this,e=this.$el.find(".carousel-item.active").length?this.$el.find(".carousel-item.active").first():this.$el.find(".carousel-item").first(),n=e.find("img").first();if(n.length)if(n[0].complete){var s=n.height();if(0=this.count?t%this.count:t<0?this._wrap(this.count+t%this.count):t}},{key:"_track",value:function(){var t,e,i,n;e=(t=Date.now())-this.timestamp,this.timestamp=t,i=this.offset-this.frame,this.frame=this.offset,n=1e3*i/(1+e),this.velocity=.8*n+.2*this.velocity}},{key:"_autoScroll",value:function(){var t=void 0,e=void 0;this.amplitude&&(t=Date.now()-this.timestamp,2<(e=this.amplitude*Math.exp(-t/this.options.duration))||e<-2?(this._scroll(this.target-e),requestAnimationFrame(this._autoScrollBound)):this._scroll(this.target))}},{key:"_scroll",value:function(t){var e=this;this.$el.hasClass("scrolling")||this.el.classList.add("scrolling"),null!=this.scrollingTimeout&&window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=window.setTimeout(function(){e.$el.removeClass("scrolling")},this.options.duration);var i,n,s,o,a=void 0,r=void 0,l=void 0,h=void 0,d=void 0,u=void 0,c=this.center,p=1/this.options.numVisible;if(this.offset="number"==typeof t?t:this.offset,this.center=Math.floor((this.offset+this.dim/2)/this.dim),o=-(s=(n=this.offset-this.center*this.dim)<0?1:-1)*n*2/this.dim,i=this.count>>1,this.options.fullWidth?(l="translateX(0)",u=1):(l="translateX("+(this.el.clientWidth-this.itemWidth)/2+"px) ",l+="translateY("+(this.el.clientHeight-this.itemHeight)/2+"px)",u=1-p*o),this.showIndicators){var v=this.center%this.count,f=this.$indicators.find(".indicator-item.active");f.index()!==v&&(f.removeClass("active"),this.$indicators.find(".indicator-item").eq(v)[0].classList.add("active"))}if(!this.noWrap||0<=this.center&&this.center=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}},{key:"prev",value:function(t){(void 0===t||isNaN(t))&&(t=1);var e=this.center-t;if(e>=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}},{key:"set",value:function(t,e){if((void 0===t||isNaN(t))&&(t=0),t>this.count||t<0){if(this.noWrap)return;t=this._wrap(t)}this._cycleTo(t,e)}}],[{key:"init",value:function(t,e){return _get(i.__proto__||Object.getPrototypeOf(i),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Carousel}},{key:"defaults",get:function(){return e}}]),i}();M.Carousel=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"carousel","M_Carousel")}(cash),function(S){"use strict";var e={onOpen:void 0,onClose:void 0},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_TapTarget=i).options=S.extend({},n.defaults,e),i.isOpen=!1,i.$origin=S("#"+i.$el.attr("data-target")),i._setup(),i._calculatePositioning(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){this._removeEventHandlers(),this.el.TapTarget=void 0}},{key:"_setupEventHandlers",value:function(){this._handleDocumentClickBound=this._handleDocumentClick.bind(this),this._handleTargetClickBound=this._handleTargetClick.bind(this),this._handleOriginClickBound=this._handleOriginClick.bind(this),this.el.addEventListener("click",this._handleTargetClickBound),this.originEl.addEventListener("click",this._handleOriginClickBound);var t=M.throttle(this._handleResize,200);this._handleThrottledResizeBound=t.bind(this),window.addEventListener("resize",this._handleThrottledResizeBound)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("click",this._handleTargetClickBound),this.originEl.removeEventListener("click",this._handleOriginClickBound),window.removeEventListener("resize",this._handleThrottledResizeBound)}},{key:"_handleTargetClick",value:function(t){this.open()}},{key:"_handleOriginClick",value:function(t){this.close()}},{key:"_handleResize",value:function(t){this._calculatePositioning()}},{key:"_handleDocumentClick",value:function(t){S(t.target).closest(".tap-target-wrapper").length||(this.close(),t.preventDefault(),t.stopPropagation())}},{key:"_setup",value:function(){this.wrapper=this.$el.parent()[0],this.waveEl=S(this.wrapper).find(".tap-target-wave")[0],this.originEl=S(this.wrapper).find(".tap-target-origin")[0],this.contentEl=this.$el.find(".tap-target-content")[0],S(this.wrapper).hasClass(".tap-target-wrapper")||(this.wrapper=document.createElement("div"),this.wrapper.classList.add("tap-target-wrapper"),this.$el.before(S(this.wrapper)),this.wrapper.append(this.el)),this.contentEl||(this.contentEl=document.createElement("div"),this.contentEl.classList.add("tap-target-content"),this.$el.append(this.contentEl)),this.waveEl||(this.waveEl=document.createElement("div"),this.waveEl.classList.add("tap-target-wave"),this.originEl||(this.originEl=this.$origin.clone(!0,!0),this.originEl.addClass("tap-target-origin"),this.originEl.removeAttr("id"),this.originEl.removeAttr("style"),this.originEl=this.originEl[0],this.waveEl.append(this.originEl)),this.wrapper.append(this.waveEl))}},{key:"_calculatePositioning",value:function(){var t="fixed"===this.$origin.css("position");if(!t)for(var e=this.$origin.parents(),i=0;i'+t.getAttribute("label")+"")[0]),i.each(function(t){var e=n._appendOptionWithIcon(n.$el,t,"optgroup-option");n._addOptionToValueDict(t,e)})}}),this.$el.after(this.dropdownOptions),this.input=document.createElement("input"),d(this.input).addClass("select-dropdown dropdown-trigger"),this.input.setAttribute("type","text"),this.input.setAttribute("readonly","true"),this.input.setAttribute("data-target",this.dropdownOptions.id),this.el.disabled&&d(this.input).prop("disabled","true"),this.$el.before(this.input),this._setValueToInput();var t=d('');if(this.$el.before(t[0]),!this.el.disabled){var e=d.extend({},this.options.dropdownOptions);e.onOpenEnd=function(t){var e=d(n.dropdownOptions).find(".selected").first();if(e.length&&(M.keyDown=!0,n.dropdown.focusedIndex=e.index(),n.dropdown._focusFocusedItem(),M.keyDown=!1,n.dropdown.isScrollable)){var i=e[0].getBoundingClientRect().top-n.dropdownOptions.getBoundingClientRect().top;i-=n.dropdownOptions.clientHeight/2,n.dropdownOptions.scrollTop=i}},this.isMultiple&&(e.closeOnClick=!1),this.dropdown=M.Dropdown.init(this.input,e)}this._setSelectedStates()}},{key:"_addOptionToValueDict",value:function(t,e){var i=Object.keys(this._valueDict).length,n=this.dropdownOptions.id+i,s={};e.id=n,s.el=t,s.optionEl=e,this._valueDict[n]=s}},{key:"_removeDropdown",value:function(){d(this.wrapper).find(".caret").remove(),d(this.input).remove(),d(this.dropdownOptions).remove(),d(this.wrapper).before(this.$el),d(this.wrapper).remove()}},{key:"_appendOptionWithIcon",value:function(t,e,i){var n=e.disabled?"disabled ":"",s="optgroup-option"===i?"optgroup-option ":"",o=this.isMultiple?'":e.innerHTML,a=d("
  • "),r=d("");r.html(o),a.addClass(n+" "+s),a.append(r);var l=e.getAttribute("data-icon");if(l){var h=d('');a.prepend(h)}return d(this.dropdownOptions).append(a[0]),a[0]}},{key:"_toggleEntryFromArray",value:function(t){var e=!this._keysSelected.hasOwnProperty(t),i=d(this._valueDict[t].optionEl);return e?this._keysSelected[t]=!0:delete this._keysSelected[t],i.toggleClass("selected",e),i.find('input[type="checkbox"]').prop("checked",e),i.prop("selected",e),e}},{key:"_setValueToInput",value:function(){var i=[];if(this.$el.find("option").each(function(t){if(d(t).prop("selected")){var e=d(t).text();i.push(e)}}),!i.length){var t=this.$el.find("option:disabled").eq(0);t.length&&""===t[0].value&&i.push(t.text())}this.input.value=i.join(", ")}},{key:"_setSelectedStates",value:function(){for(var t in this._keysSelected={},this._valueDict){var e=this._valueDict[t],i=d(e.el).prop("selected");d(e.optionEl).find('input[type="checkbox"]').prop("checked",i),i?(this._activateOption(d(this.dropdownOptions),d(e.optionEl)),this._keysSelected[t]=!0):d(e.optionEl).removeClass("selected")}}},{key:"_activateOption",value:function(t,e){e&&(this.isMultiple||t.find("li.selected").removeClass("selected"),d(e).addClass("selected"))}},{key:"getSelectedValues",value:function(){var t=[];for(var e in this._keysSelected)t.push(this._valueDict[e].el.value);return t}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_FormSelect}},{key:"defaults",get:function(){return e}}]),n}();M.FormSelect=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"formSelect","M_FormSelect")}(cash),function(s,e){"use strict";var i={},t=function(t){function n(t,e){_classCallCheck(this,n);var i=_possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,n,t,e));return(i.el.M_Range=i).options=s.extend({},n.defaults,e),i._mousedown=!1,i._setupThumb(),i._setupEventHandlers(),i}return _inherits(n,Component),_createClass(n,[{key:"destroy",value:function(){this._removeEventHandlers(),this._removeThumb(),this.el.M_Range=void 0}},{key:"_setupEventHandlers",value:function(){this._handleRangeChangeBound=this._handleRangeChange.bind(this),this._handleRangeMousedownTouchstartBound=this._handleRangeMousedownTouchstart.bind(this),this._handleRangeInputMousemoveTouchmoveBound=this._handleRangeInputMousemoveTouchmove.bind(this),this._handleRangeMouseupTouchendBound=this._handleRangeMouseupTouchend.bind(this),this._handleRangeBlurMouseoutTouchleaveBound=this._handleRangeBlurMouseoutTouchleave.bind(this),this.el.addEventListener("change",this._handleRangeChangeBound),this.el.addEventListener("mousedown",this._handleRangeMousedownTouchstartBound),this.el.addEventListener("touchstart",this._handleRangeMousedownTouchstartBound),this.el.addEventListener("input",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener("mousemove",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener("touchmove",this._handleRangeInputMousemoveTouchmoveBound),this.el.addEventListener("mouseup",this._handleRangeMouseupTouchendBound),this.el.addEventListener("touchend",this._handleRangeMouseupTouchendBound),this.el.addEventListener("blur",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener("mouseout",this._handleRangeBlurMouseoutTouchleaveBound),this.el.addEventListener("touchleave",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:"_removeEventHandlers",value:function(){this.el.removeEventListener("change",this._handleRangeChangeBound),this.el.removeEventListener("mousedown",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener("touchstart",this._handleRangeMousedownTouchstartBound),this.el.removeEventListener("input",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener("mousemove",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener("touchmove",this._handleRangeInputMousemoveTouchmoveBound),this.el.removeEventListener("mouseup",this._handleRangeMouseupTouchendBound),this.el.removeEventListener("touchend",this._handleRangeMouseupTouchendBound),this.el.removeEventListener("blur",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener("mouseout",this._handleRangeBlurMouseoutTouchleaveBound),this.el.removeEventListener("touchleave",this._handleRangeBlurMouseoutTouchleaveBound)}},{key:"_handleRangeChange",value:function(){s(this.value).html(this.$el.val()),s(this.thumb).hasClass("active")||this._showRangeBubble();var t=this._calcRangeOffset();s(this.thumb).addClass("active").css("left",t+"px")}},{key:"_handleRangeMousedownTouchstart",value:function(t){if(s(this.value).html(this.$el.val()),this._mousedown=!0,this.$el.addClass("active"),s(this.thumb).hasClass("active")||this._showRangeBubble(),"input"!==t.type){var e=this._calcRangeOffset();s(this.thumb).addClass("active").css("left",e+"px")}}},{key:"_handleRangeInputMousemoveTouchmove",value:function(){if(this._mousedown){s(this.thumb).hasClass("active")||this._showRangeBubble();var t=this._calcRangeOffset();s(this.thumb).addClass("active").css("left",t+"px"),s(this.value).html(this.$el.val())}}},{key:"_handleRangeMouseupTouchend",value:function(){this._mousedown=!1,this.$el.removeClass("active")}},{key:"_handleRangeBlurMouseoutTouchleave",value:function(){if(!this._mousedown){var t=7+parseInt(this.$el.css("padding-left"))+"px";s(this.thumb).hasClass("active")&&(e.remove(this.thumb),e({targets:this.thumb,height:0,width:0,top:10,easing:"easeOutQuad",marginLeft:t,duration:100})),s(this.thumb).removeClass("active")}}},{key:"_setupThumb",value:function(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),s(this.thumb).addClass("thumb"),s(this.value).addClass("value"),s(this.thumb).append(this.value),this.$el.after(this.thumb)}},{key:"_removeThumb",value:function(){s(this.thumb).remove()}},{key:"_showRangeBubble",value:function(){var t=-7+parseInt(s(this.thumb).parent().css("padding-left"))+"px";e.remove(this.thumb),e({targets:this.thumb,height:30,width:30,top:-30,marginLeft:t,duration:300,easing:"easeOutQuint"})}},{key:"_calcRangeOffset",value:function(){var t=this.$el.width()-15,e=parseFloat(this.$el.attr("max"))||100,i=parseFloat(this.$el.attr("min"))||0;return(parseFloat(this.$el.val())-i)/(e-i)*t}}],[{key:"init",value:function(t,e){return _get(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,this,t,e)}},{key:"getInstance",value:function(t){return(t.jquery?t[0]:t).M_Range}},{key:"defaults",get:function(){return i}}]),n}();M.Range=t,M.jQueryLoaded&&M.initializeJqueryWrapper(t,"range","M_Range"),t.init(s("input[type=range]"))}(cash,M.anime); \ No newline at end of file diff --git a/static/js/validation.js b/static/js/validation.js new file mode 100644 index 0000000..4bcbede --- /dev/null +++ b/static/js/validation.js @@ -0,0 +1,36 @@ +'use strict'; + +function isValidIPv4(str) { + const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/; + return ipv4Regex.test(str); +} + +function isValidIPv6(str) { + const ipv6Regex = /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/i; + return ipv6Regex.test(str); +} + +function isValidIpOrCidr(str) { + const parts = str.split('/'); + if (parts.length > 2) return false; + + const isIP = isValidIPv4(parts[0]) || isValidIPv6(parts[0]); + if (!isIP) return false; + + if (parts.length === 2) { + const mask = parseInt(parts[1], 10); + if (isNaN(mask) || mask < 0 || mask > (isValidIPv4(parts[0]) ? 32 : 128)) { + return false; + } + } + + return true; +} + +function isValidFqdn(str) { + if (isValidIPv4(str) || isValidIPv6(str)) { + return false; + } + const fqdnRegex = /^(?!-)(?:[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.){1,126}(?!-d$)[a-zA-Z0-9-]{2,63}$/; + return fqdnRegex.test(str); +} \ No newline at end of file diff --git a/static/js/vis-network.min.js b/static/js/vis-network.min.js new file mode 100644 index 0000000..6031381 --- /dev/null +++ b/static/js/vis-network.min.js @@ -0,0 +1,34 @@ +/** + * vis-network + * https://visjs.github.io/vis-network/ + * + * A dynamic, browser-based visualization library. + * + * @version 9.1.13 + * @date 2025-06-28T12:43:17.849Z + * + * @copyright (c) 2011-2017 Almende B.V, http://almende.com + * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs + * + * @license + * vis.js is dual licensed under both + * + * 1. The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 + * + * and + * + * 2. The MIT License + * http://opensource.org/licenses/MIT + * + * vis.js may be distributed under either license. + */ +!function(g,A){"object"==typeof exports&&"undefined"!=typeof module?A(exports):"function"==typeof define&&define.amd?define(["exports"],A):A((g="undefined"!=typeof globalThis?globalThis:g||self).vis=g.vis||{})}(this,(function(g){var A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function C(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var I=function(g){return g&&g.Math===Math&&g},t=I("object"==typeof globalThis&&globalThis)||I("object"==typeof window&&window)||I("object"==typeof self&&self)||I("object"==typeof A&&A)||function(){return this}()||A||Function("return this")(),e=function(g){try{return!!g()}catch(g){return!0}},i=!e((function(){var g=function(){}.bind();return"function"!=typeof g||g.hasOwnProperty("prototype")})),o=i,s=Function.prototype,n=s.apply,r=s.call,a="object"==typeof Reflect&&Reflect.apply||(o?r.bind(n):function(){return r.apply(n,arguments)}),d=i,h=Function.prototype,l=h.call,c=d&&h.bind.bind(l,l),u=d?c:function(g){return function(){return l.apply(g,arguments)}},p=u,f=p({}.toString),b=p("".slice),m=function(g){return b(f(g),8,-1)},v=m,y=u,w=function(g){if("Function"===v(g))return y(g)},x="object"==typeof document&&document.all,E={all:x,IS_HTMLDDA:void 0===x&&void 0!==x},O=E.all,T=E.IS_HTMLDDA?function(g){return"function"==typeof g||g===O}:function(g){return"function"==typeof g},D={},N=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),k=i,R=Function.prototype.call,P=k?R.bind(R):function(){return R.apply(R,arguments)},M={},z={}.propertyIsEnumerable,B=Object.getOwnPropertyDescriptor,Z=B&&!z.call({1:2},1);M.f=Z?function(g){var A=B(this,g);return!!A&&A.enumerable}:z;var S,F,G=function(g,A){return{enumerable:!(1&g),configurable:!(2&g),writable:!(4&g),value:A}},L=e,j=m,V=Object,Y=u("".split),W=L((function(){return!V("z").propertyIsEnumerable(0)}))?function(g){return"String"===j(g)?Y(g,""):V(g)}:V,Q=function(g){return null==g},U=Q,K=TypeError,H=function(g){if(U(g))throw new K("Can't call method on "+g);return g},X=W,_=H,J=function(g){return X(_(g))},q=T,$=E.all,gg=E.IS_HTMLDDA?function(g){return"object"==typeof g?null!==g:q(g)||g===$}:function(g){return"object"==typeof g?null!==g:q(g)},Ag={},Cg=Ag,Ig=t,tg=T,eg=function(g){return tg(g)?g:void 0},ig=function(g,A){return arguments.length<2?eg(Cg[g])||eg(Ig[g]):Cg[g]&&Cg[g][A]||Ig[g]&&Ig[g][A]},og=u({}.isPrototypeOf),sg="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ng=t,rg=sg,ag=ng.process,dg=ng.Deno,hg=ag&&ag.versions||dg&&dg.version,lg=hg&&hg.v8;lg&&(F=(S=lg.split("."))[0]>0&&S[0]<4?1:+(S[0]+S[1])),!F&&rg&&(!(S=rg.match(/Edge\/(\d+)/))||S[1]>=74)&&(S=rg.match(/Chrome\/(\d+)/))&&(F=+S[1]);var cg=F,ug=cg,pg=e,fg=t.String,bg=!!Object.getOwnPropertySymbols&&!pg((function(){var g=Symbol("symbol detection");return!fg(g)||!(Object(g)instanceof Symbol)||!Symbol.sham&&ug&&ug<41})),mg=bg&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,vg=ig,yg=T,wg=og,xg=Object,Eg=mg?function(g){return"symbol"==typeof g}:function(g){var A=vg("Symbol");return yg(A)&&wg(A.prototype,xg(g))},Og=String,Tg=function(g){try{return Og(g)}catch(g){return"Object"}},Dg=T,Ng=Tg,kg=TypeError,Rg=function(g){if(Dg(g))return g;throw new kg(Ng(g)+" is not a function")},Pg=Rg,Mg=Q,zg=function(g,A){var C=g[A];return Mg(C)?void 0:Pg(C)},Bg=P,Zg=T,Sg=gg,Fg=TypeError,Gg={exports:{}},Lg=t,jg=Object.defineProperty,Vg=function(g,A){try{jg(Lg,g,{value:A,configurable:!0,writable:!0})}catch(C){Lg[g]=A}return A},Yg="__core-js_shared__",Wg=t[Yg]||Vg(Yg,{}),Qg=Wg;(Gg.exports=function(g,A){return Qg[g]||(Qg[g]=void 0!==A?A:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ug=Gg.exports,Kg=H,Hg=Object,Xg=function(g){return Hg(Kg(g))},_g=Xg,Jg=u({}.hasOwnProperty),qg=Object.hasOwn||function(g,A){return Jg(_g(g),A)},$g=u,gA=0,AA=Math.random(),CA=$g(1..toString),IA=function(g){return"Symbol("+(void 0===g?"":g)+")_"+CA(++gA+AA,36)},tA=Ug,eA=qg,iA=IA,oA=bg,sA=mg,nA=t.Symbol,rA=tA("wks"),aA=sA?nA.for||nA:nA&&nA.withoutSetter||iA,dA=function(g){return eA(rA,g)||(rA[g]=oA&&eA(nA,g)?nA[g]:aA("Symbol."+g)),rA[g]},hA=P,lA=gg,cA=Eg,uA=zg,pA=function(g,A){var C,I;if("string"===A&&Zg(C=g.toString)&&!Sg(I=Bg(C,g)))return I;if(Zg(C=g.valueOf)&&!Sg(I=Bg(C,g)))return I;if("string"!==A&&Zg(C=g.toString)&&!Sg(I=Bg(C,g)))return I;throw new Fg("Can't convert object to primitive value")},fA=TypeError,bA=dA("toPrimitive"),mA=function(g,A){if(!lA(g)||cA(g))return g;var C,I=uA(g,bA);if(I){if(void 0===A&&(A="default"),C=hA(I,g,A),!lA(C)||cA(C))return C;throw new fA("Can't convert object to primitive value")}return void 0===A&&(A="number"),pA(g,A)},vA=Eg,yA=function(g){var A=mA(g,"string");return vA(A)?A:A+""},wA=gg,xA=t.document,EA=wA(xA)&&wA(xA.createElement),OA=function(g){return EA?xA.createElement(g):{}},TA=OA,DA=!N&&!e((function(){return 7!==Object.defineProperty(TA("div"),"a",{get:function(){return 7}}).a})),NA=N,kA=P,RA=M,PA=G,MA=J,zA=yA,BA=qg,ZA=DA,SA=Object.getOwnPropertyDescriptor;D.f=NA?SA:function(g,A){if(g=MA(g),A=zA(A),ZA)try{return SA(g,A)}catch(g){}if(BA(g,A))return PA(!kA(RA.f,g,A),g[A])};var FA=e,GA=T,LA=/#|\.prototype\./,jA=function(g,A){var C=YA[VA(g)];return C===QA||C!==WA&&(GA(A)?FA(A):!!A)},VA=jA.normalize=function(g){return String(g).replace(LA,".").toLowerCase()},YA=jA.data={},WA=jA.NATIVE="N",QA=jA.POLYFILL="P",UA=jA,KA=Rg,HA=i,XA=w(w.bind),_A=function(g,A){return KA(g),void 0===A?g:HA?XA(g,A):function(){return g.apply(A,arguments)}},JA={},qA=N&&e((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),$A=gg,gC=String,AC=TypeError,CC=function(g){if($A(g))return g;throw new AC(gC(g)+" is not an object")},IC=N,tC=DA,eC=qA,iC=CC,oC=yA,sC=TypeError,nC=Object.defineProperty,rC=Object.getOwnPropertyDescriptor,aC="enumerable",dC="configurable",hC="writable";JA.f=IC?eC?function(g,A,C){if(iC(g),A=oC(A),iC(C),"function"==typeof g&&"prototype"===A&&"value"in C&&hC in C&&!C[hC]){var I=rC(g,A);I&&I[hC]&&(g[A]=C.value,C={configurable:dC in C?C[dC]:I[dC],enumerable:aC in C?C[aC]:I[aC],writable:!1})}return nC(g,A,C)}:nC:function(g,A,C){if(iC(g),A=oC(A),iC(C),tC)try{return nC(g,A,C)}catch(g){}if("get"in C||"set"in C)throw new sC("Accessors not supported");return"value"in C&&(g[A]=C.value),g};var lC=JA,cC=G,uC=N?function(g,A,C){return lC.f(g,A,cC(1,C))}:function(g,A,C){return g[A]=C,g},pC=t,fC=a,bC=w,mC=T,vC=D.f,yC=UA,wC=Ag,xC=_A,EC=uC,OC=qg,TC=function(g){var A=function(C,I,t){if(this instanceof A){switch(arguments.length){case 0:return new g;case 1:return new g(C);case 2:return new g(C,I)}return new g(C,I,t)}return fC(g,this,arguments)};return A.prototype=g.prototype,A},DC=function(g,A){var C,I,t,e,i,o,s,n,r,a=g.target,d=g.global,h=g.stat,l=g.proto,c=d?pC:h?pC[a]:(pC[a]||{}).prototype,u=d?wC:wC[a]||EC(wC,a,{})[a],p=u.prototype;for(e in A)I=!(C=yC(d?e:a+(h?".":"#")+e,g.forced))&&c&&OC(c,e),o=u[e],I&&(s=g.dontCallGetSet?(r=vC(c,e))&&r.value:c[e]),i=I&&s?s:A[e],I&&typeof o==typeof i||(n=g.bind&&I?xC(i,pC):g.wrap&&I?TC(i):l&&mC(i)?bC(i):i,(g.sham||i&&i.sham||o&&o.sham)&&EC(n,"sham",!0),EC(u,e,n),l&&(OC(wC,t=a+"Prototype")||EC(wC,t,{}),EC(wC[t],e,i),g.real&&p&&(C||!p[e])&&EC(p,e,i)))},NC=Math.ceil,kC=Math.floor,RC=Math.trunc||function(g){var A=+g;return(A>0?kC:NC)(A)},PC=function(g){var A=+g;return A!=A||0===A?0:RC(A)},MC=PC,zC=Math.max,BC=Math.min,ZC=function(g,A){var C=MC(g);return C<0?zC(C+A,0):BC(C,A)},SC=PC,FC=Math.min,GC=function(g){return g>0?FC(SC(g),9007199254740991):0},LC=function(g){return GC(g.length)},jC=J,VC=ZC,YC=LC,WC=function(g){return function(A,C,I){var t,e=jC(A),i=YC(e),o=VC(I,i);if(g&&C!=C){for(;i>o;)if((t=e[o++])!=t)return!0}else for(;i>o;o++)if((g||o in e)&&e[o]===C)return g||o||0;return!g&&-1}},QC={includes:WC(!0),indexOf:WC(!1)},UC={},KC=qg,HC=J,XC=QC.indexOf,_C=UC,JC=u([].push),qC=function(g,A){var C,I=HC(g),t=0,e=[];for(C in I)!KC(_C,C)&&KC(I,C)&&JC(e,C);for(;A.length>t;)KC(I,C=A[t++])&&(~XC(e,C)||JC(e,C));return e},$C=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gI=qC,AI=$C,CI=Object.keys||function(g){return gI(g,AI)},II={};II.f=Object.getOwnPropertySymbols;var tI=N,eI=u,iI=P,oI=e,sI=CI,nI=II,rI=M,aI=Xg,dI=W,hI=Object.assign,lI=Object.defineProperty,cI=eI([].concat),uI=!hI||oI((function(){if(tI&&1!==hI({b:1},hI(lI({},"a",{enumerable:!0,get:function(){lI(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var g={},A={},C=Symbol("assign detection"),I="abcdefghijklmnopqrst";return g[C]=7,I.split("").forEach((function(g){A[g]=g})),7!==hI({},g)[C]||sI(hI({},A)).join("")!==I}))?function(g,A){for(var C=aI(g),I=arguments.length,t=1,e=nI.f,i=rI.f;I>t;)for(var o,s=dI(arguments[t++]),n=e?cI(sI(s),e(s)):sI(s),r=n.length,a=0;r>a;)o=n[a++],tI&&!iI(i,s,o)||(C[o]=s[o]);return C}:hI,pI=uI;DC({target:"Object",stat:!0,arity:2,forced:Object.assign!==pI},{assign:pI});var fI=C(Ag.Object.assign),bI=u([].slice),mI=u,vI=Rg,yI=gg,wI=qg,xI=bI,EI=i,OI=Function,TI=mI([].concat),DI=mI([].join),NI={},kI=EI?OI.bind:function(g){var A=vI(this),C=A.prototype,I=xI(arguments,1),t=function(){var C=TI(I,xI(arguments));return this instanceof t?function(g,A,C){if(!wI(NI,A)){for(var I=[],t=0;t=.1;)l=+e[a++%i],l>r&&(l=r),h=Math.sqrt(l*l/(1+n*n)),h=o<0?-h:h,A+=h,C+=n*h,!0===d?g.lineTo(A,C):g.moveTo(A,C),r-=l,d=!d}const QI={circle:LI,dashedLine:WI,database:YI,diamond:function(g,A,C,I){g.beginPath(),g.lineTo(A,C+I),g.lineTo(A+I,C),g.lineTo(A,C-I),g.lineTo(A-I,C),g.closePath()},ellipse:VI,ellipse_vis:VI,hexagon:function(g,A,C,I){g.beginPath();const t=2*Math.PI/6;g.moveTo(A+I,C);for(let e=1;e<6;e++)g.lineTo(A+I*Math.cos(t*e),C+I*Math.sin(t*e));g.closePath()},roundRect:jI,square:function(g,A,C,I){g.beginPath(),g.rect(A-I,C-I,2*I,2*I),g.closePath()},star:function(g,A,C,I){g.beginPath(),C+=.1*(I*=.82);for(let t=0;t<10;t++){const e=t%2==0?1.3*I:.5*I;g.lineTo(A+e*Math.sin(2*t*Math.PI/10),C-e*Math.cos(2*t*Math.PI/10))}g.closePath()},triangle:function(g,A,C,I){g.beginPath(),C+=.275*(I*=1.15);const t=2*I,e=t/2,i=Math.sqrt(3)/6*t,o=Math.sqrt(t*t-e*e);g.moveTo(A,C-(o-i)),g.lineTo(A+e,C+i),g.lineTo(A-e,C+i),g.lineTo(A,C-(o-i)),g.closePath()},triangleDown:function(g,A,C,I){g.beginPath(),C-=.275*(I*=1.15);const t=2*I,e=t/2,i=Math.sqrt(3)/6*t,o=Math.sqrt(t*t-e*e);g.moveTo(A,C+(o-i)),g.lineTo(A+e,C-i),g.lineTo(A-e,C-i),g.lineTo(A,C+(o-i)),g.closePath()}};function UI(g,A){void 0===A&&(A={});var C=A.insertAt;if(g&&"undefined"!=typeof document){var I=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===C&&I.firstChild?I.insertBefore(t,I.firstChild):I.appendChild(t),t.styleSheet?t.styleSheet.cssText=g:t.appendChild(document.createTextNode(g))}}UI(".vis-overlay{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}");UI(".vis [class*=span]{min-height:0;width:auto}");UI('div.vis-color-picker{background-color:#fff;border-radius:15px;box-shadow:0 0 10px 0 rgba(0,0,0,.5);display:none;height:444px;left:30px;margin-left:30px;margin-top:-140px;padding:10px;position:absolute;top:0;width:310px;z-index:1}div.vis-color-picker div.vis-arrow{left:5px;position:absolute;top:147px}div.vis-color-picker div.vis-arrow:after,div.vis-color-picker div.vis-arrow:before{border:solid transparent;content:" ";height:0;pointer-events:none;position:absolute;right:100%;top:50%;width:0}div.vis-color-picker div.vis-arrow:after{border-color:hsla(0,0%,100%,0) #fff hsla(0,0%,100%,0) hsla(0,0%,100%,0);border-width:30px;margin-top:-30px}div.vis-color-picker div.vis-color{cursor:pointer;height:289px;position:absolute;width:289px}div.vis-color-picker div.vis-brightness{position:absolute;top:313px}div.vis-color-picker div.vis-opacity{position:absolute;top:350px}div.vis-color-picker div.vis-selector{background:#4c4c4c;background:-moz-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4c4c4c),color-stop(12%,#595959),color-stop(25%,#666),color-stop(39%,#474747),color-stop(50%,#2c2c2c),color-stop(51%,#000),color-stop(60%,#111),color-stop(76%,#2b2b2b),color-stop(91%,#1c1c1c),color-stop(100%,#131313));background:-webkit-linear-gradient(top,#4c4c4c,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);background:-o-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:-ms-linear-gradient(top,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%);background:linear-gradient(180deg,#4c4c4c 0,#595959 12%,#666 25%,#474747 39%,#2c2c2c 50%,#000 51%,#111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313);border:1px solid #fff;border-radius:15px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#4c4c4c",endColorstr="#131313",GradientType=0);height:15px;left:137px;position:absolute;top:137px;width:15px}div.vis-color-picker div.vis-new-color{left:159px;padding-right:2px;text-align:right}div.vis-color-picker div.vis-initial-color,div.vis-color-picker div.vis-new-color{border:1px solid rgba(0,0,0,.1);border-radius:5px;color:rgba(0,0,0,.4);font-size:10px;height:20px;line-height:20px;position:absolute;top:380px;vertical-align:middle;width:140px}div.vis-color-picker div.vis-initial-color{left:10px;padding-left:2px;text-align:left}div.vis-color-picker div.vis-label{left:10px;position:absolute;width:300px}div.vis-color-picker div.vis-label.vis-brightness{top:300px}div.vis-color-picker div.vis-label.vis-opacity{top:338px}div.vis-color-picker div.vis-button{background-color:#f7f7f7;border:2px solid #d9d9d9;border-radius:10px;cursor:pointer;height:25px;line-height:25px;position:absolute;text-align:center;top:410px;vertical-align:middle;width:68px}div.vis-color-picker div.vis-button.vis-cancel{left:5px}div.vis-color-picker div.vis-button.vis-load{left:82px}div.vis-color-picker div.vis-button.vis-apply{left:159px}div.vis-color-picker div.vis-button.vis-save{left:236px}div.vis-color-picker input.vis-range{height:20px;width:290px}');UI('div.vis-configuration{display:block;float:left;font-size:12px;position:relative}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper:after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;display:block;left:10px;margin-top:20px;padding-left:5px;width:495px}div.vis-configuration.vis-config-button{background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;cursor:pointer;display:block;height:25px;left:10px;line-height:25px;margin-bottom:30px;margin-top:20px;padding-left:5px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;height:25px;line-height:25px;vertical-align:middle;width:495px}div.vis-configuration.vis-config-item.vis-config-s2{background-color:#f7f8fa;border-radius:3px;left:10px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s3{background-color:#e4e9f0;border-radius:3px;left:20px;padding-left:5px}div.vis-configuration.vis-config-item.vis-config-s4{background-color:#cfd8e6;border-radius:3px;left:30px;padding-left:5px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{height:25px;line-height:25px;width:120px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{border:1px solid #444;border-radius:2px;cursor:pointer;height:19px;margin:0;padding:0;top:1px;width:30px}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{margin:0;padding:1px;pointer-events:none;position:relative;top:-5px;width:60px}input.vis-configuration.vis-config-range{-webkit-appearance:none;background-color:transparent;border:0 solid #fff;height:20px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:5px;width:300px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2,#385380);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(180deg,#3876c2 0,#385380);border:1px solid #14334b;border-radius:50%;box-shadow:0 0 1px 0 #111927;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#3876c2",endColorstr="#385380",GradientType=0);height:17px;margin-top:-7px;width:17px}input.vis-configuration.vis-config-range:focus{outline:none}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(180deg,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#9d9d9d",endColorstr="#c8c8c8",GradientType=0)}input.vis-configuration.vis-config-range::-moz-range-track{background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);border:1px solid #999;border-radius:3px;box-shadow:0 0 3px 0 #aaa;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);height:10px;width:300px}input.vis-configuration.vis-config-range::-moz-range-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{background:transparent;border-color:transparent;border-width:6px 0;color:transparent;height:5px;width:300px}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{background:#385380;border:none;border-radius:50%;height:16px;width:16px}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{background:rgba(57,76,89,.85);border:2px solid #f2faff;border-radius:4px;color:#fff;font-size:14px;height:30px;line-height:30px;position:absolute;text-align:center;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out;width:150px}.vis-configuration-popup:after,.vis-configuration-popup:before{border:solid transparent;content:" ";height:0;left:100%;pointer-events:none;position:absolute;top:50%;width:0}.vis-configuration-popup:after{border-color:rgba(136,183,213,0) rgba(136,183,213,0) rgba(136,183,213,0) rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0) rgba(194,225,245,0) rgba(194,225,245,0) #f2faff;border-width:12px;margin-top:-12px}');UI("div.vis-tooltip{background-color:#f5f4ed;border:1px solid #808074;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;box-shadow:3px 3px 10px rgba(0,0,0,.2);color:#000;font-family:verdana;font-size:14px;padding:5px;pointer-events:none;position:absolute;visibility:hidden;white-space:nowrap;z-index:5}");var KI={exports:{}};!function(g){function A(g){if(g)return function(g){for(var C in A.prototype)g[C]=A.prototype[C];return g}(g)}g.exports=A,A.prototype.on=A.prototype.addEventListener=function(g,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+g]=this._callbacks["$"+g]||[]).push(A),this},A.prototype.once=function(g,A){function C(){this.off(g,C),A.apply(this,arguments)}return C.fn=A,this.on(g,C),this},A.prototype.off=A.prototype.removeListener=A.prototype.removeAllListeners=A.prototype.removeEventListener=function(g,A){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var C,I=this._callbacks["$"+g];if(!I)return this;if(1==arguments.length)return delete this._callbacks["$"+g],this;for(var t=0;t9007199254740991)throw JI("Maximum allowed index exceeded");return g},$I=yA,gt=JA,At=G,Ct=function(g,A,C){var I=$I(A);I in g?gt.f(g,I,At(0,C)):g[I]=C},It={};It[dA("toStringTag")]="z";var tt="[object z]"===String(It),et=tt,it=T,ot=m,st=dA("toStringTag"),nt=Object,rt="Arguments"===ot(function(){return arguments}()),at=et?ot:function(g){var A,C,I;return void 0===g?"Undefined":null===g?"Null":"string"==typeof(C=function(g,A){try{return g[A]}catch(g){}}(A=nt(g),st))?C:rt?ot(A):"Object"===(I=ot(A))&&it(A.callee)?"Arguments":I},dt=T,ht=Wg,lt=u(Function.toString);dt(ht.inspectSource)||(ht.inspectSource=function(g){return lt(g)});var ct=ht.inspectSource,ut=u,pt=e,ft=T,bt=at,mt=ct,vt=function(){},yt=[],wt=ig("Reflect","construct"),xt=/^\s*(?:class|function)\b/,Et=ut(xt.exec),Ot=!xt.test(vt),Tt=function(g){if(!ft(g))return!1;try{return wt(vt,yt,g),!0}catch(g){return!1}},Dt=function(g){if(!ft(g))return!1;switch(bt(g)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ot||!!Et(xt,mt(g))}catch(g){return!0}};Dt.sham=!0;var Nt=!wt||pt((function(){var g;return Tt(Tt.call)||!Tt(Object)||!Tt((function(){g=!0}))||g}))?Dt:Tt,kt=_I,Rt=Nt,Pt=gg,Mt=dA("species"),zt=Array,Bt=function(g){var A;return kt(g)&&(A=g.constructor,(Rt(A)&&(A===zt||kt(A.prototype))||Pt(A)&&null===(A=A[Mt]))&&(A=void 0)),void 0===A?zt:A},Zt=function(g,A){return new(Bt(g))(0===A?0:A)},St=e,Ft=cg,Gt=dA("species"),Lt=function(g){return Ft>=51||!St((function(){var A=[];return(A.constructor={})[Gt]=function(){return{foo:1}},1!==A[g](Boolean).foo}))},jt=DC,Vt=e,Yt=_I,Wt=gg,Qt=Xg,Ut=LC,Kt=qI,Ht=Ct,Xt=Zt,_t=Lt,Jt=cg,qt=dA("isConcatSpreadable"),$t=Jt>=51||!Vt((function(){var g=[];return g[qt]=!1,g.concat()[0]!==g})),ge=function(g){if(!Wt(g))return!1;var A=g[qt];return void 0!==A?!!A:Yt(g)};jt({target:"Array",proto:!0,arity:1,forced:!$t||!_t("concat")},{concat:function(g){var A,C,I,t,e,i=Qt(this),o=Xt(i,0),s=0;for(A=-1,I=arguments.length;Ai;)oe.f(g,C=t[i++],I[C]);return g};var ae,de=ig("document","documentElement"),he=IA,le=Ug("keys"),ce=function(g){return le[g]||(le[g]=he(g))},ue=CC,pe=te,fe=$C,be=UC,me=de,ve=OA,ye="prototype",we="script",xe=ce("IE_PROTO"),Ee=function(){},Oe=function(g){return"<"+we+">"+g+""},Te=function(g){g.write(Oe("")),g.close();var A=g.parentWindow.Object;return g=null,A},De=function(){try{ae=new ActiveXObject("htmlfile")}catch(g){}var g,A,C;De="undefined"!=typeof document?document.domain&&ae?Te(ae):(A=ve("iframe"),C="java"+we+":",A.style.display="none",me.appendChild(A),A.src=String(C),(g=A.contentWindow.document).open(),g.write(Oe("document.F=Object")),g.close(),g.F):Te(ae);for(var I=fe.length;I--;)delete De[ye][fe[I]];return De()};be[xe]=!0;var Ne=Object.create||function(g,A){var C;return null!==g?(Ee[ye]=ue(g),C=new Ee,Ee[ye]=null,C[xe]=g):C=De(),void 0===A?C:pe.f(C,A)},ke={},Re=qC,Pe=$C.concat("length","prototype");ke.f=Object.getOwnPropertyNames||function(g){return Re(g,Pe)};var Me={},ze=ZC,Be=LC,Ze=Ct,Se=Array,Fe=Math.max,Ge=function(g,A,C){for(var I=Be(g),t=ze(A,I),e=ze(void 0===C?I:C,I),i=Se(Fe(e-t,0)),o=0;tf;f++)if((o||f in c)&&(h=u(d=c[f],f,l),g))if(A)m[f]=h;else if(h)switch(g){case 3:return!0;case 5:return d;case 6:return f;case 2:ji(m,d)}else switch(g){case 4:return!1;case 7:ji(m,d)}return e?-1:I||t?t:m}},Yi={forEach:Vi(0),map:Vi(1),filter:Vi(2),some:Vi(3),every:Vi(4),find:Vi(5),findIndex:Vi(6),filterReject:Vi(7)},Wi=DC,Qi=t,Ui=P,Ki=u,Hi=N,Xi=bg,_i=e,Ji=qg,qi=og,$i=CC,go=J,Ao=yA,Co=Ie,Io=G,to=Ne,eo=CI,io=ke,oo=Me,so=II,no=D,ro=JA,ao=te,ho=M,lo=Ue,co=He,uo=Ug,po=UC,fo=IA,bo=dA,mo=Xe,vo=ti,yo=ni,wo=fi,xo=Bi,Eo=Yi.forEach,Oo=ce("hidden"),To="Symbol",Do="prototype",No=xo.set,ko=xo.getterFor(To),Ro=Object[Do],Po=Qi.Symbol,Mo=Po&&Po[Do],zo=Qi.RangeError,Bo=Qi.TypeError,Zo=Qi.QObject,So=no.f,Fo=ro.f,Go=oo.f,Lo=ho.f,jo=Ki([].push),Vo=uo("symbols"),Yo=uo("op-symbols"),Wo=uo("wks"),Qo=!Zo||!Zo[Do]||!Zo[Do].findChild,Uo=function(g,A,C){var I=So(Ro,A);I&&delete Ro[A],Fo(g,A,C),I&&g!==Ro&&Fo(Ro,A,I)},Ko=Hi&&_i((function(){return 7!==to(Fo({},"a",{get:function(){return Fo(this,"a",{value:7}).a}})).a}))?Uo:Fo,Ho=function(g,A){var C=Vo[g]=to(Mo);return No(C,{type:To,tag:g,description:A}),Hi||(C.description=A),C},Xo=function(g,A,C){g===Ro&&Xo(Yo,A,C),$i(g);var I=Ao(A);return $i(C),Ji(Vo,I)?(C.enumerable?(Ji(g,Oo)&&g[Oo][I]&&(g[Oo][I]=!1),C=to(C,{enumerable:Io(0,!1)})):(Ji(g,Oo)||Fo(g,Oo,Io(1,{})),g[Oo][I]=!0),Ko(g,I,C)):Fo(g,I,C)},_o=function(g,A){$i(g);var C=go(A),I=eo(C).concat(gs(C));return Eo(I,(function(A){Hi&&!Ui(Jo,C,A)||Xo(g,A,C[A])})),g},Jo=function(g){var A=Ao(g),C=Ui(Lo,this,A);return!(this===Ro&&Ji(Vo,A)&&!Ji(Yo,A))&&(!(C||!Ji(this,A)||!Ji(Vo,A)||Ji(this,Oo)&&this[Oo][A])||C)},qo=function(g,A){var C=go(g),I=Ao(A);if(C!==Ro||!Ji(Vo,I)||Ji(Yo,I)){var t=So(C,I);return!t||!Ji(Vo,I)||Ji(C,Oo)&&C[Oo][I]||(t.enumerable=!0),t}},$o=function(g){var A=Go(go(g)),C=[];return Eo(A,(function(g){Ji(Vo,g)||Ji(po,g)||jo(C,g)})),C},gs=function(g){var A=g===Ro,C=Go(A?Yo:go(g)),I=[];return Eo(C,(function(g){!Ji(Vo,g)||A&&!Ji(Ro,g)||jo(I,Vo[g])})),I};Xi||(Po=function(){if(qi(Mo,this))throw new Bo("Symbol is not a constructor");var g=arguments.length&&void 0!==arguments[0]?Co(arguments[0]):void 0,A=fo(g),C=function(g){this===Ro&&Ui(C,Yo,g),Ji(this,Oo)&&Ji(this[Oo],A)&&(this[Oo][A]=!1);var I=Io(1,g);try{Ko(this,A,I)}catch(g){if(!(g instanceof zo))throw g;Uo(this,A,I)}};return Hi&&Qo&&Ko(Ro,A,{configurable:!0,set:C}),Ho(A,g)},lo(Mo=Po[Do],"toString",(function(){return ko(this).tag})),lo(Po,"withoutSetter",(function(g){return Ho(fo(g),g)})),ho.f=Jo,ro.f=Xo,ao.f=_o,no.f=qo,io.f=oo.f=$o,so.f=gs,mo.f=function(g){return Ho(bo(g),g)},Hi&&co(Mo,"description",{configurable:!0,get:function(){return ko(this).description}})),Wi({global:!0,constructor:!0,wrap:!0,forced:!Xi,sham:!Xi},{Symbol:Po}),Eo(eo(Wo),(function(g){vo(g)})),Wi({target:To,stat:!0,forced:!Xi},{useSetter:function(){Qo=!0},useSimple:function(){Qo=!1}}),Wi({target:"Object",stat:!0,forced:!Xi,sham:!Hi},{create:function(g,A){return void 0===A?to(g):_o(to(g),A)},defineProperty:Xo,defineProperties:_o,getOwnPropertyDescriptor:qo}),Wi({target:"Object",stat:!0,forced:!Xi},{getOwnPropertyNames:$o}),yo(),wo(Po,To),po[Oo]=!0;var As=bg&&!!Symbol.for&&!!Symbol.keyFor,Cs=DC,Is=ig,ts=qg,es=Ie,is=Ug,os=As,ss=is("string-to-symbol-registry"),ns=is("symbol-to-string-registry");Cs({target:"Symbol",stat:!0,forced:!os},{for:function(g){var A=es(g);if(ts(ss,A))return ss[A];var C=Is("Symbol")(A);return ss[A]=C,ns[C]=A,C}});var rs=DC,as=qg,ds=Eg,hs=Tg,ls=As,cs=Ug("symbol-to-string-registry");rs({target:"Symbol",stat:!0,forced:!ls},{keyFor:function(g){if(!ds(g))throw new TypeError(hs(g)+" is not a symbol");if(as(cs,g))return cs[g]}});var us=_I,ps=T,fs=m,bs=Ie,ms=u([].push),vs=DC,ys=ig,ws=a,xs=P,Es=u,Os=e,Ts=T,Ds=Eg,Ns=bI,ks=function(g){if(ps(g))return g;if(us(g)){for(var A=g.length,C=[],I=0;I=A.length)return g.target=void 0,Cr(void 0,!0);switch(C){case"keys":return Cr(I,!1);case"values":return Cr(A[I],!1)}return Cr([I,A[I]],!1)}),"values"),$n.Arguments=$n.Array;var ir={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},or=t,sr=at,nr=uC,rr=An,ar=dA("toStringTag");for(var dr in ir){var hr=or[dr],lr=hr&&hr.prototype;lr&&sr(lr)!==ar&&nr(lr,ar,dr),rr[dr]=rr.Array}var cr=gn,ur=C(cr),pr=DC,fr=_I,br=Nt,mr=gg,vr=ZC,yr=LC,wr=J,xr=Ct,Er=dA,Or=bI,Tr=Lt("slice"),Dr=Er("species"),Nr=Array,kr=Math.max;pr({target:"Array",proto:!0,forced:!Tr},{slice:function(g,A){var C,I,t,e=wr(this),i=yr(e),o=vr(g,i),s=vr(void 0===A?i:A,i);if(fr(e)&&(C=e.constructor,(br(C)&&(C===Nr||fr(C.prototype))||mr(C)&&null===(C=C[Dr]))&&(C=void 0),C===Nr||void 0===C))return Or(e,o,s);for(I=new(void 0===C?Nr:C)(kr(s-o,0)),t=0;o1?arguments[1]:void 0)}});var Ur=MI("Array").map,Kr=og,Hr=Ur,Xr=Array.prototype,_r=function(g){var A=g.map;return g===Xr||Kr(Xr,g)&&A===Xr.map?Hr:A},Jr=C(_r),qr=Xg,$r=CI;DC({target:"Object",stat:!0,forced:e((function(){$r(1)}))},{keys:function(g){return $r(qr(g))}});var ga=C(Ag.Object.keys),Aa=DC,Ca=Date,Ia=u(Ca.prototype.getTime);Aa({target:"Date",stat:!0},{now:function(){return Ia(new Ca)}});var ta=C(Ag.Date.now),ea=e,ia=function(g,A){var C=[][g];return!!C&&ea((function(){C.call(null,A||function(){return 1},1)}))},oa=Yi.forEach,sa=ia("forEach")?[].forEach:function(g){return oa(this,g,arguments.length>1?arguments[1]:void 0)};DC({target:"Array",proto:!0,forced:[].forEach!==sa},{forEach:sa});var na=MI("Array").forEach,ra=at,aa=qg,da=og,ha=na,la=Array.prototype,ca={DOMTokenList:!0,NodeList:!0},ua=function(g){var A=g.forEach;return g===la||da(la,g)&&A===la.forEach||aa(ca,ra(g))?ha:A},pa=C(ua),fa=DC,ba=_I,ma=u([].reverse),va=[1,2];fa({target:"Array",proto:!0,forced:String(va)===String(va.reverse())},{reverse:function(){return ba(this)&&(this.length=this.length),ma(this)}});var ya=MI("Array").reverse,wa=og,xa=ya,Ea=Array.prototype,Oa=function(g){var A=g.reverse;return g===Ea||wa(Ea,g)&&A===Ea.reverse?xa:A},Ta=C(Oa),Da=N,Na=_I,ka=TypeError,Ra=Object.getOwnPropertyDescriptor,Pa=Da&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(g){return g instanceof TypeError}}(),Ma=Tg,za=TypeError,Ba=function(g,A){if(!delete g[A])throw new za("Cannot delete property "+Ma(A)+" of "+Ma(g))},Za=DC,Sa=Xg,Fa=ZC,Ga=PC,La=LC,ja=Pa?function(g,A){if(Na(g)&&!Ra(g,"length").writable)throw new ka("Cannot set read only .length");return g.length=A}:function(g,A){return g.length=A},Va=qI,Ya=Zt,Wa=Ct,Qa=Ba,Ua=Lt("splice"),Ka=Math.max,Ha=Math.min;Za({target:"Array",proto:!0,forced:!Ua},{splice:function(g,A){var C,I,t,e,i,o,s=Sa(this),n=La(s),r=Fa(g,n),a=arguments.length;for(0===a?C=I=0:1===a?(C=0,I=n-r):(C=a-2,I=Ha(Ka(Ga(A),0),n-r)),Va(n+C-I),t=Ya(s,I),e=0;en-I+C;e--)Qa(s,e-1)}else if(C>I)for(e=n-I;e>r;e--)o=e+C-1,(i=e+I-1)in s?s[o]=s[i]:Qa(s,o);for(e=0;e1?arguments[1]:void 0)}});var Cd=MI("Array").includes,Id=gg,td=m,ed=dA("match"),id=function(g){var A;return Id(g)&&(void 0!==(A=g[ed])?!!A:"RegExp"===td(g))},od=TypeError,sd=dA("match"),nd=DC,rd=function(g){if(id(g))throw new od("The method doesn't accept regular expressions");return g},ad=H,dd=Ie,hd=function(g){var A=/./;try{"/./"[g](A)}catch(C){try{return A[sd]=!1,"/./"[g](A)}catch(g){}}return!1},ld=u("".indexOf);nd({target:"String",proto:!0,forced:!hd("includes")},{includes:function(g){return!!~ld(dd(ad(this)),dd(rd(g)),arguments.length>1?arguments[1]:void 0)}});var cd=MI("String").includes,ud=og,pd=Cd,fd=cd,bd=Array.prototype,md=String.prototype,vd=function(g){var A=g.includes;return g===bd||ud(bd,g)&&A===bd.includes?pd:"string"==typeof g||g===md||ud(md,g)&&A===md.includes?fd:A},yd=C(vd),wd=Xg,xd=pn,Ed=nn;DC({target:"Object",stat:!0,forced:e((function(){xd(1)})),sham:!Ed},{getPrototypeOf:function(g){return xd(wd(g))}});var Od=C(Ag.Object.getPrototypeOf),Td=MI("Array").concat,Dd=og,Nd=Td,kd=Array.prototype,Rd=function(g){var A=g.concat;return g===kd||Dd(kd,g)&&A===kd.concat?Nd:A},Pd=C(Rd),Md=Yi.filter;DC({target:"Array",proto:!0,forced:!Lt("filter")},{filter:function(g){return Md(this,g,arguments.length>1?arguments[1]:void 0)}});var zd=MI("Array").filter,Bd=og,Zd=zd,Sd=Array.prototype,Fd=function(g){var A=g.filter;return g===Sd||Bd(Sd,g)&&A===Sd.filter?Zd:A},Gd=C(Fd),Ld=N,jd=e,Vd=u,Yd=pn,Wd=CI,Qd=J,Ud=Vd(M.f),Kd=Vd([].push),Hd=Ld&&jd((function(){var g=Object.create(null);return g[2]=2,!Ud(g,2)})),Xd=function(g){return function(A){for(var C,I=Qd(A),t=Wd(I),e=Hd&&null===Yd(I),i=t.length,o=0,s=[];i>o;)C=t[o++],Ld&&!(e?C in I:Ud(I,C))||Kd(s,g?[C,I[C]]:I[C]);return s}},_d={entries:Xd(!0),values:Xd(!1)}.values;DC({target:"Object",stat:!0},{values:function(g){return _d(g)}});var Jd=C(Ag.Object.values),qd="\t\n\v\f\r                 \u2028\u2029\ufeff",$d=H,gh=Ie,Ah=qd,Ch=u("".replace),Ih=RegExp("^["+Ah+"]+"),th=RegExp("(^|[^"+Ah+"])["+Ah+"]+$"),eh=function(g){return function(A){var C=gh($d(A));return 1&g&&(C=Ch(C,Ih,"")),2&g&&(C=Ch(C,th,"$1")),C}},ih={start:eh(1),end:eh(2),trim:eh(3)},oh=t,sh=e,nh=u,rh=Ie,ah=ih.trim,dh=qd,hh=oh.parseInt,lh=oh.Symbol,ch=lh&&lh.iterator,uh=/^[+-]?0x/i,ph=nh(uh.exec),fh=8!==hh(dh+"08")||22!==hh(dh+"0x16")||ch&&!sh((function(){hh(Object(ch))}))?function(g,A){var C=ah(rh(g));return hh(C,A>>>0||(ph(uh,C)?16:10))}:hh;DC({global:!0,forced:parseInt!==fh},{parseInt:fh});var bh=C(Ag.parseInt),mh=DC,vh=QC.indexOf,yh=ia,wh=w([].indexOf),xh=!!wh&&1/wh([1],1,-0)<0;mh({target:"Array",proto:!0,forced:xh||!yh("indexOf")},{indexOf:function(g){var A=arguments.length>1?arguments[1]:void 0;return xh?wh(this,g,A)||0:vh(this,g,A)}});var Eh=MI("Array").indexOf,Oh=og,Th=Eh,Dh=Array.prototype,Nh=function(g){var A=g.indexOf;return g===Dh||Oh(Dh,g)&&A===Dh.indexOf?Th:A},kh=C(Nh);DC({target:"Object",stat:!0,sham:!N},{create:Ne});var Rh=Ag.Object,Ph=C((function(g,A){return Rh.create(g,A)})),Mh=Ag,zh=a;Mh.JSON||(Mh.JSON={stringify:JSON.stringify});var Bh=function(g,A,C){return zh(Mh.JSON.stringify,null,arguments)},Zh=C(Bh),Sh="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,Fh=TypeError,Gh=t,Lh=a,jh=T,Vh=Sh,Yh=sg,Wh=bI,Qh=function(g,A){if(gC,i=jh(I)?I:Uh(I),o=e?Wh(arguments,C):[],s=e?function(){Lh(i,this,o)}:i;return A?g(s,t):g(s)}:g},Xh=DC,_h=t,Jh=Hh(_h.setInterval,!0);Xh({global:!0,bind:!0,forced:_h.setInterval!==Jh},{setInterval:Jh});var qh=DC,$h=t,gl=Hh($h.setTimeout,!0);qh({global:!0,bind:!0,forced:$h.setTimeout!==gl},{setTimeout:gl});var Al=C(Ag.setTimeout),Cl=Xg,Il=ZC,tl=LC,el=function(g){for(var A=Cl(this),C=tl(A),I=arguments.length,t=Il(I>1?arguments[1]:void 0,C),e=I>2?arguments[2]:void 0,i=void 0===e?C:Il(e,C);i>t;)A[t++]=g;return A};DC({target:"Array",proto:!0},{fill:el});var il,ol=MI("Array").fill,sl=og,nl=ol,rl=Array.prototype,al=function(g){var A=g.fill;return g===rl||sl(rl,g)&&A===rl.fill?nl:A},dl=C(al); +/*! Hammer.JS - v2.0.17-rc - 2019-12-16 + * http://naver.github.io/egjs + * + * Forked By Naver egjs + * Copyright (c) hammerjs + * Licensed under the MIT license */ +function hl(){return hl=Object.assign||function(g){for(var A=1;A-1}var Ac=function(){function g(g,A){this.manager=g,this.set(A)}var A=g.prototype;return A.set=function(g){g===Ol&&(g=this.compute()),El&&this.manager.element.style&&Pl[g]&&(this.manager.element.style[xl]=g),this.actions=g.toLowerCase().trim()},A.update=function(){this.set(this.manager.options.touchAction)},A.compute=function(){var g=[];return ql(this.manager.recognizers,(function(A){$l(A.options.enable,[A])&&(g=g.concat(A.getTouchAction()))})),function(g){if(gc(g,Nl))return Nl;var A=gc(g,kl),C=gc(g,Rl);return A&&C?Nl:A||C?A?kl:Rl:gc(g,Dl)?Dl:Tl}(g.join(" "))},A.preventDefaults=function(g){var A=g.srcEvent,C=g.offsetDirection;if(this.manager.session.prevented)A.preventDefault();else{var I=this.actions,t=gc(I,Nl)&&!Pl[Nl],e=gc(I,Rl)&&!Pl[Rl],i=gc(I,kl)&&!Pl[kl];if(t){var o=1===g.pointers.length,s=g.distance<2,n=g.deltaTime<250;if(o&&s&&n)return}if(!i||!e)return t||e&&C&Kl||i&&C&Hl?this.preventSrc(A):void 0}},A.preventSrc=function(g){this.manager.session.prevented=!0,g.preventDefault()},g}();function Cc(g,A){for(;g;){if(g===A)return!0;g=g.parentNode}return!1}function Ic(g){var A=g.length;if(1===A)return{x:ml(g[0].clientX),y:ml(g[0].clientY)};for(var C=0,I=0,t=0;t=vl(A)?g<0?Yl:Wl:A<0?Ql:Ul}function sc(g,A,C){return{x:A/g||0,y:C/g||0}}function nc(g,A){var C=g.session,I=A.pointers,t=I.length;C.firstInput||(C.firstInput=tc(A)),t>1&&!C.firstMultiple?C.firstMultiple=tc(A):1===t&&(C.firstMultiple=!1);var e=C.firstInput,i=C.firstMultiple,o=i?i.center:e.center,s=A.center=Ic(I);A.timeStamp=yl(),A.deltaTime=A.timeStamp-e.timeStamp,A.angle=ic(o,s),A.distance=ec(o,s),function(g,A){var C=A.center,I=g.offsetDelta||{},t=g.prevDelta||{},e=g.prevInput||{};A.eventType!==Gl&&e.eventType!==Ll||(t=g.prevDelta={x:e.deltaX||0,y:e.deltaY||0},I=g.offsetDelta={x:C.x,y:C.y}),A.deltaX=t.x+(C.x-I.x),A.deltaY=t.y+(C.y-I.y)}(C,A),A.offsetDirection=oc(A.deltaX,A.deltaY);var n,r,a=sc(A.deltaTime,A.deltaX,A.deltaY);A.overallVelocityX=a.x,A.overallVelocityY=a.y,A.overallVelocity=vl(a.x)>vl(a.y)?a.x:a.y,A.scale=i?(n=i.pointers,ec((r=I)[0],r[1],Jl)/ec(n[0],n[1],Jl)):1,A.rotation=i?function(g,A){return ic(A[1],A[0],Jl)+ic(g[1],g[0],Jl)}(i.pointers,I):0,A.maxPointers=C.prevInput?A.pointers.length>C.prevInput.maxPointers?A.pointers.length:C.prevInput.maxPointers:A.pointers.length,function(g,A){var C,I,t,e,i=g.lastInterval||A,o=A.timeStamp-i.timeStamp;if(A.eventType!==jl&&(o>Fl||void 0===i.velocity)){var s=A.deltaX-i.deltaX,n=A.deltaY-i.deltaY,r=sc(o,s,n);I=r.x,t=r.y,C=vl(r.x)>vl(r.y)?r.x:r.y,e=oc(s,n),g.lastInterval=A}else C=i.velocity,I=i.velocityX,t=i.velocityY,e=i.direction;A.velocity=C,A.velocityX=I,A.velocityY=t,A.direction=e}(C,A);var d,h=g.element,l=A.srcEvent;Cc(d=l.composedPath?l.composedPath()[0]:l.path?l.path[0]:l.target,h)&&(h=d),A.target=h}function rc(g,A,C){var I=C.pointers.length,t=C.changedPointers.length,e=A&Gl&&I-t==0,i=A&(Ll|jl)&&I-t==0;C.isFirst=!!e,C.isFinal=!!i,e&&(g.session={}),C.eventType=A,nc(g,C),g.emit("hammer.input",C),g.recognize(C),g.session.prevInput=C}function ac(g){return g.trim().split(/\s+/g)}function dc(g,A,C){ql(ac(A),(function(A){g.addEventListener(A,C,!1)}))}function hc(g,A,C){ql(ac(A),(function(A){g.removeEventListener(A,C,!1)}))}function lc(g){var A=g.ownerDocument||g;return A.defaultView||A.parentWindow||window}var cc=function(){function g(g,A){var C=this;this.manager=g,this.callback=A,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(A){$l(g.options.enable,[g])&&C.handler(A)},this.init()}var A=g.prototype;return A.handler=function(){},A.init=function(){this.evEl&&dc(this.element,this.evEl,this.domHandler),this.evTarget&&dc(this.target,this.evTarget,this.domHandler),this.evWin&&dc(lc(this.element),this.evWin,this.domHandler)},A.destroy=function(){this.evEl&&hc(this.element,this.evEl,this.domHandler),this.evTarget&&hc(this.target,this.evTarget,this.domHandler),this.evWin&&hc(lc(this.element),this.evWin,this.domHandler)},g}();function uc(g,A,C){if(g.indexOf&&!C)return g.indexOf(A);for(var I=0;IC[A]})):I.sort()),I}var xc={touchstart:Gl,touchmove:2,touchend:Ll,touchcancel:jl},Ec=function(g){function A(){var C;return A.prototype.evTarget="touchstart touchmove touchend touchcancel",(C=g.apply(this,arguments)||this).targetIds={},C}return ll(A,g),A.prototype.handler=function(g){var A=xc[g.type],C=Oc.call(this,g,A);C&&this.callback(this.manager,A,{pointers:C[0],changedPointers:C[1],pointerType:Zl,srcEvent:g})},A}(cc);function Oc(g,A){var C,I,t=yc(g.touches),e=this.targetIds;if(A&(2|Gl)&&1===t.length)return e[t[0].identifier]=!0,[t,t];var i=yc(g.changedTouches),o=[],s=this.target;if(I=t.filter((function(g){return Cc(g.target,s)})),A===Gl)for(C=0;C-1&&I.splice(g,1)}),Nc)}}function Rc(g,A){g&Gl?(this.primaryTouch=A.changedPointers[0].identifier,kc.call(this,A)):g&(Ll|jl)&&kc.call(this,A)}function Pc(g){for(var A=g.srcEvent.clientX,C=g.srcEvent.clientY,I=0;I-1&&this.requireFail.splice(A,1),this},A.hasRequireFailures=function(){return this.requireFail.length>0},A.canRecognizeWith=function(g){return!!this.simultaneous[g.id]},A.emit=function(g){var A=this,C=this.state;function I(C){A.manager.emit(C,g)}C<8&&I(A.options.event+Fc(C)),I(A.options.event),g.additionalEvent&&I(g.additionalEvent),C>=8&&I(A.options.event+Fc(C))},A.tryEmit=function(g){if(this.canEmit())return this.emit(g);this.state=Bc},A.canEmit=function(){for(var g=0;gA.threshold&&t&A.direction},C.attrTest=function(g){return jc.prototype.attrTest.call(this,g)&&(2&this.state||!(2&this.state)&&this.directionTest(g))},C.emit=function(A){this.pX=A.deltaX,this.pY=A.deltaY;var C=Vc(A.direction);C&&(A.additionalEvent=this.options.event+C),g.prototype.emit.call(this,A)},A}(jc),Wc=function(g){function A(A){return void 0===A&&(A={}),g.call(this,hl({event:"swipe",threshold:10,velocity:.3,direction:Kl|Hl,pointers:1},A))||this}ll(A,g);var C=A.prototype;return C.getTouchAction=function(){return Yc.prototype.getTouchAction.call(this)},C.attrTest=function(A){var C,I=this.options.direction;return I&(Kl|Hl)?C=A.overallVelocity:I&Kl?C=A.overallVelocityX:I&Hl&&(C=A.overallVelocityY),g.prototype.attrTest.call(this,A)&&I&A.offsetDirection&&A.distance>this.options.threshold&&A.maxPointers===this.options.pointers&&vl(C)>this.options.velocity&&A.eventType&Ll},C.emit=function(g){var A=Vc(g.offsetDirection);A&&this.manager.emit(this.options.event+A,g),this.manager.emit(this.options.event,g)},A}(jc),Qc=function(g){function A(A){return void 0===A&&(A={}),g.call(this,hl({event:"pinch",threshold:0,pointers:2},A))||this}ll(A,g);var C=A.prototype;return C.getTouchAction=function(){return[Nl]},C.attrTest=function(A){return g.prototype.attrTest.call(this,A)&&(Math.abs(A.scale-1)>this.options.threshold||2&this.state)},C.emit=function(A){if(1!==A.scale){var C=A.scale<1?"in":"out";A.additionalEvent=this.options.event+C}g.prototype.emit.call(this,A)},A}(jc),Uc=function(g){function A(A){return void 0===A&&(A={}),g.call(this,hl({event:"rotate",threshold:0,pointers:2},A))||this}ll(A,g);var C=A.prototype;return C.getTouchAction=function(){return[Nl]},C.attrTest=function(A){return g.prototype.attrTest.call(this,A)&&(Math.abs(A.rotation)>this.options.threshold||2&this.state)},A}(jc),Kc=function(g){function A(A){var C;return void 0===A&&(A={}),(C=g.call(this,hl({event:"press",pointers:1,time:251,threshold:9},A))||this)._timer=null,C._input=null,C}ll(A,g);var C=A.prototype;return C.getTouchAction=function(){return[Tl]},C.process=function(g){var A=this,C=this.options,I=g.pointers.length===C.pointers,t=g.distanceC.time;if(this._input=g,!t||!I||g.eventType&(Ll|jl)&&!e)this.reset();else if(g.eventType&Gl)this.reset(),this._timer=setTimeout((function(){A.state=8,A.tryEmit()}),C.time);else if(g.eventType&Ll)return 8;return Bc},C.reset=function(){clearTimeout(this._timer)},C.emit=function(g){8===this.state&&(g&&g.eventType&Ll?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=yl(),this.manager.emit(this.options.event,this._input)))},A}(Gc),Hc={domEvents:!1,touchAction:Ol,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Xc=[[Uc,{enable:!1}],[Qc,{enable:!1},["rotate"]],[Wc,{direction:Kl}],[Yc,{direction:Kl},["swipe"]],[Lc],[Lc,{event:"doubletap",taps:2},["tap"]],[Kc]];function _c(g,A){var C,I=g.element;I.style&&(ql(g.options.cssProps,(function(t,e){C=wl(I.style,e),A?(g.oldCssProps[C]=I.style[C],I.style[C]=t):I.style[C]=g.oldCssProps[C]||""})),A||(g.oldCssProps={}))}var Jc=function(){function g(g,A){var C,I=this;this.options=pl({},Hc,A||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=new((C=this).options.inputClass||(zl?vc:Bl?Ec:Ml?Mc:Dc))(C,rc),this.touchAction=new Ac(this,this.options.touchAction),_c(this,!0),ql(this.options.recognizers,(function(g){var A=I.add(new g[0](g[1]));g[2]&&A.recognizeWith(g[2]),g[3]&&A.requireFailure(g[3])}),this)}var A=g.prototype;return A.set=function(g){return pl(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},A.stop=function(g){this.session.stopped=g?2:1},A.recognize=function(g){var A=this.session;if(!A.stopped){var C;this.touchAction.preventDefaults(g);var I=this.recognizers,t=A.curRecognizer;(!t||t&&8&t.state)&&(A.curRecognizer=null,t=null);for(var e=0;e\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",t=window.console&&(window.console.warn||window.console.log);return t&&t.call(window.console,I,C),g.apply(this,arguments)}}var Cu=Au((function(g,A,C){for(var I=Object.keys(A),t=0;t2)return ru(nu(A[0],A[1]),...Zr(A).call(A,2));const I=A[0],t=A[1];if(I instanceof Date&&t instanceof Date)return I.setTime(t.getTime()),I;for(const g of Yr(t))Object.prototype.propertyIsEnumerable.call(t,g)&&(t[g]===su?delete I[g]:null===I[g]||null===t[g]||"object"!=typeof I[g]||"object"!=typeof t[g]||Wr(I[g])||Wr(t[g])?I[g]=au(t[g]):I[g]=ru(I[g],t[g]));return I}function au(g){return Wr(g)?Jr(g).call(g,(g=>au(g))):"object"==typeof g&&null!==g?g instanceof Date?new Date(g.getTime()):ru({},g):g}function du(g){for(const A of ga(g))g[A]===su?delete g[A]:"object"==typeof g[A]&&null!==g[A]&&du(g[A])}function hu(){for(var g=arguments.length,A=new Array(g),C=0;C>>0,I-=g,I*=g,g=I>>>0,I-=g,g+=4294967296*I}return 2.3283064365386963e-10*(g>>>0)}}();let A=g(" "),C=g(" "),I=g(" ");for(let t=0;t{const g=2091639*A+2.3283064365386963e-10*t;return A=C,C=I,I=g-(t=0|g)};return e.uint32=()=>4294967296*e(),e.fract53=()=>e()+11102230246251565e-32*(2097152*e()|0),e.algorithm="Alea",e.seed=g,e.version="0.9",e}(A.length?A:[ta()])}const lu="undefined"!=typeof window?window.Hammer||ou:function(){return function(){const g=()=>{};return{on:g,off:g,destroy:g,emit:g,get:()=>({set:g})}}()};function cu(g){var A;this._cleanupQueue=[],this.active=!1,this._dom={container:g,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 C=lu(this._dom.overlay);C.on("tap",GI(A=this._onTapOverlay).call(A,this)),this._cleanupQueue.push((()=>{C.destroy()}));const I=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];pa(I).call(I,(g=>{C.on(g,(g=>{g.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=A=>{(function(g,A){for(;g;){if(g===A)return!0;g=g.parentNode}return!1})(A.target,g)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push((()=>{document.body.removeEventListener("click",this._onClick)}))),this._escListener=g=>{("key"in g?"Escape"===g.key:27===g.keyCode)&&this.deactivate()}}HI(cu.prototype),cu.current=null,cu.prototype.destroy=function(){this.deactivate();for(const C of Ta(g=gd(A=this._cleanupQueue).call(A,0)).call(g)){var g,A;C()}},cu.prototype.activate=function(){cu.current&&cu.current.deactivate(),cu.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)},cu.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")},cu.prototype._onTapOverlay=function(g){this.activate(),g.srcEvent.stopPropagation()};const uu=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,pu=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,fu=/^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,bu=/^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 mu(g){if(g)for(;!0===g.hasChildNodes();){const A=g.firstChild;A&&(mu(A),g.removeChild(A))}}function vu(g){return g instanceof String||"string"==typeof g}function yu(g){return"object"==typeof g&&null!==g}function wu(g,A,C,I){let t=!1;!0===I&&(t=null===A[C]&&void 0!==g[C]),t?delete g[C]:g[C]=A[C]}function xu(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const I in g)if(void 0!==A[I])if(null===A[I]||"object"!=typeof A[I])wu(g,A,I,C);else{const t=g[I],e=A[I];yu(t)&&yu(e)&&xu(t,e,C)}}function Eu(g,A,C){let I=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Wr(C))throw new TypeError("Arrays are not supported by deepExtend");for(let t=0;t3&&void 0!==arguments[3]&&arguments[3];if(Wr(C))throw new TypeError("Arrays are not supported by deepExtend");for(const t in C)if(Object.prototype.hasOwnProperty.call(C,t)&&!yd(g).call(g,t))if(C[t]&&C[t].constructor===Object)void 0===A[t]&&(A[t]={}),A[t].constructor===Object?Tu(A[t],C[t]):wu(A,C,t,I);else if(Wr(C[t])){A[t]=[];for(let g=0;g2&&void 0!==arguments[2]&&arguments[2],I=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(const e in A)if(Object.prototype.hasOwnProperty.call(A,e)||!0===C)if("object"==typeof A[e]&&null!==A[e]&&Od(A[e])===Object.prototype)void 0===g[e]?g[e]=Tu({},A[e],C):"object"==typeof g[e]&&null!==g[e]&&Od(g[e])===Object.prototype?Tu(g[e],A[e],C):wu(g,A,e,I);else if(Wr(A[e])){var t;g[e]=Zr(t=A[e]).call(t)}else wu(g,A,e,I);return g}function Du(g,A){return[...g,A]}function Nu(g){return g.getBoundingClientRect().top}function ku(g,A){if(Wr(g)){const C=g.length;for(let I=0;I3&&void 0!==arguments[3]?arguments[3]:{};const t=function(g){return null!=g},e=function(g){return null!==g&&"object"==typeof g};if(!e(g))throw new Error("Parameter mergeTarget must be an object");if(!e(A))throw new Error("Parameter options must be an object");if(!t(C))throw new Error("Parameter option must have a value");if(!e(I))throw new Error("Parameter globalOptions must be an object");const i=A[C],o=e(I)&&!function(g){for(const A in g)if(Object.prototype.hasOwnProperty.call(g,A))return!1;return!0}(I)?I[C]:void 0,s=o?o.enabled:void 0;if(void 0===i)return;if("boolean"==typeof i)return e(g[C])||(g[C]={}),void(g[C].enabled=i);if(null===i&&!e(g[C])){if(!t(o))return;g[C]=Ph(o)}if(!e(i))return;let n=!0;void 0!==i.enabled?n=i.enabled:void 0!==s&&(n=o.enabled),function(g,A,C){e(g[C])||(g[C]={});const I=A[C],t=g[C];for(const g in I)Object.prototype.hasOwnProperty.call(I,g)&&(t[g]=I[g])}(g,A,C),g[C].enabled=n}const Vu={linear:g=>g,easeInQuad:g=>g*g,easeOutQuad:g=>g*(2-g),easeInOutQuad:g=>g<.5?2*g*g:(4-2*g)*g-1,easeInCubic:g=>g*g*g,easeOutCubic:g=>--g*g*g+1,easeInOutCubic:g=>g<.5?4*g*g*g:(g-1)*(2*g-2)*(2*g-2)+1,easeInQuart:g=>g*g*g*g,easeOutQuart:g=>1- --g*g*g*g,easeInOutQuart:g=>g<.5?8*g*g*g*g:1-8*--g*g*g*g,easeInQuint:g=>g*g*g*g*g,easeOutQuint:g=>1+--g*g*g*g*g,easeInOutQuint:g=>g<.5?16*g*g*g*g*g:1+16*--g*g*g*g*g};function Yu(g,A){let C;Wr(A)||(A=[A]);for(const I of g)if(I){C=I[A[0]];for(let g=1;g0&&void 0!==arguments[0]?arguments[0]:1;this.pixelRatio=g,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(g){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=g,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=g}setCloseCallback(g){if("function"!=typeof g)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=g}_isColorString(g){if("string"==typeof g)return Wu[g]}setColor(g){let A,C=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"===g)return;const I=this._isColorString(g);if(void 0!==I&&(g=I),!0===vu(g)){if(!0===Gu(g)){const C=g.substr(4).substr(0,g.length-5).split(",");A={r:C[0],g:C[1],b:C[2],a:1}}else if(!0===function(g){return bu.test(g)}(g)){const C=g.substr(5).substr(0,g.length-6).split(",");A={r:C[0],g:C[1],b:C[2],a:C[3]}}else if(!0===Fu(g)){const C=Ru(g);A={r:C.r,g:C.g,b:C.b,a:1}}}else if(g instanceof Object&&void 0!==g.r&&void 0!==g.g&&void 0!==g.b){const C=void 0!==g.a?g.a:"1.0";A={r:g.r,g:g.g,b:g.b,a:C}}if(void 0===A)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: "+Zh(g));this._setColor(A,C)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=fI({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",Al((()=>{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(g){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=fI({},g)),this.color=g;const A=Bu(g.r,g.g,g.b),C=2*Math.PI,I=this.r*A.s,t=this.centerCoordinates.x+I*Math.sin(C*A.h),e=this.centerCoordinates.y+I*Math.cos(C*A.h);this.colorPickerSelector.style.left=t-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=e-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(g)}_setOpacity(g){this.color.a=g/100,this._updatePicker(this.color)}_setBrightness(g){const A=Bu(this.color.r,this.color.g,this.color.b);A.v=g/100;const C=Zu(A.h,A.s,A.v);C.a=this.color.a,this.color=C,this._updatePicker()}_updatePicker(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color;const A=Bu(g.r,g.g,g.b),C=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(C.webkitBackingStorePixelRatio||C.mozBackingStorePixelRatio||C.msBackingStorePixelRatio||C.oBackingStorePixelRatio||C.backingStorePixelRatio||1)),C.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const I=this.colorPickerCanvas.clientWidth,t=this.colorPickerCanvas.clientHeight;C.clearRect(0,0,I,t),C.putImageData(this.hueCircle,0,0),C.fillStyle="rgba(0,0,0,"+(1-A.v)+")",C.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),dl(C).call(C),this.brightnessRange.value=100*A.v,this.opacityRange.value=100*g.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(){var g,A,C,I;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 g=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const g=document.createElement("DIV");g.style.color="red",g.style.fontWeight="bold",g.style.padding="10px",g.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(g)}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(g){}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(g){}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=GI(g=this._hide).call(g,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=GI(A=this._apply).call(A,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=GI(C=this._save).call(C,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=GI(I=this._loadLast).call(I,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 lu(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(g=>{g.isFirst&&this._moveSelector(g)})),this.hammer.on("tap",(g=>{this._moveSelector(g)})),this.hammer.on("panstart",(g=>{this._moveSelector(g)})),this.hammer.on("panmove",(g=>{this._moveSelector(g)})),this.hammer.on("panend",(g=>{this._moveSelector(g)}))}_generateHueCircle(){if(!1===this.generated){const g=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)),g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const A=this.colorPickerCanvas.clientWidth,C=this.colorPickerCanvas.clientHeight;let I,t,e,i;g.clearRect(0,0,A,C),this.centerCoordinates={x:.5*A,y:.5*C},this.r=.49*A;const o=2*Math.PI/360,s=1/360,n=1/this.r;let r;for(e=0;e<360;e++)for(i=0;i3&&void 0!==arguments[3]?arguments[3]:1,t=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>!1;this.parent=g,this.changedOptions=[],this.container=A,this.allowCreation=!1,this.hideOption=t,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},fI(this.options,this.defaultOptions),this.configureOptions=C,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Qu(I),this.wrapper=void 0}setOptions(g){if(void 0!==g){this.popupHistory={},this._removePopup();let A=!0;if("string"==typeof g)this.options.filter=g;else if(Wr(g))this.options.filter=g.join();else if("object"==typeof g){if(null==g)throw new TypeError("options cannot be null");void 0!==g.container&&(this.options.container=g.container),void 0!==Gd(g)&&(this.options.filter=Gd(g)),void 0!==g.showButton&&(this.options.showButton=g.showButton),void 0!==g.enabled&&(A=g.enabled)}else"boolean"==typeof g?(this.options.filter=!0,A=g):"function"==typeof g&&(this.options.filter=g,A=!0);!1===Gd(this.options)&&(A=!1),this.options.enabled=A}this._clean()}setModuleOptions(g){this.moduleOptions=g,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const g=Gd(this.options);let A=0,C=!1;for(const I in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,I)&&(this.allowCreation=!1,C=!1,"function"==typeof g?(C=g(I,[]),C=C||this._handleObject(this.configureOptions[I],[I],!0)):!0!==g&&-1===kh(g).call(g,I)||(C=!0),!1!==C&&(this.allowCreation=!0,A>0&&this._makeItem([]),this._makeHeader(I),this._handleObject(this.configureOptions[I],[I])),A++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let g=0;g1?A-1:0),I=1;I{t.appendChild(g)})),this.domElements.push(t),this.domElements.length}return 0}_makeHeader(g){const A=document.createElement("div");A.className="vis-configuration vis-config-header",A.innerText=g,this._makeItem([],A)}_makeLabel(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const I=document.createElement("div");if(I.className="vis-configuration vis-config-label vis-config-s"+A.length,!0===C){for(;I.firstChild;)I.removeChild(I.firstChild);I.appendChild(Uu("i","b",g))}else I.innerText=g+":";return I}_makeDropdown(g,A,C){const I=document.createElement("select");I.className="vis-configuration vis-config-select";let t=0;void 0!==A&&-1!==kh(g).call(g,A)&&(t=kh(g).call(g,A));for(let A=0;Ae&&1!==e&&(o.max=Math.ceil(A*g),n=o.max,s="range increased"),o.value=A}else o.value=I;const r=document.createElement("input");r.className="vis-configuration vis-config-rangeinput",r.value=o.value;const a=this;o.onchange=function(){r.value=this.value,a._update(Number(this.value),C)},o.oninput=function(){r.value=this.value};const d=this._makeLabel(C[C.length-1],C),h=this._makeItem(C,d,o,r);""!==s&&this.popupHistory[h]!==n&&(this.popupHistory[h]=n,this._setupPopup(s,h))}_makeButton(){if(!0===this.options.showButton){const g=document.createElement("div");g.className="vis-configuration vis-config-button",g.innerText="generate options",g.onclick=()=>{this._printOptions()},g.onmouseover=()=>{g.className="vis-configuration vis-config-button hover"},g.onmouseout=()=>{g.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(g)}}_setupPopup(g,A){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:C,index:A}}}_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 g=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=g.left+"px",this.popupDiv.html.style.top=g.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=Al((()=>{this.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=Al((()=>{this._removePopup()}),1800)}}_makeCheckbox(g,A,C){const I=document.createElement("input");I.type="checkbox",I.className="vis-configuration vis-config-checkbox",I.checked=g,void 0!==A&&(I.checked=A,A!==g&&("object"==typeof g?A!==g.enabled&&this.changedOptions.push({path:C,value:A}):this.changedOptions.push({path:C,value:A})));const t=this;I.onchange=function(){t._update(this.checked,C)};const e=this._makeLabel(C[C.length-1],C);this._makeItem(C,e,I)}_makeTextInput(g,A,C){const I=document.createElement("input");I.type="text",I.className="vis-configuration vis-config-text",I.value=A,A!==g&&this.changedOptions.push({path:C,value:A});const t=this;I.onchange=function(){t._update(this.value,C)};const e=this._makeLabel(C[C.length-1],C);this._makeItem(C,e,I)}_makeColorField(g,A,C){const I=g[1],t=document.createElement("div");"none"!==(A=void 0===A?I:A)?(t.className="vis-configuration vis-config-colorBlock",t.style.backgroundColor=A):t.className="vis-configuration vis-config-colorBlock none",A=void 0===A?I:A,t.onclick=()=>{this._showColorPicker(A,t,C)};const e=this._makeLabel(C[C.length-1],C);this._makeItem(C,e,t)}_showColorPicker(g,A,C){A.onclick=function(){},this.colorPicker.insertTo(A),this.colorPicker.show(),this.colorPicker.setColor(g),this.colorPicker.setUpdateCallback((g=>{const I="rgba("+g.r+","+g.g+","+g.b+","+g.a+")";A.style.backgroundColor=I,this._update(I,C)})),this.colorPicker.setCloseCallback((()=>{A.onclick=()=>{this._showColorPicker(g,A,C)}}))}_handleObject(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],C=arguments.length>2&&void 0!==arguments[2]&&arguments[2],I=!1;const t=Gd(this.options);let e=!1;for(const i in g)if(Object.prototype.hasOwnProperty.call(g,i)){I=!0;const o=g[i],s=Du(A,i);if("function"==typeof t&&(I=t(i,A),!1===I&&!Wr(o)&&"string"!=typeof o&&"boolean"!=typeof o&&o instanceof Object&&(this.allowCreation=!1,I=this._handleObject(o,s,!0),this.allowCreation=!1===C)),!1!==I){e=!0;const g=this._getValue(s);if(Wr(o))this._handleArray(o,g,s);else if("string"==typeof o)this._makeTextInput(o,g,s);else if("boolean"==typeof o)this._makeCheckbox(o,g,s);else if(o instanceof Object){if(!this.hideOption(A,i,this.moduleOptions))if(void 0!==o.enabled){const g=Du(s,"enabled"),A=this._getValue(g);if(!0===A){const g=this._makeLabel(i,s,!0);this._makeItem(s,g),e=this._handleObject(o,s)||e}else this._makeCheckbox(o,A,s)}else{const g=this._makeLabel(i,s,!0);this._makeItem(s,g),e=this._handleObject(o,s)||e}}else console.error("dont know how to handle",o,i,s)}}return e}_handleArray(g,A,C){"string"==typeof g[0]&&"color"===g[0]?(this._makeColorField(g,A,C),g[1]!==A&&this.changedOptions.push({path:C,value:A})):"string"==typeof g[0]?(this._makeDropdown(g,A,C),g[0]!==A&&this.changedOptions.push({path:C,value:A})):"number"==typeof g[0]&&(this._makeRange(g,A,C),g[0]!==A&&this.changedOptions.push({path:C,value:Number(A)}))}_update(g,A){const C=this._constructOptions(g,A);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",C),this.initialized=!0,this.parent.setOptions(C)}_constructOptions(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},I=C;g="false"!==(g="true"===g||g)&&g;for(let C=0;CI-this.padding&&(C=!0),t=C?this.x-A:this.x,e=i?this.y-g:this.y}else e=this.y-g,e+g+this.padding>C&&(e=C-g-this.padding),eI&&(t=I-A-this.padding),te.distance?" in "+g.printLocation(t.path,A,"")+"Perhaps it was misplaced? Matching option found at: "+g.printLocation(e.path,e.closestMatch,""):t.distance<=8?'. Did you mean "'+t.closestMatch+'"?'+g.printLocation(t.path,A):". Did you mean one of these: "+g.print(ga(C))+g.printLocation(I,A),console.error('%cUnknown option detected: "'+A+'"'+i,Xu),Hu=!0}static findInOptions(A,C,I){let t=arguments.length>3&&void 0!==arguments[3]&&arguments[3],e=1e9,i="",o=[];const s=A.toLowerCase();let n;for(const d in C){let h;if(void 0!==C[d].__type__&&!0===t){const t=g.findInOptions(A,C[d],Du(I,d));e>t.distance&&(i=t.closestMatch,o=t.path,e=t.distance,n=t.indexMatch)}else{var r;-1!==kh(r=d.toLowerCase()).call(r,s)&&(n=d),h=g.levenshteinDistance(A,d),e>h&&(i=d,o=Zr(a=I).call(a),e=h)}}var a;return{closestMatch:i,path:o,distance:e,indexMatch:n}}static printLocation(g,A){let C="\n\n"+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n")+"options = {\n";for(let A=0;A":!0,"--":!0},op="",sp=0,np="",rp="",ap=ep.NULL;function dp(){sp++,np=op.charAt(sp)}function hp(){return op.charAt(sp+1)}function lp(g){var A=g.charCodeAt(0);return A<47?35===A||46===A:A<59?A>47:A<91?A>64:A<96?95===A:A<123&&A>96}function cp(g,A){if(g||(g={}),A)for(var C in A)A.hasOwnProperty(C)&&(g[C]=A[C]);return g}function up(g,A,C){for(var I=A.split("."),t=g;I.length;){var e=I.shift();I.length?(t[e]||(t[e]={}),t=t[e]):t[e]=C}}function pp(g,A){for(var C,I,t=null,e=[g],i=g;i.parent;)e.push(i.parent),i=i.parent;if(i.nodes)for(C=0,I=i.nodes.length;C=0;C--){var o,s=e[C];s.nodes||(s.nodes=[]),-1===kh(o=s.nodes).call(o,t)&&s.nodes.push(t)}A.attr&&(t.attr=cp(t.attr,A.attr))}function fp(g,A){if(g.edges||(g.edges=[]),g.edges.push(A),g.edge){var C=cp({},g.edge);A.attr=cp(C,A.attr)}}function bp(g,A,C,I,t){var e={from:A,to:C,type:I};return g.edge&&(e.attr=cp({},g.edge)),e.attr=cp(e.attr||{},t),null!=t&&t.hasOwnProperty("arrows")&&null!=t.arrows&&(e.arrows={to:{enabled:!0,type:t.arrows.type}},t.arrows=null),e}function mp(){for(ap=ep.NULL,rp="";" "===np||"\t"===np||"\n"===np||"\r"===np;)dp();do{var g=!1;if("#"===np){for(var A=sp-1;" "===op.charAt(A)||"\t"===op.charAt(A);)A--;if("\n"===op.charAt(A)||""===op.charAt(A)){for(;""!=np&&"\n"!=np;)dp();g=!0}}if("/"===np&&"/"===hp()){for(;""!=np&&"\n"!=np;)dp();g=!0}if("/"===np&&"*"===hp()){for(;""!=np;){if("*"===np&&"/"===hp()){dp(),dp();break}dp()}g=!0}for(;" "===np||"\t"===np||"\n"===np||"\r"===np;)dp()}while(g);if(""!==np){var C=np+hp();if(ip[C])return ap=ep.DELIMITER,rp=C,dp(),void dp();if(ip[np])return ap=ep.DELIMITER,rp=np,void dp();if(lp(np)||"-"===np){for(rp+=np,dp();lp(np);)rp+=np,dp();return"false"===rp?rp=!1:"true"===rp?rp=!0:isNaN(Number(rp))||(rp=Number(rp)),void(ap=ep.IDENTIFIER)}if('"'===np){for(dp();""!=np&&('"'!=np||'"'===np&&'"'===hp());)'"'===np?(rp+=np,dp()):"\\"===np&&"n"===hp()?(rp+="\n",dp()):rp+=np,dp();if('"'!=np)throw Op('End of string " expected');return dp(),void(ap=ep.IDENTIFIER)}for(ap=ep.UNKNOWN;""!=np;)rp+=np,dp();throw new SyntaxError('Syntax error in part "'+Tp(rp,30)+'"')}ap=ep.DELIMITER}function vp(g){for(;""!==rp&&"}"!=rp;)yp(g),";"===rp&&mp()}function yp(g){var A=wp(g);if(A)xp(g,A);else{var C=function(g){if("node"===rp)return mp(),g.node=Ep(),"node";if("edge"===rp)return mp(),g.edge=Ep(),"edge";if("graph"===rp)return mp(),g.graph=Ep(),"graph";return null}(g);if(!C){if(ap!=ep.IDENTIFIER)throw Op("Identifier expected");var I=rp;if(mp(),"="===rp){if(mp(),ap!=ep.IDENTIFIER)throw Op("Identifier expected");g[I]=rp,mp()}else!function(g,A){var C={id:A},I=Ep();I&&(C.attr=I);pp(g,C),xp(g,A)}(g,I)}}}function wp(g){var A=null;if("subgraph"===rp&&((A={}).type="subgraph",mp(),ap===ep.IDENTIFIER&&(A.id=rp,mp())),"{"===rp){if(mp(),A||(A={}),A.parent=g,A.node=g.node,A.edge=g.edge,A.graph=g.graph,vp(A),"}"!=rp)throw Op("Angle bracket } expected");mp(),delete A.node,delete A.edge,delete A.graph,delete A.parent,g.subgraphs||(g.subgraphs=[]),g.subgraphs.push(A)}return A}function xp(g,A){for(;"->"===rp||"--"===rp;){var C,I=rp;mp();var t=wp(g);if(t)C=t;else{if(ap!=ep.IDENTIFIER)throw Op("Identifier or subgraph expected");pp(g,{id:C=rp}),mp()}fp(g,bp(g,A,C,I,Ep())),A=C}}function Ep(){for(var g,A,C=null,I={dashed:!0,solid:!1,dotted:[1,5]},t={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},e=new Array,i=new Array;"["===rp;){for(mp(),C={};""!==rp&&"]"!=rp;){if(ap!=ep.IDENTIFIER)throw Op("Attribute name expected");var o=rp;if(mp(),"="!=rp)throw Op("Equal sign = expected");if(mp(),ap!=ep.IDENTIFIER)throw Op("Attribute value expected");var s=rp;"style"===o&&(s=I[s]),"arrowhead"===o&&(o="arrows",s={to:{enabled:!0,type:t[s]}}),"arrowtail"===o&&(o="arrows",s={from:{enabled:!0,type:t[s]}}),e.push({attr:C,name:o,value:s}),i.push(o),mp(),","==rp&&mp()}if("]"!=rp)throw Op("Bracket ] expected");mp()}if(yd(i).call(i,"dir")){var n={arrows:{}};for(g=0;g"===g.type&&(A.arrows="to"),A};pa(t=C.edges).call(t,(function(g){var A,C,t,i,o,s,n;(A=g.from instanceof Object?g.from.nodes:{id:g.from},C=g.to instanceof Object?g.to.nodes:{id:g.to},g.from instanceof Object&&g.from.edges)&&pa(t=g.from.edges).call(t,(function(g){var A=e(g);I.edges.push(A)}));(o=C,s=function(A,C){var t=bp(I,A.id,C.id,g.type,g.attr),i=e(t);I.edges.push(i)},Wr(i=A)?pa(i).call(i,(function(g){Wr(o)?pa(o).call(o,(function(A){s(g,A)})):s(g,o)})):Wr(o)?pa(o).call(o,(function(g){s(i,g)})):s(i,o),g.to instanceof Object&&g.to.edges)&&pa(n=g.to.edges).call(n,(function(g){var A=e(g);I.edges.push(A)}))}))}return C.attr&&(I.options=C.attr),I}var Rp=Object.freeze({__proto__:null,DOTToGraph:kp,parseDOT:Cp});function Pp(g,A){var C;const I={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=A&&(null!=A.fixed&&(I.nodes.fixed=A.fixed),null!=A.parseColor&&(I.nodes.parseColor=A.parseColor),null!=A.inheritColor&&(I.edges.inheritColor=A.inheritColor));const t=g.edges,e=Jr(t).call(t,(g=>{const A={from:g.source,id:g.id,to:g.target};return null!=g.attributes&&(A.attributes=g.attributes),null!=g.label&&(A.label=g.label),null!=g.attributes&&null!=g.attributes.title&&(A.title=g.attributes.title),"Directed"===g.type&&(A.arrows="to"),g.color&&!1===I.edges.inheritColor&&(A.color=g.color),A}));return{nodes:Jr(C=g.nodes).call(C,(g=>{const A={id:g.id,fixed:I.nodes.fixed&&null!=g.x&&null!=g.y};return null!=g.attributes&&(A.attributes=g.attributes),null!=g.label&&(A.label=g.label),null!=g.size&&(A.size=g.size),null!=g.attributes&&null!=g.attributes.title&&(A.title=g.attributes.title),null!=g.title&&(A.title=g.title),null!=g.x&&(A.x=g.x),null!=g.y&&(A.y=g.y),null!=g.color&&(!0===I.nodes.parseColor?A.color=g.color:A.color={background:g.color,border:g.color,highlight:{background:g.color,border:g.color},hover:{background:g.color,border:g.color}}),A})),edges:e}}var Mp=Object.freeze({__proto__:null,parseGephi:Pp});var zp=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});class Bp{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const g=this.image.width,A=this.image.height;this.width=g,this.height=A;const C=Math.floor(A/2),I=Math.floor(A/4),t=Math.floor(A/8),e=Math.floor(A/16),i=Math.floor(g/2),o=Math.floor(g/4),s=Math.floor(g/8),n=Math.floor(g/16);this.canvas.width=3*o,this.canvas.height=C,this.coordinates=[[0,0,i,C],[i,0,o,I],[i,I,s,t],[5*s,I,n,e]],this._fillMipMap()}initialized(){return void 0!==this.coordinates}_fillMipMap(){const g=this.canvas.getContext("2d"),A=this.coordinates[0];g.drawImage(this.image,A[0],A[1],A[2],A[3]);for(let A=1;A2){A*=.5;let i=0;for(;A>2&&i=this.NUM_ITERATIONS&&(i=this.NUM_ITERATIONS-1);const o=this.coordinates[i];g.drawImage(this.canvas,o[0],o[1],o[2],o[3],C,I,t,e)}else g.drawImage(this.image,C,I,t,e)}}class Zp{constructor(g){this.images={},this.imageBroken={},this.callback=g}_tryloadBrokenUrl(g,A,C){void 0!==g&&void 0!==C&&(void 0!==A?(C.image.onerror=()=>{console.error("Could not load brokenImage:",A)},C.image.src=A):console.warn("No broken url image defined"))}_redrawWithImage(g){this.callback&&this.callback(g)}load(g,A){const C=this.images[g];if(C)return C;const I=new Bp;return this.images[g]=I,I.image.onload=()=>{this._fixImageCoordinates(I.image),I.init(),this._redrawWithImage(I)},I.image.onerror=()=>{console.error("Could not load image:",g),this._tryloadBrokenUrl(g,A,I)},I.image.src=g,I}_fixImageCoordinates(g){0===g.width&&(document.body.appendChild(g),g.width=g.offsetWidth,g.height=g.offsetHeight,document.body.removeChild(g))}}var Sp={exports:{}},Fp=e((function(){if("function"==typeof ArrayBuffer){var g=new ArrayBuffer(8);Object.isExtensible(g)&&Object.defineProperty(g,"a",{value:8})}})),Gp=e,Lp=gg,jp=m,Vp=Fp,Yp=Object.isExtensible,Wp=Gp((function(){Yp(1)}))||Vp?function(g){return!!Lp(g)&&((!Vp||"ArrayBuffer"!==jp(g))&&(!Yp||Yp(g)))}:Yp,Qp=!e((function(){return Object.isExtensible(Object.preventExtensions({}))})),Up=DC,Kp=u,Hp=UC,Xp=gg,_p=qg,Jp=JA.f,qp=ke,$p=Me,gf=Wp,Af=Qp,Cf=!1,If=IA("meta"),tf=0,ef=function(g){Jp(g,If,{value:{objectID:"O"+tf++,weakData:{}}})},of=Sp.exports={enable:function(){of.enable=function(){},Cf=!0;var g=qp.f,A=Kp([].splice),C={};C[If]=1,g(C).length&&(qp.f=function(C){for(var I=g(C),t=0,e=I.length;te;e++)if((o=p(g[e]))&&zf(Lf,o))return o;return new Gf(!1)}I=Bf(g,t)}for(s=d?g.next:I.next;!(n=Nf(s,I)).done;){try{o=p(n.value)}catch(g){Sf(I,"throw",g)}if("object"==typeof o&&o&&zf(Lf,o))return o}return new Gf(!1)},Vf=og,Yf=TypeError,Wf=function(g,A){if(Vf(A,g))return g;throw new Yf("Incorrect invocation")},Qf=DC,Uf=t,Kf=sf,Hf=e,Xf=uC,_f=jf,Jf=Wf,qf=T,$f=gg,gb=Q,Ab=fi,Cb=JA.f,Ib=Yi.forEach,tb=N,eb=Bi.set,ib=Bi.getterFor,ob=function(g,A,C){var I,t=-1!==g.indexOf("Map"),e=-1!==g.indexOf("Weak"),i=t?"set":"add",o=Uf[g],s=o&&o.prototype,n={};if(tb&&qf(o)&&(e||s.forEach&&!Hf((function(){(new o).entries().next()})))){var r=(I=A((function(A,C){eb(Jf(A,r),{type:g,collection:new o}),gb(C)||_f(C,A[i],{that:A,AS_ENTRIES:t})}))).prototype,a=ib(g);Ib(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(g){var A="add"===g||"set"===g;!(g in s)||e&&"clear"===g||Xf(r,g,(function(C,I){var t=a(this).collection;if(!A&&e&&!$f(C))return"get"===g&&void 0;var i=t[g](0===C?0:C,I);return A?this:i}))})),e||Cb(r,"size",{configurable:!0,get:function(){return a(this).collection.size}})}else I=C.getConstructor(A,g,t,i),Kf.enable();return Ab(I,g,!1,!0),n[g]=I,Qf({global:!0,forced:!0},n),e||C.setStrong(I,g,t),I},sb=Ue,nb=function(g,A,C){for(var I in A)C&&C.unsafe&&g[I]?g[I]=A[I]:sb(g,I,A[I],C);return g},rb=ig,ab=He,db=N,hb=dA("species"),lb=Ne,cb=He,ub=nb,pb=_A,fb=Wf,bb=Q,mb=jf,vb=_n,yb=Jn,wb=function(g){var A=rb(g);db&&A&&!A[hb]&&ab(A,hb,{configurable:!0,get:function(){return this}})},xb=N,Eb=sf.fastKey,Ob=Bi.set,Tb=Bi.getterFor,Db={getConstructor:function(g,A,C,I){var t=g((function(g,t){fb(g,e),Ob(g,{type:A,index:lb(null),first:void 0,last:void 0,size:0}),xb||(g.size=0),bb(t)||mb(t,g[I],{that:g,AS_ENTRIES:C})})),e=t.prototype,i=Tb(A),o=function(g,A,C){var I,t,e=i(g),o=s(g,A);return o?o.value=C:(e.last=o={index:t=Eb(A,!0),key:A,value:C,previous:I=e.last,next:void 0,removed:!1},e.first||(e.first=o),I&&(I.next=o),xb?e.size++:g.size++,"F"!==t&&(e.index[t]=o)),g},s=function(g,A){var C,I=i(g),t=Eb(A);if("F"!==t)return I.index[t];for(C=I.first;C;C=C.next)if(C.key===A)return C};return ub(e,{clear:function(){for(var g=i(this),A=g.index,C=g.first;C;)C.removed=!0,C.previous&&(C.previous=C.previous.next=void 0),delete A[C.index],C=C.next;g.first=g.last=void 0,xb?g.size=0:this.size=0},delete:function(g){var A=this,C=i(A),I=s(A,g);if(I){var t=I.next,e=I.previous;delete C.index[I.index],I.removed=!0,e&&(e.next=t),t&&(t.previous=e),C.first===I&&(C.first=t),C.last===I&&(C.last=e),xb?C.size--:A.size--}return!!I},forEach:function(g){for(var A,C=i(this),I=pb(g,arguments.length>1?arguments[1]:void 0);A=A?A.next:C.first;)for(I(A.value,A.key,this);A&&A.removed;)A=A.previous},has:function(g){return!!s(this,g)}}),ub(e,C?{get:function(g){var A=s(this,g);return A&&A.value},set:function(g,A){return o(this,0===g?0:g,A)}}:{add:function(g){return o(this,g=0===g?0:g,g)}}),xb&&cb(e,"size",{configurable:!0,get:function(){return i(this).size}}),t},setStrong:function(g,A,C){var I=A+" Iterator",t=Tb(A),e=Tb(I);vb(g,A,(function(g,A){Ob(this,{type:I,target:g,state:t(g),kind:A,last:void 0})}),(function(){for(var g=e(this),A=g.kind,C=g.last;C&&C.removed;)C=C.previous;return g.target&&(g.last=C=C?C.next:g.state.first)?yb("keys"===A?C.key:"values"===A?C.value:[C.key,C.value],!1):(g.target=void 0,yb(void 0,!0))}),C?"entries":"values",!C,!0),wb(A)}};ob("Map",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Db);var Nb=u,kb=PC,Rb=Ie,Pb=H,Mb=Nb("".charAt),zb=Nb("".charCodeAt),Bb=Nb("".slice),Zb=function(g){return function(A,C){var I,t,e=Rb(Pb(A)),i=kb(C),o=e.length;return i<0||i>=o?g?"":void 0:(I=zb(e,i))<55296||I>56319||i+1===o||(t=zb(e,i+1))<56320||t>57343?g?Mb(e,i):I:g?Bb(e,i,i+2):t-56320+(I-55296<<10)+65536}},Sb={codeAt:Zb(!1),charAt:Zb(!0)}.charAt,Fb=Ie,Gb=Bi,Lb=_n,jb=Jn,Vb="String Iterator",Yb=Gb.set,Wb=Gb.getterFor(Vb);Lb(String,"String",(function(g){Yb(this,{type:Vb,string:Fb(g),index:0})}),(function(){var g,A=Wb(this),C=A.string,I=A.index;return I>=C.length?jb(void 0,!0):(g=Sb(C,I),A.index+=g.length,jb(g,!1))}));var Qb=C(Ag.Map);class Ub{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},fI(this.options,this.defaultOptions)}setOptions(g){const A=["useDefaultGroups"];if(void 0!==g)for(const C in g)if(Object.prototype.hasOwnProperty.call(g,C)&&-1===kh(A).call(A,C)){const A=g[C];this.add(C,A)}}clear(){this._groups=new Qb,this._groupNames=[]}get(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],C=this._groups.get(g);if(void 0===C&&A)if(!1===this.options.useDefaultGroups&&this._groupNames.length>0){const A=this._groupIndex%this._groupNames.length;++this._groupIndex,C={},C.color=this._groups.get(this._groupNames[A]),this._groups.set(g,C)}else{const A=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,C={},C.color=this._defaultGroups[A],this._groups.set(g,C)}return C}add(g,A){return this._groups.has(g)||this._groupNames.push(g),this._groups.set(g,A),A}}DC({target:"Number",stat:!0},{isNaN:function(g){return g!=g}});var Kb=C(Ag.Number.isNaN),Hb=t.isFinite,Xb=Number.isFinite||function(g){return"number"==typeof g&&Hb(g)};DC({target:"Number",stat:!0},{isFinite:Xb});var _b=C(Ag.Number.isFinite),Jb=Yi.some;DC({target:"Array",proto:!0,forced:!ia("some")},{some:function(g){return Jb(this,g,arguments.length>1?arguments[1]:void 0)}});var qb=MI("Array").some,$b=og,gm=qb,Am=Array.prototype,Cm=function(g){var A=g.some;return g===Am||$b(Am,g)&&A===Am.some?gm:A},Im=C(Cm),tm=C(Ag.Object.getOwnPropertySymbols),em={exports:{}},im=DC,om=e,sm=J,nm=D.f,rm=N;im({target:"Object",stat:!0,forced:!rm||om((function(){nm(1)})),sham:!rm},{getOwnPropertyDescriptor:function(g,A){return nm(sm(g),A)}});var am=Ag.Object,dm=em.exports=function(g,A){return am.getOwnPropertyDescriptor(g,A)};am.getOwnPropertyDescriptor.sham&&(dm.sham=!0);var hm=C(em.exports),lm=Vr,cm=J,um=D,pm=Ct;DC({target:"Object",stat:!0,sham:!N},{getOwnPropertyDescriptors:function(g){for(var A,C,I=cm(g),t=um.f,e=lm(I),i={},o=0;e.length>o;)void 0!==(C=t(I,A=e[o++]))&&pm(i,A,C);return i}});var fm=C(Ag.Object.getOwnPropertyDescriptors),bm={exports:{}},mm=DC,vm=N,ym=te.f;mm({target:"Object",stat:!0,forced:Object.defineProperties!==ym,sham:!vm},{defineProperties:ym});var wm=Ag.Object,xm=bm.exports=function(g,A){return wm.defineProperties(g,A)};wm.defineProperties.sham&&(xm.sham=!0);var Em=C(bm.exports),Om={exports:{}},Tm=DC,Dm=N,Nm=JA.f;Tm({target:"Object",stat:!0,forced:Object.defineProperty!==Nm,sham:!Dm},{defineProperty:Nm});var km=Ag.Object,Rm=Om.exports=function(g,A,C){return km.defineProperty(g,A,C)};km.defineProperty.sham&&(Rm.sham=!0);var Pm=Om.exports,Mm=C(Pm),zm=dA,Bm=JA.f,Zm=zm("metadata"),Sm=Function.prototype;void 0===Sm[Zm]&&Bm(Sm,Zm,{value:null}),ti("asyncDispose"),ti("dispose"),ti("metadata");var Fm=cr,Gm=u,Lm=ig("Symbol"),jm=Lm.keyFor,Vm=Gm(Lm.prototype.valueOf),Ym=Lm.isRegisteredSymbol||function(g){try{return void 0!==jm(Vm(g))}catch(g){return!1}};DC({target:"Symbol",stat:!0},{isRegisteredSymbol:Ym});for(var Wm=Ug,Qm=ig,Um=u,Km=Eg,Hm=dA,Xm=Qm("Symbol"),_m=Xm.isWellKnownSymbol,Jm=Qm("Object","getOwnPropertyNames"),qm=Um(Xm.prototype.valueOf),$m=Wm("wks"),gv=0,Av=Jm(Xm),Cv=Av.length;gv=0:o>s;s+=n)s in i&&(t=C(t,i[s],s,e));return t}},fv={left:pv(!1),right:pv(!0)},bv="process"===m(t.process),mv=fv.left;DC({target:"Array",proto:!0,forced:!bv&&cg>79&&cg<83||!ia("reduce")},{reduce:function(g){var A=arguments.length;return mv(this,g,A,A>1?arguments[1]:void 0)}});var vv=MI("Array").reduce,yv=og,wv=vv,xv=Array.prototype,Ev=function(g){var A=g.reduce;return g===xv||yv(xv,g)&&A===xv.reduce?wv:A},Ov=C(Ev),Tv=_I,Dv=LC,Nv=qI,kv=_A,Rv=function(g,A,C,I,t,e,i,o){for(var s,n,r=t,a=0,d=!!i&&kv(i,o);a0&&Tv(s)?(n=Dv(s),r=Rv(g,A,s,n,r,e-1)-1):(Nv(r+1),g[r]=s),r++),a++;return r},Pv=Rv,Mv=Rg,zv=Xg,Bv=LC,Zv=Zt;DC({target:"Array",proto:!0},{flatMap:function(g){var A,C=zv(this),I=Bv(C);return Mv(g),(A=Zv(C,0)).length=Pv(A,C,C,I,0,1,g,arguments.length>1?arguments[1]:void 0),A}});var Sv=MI("Array").flatMap,Fv=og,Gv=Sv,Lv=Array.prototype,jv=function(g){var A=g.flatMap;return g===Lv||Fv(Lv,g)&&A===Lv.flatMap?Gv:A},Vv=C(jv),Yv=C(iv);ob("Set",(function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}}),Db);var Wv=C(Ag.Set),Qv=C(xf),Uv=Ge,Kv=Math.floor,Hv=function(g,A){var C=g.length,I=Kv(C/2);return C<8?Xv(g,A):_v(g,Hv(Uv(g,0,I),A),Hv(Uv(g,I),A),A)},Xv=function(g,A){for(var C,I,t=g.length,e=1;e0;)g[I]=g[--I];I!==e++&&(g[I]=C)}return g},_v=function(g,A,C,I){for(var t=A.length,e=C.length,i=0,o=0;i3)){if(ly)return!0;if(uy)return uy<603;var g,A,C,I,t="";for(g=65;g<76;g++){switch(A=String.fromCharCode(g),g){case 66:case 69:case 70:case 72:C=3;break;case 68:case 71:C=4;break;default:C=2}for(I=0;I<47;I++)py.push({k:A+I,v:C})}for(py.sort((function(g,A){return A.v-g.v})),I=0;Iny(C)?1:-1}}(g)),C=oy(t),I=0;IA(g)),g)}_add(g,A){null!=A&&this._target.add(this._transformItems(this._source.get(A.items)))}_update(g,A){null!=A&&this._target.update(this._transformItems(this._source.get(A.items)))}_remove(g,A){null!=A&&this._target.remove(this._transformItems(A.oldData))}}class hw{constructor(g){av(this,"_source",void 0),av(this,"_transformers",[]),this._source=g}filter(g){return this._transformers.push((A=>Gd(A).call(A,g))),this}map(g){return this._transformers.push((A=>Jr(A).call(A,g))),this}flatMap(g){return this._transformers.push((A=>Vv(A).call(A,g))),this}to(g){return new dw(this._source,this._transformers,g)}}function lw(g){return"string"==typeof g||"number"==typeof g}class cw{constructor(g){av(this,"delay",void 0),av(this,"max",void 0),av(this,"_queue",[]),av(this,"_timeout",null),av(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(g)}setOptions(g){g&&void 0!==g.delay&&(this.delay=g.delay),g&&void 0!==g.max&&(this.max=g.max),this._flushIfNeeded()}static extend(g,A){const C=new cw(A);if(void 0!==g.flush)throw new Error("Target object already has a property flush");g.flush=()=>{C.flush()};const I=[{name:"flush",original:void 0}];if(A&&A.replace)for(let t=0;tthis.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=Al((()=>{this.flush()}),this.delay))}flush(){var g,A;pa(g=gd(A=this._queue).call(A,0)).call(g,(g=>{g.fn.apply(g.context||g.fn,g.args||[])}))}}class uw{constructor(){av(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),av(this,"subscribe",uw.prototype.on),av(this,"unsubscribe",uw.prototype.off)}_trigger(g,A,C){var I;if("*"===g)throw new Error("Cannot trigger event *");pa(I=[...this._subscribers[g],...this._subscribers["*"]]).call(I,(I=>{I(g,A,null!=C?C:null)}))}on(g,A){"function"==typeof A&&this._subscribers[g].push(A)}off(g,A){var C;this._subscribers[g]=Gd(C=this._subscribers[g]).call(C,(g=>g!==A))}}class pw{constructor(g){av(this,"_pairs",void 0),this._pairs=g}*[Yv](){for(const[g,A]of this._pairs)yield[g,A]}*entries(){for(const[g,A]of this._pairs)yield[g,A]}*keys(){for(const[g]of this._pairs)yield g}*values(){for(const[,g]of this._pairs)yield g}toIdArray(){var g;return Jr(g=[...this._pairs]).call(g,(g=>g[0]))}toItemArray(){var g;return Jr(g=[...this._pairs]).call(g,(g=>g[1]))}toEntryArray(){return[...this._pairs]}toObjectMap(){const g=Ph(null);for(const[A,C]of this._pairs)g[A]=C;return g}toMap(){return new Qb(this._pairs)}toIdSet(){return new Wv(this.toIdArray())}toItemSet(){return new Wv(this.toItemArray())}cache(){return new pw([...this._pairs])}distinct(g){const A=new Wv;for(const[C,I]of this._pairs)A.add(g(I,C));return A}filter(g){const A=this._pairs;return new pw({*[Yv](){for(const[C,I]of A)g(I,C)&&(yield[C,I])}})}forEach(g){for(const[A,C]of this._pairs)g(C,A)}map(g){const A=this._pairs;return new pw({*[Yv](){for(const[C,I]of A)yield[C,g(I,C)]}})}max(g){const A=Qv(this._pairs);let C=A.next();if(C.done)return null;let I=C.value[1],t=g(C.value[1],C.value[0]);for(;!(C=A.next()).done;){const[A,e]=C.value,i=g(e,A);i>t&&(t=i,I=e)}return I}min(g){const A=Qv(this._pairs);let C=A.next();if(C.done)return null;let I=C.value[1],t=g(C.value[1],C.value[0]);for(;!(C=A.next()).done;){const[A,e]=C.value,i=g(e,A);i{var A;return Qv(Ny(A=[...this._pairs]).call(A,((A,C)=>{let[I,t]=A,[e,i]=C;return g(t,i,I,e)})))}})}}class fw extends uw{get idProp(){return this._idProp}constructor(g,A){super(),av(this,"flush",void 0),av(this,"length",void 0),av(this,"_options",void 0),av(this,"_data",void 0),av(this,"_idProp",void 0),av(this,"_queue",null),g&&!Wr(g)&&(A=g,g=[]),this._options=A||{},this._data=new Qb,this.length=0,this._idProp=this._options.fieldId||"id",g&&g.length&&this.add(g),this.setOptions(A)}setOptions(g){g&&void 0!==g.queue&&(!1===g.queue?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=cw.extend(this,{replace:["add","update","remove"]})),g.queue&&"object"==typeof g.queue&&this._queue.setOptions(g.queue)))}add(g,A){const C=[];let I;if(Wr(g)){const A=Jr(g).call(g,(g=>g[this._idProp]));if(Im(A).call(A,(g=>this._data.has(g))))throw new Error("A duplicate id was found in the parameter array.");for(let A=0,t=g.length;A{const A=g[i];if(null!=A&&this._data.has(A)){const C=g,i=fI({},this._data.get(A)),o=this._updateItem(C);I.push(o),e.push(C),t.push(i)}else{const A=this._addItem(g);C.push(A)}};if(Wr(g))for(let A=0,C=g.length;A{const A=this._data.get(g[this._idProp]);if(null==A)throw new Error("Updating non-existent items is not allowed.");return{oldData:A,update:g}}))).call(C,(g=>{let{oldData:A,update:C}=g;const I=A[this._idProp],t=function(g){for(var A=arguments.length,C=new Array(A>1?A-1:0),I=1;Ig.id)),oldData:Jr(I).call(I,(g=>g.oldData)),data:Jr(I).call(I,(g=>g.updatedData))};return this._trigger("update",g,A),g.items}return[]}get(g,A){let C,I,t;lw(g)?(C=g,t=A):Wr(g)?(I=g,t=A):t=g;const e=t&&"Object"===t.returnType?"Object":"Array",i=t&&Gd(t),o=[];let s,n,r;if(null!=C)s=this._data.get(C),s&&i&&!i(s)&&(s=void 0);else if(null!=I)for(let g=0,A=I.length;g(A[C]=g[C],A)),{}):g}_sort(g,A){if("string"==typeof A){const C=A;Ny(g).call(g,((g,A)=>{const I=g[C],t=A[C];return I>t?1:IC)&&(A=t,C=e)}return A||null}min(g){let A=null,C=null;for(const t of Ky(I=this._data).call(I)){var I;const e=t[g];"number"==typeof e&&(null==C||ee(g)&&i(g)),null==I?this._data.get(t):this._data.get(I,t)}getIds(g){if(this._data.length){const A=Gd(this._options),C=null!=g?Gd(g):null;let I;return I=C?A?g=>A(g)&&C(g):C:A,this._data.getIds({filter:I,order:g&&g.order})}return[]}forEach(g,A){if(this._data){var C;const I=Gd(this._options),t=A&&Gd(A);let e;e=t?I?function(g){return I(g)&&t(g)}:t:I,pa(C=this._data).call(C,g,{filter:e,order:A&&A.order})}}map(g,A){if(this._data){var C;const I=Gd(this._options),t=A&&Gd(A);let e;return e=t?I?g=>I(g)&&t(g):t:I,Jr(C=this._data).call(C,g,{filter:e,order:A&&A.order})}return[]}getDataSet(){return this._data.getDataSet()}stream(g){var A;return this._data.stream(g||{[Yv]:GI(A=Fy(this._ids)).call(A,this._ids)})}dispose(){var g;null!==(g=this._data)&&void 0!==g&&g.off&&this._data.off("*",this._listener);const A="This data view has already been disposed of.",C={get:()=>{throw new Error(A)},set:()=>{throw new Error(A)},configurable:!1};for(const g of Yr(bw.prototype))Iw(this,g,C)}_onEvent(g,A,C){if(!A||!A.items||!this._data)return;const I=A.items,t=[],e=[],i=[],o=[],s=[],n=[];switch(g){case"add":for(let g=0,A=I.length;gA.x&&g.topA.y}function Vw(g){return"string"==typeof g&&""!==g}function Yw(g,A,C,I){let t=I.x,e=I.y;if("function"==typeof I.distanceToBorder){const C=I.distanceToBorder(g,A),i=Math.sin(A)*C,o=Math.cos(A)*C;o===C?(t+=C,e=I.y):i===C?(t=I.x,e-=C):(t+=o,e-=i)}else I.shape.width>I.shape.height?(t=I.x+.5*I.shape.width,e=I.y-C):(t=I.x+C,e=I.y-.5*I.shape.height);return{x:t,y:e}}class Ww{constructor(g){this.measureText=g,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[g]&&(this.lines[g]={width:0,height:0,blocks:[]});let I=A;void 0!==A&&""!==A||(I=" ");const t=this.measureText(I,C),e=fI({},Ky(t));e.text=A,e.width=t.width,e.mod=C,void 0!==A&&""!==A||(e.width=0),this.lines[g].blocks.push(e),this.lines[g].width+=e.width}curWidth(){const g=this.lines[this.current];return void 0===g?0:g.width}append(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,A)}newLine(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,g,A),this.current++}determineLineHeights(){for(let g=0;gg&&(g=I.width),A+=I.height}this.width=g,this.height=A}removeEmptyBlocks(){const g=[];for(let A=0;A"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class Uw{constructor(g){this.text=g,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return 0===this.modStack.length?"normal":this.modStack[0]}modName(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(g){" "===g&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=g&&(this.buffer+=g)}parseWS(g){return!!/[ \t]/.test(g)&&(this.mono?this.add(g):this.spacing=!0,!0)}setTag(g){this.emitBlock(),this[g]=!0,this.modStack.unshift(g)}unsetTag(g){this.emitBlock(),this[g]=!1,this.modStack.shift()}parseStartTag(g,A){return!(this.mono||this[g]||!this.match(A))&&(this.setTag(g),!0)}match(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const[C,I]=this.prepareRegExp(g),t=C.test(this.text.substr(this.position,I));return t&&A&&(this.position+=I-1),t}parseEndTag(g,A,C){let I=this.mod()===g;return I="mono"===g?I&&this.mono:I&&!this.mono,!(!I||!this.match(A))&&(void 0!==C?(this.position===this.text.length-1||this.match(C,!1))&&this.unsetTag(g):this.unsetTag(g),!0)}replace(g,A){return!!this.match(g)&&(this.add(A),this.position+=length-1,!0)}prepareRegExp(g){let A,C;if(g instanceof RegExp)C=g,A=1;else{const I=Qw[g];C=void 0!==I?I:new RegExp(g),A=g.length}return[C,A]}}class Kw{constructor(g,A,C,I){this.ctx=g,this.parent=A,this.selected=C,this.hover=I;this.lines=new Ww(((A,t)=>{if(void 0===A)return 0;const e=this.parent.getFormattingValues(g,C,I,t);let i=0;if(""!==A){i=this.ctx.measureText(A).width}return{width:i,values:e}}))}process(g){if(!Vw(g))return this.lines.finalize();const A=this.parent.fontOptions;g=(g=g.replace(/\r\n/g,"\n")).replace(/\r/g,"\n");const C=String(g).split("\n"),I=C.length;if(A.multi)for(let g=0;g0)for(let g=0;g0)for(let g=0;g{if(/&/.test(g)){return A.replace(A.text,"<","<")||A.replace(A.text,"&","&")||A.add("&"),!0}return!1};for(;A.position")||A.parseStartTag("ital","")||A.parseStartTag("mono","")||A.parseEndTag("bold","")||A.parseEndTag("ital","")||A.parseEndTag("mono",""))||C(g)||A.add(g),A.position++}return A.emitBlock(),A.blocks}splitMarkdownBlocks(g){const A=new Uw(g);let C=!0;const I=g=>!!/\\/.test(g)&&(A.positionthis.parent.fontOptions.maxWdt}getLongestFit(g){let A="",C=0;for(;C1&&void 0!==arguments[1]?arguments[1]:"normal",C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,A);let I=(g=(g=g.replace(/^( +)/g,"$1\r")).replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r")).split("\r");for(;I.length>0;){let g=this.getLongestFit(I);if(0===g){const g=I[0],C=this.getLongestFitWord(g);this.lines.newLine(Zr(g).call(g,0,C),A),I[0]=Zr(g).call(g,C)}else{let t=g;" "===I[g-1]?g--:" "===I[t]&&t++;const e=Zr(I).call(I,0,g).join("");g==I.length&&C?this.lines.append(e,A):this.lines.newLine(e,A),I=Zr(I).call(I,t)}}}}const Hw=["bold","ital","boldital","mono"];class Xw{constructor(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.body=g,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(A),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=C}setOptions(g){if(this.elementOptions=g,this.initFontOptions(g.font),Vw(g.label)?this.labelDirty=!0:g.label=void 0,void 0!==g.font&&null!==g.font)if("string"==typeof g.font)this.baseSize=this.fontOptions.size;else if("object"==typeof g.font){const A=g.font.size;void 0!==A&&(this.baseSize=A)}}initFontOptions(g){ku(Hw,(g=>{this.fontOptions[g]={}})),Xw.parseFontString(this.fontOptions,g)?this.fontOptions.vadjust=0:ku(g,((g,A)=>{null!=g&&"object"!=typeof g&&(this.fontOptions[A]=g)}))}static parseFontString(g,A){if(!A||"string"!=typeof A)return!1;const C=A.split(" ");return g.size=+C[0].replace("px",""),g.face=C[1],g.color=C[2],!0}constrain(g){const A={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},C=Yu(g,"widthConstraint");if("number"==typeof C)A.maxWdt=Number(C),A.minWdt=Number(C);else if("object"==typeof C){const C=Yu(g,["widthConstraint","maximum"]);"number"==typeof C&&(A.maxWdt=Number(C));const I=Yu(g,["widthConstraint","minimum"]);"number"==typeof I&&(A.minWdt=Number(I))}const I=Yu(g,"heightConstraint");if("number"==typeof I)A.minHgt=Number(I);else if("object"==typeof I){const C=Yu(g,["heightConstraint","minimum"]);"number"==typeof C&&(A.minHgt=Number(C));const I=Yu(g,["heightConstraint","valign"]);"string"==typeof I&&("top"!==I&&"bottom"!==I||(A.valign=I))}return A}update(g,A){this.setOptions(g,!0),this.propagateFonts(A),Tu(this.fontOptions,this.constrain(A)),this.fontOptions.chooser=Lw("label",A)}adjustSizes(g){const A=g?g.right+g.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=A,this.fontOptions.minWdt-=A);const C=g?g.top+g.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=C)}addFontOptionsToPile(g,A){for(let C=0;C{void 0!==g&&(Object.prototype.hasOwnProperty.call(A,C)||(-1!==kh(Hw).call(Hw,C)?A[C]={}:A[C]=g))}))}return A}getFontOption(g,A,C){let I;for(let t=0;t{I[A]=g})),I.size=Number(I.size),I.vadjust=Number(I.vadjust)}}draw(g,A,C,I,t){let e=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0===this.elementOptions.label)return;let i=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&i=this.elementOptions.scaling.label.maxVisible&&(i=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(g,I,t,A,C,e),this._drawBackground(g),this._drawText(g,A,this.size.yLine,e,i))}_drawBackground(g){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){g.fillStyle=this.fontOptions.background;const A=this.getSize();g.fillRect(A.left,A.top,A.width,A.height)}}_drawText(g,A,C){let I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle",t=arguments.length>4?arguments[4]:void 0;[A,C]=this._setAlignment(g,A,C,I),g.textAlign="left",A-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(C-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(C+=(this.size.height-this.size.labelHeight)/2));for(let I=0;I0&&(g.lineWidth=o.strokeWidth,g.strokeStyle=n,g.lineJoin="round"),g.fillStyle=s,o.strokeWidth>0&&g.strokeText(o.text,A+I,C+o.vadjust),g.fillText(o.text,A+I,C+o.vadjust),I+=o.width}C+=e.height}}}_setAlignment(g,A,C,I){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){A=0,C=0;const I=2;"top"===this.fontOptions.align?(g.textBaseline="alphabetic",C-=2*I):"bottom"===this.fontOptions.align?(g.textBaseline="hanging",C+=2*I):g.textBaseline="middle"}else g.textBaseline=I;return[A,C]}_getColor(g,A,C){let I=g||"#000000",t=C||"#ffffff";if(A<=this.elementOptions.scaling.label.drawThreshold){const g=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-A)));I=Pu(I,g),t=Pu(t,g)}return[I,t]}getTextSize(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1],C=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this._processLabel(g,A,C),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let g=this.size.left,A=this.size.top-1;if(this.isEdgeLabel){const C=.5*-this.size.width;switch(this.fontOptions.align){case"middle":g=C,A=.5*-this.size.height;break;case"top":g=C,A=-(this.size.height+2);break;case"bottom":g=C,A=2}}return{left:g,top:A,width:this.size.width,height:this.size.height}}calculateLabelSize(g,A,C){let I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,t=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,e=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(g,A,C),this.size.left=I-.5*this.size.width,this.size.top=t-.5*this.size.height,this.size.yLine=t+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===e&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(g,A,C,I){const t=function(g,A,C){return"normal"===A?"mod"===C?"":g[C]:void 0!==g[A][C]?g[A][C]:g[C]},e={color:t(this.fontOptions,I,"color"),size:t(this.fontOptions,I,"size"),face:t(this.fontOptions,I,"face"),mod:t(this.fontOptions,I,"mod"),vadjust:t(this.fontOptions,I,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(A||C)&&("normal"===I&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?e.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(e,this.elementOptions.id,A,C));let i="";return void 0!==e.mod&&""!==e.mod&&(i+=e.mod+" "),i+=e.size+"px "+e.face,g.font=i.replace(/"/g,""),e.font=g.font,e.height=e.size,e}differentState(g,A){return g!==this.selectedState||A!==this.hoverState}_processLabelText(g,A,C,I){return new Kw(g,this,A,C).process(I)}_processLabel(g,A,C){if(!1===this.labelDirty&&!this.differentState(A,C))return;const I=this._processLabelText(g,A,C,this.elementOptions.label);this.fontOptions.minWdt>0&&I.width0&&I.height0&&(this.enableBorderDashes(g,A),g.stroke(),this.disableBorderDashes(g,A)),g.restore()}performFill(g,A){g.save(),g.fillStyle=A.color,this.enableShadow(g,A),dl(g).call(g),this.disableShadow(g,A),g.restore(),this.performStroke(g,A)}_addBoundingBoxMargin(g){this.boundingBox.left-=g,this.boundingBox.top-=g,this.boundingBox.bottom+=g,this.boundingBox.right+=g}_updateBoundingBox(g,A,C,I,t){void 0!==C&&this.resize(C,I,t),this.left=g-this.width/2,this.top=A-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(g,A,C,I,t){this._updateBoundingBox(g,A,C,I,t)}getDimensionsFromLabel(g,A,C){this.textSize=this.labelModule.getTextSize(g,A,C);let I=this.textSize.width,t=this.textSize.height;return 0===I&&(I=14,t=14),{width:I,height:t}}}let Jw=class extends _w{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(A,C)){const I=this.getDimensionsFromLabel(g,A,C);this.width=I.width+this.margin.right+this.margin.left,this.height=I.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(g,e),jI(g,this.left,this.top,this.width,this.height,e.borderRadius),this.performFill(g,e),this.updateBoundingBox(A,C,g,I,t),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,I,t)}updateBoundingBox(g,A,C,I,t){this._updateBoundingBox(g,A,C,I,t);const e=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(e)}distanceToBorder(g,A){g&&this.resize(g);const C=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(A)),Math.abs(this.height/2/Math.sin(A)))+C}};class qw extends _w{constructor(g,A,C){super(g,A,C),this.labelOffset=0,this.selected=!1}setOptions(g,A,C){this.options=g,void 0===A&&void 0===C||this.setImages(A,C)}setImages(g,A){A&&this.selected?(this.imageObj=A,this.imageObjAlt=g):(this.imageObj=g,this.imageObjAlt=A)}switchImages(g){const A=g&&!this.selected||!g&&this.selected;if(this.selected=g,void 0!==this.imageObjAlt&&A){const g=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=g}}_getImagePadding(){const g={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const A=this.options.imagePadding;"object"==typeof A?(g.top=A.top,g.right=A.right,g.bottom=A.bottom,g.left=A.left):(g.top=A,g.right=A,g.bottom=A,g.left=A)}return g}_resizeImage(){let g,A;if(!1===this.options.shapeProperties.useImageSize){let C=1,I=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?C=this.imageObj.width/this.imageObj.height:I=this.imageObj.height/this.imageObj.width),g=2*this.options.size*C,A=2*this.options.size*I}else{const C=this._getImagePadding();g=this.imageObj.width+C.left+C.right,A=this.imageObj.height+C.top+C.bottom}this.width=g,this.height=A,this.radius=.5*this.width}_drawRawCircle(g,A,C,I){this.initContextForDraw(g,I),LI(g,A,C,I.size),this.performFill(g,I)}_drawImageAtPosition(g,A){if(0!=this.imageObj.width){g.globalAlpha=void 0!==A.opacity?A.opacity:1,this.enableShadow(g,A);let C=1;!0===this.options.shapeProperties.interpolation&&(C=this.imageObj.width/this.width/this.body.view.scale);const I=this._getImagePadding(),t=this.left+I.left,e=this.top+I.top,i=this.width-I.left-I.right,o=this.height-I.top-I.bottom;this.imageObj.drawImageAtPosition(g,C,t,e,i,o),this.disableShadow(g,A)}}_drawImageLabel(g,A,C,I,t){let e=0;if(void 0!==this.height){e=.5*this.height;const A=this.labelModule.getTextSize(g,I,t);A.lineCount>=1&&(e+=A.height/2)}const i=C+e;this.options.label&&(this.labelOffset=e),this.labelModule.draw(g,A,i,I,t,"hanging")}}let $w=class extends qw{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(A,C)){const I=this.getDimensionsFromLabel(g,A,C),t=Math.max(I.width+this.margin.right+this.margin.left,I.height+this.margin.top+this.margin.bottom);this.options.size=t/2,this.width=t,this.height=t,this.radius=this.width/2}}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-this.width/2,this.top=C-this.height/2,this._drawRawCircle(g,A,C,e),this.updateBoundingBox(A,C),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,C,I,t)}updateBoundingBox(g,A){this.boundingBox.top=A-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=A+this.options.size}distanceToBorder(g){return g&&this.resize(g),.5*this.width}};class gx extends qw{constructor(g,A,C,I,t){super(g,A,C),this.setImages(I,t)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){const g=2*this.options.size;return this.width=g,this.height=g,void(this.radius=.5*this.width)}this.needsRefresh(A,C)&&this._resizeImage()}draw(g,A,C,I,t,e){this.switchImages(I),this.resize();let i=A,o=C;"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=A,this.top=C,i+=this.width/2,o+=this.height/2):(this.left=A-this.width/2,this.top=C-this.height/2),this._drawRawCircle(g,i,o,e),g.save(),g.clip(),this._drawImageAtPosition(g,e),g.restore(),this._drawImageLabel(g,i,o,I,t),this.updateBoundingBox(A,C)}updateBoundingBox(g,A){"top-left"===this.options.shapeProperties.coordinateOrigin?(this.boundingBox.top=A,this.boundingBox.left=g,this.boundingBox.right=g+2*this.options.size,this.boundingBox.bottom=A+2*this.options.size):(this.boundingBox.top=A-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=A+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(g){return g&&this.resize(g),.5*this.width}}class Ax extends _w{constructor(g,A,C){super(g,A,C)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover,I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(A,C)){var t,e;this.labelModule.getTextSize(g,A,C);const i=2*I.size;this.width=null!==(t=this.customSizeWidth)&&void 0!==t?t:i,this.height=null!==(e=this.customSizeHeight)&&void 0!==e?e:i,this.radius=.5*this.width}}_drawShape(g,A,C,I,t,e,i,o){var s;return this.resize(g,e,i,o),this.left=I-this.width/2,this.top=t-this.height/2,this.initContextForDraw(g,o),(s=A,Object.prototype.hasOwnProperty.call(QI,s)?QI[s]:function(g){for(var A=arguments.length,C=new Array(A>1?A-1:0),I=1;I{if(void 0!==this.options.label){this.labelModule.calculateLabelSize(g,e,i,I,t,"hanging");const A=t+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(g,I,A,e,i,"hanging")}this.updateBoundingBox(I,t)}}}updateBoundingBox(g,A){this.boundingBox.top=A-this.options.size,this.boundingBox.left=g-this.options.size,this.boundingBox.right=g+this.options.size,this.boundingBox.bottom=A+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}function Cx(g,A){var C=ga(g);if(tm){var I=tm(g);A&&(I=Gd(I).call(I,(function(A){return hm(g,A).enumerable}))),C.push.apply(C,I)}return C}function Ix(g){for(var A=1;A{g.save(),A(),g.restore()}}return i.nodeDimensions&&(this.customSizeWidth=i.nodeDimensions.width,this.customSizeHeight=i.nodeDimensions.height),i}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}class ex extends _w{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g,A,C){if(this.needsRefresh(A,C)){const I=this.getDimensionsFromLabel(g,A,C).width+this.margin.right+this.margin.left;this.width=I,this.height=I,this.radius=this.width/2}}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-this.width/2,this.top=C-this.height/2,this.initContextForDraw(g,e),YI(g,A-this.width/2,C-this.height/2,this.width,this.height),this.performFill(g,e),this.updateBoundingBox(A,C,g,I,t),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,I,t)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}let ix=class extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"diamond",4,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}};class ox extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"circle",2,A,C,I,t,e)}distanceToBorder(g){return g&&this.resize(g),this.options.size}}class sx extends _w{constructor(g,A,C){super(g,A,C)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(A,C)){const I=this.getDimensionsFromLabel(g,A,C);this.height=2*I.height,this.width=I.width+I.height,this.radius=.5*this.width}}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-.5*this.width,this.top=C-.5*this.height,this.initContextForDraw(g,e),VI(g,this.left,this.top,this.width,this.height),this.performFill(g,e),this.updateBoundingBox(A,C,g,I,t),this.labelModule.draw(g,A,C,I,t)}distanceToBorder(g,A){g&&this.resize(g);const C=.5*this.width,I=.5*this.height,t=Math.sin(A)*C,e=Math.cos(A)*I;return C*I/Math.sqrt(t*t+e*e)}}class nx extends _w{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g,A,C){this.needsRefresh(A,C)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(g,A,C,I,t,e){return this.resize(g,I,t),this.options.icon.size=this.options.icon.size||50,this.left=A-this.width/2,this.top=C-this.height/2,this._icon(g,A,C,I,t,e),{drawExternalLabel:()=>{if(void 0!==this.options.label){const A=5;this.labelModule.draw(g,this.left+this.iconSize.width/2+this.margin.left,C+this.height/2+A,I)}this.updateBoundingBox(A,C)}}}updateBoundingBox(g,A){if(this.boundingBox.top=A-.5*this.options.icon.size,this.boundingBox.left=g-.5*this.options.icon.size,this.boundingBox.right=g+.5*this.options.icon.size,this.boundingBox.bottom=A+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){const g=5;this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+g)}}_icon(g,A,C,I,t,e){const i=Number(this.options.icon.size);void 0!==this.options.icon.code?(g.font=[null!=this.options.icon.weight?this.options.icon.weight:I?"bold":"",(null!=this.options.icon.weight&&I?5:0)+i+"px",this.options.icon.face].join(" "),g.fillStyle=this.options.icon.color||"black",g.textAlign="center",g.textBaseline="middle",this.enableShadow(g,e),g.fillText(this.options.icon.code,A,C),this.disableShadow(g,e)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}let rx=class extends qw{constructor(g,A,C,I,t){super(g,A,C),this.setImages(I,t)}resize(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){const g=2*this.options.size;return this.width=g,void(this.height=g)}this.needsRefresh(A,C)&&this._resizeImage()}draw(g,A,C,I,t,e){g.save(),this.switchImages(I),this.resize();let i=A,o=C;if("top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=A,this.top=C,i+=this.width/2,o+=this.height/2):(this.left=A-this.width/2,this.top=C-this.height/2),!0===this.options.shapeProperties.useBorderWithImage){const A=this.options.borderWidth,C=this.options.borderWidthSelected||2*this.options.borderWidth,i=(I?C:A)/this.body.view.scale;g.lineWidth=Math.min(this.width,i),g.beginPath();let o=I?this.options.color.highlight.border:t?this.options.color.hover.border:this.options.color.border,s=I?this.options.color.highlight.background:t?this.options.color.hover.background:this.options.color.background;void 0!==e.opacity&&(o=Pu(o,e.opacity),s=Pu(s,e.opacity)),g.strokeStyle=o,g.fillStyle=s,g.rect(this.left-.5*g.lineWidth,this.top-.5*g.lineWidth,this.width+g.lineWidth,this.height+g.lineWidth),dl(g).call(g),this.performStroke(g,e),g.closePath()}this._drawImageAtPosition(g,e),this._drawImageLabel(g,i,o,I,t),this.updateBoundingBox(A,C),g.restore()}updateBoundingBox(g,A){this.resize(),"top-left"===this.options.shapeProperties.coordinateOrigin?(this.left=g,this.top=A):(this.left=g-this.width/2,this.top=A-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(g,A){return this._distanceToBorder(g,A)}};class ax extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"square",2,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}class dx extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"hexagon",4,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}class hx extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"star",4,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}class lx extends _w{constructor(g,A,C){super(g,A,C),this._setMargins(C)}resize(g,A,C){this.needsRefresh(A,C)&&(this.textSize=this.labelModule.getTextSize(g,A,C),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(g,A,C,I,t,e){this.resize(g,I,t),this.left=A-this.width/2,this.top=C-this.height/2,this.enableShadow(g,e),this.labelModule.draw(g,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,I,t),this.disableShadow(g,e),this.updateBoundingBox(A,C,g,I,t)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}let cx=class extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"triangle",3,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}};class ux extends Ax{constructor(g,A,C){super(g,A,C)}draw(g,A,C,I,t,e){return this._drawShape(g,"triangleDown",3,A,C,I,t,e)}distanceToBorder(g,A){return this._distanceToBorder(g,A)}}function px(g,A){var C=ga(g);if(tm){var I=tm(g);A&&(I=Gd(I).call(I,(function(A){return hm(g,A).enumerable}))),C.push.apply(C,I)}return C}function fx(g){for(var A=1;Anull!=A[g]));i.push("font"),Ou(i,g,e),g.color=zu(g.color)}static parseOptions(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2],I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},t=arguments.length>4?arguments[4]:void 0;if(Ou(["color","fixed","shadow"],g,A,C),bx.checkMass(A),void 0!==g.opacity&&(bx.checkOpacity(g.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity),g.opacity=void 0)),void 0!==A.opacity&&(bx.checkOpacity(A.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+A.opacity),A.opacity=void 0)),A.shapeProperties&&!bx.checkCoordinateOrigin(A.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+A.shapeProperties.coordinateOrigin),ju(g,A,"shadow",I),void 0!==A.color&&null!==A.color){const C=zu(A.color);xu(g.color,C)}else!0===C&&null===A.color&&(g.color=Lu(I.color));void 0!==A.fixed&&null!==A.fixed&&("boolean"==typeof A.fixed?(g.fixed.x=A.fixed,g.fixed.y=A.fixed):(void 0!==A.fixed.x&&"boolean"==typeof A.fixed.x&&(g.fixed.x=A.fixed.x),void 0!==A.fixed.y&&"boolean"==typeof A.fixed.y&&(g.fixed.y=A.fixed.y))),!0===C&&null===A.font&&(g.font=Lu(I.font)),bx.updateGroupOptions(g,A,t),void 0!==A.scaling&&ju(g.scaling,A.scaling,"label",I.scaling)}getFormattingValues(){const g={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?!0===this.chooser?this.selected?(null!=this.options.borderWidthSelected?g.borderWidth=this.options.borderWidthSelected:g.borderWidth*=2,g.color=this.options.color.highlight.background,g.borderColor=this.options.color.highlight.border,g.shadow=this.options.shadow.enabled):this.hover&&(g.color=this.options.color.hover.background,g.borderColor=this.options.color.hover.border,g.shadow=this.options.shadow.enabled):"function"==typeof this.chooser&&(this.chooser(g,this.options.id,this.selected,this.hover),!1===g.shadow&&(g.shadowColor===this.options.shadow.color&&g.shadowSize===this.options.shadow.size&&g.shadowX===this.options.shadow.x&&g.shadowY===this.options.shadow.y||(g.shadow=!0))):g.shadow=this.options.shadow.enabled,void 0!==this.options.opacity){const A=this.options.opacity;g.borderColor=Pu(g.borderColor,A),g.color=Pu(g.color,A),g.shadowColor=Pu(g.shadowColor,A)}return g}updateLabelModule(g){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),bx.updateGroupOptions(this.options,fx(fx({},g),{},{color:g&&g.color||this._localColor||void 0}),this.grouplist);const A=this.grouplist.get(this.options.group,!1),C=[g,this.options,A,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,C),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(g){if(g===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new Jw(this.options,this.body,this.labelModule);break;case"circle":this.shape=new $w(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new gx(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new tx(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new ex(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new ix(this.options,this.body,this.labelModule);break;case"dot":this.shape=new ox(this.options,this.body,this.labelModule);break;case"ellipse":default:this.shape=new sx(this.options,this.body,this.labelModule);break;case"icon":this.shape=new nx(this.options,this.body,this.labelModule);break;case"image":this.shape=new rx(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new ax(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new dx(this.options,this.body,this.labelModule);break;case"star":this.shape=new hx(this.options,this.body,this.labelModule);break;case"text":this.shape=new lx(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new cx(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new ux(this.options,this.body,this.labelModule)}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(g,A){return this.shape.distanceToBorder(g,A)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(g,A,C){if(void 0!==this.options.value){const I=this.options.scaling.customScalingFunction(g,A,C,this.options.value),t=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){const g=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+I*g}this.options.size=this.options.scaling.min+I*t}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(g){const A=this.getFormattingValues();return this.shape.draw(g,this.x,this.y,this.selected,this.hover,A)||{}}updateBoundingBox(g){this.shape.updateBoundingBox(this.x,this.y,g)}resize(g){const A=this.getFormattingValues();this.shape.resize(g,this.selected,this.hover,A)}getItemsOnPoint(g){const A=[];return this.labelModule.visible()&&jw(this.labelModule.getSize(),g)&&A.push({nodeId:this.id,labelId:0}),jw(this.shape.boundingBox,g)&&A.push({nodeId:this.id}),A}isOverlappingWith(g){return this.shape.leftg.left&&this.shape.topg.top}isBoundingBoxOverlappingWith(g){return this.shape.boundingBox.leftg.left&&this.shape.boundingBox.topg.top}static checkMass(g,A){if(void 0!==g.mass&&g.mass<=0){let C="";void 0!==A&&(C=" in node id: "+A),console.error("%cNegative or zero mass disallowed"+C+", setting mass to 1.",gp),g.mass=1}}}class mx{constructor(g,A,C,I){var t;if(this.body=g,this.images=A,this.groups=C,this.layoutEngine=I,this.body.functions.createNode=GI(t=this.create).call(t,this),this.nodesListeners={add:(g,A)=>{this.add(A.items)},update:(g,A)=>{this.update(A.items,A.data,A.oldData)},remove:(g,A)=>{this.remove(A.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(g,A,C,I){if(A===g)return.5;{const C=1/(A-g);return Math.max(0,(I-g)*C)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=Lu(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g,A;this.body.emitter.on("refreshNodes",GI(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",GI(A=this.refresh).call(A,this)),this.body.emitter.on("destroy",(()=>{ku(this.nodesListeners,((g,A)=>{this.body.data.nodes&&this.body.data.nodes.off(A,g)})),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners}))}setOptions(g){if(void 0!==g){if(bx.parseOptions(this.options,g),void 0!==g.opacity&&(Kb(g.opacity)||!_b(g.opacity)||g.opacity<0||g.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+g.opacity):this.options.opacity=g.opacity),void 0!==g.shape)for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].updateShape();if(void 0!==g.font||void 0!==g.widthConstraint||void 0!==g.heightConstraint)for(const g of ga(this.body.nodes))this.body.nodes[g].updateLabelModule(),this.body.nodes[g].needsRefresh();if(void 0!==g.size)for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.body.nodes[g].needsRefresh();void 0===g.hidden&&void 0===g.physics||this.body.emitter.emit("_dataChanged")}}setData(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const C=this.body.data.nodes;if(vw("id",g))this.body.data.nodes=g;else if(Wr(g))this.body.data.nodes=new fw,this.body.data.nodes.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new fw}if(C&&ku(this.nodesListeners,(function(g,A){C.off(A,g)})),this.body.nodes={},this.body.data.nodes){const g=this;ku(this.nodesListeners,(function(A,C){g.body.data.nodes.on(C,A)}));const A=this.body.data.nodes.getIds();this.add(A,!0)}!1===A&&this.body.emitter.emit("_dataChanged")}add(g){let A,C=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const I=[];for(let C=0;C1&&void 0!==arguments[1]?arguments[1]:bx)(g,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ku(this.body.nodes,((A,C)=>{const I=this.body.data.nodes.get(C);void 0!==I&&(!0===g&&A.setOptions({x:null,y:null}),A.setOptions({fixed:!1}),A.setOptions(I))}))}getPositions(g){const A={};if(void 0!==g){if(!0===Wr(g)){for(let C=0;C{this.body.emitter.emit("startSimulation")}),0)):console.error("Node id supplied to moveNode does not exist. Provided: ",g)}}var vx=DC,yx=Math.hypot,wx=Math.abs,xx=Math.sqrt;vx({target:"Math",stat:!0,arity:2,forced:!!yx&&yx(1/0,NaN)!==1/0},{hypot:function(g,A){for(var C,I,t=0,e=0,i=arguments.length,o=0;e0?(I=C/o)*I:C;return o===1/0?1/0:o*xx(t)}});var Ex=C(Ag.Math.hypot);class Ox{static transform(g,A){Wr(g)||(g=[g]);const C=A.point.x,I=A.point.y,t=A.angle,e=A.length;for(let A=0;A4&&void 0!==arguments[4]?arguments[4]:this.getViaNode();g.strokeStyle=this.getColor(g,A),g.lineWidth=A.width,!1!==A.dashes?this._drawDashedLine(g,A,t):this._drawLine(g,A,t)}_drawLine(g,A,C,I,t){if(this.from!=this.to)this._line(g,A,C,I,t);else{const[C,I,t]=this._getCircleData(g);this._circle(g,A,C,I,t)}}_drawDashedLine(g,A,C,I,t){g.lineCap="round";const e=Wr(A.dashes)?A.dashes:[5,5];if(void 0!==g.setLineDash){if(g.save(),g.setLineDash(e),g.lineDashOffset=0,this.from!=this.to)this._line(g,A,C);else{const[C,I,t]=this._getCircleData(g);this._circle(g,A,C,I,t)}g.setLineDash([0]),g.lineDashOffset=0,g.restore()}else{if(this.from!=this.to)WI(g,this.from.x,this.from.y,this.to.x,this.to.y,e);else{const[C,I,t]=this._getCircleData(g);this._circle(g,A,C,I,t)}this.enableShadow(g,A),g.stroke(),this.disableShadow(g,A)}}findBorderPosition(g,A,C){return this.from!=this.to?this._findBorderPosition(g,A,C):this._findBorderPositionCircle(g,A,C)}findBorderPositions(g){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,g),to:this._findBorderPosition(this.to,g)};{var A;const[C,I]=Zr(A=this._getCircleData(g)).call(A,0,2);return{from:this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:.6,high:.8,direction:1})}}}_getCircleData(g){const A=this.options.selfReference.size;void 0!==g&&void 0===this.from.shape.width&&this.from.shape.resize(g);const C=Yw(g,this.options.selfReference.angle,A,this.from);return[C.x,C.y,A]}_pointOnCircle(g,A,C,I){const t=2*I*Math.PI;return{x:g+C*Math.cos(t),y:A-C*Math.sin(t)}}_findBorderPositionCircle(g,A,C){const I=C.x,t=C.y;let e=C.low,i=C.high;const o=C.direction,s=this.options.selfReference.size;let n,r=.5*(e+i),a=0;!0===this.options.arrowStrikethrough&&(-1===o?a=this.options.endPointOffset.from:1===o&&(a=this.options.endPointOffset.to));let d=0;do{r=.5*(e+i),n=this._pointOnCircle(I,t,s,r);const C=Math.atan2(g.y-n.y,g.x-n.x),h=g.distanceToBorder(A,C)+a-Math.sqrt(Math.pow(n.x-g.x,2)+Math.pow(n.y-g.y,2));if(Math.abs(h)<.05)break;h>0?o>0?e=r:i=r:o>0?i=r:e=r,++d}while(e<=i&&d<10);return jx(jx({},n),{},{t:r})}getLineWidth(g,A){return!0===g?Math.max(this.selectionWidth,.3/this._body.view.scale):!0===A?Math.max(this.hoverWidth,.3/this._body.view.scale):Math.max(this.options.width,.3/this._body.view.scale)}getColor(g,A){if(!1!==A.inheritsColor){if("both"===A.inheritsColor&&this.from.id!==this.to.id){const C=g.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y);let I=this.from.options.color.highlight.border,t=this.to.options.color.highlight.border;return!1===this.from.selected&&!1===this.to.selected?(I=Pu(this.from.options.color.border,A.opacity),t=Pu(this.to.options.color.border,A.opacity)):!0===this.from.selected&&!1===this.to.selected?t=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(I=this.from.options.color.border),C.addColorStop(0,I),C.addColorStop(1,t),C}return"to"===A.inheritsColor?Pu(this.to.options.color.border,A.opacity):Pu(this.from.options.color.border,A.opacity)}return Pu(A.color,A.opacity)}_circle(g,A,C,I,t){this.enableShadow(g,A);let e=0,i=2*Math.PI;if(!this.options.selfReference.renderBehindTheNode){const A=this.options.selfReference.angle,t=this.options.selfReference.angle+Math.PI,o=this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:A,high:t,direction:-1}),s=this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:A,high:t,direction:1});e=Math.atan2(o.y-I,o.x-C),i=Math.atan2(s.y-I,s.x-C)}g.beginPath(),g.arc(C,I,t,e,i,!1),g.stroke(),this.disableShadow(g,A)}getDistanceToEdge(g,A,C,I,t,e){if(this.from!=this.to)return this._getDistanceToEdge(g,A,C,I,t,e);{const[g,A,C]=this._getCircleData(void 0),I=g-t,i=A-e;return Math.abs(Math.sqrt(I*I+i*i)-C)}}_getDistanceToLine(g,A,C,I,t,e){const i=C-g,o=I-A;let s=((t-g)*i+(e-A)*o)/(i*i+o*o);s>1?s=1:s<0&&(s=0);const n=g+s*i-t,r=A+s*o-e;return Math.sqrt(n*n+r*r)}getArrowData(g,A,C,I,t,e){let i,o,s,n,r,a,d;const h=e.width;"from"===A?(s=this.from,n=this.to,r=e.fromArrowScale<0,a=Math.abs(e.fromArrowScale),d=e.fromArrowType):"to"===A?(s=this.to,n=this.from,r=e.toArrowScale<0,a=Math.abs(e.toArrowScale),d=e.toArrowType):(s=this.to,n=this.from,r=e.middleArrowScale<0,a=Math.abs(e.middleArrowScale),d=e.middleArrowType);const l=15*a+3*h;if(s!=n){const I=l/Ex(s.x-n.x,s.y-n.y);if("middle"!==A)if(!0===this.options.smooth.enabled){const t=this._findBorderPosition(s,g,{via:C}),e=this.getPoint(t.t+I*("from"===A?1:-1),C);i=Math.atan2(t.y-e.y,t.x-e.x),o=t}else i=Math.atan2(s.y-n.y,s.x-n.x),o=this._findBorderPosition(s,g);else{const g=(r?-I:I)/2,A=this.getPoint(.5+g,C),t=this.getPoint(.5-g,C);i=Math.atan2(A.y-t.y,A.x-t.x),o=this.getPoint(.5,C)}}else{const[C,I,t]=this._getCircleData(g);if("from"===A){const A=this.options.selfReference.angle,t=this.options.selfReference.angle+Math.PI,e=this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:A,high:t,direction:-1});i=-2*e.t*Math.PI+1.5*Math.PI+.1*Math.PI,o=e}else if("to"===A){const A=this.options.selfReference.angle,t=this.options.selfReference.angle+Math.PI,e=this._findBorderPositionCircle(this.from,g,{x:C,y:I,low:A,high:t,direction:1});i=-2*e.t*Math.PI+1.5*Math.PI-1.1*Math.PI,o=e}else{const g=this.options.selfReference.angle/(2*Math.PI);o=this._pointOnCircle(C,I,t,g),i=-2*g*Math.PI+1.5*Math.PI+.1*Math.PI}}return{point:o,core:{x:o.x-.9*l*Math.cos(i),y:o.y-.9*l*Math.sin(i)},angle:i,length:l,type:d}}drawArrowHead(g,A,C,I,t){g.strokeStyle=this.getColor(g,A),g.fillStyle=g.strokeStyle,g.lineWidth=A.width;Gx.draw(g,t)&&(this.enableShadow(g,A),dl(g).call(g),this.disableShadow(g,A))}enableShadow(g,A){!0===A.shadow&&(g.shadowColor=A.shadowColor,g.shadowBlur=A.shadowSize,g.shadowOffsetX=A.shadowX,g.shadowOffsetY=A.shadowY)}disableShadow(g,A){!0===A.shadow&&(g.shadowColor="rgba(0,0,0,0)",g.shadowBlur=0,g.shadowOffsetX=0,g.shadowOffsetY=0)}drawBackground(g,A){if(!1!==A.background){const C={strokeStyle:g.strokeStyle,lineWidth:g.lineWidth,dashes:g.dashes};g.strokeStyle=A.backgroundColor,g.lineWidth=A.backgroundSize,this.setStrokeDashed(g,A.backgroundDashes),g.stroke(),g.strokeStyle=C.strokeStyle,g.lineWidth=C.lineWidth,g.dashes=C.dashes,this.setStrokeDashed(g,A.dashes)}}setStrokeDashed(g,A){if(!1!==A)if(void 0!==g.setLineDash){const C=Wr(A)?A:[5,5];g.setLineDash(C)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else void 0!==g.setLineDash?g.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}function Yx(g,A){var C=ga(g);if(tm){var I=tm(g);A&&(I=Gd(I).call(I,(function(A){return hm(g,A).enumerable}))),C.push.apply(C,I)}return C}function Wx(g){for(var A=1;A2&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates();let I,t,e=!1,i=1,o=0,s=this.to,n=this.options.endPointOffset?this.options.endPointOffset.to:0;g.id===this.from.id&&(s=this.from,e=!0,n=this.options.endPointOffset?this.options.endPointOffset.from:0),!1===this.options.arrowStrikethrough&&(n=0);let r=0;do{t=.5*(o+i),I=this.getPoint(t,C);const g=Math.atan2(s.y-I.y,s.x-I.x),a=s.distanceToBorder(A,g)+n-Math.sqrt(Math.pow(I.x-s.x,2)+Math.pow(I.y-s.y,2));if(Math.abs(a)<.2)break;a<0?!1===e?o=t:i=t:!1===e?i=t:o=t,++r}while(o<=i&&r<10);return Wx(Wx({},I),{},{t:t})}_getDistanceToBezierEdge(g,A,C,I,t,e,i){let o,s,n,r,a,d=1e9,h=g,l=A;for(s=1;s<10;s++)n=.1*s,r=Math.pow(1-n,2)*g+2*n*(1-n)*i.x+Math.pow(n,2)*C,a=Math.pow(1-n,2)*A+2*n*(1-n)*i.y+Math.pow(n,2)*I,s>0&&(o=this._getDistanceToLine(h,l,r,a,t,e),d=o{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(g){super.setOptions(g);let A=!1;this.options.physics!==g.physics&&(A=!0),this.options=g,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),!0===A&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],void 0===this.from||void 0===this.to||!1===this.options.physics||this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),void 0!==this.via&&(delete this._body.nodes[this.via.id],this.via=void 0,!0)}setupSupportNode(){if(void 0===this.via){const g="edgeId:"+this.id,A=this._body.functions.createNode({id:g,shape:"circle",physics:!0,hidden:!0});this._body.nodes[g]=A,this.via=A,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){void 0!==this.via&&void 0!==this.from&&void 0!==this.to?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):void 0!==this.via&&(this.via.x=0,this.via.y=0)}_line(g,A,C){this._bezierCurve(g,A,C)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.via;if(this.from===this.to){const[A,C,I]=this._getCircleData(),t=2*Math.PI*(1-g);return{x:A+I*Math.sin(t),y:C+I-I*(1-Math.cos(t))}}return{x:Math.pow(1-g,2)*this.fromPoint.x+2*g*(1-g)*A.x+Math.pow(g,2)*this.toPoint.x,y:Math.pow(1-g,2)*this.fromPoint.y+2*g*(1-g)*A.y+Math.pow(g,2)*this.toPoint.y}}_findBorderPosition(g,A){return this._findBorderPositionBezier(g,A,this.via)}_getDistanceToEdge(g,A,C,I,t,e){return this._getDistanceToBezierEdge(g,A,C,I,t,e,this.via)}}class Kx extends Qx{constructor(g,A,C){super(g,A,C)}_line(g,A,C){this._bezierCurve(g,A,C)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const g=this.options.smooth.roundness,A=this.options.smooth.type;let C=Math.abs(this.from.x-this.to.x),I=Math.abs(this.from.y-this.to.y);if("discrete"===A||"diagonalCross"===A){let t,e;t=e=C<=I?g*I:g*C,this.from.x>this.to.x&&(t=-t),this.from.y>=this.to.y&&(e=-e);let i=this.from.x+t,o=this.from.y+e;return"discrete"===A&&(C<=I?i=Cthis.to.x&&(A=-A),this.from.y>=this.to.y&&(t=-t);let e=this.from.x+A,i=this.from.y+t;return C<=I?e=this.from.x<=this.to.x?this.to.xe?this.to.x:e:i=this.from.y>=this.to.y?this.to.y>i?this.to.y:i:this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(g,A,C.via)}_getDistanceToEdge(g,A,C,I,t,e){let i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(g,A,C,I,t,e,i)}getPoint(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates();const C=g;return{x:Math.pow(1-C,2)*this.fromPoint.x+2*C*(1-C)*A.x+Math.pow(C,2)*this.toPoint.x,y:Math.pow(1-C,2)*this.fromPoint.y+2*C*(1-C)*A.y+Math.pow(C,2)*this.toPoint.y}}}class Hx extends Qx{constructor(g,A,C){super(g,A,C)}_getDistanceToBezierEdge2(g,A,C,I,t,e,i,o){let s=1e9,n=g,r=A;const a=[0,0,0,0];for(let d=1;d<10;d++){const h=.1*d;a[0]=Math.pow(1-h,3),a[1]=3*h*Math.pow(1-h,2),a[2]=3*Math.pow(h,2)*(1-h),a[3]=Math.pow(h,3);const l=a[0]*g+a[1]*i.x+a[2]*o.x+a[3]*C,c=a[0]*A+a[1]*i.y+a[2]*o.y+a[3]*I;if(d>0){const g=this._getDistanceToLine(n,r,l,c,t,e);s=gMath.abs(A)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(I=this.from.y,e=this.to.y,C=this.from.x-i*g,t=this.to.x+i*g):(I=this.from.y-i*A,e=this.to.y+i*A,C=this.from.x,t=this.to.x),[{x:C,y:I},{x:t,y:e}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(g,A){return this._findBorderPositionBezier(g,A)}_getDistanceToEdge(g,A,C,I,t,e){let[i,o]=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(g,A,C,I,t,e,i,o)}getPoint(g){let[A,C]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates();const I=g,t=[Math.pow(1-I,3),3*I*Math.pow(1-I,2),3*Math.pow(I,2)*(1-I),Math.pow(I,3)];return{x:t[0]*this.fromPoint.x+t[1]*A.x+t[2]*C.x+t[3]*this.toPoint.x,y:t[0]*this.fromPoint.y+t[1]*A.y+t[2]*C.y+t[3]*this.toPoint.y}}}class _x extends Vx{constructor(g,A,C){super(g,A,C)}_line(g,A){g.beginPath(),g.moveTo(this.fromPoint.x,this.fromPoint.y),g.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(g,A),g.stroke(),this.disableShadow(g,A)}getViaNode(){}getPoint(g){return{x:(1-g)*this.fromPoint.x+g*this.toPoint.x,y:(1-g)*this.fromPoint.y+g*this.toPoint.y}}_findBorderPosition(g,A){let C=this.to,I=this.from;g.id===this.from.id&&(C=this.from,I=this.to);const t=Math.atan2(C.y-I.y,C.x-I.x),e=C.x-I.x,i=C.y-I.y,o=Math.sqrt(e*e+i*i),s=(o-g.distanceToBorder(A,t))/o;return{x:(1-s)*I.x+s*C.x,y:(1-s)*I.y+s*C.y,t:0}}_getDistanceToEdge(g,A,C,I,t,e){return this._getDistanceToLine(g,A,C,I,t,e)}}class Jx{constructor(g,A,C,I,t){if(void 0===A)throw new Error("No body provided");this.options=Lu(I),this.globalOptions=I,this.defaultOptions=t,this.body=A,this.imagelist=C,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new Xw(this.body,this.options,!0),this.setOptions(g)}setOptions(g){if(!g)return;let A=void 0!==g.physics&&this.options.physics!==g.physics||void 0!==g.hidden&&(this.options.hidden||!1)!==(g.hidden||!1)||void 0!==g.from&&this.options.from!==g.from||void 0!==g.to&&this.options.to!==g.to;Jx.parseOptions(this.options,g,!0,this.globalOptions),void 0!==g.id&&(this.id=g.id),void 0!==g.from&&(this.fromId=g.from),void 0!==g.to&&(this.toId=g.to),void 0!==g.title&&(this.title=g.title),void 0!==g.value&&(g.value=Mw(g.value));const C=[g,this.options,this.defaultOptions];return this.chooser=Lw("edge",C),this.updateLabelModule(g),A=this.updateEdgeType()||A,this._setInteractionWidths(),this.connect(),A}static parseOptions(g,A){let C=arguments.length>2&&void 0!==arguments[2]&&arguments[2],I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},t=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Eu(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],g,A,C),void 0!==A.endPointOffset&&void 0!==A.endPointOffset.from&&(_b(A.endPointOffset.from)?g.endPointOffset.from=A.endPointOffset.from:(g.endPointOffset.from=void 0!==I.endPointOffset.from?I.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),void 0!==A.endPointOffset&&void 0!==A.endPointOffset.to&&(_b(A.endPointOffset.to)?g.endPointOffset.to=A.endPointOffset.to:(g.endPointOffset.to=void 0!==I.endPointOffset.to?I.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),Vw(A.label)?g.label=A.label:Vw(g.label)||(g.label=void 0),ju(g,A,"smooth",I),ju(g,A,"shadow",I),ju(g,A,"background",I),void 0!==A.dashes&&null!==A.dashes?g.dashes=A.dashes:!0===C&&null===A.dashes&&(g.dashes=Ph(I.dashes)),void 0!==A.scaling&&null!==A.scaling?(void 0!==A.scaling.min&&(g.scaling.min=A.scaling.min),void 0!==A.scaling.max&&(g.scaling.max=A.scaling.max),ju(g.scaling,A.scaling,"label",I.scaling)):!0===C&&null===A.scaling&&(g.scaling=Ph(I.scaling)),void 0!==A.arrows&&null!==A.arrows)if("string"==typeof A.arrows){const C=A.arrows.toLowerCase();g.arrows.to.enabled=-1!=kh(C).call(C,"to"),g.arrows.middle.enabled=-1!=kh(C).call(C,"middle"),g.arrows.from.enabled=-1!=kh(C).call(C,"from")}else{if("object"!=typeof A.arrows)throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Zh(A.arrows));ju(g.arrows,A.arrows,"to",I.arrows),ju(g.arrows,A.arrows,"middle",I.arrows),ju(g.arrows,A.arrows,"from",I.arrows)}else!0===C&&null===A.arrows&&(g.arrows=Ph(I.arrows));if(void 0!==A.color&&null!==A.color){const e=vu(A.color)?{color:A.color,highlight:A.color,hover:A.color,inherit:!1,opacity:1}:A.color,i=g.color;if(t)Tu(i,I.color,!1,C);else for(const g in i)Object.prototype.hasOwnProperty.call(i,g)&&delete i[g];if(vu(i))i.color=i,i.highlight=i,i.hover=i,i.inherit=!1,void 0===e.opacity&&(i.opacity=1);else{let g=!1;void 0!==e.color&&(i.color=e.color,g=!0),void 0!==e.highlight&&(i.highlight=e.highlight,g=!0),void 0!==e.hover&&(i.hover=e.hover,g=!0),void 0!==e.inherit&&(i.inherit=e.inherit),void 0!==e.opacity&&(i.opacity=Math.min(1,Math.max(0,e.opacity))),!0===g?i.inherit=!1:void 0===i.inherit&&(i.inherit="from")}}else!0===C&&null===A.color&&(g.color=Lu(I.color));!0===C&&null===A.font&&(g.font=Lu(I.font)),Object.prototype.hasOwnProperty.call(A,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),g.selfReference.size=A.selfReferenceSize)}getFormattingValues(){const g=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,A=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,C=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,I=this.options.color.inherit,t={toArrow:g,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:C,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:A,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:I?void 0:this.options.color.color,inheritsColor:I,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(!0===this.chooser){if(this.selected){const g=this.options.selectionWidth;"function"==typeof g?t.width=g(t.width):"number"==typeof g&&(t.width+=g),t.width=Math.max(t.width,.3/this.body.view.scale),t.color=this.options.color.highlight,t.shadow=this.options.shadow.enabled}else if(this.hover){const g=this.options.hoverWidth;"function"==typeof g?t.width=g(t.width):"number"==typeof g&&(t.width+=g),t.width=Math.max(t.width,.3/this.body.view.scale),t.color=this.options.color.hover,t.shadow=this.options.shadow.enabled}}else"function"==typeof this.chooser&&(this.chooser(t,this.options.id,this.selected,this.hover),void 0!==t.color&&(t.inheritsColor=!1),!1===t.shadow&&(t.shadowColor===this.options.shadow.color&&t.shadowSize===this.options.shadow.size&&t.shadowX===this.options.shadow.x&&t.shadowY===this.options.shadow.y||(t.shadow=!0)));else t.shadow=this.options.shadow.enabled,t.width=Math.max(t.width,.3/this.body.view.scale);return t}updateLabelModule(g){const A=[g,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,A),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const g=this.options.smooth;let A=!1,C=!0;return void 0!==this.edgeType&&((this.edgeType instanceof Ux&&!0===g.enabled&&"dynamic"===g.type||this.edgeType instanceof Xx&&!0===g.enabled&&"cubicBezier"===g.type||this.edgeType instanceof Kx&&!0===g.enabled&&"dynamic"!==g.type&&"cubicBezier"!==g.type||this.edgeType instanceof _x&&!1===g.type.enabled)&&(C=!1),!0===C&&(A=this.cleanup())),!0===C?!0===g.enabled?"dynamic"===g.type?(A=!0,this.edgeType=new Ux(this.options,this.body,this.labelModule)):"cubicBezier"===g.type?this.edgeType=new Xx(this.options,this.body,this.labelModule):this.edgeType=new Kx(this.options,this.body,this.labelModule):this.edgeType=new _x(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),A}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(g,A,C){if(void 0!==this.options.value){const I=this.options.scaling.customScalingFunction(g,A,C,this.options.value),t=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){const g=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+I*g}this.options.width=this.options.scaling.min+I*t}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(g){const A=this.getFormattingValues();if(A.hidden)return;const C=this.edgeType.getViaNode();this.edgeType.drawLine(g,A,this.selected,this.hover,C),this.drawLabel(g,C)}drawArrows(g){const A=this.getFormattingValues();if(A.hidden)return;const C=this.edgeType.getViaNode(),I={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,A.fromArrow&&(I.from=this.edgeType.getArrowData(g,"from",C,this.selected,this.hover,A),!1===A.arrowStrikethrough&&(this.edgeType.fromPoint=I.from.core),A.fromArrowSrc&&(I.from.image=this.imagelist.load(A.fromArrowSrc)),A.fromArrowImageWidth&&(I.from.imageWidth=A.fromArrowImageWidth),A.fromArrowImageHeight&&(I.from.imageHeight=A.fromArrowImageHeight)),A.toArrow&&(I.to=this.edgeType.getArrowData(g,"to",C,this.selected,this.hover,A),!1===A.arrowStrikethrough&&(this.edgeType.toPoint=I.to.core),A.toArrowSrc&&(I.to.image=this.imagelist.load(A.toArrowSrc)),A.toArrowImageWidth&&(I.to.imageWidth=A.toArrowImageWidth),A.toArrowImageHeight&&(I.to.imageHeight=A.toArrowImageHeight)),A.middleArrow&&(I.middle=this.edgeType.getArrowData(g,"middle",C,this.selected,this.hover,A),A.middleArrowSrc&&(I.middle.image=this.imagelist.load(A.middleArrowSrc)),A.middleArrowImageWidth&&(I.middle.imageWidth=A.middleArrowImageWidth),A.middleArrowImageHeight&&(I.middle.imageHeight=A.middleArrowImageHeight)),A.fromArrow&&this.edgeType.drawArrowHead(g,A,this.selected,this.hover,I.from),A.middleArrow&&this.edgeType.drawArrowHead(g,A,this.selected,this.hover,I.middle),A.toArrow&&this.edgeType.drawArrowHead(g,A,this.selected,this.hover,I.to)}drawLabel(g,A){if(void 0!==this.options.label){const C=this.from,I=this.to;let t;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(g,this.selected,this.hover),C.id!=I.id){this.labelModule.pointToSelf=!1,t=this.edgeType.getPoint(.5,A),g.save();const C=this._getRotation(g);0!=C.angle&&(g.translate(C.x,C.y),g.rotate(C.angle)),this.labelModule.draw(g,t.x,t.y,this.selected,this.hover),g.restore()}else{this.labelModule.pointToSelf=!0;const A=Yw(g,this.options.selfReference.angle,this.options.selfReference.size,C);t=this._pointOnCircle(A.x,A.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(g,t.x,t.y,this.selected,this.hover)}}}getItemsOnPoint(g){const A=[];if(this.labelModule.visible()){const C=this._getRotation();jw(this.labelModule.getSize(),g,C)&&A.push({edgeId:this.id,labelId:0})}const C={left:g.x,top:g.y};return this.isOverlappingWith(C)&&A.push({edgeId:this.id}),A}isOverlappingWith(g){if(this.connected){const A=10,C=this.from.x,I=this.from.y,t=this.to.x,e=this.to.y,i=g.left,o=g.top;return this.edgeType.getDistanceToEdge(C,I,t,e,i,o)0&&e<0)&&(i+=Math.PI),I.angle=i,I}_pointOnCircle(g,A,C,I){return{x:g+C*Math.cos(I),y:A-C*Math.sin(I)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}class qx{constructor(g,A,C){var I;this.body=g,this.images=A,this.groups=C,this.body.functions.createEdge=GI(I=this.create).call(I,this),this.edgesListeners={add:(g,A)=>{this.add(A.items)},update:(g,A)=>{this.update(A.items)},remove:(g,A)=>{this.remove(A.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(g,A,C,I){if(A===g)return.5;{const C=1/(A-g);return Math.max(0,(I-g)*C)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},Tu(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g,A,C=this;this.body.emitter.on("_forceDisableDynamicCurves",(function(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===g&&(g="continuous");let I=!1;for(const A in C.body.edges)if(Object.prototype.hasOwnProperty.call(C.body.edges,A)){const t=C.body.edges[A],e=C.body.data.edges.get(A);if(null!=e){const A=e.smooth;void 0!==A&&!0===A.enabled&&"dynamic"===A.type&&(void 0===g?t.setOptions({smooth:!1}):t.setOptions({smooth:{type:g}}),I=!0)}}!0===A&&!0===I&&C.body.emitter.emit("_dataChanged")})),this.body.emitter.on("_dataUpdated",(()=>{this.reconnectEdges()})),this.body.emitter.on("refreshEdges",GI(g=this.refresh).call(g,this)),this.body.emitter.on("refresh",GI(A=this.refresh).call(A,this)),this.body.emitter.on("destroy",(()=>{ku(this.edgesListeners,((g,A)=>{this.body.data.edges&&this.body.data.edges.off(A,g)})),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners}))}setOptions(g){if(void 0!==g){Jx.parseOptions(this.options,g,!0,this.defaultOptions,!0);let A=!1;if(void 0!==g.smooth)for(const g in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,g)&&(A=this.body.edges[g].updateEdgeType()||A);if(void 0!==g.font)for(const g in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,g)&&this.body.edges[g].updateLabelModule();void 0===g.hidden&&void 0===g.physics&&!0!==A||this.body.emitter.emit("_dataChanged")}}setData(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const C=this.body.data.edges;if(vw("id",g))this.body.data.edges=g;else if(Wr(g))this.body.data.edges=new fw,this.body.data.edges.add(g);else{if(g)throw new TypeError("Array or DataSet expected");this.body.data.edges=new fw}if(C&&ku(this.edgesListeners,((g,A)=>{C.off(A,g)})),this.body.edges={},this.body.data.edges){ku(this.edgesListeners,((g,A)=>{this.body.data.edges.on(A,g)}));const g=this.body.data.edges.getIds();this.add(g,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===A&&this.body.emitter.emit("_dataChanged")}add(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const C=this.body.edges,I=this.body.data.edges;for(let A=0;A1&&void 0!==arguments[1])||arguments[1];if(0===g.length)return;const C=this.body.edges;ku(g,(g=>{const A=C[g];void 0!==A&&A.remove()})),A&&this.body.emitter.emit("_dataChanged")}refresh(){ku(this.body.edges,((g,A)=>{const C=this.body.data.edges.get(A);void 0!==C&&g.setOptions(C)}))}create(g){return new Jx(g,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let g;const A=this.body.nodes,C=this.body.edges;for(g in A)Object.prototype.hasOwnProperty.call(A,g)&&(A[g].edges=[]);for(g in C)if(Object.prototype.hasOwnProperty.call(C,g)){const A=C[g];A.from=null,A.to=null,A.connect()}}getConnectedNodes(g){const A=[];if(void 0!==this.body.edges[g]){const C=this.body.edges[g];void 0!==C.fromId&&A.push(C.fromId),void 0!==C.toId&&A.push(C.toId)}return A}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const g=[];ku(this.body.edges,((A,C)=>{const I=this.body.nodes[A.toId],t=this.body.nodes[A.fromId];void 0!==I&&!0===I.isCluster||void 0!==t&&!0===t.isCluster||void 0!==I&&void 0!==t||g.push(C)})),this.remove(g,!1)}_addMissingEdges(){const g=this.body.data.edges;if(null==g)return;const A=this.body.edges,C=[];pa(g).call(g,((g,I)=>{void 0===A[I]&&C.push(I)})),this.add(C,!0)}}class $x{constructor(g,A,C){this.body=g,this.physicsBody=A,this.barnesHutTree,this.setOptions(C),this._rng=hu("BARNES HUT SOLVER")}setOptions(g){this.options=g,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(0!==this.options.gravitationalConstant&&this.physicsBody.physicsNodeIndices.length>0){let g;const A=this.body.nodes,C=this.physicsBody.physicsNodeIndices,I=C.length,t=this._formBarnesHutTree(A,C);this.barnesHutTree=t;for(let e=0;e0&&this._getForceContributions(t.root,g)}}_getForceContributions(g,A){this._getForceContribution(g.children.NW,A),this._getForceContribution(g.children.NE,A),this._getForceContribution(g.children.SW,A),this._getForceContribution(g.children.SE,A)}_getForceContribution(g,A){if(g.childrenCount>0){const C=g.centerOfMass.x-A.x,I=g.centerOfMass.y-A.y,t=Math.sqrt(C*C+I*I);t*g.calcSize>this.thetaInversed?this._calculateForces(t,C,I,A,g):4===g.childrenCount?this._getForceContributions(g,A):g.children.data.id!=A.id&&this._calculateForces(t,C,I,A,g)}}_calculateForces(g,A,C,I,t){0===g&&(A=g=.1),this.overlapAvoidanceFactor<1&&I.shape.radius&&(g=Math.max(.1+this.overlapAvoidanceFactor*I.shape.radius,g-I.shape.radius));const e=this.options.gravitationalConstant*t.mass*I.options.mass/Math.pow(g,3),i=A*e,o=C*e;this.physicsBody.forces[I.id].x+=i,this.physicsBody.forces[I.id].y+=o}_formBarnesHutTree(g,A){let C;const I=A.length;let t=g[A[0]].x,e=g[A[0]].y,i=g[A[0]].x,o=g[A[0]].y;for(let C=1;C0&&(si&&(i=s),no&&(o=n))}const s=Math.abs(i-t)-Math.abs(o-e);s>0?(e-=.5*s,o+=.5*s):(t+=.5*s,i-=.5*s);const n=Math.max(1e-5,Math.abs(i-t)),r=.5*n,a=.5*(t+i),d=.5*(e+o),h={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:a-r,maxX:a+r,minY:d-r,maxY:d+r},size:n,calcSize:1/n,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(h.root);for(let t=0;t0&&this._placeInTree(h.root,C);return h}_updateBranchMass(g,A){const C=g.centerOfMass,I=g.mass+A.options.mass,t=1/I;C.x=C.x*g.mass+A.x*A.options.mass,C.x*=t,C.y=C.y*g.mass+A.y*A.options.mass,C.y*=t,g.mass=I;const e=Math.max(Math.max(A.height,A.radius),A.width);g.maxWidth=g.maxWidthA.x?I.maxY>A.y?"NW":"SW":I.maxY>A.y?"NE":"SE",this._placeInRegion(g,A,t)}_placeInRegion(g,A,C){const I=g.children[C];switch(I.childrenCount){case 0:I.children.data=A,I.childrenCount=1,this._updateBranchMass(I,A);break;case 1:I.children.data.x===A.x&&I.children.data.y===A.y?(A.x+=this._rng(),A.y+=this._rng()):(this._splitBranch(I),this._placeInTree(I,A));break;case 4:this._placeInTree(I,A)}}_splitBranch(g){let A=null;1===g.childrenCount&&(A=g.children.data,g.mass=0,g.centerOfMass.x=0,g.centerOfMass.y=0),g.childrenCount=4,g.children.data=null,this._insertRegion(g,"NW"),this._insertRegion(g,"NE"),this._insertRegion(g,"SW"),this._insertRegion(g,"SE"),null!=A&&this._placeInTree(g,A)}_insertRegion(g,A){let C,I,t,e;const i=.5*g.size;switch(A){case"NW":C=g.range.minX,I=g.range.minX+i,t=g.range.minY,e=g.range.minY+i;break;case"NE":C=g.range.minX+i,I=g.range.maxX,t=g.range.minY,e=g.range.minY+i;break;case"SW":C=g.range.minX,I=g.range.minX+i,t=g.range.minY+i,e=g.range.maxY;break;case"SE":C=g.range.minX+i,I=g.range.maxX,t=g.range.minY+i,e=g.range.maxY}g.children[A]={centerOfMass:{x:0,y:0},mass:0,range:{minX:C,maxX:I,minY:t,maxY:e},size:.5*g.size,calcSize:2*g.calcSize,children:{data:null},maxWidth:0,level:g.level+1,childrenCount:0}}_debug(g,A){void 0!==this.barnesHutTree&&(g.lineWidth=1,this._drawBranch(this.barnesHutTree.root,g,A))}_drawBranch(g,A,C){void 0===C&&(C="#FF0000"),4===g.childrenCount&&(this._drawBranch(g.children.NW,A),this._drawBranch(g.children.NE,A),this._drawBranch(g.children.SE,A),this._drawBranch(g.children.SW,A)),A.strokeStyle=C,A.beginPath(),A.moveTo(g.range.minX,g.range.minY),A.lineTo(g.range.maxX,g.range.minY),A.stroke(),A.beginPath(),A.moveTo(g.range.maxX,g.range.minY),A.lineTo(g.range.maxX,g.range.maxY),A.stroke(),A.beginPath(),A.moveTo(g.range.maxX,g.range.maxY),A.lineTo(g.range.minX,g.range.maxY),A.stroke(),A.beginPath(),A.moveTo(g.range.minX,g.range.maxY),A.lineTo(g.range.minX,g.range.minY),A.stroke()}}class gE{constructor(g,A,C){this._rng=hu("REPULSION SOLVER"),this.body=g,this.physicsBody=A,this.setOptions(C)}setOptions(g){this.options=g}solve(){let g,A,C,I,t,e,i,o;const s=this.body.nodes,n=this.physicsBody.physicsNodeIndices,r=this.physicsBody.forces,a=this.options.nodeDistance,d=-2/3/a;for(let h=0;h0){const g=t.edges.length+1,e=this.options.centralGravity*g*t.options.mass;I[t.id].x=A*e,I[t.id].y=C*e}}}class oE{constructor(g){this.body=g,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},fI(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",(()=>{this.initPhysics()})),this.body.emitter.on("_layoutFailed",(()=>{this.layoutFailed=!0})),this.body.emitter.on("resetPhysics",(()=>{this.stopSimulation(),this.ready=!1})),this.body.emitter.on("disablePhysics",(()=>{this.physicsEnabled=!1,this.stopSimulation()})),this.body.emitter.on("restorePhysics",(()=>{this.setOptions(this.options),!0===this.ready&&this.startSimulation()})),this.body.emitter.on("startSimulation",(()=>{!0===this.ready&&this.startSimulation()})),this.body.emitter.on("stopSimulation",(()=>{this.stopSimulation()})),this.body.emitter.on("destroy",(()=>{this.stopSimulation(!1),this.body.emitter.off()})),this.body.emitter.on("_dataChanged",(()=>{this.updatePhysicsData()}))}setOptions(g){if(void 0!==g)if(!1===g)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(!0===g)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,Ou(["stabilization"],this.options,g),ju(this.options,g,"stabilization"),void 0===g.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation());const A=this.options.wind;A&&(("number"!=typeof A.x||Kb(A.x))&&(A.x=0),("number"!=typeof A.y||Kb(A.y))&&(A.y=0)),this.timestep=this.options.timestep}this.init()}init(){let g;"forceAtlas2Based"===this.options.solver?(g=this.options.forceAtlas2Based,this.nodesSolver=new eE(this.body,this.physicsBody,g),this.edgesSolver=new CE(this.body,this.physicsBody,g),this.gravitySolver=new iE(this.body,this.physicsBody,g)):"repulsion"===this.options.solver?(g=this.options.repulsion,this.nodesSolver=new gE(this.body,this.physicsBody,g),this.edgesSolver=new CE(this.body,this.physicsBody,g),this.gravitySolver=new tE(this.body,this.physicsBody,g)):"hierarchicalRepulsion"===this.options.solver?(g=this.options.hierarchicalRepulsion,this.nodesSolver=new AE(this.body,this.physicsBody,g),this.edgesSolver=new IE(this.body,this.physicsBody,g),this.gravitySolver=new tE(this.body,this.physicsBody,g)):(g=this.options.barnesHut,this.nodesSolver=new $x(this.body,this.physicsBody,g),this.edgesSolver=new CE(this.body,this.physicsBody,g),this.gravitySolver=new tE(this.body,this.physicsBody,g)),this.modelOptions=g}initPhysics(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){var g;!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=GI(g=this.simulationStep).call(g,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}stopSimulation(){let g=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===g&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===g&&this.body.emitter.emit("_stopRendering"))}simulationStep(){const g=ta();this.physicsTick();(ta()-g<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}_emitStabilized(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&Al((()=>{this.body.emitter.emit("stabilized",{iterations:g}),this.startedStabilization=!1,this.stabilizationIterations=0}),0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2.3))return!1;return!0}moveNodes(){const g=this.physicsBody.physicsNodeIndices;let A=0,C=0;for(let I=0;II&&(g=g>0?I:-I),g}_performStep(g){const A=this.body.nodes[g],C=this.physicsBody.forces[g];this.options.wind&&(C.x+=this.options.wind.x,C.y+=this.options.wind.y);const I=this.physicsBody.velocities[g];this.previousStates[g]={x:A.x,y:A.y,vx:I.x,vy:I.y},!1===A.options.fixed.x?(I.x=this.calculateComponentVelocity(I.x,C.x,A.options.mass),A.x+=I.x*this.timestep):(C.x=0,I.x=0),!1===A.options.fixed.y?(I.y=this.calculateComponentVelocity(I.y,C.y,A.options.mass),A.y+=I.y*this.timestep):(C.y=0,I.y=0);return Math.sqrt(Math.pow(I.x,2)+Math.pow(I.y,2))}_freezeNodes(){const g=this.body.nodes;for(const A in g)if(Object.prototype.hasOwnProperty.call(g,A)&&g[A].x&&g[A].y){const C=g[A].options.fixed;this.freezeCache[A]={x:C.x,y:C.y},C.x=!0,C.y=!0}}_restoreFrozenNodes(){const g=this.body.nodes;for(const A in g)Object.prototype.hasOwnProperty.call(g,A)&&void 0!==this.freezeCache[A]&&(g[A].options.fixed.x=this.freezeCache[A].x,g[A].options.fixed.y=this.freezeCache[A].y);this.freezeCache={}}stabilize(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;"number"!=typeof g&&(g=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",g)),0!==this.physicsBody.physicsNodeIndices.length?(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=g,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,Al((()=>this._stabilizationBatch()),0)):this.ready=!0}_startStabilizing(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const g=()=>!1===this.stabilized&&this.stabilizationIterations{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&A();let C=0;for(;g()&&C1&&void 0!==arguments[1]?arguments[1]:[],I=1e9,t=-1e9,e=1e9,i=-1e9;if(C.length>0)for(let o=0;oA.shape.boundingBox.left&&(e=A.shape.boundingBox.left),iA.shape.boundingBox.top&&(I=A.shape.boundingBox.top),t1&&void 0!==arguments[1]?arguments[1]:[],I=1e9,t=-1e9,e=1e9,i=-1e9;if(C.length>0)for(let o=0;oA.x&&(e=A.x),iA.y&&(I=A.y),t{delete this.containedEdges[g.id]})),ku(A.containedNodes,((g,A)=>{this.containedNodes[A]=g})),A.containedNodes={},ku(A.containedEdges,((g,A)=>{this.containedEdges[A]=g})),A.containedEdges={},ku(A.edges,(g=>{ku(this.edges,(A=>{var C,I;const t=kh(C=A.clusteringEdgeReplacingIds).call(C,g.id);-1!==t&&(ku(g.clusteringEdgeReplacingIds,(g=>{A.clusteringEdgeReplacingIds.push(g),this.body.edges[g].edgeReplacedById=A.id})),gd(I=A.clusteringEdgeReplacingIds).call(I,t,1))}))})),A.edges=[]}}class rE{constructor(g){this.body=g,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},fI(this.options,this.defaultOptions),this.body.emitter.on("_resetData",(()=>{this.clusteredNodes={},this.clusteredEdges={}}))}clusterByHubsize(g,A){void 0===g?g=this._getHubSize():"object"==typeof g&&(A=this._checkOptions(g),g=this._getHubSize());const C=[];for(let A=0;A=g&&C.push(I.id)}for(let g=0;g0&&void 0!==arguments[0]?arguments[0]:{},A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===g.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");g=this._checkOptions(g);const C={},I={};ku(this.body.nodes,((A,t)=>{A.options&&!0===g.joinCondition(A.options)&&(C[t]=A,ku(A.edges,(g=>{void 0===this.clusteredEdges[g.id]&&(I[g.id]=g)})))})),this._cluster(C,I,g,A)}clusterByEdgeCount(g,A){let C=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];A=this._checkOptions(A);const I=[],t={};let e,i,o;for(let C=0;C0&&ga(n).length>0&&!0===C){const g=function(){for(let g=0;g1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,g,A)}clusterBridges(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,g,A)}clusterByConnection(g,A){var C;let I=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[g])throw new Error("The nodeId given to clusterByConnection does not exist!");const t=this.body.nodes[g];void 0===(A=this._checkOptions(A,t)).clusterNodeProperties.x&&(A.clusterNodeProperties.x=t.x),void 0===A.clusterNodeProperties.y&&(A.clusterNodeProperties.y=t.y),void 0===A.clusterNodeProperties.fixed&&(A.clusterNodeProperties.fixed={},A.clusterNodeProperties.fixed.x=t.options.fixed.x,A.clusterNodeProperties.fixed.y=t.options.fixed.y);const e={},i={},o=t.id,s=sE.cloneOptions(t);e[o]=t;for(let g=0;g-1&&(i[C.id]=C)}}this._cluster(e,i,A,I)}_createClusterEdges(g,A,C,I){let t,e,i,o,s,n;const r=ga(g),a=[];for(let I=0;I0&&void 0!==arguments[0]?arguments[0]:{};return void 0===g.clusterEdgeProperties&&(g.clusterEdgeProperties={}),void 0===g.clusterNodeProperties&&(g.clusterNodeProperties={}),g}_cluster(g,A,C){let I=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const t=[];for(const A in g)Object.prototype.hasOwnProperty.call(g,A)&&void 0!==this.clusteredNodes[A]&&t.push(A);for(let A=0;At?C.x:t,e=C.yi?C.y:i;return{x:.5*(I+t),y:.5*(e+i)}}openCluster(g,A){let C=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===g)throw new Error("No clusterNodeId supplied to openCluster.");const I=this.body.nodes[g];if(void 0===I)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==I.isCluster||void 0===I.containedNodes||void 0===I.containedEdges)throw new Error("The node:"+g+" is not a valid cluster.");const t=this.findNode(g),e=kh(t).call(t,g)-1;if(e>=0){const A=t[e];return this.body.nodes[A]._openChildCluster(g),delete this.body.nodes[g],void(!0===C&&this.body.emitter.emit("_dataChanged"))}const i=I.containedNodes,o=I.containedEdges;if(void 0!==A&&void 0!==A.releaseFunction&&"function"==typeof A.releaseFunction){const g={},C={x:I.x,y:I.y};for(const A in i)if(Object.prototype.hasOwnProperty.call(i,A)){const C=this.body.nodes[A];g[A]={x:C.x,y:C.y}}const t=A.releaseFunction(C,g);for(const g in i)if(Object.prototype.hasOwnProperty.call(i,g)){const A=this.body.nodes[g];void 0!==t[g]&&(A.x=void 0===t[g].x?I.x:t[g].x,A.y=void 0===t[g].y?I.y:t[g].y)}}else ku(i,(function(g){!1===g.options.fixed.x&&(g.x=I.x),!1===g.options.fixed.y&&(g.y=I.y)}));for(const g in i)if(Object.prototype.hasOwnProperty.call(i,g)){const A=this.body.nodes[g];A.vx=I.vx,A.vy=I.vy,A.setOptions({physics:!0}),delete this.clusteredNodes[g]}const s=[];for(let g=0;g0&&t<100;){const g=A.pop();if(void 0===g)continue;const e=this.body.edges[g];if(void 0===e)continue;t++;const i=e.clusteringEdgeReplacingIds;if(void 0===i)I.push(g);else for(let g=0;gI&&(I=e.edges.length),g+=e.edges.length,A+=Math.pow(e.edges.length,2),C+=1}g/=C,A/=C;const t=A-Math.pow(g,2),e=Math.sqrt(t);let i=Math.floor(g+2*e);return i>I&&(i=I),i}_createClusteredEdge(g,A,C,I,t){const e=sE.cloneOptions(C,"edge");Tu(e,I),e.from=g,e.to=A,e.id="clusterEdge:"+nw(),void 0!==t&&Tu(e,t);const i=this.body.functions.createEdge(e);return i.clusteringEdgeReplacingIds=[C.id],i.connect(),this.body.edges[i.id]=i,i}_clusterEdges(g,A,C,I){if(A instanceof Jx){const g=A,C={};C[g.id]=g,A=C}if(g instanceof bx){const A=g,C={};C[A.id]=A,g=C}if(null==C)throw new Error("_clusterEdges: parameter clusterNode required");void 0===I&&(I=C.clusterEdgeProperties),this._createClusterEdges(g,A,C,I);for(const g in A)if(Object.prototype.hasOwnProperty.call(A,g)&&void 0!==this.body.edges[g]){const A=this.body.edges[g];this._backupEdgeOptions(A),A.setOptions({physics:!1})}for(const A in g)Object.prototype.hasOwnProperty.call(g,A)&&(this.clusteredNodes[A]={clusterId:C.id,node:this.body.nodes[A]},this.body.nodes[A].setOptions({physics:!1}))}_getClusterNodeForNode(g){if(void 0===g)return;const A=this.clusteredNodes[g];if(void 0===A)return;const C=A.clusterId;return void 0!==C?this.body.nodes[C]:void 0}_filter(g,A){const C=[];return ku(g,(g=>{A(g)&&C.push(g)})),C}_updateState(){let g;const A=[],C={},I=g=>{ku(this.body.nodes,(A=>{!0===A.isCluster&&g(A)}))};for(g in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,g))continue;void 0===this.body.nodes[g]&&A.push(g)}I((function(g){for(let C=0;C{const A=this.body.edges[g];void 0!==A&&A.endPointsValid()||(C[g]=g)})),I((function(g){ku(g.containedEdges,((g,A)=>{g.endPointsValid()||C[A]||(C[A]=A)}))})),ku(this.body.edges,((g,A)=>{let I=!0;const t=g.clusteringEdgeReplacingIds;if(void 0!==t){let g=0;ku(t,(A=>{const C=this.body.edges[A];void 0!==C&&C.endPointsValid()&&(g+=1)})),I=g>0}g.endPointsValid()&&I||(C[A]=A)})),I((g=>{ku(C,(A=>{delete g.containedEdges[A],ku(g.edges,((I,t)=>{I.id!==A?I.clusteringEdgeReplacingIds=this._filter(I.clusteringEdgeReplacingIds,(function(g){return!C[g]})):g.edges[t]=null})),g.edges=this._filter(g.edges,(function(g){return null!==g}))}))})),ku(C,(g=>{delete this.clusteredEdges[g]})),ku(C,(g=>{delete this.body.edges[g]}));ku(ga(this.body.edges),(g=>{const A=this.body.edges[g],C=this._isClusteredNode(A.fromId)||this._isClusteredNode(A.toId);if(C!==this._isClusteredEdge(A.id))if(C){const g=this._getClusterNodeForNode(A.fromId);void 0!==g&&this._clusterEdges(this.body.nodes[A.fromId],A,g);const C=this._getClusterNodeForNode(A.toId);void 0!==C&&this._clusterEdges(this.body.nodes[A.toId],A,C)}else delete this._clusterEdges[g],this._restoreEdge(A)}));let t=!1,e=!0;for(;e;){const g=[];I((function(A){const C=ga(A.containedNodes).length,I=!0===A.options.allowSingleNodeCluster;(I&&C<1||!I&&C<2)&&g.push(A.id)}));for(let A=0;A0,t=t||e}t&&this._updateState()}_isClusteredNode(g){return void 0!==this.clusteredNodes[g]}_isClusteredEdge(g){return void 0!==this.clusteredEdges[g]}}class aE{constructor(g,A){this.body=g,this.canvas=A,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},fI(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var g;this.body.emitter.on("dragStart",(()=>{this.dragging=!0})),this.body.emitter.on("dragEnd",(()=>{this.dragging=!1})),this.body.emitter.on("zoom",(()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=Al((()=>{var g;this.zooming=!1,GI(g=this._requestRedraw).call(g,this)()}),250)})),this.body.emitter.on("_resizeNodes",(()=>{this._resizeNodes()})),this.body.emitter.on("_redraw",(()=>{!1===this.renderingActive&&this._redraw()})),this.body.emitter.on("_blockRedraw",(()=>{this.allowRedraw=!1})),this.body.emitter.on("_allowRedraw",(()=>{this.allowRedraw=!0,this.redrawRequested=!1})),this.body.emitter.on("_requestRedraw",GI(g=this._requestRedraw).call(g,this)),this.body.emitter.on("_startRendering",(()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()})),this.body.emitter.on("_stopRendering",(()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0})),this.body.emitter.on("destroy",(()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()}))}setOptions(g){if(void 0!==g){Eu(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,g)}}_startRendering(){var g;!0===this.renderingActive&&(void 0===this.requestAnimationFrameRequestId&&(this.requestAnimationFrameRequestId=window.requestAnimationFrame(GI(g=this._renderStep).call(g,this),this.simulationInterval)))}_renderStep(){!0===this.renderingActive&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,window.requestAnimationFrame((()=>{this._redraw(!1)})))}_redraw(){let g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const A={drawExternalLabels:null};0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.canvas.setTransform();const C=this.canvas.getContext(),I=this.canvas.frame.canvas.clientWidth,t=this.canvas.frame.canvas.clientHeight;if(C.clearRect(0,0,I,t),0===this.canvas.frame.clientWidth)return;if(C.save(),C.translate(this.body.view.translation.x,this.body.view.translation.y),C.scale(this.body.view.scale,this.body.view.scale),C.beginPath(),this.body.emitter.emit("beforeDrawing",C),C.closePath(),!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(C),!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag){const{drawExternalLabels:I}=this._drawNodes(C,g);A.drawExternalLabels=I}!1===g&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawArrows(C),null!=A.drawExternalLabels&&A.drawExternalLabels(),!1===g&&this._drawSelectionBox(C),C.beginPath(),this.body.emitter.emit("afterDrawing",C),C.closePath(),C.restore(),!0===g&&C.clearRect(0,0,I,t)}}_resizeNodes(){this.canvas.setTransform();const g=this.canvas.getContext();g.save(),g.translate(this.body.view.translation.x,this.body.view.translation.y),g.scale(this.body.view.scale,this.body.view.scale);const A=this.body.nodes;let C;for(const I in A)Object.prototype.hasOwnProperty.call(A,I)&&(C=A[I],C.resize(g),C.updateBoundingBox(g,C.selected));g.restore()}_drawNodes(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const C=this.body.nodes,I=this.body.nodeIndices;let t;const e=[],i=[],o=this.canvas.DOMtoCanvas({x:-20,y:-20}),s=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),n={top:o.y,left:o.x,bottom:s.y,right:s.x},r=[];for(let o=0;o{for(const g of r)g()}}}_drawEdges(g){const A=this.body.edges,C=this.body.edgeIndices;for(let I=0;I{0!==g.width&&(this.body.view.translation.x=.5*g.width),0!==g.height&&(this.body.view.translation.y=.5*g.height)})),this.body.emitter.on("setSize",GI(g=this.setSize).call(g,this)),this.body.emitter.on("destroy",(()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()}))}setOptions(g){if(void 0!==g){Eu(["width","height","autoResize"],this.options,g)}if(this._cleanUp(),!0===this.options.autoResize){var A;if(window.ResizeObserver){const g=new ResizeObserver((()=>{!0===this.setSize()&&this.body.emitter.emit("_requestRedraw")})),{frame:A}=this;g.observe(A),this._cleanupCallbacks.push((()=>{g.unobserve(A)}))}else{const g=dE((()=>{!0===this.setSize()&&this.body.emitter.emit("_requestRedraw")}),1e3);this._cleanupCallbacks.push((()=>{clearInterval(g)}))}const g=GI(A=this._onResize).call(A,this);window.addEventListener("resize",g),this._cleanupCallbacks.push((()=>{window.removeEventListener("resize",g)}))}}_cleanUp(){var g,A,C;pa(g=Ta(A=gd(C=this._cleanupCallbacks).call(C,0)).call(A)).call(g,(g=>{try{g()}catch(g){console.error(g)}}))}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/g,this.cameraState.previousHeight=this.frame.canvas.height/g,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/g,y:.5*this.frame.canvas.height/g}))}_setCameraState(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){const g=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,A=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let C=this.cameraState.scale;1!=g&&1!=A?C=.5*this.cameraState.scale*(g+A):1!=g?C=this.cameraState.scale*g:1!=A&&(C=this.cameraState.scale*A),this.body.view.scale=C;const I=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),t={x:I.x-this.cameraState.position.x,y:I.y-this.cameraState.position.y};this.body.view.translation.x+=t.x*this.body.view.scale,this.body.view.translation.y+=t.y*this.body.view.scale}}_prepareValue(g){if("number"==typeof g)return g+"px";if("string"==typeof g){if(-1!==kh(g).call(g,"%")||-1!==kh(g).call(g,"px"))return g;if(-1===kh(g).call(g,"%"))return g+"px"}throw new Error("Could not use the value supplied for width or height:"+g)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{const g=document.createElement("DIV");g.style.color="red",g.style.fontWeight="bold",g.style.padding="10px",g.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(g)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new qu(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:qu.DIRECTION_ALL}),hE(this.hammer,(g=>{this.body.eventListeners.onTouch(g)})),this.hammer.on("tap",(g=>{this.body.eventListeners.onTap(g)})),this.hammer.on("doubletap",(g=>{this.body.eventListeners.onDoubleTap(g)})),this.hammer.on("press",(g=>{this.body.eventListeners.onHold(g)})),this.hammer.on("panstart",(g=>{this.body.eventListeners.onDragStart(g)})),this.hammer.on("panmove",(g=>{this.body.eventListeners.onDrag(g)})),this.hammer.on("panend",(g=>{this.body.eventListeners.onDragEnd(g)})),this.hammer.on("pinch",(g=>{this.body.eventListeners.onPinch(g)})),this.frame.canvas.addEventListener("wheel",(g=>{this.body.eventListeners.onMouseWheel(g)})),this.frame.canvas.addEventListener("mousemove",(g=>{this.body.eventListeners.onMouseMove(g)})),this.frame.canvas.addEventListener("contextmenu",(g=>{this.body.eventListeners.onContext(g)})),this.hammerFrame=new qu(this.frame),lE(this.hammerFrame,(g=>{this.body.eventListeners.onRelease(g)}))}setSize(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;g=this._prepareValue(g),A=this._prepareValue(A);let C=!1;const I=this.frame.canvas.width,t=this.frame.canvas.height,e=this.pixelRatio;if(this._setPixelRatio(),g!=this.options.width||A!=this.options.height||this.frame.style.width!=g||this.frame.style.height!=A)this._getCameraState(e),this.frame.style.width=g,this.frame.style.height=A,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=g,this.options.height=A,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},C=!0;else{const g=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),A=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===g&&this.frame.canvas.height===A||this._getCameraState(e),this.frame.canvas.width!==g&&(this.frame.canvas.width=g,C=!0),this.frame.canvas.height!==A&&(this.frame.canvas.height=A,C=!0)}return!0===C&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(I/this.pixelRatio),oldHeight:Math.round(t/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,C}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");let A=1;"undefined"!=typeof window&&(A=window.devicePixelRatio||1);return A/(g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1)}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const g=this.getContext();if(void 0===g)throw new Error("Could not get canvax context");g.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(g){return(g-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(g){return g*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(g){return(g-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(g){return g*this.body.view.scale+this.body.view.translation.y}canvasToDOM(g){return{x:this._XconvertCanvasToDOM(g.x),y:this._YconvertCanvasToDOM(g.y)}}DOMtoCanvas(g){return{x:this._XconvertDOMtoCanvas(g.x),y:this._YconvertDOMtoCanvas(g.y)}}}class uE{constructor(g,A){var C,I;this.body=g,this.canvas=A,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",GI(C=this.fit).call(C,this)),this.body.emitter.on("animationFinished",(()=>{this.body.emitter.emit("_stopRendering")})),this.body.emitter.on("unlockNode",GI(I=this.releaseNode).call(I,this))}setOptions(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=g}fit(g){let A=arguments.length>1&&void 0!==arguments[1]&&arguments[1];g=function(g,A){const C=fI({nodes:A,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},null!=g?g:{});if(!Wr(C.nodes))throw new TypeError("Nodes has to be an array of ids.");if(0===C.nodes.length&&(C.nodes=A),!("number"==typeof C.minZoomLevel&&C.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!("number"==typeof C.maxZoomLevel&&C.minZoomLevel<=C.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return C}(g,this.body.nodeIndices);const C=this.canvas.frame.canvas.clientWidth,I=this.canvas.frame.canvas.clientHeight;let t,e;if(0===C||0===I)e=1,t=sE.getRange(this.body.nodes,g.nodes);else if(!0===A){let A=0;for(const g in this.body.nodes)if(Object.prototype.hasOwnProperty.call(this.body.nodes,g)){!0===this.body.nodes[g].predefinedPosition&&(A+=1)}if(A>.5*this.body.nodeIndices.length)return void this.fit(g,!1);t=sE.getRange(this.body.nodes,g.nodes);e=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;e*=Math.min(C/600,I/600)}else{this.body.emitter.emit("_resizeNodes"),t=sE.getRange(this.body.nodes,g.nodes);const A=C/(1.1*Math.abs(t.maxX-t.minX)),i=I/(1.1*Math.abs(t.maxY-t.minY));e=A<=i?A:i}e>g.maxZoomLevel?e=g.maxZoomLevel:e1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[g]){const C={x:this.body.nodes[g].x,y:this.body.nodes[g].y};A.position=C,A.lockedOnNode=g,this.moveTo(A)}else console.error("Node: "+g+" cannot be found.")}moveTo(g){if(void 0!==g){if(null!=g.offset){if(null!=g.offset.x){if(g.offset.x=+g.offset.x,!_b(g.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else g.offset.x=0;if(null!=g.offset.y){if(g.offset.y=+g.offset.y,!_b(g.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else g.offset.x=0}else g.offset={x:0,y:0};if(null!=g.position){if(null!=g.position.x){if(g.position.x=+g.position.x,!_b(g.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else g.position.x=0;if(null!=g.position.y){if(g.position.y=+g.position.y,!_b(g.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else g.position.x=0}else g.position=this.getViewPosition();if(null!=g.scale){if(g.scale=+g.scale,!(g.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else g.scale=this.body.view.scale;void 0===g.animation&&(g.animation={duration:0}),!1===g.animation&&(g.animation={duration:0}),!0===g.animation&&(g.animation={}),void 0===g.animation.duration&&(g.animation.duration=1e3),void 0===g.animation.easingFunction&&(g.animation.easingFunction="easeInOutQuad"),this.animateView(g)}else g={}}animateView(g){if(void 0===g)return;this.animationEasingFunction=g.animation.easingFunction,this.releaseNode(),!0===g.locked&&(this.lockedOnNodeId=g.lockedOnNode,this.lockedOnNodeOffset=g.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=g.scale,this.body.view.scale=this.targetScale;const A=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),C=A.x-g.position.x,I=A.y-g.position.y;var t,e;(this.targetTranslation={x:this.sourceTranslation.x+C*this.targetScale+g.offset.x,y:this.sourceTranslation.y+I*this.targetScale+g.offset.y},0===g.animation.duration)?null!=this.lockedOnNodeId?(this.viewFunction=GI(t=this._lockedRedraw).call(t,this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*g.animation.duration*.001)||1/60,this.animationEasingFunction=g.animation.easingFunction,this.viewFunction=GI(e=this._transitionRedraw).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}_lockedRedraw(){const g=this.body.nodes[this.lockedOnNodeId].x,A=this.body.nodes[this.lockedOnNodeId].y,C=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),I=C.x-g,t=C.y-A,e=this.body.view.translation,i={x:e.x+I*this.body.view.scale+this.lockedOnNodeOffset.x,y:e.y+t*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=i}releaseNode(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let g=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===g?1:this.easingTime;const A=Vu[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*A,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*A,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*A},this.easingTime>=1){var C;if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,null!=this.lockedOnNodeId)this.viewFunction=GI(C=this._lockedRedraw).call(C,this),this.body.emitter.on("initRedraw",this.viewFunction);this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}function pE(g){var A,C=g&&g.preventDefault||!1,I=g&&g.container||window,t={},e={keydown:{},keyup:{}},i={};for(A=97;A<=122;A++)i[String.fromCharCode(A)]={code:A-97+65,shift:!1};for(A=65;A<=90;A++)i[String.fromCharCode(A)]={code:A,shift:!0};for(A=0;A<=9;A++)i[""+A]={code:48+A,shift:!1};for(A=1;A<=12;A++)i["F"+A]={code:111+A,shift:!1};for(A=0;A<=9;A++)i["num"+A]={code:96+A,shift:!1};i["num*"]={code:106,shift:!1},i["num+"]={code:107,shift:!1},i["num-"]={code:109,shift:!1},i["num/"]={code:111,shift:!1},i["num."]={code:110,shift:!1},i.left={code:37,shift:!1},i.up={code:38,shift:!1},i.right={code:39,shift:!1},i.down={code:40,shift:!1},i.space={code:32,shift:!1},i.enter={code:13,shift:!1},i.shift={code:16,shift:void 0},i.esc={code:27,shift:!1},i.backspace={code:8,shift:!1},i.tab={code:9,shift:!1},i.ctrl={code:17,shift:!1},i.alt={code:18,shift:!1},i.delete={code:46,shift:!1},i.pageup={code:33,shift:!1},i.pagedown={code:34,shift:!1},i["="]={code:187,shift:!1},i["-"]={code:189,shift:!1},i["]"]={code:221,shift:!1},i["["]={code:219,shift:!1};var o=function(g){n(g,"keydown")},s=function(g){n(g,"keyup")},n=function(g,A){if(void 0!==e[A][g.keyCode]){for(var I=e[A][g.keyCode],t=0;t{this.activated=!0,this.configureKeyboardBindings()})),this.body.emitter.on("deactivate",(()=>{this.activated=!1,this.configureKeyboardBindings()})),this.body.emitter.on("destroy",(()=>{void 0!==this.keycharm&&this.keycharm.destroy()})),this.options={}}setOptions(g){void 0!==g&&(this.options=g,this.create())}create(){!0===this.options.navigationButtons?!1===this.iconsCreated&&this.loadNavigationElements():!0===this.iconsCreated&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(0!=this.navigationHammers.length){for(let g=0;g{this._stopMovement()})),this.navigationHammers.push(t),this.iconsCreated=!0}bindToRedraw(g){var A;void 0===this.boundFunctions[g]&&(this.boundFunctions[g]=GI(A=this[g]).call(A,this),this.body.emitter.on("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_startRendering"))}unbindFromRedraw(g){void 0!==this.boundFunctions[g]&&(this.body.emitter.off("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[g])}_fit(){(new Date).valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=(new Date).valueOf())}_stopMovement(){for(const g in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,g)&&(this.body.emitter.off("initRedraw",this.boundFunctions[g]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const g=this.body.view.scale,A=this.body.view.scale*(1+this.options.keyboard.speed.zoom),C=this.body.view.translation,I=A/g,t=(1-I)*this.canvas.canvasViewCenter.x+C.x*I,e=(1-I)*this.canvas.canvasViewCenter.y+C.y*I;this.body.view.scale=A,this.body.view.translation={x:t,y:e},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const g=this.body.view.scale,A=this.body.view.scale/(1+this.options.keyboard.speed.zoom),C=this.body.view.translation,I=A/g,t=(1-I)*this.canvas.canvasViewCenter.x+C.x*I,e=(1-I)*this.canvas.canvasViewCenter.y+C.y*I;this.body.view.scale=A,this.body.view.translation={x:t,y:e},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){var g,A,C,I,t,e,i,o,s,n,r,a,d,h,l,c,u,p,f,b,m,v,y,w;(void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled)&&(!0===this.options.keyboard.bindToWindow?this.keycharm=pE({container:window,preventDefault:!0}):this.keycharm=pE({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(GI(g=this.keycharm).call(g,"up",(()=>{this.bindToRedraw("_moveUp")}),"keydown"),GI(A=this.keycharm).call(A,"down",(()=>{this.bindToRedraw("_moveDown")}),"keydown"),GI(C=this.keycharm).call(C,"left",(()=>{this.bindToRedraw("_moveLeft")}),"keydown"),GI(I=this.keycharm).call(I,"right",(()=>{this.bindToRedraw("_moveRight")}),"keydown"),GI(t=this.keycharm).call(t,"=",(()=>{this.bindToRedraw("_zoomIn")}),"keydown"),GI(e=this.keycharm).call(e,"num+",(()=>{this.bindToRedraw("_zoomIn")}),"keydown"),GI(i=this.keycharm).call(i,"num-",(()=>{this.bindToRedraw("_zoomOut")}),"keydown"),GI(o=this.keycharm).call(o,"-",(()=>{this.bindToRedraw("_zoomOut")}),"keydown"),GI(s=this.keycharm).call(s,"[",(()=>{this.bindToRedraw("_zoomOut")}),"keydown"),GI(n=this.keycharm).call(n,"]",(()=>{this.bindToRedraw("_zoomIn")}),"keydown"),GI(r=this.keycharm).call(r,"pageup",(()=>{this.bindToRedraw("_zoomIn")}),"keydown"),GI(a=this.keycharm).call(a,"pagedown",(()=>{this.bindToRedraw("_zoomOut")}),"keydown"),GI(d=this.keycharm).call(d,"up",(()=>{this.unbindFromRedraw("_moveUp")}),"keyup"),GI(h=this.keycharm).call(h,"down",(()=>{this.unbindFromRedraw("_moveDown")}),"keyup"),GI(l=this.keycharm).call(l,"left",(()=>{this.unbindFromRedraw("_moveLeft")}),"keyup"),GI(c=this.keycharm).call(c,"right",(()=>{this.unbindFromRedraw("_moveRight")}),"keyup"),GI(u=this.keycharm).call(u,"=",(()=>{this.unbindFromRedraw("_zoomIn")}),"keyup"),GI(p=this.keycharm).call(p,"num+",(()=>{this.unbindFromRedraw("_zoomIn")}),"keyup"),GI(f=this.keycharm).call(f,"num-",(()=>{this.unbindFromRedraw("_zoomOut")}),"keyup"),GI(b=this.keycharm).call(b,"-",(()=>{this.unbindFromRedraw("_zoomOut")}),"keyup"),GI(m=this.keycharm).call(m,"[",(()=>{this.unbindFromRedraw("_zoomOut")}),"keyup"),GI(v=this.keycharm).call(v,"]",(()=>{this.unbindFromRedraw("_zoomIn")}),"keyup"),GI(y=this.keycharm).call(y,"pageup",(()=>{this.unbindFromRedraw("_zoomIn")}),"keyup"),GI(w=this.keycharm).call(w,"pagedown",(()=>{this.unbindFromRedraw("_zoomOut")}),"keyup")))}}class bE{constructor(g,A,C){var I,t,e,i,o,s,n,r,a,d,h,l,c;this.body=g,this.canvas=A,this.selectionHandler=C,this.navigationHandler=new fE(g,A),this.body.eventListeners.onTap=GI(I=this.onTap).call(I,this),this.body.eventListeners.onTouch=GI(t=this.onTouch).call(t,this),this.body.eventListeners.onDoubleTap=GI(e=this.onDoubleTap).call(e,this),this.body.eventListeners.onHold=GI(i=this.onHold).call(i,this),this.body.eventListeners.onDragStart=GI(o=this.onDragStart).call(o,this),this.body.eventListeners.onDrag=GI(s=this.onDrag).call(s,this),this.body.eventListeners.onDragEnd=GI(n=this.onDragEnd).call(n,this),this.body.eventListeners.onMouseWheel=GI(r=this.onMouseWheel).call(r,this),this.body.eventListeners.onPinch=GI(a=this.onPinch).call(a,this),this.body.eventListeners.onMouseMove=GI(d=this.onMouseMove).call(d,this),this.body.eventListeners.onRelease=GI(h=this.onRelease).call(h,this),this.body.eventListeners.onContext=GI(l=this.onContext).call(l,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=GI(c=this.getPointer).call(c,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},fI(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",(()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer}))}setOptions(g){if(void 0!==g){Ou(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,g),ju(this.options,g,"keyboard"),g.tooltip&&(fI(this.options.tooltip,g.tooltip),g.tooltip.color&&(this.options.tooltip.color=zu(g.tooltip.color)))}this.navigationHandler.setOptions(this.options)}getPointer(g){return{x:g.x-(A=this.canvas.frame.canvas,A.getBoundingClientRect().left),y:g.y-Nu(this.canvas.frame.canvas)};var A}onTouch(g){(new Date).valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(g.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=(new Date).valueOf())}onTap(g){const A=this.getPointer(g.center),C=this.selectionHandler.options.multiselect&&(g.changedPointers[0].ctrlKey||g.changedPointers[0].metaKey);this.checkSelectionChanges(A,C),this.selectionHandler.commitAndEmit(A,g),this.selectionHandler.generateClickEvent("click",g,A)}onDoubleTap(g){const A=this.getPointer(g.center);this.selectionHandler.generateClickEvent("doubleClick",g,A)}onHold(g){const A=this.getPointer(g.center),C=this.selectionHandler.options.multiselect;this.checkSelectionChanges(A,C),this.selectionHandler.commitAndEmit(A,g),this.selectionHandler.generateClickEvent("click",g,A),this.selectionHandler.generateClickEvent("hold",g,A)}onRelease(g){if((new Date).valueOf()-this.touchTime>10){const A=this.getPointer(g.center);this.selectionHandler.generateClickEvent("release",g,A),this.touchTime=(new Date).valueOf()}}onContext(g){const A=this.getPointer({x:g.clientX,y:g.clientY});this.selectionHandler.generateClickEvent("oncontext",g,A)}checkSelectionChanges(g){!0===(arguments.length>1&&void 0!==arguments[1]&&arguments[1])?this.selectionHandler.selectAdditionalOnPoint(g):this.selectionHandler.selectOnPoint(g)}_determineDifference(g,A){const C=function(g,A){const C=[];for(let I=0;I{const A=g.node;!1===g.xFixed&&(A.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(g.x)+I)),!1===g.yFixed&&(A.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(g.y)+t))})),this.body.emitter.emit("startSimulation")}else{if(g.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",g,A,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(g);this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(A.x),y:this.canvas._YconvertDOMtoCanvas(A.y)},this.body.emitter.emit("_requestRedraw")}if(!0===this.options.dragView&&!g.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",g,A,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(g);const C=A.x-this.drag.pointer.x,I=A.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+C,y:this.drag.translation.y+I},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(g){if(this.drag.dragging=!1,this.body.selectionBox.show){var A;this.body.selectionBox.show=!1;const C=this.body.selectionBox.position,I={minX:Math.min(C.start.x,C.end.x),minY:Math.min(C.start.y,C.end.y),maxX:Math.max(C.start.x,C.end.x),maxY:Math.max(C.start.y,C.end.y)},t=Gd(A=this.body.nodeIndices).call(A,(g=>{const A=this.body.nodes[g];return A.x>=I.minX&&A.x<=I.maxX&&A.y>=I.minY&&A.y<=I.maxY}));pa(t).call(t,(g=>this.selectionHandler.selectObject(this.body.nodes[g])));const e=this.getPointer(g.center);this.selectionHandler.commitAndEmit(e,g),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const A=this.drag.selection;A&&A.length?(pa(A).call(A,(function(g){g.node.options.fixed.x=g.xFixed,g.node.options.fixed.y=g.yFixed})),this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",g,this.getPointer(g.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(g){const A=this.getPointer(g.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);const C=this.pinch.scale*g.scale;this.zoom(C,A)}zoom(g,A){if(!0===this.options.zoomView){const C=this.body.view.scale;let I;g<1e-5&&(g=1e-5),g>10&&(g=10),void 0!==this.drag&&!0===this.drag.dragging&&(I=this.canvas.DOMtoCanvas(this.drag.pointer));const t=this.body.view.translation,e=g/C,i=(1-e)*A.x+t.x*e,o=(1-e)*A.y+t.y*e;if(this.body.view.scale=g,this.body.view.translation={x:i,y:o},null!=I){const g=this.canvas.canvasToDOM(I);this.drag.pointer.x=g.x,this.drag.pointer.y=g.y}this.body.emitter.emit("_requestRedraw"),Cthis._checkShowPopup(A)),this.options.tooltipDelay))),!0===this.options.hover&&this.selectionHandler.hoverObject(g,A)}_checkShowPopup(g){const A=this.canvas._XconvertDOMtoCanvas(g.x),C=this.canvas._YconvertDOMtoCanvas(g.y),I={left:A,top:C,right:A,bottom:C},t=void 0===this.popupObj?void 0:this.popupObj.id;let e=!1,i="node";if(void 0===this.popupObj){const g=this.body.nodeIndices,A=this.body.nodes;let C;const t=[];for(let i=0;i0&&(this.popupObj=A[t[t.length-1]],e=!0)}if(void 0===this.popupObj&&!1===e){const g=this.body.edgeIndices,A=this.body.edges;let C;const t=[];for(let e=0;e0&&(this.popupObj=A[t[t.length-1]],i="edge")}void 0!==this.popupObj?this.popupObj.id!==t&&(void 0===this.popup&&(this.popup=new $u(this.canvas.frame)),this.popup.popupTargetType=i,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(g.x+3,g.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(g){const A=this.selectionHandler._pointerToPositionObject(g);let C=!1;if("node"===this.popup.popupTargetType){if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(C=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(A),!0===C)){const A=this.selectionHandler.getNodeAt(g);C=void 0!==A&&A.id===this.popup.popupTargetId}}else void 0===this.selectionHandler.getNodeAt(g)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(C=this.body.edges[this.popup.popupTargetId].isOverlappingWith(A));!1===C&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var mE=u,vE=nb,yE=sf.getWeakData,wE=Wf,xE=CC,EE=Q,OE=gg,TE=jf,DE=qg,NE=Bi.set,kE=Bi.getterFor,RE=Yi.find,PE=Yi.findIndex,ME=mE([].splice),zE=0,BE=function(g){return g.frozen||(g.frozen=new ZE)},ZE=function(){this.entries=[]},SE=function(g,A){return RE(g.entries,(function(g){return g[0]===A}))};ZE.prototype={get:function(g){var A=SE(this,g);if(A)return A[1]},has:function(g){return!!SE(this,g)},set:function(g,A){var C=SE(this,g);C?C[1]=A:this.entries.push([g,A])},delete:function(g){var A=PE(this.entries,(function(A){return A[0]===g}));return~A&&ME(this.entries,A,1),!!~A}};var FE,GE={getConstructor:function(g,A,C,I){var t=g((function(g,t){wE(g,e),NE(g,{type:A,id:zE++,frozen:void 0}),EE(t)||TE(t,g[I],{that:g,AS_ENTRIES:C})})),e=t.prototype,i=kE(A),o=function(g,A,C){var I=i(g),t=yE(xE(A),!0);return!0===t?BE(I).set(A,C):t[I.id]=C,g};return vE(e,{delete:function(g){var A=i(this);if(!OE(g))return!1;var C=yE(g);return!0===C?BE(A).delete(g):C&&DE(C,A.id)&&delete C[A.id]},has:function(g){var A=i(this);if(!OE(g))return!1;var C=yE(g);return!0===C?BE(A).has(g):C&&DE(C,A.id)}}),vE(e,C?{get:function(g){var A=i(this);if(OE(g)){var C=yE(g);return!0===C?BE(A).get(g):C?C[A.id]:void 0}},set:function(g,A){return o(this,g,A)}}:{add:function(g){return o(this,g,!0)}}),t}},LE=Qp,jE=t,VE=u,YE=nb,WE=sf,QE=ob,UE=GE,KE=gg,HE=Bi.enforce,XE=e,_E=vi,JE=Object,qE=Array.isArray,$E=JE.isExtensible,gO=JE.isFrozen,AO=JE.isSealed,CO=JE.freeze,IO=JE.seal,tO={},eO={},iO=!jE.ActiveXObject&&"ActiveXObject"in jE,oO=function(g){return function(){return g(this,arguments.length?arguments[0]:void 0)}},sO=QE("WeakMap",oO,UE),nO=sO.prototype,rO=VE(nO.set);if(_E)if(iO){FE=UE.getConstructor(oO,"WeakMap",!0),WE.enable();var aO=VE(nO.delete),dO=VE(nO.has),hO=VE(nO.get);YE(nO,{delete:function(g){if(KE(g)&&!$E(g)){var A=HE(this);return A.frozen||(A.frozen=new FE),aO(this,g)||A.frozen.delete(g)}return aO(this,g)},has:function(g){if(KE(g)&&!$E(g)){var A=HE(this);return A.frozen||(A.frozen=new FE),dO(this,g)||A.frozen.has(g)}return dO(this,g)},get:function(g){if(KE(g)&&!$E(g)){var A=HE(this);return A.frozen||(A.frozen=new FE),dO(this,g)?hO(this,g):A.frozen.get(g)}return hO(this,g)},set:function(g,A){if(KE(g)&&!$E(g)){var C=HE(this);C.frozen||(C.frozen=new FE),dO(this,g)?rO(this,g,A):C.frozen.set(g,A)}else rO(this,g,A);return this}})}else LE&&XE((function(){var g=CO([]);return rO(new sO,g,1),!gO(g)}))&&YE(nO,{set:function(g,A){var C;return qE(g)&&(gO(g)?C=tO:AO(g)&&(C=eO)),rO(this,g,A),C===tO&&CO(g),C===eO&&IO(g),this}});var lO,cO,uO,pO,fO,bO=C(Ag.WeakMap);function mO(g,A,C,I){if("a"===C&&!I)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof A?g!==A||!I:!A.has(g))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===C?I:"a"===C?I.call(g):I?I.value:A.get(g)}function vO(g,A,C,I,t){if("m"===I)throw new TypeError("Private method is not writable");if("a"===I&&!t)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof A?g!==A||!t:!A.has(g))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===I?t.call(g,C):t?t.value=C:A.set(g,C),C}function yO(g,A){const C=new Wv;for(const I of A)g.has(I)||C.add(I);return C}"function"==typeof SuppressedError&&SuppressedError;class wO{constructor(){lO.set(this,new Wv),cO.set(this,new Wv)}get size(){return mO(this,cO,"f").size}add(){for(var g=arguments.length,A=new Array(g),C=0;C0&&void 0!==arguments[0]?arguments[0]:()=>{};uO.set(this,new wO),pO.set(this,new wO),fO.set(this,void 0),vO(this,fO,g,"f")}get sizeNodes(){return mO(this,uO,"f").size}get sizeEdges(){return mO(this,pO,"f").size}getNodes(){return mO(this,uO,"f").getSelection()}getEdges(){return mO(this,pO,"f").getSelection()}addNodes(){mO(this,uO,"f").add(...arguments)}addEdges(){mO(this,pO,"f").add(...arguments)}deleteNodes(g){mO(this,uO,"f").delete(g)}deleteEdges(g){mO(this,pO,"f").delete(g)}clear(){mO(this,uO,"f").clear(),mO(this,pO,"f").clear()}commit(){const g={nodes:mO(this,uO,"f").commit(),edges:mO(this,pO,"f").commit()};for(var A=arguments.length,C=new Array(A),I=0;I{this.updateSelection()}))}setOptions(g){if(void 0!==g){Eu(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,g)}}selectOnPoint(g){let A=!1;if(!0===this.options.selectable){const C=this.getNodeAt(g)||this.getEdgeAt(g);this.unselectAll(),void 0!==C&&(A=this.selectObject(C)),this.body.emitter.emit("_requestRedraw")}return A}selectAdditionalOnPoint(g){let A=!1;if(!0===this.options.selectable){const C=this.getNodeAt(g)||this.getEdgeAt(g);void 0!==C&&(A=!0,!0===C.isSelected()?this.deselectObject(C):this.selectObject(C),this.body.emitter.emit("_requestRedraw"))}return A}_initBaseEvent(g,A){const C={};return C.pointer={DOM:{x:A.x,y:A.y},canvas:this.canvas.DOMtoCanvas(A)},C.event=g,C}generateClickEvent(g,A,C,I){let t=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const e=this._initBaseEvent(A,C);if(!0===t)e.nodes=[],e.edges=[];else{const g=this.getSelection();e.nodes=g.nodes,e.edges=g.edges}void 0!==I&&(e.previousSelection=I),"click"==g&&(e.items=this.getClickedItems(C)),void 0!==A.controlEdge&&(e.controlEdge=A.controlEdge),this.body.emitter.emit(g,e)}selectObject(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==g&&(g instanceof bx?(!0===A&&this._selectionAccumulator.addEdges(...g.edges),this._selectionAccumulator.addNodes(g)):this._selectionAccumulator.addEdges(g),!0)}deselectObject(g){!0===g.isSelected()&&(g.selected=!1,this._removeFromSelection(g))}_getAllNodesOverlappingWith(g){const A=[],C=this.body.nodes;for(let I=0;I1&&void 0!==arguments[1])||arguments[1];const C=this._pointerToPositionObject(g),I=this._getAllNodesOverlappingWith(C);return I.length>0?!0===A?this.body.nodes[I[I.length-1]]:I[I.length-1]:void 0}_getEdgesOverlappingWith(g,A){const C=this.body.edges;for(let I=0;I1&&void 0!==arguments[1])||arguments[1];const C=this.canvas.DOMtoCanvas(g);let I=10,t=null;const e=this.body.edges;for(let g=0;g0&&(this.generateClickEvent("deselectEdge",A,g,t),C=!0),I.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",A,g,t),C=!0),I.nodes.added.length>0&&(this.generateClickEvent("selectNode",A,g),C=!0),I.edges.added.length>0&&(this.generateClickEvent("selectEdge",A,g),C=!0),!0===C&&this.generateClickEvent("select",A,g)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var g;return Jr(g=this._selectionAccumulator.getNodes()).call(g,(g=>g.id))}getSelectedEdgeIds(){var g;return Jr(g=this._selectionAccumulator.getEdges()).call(g,(g=>g.id))}setSelection(g){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!g||!g.nodes&&!g.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((A.unselectAll||void 0===A.unselectAll)&&this.unselectAll(),g.nodes)for(const C of g.nodes){const g=this.body.nodes[C];if(!g)throw new RangeError('Node with id "'+C+'" not found');this.selectObject(g,A.highlightEdges)}if(g.edges)for(const A of g.edges){const g=this.body.edges[A];if(!g)throw new RangeError('Edge with id "'+A+'" not found');this.selectObject(g)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(g){let A=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({nodes:g},{highlightEdges:A})}selectEdges(g){if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({edges:g})}updateSelection(){for(const g in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,g.id)||this._selectionAccumulator.deleteNodes(g);for(const g in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,g.id)||this._selectionAccumulator.deleteEdges(g)}getClickedItems(g){const A=this.canvas.DOMtoCanvas(g),C=[],I=this.body.nodeIndices,t=this.body.nodes;for(let g=I.length-1;g>=0;g--){const e=t[I[g]].getItemsOnPoint(A);C.push.apply(C,e)}const e=this.body.edgeIndices,i=this.body.edges;for(let g=e.length-1;g>=0;g--){const I=i[e[g]].getItemsOnPoint(A);C.push.apply(C,I)}return C}}class OO{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(g){return this.fake_use(g),this.abstract()}setPosition(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(g,A,C),this.abstract()}getTreeSize(g){return this.fake_use(g),this.abstract()}sort(g){this.fake_use(g),this.abstract()}fix(g,A){this.fake_use(g,A),this.abstract()}shift(g,A){this.fake_use(g,A),this.abstract()}}class TO extends OO{constructor(g){super(),this.layout=g}curveType(){return"horizontal"}getPosition(g){return g.x}setPosition(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==C&&this.layout.hierarchical.addToOrdering(g,C),g.x=A}getTreeSize(g){const A=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:A.min_x,max:A.max_x}}sort(g){Ny(g).call(g,(function(g,A){return g.x-A.x}))}fix(g,A){g.y=this.layout.options.hierarchical.levelSeparation*A,g.options.fixed.y=!0}shift(g,A){this.layout.body.nodes[g].x+=A}}class DO extends OO{constructor(g){super(),this.layout=g}curveType(){return"vertical"}getPosition(g){return g.y}setPosition(g,A){let C=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==C&&this.layout.hierarchical.addToOrdering(g,C),g.y=A}getTreeSize(g){const A=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:A.min_y,max:A.max_y}}sort(g){Ny(g).call(g,(function(g,A){return g.y-A.y}))}fix(g,A){g.x=this.layout.options.hierarchical.levelSeparation*A,g.options.fixed.x=!0}shift(g,A){this.layout.body.nodes[g].y+=A}}var NO=Yi.every;DC({target:"Array",proto:!0,forced:!ia("every")},{every:function(g){return NO(this,g,arguments.length>1?arguments[1]:void 0)}});var kO=MI("Array").every,RO=og,PO=kO,MO=Array.prototype,zO=function(g){var A=g.every;return g===MO||RO(MO,g)&&A===MO.every?PO:A},BO=C(zO);function ZO(g,A){const C=new Wv;return pa(g).call(g,(g=>{var A;pa(A=g.edges).call(A,(g=>{g.connected&&C.add(g)}))})),pa(C).call(C,(g=>{const C=g.from.id,I=g.to.id;null==A[C]&&(A[C]=0),(null==A[I]||A[C]>=A[I])&&(A[I]=A[C]+1)})),A}function SO(g,A,C,I){var t;const e=Ph(null),i=Ov(t=[...Ky(I).call(I)]).call(t,((g,A)=>g+1+A.edges.length),0),o=C+"Id",s="to"===C?1:-1;for(const[t,a]of I){if(!I.has(t)||!g(a))continue;e[t]=0;const d=[a];let h,l=0;for(;h=d.pop();){var n,r;if(!I.has(t))continue;const g=e[h.id]+s;if(pa(n=Gd(r=h.edges).call(r,(g=>g.connected&&g.to!==g.from&&g[C]!==h&&I.has(g.toId)&&I.has(g.fromId)))).call(n,(I=>{const t=I[o],i=e[t];(null==i||A(g,i))&&(e[t]=g,d.push(I[C]))})),l>i)return ZO(I,e);++l}}return e}class FO{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(g,A){void 0===this.childrenReference[g]&&(this.childrenReference[g]=[]),this.childrenReference[g].push(A),void 0===this.parentReference[A]&&(this.parentReference[A]=[]),this.parentReference[A].push(g)}checkIfTree(){for(const g in this.parentReference)if(this.parentReference[g].length>1)return void(this.isTree=!1);this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(g,A){void 0!==A&&void 0===this.trees[g.id]&&(this.trees[g.id]=A,this.treeIndex=Math.max(A,this.treeIndex))}ensureLevel(g){void 0===this.levels[g]&&(this.levels[g]=0)}getMaxLevel(g){const A={},C=g=>{if(void 0!==A[g])return A[g];let I=this.levels[g];if(this.childrenReference[g]){const A=this.childrenReference[g];if(A.length>0)for(let g=0;gg-A));for(const g of I)A.set(g,C++);for(const g in this.levels)Object.prototype.hasOwnProperty.call(this.levels,g)&&(this.levels[g]=A.get(this.levels[g]))}getTreeSize(g,A){let C=1e9,I=-1e9,t=1e9,e=-1e9;for(const i in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,i)&&this.trees[i]===A){const A=g[i];C=Math.min(A.x,C),I=Math.max(A.x,I),t=Math.min(A.y,t),e=Math.max(A.y,e)}return{min_x:C,max_x:I,min_y:t,max_y:e}}hasSameParent(g,A){const C=this.parentReference[g.id],I=this.parentReference[A.id];if(void 0===C||void 0===I)return!1;for(let g=0;g{this.setupHierarchicalLayout()})),this.body.emitter.on("_dataLoaded",(()=>{this.layoutNetwork()})),this.body.emitter.on("_resetHierarchicalLayout",(()=>{this.setupHierarchicalLayout()})),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",(()=>{if(!0!==this.options.hierarchical.enabled)return;const g=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",g,!1)}))}setOptions(g,A){if(void 0!==g){const C=this.options.hierarchical,I=C.enabled;if(Eu(["randomSeed","improvedLayout","clusterThreshold"],this.options,g),ju(this.options,g,"hierarchical"),void 0!==g.randomSeed&&this._resetRNG(g.randomSeed),!0===C.enabled)return!0===I&&this.body.emitter.emit("refresh",!0),"RL"===C.direction||"DU"===C.direction?C.levelSeparation>0&&(C.levelSeparation*=-1):C.levelSeparation<0&&(C.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(A);if(!0===I)return this.body.emitter.emit("refresh"),Tu(A,this.optionsBackup)}return A}_resetRNG(g){this.initialRandomSeed=g,this._rng=hu(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(g){if(!0===this.options.hierarchical.enabled){const A=this.optionsBackup.physics;void 0===g.physics||!0===g.physics?(g.physics={enabled:void 0===A.enabled||A.enabled,solver:"hierarchicalRepulsion"},A.enabled=void 0===A.enabled||A.enabled,A.solver=A.solver||"barnesHut"):"object"==typeof g.physics?(A.enabled=void 0===g.physics.enabled||g.physics.enabled,A.solver=g.physics.solver||"barnesHut",g.physics.solver="hierarchicalRepulsion"):!1!==g.physics&&(A.solver="barnesHut",g.physics={solver:"hierarchicalRepulsion"});let C=this.direction.curveType();if(void 0===g.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges={smooth:!1};else if(void 0===g.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges.smooth=!1;else if("boolean"==typeof g.edges.smooth)this.optionsBackup.edges={smooth:g.edges.smooth},g.edges.smooth={enabled:g.edges.smooth,type:C};else{const A=g.edges.smooth;void 0!==A.type&&"dynamic"!==A.type&&(C=A.type),this.optionsBackup.edges={smooth:{enabled:void 0===A.enabled||A.enabled,type:void 0===A.type?"dynamic":A.type,roundness:void 0===A.roundness?.5:A.roundness,forceDirection:void 0!==A.forceDirection&&A.forceDirection}},g.edges.smooth={enabled:void 0===A.enabled||A.enabled,type:C,roundness:void 0===A.roundness?.5:A.roundness,forceDirection:void 0!==A.forceDirection&&A.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",C)}return g}positionInitially(g){if(!0!==this.options.hierarchical.enabled){this._resetRNG(this.initialRandomSeed);const A=g.length+50;for(let C=0;CI){const e=g.length;for(;g.length>I&&C<=A;){C+=1;const A=g.length;C%3==0?this.body.modules.clustering.clusterBridges(t):this.body.modules.clustering.clusterOutliers(t);if(A==g.length&&C%3!=0)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*e)})}C>A&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(g,this.body.edgeIndices,!0),this._shiftToCenter();const e=70;for(let A=0;A0){let g,A,C=!1,I=!1;for(A in this.lastNodeOnLevel={},this.hierarchical=new FO,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,A)&&(g=this.body.nodes[A],void 0!==g.options.level?(C=!0,this.hierarchical.levels[A]=g.options.level):I=!0);if(!0===I&&!0===C)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(!0===I){const g=this.options.hierarchical.sortMethod;"hubsize"===g?this._determineLevelsByHubsize():"directed"===g?this._determineLevelsDirected():"custom"===g&&this._determineLevelsCustomCallback()}for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this.hierarchical.ensureLevel(g);const g=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(g),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var g=this;let A=!1;const C={},I=(g,A)=>{const C=this.hierarchical.trees;for(const I in C)Object.prototype.hasOwnProperty.call(C,I)&&C[I]===g&&this.direction.shift(I,A)},t=()=>{const g=[];for(let A=0;A{if(!A[g.id]&&(A[g.id]=!0,this.hierarchical.childrenReference[g.id])){const C=this.hierarchical.childrenReference[g.id];if(C.length>0)for(let g=0;g1&&void 0!==arguments[1]?arguments[1]:1e9,I=1e9,t=1e9,e=1e9,i=-1e9;for(const o in A)if(Object.prototype.hasOwnProperty.call(A,o)){const s=g.body.nodes[o],n=g.hierarchical.levels[s.id],r=g.direction.getPosition(s),[a,d]=g._getSpaceAroundNode(s,A);I=Math.min(a,I),t=Math.min(d,t),n<=C&&(e=Math.min(r,e),i=Math.max(r,i))}return[e,i,I,t]},o=(g,A)=>{const C=this.hierarchical.getMaxLevel(g.id),I=this.hierarchical.getMaxLevel(A.id);return Math.min(C,I)},s=(g,A,C)=>{const I=this.hierarchical;for(let t=0;t1)for(let A=0;A2&&void 0!==arguments[2]&&arguments[2];const s=g.direction.getPosition(C),n=g.direction.getPosition(I),r=Math.abs(n-s),a=g.options.hierarchical.nodeSpacing;if(r>a){const s={},n={};e(C,s),e(I,n);const r=o(C,I),d=i(s,r),h=i(n,r),l=d[1],c=h[0],u=h[2];if(Math.abs(l-c)>a){let C=l-c+a;C<-u+a&&(C=-u+a),C<0&&(g._shiftBlock(I.id,C),A=!0,!0===t&&g._centerParent(I))}}},r=(g,I)=>{const t=I.id,o=I.edges,s=this.hierarchical.levels[I.id],n=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,r={},a=[];for(let g=0;g{let C=0;for(let I=0;I{let C=0;for(let I=0;I{let C=this.direction.getPosition(I);const t={};for(let I=0;I{const t=this.direction.getPosition(I);if(void 0===C[I.id]){const g={};e(I,g),C[I.id]=g}const o=i(C[I.id]),s=o[2],n=o[3],r=g-t;let a=0;r>0?a=Math.min(r,n-this.options.hierarchical.nodeSpacing):r<0&&(a=-Math.min(-r,s-this.options.hierarchical.nodeSpacing)),0!=a&&(this._shiftBlock(I.id,a),A=!0)})(c),c=l(g,o),(g=>{const C=this.direction.getPosition(I),[t,e]=this._getSpaceAroundNode(I),i=g-C;let o=C;i>0?o=Math.min(C+(e-this.options.hierarchical.nodeSpacing),g):i<0&&(o=Math.max(C-(t-this.options.hierarchical.nodeSpacing),g)),o!==C&&(this.direction.setPosition(I,o),A=!0)})(c)},a=g=>{let C=this.hierarchical.getLevels();C=Ta(C).call(C);for(let I=0;I{let C=this.hierarchical.getLevels();C=Ta(C).call(C);for(let I=0;I{for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&this._centerParent(this.body.nodes[g])},l=()=>{let g=this.hierarchical.getLevels();g=Ta(g).call(g);for(let A=0;A{const g=t();let A=0;for(let C=0;C0&&Math.abs(i)0&&(i=this.direction.getPosition(I[g-1])+e),this.direction.setPosition(A,i,C),this._validatePositionAndContinue(A,C,i),t++}}}}_placeBranchNodes(g,A){var C;const I=this.hierarchical.childrenReference[g];if(void 0===I)return;const t=[];for(let g=0;gA&&void 0===this.positionedNodes[I.id]))return;{const A=this.options.hierarchical.nodeSpacing;let i;i=0===C?this.direction.getPosition(this.body.nodes[g]):this.direction.getPosition(t[C-1])+A,this.direction.setPosition(I,i,e),this._validatePositionAndContinue(I,e,i)}}const e=this._getCenterPosition(t);this.direction.setPosition(this.body.nodes[g],e,A)}_validatePositionAndContinue(g,A,C){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[A]){const I=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[A]]);if(C-I{var C;-1!==kh(C=this.body.edgeIndices).call(C,g.id)&&A.push(g)})),A}_getHubSizes(){const g={};ku(this.body.nodeIndices,(A=>{const C=this.body.nodes[A],I=this._getActiveEdges(C).length;g[I]=!0}));const A=[];return ku(g,(g=>{A.push(Number(g))})),Ny(A).call(A,(function(g,A){return A-g})),A}_determineLevelsByHubsize(){const g=(g,A)=>{this.hierarchical.levelDownstream(g,A)},A=this._getHubSizes();for(let C=0;C{const C=this.body.nodes[A];I===this._getActiveEdges(C).length&&this._crawlNetwork(g,A)}))}}_determineLevelsCustomCallback(){this._crawlNetwork(((g,A,C)=>{let I=this.hierarchical.levels[g.id];void 0===I&&(I=this.hierarchical.levels[g.id]=1e5);const t=(sE.cloneOptions(g,"node"),sE.cloneOptions(A,"node"),void sE.cloneOptions(C,"edge"));this.hierarchical.levels[A.id]=I+t})),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var g;const A=Ov(g=this.body.nodeIndices).call(g,((g,A)=>(g.set(A,this.body.nodes[A]),g)),new Qb);"roots"===this.options.hierarchical.shakeTowards?this.hierarchical.levels=function(g){return SO((A=>{var C,I;return BO(C=Gd(I=A.edges).call(I,(A=>g.has(A.toId)))).call(C,(g=>g.from===A))}),((g,A)=>A{var C,I;return BO(C=Gd(I=A.edges).call(I,(A=>g.has(A.toId)))).call(C,(g=>g.to===A))}),((g,A)=>A>g),"from",g)}(A),this.hierarchical.setMinLevelToZero()}_generateMap(){this._crawlNetwork(((g,A)=>{this.hierarchical.levels[A.id]>this.hierarchical.levels[g.id]&&this.hierarchical.addRelation(g.id,A.id)})),this.hierarchical.checkIfTree()}_crawlNetwork(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},A=arguments.length>1?arguments[1]:void 0;const C={},I=(A,t)=>{if(void 0===C[A.id]){let e;this.hierarchical.setTreeIndex(A,t),C[A.id]=!0;const i=this._getActiveEdges(A);for(let C=0;C{if(C[g])return;C[g]=!0,this.direction.shift(g,A);const t=this.hierarchical.childrenReference[g];if(void 0!==t)for(let g=0;g{const C=this.hierarchical.parentReference[A];if(void 0!==C)for(let A=0;A{const C=this.hierarchical.parentReference[A];if(void 0!==C)for(let I=0;I{this._clean()})),this.body.emitter.on("_dataChanged",GI(t=this._restore).call(t,this)),this.body.emitter.on("_resetData",GI(e=this._restore).call(e,this))}_restore(){!1!==this.inMode&&(!0===this.options.initiallyActive?this.enableEditMode():this.disableEditMode())}setOptions(g,A,C){void 0!==A&&(void 0!==A.locale?this.options.locale=A.locale:this.options.locale=C.locale,void 0!==A.locales?this.options.locales=A.locales:this.options.locales=C.locales),void 0!==g&&("boolean"==typeof g?this.options.enabled=g:(this.options.enabled=!0,Tu(this.options,g)),!0===this.options.initiallyActive&&(this.editMode=!0),this._setup())}toggleEditMode(){!0===this.editMode?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},!0===this.guiEnabled){var g,A;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const C=this.selectionHandler.getSelectedNodeCount(),I=this.selectionHandler.getSelectedEdgeCount(),t=C+I,e=this.options.locales[this.options.locale];let i=!1;!1!==this.options.addNode&&(this._createAddNodeButton(e),i=!0),!1!==this.options.addEdge&&(!0===i?this._createSeperator(1):i=!0,this._createAddEdgeButton(e)),1===C&&"function"==typeof this.options.editNode?(!0===i?this._createSeperator(2):i=!0,this._createEditNodeButton(e)):1===I&&0===C&&!1!==this.options.editEdge&&(!0===i?this._createSeperator(3):i=!0,this._createEditEdgeButton(e)),0!==t&&(C>0&&!1!==this.options.deleteNode||0===C&&!1!==this.options.deleteEdge)&&(!0===i&&this._createSeperator(4),this._createDeleteButton(e)),this._bindElementEvents(this.closeDiv,GI(g=this.toggleEditMode).call(g,this)),this._temporaryBindEvent("select",GI(A=this.showManipulatorToolbar).call(A,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var g;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var A;const g=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(g),this._createSeperator(),this._createDescription(g.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,GI(A=this.toggleEditMode).call(A,this))}this._temporaryBindEvent("click",GI(g=this._performAddNode).call(g,this))}editNode(){!0!==this.editMode&&this.enableEditMode(),this._clean();const g=this.selectionHandler.getSelectedNodes()[0];if(void 0!==g){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(!0!==g.isCluster){const A=Tu({},g.options,!1);if(A.x=g.x,A.y=g.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(A,(g=>{null!=g&&"editNode"===this.inMode&&this.body.data.nodes.getDataSet().update(g),this.showManipulatorToolbar()}))}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}addEdgeMode(){var g,A,C,I,t;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var e;const g=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(g),this._createSeperator(),this._createDescription(g.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,GI(e=this.toggleEditMode).call(e,this))}this._temporaryBindUI("onTouch",GI(g=this._handleConnect).call(g,this)),this._temporaryBindUI("onDragEnd",GI(A=this._finishConnect).call(A,this)),this._temporaryBindUI("onDrag",GI(C=this._dragControlNode).call(C,this)),this._temporaryBindUI("onRelease",GI(I=this._finishConnect).call(I,this)),this._temporaryBindUI("onDragStart",GI(t=this._dragStartEdge).call(t,this)),this._temporaryBindUI("onHold",(()=>{}))}editEdgeMode(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"!=typeof this.options.editEdge||"function"!=typeof this.options.editEdge.editWithoutDrag||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0===this.edgeBeingEditedId)){if(!0===this.guiEnabled){var g;const A=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(A),this._createSeperator(),this._createDescription(A.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,GI(g=this.toggleEditMode).call(g,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0!==this.edgeBeingEditedId){var A,C,I,t;const g=this.body.edges[this.edgeBeingEditedId],e=this._getNewTargetNode(g.from.x,g.from.y),i=this._getNewTargetNode(g.to.x,g.to.y);this.temporaryIds.nodes.push(e.id),this.temporaryIds.nodes.push(i.id),this.body.nodes[e.id]=e,this.body.nodeIndices.push(e.id),this.body.nodes[i.id]=i,this.body.nodeIndices.push(i.id),this._temporaryBindUI("onTouch",GI(A=this._controlNodeTouch).call(A,this)),this._temporaryBindUI("onTap",(()=>{})),this._temporaryBindUI("onHold",(()=>{})),this._temporaryBindUI("onDragStart",GI(C=this._controlNodeDragStart).call(C,this)),this._temporaryBindUI("onDrag",GI(I=this._controlNodeDrag).call(I,this)),this._temporaryBindUI("onDragEnd",GI(t=this._controlNodeDragEnd).call(t,this)),this._temporaryBindUI("onMouseMove",(()=>{})),this._temporaryBindEvent("beforeDrawing",(A=>{const C=g.edgeType.findBorderPositions(A);!1===e.selected&&(e.x=C.from.x,e.y=C.from.y),!1===i.selected&&(i.x=C.to.x,i.y=C.to.y)})),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}else{const g=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(g.from.id,g.to.id)}}deleteSelected(){!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";const g=this.selectionHandler.getSelectedNodeIds(),A=this.selectionHandler.getSelectedEdgeIds();let C;if(g.length>0){for(let A=0;A0&&"function"==typeof this.options.deleteEdge&&(C=this.options.deleteEdge);if("function"==typeof C){const I={nodes:g,edges:A};if(2!==C.length)throw new Error("The function for delete does not support two arguments (data, callback)");C(I,(g=>{null!=g&&"delete"===this.inMode?(this.body.data.edges.getDataSet().remove(g.edges),this.body.data.nodes.getDataSet().remove(g.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().remove(A),this.body.data.nodes.getDataSet().remove(g),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){var g,A;(void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",!0===this.editMode?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",!0===this.editMode?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv)&&(this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",null!==(g=null===(A=this.options.locales[this.options.locale])||void 0===A?void 0:A.close)&&void 0!==g?g:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}_getNewTargetNode(g,A){const C=Tu({},this.options.controlNodeStyle);C.id="targetNode"+nw(),C.hidden=!1,C.physics=!1,C.x=g,C.y=A;const I=this.body.functions.createNode(C);return I.shape.boundingBox={left:g,right:g,top:A,bottom:A},I}_createEditButton(){var g;this._clean(),this.manipulationDOM={},mu(this.editModeDiv);const A=this.options.locales[this.options.locale],C=this._createButton("editMode","vis-edit vis-edit-mode",A.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(C),this._bindElementEvents(C,GI(g=this.toggleEditMode).call(g,this))}_clean(){this.inMode=!1,!0===this.guiEnabled&&(mu(this.editModeDiv),mu(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const A of gd(g=this._domEventListenerCleanupQueue).call(g,0)){var g;A()}}_removeManipulationDOM(){this._clean(),mu(this.manipulationDiv),mu(this.editModeDiv),mu(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+g]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+g].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+g])}_createAddNodeButton(g){var A;const C=this._createButton("addNode","vis-add",g.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.addNodeMode).call(A,this))}_createAddEdgeButton(g){var A;const C=this._createButton("addEdge","vis-connect",g.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.addEdgeMode).call(A,this))}_createEditNodeButton(g){var A;const C=this._createButton("editNode","vis-edit",g.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.editNode).call(A,this))}_createEditEdgeButton(g){var A;const C=this._createButton("editEdge","vis-edit",g.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.editEdgeMode).call(A,this))}_createDeleteButton(g){var A;let C;C=this.options.rtl?"vis-delete-rtl":"vis-delete";const I=this._createButton("delete",C,g.del||this.options.locales.en.del);this.manipulationDiv.appendChild(I),this._bindElementEvents(I,GI(A=this.deleteSelected).call(A,this))}_createBackButton(g){var A;const C=this._createButton("back","vis-back",g.back||this.options.locales.en.back);this.manipulationDiv.appendChild(C),this._bindElementEvents(C,GI(A=this.showManipulatorToolbar).call(A,this))}_createButton(g,A,C){let I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[g+"Div"]=document.createElement("button"),this.manipulationDOM[g+"Div"].className="vis-button "+A,this.manipulationDOM[g+"Label"]=document.createElement("div"),this.manipulationDOM[g+"Label"].className=I,this.manipulationDOM[g+"Label"].innerText=C,this.manipulationDOM[g+"Div"].appendChild(this.manipulationDOM[g+"Label"]),this.manipulationDOM[g+"Div"]}_createDescription(g){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=g,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(g,A){this.temporaryEventFunctions.push({event:g,boundFunction:A}),this.body.emitter.on(g,A)}_temporaryBindUI(g,A){if(void 0===this.body.eventListeners[g])throw new Error("This UI function does not exist. Typo? You tried: "+g+" possible are: "+Zh(ga(this.body.eventListeners)));this.temporaryUIFunctions[g]=this.body.eventListeners[g],this.body.eventListeners[g]=A}_unbindTemporaryUIs(){for(const g in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,g)&&(this.body.eventListeners[g]=this.temporaryUIFunctions[g],delete this.temporaryUIFunctions[g]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let g=0;g{C.destroy()}));const I=g=>{let{keyCode:C,key:I}=g;"Enter"!==I&&" "!==I&&13!==C&&32!==C||A()};g.addEventListener("keyup",I,!1),this._domEventListenerCleanupQueue.push((()=>{g.removeEventListener("keyup",I,!1)}))}_cleanupTemporaryNodesAndEdges(){for(let C=0;C=0;g--)if(t[g]!==this.selectedControlNode.id){e=this.body.nodes[t[g]];break}if(void 0!==e&&void 0!==this.selectedControlNode)if(!0===e.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const g=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===g.id?this._performEditEdge(e.id,I.to.id):this._performEditEdge(I.from.id,e.id)}else I.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(g){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(g.center),this.lastTouch.translation=fI({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const A=this.lastTouch,C=this.selectionHandler.getNodeAt(A);if(void 0!==C)if(!0===C.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const g=this._getNewTargetNode(C.x,C.y);this.body.nodes[g.id]=g,this.body.nodeIndices.push(g.id);const A=this.body.functions.createEdge({id:"connectionEdge"+nw(),from:C.id,to:g.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[A.id]=A,this.body.edgeIndices.push(A.id),this.temporaryIds.nodes.push(g.id),this.temporaryIds.edges.push(A.id)}this.touchTime=(new Date).valueOf()}}_dragControlNode(g){const A=this.body.functions.getPointer(g.center),C=this.selectionHandler._pointerToPositionObject(A);let I;void 0!==this.temporaryIds.edges[0]&&(I=this.body.edges[this.temporaryIds.edges[0]].fromId);const t=this.selectionHandler._getAllNodesOverlappingWith(C);let e;for(let g=t.length-1;g>=0;g--){var i;if(-1===kh(i=this.temporaryIds.nodes).call(i,t[g])){e=this.body.nodes[t[g]];break}}if(g.controlEdge={from:I,to:e?e.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",g,A),void 0!==this.temporaryIds.nodes[0]){const g=this.body.nodes[this.temporaryIds.nodes[0]];g.x=this.canvas._XconvertDOMtoCanvas(A.x),g.y=this.canvas._YconvertDOMtoCanvas(A.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(g)}_finishConnect(g){const A=this.body.functions.getPointer(g.center),C=this.selectionHandler._pointerToPositionObject(A);let I;void 0!==this.temporaryIds.edges[0]&&(I=this.body.edges[this.temporaryIds.edges[0]].fromId);const t=this.selectionHandler._getAllNodesOverlappingWith(C);let e;for(let g=t.length-1;g>=0;g--){var i;if(-1===kh(i=this.temporaryIds.nodes).call(i,t[g])){e=this.body.nodes[t[g]];break}}this._cleanupTemporaryNodesAndEdges(),void 0!==e&&(!0===e.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[I]&&void 0!==this.body.nodes[e.id]&&this._performAddEdge(I,e.id)),g.controlEdge={from:I,to:e?e.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",g,A),this.body.emitter.emit("_redraw")}_dragStartEdge(g){const A=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",g,A,void 0,!0)}_performAddNode(g){const A={id:nw(),x:g.pointer.canvas.x,y:g.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(A,(g=>{null!=g&&"addNode"===this.inMode&&this.body.data.nodes.getDataSet().add(g),this.showManipulatorToolbar()}))}else this.body.data.nodes.getDataSet().add(A),this.showManipulatorToolbar()}_performAddEdge(g,A){const C={from:g,to:A};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(C,(g=>{null!=g&&"addEdge"===this.inMode&&(this.body.data.edges.getDataSet().add(g),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().add(C),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(g,A){const C={id:this.edgeBeingEditedId,from:g,to:A,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let I=this.options.editEdge;if("object"==typeof I&&(I=I.editWithoutDrag),"function"==typeof I){if(2!==I.length)throw new Error("The function for edit does not support two arguments (data, callback)");I(C,(g=>{null==g||"editEdge"!==this.inMode?(this.body.edges[C.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(g),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().update(C),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const jO="string",VO="boolean",YO="number",WO="array",QO="object",UO=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],KO={borderWidth:{number:YO},borderWidthSelected:{number:YO,undefined:"undefined"},brokenImage:{string:jO,undefined:"undefined"},chosen:{label:{boolean:VO,function:"function"},node:{boolean:VO,function:"function"},__type__:{object:QO,boolean:VO}},color:{border:{string:jO},background:{string:jO},highlight:{border:{string:jO},background:{string:jO},__type__:{object:QO,string:jO}},hover:{border:{string:jO},background:{string:jO},__type__:{object:QO,string:jO}},__type__:{object:QO,string:jO}},opacity:{number:YO,undefined:"undefined"},fixed:{x:{boolean:VO},y:{boolean:VO},__type__:{object:QO,boolean:VO}},font:{align:{string:jO},color:{string:jO},size:{number:YO},face:{string:jO},background:{string:jO},strokeWidth:{number:YO},strokeColor:{string:jO},vadjust:{number:YO},multi:{boolean:VO,string:jO},bold:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},boldital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},ital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},mono:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},__type__:{object:QO,string:jO}},group:{string:jO,number:YO,undefined:"undefined"},heightConstraint:{minimum:{number:YO},valign:{string:jO},__type__:{object:QO,boolean:VO,number:YO}},hidden:{boolean:VO},icon:{face:{string:jO},code:{string:jO},size:{number:YO},color:{string:jO},weight:{string:jO,number:YO},__type__:{object:QO}},id:{string:jO,number:YO},image:{selected:{string:jO,undefined:"undefined"},unselected:{string:jO,undefined:"undefined"},__type__:{object:QO,string:jO}},imagePadding:{top:{number:YO},right:{number:YO},bottom:{number:YO},left:{number:YO},__type__:{object:QO,number:YO}},label:{string:jO,undefined:"undefined"},labelHighlightBold:{boolean:VO},level:{number:YO,undefined:"undefined"},margin:{top:{number:YO},right:{number:YO},bottom:{number:YO},left:{number:YO},__type__:{object:QO,number:YO}},mass:{number:YO},physics:{boolean:VO},scaling:{min:{number:YO},max:{number:YO},label:{enabled:{boolean:VO},min:{number:YO},max:{number:YO},maxVisible:{number:YO},drawThreshold:{number:YO},__type__:{object:QO,boolean:VO}},customScalingFunction:{function:"function"},__type__:{object:QO}},shadow:{enabled:{boolean:VO},color:{string:jO},size:{number:YO},x:{number:YO},y:{number:YO},__type__:{object:QO,boolean:VO}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:VO,array:WO},borderRadius:{number:YO},interpolation:{boolean:VO},useImageSize:{boolean:VO},useBorderWithImage:{boolean:VO},coordinateOrigin:{string:["center","top-left"]},__type__:{object:QO}},size:{number:YO},title:{string:jO,dom:"dom",undefined:"undefined"},value:{number:YO,undefined:"undefined"},widthConstraint:{minimum:{number:YO},maximum:{number:YO},__type__:{object:QO,boolean:VO,number:YO}},x:{number:YO},y:{number:YO},__type__:{object:QO}},HO={configure:{enabled:{boolean:VO},filter:{boolean:VO,string:jO,array:WO,function:"function"},container:{dom:"dom"},showButton:{boolean:VO},__type__:{object:QO,boolean:VO,string:jO,array:WO,function:"function"}},edges:{arrows:{to:{enabled:{boolean:VO},scaleFactor:{number:YO},type:{string:UO},imageHeight:{number:YO},imageWidth:{number:YO},src:{string:jO},__type__:{object:QO,boolean:VO}},middle:{enabled:{boolean:VO},scaleFactor:{number:YO},type:{string:UO},imageWidth:{number:YO},imageHeight:{number:YO},src:{string:jO},__type__:{object:QO,boolean:VO}},from:{enabled:{boolean:VO},scaleFactor:{number:YO},type:{string:UO},imageWidth:{number:YO},imageHeight:{number:YO},src:{string:jO},__type__:{object:QO,boolean:VO}},__type__:{string:["from","to","middle"],object:QO}},endPointOffset:{from:{number:YO},to:{number:YO},__type__:{object:QO,number:YO}},arrowStrikethrough:{boolean:VO},background:{enabled:{boolean:VO},color:{string:jO},size:{number:YO},dashes:{boolean:VO,array:WO},__type__:{object:QO,boolean:VO}},chosen:{label:{boolean:VO,function:"function"},edge:{boolean:VO,function:"function"},__type__:{object:QO,boolean:VO}},color:{color:{string:jO},highlight:{string:jO},hover:{string:jO},inherit:{string:["from","to","both"],boolean:VO},opacity:{number:YO},__type__:{object:QO,string:jO}},dashes:{boolean:VO,array:WO},font:{color:{string:jO},size:{number:YO},face:{string:jO},background:{string:jO},strokeWidth:{number:YO},strokeColor:{string:jO},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:YO},multi:{boolean:VO,string:jO},bold:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},boldital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},ital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},mono:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},__type__:{object:QO,string:jO}},hidden:{boolean:VO},hoverWidth:{function:"function",number:YO},label:{string:jO,undefined:"undefined"},labelHighlightBold:{boolean:VO},length:{number:YO,undefined:"undefined"},physics:{boolean:VO},scaling:{min:{number:YO},max:{number:YO},label:{enabled:{boolean:VO},min:{number:YO},max:{number:YO},maxVisible:{number:YO},drawThreshold:{number:YO},__type__:{object:QO,boolean:VO}},customScalingFunction:{function:"function"},__type__:{object:QO}},selectionWidth:{function:"function",number:YO},selfReferenceSize:{number:YO},selfReference:{size:{number:YO},angle:{number:YO},renderBehindTheNode:{boolean:VO},__type__:{object:QO}},shadow:{enabled:{boolean:VO},color:{string:jO},size:{number:YO},x:{number:YO},y:{number:YO},__type__:{object:QO,boolean:VO}},smooth:{enabled:{boolean:VO},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:YO},forceDirection:{string:["horizontal","vertical","none"],boolean:VO},__type__:{object:QO,boolean:VO}},title:{string:jO,undefined:"undefined"},width:{number:YO},widthConstraint:{maximum:{number:YO},__type__:{object:QO,boolean:VO,number:YO}},value:{number:YO,undefined:"undefined"},__type__:{object:QO}},groups:{useDefaultGroups:{boolean:VO},__any__:KO,__type__:{object:QO}},interaction:{dragNodes:{boolean:VO},dragView:{boolean:VO},hideEdgesOnDrag:{boolean:VO},hideEdgesOnZoom:{boolean:VO},hideNodesOnDrag:{boolean:VO},hover:{boolean:VO},keyboard:{enabled:{boolean:VO},speed:{x:{number:YO},y:{number:YO},zoom:{number:YO},__type__:{object:QO}},bindToWindow:{boolean:VO},autoFocus:{boolean:VO},__type__:{object:QO,boolean:VO}},multiselect:{boolean:VO},navigationButtons:{boolean:VO},selectable:{boolean:VO},selectConnectedEdges:{boolean:VO},hoverConnectedEdges:{boolean:VO},tooltipDelay:{number:YO},zoomView:{boolean:VO},zoomSpeed:{number:YO},__type__:{object:QO}},layout:{randomSeed:{undefined:"undefined",number:YO,string:jO},improvedLayout:{boolean:VO},clusterThreshold:{number:YO},hierarchical:{enabled:{boolean:VO},levelSeparation:{number:YO},nodeSpacing:{number:YO},treeSpacing:{number:YO},blockShifting:{boolean:VO},edgeMinimization:{boolean:VO},parentCentralization:{boolean:VO},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:QO,boolean:VO}},__type__:{object:QO}},manipulation:{enabled:{boolean:VO},initiallyActive:{boolean:VO},addNode:{boolean:VO,function:"function"},addEdge:{boolean:VO,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:QO,boolean:VO,function:"function"}},deleteNode:{boolean:VO,function:"function"},deleteEdge:{boolean:VO,function:"function"},controlNodeStyle:KO,__type__:{object:QO,boolean:VO}},nodes:KO,physics:{enabled:{boolean:VO},barnesHut:{theta:{number:YO},gravitationalConstant:{number:YO},centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},damping:{number:YO},avoidOverlap:{number:YO},__type__:{object:QO}},forceAtlas2Based:{theta:{number:YO},gravitationalConstant:{number:YO},centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},damping:{number:YO},avoidOverlap:{number:YO},__type__:{object:QO}},repulsion:{centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},nodeDistance:{number:YO},damping:{number:YO},__type__:{object:QO}},hierarchicalRepulsion:{centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},nodeDistance:{number:YO},damping:{number:YO},avoidOverlap:{number:YO},__type__:{object:QO}},maxVelocity:{number:YO},minVelocity:{number:YO},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:VO},iterations:{number:YO},updateInterval:{number:YO},onlyDynamicEdges:{boolean:VO},fit:{boolean:VO},__type__:{object:QO,boolean:VO}},timestep:{number:YO},adaptiveTimestep:{boolean:VO},wind:{x:{number:YO},y:{number:YO},__type__:{object:QO}},__type__:{object:QO,boolean:VO}},autoResize:{boolean:VO},clickToUse:{boolean:VO},locale:{string:jO},locales:{__any__:{any:"any"},__type__:{object:QO}},height:{string:jO},width:{string:jO},__type__:{object:QO}},XO={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},_O=(g,A,C)=>{var I;return!(!yd(g).call(g,"physics")||!yd(I=XO.physics.solver).call(I,A)||C.physics.solver===A||"wind"===A)};var JO=Object.freeze({__proto__:null,allOptions:HO,configuratorHideOption:_O,configureOptions:XO});class qO{constructor(){}getDistances(g,A,C){const I={},t=g.edges;for(let g=0;g2&&void 0!==arguments[2]&&arguments[2];const I=this.distanceSolver.getDistances(this.body,g,A);this._createL_matrix(I),this._createK_matrix(I),this._createE_matrix();let t=0;const e=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3));let i=1e9,o=0,s=0,n=0,r=0,a=0;for(;i>.01&&t1&&a<5;)a+=1,this._moveNode(o,s,n),[r,s,n]=this._getEnergy(o)}_getHighestEnergyNode(g){const A=this.body.nodeIndices,C=this.body.nodes;let I=0,t=A[0],e=0,i=0;for(let o=0;othis.body.emitter.emit("_requestRedraw"))),this.groups=new Ub,this.canvas=new cE(this.body),this.selectionHandler=new EO(this.body,this.canvas),this.interactionHandler=new bE(this.body,this.canvas,this.selectionHandler),this.view=new uE(this.body,this.canvas),this.renderer=new aE(this.body,this.canvas),this.physics=new oE(this.body),this.layoutEngine=new GO(this.body),this.clustering=new rE(this.body),this.manipulation=new LO(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new mx(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new qx(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new $O(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(C),this.setData(A)}HI(gT.prototype),gT.prototype.setOptions=function(g){if(null===g&&(g=void 0),void 0!==g){!0===Ap.validate(g,HO)&&console.error("%cErrors have been found in the supplied options object.",gp);if(Eu(["locale","locales","clickToUse"],this.options,g),void 0!==g.locale&&(g.locale=function(g,A){try{const[I,t]=A.split(/[-_ /]/,2),e=null!=I?I.toLowerCase():null,i=null!=t?t.toUpperCase():null;if(e&&i){const A=e+"-"+i;if(Object.prototype.hasOwnProperty.call(g,A))return A;var C;console.warn(Pd(C="Unknown variant ".concat(i," of language ")).call(C,e,"."))}if(e){const A=e;if(Object.prototype.hasOwnProperty.call(g,A))return A;console.warn("Unknown language ".concat(e))}return console.warn("Unknown locale ".concat(A,", falling back to English.")),"en"}catch(g){return console.error(g),console.warn("Unexpected error while normalizing locale ".concat(A,", falling back to English.")),"en"}}(g.locales||this.options.locales,g.locale)),g=this.layoutEngine.setOptions(g.layout,g),this.canvas.setOptions(g),this.groups.setOptions(g.groups),this.nodesHandler.setOptions(g.nodes),this.edgesHandler.setOptions(g.edges),this.physics.setOptions(g.physics),this.manipulation.setOptions(g.manipulation,g,this.options),this.interactionHandler.setOptions(g.interaction),this.renderer.setOptions(g.interaction),this.selectionHandler.setOptions(g.interaction),void 0!==g.groups&&this.body.emitter.emit("refreshNodes"),"configure"in g&&(this.configurator||(this.configurator=new Ju(this,this.body.container,XO,this.canvas.pixelRatio,_O)),this.configurator.setOptions(g.configure)),this.configurator&&!0===this.configurator.options.enabled){const g={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};Tu(g.nodes,this.nodesHandler.options),Tu(g.edges,this.edgesHandler.options),Tu(g.layout,this.layoutEngine.options),Tu(g.interaction,this.selectionHandler.options),Tu(g.interaction,this.renderer.options),Tu(g.interaction,this.interactionHandler.options),Tu(g.manipulation,this.manipulation.options),Tu(g.physics,this.physics.options),Tu(g.global,this.canvas.options),Tu(g.global,this.options),this.configurator.setModuleOptions(g)}void 0!==g.clickToUse?!0===g.clickToUse?void 0===this.activator&&(this.activator=new _u(this.canvas.frame),this.activator.on("change",(()=>{this.body.emitter.emit("activate")}))):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},gT.prototype._updateVisibleIndices=function(){const g=this.body.nodes,A=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const A in g)Object.prototype.hasOwnProperty.call(g,A)&&(this.clustering._isClusteredNode(A)||!1!==g[A].options.hidden||this.body.nodeIndices.push(g[A].id));for(const C in A)if(Object.prototype.hasOwnProperty.call(A,C)){const I=A[C],t=g[I.fromId],e=g[I.toId],i=void 0!==t&&void 0!==e;!this.clustering._isClusteredEdge(C)&&!1===I.options.hidden&&i&&!1===t.options.hidden&&!1===e.options.hidden&&this.body.edgeIndices.push(I.id)}},gT.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",(()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")})),this.body.emitter.on("_dataUpdated",(()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")}))},gT.prototype.setData=function(g){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),g&&g.dot&&(g.nodes||g.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(g&&g.options),g&&g.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");const A=kp(g.dot);this.setData(A)}else if(g&&g.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");const A=Pp(g.gephi);this.setData(A)}else this.nodesHandler.setData(g&&g.nodes,!0),this.edgesHandler.setData(g&&g.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},gT.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(const g in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,g)&&delete this.body.nodes[g];for(const g in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,g)&&delete this.body.edges[g];mu(this.body.container)},gT.prototype._updateValueRange=function(g){let A,C,I,t=0;for(A in g)if(Object.prototype.hasOwnProperty.call(g,A)){const e=g[A].getValue();void 0!==e&&(C=void 0===C?e:Math.min(e,C),I=void 0===I?e:Math.max(e,I),t+=e)}if(void 0!==C&&void 0!==I)for(A in g)Object.prototype.hasOwnProperty.call(g,A)&&g[A].setValueRange(C,I,t)},gT.prototype.isActive=function(){return!this.activator||this.activator.active},gT.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},gT.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},gT.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},gT.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},gT.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},gT.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},gT.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},gT.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},gT.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},gT.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},gT.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},gT.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},gT.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},gT.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},gT.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},gT.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},gT.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},gT.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},gT.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},gT.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},gT.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},gT.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},gT.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},gT.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},gT.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},gT.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},gT.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},gT.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},gT.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},gT.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},gT.prototype.getConnectedNodes=function(g){return void 0!==this.body.nodes[g]?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},gT.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},gT.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},gT.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},gT.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},gT.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},gT.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},gT.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},gT.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},gT.prototype.getNodeAt=function(){const g=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==g&&void 0!==g.id?g.id:g},gT.prototype.getEdgeAt=function(){const g=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==g&&void 0!==g.id?g.id:g},gT.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},gT.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},gT.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},gT.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},gT.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},gT.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},gT.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},gT.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},gT.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},gT.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},gT.prototype.getOptionsFromConfigurator=function(){let g={};return this.configurator&&(g=this.configurator.getOptions.apply(this.configurator)),g};const AT=kp;g.DataSet=fw,g.DataView=bw,g.Network=gT,g.NetworkImages=Zp,g.Queue=cw,g.data=yw,g.networkDOTParser=Rp,g.networkGephiParser=Mp,g.networkOptions=JO,g.parseDOTNetwork=AT,g.parseGephiNetwork=Pp})); +//# sourceMappingURL=vis-network.min.js.map