@rnacanvas/app-object 3.6.1 → 3.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.appObject=e():t.appObject=e()}(this,(()=>(()=>{var t={124:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ConsecutiveBasesSelectingTool:()=>n,SelectedBases:()=>r});class n{constructor(t,e){this.targetDrawing=t,this.selectedBases=e,this.mouseIsDown=!1,window.addEventListener("mousedown",(t=>this.handleMouseDown(t))),window.addEventListener("mouseup",(t=>this.handleMouseUp(t))),window.addEventListener("mouseover",(t=>this.handleMouseOver(t)))}handleMouseDown(t){this.lastMouseDown=t,this.mouseIsDown=!0}handleMouseUp(t){this.mouseIsDown=!1}handleMouseOver(t){if(!this.mouseIsDown)return;let e=this.lastMouseDown;if(!e)return;if(!e.shiftKey)return;if(!(t.target instanceof Node))return;if(!this.targetDrawing.domNode.contains(t.target))return;let n=[...this.targetDrawing.bases],r=n.findIndex((e=>e.domNode===t.target));if(r<0)return;let i=n.findIndex((t=>t.domNode===e.target));if(i<0)return;try{let t=n[i];if(!this.selectedBases.include(t))return}catch(t){console.error(t)}let s=Math.min(i,r),o=Math.max(i,r);this.selectedBases.addAll(n.slice(s,o+1))}}class r{constructor(t,e){this.targetDrawing=t,this.selectedSVGElements=e}[Symbol.iterator](){return[...this.targetDrawing.bases].filter((t=>this.selectedSVGElements.include(t.domNode))).values()}include(t){return this.selectedSVGElements.include(t.domNode)}addAll(t){this.selectedSVGElements.addAll([...t].map((t=>t.domNode)))}}return e})(),t.exports=e()},524:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{BoxTrace:()=>n,LiveSVGElementHighlightings:()=>r});class n{constructor(){this.domNode=document.createElementNS("http://www.w3.org/2000/svg","g"),this.lightDashing=document.createElementNS("http://www.w3.org/2000/svg","path"),this.darkDashing=document.createElementNS("http://www.w3.org/2000/svg","path"),this.domNode.append(this.lightDashing,this.darkDashing),this.domNode.style.pointerEvents="none",this.lightDashing.setAttribute("stroke","powderblue"),this.darkDashing.setAttribute("stroke","blue"),this.lightDashing.setAttribute("stroke-dasharray","0 1"),this.darkDashing.setAttribute("stroke-dasharray","0 1"),this.lightDashing.setAttribute("stroke-linecap","round"),this.darkDashing.setAttribute("stroke-linecap","round"),this.darkDashing.setAttribute("stroke-dashoffset","0.5"),this.lightDashing.setAttribute("stroke-width","0.4"),this.darkDashing.setAttribute("stroke-width","0.4"),this.lightDashing.setAttribute("fill","none"),this.darkDashing.setAttribute("fill","none")}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}trace(t){let e=`M ${t.x} ${t.y} h ${t.width} v ${t.height} h ${-t.width} z`;this.lightDashing.setAttribute("d",e),this.darkDashing.setAttribute("d",e)}setThickness(t){this.lightDashing.setAttribute("stroke-width",`${t}`),this.darkDashing.setAttribute("stroke-width",`${t}`)}setOpacity(t){this.domNode.setAttribute("opacity",`${t}`)}}class r{constructor(t,e){this.targetSVGElements=t,this.domNode=document.createElementNS("http://www.w3.org/2000/svg","g"),this.boxTraces=[],t.addEventListener("change",(()=>this.refresh())),new MutationObserver((()=>this.refresh())).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}refresh(){let t=[...this.targetSVGElements];t.slice(this.boxTraces.length).forEach((()=>{let t=new n;t.appendTo(this.domNode),this.boxTraces.push(t)})),t.forEach(((t,e)=>{try{let n=this.boxTraces[e];n.trace(t.getBBox()),n.setOpacity(1)}catch(t){console.error(t)}})),this.boxTraces.slice(t.length).forEach((t=>t.setOpacity(0)))}}return e})(),t.exports=e()},460:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ClickSelectTool:()=>n});class n{constructor(t,e){this.targetSVGDoc=t,this.selectedSVGElements=e,t.addEventListener("mousedown",(t=>this.handleMouseDown(t)))}handleMouseDown(t){t.target!==this.targetSVGDoc?t.target instanceof SVGGraphicsElement&&this.targetSVGDoc.contains(t.target)&&(this.selectedSVGElements.include(t.target)?!t.shiftKey||this.selectedSVGElements.removeAll([t.target]):(t.shiftKey||this.selectedSVGElements.clear(),this.selectedSVGElements.addAll([t.target]))):t.shiftKey||this.selectedSVGElements.clear()}}return e})(),t.exports=e()},662:function(t){var e;e=()=>(()=>{var t={127:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>h,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>u,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),h=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(a.bind.apply(a,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),h=(0,i.min)(r),u=o;u<=h;u++)s.push(u);e.push(s),n=r,r=t.shift()}return e},t}();function u(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>l,PositionPairs:()=>t,Stems:()=>u,TrailingDanglingBases:()=>a,consecutivePairs:()=>d,parseDotBracket:()=>c});class t{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];return this.targetStructure[1].map((e=>[t.indexOf(e[0])+1,t.indexOf(e[1])+1]))}}class e{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let n=e.flat(),r=t.findIndex((t=>n.includes(t)));if(r<0)throw new Error("No paired bases present in sequence.");return t[r]}}var i=n(986);class s{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let n=e.flat().map((e=>t.indexOf(e)));if((0,i.max)(n)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(n)]}}class o{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let n=new e(...this.targetStructure).get(),r=t.indexOf(n);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)}}class a{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new s(...this.targetStructure).get(),n=t.indexOf(e);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(n+1)}}var h=n(369);class u{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],n=new t(...this.targetStructure).get();return new h.Stems(e,n).get().map((t=>t.map((t=>[e[t[0]-1],e[t[1]-1]]))))}}class l{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],n=new t(...this.targetStructure).get();return new h.Linkers(e,n).get().map((t=>t.map((t=>e[t-1]))))}}function c(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,h.parseDotBracket)(e)].map((e=>{let n=e[0],r=e[1];return[t[n-1],t[r-1]]}))}function d(t){return t.length<2?[]:t.slice(0,-1).map(((e,n)=>[t[n],t[n+1]]))}})(),r})(),t.exports=e()},661:function(t){var e;e=()=>(()=>{var t={127:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>h,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>u,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),h=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(a.bind.apply(a,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),h=(0,i.min)(r),u=o;u<=h;u++)s.push(u);e.push(s),n=r,r=t.shift()}return e},t}();function u(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>l,PositionPairs:()=>t,Stems:()=>u,TrailingDanglingBases:()=>a});var t=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];return this.targetStructure[1].map((function(e){return[t.indexOf(e[0])+1,t.indexOf(e[1])+1]}))},t}(),e=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");var n=e.flat(),r=t.findIndex((function(t){return n.includes(t)}));if(r<0)throw new Error("No paired bases present in sequence.");return t[r]},t}(),i=n(986),s=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");var n=e.flat().map((function(e){return t.indexOf(e)}));if((0,i.max)(n)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(n)]},t}(),o=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var n=(new(e.bind.apply(e,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),r=t.indexOf(n);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)},t}(),a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var e=(new(s.bind.apply(s,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),n=t.indexOf(e);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(n+1)},t}(),h=n(369),u=function(){function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return e.prototype.get=function(){var e=this.targetStructure[0],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new h.Stems(e,n).get().map((function(t){return t.map((function(t){return[e[t[0]-1],e[t[1]-1]]}))}))},e}(),l=function(){function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return e.prototype.get=function(){var e=this.targetStructure[0],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new h.Linkers(e,n).get().map((function(t){return t.map((function(t){return e[t-1]}))}))},e}()})(),r})(),t.exports=e()},173:function(t){var e;e=()=>(()=>{var t={422:function(t){t.exports=(()=>{var t={138:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}return t.r(e),t.d(e,{average:()=>r,mean:()=>r,sum:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function t(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}n.r(r),n.d(r,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=n(138);function s(t){return{x:(0,i.mean)(t.map((function(t){return t.x}))),y:(0,i.mean)(t.map((function(t){return t.y})))}}function o(t,e){return s([t,e])}})(),r})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{CircularSegment:()=>a,Semicircle:()=>e});var t=n(422),e=function(){function e(t){this.chord=t}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return Math.PI*this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcAngle",{get:function(){return Math.PI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){return(0,t.midpoint)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),e}(),i=n(872),s=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(r<=i)throw new Error("Arc length is too small.");if(r>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(r/i*Math.sin(s)-s)/(r/i*Math.cos(s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e+=(Math.PI-this.arcAngle)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(r<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(r/i*Math.sin(Math.PI-s)-s)/(-r/i*Math.cos(Math.PI-s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e-=(this.arcAngle-Math.PI)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function n(n,r){this.chord=n,this.moreProps=r;var i=r.arcLength,a=(0,t.distance)(n[0],n[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var h=a<.001&&i<.001,u=Math.PI*a/2,l=Math.abs(i-u)<.001;this.wrappedCircularSegment=h||l?new e(n):i<u?new s(n,{arcLength:i}):new o(n,{arcLength:i})}return Object.defineProperty(n.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),n}()})(),r})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,degrees:()=>m,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return Math.abs(t-e)<=n}function f(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function m(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function h(t){return null==t}function u(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>u,isNullish:()=>h,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{areWithin:()=>a,centroid:()=>f,deepCopy:()=>s,direction:()=>c,displaced:()=>u,displacement:()=>h,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=n(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(n){return e(n)&&(0,t.isFiniteNumber)(n.x)&&(0,t.isFiniteNumber)(n.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function a(t,e,n){return o(t,e)<=n}function h(t,e){return{x:e.x-t.x,y:e.y-t.y}}function u(t,e){return{x:t.x+e.x,y:t.y+e.y}}var l=n(30);function c(t,e){return(0,l.direction)(h(t,e))}var d=n(986);function f(t){return{x:(0,d.mean)(t.map((function(t){return t.x}))),y:(0,d.mean)(t.map((function(t){return t.y})))}}function p(t,e){return f([t,e])}})(),r})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>h,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>u,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),h=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(a.bind.apply(a,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),h=(0,i.min)(r),u=o;u<=h;u++)s.push(u);e.push(s),n=r,r=t.shift()}return e},t}();function u(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Centroid:()=>s,Direction:()=>f,MaxCenterX:()=>h,MaxCenterY:()=>l,MinCenterX:()=>a,MinCenterY:()=>u,NucleobaseMock:()=>t,circularize:()=>v,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>p,flipY:()=>m,linearize:()=>b,radialize:()=>I,rotate:()=>d,round:()=>S,shift:()=>e,stemmify:()=>x,straighten:()=>w});class t{constructor(t){this.props=t}getCenterPoint(){return this.props.centerPoint}setCenterPoint(t){this.props.centerPoint=t}}function e(t,e){t.forEach((t=>{let n=t.getCenterPoint();t.setCenterPoint({x:n.x+e.x,y:n.y+e.y})}))}var i=n(725);class s{constructor(t){this.targetBases=t}get(){let t=this.targetBases.map((t=>t.getCenterPoint()));return(0,i.centroid)(t)}set(t){let n=this.get(),r=(0,i.displacement)(n,t);e(this.targetBases,r)}}var o=n(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}class l{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}var c=n(30);function d(t,e){if(0==t.length)return;let n=new s(t).get();t.forEach((t=>{let r=t.getCenterPoint(),s=(0,i.distance)(n,r),o=(0,c.direction)((0,i.displacement)(n,r));o+=e,t.setCenterPoint({x:n.x+s*Math.cos(o),y:n.y+s*Math.sin(o)})}))}class f{constructor(t){this.targetBases=t}get(){if(this.targetBases.length<2)return 0;let t=this.targetBases[0],e=this.targetBases[this.targetBases.length-1];return(0,c.direction)((0,i.displacement)(t.getCenterPoint(),e.getCenterPoint()))}set(t){let e=t-this.get();d(this.targetBases,e)}}function p(t){let e=new s(t).get().y;t.forEach((t=>{let n=t.getCenterPoint(),r=n.y-e;t.setCenterPoint({x:n.x,y:e-r})}))}function m(t){let e=new s(t).get().x;t.forEach((t=>{let n=t.getCenterPoint(),r=n.x-e;t.setCenterPoint({x:e-r,y:n.y})}))}function g(t){if(0==t.length)return;let n=t[0],{x:r,y:s}=n.getCenterPoint(),o={x:r,y:s},a=new f(t).get();d(t,-a),p(t),d(t,a),e(t,(0,i.displacement)(n.getCenterPoint(),o))}function y(t){let e=new s(t),{x:n,y:r}=e.get(),i=n,o=r,a=new f(t).get();d(t,-a),m(t),d(t,a),e.set({x:i,y:o})}function b(t,e){let{spacing:n}=e;if(t.length<2)return;let r=new f(t),i=r.get(),o=new s(t),{x:a,y:h}=o.get(),u={x:a,y:h};t.forEach(((t,e)=>{t.setCenterPoint({x:e*n,y:0})})),r.set(i),o.set(u)}function w(t){if(t.length<3)return;let e=t[0],n=t[t.length-1],r=[e.getCenterPoint(),n.getCenterPoint()],s=(0,i.distance)(r[0],r[1]),o=(0,c.direction)((0,i.displacement)(r[0],r[1])),a=s/(t.length-1),h=a*Math.cos(o),u=a*Math.sin(o),{x:l,y:d}=r[0];t.forEach((t=>{t.setCenterPoint({x:l,y:d}),l+=h,d+=u}))}function x(t,n){let{basePairLength:r,basePairSpacing:o}=n;if(t.length<2)return;let a=Math.ceil(t.length/2),h=t.slice(0,a),u=t.slice(a),l=new s(t),{x:c,y:p}=l.get(),m={x:c,y:p},g=new f(t).get();b(h,{spacing:o}),b(u,{spacing:o}),new f(h).set(-Math.PI/2),new f(u).set(Math.PI/2);let y=t[0],w=t[t.length-1];e(h,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(u,(0,i.displacement)(w.getCenterPoint(),{x:r,y:0})),d(t,g),l.set(m)}function v(t,e){let{spacing:n,terminiGap:r}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),h=o,u=a,l=new f(t).get(),c=n*(t.length-1);c+=r,Math.abs(c)<1e-5&&(c=1e-5);let p=c/(2*Math.PI),m=Math.PI/2+2*Math.PI*(.5*r/c);t.forEach(((t,e)=>{let r=m+2*Math.PI*(e*n)/c;t.setCenterPoint({x:p*Math.cos(r),y:p*Math.sin(r)})})),d(t,l),i.set({x:h,y:u})}var _=n(173);function S(t,n){let{spacing:r}=n;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],h=(0,i.distance)(a[0],a[1]),u=r*(t.length-1);if(u-h<.001)return void w(t);if(h<.001){let{x:n,y:o}=s.getCenterPoint();return v(t,{spacing:r,terminiGap:h}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:n,y:o}))}let l=new _.CircularSegment(a,{arcLength:u}),d=l.parentCircleCenterPoint,f=l.parentCircleRadius,p=(0,c.direction)((0,i.displacement)(d,s.getCenterPoint())),m=l.arcAngle/(t.length-1);t.forEach((t=>{t.setCenterPoint({x:d.x+f*Math.cos(p),y:d.y+f*Math.sin(p)}),p+=m}))}var O=n(127),M=n(369);class N{static from(t){return{to:e=>({inclusive:()=>{let n=e-t+1;return Array.from({length:n},((e,n)=>t+n))}})}}}class P{static of(...t){let[e,n]=t,r=new O.PositionPairs(...t).get();r=(0,M.sorted)(r);let i=r.map((t=>t.map((t=>t-1)))),s=[],a=0;return e.forEach(((t,e)=>{let n=i.find((t=>t.includes(e)));n&&e==(0,o.min)(n)?(s.push(a),a+=1):n&&e==(0,o.max)(n)?(a-=1,s.push(a)):s.push(a)})),s}}class A{constructor(...t){let[e,n]=t;this.rawForm=t,this.mountainPlotTraversal=P.of(...t),this.positionPairs=new O.PositionPairs(...t).get(),this.indexPairs=this.positionPairs.map((t=>[t[0]-1,t[1]-1])),this.pairedBases=new Set(n.flat()),this.pairedIndices=new Set(e.map(((t,e)=>({b:t,i:e}))).filter((t=>this.pairedBases.has(t.b))).map((t=>t.i)))}[Symbol.iterator](){return this.rawForm.values()}get sequence(){return this.rawForm[0]}get basePairs(){return this.rawForm[1]}}class E{static correspondingTo(t){return{in:e=>t.map((t=>e.sequence.indexOf(t)))}}}class T{static composedOf(t){if(0==t.length)throw new Error("All stems must have at least one base-pair.");let n=t[0],r=t[t.length-1],s=t.map((t=>t[0])),o=t.map((t=>t[1])).reverse(),a=n[0],h=n[1],u=[...s,...o];return{[Symbol.iterator]:()=>t.values(),bottomBasePair:n,topBasePair:r,side5:s,side3:o,flat:()=>u,firstBase:a,lastBase:h,stemmify:()=>({with:t=>{let{basePairLength:n,basePairSpacing:r}=t,s=Object.assign({},a.getCenterPoint());x(u,{basePairLength:n,basePairSpacing:r}),e(u,(0,i.displacement)(a.getCenterPoint(),s))}})}}}class j{static in(t){return{[Symbol.iterator]:()=>new O.Stems(t.sequence,t.basePairs).get().map((t=>T.composedOf(t))).values()}}}class C{static composedOf(t){if(t.length<2)throw new Error("Linkers must have at least two bases.");let n=t[0],r=t[t.length-1],s=t.slice(1,-1);return{in:o=>{let a=o.sequence.indexOf(n),h=o.sequence.indexOf(r),u=N.from(a).to(h).inclusive(),l=!!o.indexPairs.find((t=>t.includes(a)&&t.includes(h))),c=u.every((t=>0==o.mountainPlotTraversal[t])),d=1==new Set(u.map((t=>o.mountainPlotTraversal[t]))).size&&!l;return{[Symbol.iterator]:()=>t.values(),indices:u,firstBase:n,lastBase:r,firstIndex:a,lastIndex:h,unpairedBases:{[Symbol.iterator]:()=>s.values(),stemmify:()=>({with:t=>{let{spacing:n}=t;if(s.length<3)return;let r=s[0],o=s[s.length-1],a=Object.assign({},r.getCenterPoint());x(s,{basePairLength:(0,i.distance)(r.getCenterPoint(),o.getCenterPoint()),basePairSpacing:n}),e(s,(0,i.displacement)(r.getCenterPoint(),a))}})},get middleThreeUnpairedBases(){if(s.length<3)throw new Error("This linker has less than three unpaired bases.");if(s.length%2==0)throw new Error("This linker has an even number of unpaired bases.");let t=Math.floor(s.length/2);return[s[t-1],s[t],s[t+1]]},isHairpinLoop:()=>l,isInOutermostLoop:()=>c,isBetweenSiblingStems:()=>d,round:()=>({with:e=>{let{spacing:n}=e;S(t,{spacing:n})}})}}}}}class D{static in(t){let e=new O.Linkers(t.sequence,t.basePairs).get().map((e=>C.composedOf(e).in(t)));return{[Symbol.iterator]:()=>e.values(),thatAreHairpinLoops:{[Symbol.iterator]:()=>e.filter((t=>t.isHairpinLoop())).values()},inOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>t.isInOutermostLoop())).values()},notInOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).values(),betweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).filter((t=>t.isBetweenSiblingStems())).values()}},notBetweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isBetweenSiblingStems())).values()}}}}class k{static closedBy(n){return{in:r=>{let s=n.topBasePair,a=E.correspondingTo(s).in(r),h=(0,o.min)(a),u=r.sequence.filter(((t,e)=>e>(0,o.min)(a)&&e<(0,o.max)(a)&&r.mountainPlotTraversal[e]==r.mountainPlotTraversal[h]+1)),l=u.map((t=>r.sequence.indexOf(t))),c=u.filter((t=>r.pairedBases.has(t))),d=l.filter((t=>r.pairedIndices.has(t))),f=[s[0],...u,s[1]];return{[Symbol.iterator]:()=>f.values(),parentStructure:r,closingStem:n,closingBasePair:s,closingIndexPair:a,enclosedBases:u,enclosedIndices:l,enclosedPairedBases:c,enclosedPairedIndices:d,get platform(){if(0==d.length)throw new Error("This loop does not have a platform.");let n=(0,o.min)(d),h=(0,o.max)(d),u=r.sequence.filter(((t,e)=>e>=n&&e<=h&&l.includes(e)&&[e-1,e,e+1].some((t=>d.includes(t)))));return{[Symbol.iterator]:()=>u.values(),firstIndex:n,lastIndex:h,arch:()=>({with:r=>{let{spacing:l}=r,c=(0,o.max)([u.length-2,n-(0,o.min)(a)-1,(0,o.max)(a)-h-1,0]),d=N.from(1).to(c).inclusive().map((()=>new t({centerPoint:{x:0,y:0}}))),f=d.map((()=>new t({centerPoint:{x:0,y:0}}))),p=Object.assign({},s[0].getCenterPoint());v([s[0],...d,...u,...f,s[1]],{spacing:l,terminiGap:l}),e([...s,...u],(0,i.displacement)(s[0].getCenterPoint(),p))}})}}}}}}}class B{static of(t){let e=t.sequence.filter(((e,n)=>0==t.mountainPlotTraversal[n]));return{[Symbol.iterator]:()=>e.values()}}}function I(t,e,n){var r;let{spacing:i,basePairSpacing:o}=n,a=null!==(r=n.hairpinLoopSpacing)&&void 0!==r?r:i,h=new A(t,e);if(t.length<2)return;if(0==e.length)return void v(t,{spacing:i,terminiGap:2*i});let u=Object.assign({},new s(t).get()),l=new f(t).get(),c=j.in(h),d=D.in(h);v([...B.of(h)],{spacing:i,terminiGap:2*i});let p=[...c].map((t=>k.closedBy(t).in(h)));p.filter((t=>t.enclosedPairedBases.length>0)).forEach((t=>{t.closingStem.stemmify().with({basePairLength:i,basePairSpacing:o}),t.platform.arch().with({spacing:i}),t.closingStem.stemmify().with({basePairLength:i,basePairSpacing:o})})),p.filter((t=>0==t.enclosedPairedBases.length)).forEach((t=>t.closingStem.stemmify().with({basePairLength:i,basePairSpacing:o}))),[...d.notBetweenSiblingStems].forEach((t=>t.round().with({spacing:i}))),[...d.thatAreHairpinLoops].forEach((t=>t.round().with({spacing:a}))),[...d.notInOutermostLoop.betweenSiblingStems].filter((t=>[...t.unpairedBases].length>=3)).forEach((t=>{t.unpairedBases.stemmify().with({spacing:i}),[...t.unpairedBases].length%2!=0&&S(t.middleThreeUnpairedBases,{spacing:i})})),new f(t).set(l),new s(t).set(u)}})(),r})(),t.exports=e()},358:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>u,VerticalClientScaling:()=>c,assignUUID:()=>h,bringToFront:()=>d,sendToBack:()=>f});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function h(t){t.id="uuid-"+a()}var u=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")},t}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();function d(t){var e=t.parentNode;e&&e.appendChild(t)}function f(t){var e=t.parentNode;e&&e.prepend(t)}return e})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Nucleobase:()=>He});const t={},e=[];function i(e,n){if(Array.isArray(e))for(const t of e)i(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)i(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function a(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function h(t){return t%360*Math.PI/180}function u(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function d(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:h}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?h:i.includes("bottom")?h+t:h+t/2)}return[r,i]}const f="http://www.w3.org/2000/svg",p="http://www.w3.org/2000/xmlns/",m="http://www.w3.org/1999/xlink",g={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class y{}const b={},w="___SYMBOL___ROOT___";function x(t,e=f){return g.document.createElementNS(e,t)}function v(t,e=!1){if(t instanceof y)return t;if("object"==typeof t)return O(t);if(null==t)return new b[w];if("string"==typeof t&&"<"!==t.charAt(0))return O(g.document.querySelector(t));const n=e?g.document.createElement("div"):x("svg");return n.innerHTML=t,t=O(n.firstChild),n.removeChild(n.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function S(t){if(!t)return null;if(t.instance instanceof y)return t.instance;if("#document-fragment"===t.nodeName)return new b.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":b[e]||(e="Dom"),new b[e](t)}let O=S;function M(t,e=t.name,n=!1){return b[e]=t,n&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let N=1e3;function P(t){return"Svgjs"+l(t)+N++}function A(t){for(let e=t.children.length-1;e>=0;e--)A(t.children[e]);return t.id?(t.id=P(t.nodeName),t):t}function E(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function T(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}i("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=v(t)).before(this),this},insertAfter:function(t){return(t=v(t)).after(this),this}});const j=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,C=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,k=/(#[a-z_][a-z0-9\-_]*)/i,B=/\)\s*,?\s*/,I=/\s/g,L=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,z=/^rgb\(/,R=/^(\s+)?$/,F=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,q=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,V=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function Y(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function G(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function U(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(V)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),i("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=u(e);n[e]=this.node.style[t]}return n}if("string"==typeof t)return this.node.style[u(t)];if("object"==typeof t)for(const e in t)this.node.style[u(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[u(t)]=null==e||R.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),i("Dom",{data:function(t,e,n){if(null==t)return this.data(a(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),i("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class H{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof H||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new H(t,e,n,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?r():e)/.5+.01)+150),n=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new H(t,n,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new H(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new H(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new H(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new H(t,e,n,"lab")}if("grey"===t){const t=255*r();return new H(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(L.test(t)||z.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),h=(o+a)/2,u=o===a,l=o-a;return new H(360*(u?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(u?0:h>.5?l/(2-o-a):l/(o+a)),100*h,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=G(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:G(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:G(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:G(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:G(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:G(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[n,r,i]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!L.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=C.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:n}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,h=o-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(h**3>l?h**3:(h-u)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,h=r>a?1.055*o(r,1/2.4)-.055:12.92*r,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*h,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new H(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*U(i,r,t+1/3),o=255*U(i,r,t),a=255*U(i,r,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Y);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,l=(.2126*o+.7152*a+.0722*h)/1,c=(.0193*o+.1192*a+.9505*h)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new H(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function W(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,h=t.shear||0,u=t.rotate||t.theta||0,l=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new $(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new $(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:w.x,ry:w.y,tx:y,ty:b,ox:c,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=h,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new Q(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=n*s-r*i,u=h>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/h,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new Q(t);return W(this.a,e.a)&&W(this.b,e.b)&&W(this.c,e.c)&&W(this.d,e.d)&&W(this.e,e.e)&&W(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Q.fromArray([1,0,0,1,0,0]);return t=t instanceof yt?t.matrixify():"string"==typeof t?Q.fromArray(t.split(V).map(parseFloat)):Array.isArray(t)?Q.fromArray(t):"object"==typeof t&&Q.isMatrixLike(t)?t:"object"==typeof t?(new Q).transform(t):6===arguments.length?Q.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,h=-e/o,u=-n/o,l=t/o,c=-(a*i+u*s),d=-(h*i+l*s);return this.a=a,this.b=h,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=h(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:l,f:c}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-u*i,this.d=u*r+a*i,this.e=l*r-c*i+n*i-e*r+e,this.f=c*r+l*i-e*i-n*r+n,this}scale(t,e,n,r){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:h}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+h*t-n*t,this}skew(t,e,n,r){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=h(t),e=h(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:l,e:c,f:d}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+l*i,this.d=l+u*s,this.e=c+d*i-r*i,this.f=d+c*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Q.isMatrixLike(t))return new Q(t).multiplyO(this);const e=Q.formatTransforms(t),{x:n,y:r}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new $(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function J(){if(!J.nodes){const t=v().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;J.nodes={svg:t,path:e}}if(!J.nodes.svg.node.parentNode){const t=g.document.body||g.document.documentElement;J.nodes.svg.addTo(t)}return J.nodes}function Z(t){return!(t.width||t.height||t.x||t.y)}M(Q,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=g.window.pageXOffset,this.y+=g.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(V).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Z(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Q||(t=new Q(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new $(this.x,this.y),new $(this.x2,this.y),new $(this.x,this.y2),new $(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new K(e,r,n-e,i-r)}}function tt(t,e,n){let r;try{if(r=e(t.node),Z(r)&&(i=t.node)!==g.document&&!(g.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===g.document}).call(g.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}i({viewbox:{viewbox(t,e,n,r){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new $(n/2/s+i.x,r/2/o+i.y);const u=new K(i).transform(new Q({scale:h,origin:e}));return this.viewbox(u)}}}),M(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}E([et],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const nt=["toArray","constructor","each"];function rt(t,e){return new et(a((e||g.document).querySelectorAll(t),(function(t){return S(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),E([et],t)};let it=0;const st={};function ot(t){let e=t.getEventHolder();return e===g.window&&(e=st),e.events||(e.events={}),e.events}function at(t){return t.getEventTarget()}function ht(t,e,n,r,i){const s=n.bind(r||t),o=v(t),a=ot(o),h=at(o);e=Array.isArray(e)?e:e.split(V),n._svgjsListenerId||(n._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function ut(t,e,n,r){const i=v(t),s=ot(i),o=at(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(V)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let h,u;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])ut(o,[e,a].join("."),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&ut(o,[t,a].join("."));else if(e){if(s[e]){for(h in s[e])ut(o,[e,h].join("."));delete s[e]}}else{for(t in s)ut(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class lt extends y{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ut(this,t,e,n),this}on(t,e,n,r){return ht(this,t,e,n,r),this}removeEventListener(){}}function ct(){}M(lt,"EventTarget");const dt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class ft extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(V).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class pt{constructor(...t){this.init(...t)}convert(t){return new pt(this.value,t)}divide(t){return t=new pt(t),new pt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(j))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof pt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new pt(t),new pt(this-t,this.unit||t.unit)}plus(t){return t=new pt(t),new pt(this+t,this.unit||t.unit)}times(t){return t=new pt(t),new pt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const mt=[];class gt extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=v(t)).removeNamespace&&this.node instanceof g.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return v(t).put(this,e)}children(){return new et(a(this.node.children,(function(t){return S(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=A(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new gt(x(t),e))}first(){return S(this.node.firstChild)}get(t){return S(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=P(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=v(t),this.add(t,e),t}putIn(t,e){return v(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=v(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,f)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=S(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=x("wrapper",n),i=g.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}E(gt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=F.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?dt[t]:F.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,n)=>n(t,e,this)),e))?e=new pt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new ft(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return S(this.node.querySelector(t))}}),M(gt,"Dom");class yt extends gt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new pt(t).plus(this.x()))}dy(t=0){return this.y(new pt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=v(t));const n=new et;let r=this;for(;(r=r.parent())&&r.node!==g.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?v(e[1]):null}root(){const t=this.parent(b[w]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new pt(n.width)).height(new pt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}E(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new $(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Q(this.node.getCTM())},screenCTM:function(){if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new Q(e)}return new Q(this.node.getScreenCTM())}}),M(yt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof H||H.isRgb(e)||e instanceof yt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),i("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new pt(t)):this.rx(t).ry(e)}}),i("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new $(this.node.getPointAtLength(t))}}),i(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),i("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),i("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(B).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(V).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Q.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Q)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Q(this).decompose();return null==t?e:e[t]}Q.isMatrixLike(t)||(t={...t,origin:d(t,this)});const n=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class wt extends yt{flatten(t=this,e){return this.each((function(){if(this instanceof wt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class xt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(xt,"Defs");class vt extends yt{}function _t(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function Ot(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Mt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Nt(t){return this.attr("cx",t)}function Pt(t){return this.attr("cy",t)}function At(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function Et(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(vt,"Shape");var Tt={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et};class jt extends vt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new pt(n.width).divide(2)).ry(new pt(n.height).divide(2))}}E(jt,Tt),i("Container",{ellipse:T((function(t=0,e=t){return this.put(new jt).size(t,e).move(0,0)}))}),M(jt,"Ellipse");class Ct extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Dt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new pt(t),fy:new pt(e)}):this.attr({x1:new pt(t),y1:new pt(e)})}function kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new pt(t),cy:new pt(e)}):this.attr({x2:new pt(t),y2:new pt(e)})}M(Ct,"Fragment");var Bt,It={__proto__:null,from:Dt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}E(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:T((function(t,e){return this.put(new Lt(t)).update(e)}))}}),M(Lt,"Gradient");class zt extends wt{constructor(t,e=t){super(_("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}i({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:T((function(t,e,n){return this.put(new zt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends vt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const n=new g.window.Image;return ht(n,"load",(function(t){const r=this.parent(zt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof zt&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ht(n,"load error",(function(){ut(n)})),this.attr("href",n.src=t,m)}}Bt=function(t,e,n){return"fill"!==t&&"stroke"!==t||q.test(e)&&(e=n.root().defs().image(e)),e instanceof Rt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:T((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Ft extends ft{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new K(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(V).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}var qt={__proto__:null,MorphArray:Ft,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Vt extends vt{constructor(t,e=t){super(_("line",t),e)}array(){return new Ft([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Ft(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}E(Vt,qt),i({Container:{line:T((function(...t){return Vt.prototype.plot.apply(this.put(new Vt),null!=t[0]?t:[0,0,0,0])}))}}),M(Vt,"Line");class Xt extends wt{constructor(t,e=t){super(_("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Yt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:T((function(t,e,n){return this.put(new Xt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Xt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),M(Xt,"Marker");const Gt={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Gt[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}E(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Yt("_duration",Wt),overshoot:Yt("_overshoot",Wt)}),E(class extends $t{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Yt("_windup"),p:Yt("P"),i:Yt("I"),d:Yt("D")});const Qt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jt={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Zt="mlhvqtcsaz".split("");for(let t=0,e=Zt.length;t<e;++t)Jt[Zt[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Jt[t](e,n,r)}}(Zt[t].toUpperCase());function Kt(t){return t.segment.length&&t.segment.length-1===Qt[t.segment[0].toUpperCase()]}function te(t,e){t.inNumber&&ee(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ee(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Kt(t)&&ne(t)}function ne(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Jt[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function re(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends ft{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!te(i,r))if("."!==r)if(isNaN(parseInt(r)))if(" "!==r&&","!==r)if("-"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");ne(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||re(i)){i.inNumber=!0,i.number=r,ee(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&ne(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:V.test(t)?X.test(t)?se:ft:j.test(t)?pt:he:de.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ft:"object"===e?ce:he};class ae{constructor(t){this._stepper=t||new Ht("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(oe(t));let e=new this._type(t);return this._type===H&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ce&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class he{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class ue{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,ue.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}ue.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const le=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class ce{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===H&&t[n+7]!==e[n+7]){const e=t[n+7],r=new H(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=oe(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(le),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const de=[he,ue,ce];class fe extends vt{constructor(t,e=t){super(_("path",t),e)}array(){return this._array||(this._array=new se(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new se(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}fe.prototype.MorphArray=se,i({Container:{path:T((function(t){return this.put(new fe).plot(t||new se)}))}}),M(fe,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new Ft(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Ft(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class me extends vt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:T((function(t){return this.put(new me).plot(t||new Ft)}))}}),E(me,qt),E(me,pe),M(me,"Polygon");class ge extends vt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:T((function(t){return this.put(new ge).plot(t||new Ft)}))}}),E(ge,qt),E(ge,pe),M(ge,"Polyline");class ye extends vt{constructor(t,e=t){super(_("rect",t),e)}}E(ye,{rx:_t,ry:St}),i({Container:{rect:T((function(t,e){return this.put(new ye).size(t,e)}))}}),M(ye,"Rect");class be{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const we={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>g.window.performance||g.window.Date,transforms:[],frame(t){const e=we.frames.push({run:t});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},timeout(t,e){e=e||0;const n=we.timer().now()+e,r=we.timeouts.push({run:t,time:n});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),r},immediate(t){const e=we.immediates.push(t);return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},cancelFrame(t){null!=t&&we.frames.remove(t)},clearTimeout(t){null!=t&&we.timeouts.remove(t)},cancelImmediate(t){null!=t&&we.immediates.remove(t)},_draw(t){let e=null;const n=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==n););let r=null;const i=we.frames.last();for(;r!==i&&(r=we.frames.shift());)r.run(t);let s=null;for(;s=we.immediates.shift();)s();we.nextDraw=we.timeouts.first()||we.frames.first()?g.window.requestAnimationFrame(we._draw):null}},xe=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},ve=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends lt{constructor(t=ve){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(xe);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return we.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=we.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}i({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new _e,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?400:t)?new $t(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof $t,this._stepper=this._isDeclarative?t:new Ht,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e||0,n=n||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,n=t.when||n,i=t.swing||i,r=t.times||r,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Se.sanitise(t,e,n),i=new Se(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new Q,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Ht(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},h=i*(r+n)-r;return a=e<=0?Math.round(t(1e-5)):e<h?t(e):Math.round(t(h-1e-5)),a}const h=Math.floor(this.loops()),u=s&&h%2==0;return a=h+(u&&!o||o&&u?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof _e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new Q,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}E([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Ne=t=>t.transforms;function Pe(){const t=this._transformationRunners.runners.map(Ne).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ae{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Oe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}i({Element:{animate(t,e,n){const r=Se.sanitise(t,e,n),i=this.timeline();return new Se(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ne).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Pe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ae).add(new Oe(new Q(this))))}}}),E(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ae(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new ce(i.from()).valueOf();Object.assign(n,e),i.from(n)}const h=new ce(i.to()).valueOf();Object.assign(h,e),i.to(h),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ae(this._stepper).to(new pt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=Q.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ae(this._stepper).type(n?ue:Q);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||d(t,o),u=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new $(s).transform(o._currentTransform(this));let f=new Q({...t,origin:[c,d]}),p=this._isDeclarative&&a?a:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(f);const m=i.at(l);return h=m.rotate,a=new Q(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=d(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new pt(e),this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new pt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new pt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ae(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new K(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),E(Se,{rx:_t,ry:St,from:Dt,to:kt}),M(Se,"Runner");class Ee extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new xt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof g.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:f,version:"1.1"}).attr("xmlns:xlink",m,p).attr("xmlns:svgjs","http://svgjs.dev/svgjs",p):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,p).attr("xmlns:svgjs",null,p)}root(){return this.isRoot()?this:super.root()}}i({Container:{nested:T((function(){return this.put(new Ee)}))}}),M(Ee,"Svg",!0);class Te extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:T((function(){return this.put(new Te)}))}}),M(Te,"Symbol");var je={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(g.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class Ce extends vt{constructor(t,e=t){super(_("text",t),e),this.dom.leading=new pt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new pt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new pt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"!==e[r].nodeName?(r!==n&&3!==e[r].nodeType&&!0===S(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent):0===r&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}E(Ce,je),i({Container:{text:T((function(t=""){return this.put(new Ce).text(t)})),plain:T((function(t=""){return this.put(new Ce).plain(t)}))}}),M(Ce,"Text");class De extends vt{constructor(t,e=t){super(_("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Ce))return this;const e=t.index(this),n=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new pt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}E(De,je),i({Tspan:{tspan:T((function(t=""){const e=new De;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(De,"Tspan");class ke extends vt{constructor(t,e=t){super(_("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new pt(t).divide(2))}}E(ke,{x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et}),i({Container:{circle:T((function(t=0){return this.put(new ke).size(t).move(0,0)}))}}),M(ke,"Circle");class Be extends wt{constructor(t,e=t){super(_("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return rt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:T((function(){return this.defs().put(new Be)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Be?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),M(Be,"ClipPath");class Ie extends yt{constructor(t,e=t){super(_("foreignObject",t),e)}}i({Container:{foreignObject:T((function(t,e){return this.put(new Ie).size(t,e)}))}}),M(Ie,"ForeignObject");var Le={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,r)=>{let i;try{i=n.bbox()}catch(t){return}const s=new Q(n),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=c(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach(((t,e)=>{const r=new $(n).transform(new Q(t).inverse());t.scale(i,s,r.x,r.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class ze extends wt{constructor(t,e=t){super(_("g",t),e)}}E(ze,Le),i({Container:{group:T((function(){return this.put(new ze)}))}}),M(ze,"G");class Re extends wt{constructor(t,e=t){super(_("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}E(Re,Le),i({Container:{link:T((function(t){return this.put(new Re).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Re,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),M(Re,"A");class Fe extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}i({Container:{mask:T((function(){return this.defs().put(new Fe)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Fe?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Fe,"Mask");class qe extends yt{constructor(t,e=t){super(_("stop",t),e)}update(t){return("number"==typeof t||t instanceof pt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new pt(t.offset)),this}}i({Gradient:{stop:function(t,e,n){return this.put(new qe).update(t,e,n)}}}),M(qe,"Stop");class Ve extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}i("Dom",{style(t,e){return this.put(new Ve).rule(t,e)},fontface(t,e,n){return this.put(new Ve).font(t,e,n)}}),M(Ve,"Style");class Xe extends Ce{constructor(t,e=t){super(_("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}i({Container:{textPath:T((function(t,e){return t instanceof Ce||(t=this.text(t)),t.path(e)}))},Text:{path:T((function(t,e=!0){const n=new Xe;let r;if(t instanceof fe||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:T((function(t){return t instanceof Ce||(t=(new Ce).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Xe.prototype.MorphArray=se,M(Xe,"TextPath");class Ye extends vt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:T((function(t,e){return this.put(new Ye).use(t,e)}))}}),M(Ye,"Use"),E([Ee,Te,Rt,zt,Xt],s("viewbox")),E([Vt,ge,me,fe],s("marker")),E(Ce,s("Text")),E(fe,s("Path")),E(xt,s("Defs")),E([Ce,De],s("Tspan")),E([ye,jt,Lt,Se],s("radius")),E(lt,s("EventTarget")),E(gt,s("Dom")),E(yt,s("Element")),E(vt,s("Shape")),E([wt,Ct],s("Container")),E(Lt,s("Gradient")),E(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){de.push(...[].concat(t))}([pt,H,K,Q,ft,Ft,se,$]),E(de,{to(t){return(new ae).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var Ge=n(726),Ue=n(986),He=function(){function t(t){var e=this;this.textElement=t,this.eventListeners={move:[]},new MutationObserver((function(){return e.callEventListeners("move")})).observe(t,{attributes:!0,attributeFilter:["x","y"]})}return t.create=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","text");n.textContent=e;var r=new t(n);return r.assignUUID(),r.setAttributes(t.defaultAttributes),r},Object.defineProperty(t.prototype,"domNode",{get:function(){return this.textElement},enumerable:!1,configurable:!0}),t.prototype.appendTo=function(t){t.appendChild(this.domNode)},t.prototype.remove=function(){this.domNode.remove()},t.prototype.isIn=function(t){return t.contains(this.domNode)&&t!==this.domNode},t.prototype.hasParent=function(){return!!this.domNode.parentNode},t.prototype.bringToFront=function(){(0,Ge.bringToFront)(this.domNode)},t.prototype.sendToBack=function(){(0,Ge.sendToBack)(this.domNode)},t.prototype.getAttribute=function(t){return this.domNode.getAttribute(t)},t.prototype.setAttribute=function(t,e){this.domNode.setAttribute(t,e)},t.prototype.setAttributes=function(t){try{new Ce(this.domNode).attr(t)}catch(t){}},Object.defineProperty(t.prototype,"id",{get:function(){return this.domNode.id},enumerable:!1,configurable:!0}),t.prototype.assignUUID=function(){(0,Ge.assignUUID)(this.domNode)},Object.defineProperty(t.prototype,"textContent",{get:function(){return this.domNode.textContent},set:function(t){this.domNode.textContent=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bbox",{get:function(){return this.domNode.getBBox()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerPoint",{get:function(){var t=new Ce(this.domNode).bbox();return{x:t.cx,y:t.cy}},set:function(t){new Ce(this.domNode).center(t.x,t.y)},enumerable:!1,configurable:!0}),t.prototype.getCenterPoint=function(){return this.centerPoint},t.prototype.setCenterPoint=function(t){this.centerPoint=t},Object.defineProperty(t.prototype,"boundingClientRect",{get:function(){return this.domNode.getBoundingClientRect()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerClientPoint",{get:function(){var t=this.domNode.getBoundingClientRect();return{x:(0,Ue.mean)([t.left,t.right]),y:(0,Ue.mean)([t.top,t.bottom])}},enumerable:!1,configurable:!0}),t.prototype.getCenterClientPoint=function(){return this.centerClientPoint},t.prototype.addEventListener=function(t,e){this.eventListeners[t].push(e)},t.prototype.callEventListeners=function(t){this.eventListeners[t].forEach((function(t){return t()}))},t.defaultAttributes={"font-family":"Arial","font-size":"9","font-weight":"700"},t.defaultAttributeNames=["font-family","font-size","font-weight"],t}()})(),r})(),t.exports=e()},298:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>u,VerticalClientScaling:()=>c,assignUUID:()=>h});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function h(t){t.id="uuid-"+a()}var u=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")},t}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();return e})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,degrees:()=>m,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return Math.abs(t-e)<=n}function f(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function m(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function h(t){return null==t}function u(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>u,isNullish:()=>h,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{areWithin:()=>a,centroid:()=>f,deepCopy:()=>s,direction:()=>c,displaced:()=>u,displacement:()=>h,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=n(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(n){return e(n)&&(0,t.isFiniteNumber)(n.x)&&(0,t.isFiniteNumber)(n.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function a(t,e,n){return o(t,e)<=n}function h(t,e){return{x:e.x-t.x,y:e.y-t.y}}function u(t,e){return{x:t.x+e.x,y:t.y+e.y}}var l=n(30);function c(t,e){return(0,l.direction)(h(t,e))}var d=n(986);function f(t){return{x:(0,d.mean)(t.map((function(t){return t.x}))),y:(0,d.mean)(t.map((function(t){return t.y})))}}function p(t,e){return f([t,e])}})(),r})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function h(t){return null==t}function u(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>u,isNullish:()=>h,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{StraightBond:()=>Qe});const t={},e=[];function i(e,n){if(Array.isArray(e))for(const t of e)i(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)i(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function a(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function h(t){return t%360*Math.PI/180}function u(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function d(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:h}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?h:i.includes("bottom")?h+t:h+t/2)}return[r,i]}const f="http://www.w3.org/2000/svg",p="http://www.w3.org/2000/xmlns/",m="http://www.w3.org/1999/xlink",g={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class y{}const b={},w="___SYMBOL___ROOT___";function x(t,e=f){return g.document.createElementNS(e,t)}function v(t,e=!1){if(t instanceof y)return t;if("object"==typeof t)return O(t);if(null==t)return new b[w];if("string"==typeof t&&"<"!==t.charAt(0))return O(g.document.querySelector(t));const n=e?g.document.createElement("div"):x("svg");return n.innerHTML=t,t=O(n.firstChild),n.removeChild(n.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function S(t){if(!t)return null;if(t.instance instanceof y)return t.instance;if("#document-fragment"===t.nodeName)return new b.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":b[e]||(e="Dom"),new b[e](t)}let O=S;function M(t,e=t.name,n=!1){return b[e]=t,n&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let N=1e3;function P(t){return"Svgjs"+l(t)+N++}function A(t){for(let e=t.children.length-1;e>=0;e--)A(t.children[e]);return t.id?(t.id=P(t.nodeName),t):t}function E(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function T(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}i("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=v(t)).before(this),this},insertAfter:function(t){return(t=v(t)).after(this),this}});const j=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,C=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,k=/(#[a-z_][a-z0-9\-_]*)/i,B=/\)\s*,?\s*/,I=/\s/g,L=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,z=/^rgb\(/,R=/^(\s+)?$/,F=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,q=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,V=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function Y(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function G(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function U(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(V)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),i("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=u(e);n[e]=this.node.style[t]}return n}if("string"==typeof t)return this.node.style[u(t)];if("object"==typeof t)for(const e in t)this.node.style[u(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[u(t)]=null==e||R.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),i("Dom",{data:function(t,e,n){if(null==t)return this.data(a(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),i("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class H{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof H||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new H(t,e,n,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?r():e)/.5+.01)+150),n=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new H(t,n,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new H(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new H(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new H(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new H(t,e,n,"lab")}if("grey"===t){const t=255*r();return new H(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(L.test(t)||z.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),h=(o+a)/2,u=o===a,l=o-a;return new H(360*(u?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(u?0:h>.5?l/(2-o-a):l/(o+a)),100*h,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=G(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:G(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:G(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:G(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:G(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:G(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[n,r,i]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!L.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=C.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:n}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,h=o-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(h**3>l?h**3:(h-u)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,h=r>a?1.055*o(r,1/2.4)-.055:12.92*r,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*h,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new H(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*U(i,r,t+1/3),o=255*U(i,r,t),a=255*U(i,r,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Y);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,l=(.2126*o+.7152*a+.0722*h)/1,c=(.0193*o+.1192*a+.9505*h)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new H(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function W(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,h=t.shear||0,u=t.rotate||t.theta||0,l=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new $(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new $(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:w.x,ry:w.y,tx:y,ty:b,ox:c,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=h,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new Q(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=n*s-r*i,u=h>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/h,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new Q(t);return W(this.a,e.a)&&W(this.b,e.b)&&W(this.c,e.c)&&W(this.d,e.d)&&W(this.e,e.e)&&W(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Q.fromArray([1,0,0,1,0,0]);return t=t instanceof yt?t.matrixify():"string"==typeof t?Q.fromArray(t.split(V).map(parseFloat)):Array.isArray(t)?Q.fromArray(t):"object"==typeof t&&Q.isMatrixLike(t)?t:"object"==typeof t?(new Q).transform(t):6===arguments.length?Q.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,h=-e/o,u=-n/o,l=t/o,c=-(a*i+u*s),d=-(h*i+l*s);return this.a=a,this.b=h,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=h(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:l,f:c}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-u*i,this.d=u*r+a*i,this.e=l*r-c*i+n*i-e*r+e,this.f=c*r+l*i-e*i-n*r+n,this}scale(t,e,n,r){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:h}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+h*t-n*t,this}skew(t,e,n,r){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=h(t),e=h(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:l,e:c,f:d}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+l*i,this.d=l+u*s,this.e=c+d*i-r*i,this.f=d+c*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Q.isMatrixLike(t))return new Q(t).multiplyO(this);const e=Q.formatTransforms(t),{x:n,y:r}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new $(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function J(){if(!J.nodes){const t=v().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;J.nodes={svg:t,path:e}}if(!J.nodes.svg.node.parentNode){const t=g.document.body||g.document.documentElement;J.nodes.svg.addTo(t)}return J.nodes}function Z(t){return!(t.width||t.height||t.x||t.y)}M(Q,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=g.window.pageXOffset,this.y+=g.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(V).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Z(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Q||(t=new Q(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new $(this.x,this.y),new $(this.x2,this.y),new $(this.x,this.y2),new $(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new K(e,r,n-e,i-r)}}function tt(t,e,n){let r;try{if(r=e(t.node),Z(r)&&(i=t.node)!==g.document&&!(g.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===g.document}).call(g.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}i({viewbox:{viewbox(t,e,n,r){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new $(n/2/s+i.x,r/2/o+i.y);const u=new K(i).transform(new Q({scale:h,origin:e}));return this.viewbox(u)}}}),M(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}E([et],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const nt=["toArray","constructor","each"];function rt(t,e){return new et(a((e||g.document).querySelectorAll(t),(function(t){return S(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),E([et],t)};let it=0;const st={};function ot(t){let e=t.getEventHolder();return e===g.window&&(e=st),e.events||(e.events={}),e.events}function at(t){return t.getEventTarget()}function ht(t,e,n,r,i){const s=n.bind(r||t),o=v(t),a=ot(o),h=at(o);e=Array.isArray(e)?e:e.split(V),n._svgjsListenerId||(n._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function ut(t,e,n,r){const i=v(t),s=ot(i),o=at(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(V)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let h,u;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])ut(o,[e,a].join("."),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&ut(o,[t,a].join("."));else if(e){if(s[e]){for(h in s[e])ut(o,[e,h].join("."));delete s[e]}}else{for(t in s)ut(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class lt extends y{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ut(this,t,e,n),this}on(t,e,n,r){return ht(this,t,e,n,r),this}removeEventListener(){}}function ct(){}M(lt,"EventTarget");const dt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class ft extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(V).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class pt{constructor(...t){this.init(...t)}convert(t){return new pt(this.value,t)}divide(t){return t=new pt(t),new pt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(j))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof pt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new pt(t),new pt(this-t,this.unit||t.unit)}plus(t){return t=new pt(t),new pt(this+t,this.unit||t.unit)}times(t){return t=new pt(t),new pt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const mt=[];class gt extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=v(t)).removeNamespace&&this.node instanceof g.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return v(t).put(this,e)}children(){return new et(a(this.node.children,(function(t){return S(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=A(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new gt(x(t),e))}first(){return S(this.node.firstChild)}get(t){return S(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=P(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=v(t),this.add(t,e),t}putIn(t,e){return v(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=v(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,f)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=S(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=x("wrapper",n),i=g.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}E(gt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=F.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?dt[t]:F.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,n)=>n(t,e,this)),e))?e=new pt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new ft(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return S(this.node.querySelector(t))}}),M(gt,"Dom");class yt extends gt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new pt(t).plus(this.x()))}dy(t=0){return this.y(new pt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=v(t));const n=new et;let r=this;for(;(r=r.parent())&&r.node!==g.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?v(e[1]):null}root(){const t=this.parent(b[w]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new pt(n.width)).height(new pt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}E(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new $(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Q(this.node.getCTM())},screenCTM:function(){if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new Q(e)}return new Q(this.node.getScreenCTM())}}),M(yt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof H||H.isRgb(e)||e instanceof yt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),i("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new pt(t)):this.rx(t).ry(e)}}),i("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new $(this.node.getPointAtLength(t))}}),i(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),i("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),i("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(B).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(V).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Q.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Q)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Q(this).decompose();return null==t?e:e[t]}Q.isMatrixLike(t)||(t={...t,origin:d(t,this)});const n=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class wt extends yt{flatten(t=this,e){return this.each((function(){if(this instanceof wt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class xt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(xt,"Defs");class vt extends yt{}function _t(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function Ot(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Mt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Nt(t){return this.attr("cx",t)}function Pt(t){return this.attr("cy",t)}function At(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function Et(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(vt,"Shape");var Tt={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et};class jt extends vt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new pt(n.width).divide(2)).ry(new pt(n.height).divide(2))}}E(jt,Tt),i("Container",{ellipse:T((function(t=0,e=t){return this.put(new jt).size(t,e).move(0,0)}))}),M(jt,"Ellipse");class Ct extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Dt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new pt(t),fy:new pt(e)}):this.attr({x1:new pt(t),y1:new pt(e)})}function kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new pt(t),cy:new pt(e)}):this.attr({x2:new pt(t),y2:new pt(e)})}M(Ct,"Fragment");var Bt,It={__proto__:null,from:Dt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}E(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:T((function(t,e){return this.put(new Lt(t)).update(e)}))}}),M(Lt,"Gradient");class zt extends wt{constructor(t,e=t){super(_("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}i({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:T((function(t,e,n){return this.put(new zt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends vt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const n=new g.window.Image;return ht(n,"load",(function(t){const r=this.parent(zt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof zt&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ht(n,"load error",(function(){ut(n)})),this.attr("href",n.src=t,m)}}Bt=function(t,e,n){return"fill"!==t&&"stroke"!==t||q.test(e)&&(e=n.root().defs().image(e)),e instanceof Rt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:T((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Ft extends ft{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new K(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(V).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}var qt={__proto__:null,MorphArray:Ft,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Vt extends vt{constructor(t,e=t){super(_("line",t),e)}array(){return new Ft([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Ft(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}E(Vt,qt),i({Container:{line:T((function(...t){return Vt.prototype.plot.apply(this.put(new Vt),null!=t[0]?t:[0,0,0,0])}))}}),M(Vt,"Line");class Xt extends wt{constructor(t,e=t){super(_("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Yt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:T((function(t,e,n){return this.put(new Xt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Xt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),M(Xt,"Marker");const Gt={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Gt[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}E(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Yt("_duration",Wt),overshoot:Yt("_overshoot",Wt)}),E(class extends $t{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Yt("_windup"),p:Yt("P"),i:Yt("I"),d:Yt("D")});const Qt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jt={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Zt="mlhvqtcsaz".split("");for(let t=0,e=Zt.length;t<e;++t)Jt[Zt[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Jt[t](e,n,r)}}(Zt[t].toUpperCase());function Kt(t){return t.segment.length&&t.segment.length-1===Qt[t.segment[0].toUpperCase()]}function te(t,e){t.inNumber&&ee(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ee(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Kt(t)&&ne(t)}function ne(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Jt[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function re(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends ft{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!te(i,r))if("."!==r)if(isNaN(parseInt(r)))if(" "!==r&&","!==r)if("-"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");ne(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||re(i)){i.inNumber=!0,i.number=r,ee(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&ne(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:V.test(t)?X.test(t)?se:ft:j.test(t)?pt:he:de.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ft:"object"===e?ce:he};class ae{constructor(t){this._stepper=t||new Ht("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(oe(t));let e=new this._type(t);return this._type===H&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ce&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class he{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class ue{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,ue.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}ue.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const le=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class ce{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===H&&t[n+7]!==e[n+7]){const e=t[n+7],r=new H(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=oe(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(le),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const de=[he,ue,ce];class fe extends vt{constructor(t,e=t){super(_("path",t),e)}array(){return this._array||(this._array=new se(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new se(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}fe.prototype.MorphArray=se,i({Container:{path:T((function(t){return this.put(new fe).plot(t||new se)}))}}),M(fe,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new Ft(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Ft(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class me extends vt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:T((function(t){return this.put(new me).plot(t||new Ft)}))}}),E(me,qt),E(me,pe),M(me,"Polygon");class ge extends vt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:T((function(t){return this.put(new ge).plot(t||new Ft)}))}}),E(ge,qt),E(ge,pe),M(ge,"Polyline");class ye extends vt{constructor(t,e=t){super(_("rect",t),e)}}E(ye,{rx:_t,ry:St}),i({Container:{rect:T((function(t,e){return this.put(new ye).size(t,e)}))}}),M(ye,"Rect");class be{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const we={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>g.window.performance||g.window.Date,transforms:[],frame(t){const e=we.frames.push({run:t});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},timeout(t,e){e=e||0;const n=we.timer().now()+e,r=we.timeouts.push({run:t,time:n});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),r},immediate(t){const e=we.immediates.push(t);return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},cancelFrame(t){null!=t&&we.frames.remove(t)},clearTimeout(t){null!=t&&we.timeouts.remove(t)},cancelImmediate(t){null!=t&&we.immediates.remove(t)},_draw(t){let e=null;const n=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==n););let r=null;const i=we.frames.last();for(;r!==i&&(r=we.frames.shift());)r.run(t);let s=null;for(;s=we.immediates.shift();)s();we.nextDraw=we.timeouts.first()||we.frames.first()?g.window.requestAnimationFrame(we._draw):null}},xe=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},ve=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends lt{constructor(t=ve){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(xe);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return we.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=we.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}i({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new _e,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?400:t)?new $t(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof $t,this._stepper=this._isDeclarative?t:new Ht,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e||0,n=n||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,n=t.when||n,i=t.swing||i,r=t.times||r,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Se.sanitise(t,e,n),i=new Se(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new Q,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Ht(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},h=i*(r+n)-r;return a=e<=0?Math.round(t(1e-5)):e<h?t(e):Math.round(t(h-1e-5)),a}const h=Math.floor(this.loops()),u=s&&h%2==0;return a=h+(u&&!o||o&&u?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof _e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new Q,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}E([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Ne=t=>t.transforms;function Pe(){const t=this._transformationRunners.runners.map(Ne).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ae{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Oe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}i({Element:{animate(t,e,n){const r=Se.sanitise(t,e,n),i=this.timeline();return new Se(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ne).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Pe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ae).add(new Oe(new Q(this))))}}}),E(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ae(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new ce(i.from()).valueOf();Object.assign(n,e),i.from(n)}const h=new ce(i.to()).valueOf();Object.assign(h,e),i.to(h),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ae(this._stepper).to(new pt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=Q.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ae(this._stepper).type(n?ue:Q);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||d(t,o),u=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new $(s).transform(o._currentTransform(this));let f=new Q({...t,origin:[c,d]}),p=this._isDeclarative&&a?a:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(f);const m=i.at(l);return h=m.rotate,a=new Q(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=d(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new pt(e),this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new pt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new pt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ae(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new K(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),E(Se,{rx:_t,ry:St,from:Dt,to:kt}),M(Se,"Runner");class Ee extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new xt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof g.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:f,version:"1.1"}).attr("xmlns:xlink",m,p).attr("xmlns:svgjs","http://svgjs.dev/svgjs",p):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,p).attr("xmlns:svgjs",null,p)}root(){return this.isRoot()?this:super.root()}}i({Container:{nested:T((function(){return this.put(new Ee)}))}}),M(Ee,"Svg",!0);class Te extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:T((function(){return this.put(new Te)}))}}),M(Te,"Symbol");var je={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(g.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class Ce extends vt{constructor(t,e=t){super(_("text",t),e),this.dom.leading=new pt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new pt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new pt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"!==e[r].nodeName?(r!==n&&3!==e[r].nodeType&&!0===S(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent):0===r&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}E(Ce,je),i({Container:{text:T((function(t=""){return this.put(new Ce).text(t)})),plain:T((function(t=""){return this.put(new Ce).plain(t)}))}}),M(Ce,"Text");class De extends vt{constructor(t,e=t){super(_("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Ce))return this;const e=t.index(this),n=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new pt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}E(De,je),i({Tspan:{tspan:T((function(t=""){const e=new De;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(De,"Tspan");class ke extends vt{constructor(t,e=t){super(_("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new pt(t).divide(2))}}E(ke,{x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et}),i({Container:{circle:T((function(t=0){return this.put(new ke).size(t).move(0,0)}))}}),M(ke,"Circle");class Be extends wt{constructor(t,e=t){super(_("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return rt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:T((function(){return this.defs().put(new Be)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Be?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),M(Be,"ClipPath");class Ie extends yt{constructor(t,e=t){super(_("foreignObject",t),e)}}i({Container:{foreignObject:T((function(t,e){return this.put(new Ie).size(t,e)}))}}),M(Ie,"ForeignObject");var Le={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,r)=>{let i;try{i=n.bbox()}catch(t){return}const s=new Q(n),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=c(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach(((t,e)=>{const r=new $(n).transform(new Q(t).inverse());t.scale(i,s,r.x,r.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class ze extends wt{constructor(t,e=t){super(_("g",t),e)}}E(ze,Le),i({Container:{group:T((function(){return this.put(new ze)}))}}),M(ze,"G");class Re extends wt{constructor(t,e=t){super(_("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}E(Re,Le),i({Container:{link:T((function(t){return this.put(new Re).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Re,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),M(Re,"A");class Fe extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}i({Container:{mask:T((function(){return this.defs().put(new Fe)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Fe?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Fe,"Mask");class qe extends yt{constructor(t,e=t){super(_("stop",t),e)}update(t){return("number"==typeof t||t instanceof pt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new pt(t.offset)),this}}i({Gradient:{stop:function(t,e,n){return this.put(new qe).update(t,e,n)}}}),M(qe,"Stop");class Ve extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}i("Dom",{style(t,e){return this.put(new Ve).rule(t,e)},fontface(t,e,n){return this.put(new Ve).font(t,e,n)}}),M(Ve,"Style");class Xe extends Ce{constructor(t,e=t){super(_("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}i({Container:{textPath:T((function(t,e){return t instanceof Ce||(t=this.text(t)),t.path(e)}))},Text:{path:T((function(t,e=!0){const n=new Xe;let r;if(t instanceof fe||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:T((function(t){return t instanceof Ce||(t=(new Ce).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Xe.prototype.MorphArray=se,M(Xe,"TextPath");class Ye extends vt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:T((function(t,e){return this.put(new Ye).use(t,e)}))}}),M(Ye,"Use"),E([Ee,Te,Rt,zt,Xt],s("viewbox")),E([Vt,ge,me,fe],s("marker")),E(Ce,s("Text")),E(fe,s("Path")),E(xt,s("Defs")),E([Ce,De],s("Tspan")),E([ye,jt,Lt,Se],s("radius")),E(lt,s("EventTarget")),E(gt,s("Dom")),E(yt,s("Element")),E(vt,s("Shape")),E([wt,Ct],s("Container")),E(Lt,s("Gradient")),E(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){de.push(...[].concat(t))}([pt,H,K,Q,ft,Ft,se,$]),E(de,{to(t){return(new ae).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var Ge=n(726),Ue=n(725),He=n(854),$e=["basePadding1","basePadding2"],We={basePadding1:"setBasePadding1",basePadding2:"setBasePadding2"},Qe=function(){function t(t,e,n){var r=this;this.line=t,this.base1=e,this.base2=n,this.cachedBasePadding1=(0,Ue.distance)(this.point1,this.base1.centerPoint),this.cachedBasePadding2=(0,Ue.distance)(this.point2,this.base2.centerPoint),e.addEventListener("move",(function(){return r.reposition()})),n.addEventListener("move",(function(){return r.reposition()}))}return t.between=function(e,n){var r=new t((new Vt).node,e,n);return r.assignUUID(),r.set(t.defaultValues),r.reposition(),r},Object.defineProperty(t.prototype,"basePair",{get:function(){return[this.base1,this.base2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"domNode",{get:function(){return this.line},enumerable:!1,configurable:!0}),t.prototype.getAttribute=function(t){return this.domNode.getAttribute(t)},t.prototype.setAttribute=function(t,e){this.domNode.setAttribute(t,e)},t.prototype.setAttributes=function(t){if((0,He.isNonNullObject)(t))try{new Vt(this.domNode).attr(t)}catch(t){}},Object.defineProperty(t.prototype,"id",{get:function(){return this.domNode.id},enumerable:!1,configurable:!0}),t.prototype.assignUUID=function(){(0,Ge.assignUUID)(this.domNode)},t.prototype.appendTo=function(t){t.appendChild(this.domNode)},t.prototype.remove=function(){this.domNode.remove()},t.prototype.isIn=function(t){return t.contains(this.domNode)&&t!==this.domNode},t.prototype.hasParent=function(){return!!this.domNode.parentNode},t.prototype.getTotalLength=function(){return this.domNode.getTotalLength()},t.prototype.getPointAtLength=function(t){return this.domNode.getPointAtLength(t)},Object.defineProperty(t.prototype,"point1",{get:function(){return{x:this.domNode.x1.baseVal.value,y:this.domNode.y1.baseVal.value}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"point2",{get:function(){return{x:this.domNode.x2.baseVal.value,y:this.domNode.y2.baseVal.value}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"basePadding1",{get:function(){return this.cachedBasePadding1},set:function(t){this.cachedBasePadding1=t,this.reposition()},enumerable:!1,configurable:!0}),t.prototype.setBasePadding1=function(t){(0,He.isFiniteNumber)(t)&&(this.basePadding1=Math.max(0,t))},Object.defineProperty(t.prototype,"basePadding2",{get:function(){return this.cachedBasePadding2},set:function(t){this.cachedBasePadding2=t,this.reposition()},enumerable:!1,configurable:!0}),t.prototype.setBasePadding2=function(t){(0,He.isFiniteNumber)(t)&&(this.basePadding2=Math.max(0,t))},t.prototype.set=function(t){var e=this;try{this.setAttributes(t.attributes)}catch(t){}$e.forEach((function(n){try{e[We[n]](t[n])}catch(t){}}))},t.prototype.reposition=function(){var t=this.base1.centerPoint,e=this.base2.centerPoint,n=(0,Ue.direction)(t,e);this.setAttribute("x1","".concat(t.x+this.basePadding1*Math.cos(n))),this.setAttribute("y1","".concat(t.y+this.basePadding1*Math.sin(n))),this.setAttribute("x2","".concat(e.x-this.basePadding2*Math.cos(n))),this.setAttribute("y2","".concat(e.y-this.basePadding2*Math.sin(n)))},t.prototype.basesMoved=function(){this.reposition()},t.prototype.basesRemoved=function(){this.base1.hasParent()&&this.base2.hasParent()||this.remove()},t.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},t}()})(),r})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>u,VerticalClientScaling:()=>c,assignUUID:()=>h,bringToFront:()=>d,sendToBack:()=>f});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function h(t){t.id="uuid-"+a()}var u=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")},t}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();function d(t){var e=t.parentNode;e&&e.appendChild(t)}function f(t){var e=t.parentNode;e&&e.prepend(t)}return e})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{DotBracketDrawer:()=>rn,Drawing:()=>Ke,Nucleobase:()=>Ue.Nucleobase,StraightBond:()=>We.StraightBond});const t={},e=[];function i(e,n){if(Array.isArray(e))for(const t of e)i(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)i(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function a(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function h(t){return t%360*Math.PI/180}function u(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function d(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:h}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?h:i.includes("bottom")?h+t:h+t/2)}return[r,i]}const f="http://www.w3.org/2000/svg",p="http://www.w3.org/2000/xmlns/",m="http://www.w3.org/1999/xlink",g={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class y{}const b={},w="___SYMBOL___ROOT___";function x(t,e=f){return g.document.createElementNS(e,t)}function v(t,e=!1){if(t instanceof y)return t;if("object"==typeof t)return O(t);if(null==t)return new b[w];if("string"==typeof t&&"<"!==t.charAt(0))return O(g.document.querySelector(t));const n=e?g.document.createElement("div"):x("svg");return n.innerHTML=t,t=O(n.firstChild),n.removeChild(n.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function S(t){if(!t)return null;if(t.instance instanceof y)return t.instance;if("#document-fragment"===t.nodeName)return new b.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":b[e]||(e="Dom"),new b[e](t)}let O=S;function M(t,e=t.name,n=!1){return b[e]=t,n&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let N=1e3;function P(t){return"Svgjs"+l(t)+N++}function A(t){for(let e=t.children.length-1;e>=0;e--)A(t.children[e]);return t.id?(t.id=P(t.nodeName),t):t}function E(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function T(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}i("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=v(t)).before(this),this},insertAfter:function(t){return(t=v(t)).after(this),this}});const j=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,C=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,k=/(#[a-z_][a-z0-9\-_]*)/i,B=/\)\s*,?\s*/,I=/\s/g,L=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,z=/^rgb\(/,R=/^(\s+)?$/,F=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,q=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,V=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function Y(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function G(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function U(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(V)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),i("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=u(e);n[e]=this.node.style[t]}return n}if("string"==typeof t)return this.node.style[u(t)];if("object"==typeof t)for(const e in t)this.node.style[u(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[u(t)]=null==e||R.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),i("Dom",{data:function(t,e,n){if(null==t)return this.data(a(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),i("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class H{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof H||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new H(t,e,n,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?r():e)/.5+.01)+150),n=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new H(t,n,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new H(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new H(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new H(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new H(t,e,n,"lab")}if("grey"===t){const t=255*r();return new H(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(L.test(t)||z.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),h=(o+a)/2,u=o===a,l=o-a;return new H(360*(u?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(u?0:h>.5?l/(2-o-a):l/(o+a)),100*h,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=G(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:G(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:G(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:G(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:G(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:G(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[n,r,i]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!L.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=C.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:n}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,h=o-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(h**3>l?h**3:(h-u)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,h=r>a?1.055*o(r,1/2.4)-.055:12.92*r,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*h,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new H(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*U(i,r,t+1/3),o=255*U(i,r,t),a=255*U(i,r,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Y);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,l=(.2126*o+.7152*a+.0722*h)/1,c=(.0193*o+.1192*a+.9505*h)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new H(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function W(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,h=t.shear||0,u=t.rotate||t.theta||0,l=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new $(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new $(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:w.x,ry:w.y,tx:y,ty:b,ox:c,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=h,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new Q(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=n*s-r*i,u=h>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/h,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new Q(t);return W(this.a,e.a)&&W(this.b,e.b)&&W(this.c,e.c)&&W(this.d,e.d)&&W(this.e,e.e)&&W(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Q.fromArray([1,0,0,1,0,0]);return t=t instanceof yt?t.matrixify():"string"==typeof t?Q.fromArray(t.split(V).map(parseFloat)):Array.isArray(t)?Q.fromArray(t):"object"==typeof t&&Q.isMatrixLike(t)?t:"object"==typeof t?(new Q).transform(t):6===arguments.length?Q.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,h=-e/o,u=-n/o,l=t/o,c=-(a*i+u*s),d=-(h*i+l*s);return this.a=a,this.b=h,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=h(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:l,f:c}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-u*i,this.d=u*r+a*i,this.e=l*r-c*i+n*i-e*r+e,this.f=c*r+l*i-e*i-n*r+n,this}scale(t,e,n,r){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:h}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+h*t-n*t,this}skew(t,e,n,r){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=h(t),e=h(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:l,e:c,f:d}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+l*i,this.d=l+u*s,this.e=c+d*i-r*i,this.f=d+c*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Q.isMatrixLike(t))return new Q(t).multiplyO(this);const e=Q.formatTransforms(t),{x:n,y:r}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new $(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function J(){if(!J.nodes){const t=v().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;J.nodes={svg:t,path:e}}if(!J.nodes.svg.node.parentNode){const t=g.document.body||g.document.documentElement;J.nodes.svg.addTo(t)}return J.nodes}function Z(t){return!(t.width||t.height||t.x||t.y)}M(Q,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=g.window.pageXOffset,this.y+=g.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(V).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Z(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Q||(t=new Q(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new $(this.x,this.y),new $(this.x2,this.y),new $(this.x,this.y2),new $(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new K(e,r,n-e,i-r)}}function tt(t,e,n){let r;try{if(r=e(t.node),Z(r)&&(i=t.node)!==g.document&&!(g.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===g.document}).call(g.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}i({viewbox:{viewbox(t,e,n,r){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new $(n/2/s+i.x,r/2/o+i.y);const u=new K(i).transform(new Q({scale:h,origin:e}));return this.viewbox(u)}}}),M(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}E([et],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const nt=["toArray","constructor","each"];function rt(t,e){return new et(a((e||g.document).querySelectorAll(t),(function(t){return S(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),E([et],t)};let it=0;const st={};function ot(t){let e=t.getEventHolder();return e===g.window&&(e=st),e.events||(e.events={}),e.events}function at(t){return t.getEventTarget()}function ht(t,e,n,r,i){const s=n.bind(r||t),o=v(t),a=ot(o),h=at(o);e=Array.isArray(e)?e:e.split(V),n._svgjsListenerId||(n._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function ut(t,e,n,r){const i=v(t),s=ot(i),o=at(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(V)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let h,u;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])ut(o,[e,a].join("."),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&ut(o,[t,a].join("."));else if(e){if(s[e]){for(h in s[e])ut(o,[e,h].join("."));delete s[e]}}else{for(t in s)ut(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class lt extends y{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ut(this,t,e,n),this}on(t,e,n,r){return ht(this,t,e,n,r),this}removeEventListener(){}}function ct(){}M(lt,"EventTarget");const dt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class ft extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(V).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class pt{constructor(...t){this.init(...t)}convert(t){return new pt(this.value,t)}divide(t){return t=new pt(t),new pt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(j))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof pt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new pt(t),new pt(this-t,this.unit||t.unit)}plus(t){return t=new pt(t),new pt(this+t,this.unit||t.unit)}times(t){return t=new pt(t),new pt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const mt=[];class gt extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=v(t)).removeNamespace&&this.node instanceof g.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return v(t).put(this,e)}children(){return new et(a(this.node.children,(function(t){return S(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=A(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new gt(x(t),e))}first(){return S(this.node.firstChild)}get(t){return S(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=P(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=v(t),this.add(t,e),t}putIn(t,e){return v(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=v(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,f)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=S(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=x("wrapper",n),i=g.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}E(gt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=F.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?dt[t]:F.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,n)=>n(t,e,this)),e))?e=new pt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new ft(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return S(this.node.querySelector(t))}}),M(gt,"Dom");class yt extends gt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new pt(t).plus(this.x()))}dy(t=0){return this.y(new pt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=v(t));const n=new et;let r=this;for(;(r=r.parent())&&r.node!==g.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?v(e[1]):null}root(){const t=this.parent(b[w]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new pt(n.width)).height(new pt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}E(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new $(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Q(this.node.getCTM())},screenCTM:function(){if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new Q(e)}return new Q(this.node.getScreenCTM())}}),M(yt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof H||H.isRgb(e)||e instanceof yt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),i("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new pt(t)):this.rx(t).ry(e)}}),i("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new $(this.node.getPointAtLength(t))}}),i(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),i("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),i("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(B).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(V).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Q.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Q)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Q(this).decompose();return null==t?e:e[t]}Q.isMatrixLike(t)||(t={...t,origin:d(t,this)});const n=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class wt extends yt{flatten(t=this,e){return this.each((function(){if(this instanceof wt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class xt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(xt,"Defs");class vt extends yt{}function _t(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function Ot(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Mt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Nt(t){return this.attr("cx",t)}function Pt(t){return this.attr("cy",t)}function At(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function Et(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(vt,"Shape");var Tt={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et};class jt extends vt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new pt(n.width).divide(2)).ry(new pt(n.height).divide(2))}}E(jt,Tt),i("Container",{ellipse:T((function(t=0,e=t){return this.put(new jt).size(t,e).move(0,0)}))}),M(jt,"Ellipse");class Ct extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Dt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new pt(t),fy:new pt(e)}):this.attr({x1:new pt(t),y1:new pt(e)})}function kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new pt(t),cy:new pt(e)}):this.attr({x2:new pt(t),y2:new pt(e)})}M(Ct,"Fragment");var Bt,It={__proto__:null,from:Dt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}E(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:T((function(t,e){return this.put(new Lt(t)).update(e)}))}}),M(Lt,"Gradient");class zt extends wt{constructor(t,e=t){super(_("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}i({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:T((function(t,e,n){return this.put(new zt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends vt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const n=new g.window.Image;return ht(n,"load",(function(t){const r=this.parent(zt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof zt&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ht(n,"load error",(function(){ut(n)})),this.attr("href",n.src=t,m)}}Bt=function(t,e,n){return"fill"!==t&&"stroke"!==t||q.test(e)&&(e=n.root().defs().image(e)),e instanceof Rt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:T((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Ft extends ft{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new K(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(V).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}var qt={__proto__:null,MorphArray:Ft,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Vt extends vt{constructor(t,e=t){super(_("line",t),e)}array(){return new Ft([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Ft(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}E(Vt,qt),i({Container:{line:T((function(...t){return Vt.prototype.plot.apply(this.put(new Vt),null!=t[0]?t:[0,0,0,0])}))}}),M(Vt,"Line");class Xt extends wt{constructor(t,e=t){super(_("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Yt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:T((function(t,e,n){return this.put(new Xt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Xt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),M(Xt,"Marker");const Gt={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Gt[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}E(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Yt("_duration",Wt),overshoot:Yt("_overshoot",Wt)}),E(class extends $t{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Yt("_windup"),p:Yt("P"),i:Yt("I"),d:Yt("D")});const Qt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jt={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Zt="mlhvqtcsaz".split("");for(let t=0,e=Zt.length;t<e;++t)Jt[Zt[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Jt[t](e,n,r)}}(Zt[t].toUpperCase());function Kt(t){return t.segment.length&&t.segment.length-1===Qt[t.segment[0].toUpperCase()]}function te(t,e){t.inNumber&&ee(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ee(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Kt(t)&&ne(t)}function ne(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Jt[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function re(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends ft{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!te(i,r))if("."!==r)if(isNaN(parseInt(r)))if(" "!==r&&","!==r)if("-"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");ne(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||re(i)){i.inNumber=!0,i.number=r,ee(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&ne(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:V.test(t)?X.test(t)?se:ft:j.test(t)?pt:he:de.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ft:"object"===e?ce:he};class ae{constructor(t){this._stepper=t||new Ht("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(oe(t));let e=new this._type(t);return this._type===H&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ce&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class he{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class ue{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,ue.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}ue.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const le=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class ce{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===H&&t[n+7]!==e[n+7]){const e=t[n+7],r=new H(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=oe(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(le),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const de=[he,ue,ce];class fe extends vt{constructor(t,e=t){super(_("path",t),e)}array(){return this._array||(this._array=new se(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new se(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}fe.prototype.MorphArray=se,i({Container:{path:T((function(t){return this.put(new fe).plot(t||new se)}))}}),M(fe,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new Ft(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Ft(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class me extends vt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:T((function(t){return this.put(new me).plot(t||new Ft)}))}}),E(me,qt),E(me,pe),M(me,"Polygon");class ge extends vt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:T((function(t){return this.put(new ge).plot(t||new Ft)}))}}),E(ge,qt),E(ge,pe),M(ge,"Polyline");class ye extends vt{constructor(t,e=t){super(_("rect",t),e)}}E(ye,{rx:_t,ry:St}),i({Container:{rect:T((function(t,e){return this.put(new ye).size(t,e)}))}}),M(ye,"Rect");class be{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const we={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>g.window.performance||g.window.Date,transforms:[],frame(t){const e=we.frames.push({run:t});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},timeout(t,e){e=e||0;const n=we.timer().now()+e,r=we.timeouts.push({run:t,time:n});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),r},immediate(t){const e=we.immediates.push(t);return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},cancelFrame(t){null!=t&&we.frames.remove(t)},clearTimeout(t){null!=t&&we.timeouts.remove(t)},cancelImmediate(t){null!=t&&we.immediates.remove(t)},_draw(t){let e=null;const n=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==n););let r=null;const i=we.frames.last();for(;r!==i&&(r=we.frames.shift());)r.run(t);let s=null;for(;s=we.immediates.shift();)s();we.nextDraw=we.timeouts.first()||we.frames.first()?g.window.requestAnimationFrame(we._draw):null}},xe=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},ve=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends lt{constructor(t=ve){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(xe);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return we.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=we.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}i({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new _e,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?400:t)?new $t(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof $t,this._stepper=this._isDeclarative?t:new Ht,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e||0,n=n||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,n=t.when||n,i=t.swing||i,r=t.times||r,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Se.sanitise(t,e,n),i=new Se(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new Q,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Ht(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},h=i*(r+n)-r;return a=e<=0?Math.round(t(1e-5)):e<h?t(e):Math.round(t(h-1e-5)),a}const h=Math.floor(this.loops()),u=s&&h%2==0;return a=h+(u&&!o||o&&u?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof _e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new Q,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}E([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Ne=t=>t.transforms;function Pe(){const t=this._transformationRunners.runners.map(Ne).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ae{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Oe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}i({Element:{animate(t,e,n){const r=Se.sanitise(t,e,n),i=this.timeline();return new Se(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ne).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Pe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ae).add(new Oe(new Q(this))))}}}),E(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ae(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new ce(i.from()).valueOf();Object.assign(n,e),i.from(n)}const h=new ce(i.to()).valueOf();Object.assign(h,e),i.to(h),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ae(this._stepper).to(new pt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=Q.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ae(this._stepper).type(n?ue:Q);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||d(t,o),u=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new $(s).transform(o._currentTransform(this));let f=new Q({...t,origin:[c,d]}),p=this._isDeclarative&&a?a:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(f);const m=i.at(l);return h=m.rotate,a=new Q(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=d(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new pt(e),this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new pt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new pt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ae(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new K(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),E(Se,{rx:_t,ry:St,from:Dt,to:kt}),M(Se,"Runner");class Ee extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new xt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof g.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:f,version:"1.1"}).attr("xmlns:xlink",m,p).attr("xmlns:svgjs","http://svgjs.dev/svgjs",p):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,p).attr("xmlns:svgjs",null,p)}root(){return this.isRoot()?this:super.root()}}i({Container:{nested:T((function(){return this.put(new Ee)}))}}),M(Ee,"Svg",!0);class Te extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:T((function(){return this.put(new Te)}))}}),M(Te,"Symbol");var je={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(g.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class Ce extends vt{constructor(t,e=t){super(_("text",t),e),this.dom.leading=new pt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new pt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new pt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"!==e[r].nodeName?(r!==n&&3!==e[r].nodeType&&!0===S(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent):0===r&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}E(Ce,je),i({Container:{text:T((function(t=""){return this.put(new Ce).text(t)})),plain:T((function(t=""){return this.put(new Ce).plain(t)}))}}),M(Ce,"Text");class De extends vt{constructor(t,e=t){super(_("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Ce))return this;const e=t.index(this),n=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new pt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}E(De,je),i({Tspan:{tspan:T((function(t=""){const e=new De;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(De,"Tspan");class ke extends vt{constructor(t,e=t){super(_("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new pt(t).divide(2))}}E(ke,{x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et}),i({Container:{circle:T((function(t=0){return this.put(new ke).size(t).move(0,0)}))}}),M(ke,"Circle");class Be extends wt{constructor(t,e=t){super(_("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return rt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:T((function(){return this.defs().put(new Be)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Be?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),M(Be,"ClipPath");class Ie extends yt{constructor(t,e=t){super(_("foreignObject",t),e)}}i({Container:{foreignObject:T((function(t,e){return this.put(new Ie).size(t,e)}))}}),M(Ie,"ForeignObject");var Le={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,r)=>{let i;try{i=n.bbox()}catch(t){return}const s=new Q(n),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=c(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach(((t,e)=>{const r=new $(n).transform(new Q(t).inverse());t.scale(i,s,r.x,r.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class ze extends wt{constructor(t,e=t){super(_("g",t),e)}}E(ze,Le),i({Container:{group:T((function(){return this.put(new ze)}))}}),M(ze,"G");class Re extends wt{constructor(t,e=t){super(_("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}E(Re,Le),i({Container:{link:T((function(t){return this.put(new Re).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Re,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),M(Re,"A");class Fe extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}i({Container:{mask:T((function(){return this.defs().put(new Fe)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Fe?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Fe,"Mask");class qe extends yt{constructor(t,e=t){super(_("stop",t),e)}update(t){return("number"==typeof t||t instanceof pt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new pt(t.offset)),this}}i({Gradient:{stop:function(t,e,n){return this.put(new qe).update(t,e,n)}}}),M(qe,"Stop");class Ve extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}i("Dom",{style(t,e){return this.put(new Ve).rule(t,e)},fontface(t,e,n){return this.put(new Ve).font(t,e,n)}}),M(Ve,"Style");class Xe extends Ce{constructor(t,e=t){super(_("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}i({Container:{textPath:T((function(t,e){return t instanceof Ce||(t=this.text(t)),t.path(e)}))},Text:{path:T((function(t,e=!0){const n=new Xe;let r;if(t instanceof fe||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:T((function(t){return t instanceof Ce||(t=(new Ce).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Xe.prototype.MorphArray=se,M(Xe,"TextPath");class Ye extends vt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:T((function(t,e){return this.put(new Ye).use(t,e)}))}}),M(Ye,"Use"),E([Ee,Te,Rt,zt,Xt],s("viewbox")),E([Vt,ge,me,fe],s("marker")),E(Ce,s("Text")),E(fe,s("Path")),E(xt,s("Defs")),E([Ce,De],s("Tspan")),E([ye,jt,Lt,Se],s("radius")),E(lt,s("EventTarget")),E(gt,s("Dom")),E(yt,s("Element")),E(vt,s("Shape")),E([wt,Ct],s("Container")),E(Lt,s("Gradient")),E(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){de.push(...[].concat(t))}([pt,H,K,Q,ft,Ft,se,$]),E(de,{to(t){return(new ae).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var Ge=n(726),Ue=n(358);class He{constructor(t,e){this.svgDoc=t,this.elements=e,new MutationObserver((t=>{t.some((t=>t.removedNodes.length>0))&&(this.elements=this.elements.filter((t=>t.isIn(this.svgDoc))))})).observe(t,{childList:!0,subtree:!0})}}class $e{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new He(t,e)}get bases(){return this.elementsDrawing.elements}append(t){t.appendTo(this.svgDoc),this.bases.push(t)}add(t){let e=Ue.Nucleobase.create(t);return this.append(e),e}}var We=n(298);class Qe{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new He(t,e),new MutationObserver((()=>{this.bonds.forEach((t=>{t.base1.isIn(this.svgDoc)&&t.base2.isIn(this.svgDoc)||t.remove()}))})).observe(t,{childList:!0,subtree:!0})}get bonds(){return this.elementsDrawing.elements}set bonds(t){this.elementsDrawing.elements=t}}class Je{constructor(t,e){this.svgDoc=t,this.primaryBondDefaultValues={attributes:{stroke:"#808080","stroke-width":"1"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Qe(t,e)}get primaryBonds(){return this.bondsDrawing.bonds}set primaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.primaryBonds.push(t)}add(t,e){let n=We.StraightBond.between(t,e);return n.set(this.primaryBondDefaultValues),this.append(n),n}}class Ze{constructor(t,e){this.svgDoc=t,this.secondaryBondDefaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Qe(t,e)}get secondaryBonds(){return this.bondsDrawing.bonds}set secondaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.secondaryBonds.push(t)}add(t,e){let n=We.StraightBond.between(t,e);return n.set(this.secondaryBondDefaultValues),this.append(n),n}}class Ke{constructor(){this.domNode=(new Ee).node,this.domNode.setAttribute("viewBox","0 0 100 100"),this.domNode.setAttribute("width","100"),this.domNode.setAttribute("height","100"),this.basesDrawing=new $e(this.domNode,[]),this.primaryBondsDrawing=new Je(this.domNode,[]),this.secondaryBondsDrawing=new Ze(this.domNode,[])}get outerHTML(){return this.domNode.outerHTML}get innerHTML(){return this.domNode.innerHTML}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}get minX(){return this.domNode.viewBox.baseVal.x}set minX(t){let e=this.maxX-t,n=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${t} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(n*e).toString())}get maxX(){return this.minX+this.width}set maxX(t){let e=t-this.minX,n=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(n*e).toString())}get minY(){return this.domNode.viewBox.baseVal.y}set minY(t){let e=this.maxY-t,n=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${t} ${this.width} ${e}`),this.domNode.setAttribute("height",(n*e).toString())}get maxY(){return this.minY+this.height}set maxY(t){let e=t-this.minY,n=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${this.width} ${e}`),this.domNode.setAttribute("height",(n*e).toString())}setBoundaries({minX:t,maxX:e,minY:n,maxY:r}){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}get width(){return this.domNode.viewBox.baseVal.width}set width(t){this.maxX=this.minX+t}get height(){return this.domNode.viewBox.baseVal.height}set height(t){this.maxY=this.minY+t}get horizontalScaling(){let t=this.width;return this.domNode.width.baseVal.value/t}set horizontalScaling(t){let e=this.width;this.domNode.setAttribute("width",(t*e).toString())}get verticalScaling(){let t=this.height;return this.domNode.height.baseVal.value/t}set verticalScaling(t){let e=this.height;this.domNode.setAttribute("height",(t*e).toString())}setScaling(t){this.horizontalScaling=t,this.verticalScaling=t}get horizontalClientScaling(){return new Ge.HorizontalClientScaling(this.domNode).get()}get verticalClientScaling(){return new Ge.VerticalClientScaling(this.domNode).get()}get bases(){return this.basesDrawing.bases}appendBase(t){this.basesDrawing.append(t)}addBase(t){return this.basesDrawing.add(t)}get primaryBondDefaultValues(){return this.primaryBondsDrawing.primaryBondDefaultValues}set primaryBondDefaultValues(t){this.primaryBondsDrawing.primaryBondDefaultValues=t}get primaryBonds(){return this.primaryBondsDrawing.primaryBonds}set primaryBonds(t){this.primaryBondsDrawing.primaryBonds=[...t]}appendPrimaryBond(t){this.primaryBondsDrawing.append(t)}addPrimaryBond(t,e){return this.primaryBondsDrawing.add(t,e)}get secondaryBondDefaultValues(){return this.secondaryBondsDrawing.secondaryBondDefaultValues}set secondaryBondDefaultValues(t){this.secondaryBondsDrawing.secondaryBondDefaultValues=t}get secondaryBonds(){return this.secondaryBondsDrawing.secondaryBonds}set secondaryBonds(t){this.secondaryBondsDrawing.secondaryBonds=[...t]}appendSecondaryBond(t){this.secondaryBondsDrawing.append(t)}addSecondaryBond(t,e){return this.secondaryBondsDrawing.add(t,e)}get contentBBox(){return this.domNode.getBBox()}setPadding(t){let e=this.contentBBox;this.setBoundaries({minX:e.x-t,maxX:e.x+e.width+t,minY:e.y-t,maxY:e.y+e.height+t})}}var tn=n(127),en=n(661),nn=n(986);class rn{constructor(t){this.targetDrawing=t}draw(t,e){let n=[...t].map((t=>this.targetDrawing.addBase(t)));(0,tn.consecutivePairs)(n).forEach((t=>this.targetDrawing.addPrimaryBond(...t)));let r=[...(0,tn.parseDotBracket)(n,e)];r.forEach((t=>this.targetDrawing.addSecondaryBond(...t))),n.forEach((t=>t.bringToFront()));let i=1.87*(0,nn.mean)(n.map((t=>t.bbox.height)));(0,en.radialize)(n,r,{spacing:i,basePairSpacing:i/2,hairpinLoopSpacing:i/2})}}})(),r})(),t.exports=e()},925:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalScrollbar:()=>r,HorizontalScrollbarThumb:()=>n,Scrollbars:()=>o,VerticalScrollbar:()=>s,VerticalScrollbarThumb:()=>i});class n{constructor(t){this.targetElement=t}get leftX(){return this.targetElement.scrollLeft}set leftX(t){this.targetElement.scrollLeft=t}get length(){let t=this.targetElement.scrollLeft;this.targetElement.scrollLeft=this.targetElement.scrollWidth;let e=this.targetElement.scrollWidth-this.targetElement.scrollLeft;return this.targetElement.scrollLeft=t,e}get rightX(){return this.leftX+this.length}set rightX(t){this.targetElement.scrollLeft=t-this.length}get centerX(){return(this.leftX+this.rightX)/2}set centerX(t){this.targetElement.scrollLeft=t-this.length/2}}class r{constructor(t){this.targetElement=t,this.thumb=new n(t)}}class i{constructor(t){this.targetElement=t}get topY(){return this.targetElement.scrollTop}set topY(t){this.targetElement.scrollTop=t}get length(){let t=this.targetElement.scrollTop;this.targetElement.scrollTop=this.targetElement.scrollHeight;let e=this.targetElement.scrollHeight-this.targetElement.scrollTop;return this.targetElement.scrollTop=t,e}get bottomY(){return this.topY+this.length}set bottomY(t){this.targetElement.scrollTop=t-this.length}get centerY(){return this.targetElement.scrollTop+this.length/2}set centerY(t){this.targetElement.scrollTop=t-this.length/2}}class s{constructor(t){this.targetElement=t,this.thumb=new i(t)}}class o{constructor(t){this.targetElement=t}center(){this.targetElement.scrollLeft=this.targetElement.scrollWidth,this.targetElement.scrollTop=this.targetElement.scrollHeight;let t=this.targetElement.scrollWidth-this.targetElement.scrollLeft,e=this.targetElement.scrollHeight-this.targetElement.scrollTop;this.targetElement.scrollLeft=this.targetElement.scrollWidth/2-t/2,this.targetElement.scrollTop=this.targetElement.scrollHeight/2-e/2}}return e})(),t.exports=e()},106:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return t.map((t=>({v:t,priority:Math.random()}))).sort(((t,e)=>t.priority-e.priority)).map((({v:t})=>t))}function r(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}t.r(e),t.d(e,{DownloadableFile:()=>i,EventfulSet:()=>s,detectMac:()=>r,shuffled:()=>n});class i{constructor(t){this.textContent=t}downloadAs(t,e){let n=new File([this.textContent],t,{type:e.type}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=n.name,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)}}class s{constructor(){this.eventListeners={change:[]},this.underlyingSet=new Set}[Symbol.iterator](){return this.underlyingSet.values()}includes(t){return this.underlyingSet.has(t)}include(t){return this.includes(t)}addAll(t){let e=[...t];0!=e.length&&(e.every((t=>this.includes(t)))||(e.forEach((t=>this.underlyingSet.add(t))),this.callEventListeners("change")))}removeAll(t){let e=[...t];0!=e.length&&(e.every((t=>!this.includes(t)))||(e.forEach((t=>this.underlyingSet.delete(t))),this.callEventListeners("change")))}clear(){0!=this.underlyingSet.size&&(this.underlyingSet.clear(),this.callEventListeners("change"))}addEventListener(t,e){this.eventListeners[t].push(e)}callEventListeners(t){this.eventListeners[t].forEach((t=>t()))}removeEventListener(t,e){this.eventListeners[t]=this.eventListeners[t].filter((t=>t!==e))}}return e})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{RNAcanvas:()=>u});var t=n(662),e=n(925);class i{constructor(t,e,n){this.targetDrawing=t,this.horizontalScrollbar=e,this.verticalScrollbar=n}get centerPoint(){return{x:this.horizontalScrollbar.thumb.centerX/this.targetDrawing.horizontalScaling+this.targetDrawing.minX,y:this.verticalScrollbar.thumb.centerY/this.targetDrawing.verticalScaling+this.targetDrawing.minY}}set centerPoint(t){this.horizontalScrollbar.thumb.centerX=this.targetDrawing.horizontalScaling*(t.x-this.targetDrawing.minX),this.verticalScrollbar.thumb.centerY=this.targetDrawing.verticalScaling*(t.y-this.targetDrawing.minY)}fitToContent(){let t=this.targetDrawing.contentBBox;this.targetDrawing.setScaling(.9*Math.min(this.horizontalScrollbar.thumb.length/t.width,this.verticalScrollbar.thumb.length/t.height)),this.centerPoint={x:t.x+t.width/2,y:t.y+t.height/2}}}var s=n(106),o=n(524),a=n(460),h=n(124);class u{constructor(){this.selectedSVGElements=new s.EventfulSet,this.domNode=document.createElement("div"),this.boundingBox=document.createElement("div"),this.domNode.appendChild(this.boundingBox),this.boundingBox.style.width="100%",this.boundingBox.style.height="100%",this.boundingBox.style.overflow="auto",this.boundingBox.style.position="relative",this.drawing=new t.Drawing,this.drawing.appendTo(this.boundingBox),this.drawing.domNode.style.userSelect="none",this.horizontalDrawingScrollbar=new e.HorizontalScrollbar(this.boundingBox),this.verticalDrawingScrollbar=new e.VerticalScrollbar(this.boundingBox),this.drawingScrollbars=new e.Scrollbars(this.boundingBox),this.drawingView=new i(this.drawing,this.horizontalDrawingScrollbar,this.verticalDrawingScrollbar),this.dotBracketDrawer=new t.DotBracketDrawer(this.drawing),this.overlaidDrawing=new t.Drawing,this.overlaidDrawing.domNode.style.position="absolute",this.overlaidDrawing.domNode.style.top="0px",this.overlaidDrawing.domNode.style.left="0px",this.overlaidDrawing.domNode.style.pointerEvents="none",this.overlaidDrawing.appendTo(this.boundingBox),new MutationObserver((()=>{this.overlaidDrawing.setBoundaries(this.drawing),this.overlaidDrawing.horizontalScaling=this.drawing.horizontalScaling,this.overlaidDrawing.verticalScaling=this.drawing.verticalScaling})).observe(this.drawing.domNode,{attributes:!0}),this.selectedSVGElementHighlightings=new o.LiveSVGElementHighlightings(this.selectedSVGElements,this.drawing.domNode),this.selectedSVGElementHighlightings.appendTo(this.overlaidDrawing.domNode),this.clickSelectTool=new a.ClickSelectTool(this.drawing.domNode,this.selectedSVGElements),this.selectedBases=new h.SelectedBases(this.drawing,this.selectedSVGElements),this.consecutiveBasesSelectingTool=new h.ConsecutiveBasesSelectingTool(this.drawing,this.selectedBases)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}drawDotBracket(t,e){this.dotBracketDrawer.draw(t,e)}get style(){return this.domNode.style}}})(),r})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.appObject=e():t.appObject=e()}(this,(()=>(()=>{var t={124:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ConsecutiveBasesSelectingTool:()=>n,SelectedBases:()=>r});class n{constructor(t,e){this.targetDrawing=t,this.selectedBases=e,this.mouseIsDown=!1,window.addEventListener("mousedown",(t=>this.handleMouseDown(t))),window.addEventListener("mouseup",(t=>this.handleMouseUp(t))),window.addEventListener("mouseover",(t=>this.handleMouseOver(t)))}handleMouseDown(t){this.lastMouseDown=t,this.mouseIsDown=!0}handleMouseUp(t){this.mouseIsDown=!1}handleMouseOver(t){if(!this.mouseIsDown)return;let e=this.lastMouseDown;if(!e)return;if(!e.shiftKey)return;if(!(t.target instanceof Node))return;if(!this.targetDrawing.domNode.contains(t.target))return;let n=[...this.targetDrawing.bases],r=n.findIndex((e=>e.domNode===t.target));if(r<0)return;let i=n.findIndex((t=>t.domNode===e.target));if(i<0)return;try{let t=n[i];if(!this.selectedBases.include(t))return}catch(t){console.error(t)}let s=Math.min(i,r),o=Math.max(i,r);this.selectedBases.addAll(n.slice(s,o+1))}}class r{constructor(t,e){this.targetDrawing=t,this.selectedSVGElements=e}[Symbol.iterator](){return[...this.targetDrawing.bases].filter((t=>this.selectedSVGElements.include(t.domNode))).values()}include(t){return this.selectedSVGElements.include(t.domNode)}addAll(t){this.selectedSVGElements.addAll([...t].map((t=>t.domNode)))}}return e})(),t.exports=e()},524:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{BoxTrace:()=>n,LiveSVGElementHighlightings:()=>r});class n{constructor(){this.domNode=document.createElementNS("http://www.w3.org/2000/svg","g"),this.lightDashing=document.createElementNS("http://www.w3.org/2000/svg","path"),this.darkDashing=document.createElementNS("http://www.w3.org/2000/svg","path"),this.domNode.append(this.lightDashing,this.darkDashing),this.domNode.style.pointerEvents="none",this.lightDashing.setAttribute("stroke","powderblue"),this.darkDashing.setAttribute("stroke","blue"),this.lightDashing.setAttribute("stroke-dasharray","0 1"),this.darkDashing.setAttribute("stroke-dasharray","0 1"),this.lightDashing.setAttribute("stroke-linecap","round"),this.darkDashing.setAttribute("stroke-linecap","round"),this.darkDashing.setAttribute("stroke-dashoffset","0.5"),this.lightDashing.setAttribute("stroke-width","0.4"),this.darkDashing.setAttribute("stroke-width","0.4"),this.lightDashing.setAttribute("fill","none"),this.darkDashing.setAttribute("fill","none")}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}trace(t){let e=`M ${t.x} ${t.y} h ${t.width} v ${t.height} h ${-t.width} z`;this.lightDashing.setAttribute("d",e),this.darkDashing.setAttribute("d",e)}setThickness(t){this.lightDashing.setAttribute("stroke-width",`${t}`),this.darkDashing.setAttribute("stroke-width",`${t}`)}setOpacity(t){this.domNode.setAttribute("opacity",`${t}`)}}class r{constructor(t,e){this.targetSVGElements=t,this.domNode=document.createElementNS("http://www.w3.org/2000/svg","g"),this.boxTraces=[],t.addEventListener("change",(()=>this.refresh())),new MutationObserver((()=>this.refresh())).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}refresh(){let t=[...this.targetSVGElements];t.slice(this.boxTraces.length).forEach((()=>{let t=new n;t.appendTo(this.domNode),this.boxTraces.push(t)})),t.forEach(((t,e)=>{try{let n=this.boxTraces[e];n.trace(t.getBBox()),n.setOpacity(1)}catch(t){console.error(t)}})),this.boxTraces.slice(t.length).forEach((t=>t.setOpacity(0)))}}return e})(),t.exports=e()},460:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ClickSelectTool:()=>n});class n{constructor(t,e){this.targetSVGDoc=t,this.selectedSVGElements=e,t.addEventListener("mousedown",(t=>this.handleMouseDown(t)))}handleMouseDown(t){t.target!==this.targetSVGDoc?t.target instanceof SVGGraphicsElement&&this.targetSVGDoc.contains(t.target)&&(this.selectedSVGElements.include(t.target)?!t.shiftKey||this.selectedSVGElements.removeAll([t.target]):(t.shiftKey||this.selectedSVGElements.clear(),this.selectedSVGElements.addAll([t.target]))):t.shiftKey||this.selectedSVGElements.clear()}}return e})(),t.exports=e()},662:function(t){var e;e=()=>(()=>{var t={127:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>h,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>u,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),h=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(a.bind.apply(a,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),h=(0,i.min)(r),u=o;u<=h;u++)s.push(u);e.push(s),n=r,r=t.shift()}return e},t}();function u(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>l,PositionPairs:()=>t,Stems:()=>u,TrailingDanglingBases:()=>a,consecutivePairs:()=>d,parseDotBracket:()=>c});class t{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];return this.targetStructure[1].map((e=>[t.indexOf(e[0])+1,t.indexOf(e[1])+1]))}}class e{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let n=e.flat(),r=t.findIndex((t=>n.includes(t)));if(r<0)throw new Error("No paired bases present in sequence.");return t[r]}}var i=n(986);class s{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let n=e.flat().map((e=>t.indexOf(e)));if((0,i.max)(n)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(n)]}}class o{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let n=new e(...this.targetStructure).get(),r=t.indexOf(n);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)}}class a{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new s(...this.targetStructure).get(),n=t.indexOf(e);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(n+1)}}var h=n(369);class u{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],n=new t(...this.targetStructure).get();return new h.Stems(e,n).get().map((t=>t.map((t=>[e[t[0]-1],e[t[1]-1]]))))}}class l{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],n=new t(...this.targetStructure).get();return new h.Linkers(e,n).get().map((t=>t.map((t=>e[t-1]))))}}function c(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,h.parseDotBracket)(e)].map((e=>{let n=e[0],r=e[1];return[t[n-1],t[r-1]]}))}function d(t){return t.length<2?[]:t.slice(0,-1).map(((e,n)=>[t[n],t[n+1]]))}})(),r})(),t.exports=e()},661:function(t){var e;e=()=>(()=>{var t={127:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>h,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>u,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),h=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(a.bind.apply(a,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),h=(0,i.min)(r),u=o;u<=h;u++)s.push(u);e.push(s),n=r,r=t.shift()}return e},t}();function u(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>l,PositionPairs:()=>t,Stems:()=>u,TrailingDanglingBases:()=>a});var t=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];return this.targetStructure[1].map((function(e){return[t.indexOf(e[0])+1,t.indexOf(e[1])+1]}))},t}(),e=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");var n=e.flat(),r=t.findIndex((function(t){return n.includes(t)}));if(r<0)throw new Error("No paired bases present in sequence.");return t[r]},t}(),i=n(986),s=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");var n=e.flat().map((function(e){return t.indexOf(e)}));if((0,i.max)(n)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(n)]},t}(),o=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var n=(new(e.bind.apply(e,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),r=t.indexOf(n);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)},t}(),a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var e=(new(s.bind.apply(s,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),n=t.indexOf(e);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(n+1)},t}(),h=n(369),u=function(){function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return e.prototype.get=function(){var e=this.targetStructure[0],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new h.Stems(e,n).get().map((function(t){return t.map((function(t){return[e[t[0]-1],e[t[1]-1]]}))}))},e}(),l=function(){function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return e.prototype.get=function(){var e=this.targetStructure[0],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new h.Linkers(e,n).get().map((function(t){return t.map((function(t){return e[t-1]}))}))},e}()})(),r})(),t.exports=e()},173:function(t){var e;e=()=>(()=>{var t={422:function(t){t.exports=(()=>{var t={138:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}return t.r(e),t.d(e,{average:()=>r,mean:()=>r,sum:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function t(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}n.r(r),n.d(r,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=n(138);function s(t){return{x:(0,i.mean)(t.map((function(t){return t.x}))),y:(0,i.mean)(t.map((function(t){return t.y})))}}function o(t,e){return s([t,e])}})(),r})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{CircularSegment:()=>a,Semicircle:()=>e});var t=n(422),e=function(){function e(t){this.chord=t}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return Math.PI*this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcAngle",{get:function(){return Math.PI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){return(0,t.midpoint)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),e}(),i=n(872),s=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(r<=i)throw new Error("Arc length is too small.");if(r>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(r/i*Math.sin(s)-s)/(r/i*Math.cos(s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e+=(Math.PI-this.arcAngle)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(r<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(r/i*Math.sin(Math.PI-s)-s)/(-r/i*Math.cos(Math.PI-s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e-=(this.arcAngle-Math.PI)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function n(n,r){this.chord=n,this.moreProps=r;var i=r.arcLength,a=(0,t.distance)(n[0],n[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var h=a<.001&&i<.001,u=Math.PI*a/2,l=Math.abs(i-u)<.001;this.wrappedCircularSegment=h||l?new e(n):i<u?new s(n,{arcLength:i}):new o(n,{arcLength:i})}return Object.defineProperty(n.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),n}()})(),r})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,degrees:()=>m,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return Math.abs(t-e)<=n}function f(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function m(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function h(t){return null==t}function u(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>u,isNullish:()=>h,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{areWithin:()=>a,centroid:()=>f,deepCopy:()=>s,direction:()=>c,displaced:()=>u,displacement:()=>h,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=n(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(n){return e(n)&&(0,t.isFiniteNumber)(n.x)&&(0,t.isFiniteNumber)(n.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function a(t,e,n){return o(t,e)<=n}function h(t,e){return{x:e.x-t.x,y:e.y-t.y}}function u(t,e){return{x:t.x+e.x,y:t.y+e.y}}var l=n(30);function c(t,e){return(0,l.direction)(h(t,e))}var d=n(986);function f(t){return{x:(0,d.mean)(t.map((function(t){return t.x}))),y:(0,d.mean)(t.map((function(t){return t.y})))}}function p(t,e){return f([t,e])}})(),r})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>h,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>u,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),h=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=(new(a.bind.apply(a,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),h=(0,i.min)(r),u=o;u<=h;u++)s.push(u);e.push(s),n=r,r=t.shift()}return e},t}();function u(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Centroid:()=>s,Direction:()=>f,MaxCenterX:()=>h,MaxCenterY:()=>l,MinCenterX:()=>a,MinCenterY:()=>u,NucleobaseMock:()=>t,circularize:()=>v,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>p,flipY:()=>m,linearize:()=>b,radialize:()=>I,rotate:()=>d,round:()=>S,shift:()=>e,stemmify:()=>x,straighten:()=>w});class t{constructor(t){this.props=t}getCenterPoint(){return this.props.centerPoint}setCenterPoint(t){this.props.centerPoint=t}}function e(t,e){t.forEach((t=>{let n=t.getCenterPoint();t.setCenterPoint({x:n.x+e.x,y:n.y+e.y})}))}var i=n(725);class s{constructor(t){this.targetBases=t}get(){let t=this.targetBases.map((t=>t.getCenterPoint()));return(0,i.centroid)(t)}set(t){let n=this.get(),r=(0,i.displacement)(n,t);e(this.targetBases,r)}}var o=n(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}class l{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}var c=n(30);function d(t,e){if(0==t.length)return;let n=new s(t).get();t.forEach((t=>{let r=t.getCenterPoint(),s=(0,i.distance)(n,r),o=(0,c.direction)((0,i.displacement)(n,r));o+=e,t.setCenterPoint({x:n.x+s*Math.cos(o),y:n.y+s*Math.sin(o)})}))}class f{constructor(t){this.targetBases=t}get(){if(this.targetBases.length<2)return 0;let t=this.targetBases[0],e=this.targetBases[this.targetBases.length-1];return(0,c.direction)((0,i.displacement)(t.getCenterPoint(),e.getCenterPoint()))}set(t){let e=t-this.get();d(this.targetBases,e)}}function p(t){let e=new s(t).get().y;t.forEach((t=>{let n=t.getCenterPoint(),r=n.y-e;t.setCenterPoint({x:n.x,y:e-r})}))}function m(t){let e=new s(t).get().x;t.forEach((t=>{let n=t.getCenterPoint(),r=n.x-e;t.setCenterPoint({x:e-r,y:n.y})}))}function g(t){if(0==t.length)return;let n=t[0],{x:r,y:s}=n.getCenterPoint(),o={x:r,y:s},a=new f(t).get();d(t,-a),p(t),d(t,a),e(t,(0,i.displacement)(n.getCenterPoint(),o))}function y(t){let e=new s(t),{x:n,y:r}=e.get(),i=n,o=r,a=new f(t).get();d(t,-a),m(t),d(t,a),e.set({x:i,y:o})}function b(t,e){let{spacing:n}=e;if(t.length<2)return;let r=new f(t),i=r.get(),o=new s(t),{x:a,y:h}=o.get(),u={x:a,y:h};t.forEach(((t,e)=>{t.setCenterPoint({x:e*n,y:0})})),r.set(i),o.set(u)}function w(t){if(t.length<3)return;let e=t[0],n=t[t.length-1],r=[e.getCenterPoint(),n.getCenterPoint()],s=(0,i.distance)(r[0],r[1]),o=(0,c.direction)((0,i.displacement)(r[0],r[1])),a=s/(t.length-1),h=a*Math.cos(o),u=a*Math.sin(o),{x:l,y:d}=r[0];t.forEach((t=>{t.setCenterPoint({x:l,y:d}),l+=h,d+=u}))}function x(t,n){let{basePairLength:r,basePairSpacing:o}=n;if(t.length<2)return;let a=Math.ceil(t.length/2),h=t.slice(0,a),u=t.slice(a),l=new s(t),{x:c,y:p}=l.get(),m={x:c,y:p},g=new f(t).get();b(h,{spacing:o}),b(u,{spacing:o}),new f(h).set(-Math.PI/2),new f(u).set(Math.PI/2);let y=t[0],w=t[t.length-1];e(h,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(u,(0,i.displacement)(w.getCenterPoint(),{x:r,y:0})),d(t,g),l.set(m)}function v(t,e){let{spacing:n,terminiGap:r}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),h=o,u=a,l=new f(t).get(),c=n*(t.length-1);c+=r,Math.abs(c)<1e-5&&(c=1e-5);let p=c/(2*Math.PI),m=Math.PI/2+2*Math.PI*(.5*r/c);t.forEach(((t,e)=>{let r=m+2*Math.PI*(e*n)/c;t.setCenterPoint({x:p*Math.cos(r),y:p*Math.sin(r)})})),d(t,l),i.set({x:h,y:u})}var _=n(173);function S(t,n){let{spacing:r}=n;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],h=(0,i.distance)(a[0],a[1]),u=r*(t.length-1);if(u-h<.001)return void w(t);if(h<.001){let{x:n,y:o}=s.getCenterPoint();return v(t,{spacing:r,terminiGap:h}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:n,y:o}))}let l=new _.CircularSegment(a,{arcLength:u}),d=l.parentCircleCenterPoint,f=l.parentCircleRadius,p=(0,c.direction)((0,i.displacement)(d,s.getCenterPoint())),m=l.arcAngle/(t.length-1);t.forEach((t=>{t.setCenterPoint({x:d.x+f*Math.cos(p),y:d.y+f*Math.sin(p)}),p+=m}))}var O=n(127),M=n(369);class N{static from(t){return{to:e=>({inclusive:()=>{let n=e-t+1;return Array.from({length:n},((e,n)=>t+n))}})}}}class P{static of(...t){let[e,n]=t,r=new O.PositionPairs(...t).get();r=(0,M.sorted)(r);let i=r.map((t=>t.map((t=>t-1)))),s=[],a=0;return e.forEach(((t,e)=>{let n=i.find((t=>t.includes(e)));n&&e==(0,o.min)(n)?(s.push(a),a+=1):n&&e==(0,o.max)(n)?(a-=1,s.push(a)):s.push(a)})),s}}class A{constructor(...t){let[e,n]=t;this.rawForm=t,this.mountainPlotTraversal=P.of(...t),this.positionPairs=new O.PositionPairs(...t).get(),this.indexPairs=this.positionPairs.map((t=>[t[0]-1,t[1]-1])),this.pairedBases=new Set(n.flat()),this.pairedIndices=new Set(e.map(((t,e)=>({b:t,i:e}))).filter((t=>this.pairedBases.has(t.b))).map((t=>t.i)))}[Symbol.iterator](){return this.rawForm.values()}get sequence(){return this.rawForm[0]}get basePairs(){return this.rawForm[1]}}class E{static correspondingTo(t){return{in:e=>t.map((t=>e.sequence.indexOf(t)))}}}class C{static composedOf(t){if(0==t.length)throw new Error("All stems must have at least one base-pair.");let n=t[0],r=t[t.length-1],s=t.map((t=>t[0])),o=t.map((t=>t[1])).reverse(),a=n[0],h=n[1],u=[...s,...o];return{[Symbol.iterator]:()=>t.values(),bottomBasePair:n,topBasePair:r,side5:s,side3:o,flat:()=>u,firstBase:a,lastBase:h,stemmify:()=>({with:t=>{let{basePairLength:n,basePairSpacing:r}=t,s=Object.assign({},a.getCenterPoint());x(u,{basePairLength:n,basePairSpacing:r}),e(u,(0,i.displacement)(a.getCenterPoint(),s))}})}}}class T{static in(t){return{[Symbol.iterator]:()=>new O.Stems(t.sequence,t.basePairs).get().map((t=>C.composedOf(t))).values()}}}class j{static composedOf(t){if(t.length<2)throw new Error("Linkers must have at least two bases.");let n=t[0],r=t[t.length-1],s=t.slice(1,-1);return{in:o=>{let a=o.sequence.indexOf(n),h=o.sequence.indexOf(r),u=N.from(a).to(h).inclusive(),l=!!o.indexPairs.find((t=>t.includes(a)&&t.includes(h))),c=u.every((t=>0==o.mountainPlotTraversal[t])),d=1==new Set(u.map((t=>o.mountainPlotTraversal[t]))).size&&!l;return{[Symbol.iterator]:()=>t.values(),indices:u,firstBase:n,lastBase:r,firstIndex:a,lastIndex:h,unpairedBases:{[Symbol.iterator]:()=>s.values(),stemmify:()=>({with:t=>{let{spacing:n}=t;if(s.length<3)return;let r=s[0],o=s[s.length-1],a=Object.assign({},r.getCenterPoint());x(s,{basePairLength:(0,i.distance)(r.getCenterPoint(),o.getCenterPoint()),basePairSpacing:n}),e(s,(0,i.displacement)(r.getCenterPoint(),a))}})},get middleThreeUnpairedBases(){if(s.length<3)throw new Error("This linker has less than three unpaired bases.");if(s.length%2==0)throw new Error("This linker has an even number of unpaired bases.");let t=Math.floor(s.length/2);return[s[t-1],s[t],s[t+1]]},isHairpinLoop:()=>l,isInOutermostLoop:()=>c,isBetweenSiblingStems:()=>d,round:()=>({with:e=>{let{spacing:n}=e;S(t,{spacing:n})}})}}}}}class D{static in(t){let e=new O.Linkers(t.sequence,t.basePairs).get().map((e=>j.composedOf(e).in(t)));return{[Symbol.iterator]:()=>e.values(),thatAreHairpinLoops:{[Symbol.iterator]:()=>e.filter((t=>t.isHairpinLoop())).values()},inOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>t.isInOutermostLoop())).values()},notInOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).values(),betweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).filter((t=>t.isBetweenSiblingStems())).values()}},notBetweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isBetweenSiblingStems())).values()}}}}class k{static closedBy(n){return{in:r=>{let s=n.topBasePair,a=E.correspondingTo(s).in(r),h=(0,o.min)(a),u=r.sequence.filter(((t,e)=>e>(0,o.min)(a)&&e<(0,o.max)(a)&&r.mountainPlotTraversal[e]==r.mountainPlotTraversal[h]+1)),l=u.map((t=>r.sequence.indexOf(t))),c=u.filter((t=>r.pairedBases.has(t))),d=l.filter((t=>r.pairedIndices.has(t))),f=[s[0],...u,s[1]];return{[Symbol.iterator]:()=>f.values(),parentStructure:r,closingStem:n,closingBasePair:s,closingIndexPair:a,enclosedBases:u,enclosedIndices:l,enclosedPairedBases:c,enclosedPairedIndices:d,get platform(){if(0==d.length)throw new Error("This loop does not have a platform.");let n=(0,o.min)(d),h=(0,o.max)(d),u=r.sequence.filter(((t,e)=>e>=n&&e<=h&&l.includes(e)&&[e-1,e,e+1].some((t=>d.includes(t)))));return{[Symbol.iterator]:()=>u.values(),firstIndex:n,lastIndex:h,arch:()=>({with:r=>{let{spacing:l}=r,c=(0,o.max)([u.length-2,n-(0,o.min)(a)-1,(0,o.max)(a)-h-1,0]),d=N.from(1).to(c).inclusive().map((()=>new t({centerPoint:{x:0,y:0}}))),f=d.map((()=>new t({centerPoint:{x:0,y:0}}))),p=Object.assign({},s[0].getCenterPoint());v([s[0],...d,...u,...f,s[1]],{spacing:l,terminiGap:l}),e([...s,...u],(0,i.displacement)(s[0].getCenterPoint(),p))}})}}}}}}}class B{static of(t){let e=t.sequence.filter(((e,n)=>0==t.mountainPlotTraversal[n]));return{[Symbol.iterator]:()=>e.values()}}}function I(t,e,n){var r;let{spacing:i,basePairSpacing:o}=n,a=null!==(r=n.hairpinLoopSpacing)&&void 0!==r?r:i,h=new A(t,e);if(t.length<2)return;if(0==e.length)return void v(t,{spacing:i,terminiGap:2*i});let u=Object.assign({},new s(t).get()),l=new f(t).get(),c=T.in(h),d=D.in(h);v([...B.of(h)],{spacing:i,terminiGap:2*i});let p=[...c].map((t=>k.closedBy(t).in(h)));p.filter((t=>t.enclosedPairedBases.length>0)).forEach((t=>{t.closingStem.stemmify().with({basePairLength:i,basePairSpacing:o}),t.platform.arch().with({spacing:i}),t.closingStem.stemmify().with({basePairLength:i,basePairSpacing:o})})),p.filter((t=>0==t.enclosedPairedBases.length)).forEach((t=>t.closingStem.stemmify().with({basePairLength:i,basePairSpacing:o}))),[...d.notBetweenSiblingStems].forEach((t=>t.round().with({spacing:i}))),[...d.thatAreHairpinLoops].forEach((t=>t.round().with({spacing:a}))),[...d.notInOutermostLoop.betweenSiblingStems].filter((t=>[...t.unpairedBases].length>=3)).forEach((t=>{t.unpairedBases.stemmify().with({spacing:i}),[...t.unpairedBases].length%2!=0&&S(t.middleThreeUnpairedBases,{spacing:i})})),new f(t).set(l),new s(t).set(u)}})(),r})(),t.exports=e()},358:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>u,VerticalClientScaling:()=>c,assignUUID:()=>h,bringToFront:()=>d,sendToBack:()=>f});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function h(t){t.id="uuid-"+a()}var u=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")},t}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();function d(t){var e=t.parentNode;e&&e.appendChild(t)}function f(t){var e=t.parentNode;e&&e.prepend(t)}return e})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Nucleobase:()=>He});const t={},e=[];function i(e,n){if(Array.isArray(e))for(const t of e)i(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)i(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function a(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function h(t){return t%360*Math.PI/180}function u(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function d(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:h}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?h:i.includes("bottom")?h+t:h+t/2)}return[r,i]}const f="http://www.w3.org/2000/svg",p="http://www.w3.org/2000/xmlns/",m="http://www.w3.org/1999/xlink",g={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class y{}const b={},w="___SYMBOL___ROOT___";function x(t,e=f){return g.document.createElementNS(e,t)}function v(t,e=!1){if(t instanceof y)return t;if("object"==typeof t)return O(t);if(null==t)return new b[w];if("string"==typeof t&&"<"!==t.charAt(0))return O(g.document.querySelector(t));const n=e?g.document.createElement("div"):x("svg");return n.innerHTML=t,t=O(n.firstChild),n.removeChild(n.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function S(t){if(!t)return null;if(t.instance instanceof y)return t.instance;if("#document-fragment"===t.nodeName)return new b.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":b[e]||(e="Dom"),new b[e](t)}let O=S;function M(t,e=t.name,n=!1){return b[e]=t,n&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let N=1e3;function P(t){return"Svgjs"+l(t)+N++}function A(t){for(let e=t.children.length-1;e>=0;e--)A(t.children[e]);return t.id?(t.id=P(t.nodeName),t):t}function E(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function C(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}i("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=v(t)).before(this),this},insertAfter:function(t){return(t=v(t)).after(this),this}});const T=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,k=/(#[a-z_][a-z0-9\-_]*)/i,B=/\)\s*,?\s*/,I=/\s/g,L=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,z=/^rgb\(/,R=/^(\s+)?$/,F=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,q=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,V=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function Y(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function G(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function U(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(V)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),i("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=u(e);n[e]=this.node.style[t]}return n}if("string"==typeof t)return this.node.style[u(t)];if("object"==typeof t)for(const e in t)this.node.style[u(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[u(t)]=null==e||R.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),i("Dom",{data:function(t,e,n){if(null==t)return this.data(a(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),i("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class H{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof H||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new H(t,e,n,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?r():e)/.5+.01)+150),n=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new H(t,n,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new H(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new H(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new H(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new H(t,e,n,"lab")}if("grey"===t){const t=255*r();return new H(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(L.test(t)||z.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),h=(o+a)/2,u=o===a,l=o-a;return new H(360*(u?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(u?0:h>.5?l/(2-o-a):l/(o+a)),100*h,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=G(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:G(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:G(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:G(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:G(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:G(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[n,r,i]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!L.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=j.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:n}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,h=o-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(h**3>l?h**3:(h-u)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,h=r>a?1.055*o(r,1/2.4)-.055:12.92*r,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*h,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new H(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*U(i,r,t+1/3),o=255*U(i,r,t),a=255*U(i,r,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Y);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,l=(.2126*o+.7152*a+.0722*h)/1,c=(.0193*o+.1192*a+.9505*h)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new H(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function W(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,h=t.shear||0,u=t.rotate||t.theta||0,l=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new $(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new $(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:w.x,ry:w.y,tx:y,ty:b,ox:c,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=h,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new Q(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=n*s-r*i,u=h>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/h,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new Q(t);return W(this.a,e.a)&&W(this.b,e.b)&&W(this.c,e.c)&&W(this.d,e.d)&&W(this.e,e.e)&&W(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Q.fromArray([1,0,0,1,0,0]);return t=t instanceof yt?t.matrixify():"string"==typeof t?Q.fromArray(t.split(V).map(parseFloat)):Array.isArray(t)?Q.fromArray(t):"object"==typeof t&&Q.isMatrixLike(t)?t:"object"==typeof t?(new Q).transform(t):6===arguments.length?Q.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,h=-e/o,u=-n/o,l=t/o,c=-(a*i+u*s),d=-(h*i+l*s);return this.a=a,this.b=h,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=h(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:l,f:c}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-u*i,this.d=u*r+a*i,this.e=l*r-c*i+n*i-e*r+e,this.f=c*r+l*i-e*i-n*r+n,this}scale(t,e,n,r){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:h}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+h*t-n*t,this}skew(t,e,n,r){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=h(t),e=h(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:l,e:c,f:d}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+l*i,this.d=l+u*s,this.e=c+d*i-r*i,this.f=d+c*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Q.isMatrixLike(t))return new Q(t).multiplyO(this);const e=Q.formatTransforms(t),{x:n,y:r}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new $(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function J(){if(!J.nodes){const t=v().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;J.nodes={svg:t,path:e}}if(!J.nodes.svg.node.parentNode){const t=g.document.body||g.document.documentElement;J.nodes.svg.addTo(t)}return J.nodes}function Z(t){return!(t.width||t.height||t.x||t.y)}M(Q,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=g.window.pageXOffset,this.y+=g.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(V).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Z(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Q||(t=new Q(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new $(this.x,this.y),new $(this.x2,this.y),new $(this.x,this.y2),new $(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new K(e,r,n-e,i-r)}}function tt(t,e,n){let r;try{if(r=e(t.node),Z(r)&&(i=t.node)!==g.document&&!(g.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===g.document}).call(g.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}i({viewbox:{viewbox(t,e,n,r){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new $(n/2/s+i.x,r/2/o+i.y);const u=new K(i).transform(new Q({scale:h,origin:e}));return this.viewbox(u)}}}),M(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}E([et],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const nt=["toArray","constructor","each"];function rt(t,e){return new et(a((e||g.document).querySelectorAll(t),(function(t){return S(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),E([et],t)};let it=0;const st={};function ot(t){let e=t.getEventHolder();return e===g.window&&(e=st),e.events||(e.events={}),e.events}function at(t){return t.getEventTarget()}function ht(t,e,n,r,i){const s=n.bind(r||t),o=v(t),a=ot(o),h=at(o);e=Array.isArray(e)?e:e.split(V),n._svgjsListenerId||(n._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function ut(t,e,n,r){const i=v(t),s=ot(i),o=at(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(V)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let h,u;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])ut(o,[e,a].join("."),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&ut(o,[t,a].join("."));else if(e){if(s[e]){for(h in s[e])ut(o,[e,h].join("."));delete s[e]}}else{for(t in s)ut(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class lt extends y{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ut(this,t,e,n),this}on(t,e,n,r){return ht(this,t,e,n,r),this}removeEventListener(){}}function ct(){}M(lt,"EventTarget");const dt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class ft extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(V).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class pt{constructor(...t){this.init(...t)}convert(t){return new pt(this.value,t)}divide(t){return t=new pt(t),new pt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(T))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof pt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new pt(t),new pt(this-t,this.unit||t.unit)}plus(t){return t=new pt(t),new pt(this+t,this.unit||t.unit)}times(t){return t=new pt(t),new pt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const mt=[];class gt extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=v(t)).removeNamespace&&this.node instanceof g.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return v(t).put(this,e)}children(){return new et(a(this.node.children,(function(t){return S(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=A(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new gt(x(t),e))}first(){return S(this.node.firstChild)}get(t){return S(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=P(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=v(t),this.add(t,e),t}putIn(t,e){return v(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=v(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,f)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=S(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=x("wrapper",n),i=g.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}E(gt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=F.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?dt[t]:F.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,n)=>n(t,e,this)),e))?e=new pt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new ft(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return S(this.node.querySelector(t))}}),M(gt,"Dom");class yt extends gt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new pt(t).plus(this.x()))}dy(t=0){return this.y(new pt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=v(t));const n=new et;let r=this;for(;(r=r.parent())&&r.node!==g.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?v(e[1]):null}root(){const t=this.parent(b[w]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new pt(n.width)).height(new pt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}E(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new $(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Q(this.node.getCTM())},screenCTM:function(){if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new Q(e)}return new Q(this.node.getScreenCTM())}}),M(yt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof H||H.isRgb(e)||e instanceof yt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),i("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new pt(t)):this.rx(t).ry(e)}}),i("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new $(this.node.getPointAtLength(t))}}),i(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),i("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),i("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(B).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(V).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Q.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Q)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Q(this).decompose();return null==t?e:e[t]}Q.isMatrixLike(t)||(t={...t,origin:d(t,this)});const n=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class wt extends yt{flatten(t=this,e){return this.each((function(){if(this instanceof wt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class xt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(xt,"Defs");class vt extends yt{}function _t(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function Ot(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Mt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Nt(t){return this.attr("cx",t)}function Pt(t){return this.attr("cy",t)}function At(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function Et(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(vt,"Shape");var Ct={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et};class Tt extends vt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new pt(n.width).divide(2)).ry(new pt(n.height).divide(2))}}E(Tt,Ct),i("Container",{ellipse:C((function(t=0,e=t){return this.put(new Tt).size(t,e).move(0,0)}))}),M(Tt,"Ellipse");class jt extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Dt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new pt(t),fy:new pt(e)}):this.attr({x1:new pt(t),y1:new pt(e)})}function kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new pt(t),cy:new pt(e)}):this.attr({x2:new pt(t),y2:new pt(e)})}M(jt,"Fragment");var Bt,It={__proto__:null,from:Dt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}E(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:C((function(t,e){return this.put(new Lt(t)).update(e)}))}}),M(Lt,"Gradient");class zt extends wt{constructor(t,e=t){super(_("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}i({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:C((function(t,e,n){return this.put(new zt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends vt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const n=new g.window.Image;return ht(n,"load",(function(t){const r=this.parent(zt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof zt&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ht(n,"load error",(function(){ut(n)})),this.attr("href",n.src=t,m)}}Bt=function(t,e,n){return"fill"!==t&&"stroke"!==t||q.test(e)&&(e=n.root().defs().image(e)),e instanceof Rt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:C((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Ft extends ft{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new K(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(V).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}var qt={__proto__:null,MorphArray:Ft,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Vt extends vt{constructor(t,e=t){super(_("line",t),e)}array(){return new Ft([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Ft(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}E(Vt,qt),i({Container:{line:C((function(...t){return Vt.prototype.plot.apply(this.put(new Vt),null!=t[0]?t:[0,0,0,0])}))}}),M(Vt,"Line");class Xt extends wt{constructor(t,e=t){super(_("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Yt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:C((function(t,e,n){return this.put(new Xt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Xt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),M(Xt,"Marker");const Gt={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Gt[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}E(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Yt("_duration",Wt),overshoot:Yt("_overshoot",Wt)}),E(class extends $t{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Yt("_windup"),p:Yt("P"),i:Yt("I"),d:Yt("D")});const Qt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jt={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Zt="mlhvqtcsaz".split("");for(let t=0,e=Zt.length;t<e;++t)Jt[Zt[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Jt[t](e,n,r)}}(Zt[t].toUpperCase());function Kt(t){return t.segment.length&&t.segment.length-1===Qt[t.segment[0].toUpperCase()]}function te(t,e){t.inNumber&&ee(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ee(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Kt(t)&&ne(t)}function ne(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Jt[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function re(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends ft{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!te(i,r))if("."!==r)if(isNaN(parseInt(r)))if(" "!==r&&","!==r)if("-"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");ne(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||re(i)){i.inNumber=!0,i.number=r,ee(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&ne(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:V.test(t)?X.test(t)?se:ft:T.test(t)?pt:he:de.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ft:"object"===e?ce:he};class ae{constructor(t){this._stepper=t||new Ht("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(oe(t));let e=new this._type(t);return this._type===H&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ce&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class he{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class ue{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,ue.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}ue.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const le=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class ce{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===H&&t[n+7]!==e[n+7]){const e=t[n+7],r=new H(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=oe(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(le),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const de=[he,ue,ce];class fe extends vt{constructor(t,e=t){super(_("path",t),e)}array(){return this._array||(this._array=new se(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new se(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}fe.prototype.MorphArray=se,i({Container:{path:C((function(t){return this.put(new fe).plot(t||new se)}))}}),M(fe,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new Ft(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Ft(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class me extends vt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:C((function(t){return this.put(new me).plot(t||new Ft)}))}}),E(me,qt),E(me,pe),M(me,"Polygon");class ge extends vt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:C((function(t){return this.put(new ge).plot(t||new Ft)}))}}),E(ge,qt),E(ge,pe),M(ge,"Polyline");class ye extends vt{constructor(t,e=t){super(_("rect",t),e)}}E(ye,{rx:_t,ry:St}),i({Container:{rect:C((function(t,e){return this.put(new ye).size(t,e)}))}}),M(ye,"Rect");class be{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const we={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>g.window.performance||g.window.Date,transforms:[],frame(t){const e=we.frames.push({run:t});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},timeout(t,e){e=e||0;const n=we.timer().now()+e,r=we.timeouts.push({run:t,time:n});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),r},immediate(t){const e=we.immediates.push(t);return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},cancelFrame(t){null!=t&&we.frames.remove(t)},clearTimeout(t){null!=t&&we.timeouts.remove(t)},cancelImmediate(t){null!=t&&we.immediates.remove(t)},_draw(t){let e=null;const n=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==n););let r=null;const i=we.frames.last();for(;r!==i&&(r=we.frames.shift());)r.run(t);let s=null;for(;s=we.immediates.shift();)s();we.nextDraw=we.timeouts.first()||we.frames.first()?g.window.requestAnimationFrame(we._draw):null}},xe=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},ve=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends lt{constructor(t=ve){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(xe);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return we.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=we.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}i({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new _e,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?400:t)?new $t(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof $t,this._stepper=this._isDeclarative?t:new Ht,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e||0,n=n||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,n=t.when||n,i=t.swing||i,r=t.times||r,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Se.sanitise(t,e,n),i=new Se(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new Q,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Ht(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},h=i*(r+n)-r;return a=e<=0?Math.round(t(1e-5)):e<h?t(e):Math.round(t(h-1e-5)),a}const h=Math.floor(this.loops()),u=s&&h%2==0;return a=h+(u&&!o||o&&u?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof _e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new Q,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}E([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Ne=t=>t.transforms;function Pe(){const t=this._transformationRunners.runners.map(Ne).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ae{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Oe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}i({Element:{animate(t,e,n){const r=Se.sanitise(t,e,n),i=this.timeline();return new Se(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ne).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Pe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ae).add(new Oe(new Q(this))))}}}),E(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ae(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new ce(i.from()).valueOf();Object.assign(n,e),i.from(n)}const h=new ce(i.to()).valueOf();Object.assign(h,e),i.to(h),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ae(this._stepper).to(new pt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=Q.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ae(this._stepper).type(n?ue:Q);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||d(t,o),u=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new $(s).transform(o._currentTransform(this));let f=new Q({...t,origin:[c,d]}),p=this._isDeclarative&&a?a:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(f);const m=i.at(l);return h=m.rotate,a=new Q(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=d(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new pt(e),this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new pt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new pt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ae(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new K(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),E(Se,{rx:_t,ry:St,from:Dt,to:kt}),M(Se,"Runner");class Ee extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new xt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof g.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:f,version:"1.1"}).attr("xmlns:xlink",m,p).attr("xmlns:svgjs","http://svgjs.dev/svgjs",p):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,p).attr("xmlns:svgjs",null,p)}root(){return this.isRoot()?this:super.root()}}i({Container:{nested:C((function(){return this.put(new Ee)}))}}),M(Ee,"Svg",!0);class Ce extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:C((function(){return this.put(new Ce)}))}}),M(Ce,"Symbol");var Te={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(g.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class je extends vt{constructor(t,e=t){super(_("text",t),e),this.dom.leading=new pt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new pt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new pt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"!==e[r].nodeName?(r!==n&&3!==e[r].nodeType&&!0===S(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent):0===r&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}E(je,Te),i({Container:{text:C((function(t=""){return this.put(new je).text(t)})),plain:C((function(t=""){return this.put(new je).plain(t)}))}}),M(je,"Text");class De extends vt{constructor(t,e=t){super(_("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof je))return this;const e=t.index(this),n=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new pt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}E(De,Te),i({Tspan:{tspan:C((function(t=""){const e=new De;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(De,"Tspan");class ke extends vt{constructor(t,e=t){super(_("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new pt(t).divide(2))}}E(ke,{x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et}),i({Container:{circle:C((function(t=0){return this.put(new ke).size(t).move(0,0)}))}}),M(ke,"Circle");class Be extends wt{constructor(t,e=t){super(_("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return rt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:C((function(){return this.defs().put(new Be)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Be?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),M(Be,"ClipPath");class Ie extends yt{constructor(t,e=t){super(_("foreignObject",t),e)}}i({Container:{foreignObject:C((function(t,e){return this.put(new Ie).size(t,e)}))}}),M(Ie,"ForeignObject");var Le={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,r)=>{let i;try{i=n.bbox()}catch(t){return}const s=new Q(n),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=c(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach(((t,e)=>{const r=new $(n).transform(new Q(t).inverse());t.scale(i,s,r.x,r.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class ze extends wt{constructor(t,e=t){super(_("g",t),e)}}E(ze,Le),i({Container:{group:C((function(){return this.put(new ze)}))}}),M(ze,"G");class Re extends wt{constructor(t,e=t){super(_("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}E(Re,Le),i({Container:{link:C((function(t){return this.put(new Re).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Re,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),M(Re,"A");class Fe extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}i({Container:{mask:C((function(){return this.defs().put(new Fe)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Fe?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Fe,"Mask");class qe extends yt{constructor(t,e=t){super(_("stop",t),e)}update(t){return("number"==typeof t||t instanceof pt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new pt(t.offset)),this}}i({Gradient:{stop:function(t,e,n){return this.put(new qe).update(t,e,n)}}}),M(qe,"Stop");class Ve extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}i("Dom",{style(t,e){return this.put(new Ve).rule(t,e)},fontface(t,e,n){return this.put(new Ve).font(t,e,n)}}),M(Ve,"Style");class Xe extends je{constructor(t,e=t){super(_("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}i({Container:{textPath:C((function(t,e){return t instanceof je||(t=this.text(t)),t.path(e)}))},Text:{path:C((function(t,e=!0){const n=new Xe;let r;if(t instanceof fe||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:C((function(t){return t instanceof je||(t=(new je).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Xe.prototype.MorphArray=se,M(Xe,"TextPath");class Ye extends vt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:C((function(t,e){return this.put(new Ye).use(t,e)}))}}),M(Ye,"Use"),E([Ee,Ce,Rt,zt,Xt],s("viewbox")),E([Vt,ge,me,fe],s("marker")),E(je,s("Text")),E(fe,s("Path")),E(xt,s("Defs")),E([je,De],s("Tspan")),E([ye,Tt,Lt,Se],s("radius")),E(lt,s("EventTarget")),E(gt,s("Dom")),E(yt,s("Element")),E(vt,s("Shape")),E([wt,jt],s("Container")),E(Lt,s("Gradient")),E(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){de.push(...[].concat(t))}([pt,H,K,Q,ft,Ft,se,$]),E(de,{to(t){return(new ae).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var Ge=n(726),Ue=n(986),He=function(){function t(t){var e=this;this.textElement=t,this.eventListeners={move:[]},new MutationObserver((function(){return e.callEventListeners("move")})).observe(t,{attributes:!0,attributeFilter:["x","y"]})}return t.create=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","text");n.textContent=e;var r=new t(n);return r.assignUUID(),r.setAttributes(t.defaultAttributes),r},Object.defineProperty(t.prototype,"domNode",{get:function(){return this.textElement},enumerable:!1,configurable:!0}),t.prototype.appendTo=function(t){t.appendChild(this.domNode)},t.prototype.remove=function(){this.domNode.remove()},t.prototype.isIn=function(t){return t.contains(this.domNode)&&t!==this.domNode},t.prototype.hasParent=function(){return!!this.domNode.parentNode},t.prototype.bringToFront=function(){(0,Ge.bringToFront)(this.domNode)},t.prototype.sendToBack=function(){(0,Ge.sendToBack)(this.domNode)},t.prototype.getAttribute=function(t){return this.domNode.getAttribute(t)},t.prototype.setAttribute=function(t,e){this.domNode.setAttribute(t,e)},t.prototype.setAttributes=function(t){try{new je(this.domNode).attr(t)}catch(t){}},Object.defineProperty(t.prototype,"id",{get:function(){return this.domNode.id},enumerable:!1,configurable:!0}),t.prototype.assignUUID=function(){(0,Ge.assignUUID)(this.domNode)},Object.defineProperty(t.prototype,"textContent",{get:function(){return this.domNode.textContent},set:function(t){this.domNode.textContent=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bbox",{get:function(){return this.domNode.getBBox()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerPoint",{get:function(){var t=new je(this.domNode).bbox();return{x:t.cx,y:t.cy}},set:function(t){new je(this.domNode).center(t.x,t.y)},enumerable:!1,configurable:!0}),t.prototype.getCenterPoint=function(){return this.centerPoint},t.prototype.setCenterPoint=function(t){this.centerPoint=t},Object.defineProperty(t.prototype,"boundingClientRect",{get:function(){return this.domNode.getBoundingClientRect()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerClientPoint",{get:function(){var t=this.domNode.getBoundingClientRect();return{x:(0,Ue.mean)([t.left,t.right]),y:(0,Ue.mean)([t.top,t.bottom])}},enumerable:!1,configurable:!0}),t.prototype.getCenterClientPoint=function(){return this.centerClientPoint},t.prototype.addEventListener=function(t,e){this.eventListeners[t].push(e)},t.prototype.callEventListeners=function(t){this.eventListeners[t].forEach((function(t){return t()}))},t.defaultAttributes={"font-family":"Arial","font-size":"9","font-weight":"700"},t.defaultAttributeNames=["font-family","font-size","font-weight"],t}()})(),r})(),t.exports=e()},298:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>u,VerticalClientScaling:()=>c,assignUUID:()=>h});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function h(t){t.id="uuid-"+a()}var u=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")},t}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();return e})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,degrees:()=>m,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return Math.abs(t-e)<=n}function f(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function m(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}return e})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function h(t){return null==t}function u(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>u,isNullish:()=>h,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{areWithin:()=>a,centroid:()=>f,deepCopy:()=>s,direction:()=>c,displaced:()=>u,displacement:()=>h,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=n(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(n){return e(n)&&(0,t.isFiniteNumber)(n.x)&&(0,t.isFiniteNumber)(n.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function a(t,e,n){return o(t,e)<=n}function h(t,e){return{x:e.x-t.x,y:e.y-t.y}}function u(t,e){return{x:t.x+e.x,y:t.y+e.y}}var l=n(30);function c(t,e){return(0,l.direction)(h(t,e))}var d=n(986);function f(t){return{x:(0,d.mean)(t.map((function(t){return t.x}))),y:(0,d.mean)(t.map((function(t){return t.y})))}}function p(t,e){return f([t,e])}})(),r})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function h(t){return null==t}function u(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>u,isNullish:()=>h,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{StraightBond:()=>Qe});const t={},e=[];function i(e,n){if(Array.isArray(e))for(const t of e)i(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)i(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function a(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function h(t){return t%360*Math.PI/180}function u(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function d(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:h}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?h:i.includes("bottom")?h+t:h+t/2)}return[r,i]}const f="http://www.w3.org/2000/svg",p="http://www.w3.org/2000/xmlns/",m="http://www.w3.org/1999/xlink",g={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class y{}const b={},w="___SYMBOL___ROOT___";function x(t,e=f){return g.document.createElementNS(e,t)}function v(t,e=!1){if(t instanceof y)return t;if("object"==typeof t)return O(t);if(null==t)return new b[w];if("string"==typeof t&&"<"!==t.charAt(0))return O(g.document.querySelector(t));const n=e?g.document.createElement("div"):x("svg");return n.innerHTML=t,t=O(n.firstChild),n.removeChild(n.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function S(t){if(!t)return null;if(t.instance instanceof y)return t.instance;if("#document-fragment"===t.nodeName)return new b.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":b[e]||(e="Dom"),new b[e](t)}let O=S;function M(t,e=t.name,n=!1){return b[e]=t,n&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let N=1e3;function P(t){return"Svgjs"+l(t)+N++}function A(t){for(let e=t.children.length-1;e>=0;e--)A(t.children[e]);return t.id?(t.id=P(t.nodeName),t):t}function E(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function C(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}i("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=v(t)).before(this),this},insertAfter:function(t){return(t=v(t)).after(this),this}});const T=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,k=/(#[a-z_][a-z0-9\-_]*)/i,B=/\)\s*,?\s*/,I=/\s/g,L=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,z=/^rgb\(/,R=/^(\s+)?$/,F=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,q=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,V=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function Y(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function G(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function U(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(V)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),i("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=u(e);n[e]=this.node.style[t]}return n}if("string"==typeof t)return this.node.style[u(t)];if("object"==typeof t)for(const e in t)this.node.style[u(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[u(t)]=null==e||R.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),i("Dom",{data:function(t,e,n){if(null==t)return this.data(a(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),i("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class H{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof H||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new H(t,e,n,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?r():e)/.5+.01)+150),n=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new H(t,n,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new H(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new H(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new H(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new H(t,e,n,"lab")}if("grey"===t){const t=255*r();return new H(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(L.test(t)||z.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),h=(o+a)/2,u=o===a,l=o-a;return new H(360*(u?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(u?0:h>.5?l/(2-o-a):l/(o+a)),100*h,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=G(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:G(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:G(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:G(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:G(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:G(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[n,r,i]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!L.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=j.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:n}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,h=o-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(h**3>l?h**3:(h-u)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,h=r>a?1.055*o(r,1/2.4)-.055:12.92*r,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*h,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new H(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*U(i,r,t+1/3),o=255*U(i,r,t),a=255*U(i,r,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Y);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,l=(.2126*o+.7152*a+.0722*h)/1,c=(.0193*o+.1192*a+.9505*h)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new H(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function W(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,h=t.shear||0,u=t.rotate||t.theta||0,l=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new $(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new $(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:w.x,ry:w.y,tx:y,ty:b,ox:c,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=h,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new Q(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=n*s-r*i,u=h>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/h,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new Q(t);return W(this.a,e.a)&&W(this.b,e.b)&&W(this.c,e.c)&&W(this.d,e.d)&&W(this.e,e.e)&&W(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Q.fromArray([1,0,0,1,0,0]);return t=t instanceof yt?t.matrixify():"string"==typeof t?Q.fromArray(t.split(V).map(parseFloat)):Array.isArray(t)?Q.fromArray(t):"object"==typeof t&&Q.isMatrixLike(t)?t:"object"==typeof t?(new Q).transform(t):6===arguments.length?Q.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,h=-e/o,u=-n/o,l=t/o,c=-(a*i+u*s),d=-(h*i+l*s);return this.a=a,this.b=h,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=h(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:l,f:c}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-u*i,this.d=u*r+a*i,this.e=l*r-c*i+n*i-e*r+e,this.f=c*r+l*i-e*i-n*r+n,this}scale(t,e,n,r){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:h}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+h*t-n*t,this}skew(t,e,n,r){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=h(t),e=h(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:l,e:c,f:d}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+l*i,this.d=l+u*s,this.e=c+d*i-r*i,this.f=d+c*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Q.isMatrixLike(t))return new Q(t).multiplyO(this);const e=Q.formatTransforms(t),{x:n,y:r}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new $(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function J(){if(!J.nodes){const t=v().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;J.nodes={svg:t,path:e}}if(!J.nodes.svg.node.parentNode){const t=g.document.body||g.document.documentElement;J.nodes.svg.addTo(t)}return J.nodes}function Z(t){return!(t.width||t.height||t.x||t.y)}M(Q,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=g.window.pageXOffset,this.y+=g.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(V).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Z(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Q||(t=new Q(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new $(this.x,this.y),new $(this.x2,this.y),new $(this.x,this.y2),new $(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new K(e,r,n-e,i-r)}}function tt(t,e,n){let r;try{if(r=e(t.node),Z(r)&&(i=t.node)!==g.document&&!(g.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===g.document}).call(g.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}i({viewbox:{viewbox(t,e,n,r){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new $(n/2/s+i.x,r/2/o+i.y);const u=new K(i).transform(new Q({scale:h,origin:e}));return this.viewbox(u)}}}),M(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}E([et],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const nt=["toArray","constructor","each"];function rt(t,e){return new et(a((e||g.document).querySelectorAll(t),(function(t){return S(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),E([et],t)};let it=0;const st={};function ot(t){let e=t.getEventHolder();return e===g.window&&(e=st),e.events||(e.events={}),e.events}function at(t){return t.getEventTarget()}function ht(t,e,n,r,i){const s=n.bind(r||t),o=v(t),a=ot(o),h=at(o);e=Array.isArray(e)?e:e.split(V),n._svgjsListenerId||(n._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function ut(t,e,n,r){const i=v(t),s=ot(i),o=at(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(V)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let h,u;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])ut(o,[e,a].join("."),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&ut(o,[t,a].join("."));else if(e){if(s[e]){for(h in s[e])ut(o,[e,h].join("."));delete s[e]}}else{for(t in s)ut(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class lt extends y{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ut(this,t,e,n),this}on(t,e,n,r){return ht(this,t,e,n,r),this}removeEventListener(){}}function ct(){}M(lt,"EventTarget");const dt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class ft extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(V).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class pt{constructor(...t){this.init(...t)}convert(t){return new pt(this.value,t)}divide(t){return t=new pt(t),new pt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(T))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof pt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new pt(t),new pt(this-t,this.unit||t.unit)}plus(t){return t=new pt(t),new pt(this+t,this.unit||t.unit)}times(t){return t=new pt(t),new pt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const mt=[];class gt extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=v(t)).removeNamespace&&this.node instanceof g.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return v(t).put(this,e)}children(){return new et(a(this.node.children,(function(t){return S(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=A(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new gt(x(t),e))}first(){return S(this.node.firstChild)}get(t){return S(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=P(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=v(t),this.add(t,e),t}putIn(t,e){return v(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=v(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,f)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=S(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=x("wrapper",n),i=g.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}E(gt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=F.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?dt[t]:F.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,n)=>n(t,e,this)),e))?e=new pt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new ft(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return S(this.node.querySelector(t))}}),M(gt,"Dom");class yt extends gt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new pt(t).plus(this.x()))}dy(t=0){return this.y(new pt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=v(t));const n=new et;let r=this;for(;(r=r.parent())&&r.node!==g.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?v(e[1]):null}root(){const t=this.parent(b[w]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new pt(n.width)).height(new pt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}E(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new $(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Q(this.node.getCTM())},screenCTM:function(){if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new Q(e)}return new Q(this.node.getScreenCTM())}}),M(yt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof H||H.isRgb(e)||e instanceof yt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),i("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new pt(t)):this.rx(t).ry(e)}}),i("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new $(this.node.getPointAtLength(t))}}),i(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),i("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),i("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(B).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(V).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Q.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Q)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Q(this).decompose();return null==t?e:e[t]}Q.isMatrixLike(t)||(t={...t,origin:d(t,this)});const n=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class wt extends yt{flatten(t=this,e){return this.each((function(){if(this instanceof wt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class xt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(xt,"Defs");class vt extends yt{}function _t(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function Ot(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Mt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Nt(t){return this.attr("cx",t)}function Pt(t){return this.attr("cy",t)}function At(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function Et(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(vt,"Shape");var Ct={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et};class Tt extends vt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new pt(n.width).divide(2)).ry(new pt(n.height).divide(2))}}E(Tt,Ct),i("Container",{ellipse:C((function(t=0,e=t){return this.put(new Tt).size(t,e).move(0,0)}))}),M(Tt,"Ellipse");class jt extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Dt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new pt(t),fy:new pt(e)}):this.attr({x1:new pt(t),y1:new pt(e)})}function kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new pt(t),cy:new pt(e)}):this.attr({x2:new pt(t),y2:new pt(e)})}M(jt,"Fragment");var Bt,It={__proto__:null,from:Dt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}E(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:C((function(t,e){return this.put(new Lt(t)).update(e)}))}}),M(Lt,"Gradient");class zt extends wt{constructor(t,e=t){super(_("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}i({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:C((function(t,e,n){return this.put(new zt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends vt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const n=new g.window.Image;return ht(n,"load",(function(t){const r=this.parent(zt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof zt&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ht(n,"load error",(function(){ut(n)})),this.attr("href",n.src=t,m)}}Bt=function(t,e,n){return"fill"!==t&&"stroke"!==t||q.test(e)&&(e=n.root().defs().image(e)),e instanceof Rt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:C((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Ft extends ft{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new K(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(V).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}var qt={__proto__:null,MorphArray:Ft,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Vt extends vt{constructor(t,e=t){super(_("line",t),e)}array(){return new Ft([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Ft(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}E(Vt,qt),i({Container:{line:C((function(...t){return Vt.prototype.plot.apply(this.put(new Vt),null!=t[0]?t:[0,0,0,0])}))}}),M(Vt,"Line");class Xt extends wt{constructor(t,e=t){super(_("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Yt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:C((function(t,e,n){return this.put(new Xt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Xt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),M(Xt,"Marker");const Gt={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Gt[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}E(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Yt("_duration",Wt),overshoot:Yt("_overshoot",Wt)}),E(class extends $t{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Yt("_windup"),p:Yt("P"),i:Yt("I"),d:Yt("D")});const Qt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jt={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Zt="mlhvqtcsaz".split("");for(let t=0,e=Zt.length;t<e;++t)Jt[Zt[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Jt[t](e,n,r)}}(Zt[t].toUpperCase());function Kt(t){return t.segment.length&&t.segment.length-1===Qt[t.segment[0].toUpperCase()]}function te(t,e){t.inNumber&&ee(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ee(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Kt(t)&&ne(t)}function ne(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Jt[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function re(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends ft{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!te(i,r))if("."!==r)if(isNaN(parseInt(r)))if(" "!==r&&","!==r)if("-"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");ne(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||re(i)){i.inNumber=!0,i.number=r,ee(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&ne(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:V.test(t)?X.test(t)?se:ft:T.test(t)?pt:he:de.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ft:"object"===e?ce:he};class ae{constructor(t){this._stepper=t||new Ht("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(oe(t));let e=new this._type(t);return this._type===H&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ce&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class he{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class ue{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,ue.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}ue.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const le=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class ce{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===H&&t[n+7]!==e[n+7]){const e=t[n+7],r=new H(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=oe(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(le),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const de=[he,ue,ce];class fe extends vt{constructor(t,e=t){super(_("path",t),e)}array(){return this._array||(this._array=new se(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new se(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}fe.prototype.MorphArray=se,i({Container:{path:C((function(t){return this.put(new fe).plot(t||new se)}))}}),M(fe,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new Ft(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Ft(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class me extends vt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:C((function(t){return this.put(new me).plot(t||new Ft)}))}}),E(me,qt),E(me,pe),M(me,"Polygon");class ge extends vt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:C((function(t){return this.put(new ge).plot(t||new Ft)}))}}),E(ge,qt),E(ge,pe),M(ge,"Polyline");class ye extends vt{constructor(t,e=t){super(_("rect",t),e)}}E(ye,{rx:_t,ry:St}),i({Container:{rect:C((function(t,e){return this.put(new ye).size(t,e)}))}}),M(ye,"Rect");class be{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const we={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>g.window.performance||g.window.Date,transforms:[],frame(t){const e=we.frames.push({run:t});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},timeout(t,e){e=e||0;const n=we.timer().now()+e,r=we.timeouts.push({run:t,time:n});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),r},immediate(t){const e=we.immediates.push(t);return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},cancelFrame(t){null!=t&&we.frames.remove(t)},clearTimeout(t){null!=t&&we.timeouts.remove(t)},cancelImmediate(t){null!=t&&we.immediates.remove(t)},_draw(t){let e=null;const n=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==n););let r=null;const i=we.frames.last();for(;r!==i&&(r=we.frames.shift());)r.run(t);let s=null;for(;s=we.immediates.shift();)s();we.nextDraw=we.timeouts.first()||we.frames.first()?g.window.requestAnimationFrame(we._draw):null}},xe=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},ve=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends lt{constructor(t=ve){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(xe);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return we.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=we.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}i({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new _e,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?400:t)?new $t(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof $t,this._stepper=this._isDeclarative?t:new Ht,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e||0,n=n||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,n=t.when||n,i=t.swing||i,r=t.times||r,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Se.sanitise(t,e,n),i=new Se(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new Q,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Ht(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},h=i*(r+n)-r;return a=e<=0?Math.round(t(1e-5)):e<h?t(e):Math.round(t(h-1e-5)),a}const h=Math.floor(this.loops()),u=s&&h%2==0;return a=h+(u&&!o||o&&u?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof _e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new Q,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}E([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Ne=t=>t.transforms;function Pe(){const t=this._transformationRunners.runners.map(Ne).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ae{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Oe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}i({Element:{animate(t,e,n){const r=Se.sanitise(t,e,n),i=this.timeline();return new Se(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ne).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Pe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ae).add(new Oe(new Q(this))))}}}),E(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ae(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new ce(i.from()).valueOf();Object.assign(n,e),i.from(n)}const h=new ce(i.to()).valueOf();Object.assign(h,e),i.to(h),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ae(this._stepper).to(new pt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=Q.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ae(this._stepper).type(n?ue:Q);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||d(t,o),u=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new $(s).transform(o._currentTransform(this));let f=new Q({...t,origin:[c,d]}),p=this._isDeclarative&&a?a:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(f);const m=i.at(l);return h=m.rotate,a=new Q(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=d(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new pt(e),this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new pt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new pt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ae(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new K(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),E(Se,{rx:_t,ry:St,from:Dt,to:kt}),M(Se,"Runner");class Ee extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new xt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof g.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:f,version:"1.1"}).attr("xmlns:xlink",m,p).attr("xmlns:svgjs","http://svgjs.dev/svgjs",p):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,p).attr("xmlns:svgjs",null,p)}root(){return this.isRoot()?this:super.root()}}i({Container:{nested:C((function(){return this.put(new Ee)}))}}),M(Ee,"Svg",!0);class Ce extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:C((function(){return this.put(new Ce)}))}}),M(Ce,"Symbol");var Te={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(g.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class je extends vt{constructor(t,e=t){super(_("text",t),e),this.dom.leading=new pt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new pt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new pt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"!==e[r].nodeName?(r!==n&&3!==e[r].nodeType&&!0===S(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent):0===r&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}E(je,Te),i({Container:{text:C((function(t=""){return this.put(new je).text(t)})),plain:C((function(t=""){return this.put(new je).plain(t)}))}}),M(je,"Text");class De extends vt{constructor(t,e=t){super(_("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof je))return this;const e=t.index(this),n=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new pt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}E(De,Te),i({Tspan:{tspan:C((function(t=""){const e=new De;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(De,"Tspan");class ke extends vt{constructor(t,e=t){super(_("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new pt(t).divide(2))}}E(ke,{x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et}),i({Container:{circle:C((function(t=0){return this.put(new ke).size(t).move(0,0)}))}}),M(ke,"Circle");class Be extends wt{constructor(t,e=t){super(_("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return rt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:C((function(){return this.defs().put(new Be)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Be?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),M(Be,"ClipPath");class Ie extends yt{constructor(t,e=t){super(_("foreignObject",t),e)}}i({Container:{foreignObject:C((function(t,e){return this.put(new Ie).size(t,e)}))}}),M(Ie,"ForeignObject");var Le={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,r)=>{let i;try{i=n.bbox()}catch(t){return}const s=new Q(n),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=c(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach(((t,e)=>{const r=new $(n).transform(new Q(t).inverse());t.scale(i,s,r.x,r.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class ze extends wt{constructor(t,e=t){super(_("g",t),e)}}E(ze,Le),i({Container:{group:C((function(){return this.put(new ze)}))}}),M(ze,"G");class Re extends wt{constructor(t,e=t){super(_("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}E(Re,Le),i({Container:{link:C((function(t){return this.put(new Re).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Re,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),M(Re,"A");class Fe extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}i({Container:{mask:C((function(){return this.defs().put(new Fe)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Fe?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Fe,"Mask");class qe extends yt{constructor(t,e=t){super(_("stop",t),e)}update(t){return("number"==typeof t||t instanceof pt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new pt(t.offset)),this}}i({Gradient:{stop:function(t,e,n){return this.put(new qe).update(t,e,n)}}}),M(qe,"Stop");class Ve extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}i("Dom",{style(t,e){return this.put(new Ve).rule(t,e)},fontface(t,e,n){return this.put(new Ve).font(t,e,n)}}),M(Ve,"Style");class Xe extends je{constructor(t,e=t){super(_("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}i({Container:{textPath:C((function(t,e){return t instanceof je||(t=this.text(t)),t.path(e)}))},Text:{path:C((function(t,e=!0){const n=new Xe;let r;if(t instanceof fe||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:C((function(t){return t instanceof je||(t=(new je).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Xe.prototype.MorphArray=se,M(Xe,"TextPath");class Ye extends vt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:C((function(t,e){return this.put(new Ye).use(t,e)}))}}),M(Ye,"Use"),E([Ee,Ce,Rt,zt,Xt],s("viewbox")),E([Vt,ge,me,fe],s("marker")),E(je,s("Text")),E(fe,s("Path")),E(xt,s("Defs")),E([je,De],s("Tspan")),E([ye,Tt,Lt,Se],s("radius")),E(lt,s("EventTarget")),E(gt,s("Dom")),E(yt,s("Element")),E(vt,s("Shape")),E([wt,jt],s("Container")),E(Lt,s("Gradient")),E(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){de.push(...[].concat(t))}([pt,H,K,Q,ft,Ft,se,$]),E(de,{to(t){return(new ae).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var Ge=n(726),Ue=n(725),He=n(854),$e=["basePadding1","basePadding2"],We={basePadding1:"setBasePadding1",basePadding2:"setBasePadding2"},Qe=function(){function t(t,e,n){var r=this;this.line=t,this.base1=e,this.base2=n,this.cachedBasePadding1=(0,Ue.distance)(this.point1,this.base1.centerPoint),this.cachedBasePadding2=(0,Ue.distance)(this.point2,this.base2.centerPoint),e.addEventListener("move",(function(){return r.reposition()})),n.addEventListener("move",(function(){return r.reposition()}))}return t.between=function(e,n){var r=new t((new Vt).node,e,n);return r.assignUUID(),r.set(t.defaultValues),r.reposition(),r},Object.defineProperty(t.prototype,"basePair",{get:function(){return[this.base1,this.base2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"domNode",{get:function(){return this.line},enumerable:!1,configurable:!0}),t.prototype.getAttribute=function(t){return this.domNode.getAttribute(t)},t.prototype.setAttribute=function(t,e){this.domNode.setAttribute(t,e)},t.prototype.setAttributes=function(t){if((0,He.isNonNullObject)(t))try{new Vt(this.domNode).attr(t)}catch(t){}},Object.defineProperty(t.prototype,"id",{get:function(){return this.domNode.id},enumerable:!1,configurable:!0}),t.prototype.assignUUID=function(){(0,Ge.assignUUID)(this.domNode)},t.prototype.appendTo=function(t){t.appendChild(this.domNode)},t.prototype.remove=function(){this.domNode.remove()},t.prototype.isIn=function(t){return t.contains(this.domNode)&&t!==this.domNode},t.prototype.hasParent=function(){return!!this.domNode.parentNode},t.prototype.getTotalLength=function(){return this.domNode.getTotalLength()},t.prototype.getPointAtLength=function(t){return this.domNode.getPointAtLength(t)},Object.defineProperty(t.prototype,"point1",{get:function(){return{x:this.domNode.x1.baseVal.value,y:this.domNode.y1.baseVal.value}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"point2",{get:function(){return{x:this.domNode.x2.baseVal.value,y:this.domNode.y2.baseVal.value}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"basePadding1",{get:function(){return this.cachedBasePadding1},set:function(t){this.cachedBasePadding1=t,this.reposition()},enumerable:!1,configurable:!0}),t.prototype.setBasePadding1=function(t){(0,He.isFiniteNumber)(t)&&(this.basePadding1=Math.max(0,t))},Object.defineProperty(t.prototype,"basePadding2",{get:function(){return this.cachedBasePadding2},set:function(t){this.cachedBasePadding2=t,this.reposition()},enumerable:!1,configurable:!0}),t.prototype.setBasePadding2=function(t){(0,He.isFiniteNumber)(t)&&(this.basePadding2=Math.max(0,t))},t.prototype.set=function(t){var e=this;try{this.setAttributes(t.attributes)}catch(t){}$e.forEach((function(n){try{e[We[n]](t[n])}catch(t){}}))},t.prototype.reposition=function(){var t=this.base1.centerPoint,e=this.base2.centerPoint,n=(0,Ue.direction)(t,e);this.setAttribute("x1","".concat(t.x+this.basePadding1*Math.cos(n))),this.setAttribute("y1","".concat(t.y+this.basePadding1*Math.sin(n))),this.setAttribute("x2","".concat(e.x-this.basePadding2*Math.cos(n))),this.setAttribute("y2","".concat(e.y-this.basePadding2*Math.sin(n)))},t.prototype.basesMoved=function(){this.reposition()},t.prototype.basesRemoved=function(){this.base1.hasParent()&&this.base2.hasParent()||this.remove()},t.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},t}()})(),r})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>u,VerticalClientScaling:()=>c,assignUUID:()=>h,bringToFront:()=>d,sendToBack:()=>f});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function h(t){t.id="uuid-"+a()}var u=function(){function t(t){this.targetSVGDoc=t}return t.prototype.set=function(t){var e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")},t}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();function d(t){var e=t.parentNode;e&&e.appendChild(t)}function f(t){var e=t.parentNode;e&&e.prepend(t)}return e})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>u,mean:()=>r,median:()=>a,min:()=>h,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function h(t){if(0==t.length)return 1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.min(e,t)})),e}function u(t){if(0==t.length)return-1/0;var e=t[0];return t.slice(1).forEach((function(t){e=Math.max(e,t)})),e}function l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function d(t,e,n){return t<e?e:t>n?n:t}function f(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{DotBracketDrawer:()=>rn,Drawing:()=>Ke,Nucleobase:()=>Ue.Nucleobase,StraightBond:()=>We.StraightBond});const t={},e=[];function i(e,n){if(Array.isArray(e))for(const t of e)i(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)i(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function a(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function h(t){return t%360*Math.PI/180}function u(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function d(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:h}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?h:i.includes("bottom")?h+t:h+t/2)}return[r,i]}const f="http://www.w3.org/2000/svg",p="http://www.w3.org/2000/xmlns/",m="http://www.w3.org/1999/xlink",g={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class y{}const b={},w="___SYMBOL___ROOT___";function x(t,e=f){return g.document.createElementNS(e,t)}function v(t,e=!1){if(t instanceof y)return t;if("object"==typeof t)return O(t);if(null==t)return new b[w];if("string"==typeof t&&"<"!==t.charAt(0))return O(g.document.querySelector(t));const n=e?g.document.createElement("div"):x("svg");return n.innerHTML=t,t=O(n.firstChild),n.removeChild(n.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function S(t){if(!t)return null;if(t.instance instanceof y)return t.instance;if("#document-fragment"===t.nodeName)return new b.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":b[e]||(e="Dom"),new b[e](t)}let O=S;function M(t,e=t.name,n=!1){return b[e]=t,n&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let N=1e3;function P(t){return"Svgjs"+l(t)+N++}function A(t){for(let e=t.children.length-1;e>=0;e--)A(t.children[e]);return t.id?(t.id=P(t.nodeName),t):t}function E(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function C(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}i("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=v(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=v(t)).before(this),this},insertAfter:function(t){return(t=v(t)).after(this),this}});const T=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,k=/(#[a-z_][a-z0-9\-_]*)/i,B=/\)\s*,?\s*/,I=/\s/g,L=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,z=/^rgb\(/,R=/^(\s+)?$/,F=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,q=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,V=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function Y(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function G(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function U(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(V)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),i("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=u(e);n[e]=this.node.style[t]}return n}if("string"==typeof t)return this.node.style[u(t)];if("object"==typeof t)for(const e in t)this.node.style[u(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[u(t)]=null==e||R.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),i("Dom",{data:function(t,e,n){if(null==t)return this.data(a(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),i("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class H{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof H||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new H(t,e,n,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?r():e)/.5+.01)+150),n=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new H(t,n,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new H(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new H(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new H(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new H(t,e,n,"lab")}if("grey"===t){const t=255*r();return new H(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(L.test(t)||z.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),h=(o+a)/2,u=o===a,l=o-a;return new H(360*(u?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(u?0:h>.5?l/(2-o-a):l/(o+a)),100*h,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=G(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:G(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:G(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:G(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:G(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:G(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[n,r,i]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!L.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=j.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:h}=this,u="rgb"===this.space?{r:s,g:o,b:a}:"xyz"===this.space?{x:s,y:o,z:a}:"hsl"===this.space?{h:s,s:o,l:a}:"lab"===this.space?{l:s,a:o,b:a}:"lch"===this.space?{l:s,c:o,h:a}:"cmyk"===this.space?{c:s,m:o,y:a,k:h}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:n}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,h=o-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(h**3>l?h**3:(h-u)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,h=r>a?1.055*o(r,1/2.4)-.055:12.92*r,u=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*h,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new H(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*U(i,r,t+1/3),o=255*U(i,r,t),a=255*U(i,r,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Y);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*a+.1805*h)/.95047,l=(.2126*o+.7152*a+.0722*h)/1,c=(.0193*o+.1192*a+.9505*h)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new H(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function W(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,h=t.shear||0,u=t.rotate||t.theta||0,l=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new $(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,w=new $(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:h,theta:u,rx:w.x,ry:w.y,tx:y,ty:b,ox:c,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=h,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new Q(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,h=n*s-r*i,u=h>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/h,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new Q(t);return W(this.a,e.a)&&W(this.b,e.b)&&W(this.c,e.c)&&W(this.d,e.d)&&W(this.e,e.e)&&W(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Q.fromArray([1,0,0,1,0,0]);return t=t instanceof yt?t.matrixify():"string"==typeof t?Q.fromArray(t.split(V).map(parseFloat)):Array.isArray(t)?Q.fromArray(t):"object"==typeof t&&Q.isMatrixLike(t)?t:"object"==typeof t?(new Q).transform(t):6===arguments.length?Q.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,h=-e/o,u=-n/o,l=t/o,c=-(a*i+u*s),d=-(h*i+l*s);return this.a=a,this.b=h,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof Q?t:new Q(t);return Q.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=h(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:l,f:c}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-u*i,this.d=u*r+a*i,this.e=l*r-c*i+n*i-e*r+e,this.f=c*r+l*i-e*i-n*r+n,this}scale(t,e,n,r){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e:h,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=h*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:h}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+h*t-n*t,this}skew(t,e,n,r){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=h(t),e=h(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:l,e:c,f:d}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+l*i,this.d=l+u*s,this.e=c+d*i-r*i,this.f=d+c*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Q.isMatrixLike(t))return new Q(t).multiplyO(this);const e=Q.formatTransforms(t),{x:n,y:r}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new $(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function J(){if(!J.nodes){const t=v().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;J.nodes={svg:t,path:e}}if(!J.nodes.svg.node.parentNode){const t=g.document.body||g.document.documentElement;J.nodes.svg.addTo(t)}return J.nodes}function Z(t){return!(t.width||t.height||t.x||t.y)}M(Q,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=g.window.pageXOffset,this.y+=g.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(V).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Z(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Q||(t=new Q(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new $(this.x,this.y),new $(this.x2,this.y),new $(this.x,this.y2),new $(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new K(e,r,n-e,i-r)}}function tt(t,e,n){let r;try{if(r=e(t.node),Z(r)&&(i=t.node)!==g.document&&!(g.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===g.document}).call(g.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}i({viewbox:{viewbox(t,e,n,r){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let h=a/t;h===1/0&&(h=Number.MAX_SAFE_INTEGER/100),e=e||new $(n/2/s+i.x,r/2/o+i.y);const u=new K(i).transform(new Q({scale:h,origin:e}));return this.viewbox(u)}}}),M(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}E([et],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const nt=["toArray","constructor","each"];function rt(t,e){return new et(a((e||g.document).querySelectorAll(t),(function(t){return S(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),E([et],t)};let it=0;const st={};function ot(t){let e=t.getEventHolder();return e===g.window&&(e=st),e.events||(e.events={}),e.events}function at(t){return t.getEventTarget()}function ht(t,e,n,r,i){const s=n.bind(r||t),o=v(t),a=ot(o),h=at(o);e=Array.isArray(e)?e:e.split(V),n._svgjsListenerId||(n._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,h.addEventListener(e,s,i||!1)}))}function ut(t,e,n,r){const i=v(t),s=ot(i),o=at(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(V)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let h,u;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(u in s[e][a])ut(o,[e,a].join("."),u);delete s[e][a]}}else if(a)for(t in s)for(h in s[t])a===h&&ut(o,[t,a].join("."));else if(e){if(s[e]){for(h in s[e])ut(o,[e,h].join("."));delete s[e]}}else{for(t in s)ut(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class lt extends y{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ut(this,t,e,n),this}on(t,e,n,r){return ht(this,t,e,n,r),this}removeEventListener(){}}function ct(){}M(lt,"EventTarget");const dt={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class ft extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(V).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class pt{constructor(...t){this.init(...t)}convert(t){return new pt(this.value,t)}divide(t){return t=new pt(t),new pt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(T))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof pt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new pt(t),new pt(this-t,this.unit||t.unit)}plus(t){return t=new pt(t),new pt(this+t,this.unit||t.unit)}times(t){return t=new pt(t),new pt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const mt=[];class gt extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=v(t)).removeNamespace&&this.node instanceof g.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return v(t).put(this,e)}children(){return new et(a(this.node.children,(function(t){return S(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=A(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new gt(x(t),e))}first(){return S(this.node.firstChild)}get(t){return S(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=P(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=v(t),this.add(t,e),t}putIn(t,e){return v(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=v(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,f)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=S(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=x("wrapper",n),i=g.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}E(gt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=F.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?dt[t]:F.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,n)=>n(t,e,this)),e))?e=new pt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new ft(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return S(this.node.querySelector(t))}}),M(gt,"Dom");class yt extends gt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(JSON.parse(t.getAttribute("svgjs:data"))||{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new pt(t).plus(this.x()))}dy(t=0){return this.y(new pt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=v(t));const n=new et;let r=this;for(;(r=r.parent())&&r.node!==g.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?v(e[1]):null}root(){const t=this.parent(b[w]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new pt(n.width)).height(new pt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}E(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new $(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Q(this.node.getCTM())},screenCTM:function(){if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new Q(e)}return new Q(this.node.getScreenCTM())}}),M(yt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof H||H.isRgb(e)||e instanceof yt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),i("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new pt(t)):this.rx(t).ry(e)}}),i("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new $(this.node.getPointAtLength(t))}}),i(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),i("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),i("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(B).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(V).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Q.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Q)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Q(this).decompose();return null==t?e:e[t]}Q.isMatrixLike(t)||(t={...t,origin:d(t,this)});const n=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class wt extends yt{flatten(t=this,e){return this.each((function(){if(this instanceof wt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class xt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(xt,"Defs");class vt extends yt{}function _t(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function Ot(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Mt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Nt(t){return this.attr("cx",t)}function Pt(t){return this.attr("cy",t)}function At(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function Et(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(vt,"Shape");var Ct={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et};class Tt extends vt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new pt(n.width).divide(2)).ry(new pt(n.height).divide(2))}}E(Tt,Ct),i("Container",{ellipse:C((function(t=0,e=t){return this.put(new Tt).size(t,e).move(0,0)}))}),M(Tt,"Ellipse");class jt extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Dt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new pt(t),fy:new pt(e)}):this.attr({x1:new pt(t),y1:new pt(e)})}function kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new pt(t),cy:new pt(e)}):this.attr({x2:new pt(t),y2:new pt(e)})}M(jt,"Fragment");var Bt,It={__proto__:null,from:Dt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}E(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:C((function(t,e){return this.put(new Lt(t)).update(e)}))}}),M(Lt,"Gradient");class zt extends wt{constructor(t,e=t){super(_("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}i({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:C((function(t,e,n){return this.put(new zt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends vt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const n=new g.window.Image;return ht(n,"load",(function(t){const r=this.parent(zt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof zt&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ht(n,"load error",(function(){ut(n)})),this.attr("href",n.src=t,m)}}Bt=function(t,e,n){return"fill"!==t&&"stroke"!==t||q.test(e)&&(e=n.root().defs().image(e)),e instanceof Rt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:C((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Ft extends ft{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new K(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(V).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}var qt={__proto__:null,MorphArray:Ft,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Vt extends vt{constructor(t,e=t){super(_("line",t),e)}array(){return new Ft([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Ft(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}E(Vt,qt),i({Container:{line:C((function(...t){return Vt.prototype.plot.apply(this.put(new Vt),null!=t[0]?t:[0,0,0,0])}))}}),M(Vt,"Line");class Xt extends wt{constructor(t,e=t){super(_("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Yt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:C((function(t,e,n){return this.put(new Xt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Xt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),M(Xt,"Marker");const Gt={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Gt[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}E(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Yt("_duration",Wt),overshoot:Yt("_overshoot",Wt)}),E(class extends $t{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Yt("_windup"),p:Yt("P"),i:Yt("I"),d:Yt("D")});const Qt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jt={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Zt="mlhvqtcsaz".split("");for(let t=0,e=Zt.length;t<e;++t)Jt[Zt[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Jt[t](e,n,r)}}(Zt[t].toUpperCase());function Kt(t){return t.segment.length&&t.segment.length-1===Qt[t.segment[0].toUpperCase()]}function te(t,e){t.inNumber&&ee(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ee(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Kt(t)&&ne(t)}function ne(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Jt[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function re(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends ft{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!te(i,r))if("."!==r)if(isNaN(parseInt(r)))if(" "!==r&&","!==r)if("-"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");ne(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||re(i)){i.inNumber=!0,i.number=r,ee(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&ne(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:V.test(t)?X.test(t)?se:ft:T.test(t)?pt:he:de.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ft:"object"===e?ce:he};class ae{constructor(t){this._stepper=t||new Ht("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(oe(t));let e=new this._type(t);return this._type===H&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ce&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class he{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class ue{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,ue.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}ue.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const le=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class ce{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===H&&t[n+7]!==e[n+7]){const e=t[n+7],r=new H(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=oe(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(le),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const de=[he,ue,ce];class fe extends vt{constructor(t,e=t){super(_("path",t),e)}array(){return this._array||(this._array=new se(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new se(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}fe.prototype.MorphArray=se,i({Container:{path:C((function(t){return this.put(new fe).plot(t||new se)}))}}),M(fe,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new Ft(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Ft(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class me extends vt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:C((function(t){return this.put(new me).plot(t||new Ft)}))}}),E(me,qt),E(me,pe),M(me,"Polygon");class ge extends vt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:C((function(t){return this.put(new ge).plot(t||new Ft)}))}}),E(ge,qt),E(ge,pe),M(ge,"Polyline");class ye extends vt{constructor(t,e=t){super(_("rect",t),e)}}E(ye,{rx:_t,ry:St}),i({Container:{rect:C((function(t,e){return this.put(new ye).size(t,e)}))}}),M(ye,"Rect");class be{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const we={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>g.window.performance||g.window.Date,transforms:[],frame(t){const e=we.frames.push({run:t});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},timeout(t,e){e=e||0;const n=we.timer().now()+e,r=we.timeouts.push({run:t,time:n});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),r},immediate(t){const e=we.immediates.push(t);return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),e},cancelFrame(t){null!=t&&we.frames.remove(t)},clearTimeout(t){null!=t&&we.timeouts.remove(t)},cancelImmediate(t){null!=t&&we.immediates.remove(t)},_draw(t){let e=null;const n=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==n););let r=null;const i=we.frames.last();for(;r!==i&&(r=we.frames.shift());)r.run(t);let s=null;for(;s=we.immediates.shift();)s();we.nextDraw=we.timeouts.first()||we.frames.first()?g.window.requestAnimationFrame(we._draw):null}},xe=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},ve=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends lt{constructor(t=ve){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(xe);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return we.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=we.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}i({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new _e,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?400:t)?new $t(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof $t,this._stepper=this._isDeclarative?t:new Ht,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e||0,n=n||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,n=t.when||n,i=t.swing||i,r=t.times||r,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Se.sanitise(t,e,n),i=new Se(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new Q,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Ht(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},h=i*(r+n)-r;return a=e<=0?Math.round(t(1e-5)):e<h?t(e):Math.round(t(h-1e-5)),a}const h=Math.floor(this.loops()),u=s&&h%2==0;return a=h+(u&&!o||o&&u?t:1-t),this.loops(a)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof _e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new Q,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}E([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Ne=t=>t.transforms;function Pe(){const t=this._transformationRunners.runners.map(Ne).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ae{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Oe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}i({Element:{animate(t,e,n){const r=Se.sanitise(t,e,n),i=this.timeline();return new Se(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ne).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Pe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ae).add(new Oe(new Q(this))))}}}),E(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ae(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new ce(i.from()).valueOf();Object.assign(n,e),i.from(n)}const h=new ce(i.to()).valueOf();Object.assign(h,e),i.to(h),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ae(this._stepper).to(new pt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=Q.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ae(this._stepper).type(n?ue:Q);let s,o,a,h,u;return this.queue((function(){o=o||this.element(),s=s||d(t,o),u=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new $(s).transform(o._currentTransform(this));let f=new Q({...t,origin:[c,d]}),p=this._isDeclarative&&a?a:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&h&&(p.rotate=h)),i.from(p),i.to(f);const m=i.at(l);return h=m.rotate,a=new Q(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=d(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new pt(e),this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new pt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new pt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ae(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new K(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),E(Se,{rx:_t,ry:St,from:Dt,to:kt}),M(Se,"Runner");class Ee extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new xt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof g.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:f,version:"1.1"}).attr("xmlns:xlink",m,p).attr("xmlns:svgjs","http://svgjs.dev/svgjs",p):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,p).attr("xmlns:svgjs",null,p)}root(){return this.isRoot()?this:super.root()}}i({Container:{nested:C((function(){return this.put(new Ee)}))}}),M(Ee,"Svg",!0);class Ce extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:C((function(){return this.put(new Ce)}))}}),M(Ce,"Symbol");var Te={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(g.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class je extends vt{constructor(t,e=t){super(_("text",t),e),this.dom.leading=new pt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new pt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new pt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"!==e[r].nodeName?(r!==n&&3!==e[r].nodeType&&!0===S(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent):0===r&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}E(je,Te),i({Container:{text:C((function(t=""){return this.put(new je).text(t)})),plain:C((function(t=""){return this.put(new je).plain(t)}))}}),M(je,"Text");class De extends vt{constructor(t,e=t){super(_("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof je))return this;const e=t.index(this),n=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new pt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}E(De,Te),i({Tspan:{tspan:C((function(t=""){const e=new De;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(De,"Tspan");class ke extends vt{constructor(t,e=t){super(_("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new pt(t).divide(2))}}E(ke,{x:Ot,y:Mt,cx:Nt,cy:Pt,width:At,height:Et}),i({Container:{circle:C((function(t=0){return this.put(new ke).size(t).move(0,0)}))}}),M(ke,"Circle");class Be extends wt{constructor(t,e=t){super(_("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return rt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:C((function(){return this.defs().put(new Be)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Be?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),M(Be,"ClipPath");class Ie extends yt{constructor(t,e=t){super(_("foreignObject",t),e)}}i({Container:{foreignObject:C((function(t,e){return this.put(new Ie).size(t,e)}))}}),M(Ie,"ForeignObject");var Le={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,r)=>{let i;try{i=n.bbox()}catch(t){return}const s=new Q(n),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=c(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach(((t,e)=>{const r=new $(n).transform(new Q(t).inverse());t.scale(i,s,r.x,r.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class ze extends wt{constructor(t,e=t){super(_("g",t),e)}}E(ze,Le),i({Container:{group:C((function(){return this.put(new ze)}))}}),M(ze,"G");class Re extends wt{constructor(t,e=t){super(_("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}E(Re,Le),i({Container:{link:C((function(t){return this.put(new Re).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Re,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),M(Re,"A");class Fe extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}i({Container:{mask:C((function(){return this.defs().put(new Fe)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Fe?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Fe,"Mask");class qe extends yt{constructor(t,e=t){super(_("stop",t),e)}update(t){return("number"==typeof t||t instanceof pt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new pt(t.offset)),this}}i({Gradient:{stop:function(t,e,n){return this.put(new qe).update(t,e,n)}}}),M(qe,"Stop");class Ve extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}i("Dom",{style(t,e){return this.put(new Ve).rule(t,e)},fontface(t,e,n){return this.put(new Ve).font(t,e,n)}}),M(Ve,"Style");class Xe extends je{constructor(t,e=t){super(_("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}i({Container:{textPath:C((function(t,e){return t instanceof je||(t=this.text(t)),t.path(e)}))},Text:{path:C((function(t,e=!0){const n=new Xe;let r;if(t instanceof fe||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:C((function(t){return t instanceof je||(t=(new je).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Xe.prototype.MorphArray=se,M(Xe,"TextPath");class Ye extends vt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:C((function(t,e){return this.put(new Ye).use(t,e)}))}}),M(Ye,"Use"),E([Ee,Ce,Rt,zt,Xt],s("viewbox")),E([Vt,ge,me,fe],s("marker")),E(je,s("Text")),E(fe,s("Path")),E(xt,s("Defs")),E([je,De],s("Tspan")),E([ye,Tt,Lt,Se],s("radius")),E(lt,s("EventTarget")),E(gt,s("Dom")),E(yt,s("Element")),E(vt,s("Shape")),E([wt,jt],s("Container")),E(Lt,s("Gradient")),E(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){de.push(...[].concat(t))}([pt,H,K,Q,ft,Ft,se,$]),E(de,{to(t){return(new ae).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var Ge=n(726),Ue=n(358);class He{constructor(t,e){this.svgDoc=t,this.elements=e,new MutationObserver((t=>{t.some((t=>t.removedNodes.length>0))&&(this.elements=this.elements.filter((t=>t.isIn(this.svgDoc))))})).observe(t,{childList:!0,subtree:!0})}}class $e{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new He(t,e)}get bases(){return this.elementsDrawing.elements}append(t){t.appendTo(this.svgDoc),this.bases.push(t)}add(t){let e=Ue.Nucleobase.create(t);return this.append(e),e}}var We=n(298);class Qe{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new He(t,e),new MutationObserver((()=>{this.bonds.forEach((t=>{t.base1.isIn(this.svgDoc)&&t.base2.isIn(this.svgDoc)||t.remove()}))})).observe(t,{childList:!0,subtree:!0})}get bonds(){return this.elementsDrawing.elements}set bonds(t){this.elementsDrawing.elements=t}}class Je{constructor(t,e){this.svgDoc=t,this.primaryBondDefaultValues={attributes:{stroke:"#808080","stroke-width":"1"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Qe(t,e)}get primaryBonds(){return this.bondsDrawing.bonds}set primaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.primaryBonds.push(t)}add(t,e){let n=We.StraightBond.between(t,e);return n.set(this.primaryBondDefaultValues),this.append(n),n}}class Ze{constructor(t,e){this.svgDoc=t,this.secondaryBondDefaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Qe(t,e)}get secondaryBonds(){return this.bondsDrawing.bonds}set secondaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.secondaryBonds.push(t)}add(t,e){let n=We.StraightBond.between(t,e);return n.set(this.secondaryBondDefaultValues),this.append(n),n}}class Ke{constructor(){this.domNode=(new Ee).node,this.domNode.setAttribute("viewBox","0 0 100 100"),this.domNode.setAttribute("width","100"),this.domNode.setAttribute("height","100"),this.basesDrawing=new $e(this.domNode,[]),this.primaryBondsDrawing=new Je(this.domNode,[]),this.secondaryBondsDrawing=new Ze(this.domNode,[])}get outerHTML(){return this.domNode.outerHTML}get innerHTML(){return this.domNode.innerHTML}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}get minX(){return this.domNode.viewBox.baseVal.x}set minX(t){let e=this.maxX-t,n=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${t} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(n*e).toString())}get maxX(){return this.minX+this.width}set maxX(t){let e=t-this.minX,n=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(n*e).toString())}get minY(){return this.domNode.viewBox.baseVal.y}set minY(t){let e=this.maxY-t,n=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${t} ${this.width} ${e}`),this.domNode.setAttribute("height",(n*e).toString())}get maxY(){return this.minY+this.height}set maxY(t){let e=t-this.minY,n=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${this.width} ${e}`),this.domNode.setAttribute("height",(n*e).toString())}setBoundaries({minX:t,maxX:e,minY:n,maxY:r}){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}get width(){return this.domNode.viewBox.baseVal.width}set width(t){this.maxX=this.minX+t}get height(){return this.domNode.viewBox.baseVal.height}set height(t){this.maxY=this.minY+t}get horizontalScaling(){let t=this.width;return this.domNode.width.baseVal.value/t}set horizontalScaling(t){let e=this.width;this.domNode.setAttribute("width",(t*e).toString())}get verticalScaling(){let t=this.height;return this.domNode.height.baseVal.value/t}set verticalScaling(t){let e=this.height;this.domNode.setAttribute("height",(t*e).toString())}setScaling(t){this.horizontalScaling=t,this.verticalScaling=t}get horizontalClientScaling(){return new Ge.HorizontalClientScaling(this.domNode).get()}get verticalClientScaling(){return new Ge.VerticalClientScaling(this.domNode).get()}get bases(){return this.basesDrawing.bases}appendBase(t){this.basesDrawing.append(t)}addBase(t){return this.basesDrawing.add(t)}get primaryBondDefaultValues(){return this.primaryBondsDrawing.primaryBondDefaultValues}set primaryBondDefaultValues(t){this.primaryBondsDrawing.primaryBondDefaultValues=t}get primaryBonds(){return this.primaryBondsDrawing.primaryBonds}set primaryBonds(t){this.primaryBondsDrawing.primaryBonds=[...t]}appendPrimaryBond(t){this.primaryBondsDrawing.append(t)}addPrimaryBond(t,e){return this.primaryBondsDrawing.add(t,e)}get secondaryBondDefaultValues(){return this.secondaryBondsDrawing.secondaryBondDefaultValues}set secondaryBondDefaultValues(t){this.secondaryBondsDrawing.secondaryBondDefaultValues=t}get secondaryBonds(){return this.secondaryBondsDrawing.secondaryBonds}set secondaryBonds(t){this.secondaryBondsDrawing.secondaryBonds=[...t]}appendSecondaryBond(t){this.secondaryBondsDrawing.append(t)}addSecondaryBond(t,e){return this.secondaryBondsDrawing.add(t,e)}get contentBBox(){return this.domNode.getBBox()}setPadding(t){let e=this.contentBBox;this.setBoundaries({minX:e.x-t,maxX:e.x+e.width+t,minY:e.y-t,maxY:e.y+e.height+t})}}var tn=n(127),en=n(661),nn=n(986);class rn{constructor(t){this.targetDrawing=t}draw(t,e){let n=[...t].map((t=>this.targetDrawing.addBase(t)));(0,tn.consecutivePairs)(n).forEach((t=>this.targetDrawing.addPrimaryBond(...t)));let r=[...(0,tn.parseDotBracket)(n,e)];r.forEach((t=>this.targetDrawing.addSecondaryBond(...t))),n.forEach((t=>t.bringToFront()));let i=1.87*(0,nn.mean)(n.map((t=>t.bbox.height)));(0,en.radialize)(n,r,{spacing:i,basePairSpacing:i/2,hairpinLoopSpacing:i/2})}}})(),r})(),t.exports=e()},925:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalScrollbar:()=>r,HorizontalScrollbarThumb:()=>n,Scrollbars:()=>o,VerticalScrollbar:()=>s,VerticalScrollbarThumb:()=>i});class n{constructor(t){this.targetElement=t}get leftX(){return this.targetElement.scrollLeft}set leftX(t){this.targetElement.scrollLeft=t}get length(){let t=this.targetElement.scrollLeft;this.targetElement.scrollLeft=this.targetElement.scrollWidth;let e=this.targetElement.scrollWidth-this.targetElement.scrollLeft;return this.targetElement.scrollLeft=t,e}get rightX(){return this.leftX+this.length}set rightX(t){this.targetElement.scrollLeft=t-this.length}get centerX(){return(this.leftX+this.rightX)/2}set centerX(t){this.targetElement.scrollLeft=t-this.length/2}}class r{constructor(t){this.targetElement=t,this.thumb=new n(t)}}class i{constructor(t){this.targetElement=t}get topY(){return this.targetElement.scrollTop}set topY(t){this.targetElement.scrollTop=t}get length(){let t=this.targetElement.scrollTop;this.targetElement.scrollTop=this.targetElement.scrollHeight;let e=this.targetElement.scrollHeight-this.targetElement.scrollTop;return this.targetElement.scrollTop=t,e}get bottomY(){return this.topY+this.length}set bottomY(t){this.targetElement.scrollTop=t-this.length}get centerY(){return this.targetElement.scrollTop+this.length/2}set centerY(t){this.targetElement.scrollTop=t-this.length/2}}class s{constructor(t){this.targetElement=t,this.thumb=new i(t)}}class o{constructor(t){this.targetElement=t}center(){this.targetElement.scrollLeft=this.targetElement.scrollWidth,this.targetElement.scrollTop=this.targetElement.scrollHeight;let t=this.targetElement.scrollWidth-this.targetElement.scrollLeft,e=this.targetElement.scrollHeight-this.targetElement.scrollTop;this.targetElement.scrollLeft=this.targetElement.scrollWidth/2-t/2,this.targetElement.scrollTop=this.targetElement.scrollHeight/2-e/2}}return e})(),t.exports=e()},106:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return t.map((t=>({v:t,priority:Math.random()}))).sort(((t,e)=>t.priority-e.priority)).map((({v:t})=>t))}function r(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}t.r(e),t.d(e,{DownloadableFile:()=>i,EventfulSet:()=>s,detectMac:()=>r,shuffled:()=>n});class i{constructor(t){this.textContent=t}downloadAs(t,e){let n=new File([this.textContent],t,{type:e.type}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=n.name,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)}}class s{constructor(){this.eventListeners={change:[]},this.underlyingSet=new Set}[Symbol.iterator](){return this.underlyingSet.values()}includes(t){return this.underlyingSet.has(t)}include(t){return this.includes(t)}addAll(t){let e=[...t];0!=e.length&&(e.every((t=>this.includes(t)))||(e.forEach((t=>this.underlyingSet.add(t))),this.callEventListeners("change")))}removeAll(t){let e=[...t];0!=e.length&&(e.every((t=>!this.includes(t)))||(e.forEach((t=>this.underlyingSet.delete(t))),this.callEventListeners("change")))}clear(){0!=this.underlyingSet.size&&(this.underlyingSet.clear(),this.callEventListeners("change"))}addEventListener(t,e){this.eventListeners[t].push(e)}callEventListeners(t){this.eventListeners[t].forEach((t=>t()))}removeEventListener(t,e){this.eventListeners[t]=this.eventListeners[t].filter((t=>t!==e))}}return e})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{RNAcanvas:()=>l});var t=n(662),e=n(925);class i{constructor(){this.domNode=document.createElement("div"),this.domNode.style.overflow="auto";let t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div");t.style.flexGrow="1",n.style.flexGrow="0",r.style.flexGrow="1",this.domNode.style.display="flex",this.domNode.style.flexDirection="column",this.domNode.append(t,n,r);let i=document.createElement("div"),s=document.createElement("div"),o=document.createElement("div");i.style.flexGrow="1",s.style.flexGrow="0",o.style.flexGrow="1",n.style.display="flex",n.style.flexDirection="row",n.append(i,s,o);let a=document.createElement("div");this.contentContainer=document.createElement("div");let h=document.createElement("div");a.style.flexGrow="1",this.contentContainer.style.flexGrow="0",h.style.flexGrow="1",s.style.display="flex",s.style.flexDirection="column",s.append(a,this.contentContainer,h),this.horizontalScrollbar=new e.HorizontalScrollbar(this.domNode),this.verticalScrollbar=new e.VerticalScrollbar(this.domNode),this.scrollbars=new e.Scrollbars(this.domNode)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}append(t){this.contentContainer.append(t)}get style(){return this.domNode.style}}class s{constructor(t,e,n){this.targetDrawing=t,this.horizontalScrollbar=e,this.verticalScrollbar=n}get centerPoint(){return{x:this.horizontalScrollbar.thumb.centerX/this.targetDrawing.horizontalScaling+this.targetDrawing.minX,y:this.verticalScrollbar.thumb.centerY/this.targetDrawing.verticalScaling+this.targetDrawing.minY}}set centerPoint(t){this.horizontalScrollbar.thumb.centerX=this.targetDrawing.horizontalScaling*(t.x-this.targetDrawing.minX),this.verticalScrollbar.thumb.centerY=this.targetDrawing.verticalScaling*(t.y-this.targetDrawing.minY)}fitToContent(){let t=this.targetDrawing.contentBBox;this.targetDrawing.setScaling(.9*Math.min(this.horizontalScrollbar.thumb.length/t.width,this.verticalScrollbar.thumb.length/t.height)),this.centerPoint={x:t.x+t.width/2,y:t.y+t.height/2}}}var o=n(106),a=n(524),h=n(460),u=n(124);class l{constructor(){this.selectedSVGElements=new o.EventfulSet,this.domNode=document.createElement("div"),this.boundingBox=document.createElement("div"),this.domNode.appendChild(this.boundingBox),this.boundingBox.style.width="100%",this.boundingBox.style.height="100%",this.boundingBox.style.overflow="auto",this.boundingBox.style.position="relative",this.drawingScrollContainer=new i,this.drawingScrollContainer.style.width="100%",this.drawingScrollContainer.style.height="100%",this.drawingScrollContainer.appendTo(this.boundingBox),this.stackedDrawingsContainer=document.createElement("div"),this.stackedDrawingsContainer.style.position="relative",this.drawingScrollContainer.append(this.stackedDrawingsContainer),this.drawing=new t.Drawing,this.drawing.domNode.style.userSelect="none",this.overlaidDrawing=new t.Drawing,this.overlaidDrawing.domNode.style.position="absolute",this.overlaidDrawing.domNode.style.top="0px",this.overlaidDrawing.domNode.style.left="0px",this.overlaidDrawing.domNode.style.pointerEvents="none",new MutationObserver((()=>{this.overlaidDrawing.setBoundaries(this.drawing),this.overlaidDrawing.horizontalScaling=this.drawing.horizontalScaling,this.overlaidDrawing.verticalScaling=this.drawing.verticalScaling})).observe(this.drawing.domNode,{attributes:!0}),this.stackedDrawingsContainer.append(this.drawing.domNode,this.overlaidDrawing.domNode),this.drawingView=new s(this.drawing,this.horizontalDrawingScrollbar,this.verticalDrawingScrollbar),this.selectedSVGElementHighlightings=new a.LiveSVGElementHighlightings(this.selectedSVGElements,this.drawing.domNode),this.selectedSVGElementHighlightings.appendTo(this.overlaidDrawing.domNode),this.clickSelectTool=new h.ClickSelectTool(this.drawing.domNode,this.selectedSVGElements),this.selectedBases=new u.SelectedBases(this.drawing,this.selectedSVGElements),this.consecutiveBasesSelectingTool=new u.ConsecutiveBasesSelectingTool(this.drawing,this.selectedBases),this.formsContainer=document.createElement("div"),this.boundingBox.appendChild(this.formsContainer),this.dotBracketDrawer=new t.DotBracketDrawer(this.drawing)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}get horizontalDrawingScrollbar(){return this.drawingScrollContainer.horizontalScrollbar}get verticalDrawingScrollbar(){return this.drawingScrollContainer.verticalScrollbar}get drawingScrollbars(){return this.drawingScrollContainer.scrollbars}drawDotBracket(t,e){this.dotBracketDrawer.draw(t,e)}openForm(t){t instanceof Node?this.formsContainer.appendChild(t):t.appendTo(this.formsContainer)}get style(){return this.domNode.style}}})(),r})()));