@rnacanvas/app-object 3.10.0 → 3.10.2

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=()=>(()=>{var t={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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>c,PositionPairs:()=>t,Stems:()=>h,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 r=e.flat(),n=t.findIndex((function(t){return r.includes(t)}));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]},t}(),i=r(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 r=e.flat().map((function(e){return t.indexOf(e)}));if((0,i.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(r)]},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 r=(new(e.bind.apply(e,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),n=t.indexOf(r);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(0,n)},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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)},t}(),u=r(369),h=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],r=(new(t.bind.apply(t,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Stems(e,r).get().map((function(t){return t.map((function(t){return[e[t[0]-1],e[t[1]-1]]}))}))},e}(),c=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],r=(new(t.bind.apply(t,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Linkers(e,r).get().map((function(t){return t.map((function(t){return e[t-1]}))}))},e}()})(),n})(),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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}return t.r(e),t.d(e,{average:()=>n,mean:()=>n,sum:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}r.r(n),r.d(n,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=r(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])}})(),n})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{CircularSegment:()=>a,Semicircle:()=>e});var t=r(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=r(872),s=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(n<=i)throw new Error("Arc length is too small.");if(n>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(n/i*Math.sin(s)-s)/(n/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 r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(n<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(n/i*Math.sin(Math.PI-s)-s)/(-n/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 r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function r(r,n){this.chord=r,this.moreProps=n;var i=n.arcLength,a=(0,t.distance)(r[0],r[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var u=a<.001&&i<.001,h=Math.PI*a/2,c=Math.abs(i-h)<.001;this.wrappedCircularSegment=u||c?new e(r):i<h?new s(r,{arcLength:i}):new o(r,{arcLength:i})}return Object.defineProperty(r.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),r}()})(),n})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>m,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function p(t,e){return d([t,e])}})(),n})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Centroid:()=>s,Direction:()=>d,MaxCenterX:()=>u,MaxCenterY:()=>c,MinCenterX:()=>a,MinCenterY:()=>h,NucleobaseMock:()=>t,circularize:()=>x,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>p,flipY:()=>m,linearize:()=>b,radialize:()=>I,rotate:()=>f,round:()=>S,shift:()=>e,stemmify:()=>v,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 r=t.getCenterPoint();t.setCenterPoint({x:r.x+e.x,y:r.y+e.y})}))}var i=r(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 r=this.get(),n=(0,i.displacement)(r,t);e(this.targetBases,n)}}var o=r(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}class c{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}var l=r(30);function f(t,e){if(0==t.length)return;let r=new s(t).get();t.forEach((t=>{let n=t.getCenterPoint(),s=(0,i.distance)(r,n),o=(0,l.direction)((0,i.displacement)(r,n));o+=e,t.setCenterPoint({x:r.x+s*Math.cos(o),y:r.y+s*Math.sin(o)})}))}class d{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,l.direction)((0,i.displacement)(t.getCenterPoint(),e.getCenterPoint()))}set(t){let e=t-this.get();f(this.targetBases,e)}}function p(t){let e=new s(t).get().y;t.forEach((t=>{let r=t.getCenterPoint(),n=r.y-e;t.setCenterPoint({x:r.x,y:e-n})}))}function m(t){let e=new s(t).get().x;t.forEach((t=>{let r=t.getCenterPoint(),n=r.x-e;t.setCenterPoint({x:e-n,y:r.y})}))}function g(t){if(0==t.length)return;let r=t[0],{x:n,y:s}=r.getCenterPoint(),o={x:n,y:s},a=new d(t).get();f(t,-a),p(t),f(t,a),e(t,(0,i.displacement)(r.getCenterPoint(),o))}function y(t){let e=new s(t),{x:r,y:n}=e.get(),i=r,o=n,a=new d(t).get();f(t,-a),m(t),f(t,a),e.set({x:i,y:o})}function b(t,e){let{spacing:r}=e;if(t.length<2)return;let n=new d(t),i=n.get(),o=new s(t),{x:a,y:u}=o.get(),h={x:a,y:u};t.forEach(((t,e)=>{t.setCenterPoint({x:e*r,y:0})})),n.set(i),o.set(h)}function w(t){if(t.length<3)return;let e=t[0],r=t[t.length-1],n=[e.getCenterPoint(),r.getCenterPoint()],s=(0,i.distance)(n[0],n[1]),o=(0,l.direction)((0,i.displacement)(n[0],n[1])),a=s/(t.length-1),u=a*Math.cos(o),h=a*Math.sin(o),{x:c,y:f}=n[0];t.forEach((t=>{t.setCenterPoint({x:c,y:f}),c+=u,f+=h}))}function v(t,r){let{basePairLength:n,basePairSpacing:o}=r;if(t.length<2)return;let a=Math.ceil(t.length/2),u=t.slice(0,a),h=t.slice(a),c=new s(t),{x:l,y:p}=c.get(),m={x:l,y:p},g=new d(t).get();b(u,{spacing:o}),b(h,{spacing:o}),new d(u).set(-Math.PI/2),new d(h).set(Math.PI/2);let y=t[0],w=t[t.length-1];e(u,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(h,(0,i.displacement)(w.getCenterPoint(),{x:n,y:0})),f(t,g),c.set(m)}function x(t,e){let{spacing:r,terminiGap:n}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),u=o,h=a,c=new d(t).get(),l=r*(t.length-1);l+=n,Math.abs(l)<1e-5&&(l=1e-5);let p=l/(2*Math.PI),m=Math.PI/2+2*Math.PI*(.5*n/l);t.forEach(((t,e)=>{let n=m+2*Math.PI*(e*r)/l;t.setCenterPoint({x:p*Math.cos(n),y:p*Math.sin(n)})})),f(t,c),i.set({x:u,y:h})}var _=r(173);function S(t,r){let{spacing:n}=r;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],u=(0,i.distance)(a[0],a[1]),h=n*(t.length-1);if(h-u<.001)return void w(t);if(u<.001){let{x:r,y:o}=s.getCenterPoint();return x(t,{spacing:n,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:r,y:o}))}let c=new _.CircularSegment(a,{arcLength:h}),f=c.parentCircleCenterPoint,d=c.parentCircleRadius,p=(0,l.direction)((0,i.displacement)(f,s.getCenterPoint())),m=c.arcAngle/(t.length-1);t.forEach((t=>{t.setCenterPoint({x:f.x+d*Math.cos(p),y:f.y+d*Math.sin(p)}),p+=m}))}var O=r(127),M=r(369);class P{static from(t){return{to:e=>({inclusive:()=>{let r=e-t+1;return Array.from({length:r},((e,r)=>t+r))}})}}}class N{static of(...t){let[e,r]=t,n=new O.PositionPairs(...t).get();n=(0,M.sorted)(n);let i=n.map((t=>t.map((t=>t-1)))),s=[],a=0;return e.forEach(((t,e)=>{let r=i.find((t=>t.includes(e)));r&&e==(0,o.min)(r)?(s.push(a),a+=1):r&&e==(0,o.max)(r)?(a-=1,s.push(a)):s.push(a)})),s}}class C{constructor(...t){let[e,r]=t;this.rawForm=t,this.mountainPlotTraversal=N.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(r.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 j{static correspondingTo(t){return{in:e=>t.map((t=>e.sequence.indexOf(t)))}}}class A{static composedOf(t){if(0==t.length)throw new Error("All stems must have at least one base-pair.");let r=t[0],n=t[t.length-1],s=t.map((t=>t[0])),o=t.map((t=>t[1])).reverse(),a=r[0],u=r[1],h=[...s,...o];return{[Symbol.iterator]:()=>t.values(),bottomBasePair:r,topBasePair:n,side5:s,side3:o,flat:()=>h,firstBase:a,lastBase:u,stemmify:()=>({with:t=>{let{basePairLength:r,basePairSpacing:n}=t,s=Object.assign({},a.getCenterPoint());v(h,{basePairLength:r,basePairSpacing:n}),e(h,(0,i.displacement)(a.getCenterPoint(),s))}})}}}class E{static in(t){return{[Symbol.iterator]:()=>new O.Stems(t.sequence,t.basePairs).get().map((t=>A.composedOf(t))).values()}}}class D{static composedOf(t){if(t.length<2)throw new Error("Linkers must have at least two bases.");let r=t[0],n=t[t.length-1],s=t.slice(1,-1);return{in:o=>{let a=o.sequence.indexOf(r),u=o.sequence.indexOf(n),h=P.from(a).to(u).inclusive(),c=!!o.indexPairs.find((t=>t.includes(a)&&t.includes(u))),l=h.every((t=>0==o.mountainPlotTraversal[t])),f=1==new Set(h.map((t=>o.mountainPlotTraversal[t]))).size&&!c;return{[Symbol.iterator]:()=>t.values(),indices:h,firstBase:r,lastBase:n,firstIndex:a,lastIndex:u,unpairedBases:{[Symbol.iterator]:()=>s.values(),stemmify:()=>({with:t=>{let{spacing:r}=t;if(s.length<3)return;let n=s[0],o=s[s.length-1],a=Object.assign({},n.getCenterPoint());v(s,{basePairLength:(0,i.distance)(n.getCenterPoint(),o.getCenterPoint()),basePairSpacing:r}),e(s,(0,i.displacement)(n.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:()=>c,isInOutermostLoop:()=>l,isBetweenSiblingStems:()=>f,round:()=>({with:e=>{let{spacing:r}=e;S(t,{spacing:r})}})}}}}}class T{static in(t){let e=new O.Linkers(t.sequence,t.basePairs).get().map((e=>D.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(r){return{in:n=>{let s=r.topBasePair,a=j.correspondingTo(s).in(n),u=(0,o.min)(a),h=n.sequence.filter(((t,e)=>e>(0,o.min)(a)&&e<(0,o.max)(a)&&n.mountainPlotTraversal[e]==n.mountainPlotTraversal[u]+1)),c=h.map((t=>n.sequence.indexOf(t))),l=h.filter((t=>n.pairedBases.has(t))),f=c.filter((t=>n.pairedIndices.has(t))),d=[s[0],...h,s[1]];return{[Symbol.iterator]:()=>d.values(),parentStructure:n,closingStem:r,closingBasePair:s,closingIndexPair:a,enclosedBases:h,enclosedIndices:c,enclosedPairedBases:l,enclosedPairedIndices:f,get platform(){if(0==f.length)throw new Error("This loop does not have a platform.");let r=(0,o.min)(f),u=(0,o.max)(f),h=n.sequence.filter(((t,e)=>e>=r&&e<=u&&c.includes(e)&&[e-1,e,e+1].some((t=>f.includes(t)))));return{[Symbol.iterator]:()=>h.values(),firstIndex:r,lastIndex:u,arch:()=>({with:n=>{let{spacing:c}=n,l=(0,o.max)([h.length-2,r-(0,o.min)(a)-1,(0,o.max)(a)-u-1,0]),f=P.from(1).to(l).inclusive().map((()=>new t({centerPoint:{x:0,y:0}}))),d=f.map((()=>new t({centerPoint:{x:0,y:0}}))),p=Object.assign({},s[0].getCenterPoint());x([s[0],...f,...h,...d,s[1]],{spacing:c,terminiGap:c}),e([...s,...h],(0,i.displacement)(s[0].getCenterPoint(),p))}})}}}}}}}class B{static of(t){let e=t.sequence.filter(((e,r)=>0==t.mountainPlotTraversal[r]));return{[Symbol.iterator]:()=>e.values()}}}function I(t,e,r){var n;let{spacing:i,basePairSpacing:o}=r,a=null!==(n=r.hairpinLoopSpacing)&&void 0!==n?n:i,u=new C(t,e);if(t.length<2)return;if(0==e.length)return void x(t,{spacing:i,terminiGap:2*i});let h=Object.assign({},new s(t).get()),c=new d(t).get(),l=E.in(u),f=T.in(u);x([...B.of(u)],{spacing:i,terminiGap:2*i});let p=[...l].map((t=>k.closedBy(t).in(u)));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}))),[...f.notBetweenSiblingStems].forEach((t=>t.round().with({spacing:i}))),[...f.thatAreHairpinLoops].forEach((t=>t.round().with({spacing:a}))),[...f.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 d(t).set(c),new s(t).set(h)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{ConsecutiveBasesSelectingTool:()=>t,DraggingTool:()=>s,SelectedBases:()=>e});class t{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 r=[...this.targetDrawing.bases],n=r.findIndex((e=>e.domNode===t.target));if(n<0)return;let i=r.findIndex((t=>t.domNode===e.target));if(i<0)return;try{let t=r[i];if(!this.selectedBases.include(t))return}catch(t){console.error(t)}let s=Math.min(i,n),o=Math.max(i,n);this.selectedBases.addAll(r.slice(s,o+1))}}class e{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)))}}var i=r(661);class s{constructor(t,e,r){this.targetDrawing=t,this.selectedElements=e,this.options=r,this.mouseIsDown=!1,this.dragged=!1,window.addEventListener("mousedown",(t=>this.handleMouseDown(t))),window.addEventListener("mousemove",(t=>this.handleMouseMove(t))),window.addEventListener("mouseup",(t=>this.handleMouseUp(t)))}handleMouseDown(t){this.lastMouseDown=t,this.mouseIsDown=!0,this.dragged=!1}handleMouseMove(t){var e;if(!this.mouseIsDown)return;if(!this.lastMouseDown)return;if(!(this.lastMouseDown.target instanceof SVGGraphicsElement))return;if(!this.selectedElements.svgElements.include(this.lastMouseDown.target))return;let r=t.movementX/this.targetDrawing.horizontalClientScaling,n=t.movementY/this.targetDrawing.verticalClientScaling;this.dragged||!(null===(e=this.options)||void 0===e?void 0:e.beforeDragging)||this.options.beforeDragging(),(0,i.shift)([...this.selectedElements.bases],{x:r,y:n}),this.dragged=!0}handleMouseUp(t){var e;this.mouseIsDown=!1,!this.dragged||!(null===(e=this.options)||void 0===e?void 0:e.afterDragging)||this.options.afterDragging(),this.dragged=!1}}})(),n})(),t.exports=e()},524:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>r,LiveSVGElementHighlightings:()=>n});class r{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 n{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 r;t.appendTo(this.domNode),this.boxTraces.push(t)})),t.forEach(((t,e)=>{try{let r=this.boxTraces[e];r.trace(t.getBBox()),r.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=()=>(()=>{var t={645:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Box:()=>e});var t=r(986);class e{static bounding(r){let n=r.map((t=>e.matching(t))),i=(0,t.min)(n.map((t=>t.left))),s=(0,t.min)(n.map((t=>t.top))),o=(0,t.max)(n.map((t=>t.right)))-i,a=(0,t.max)(n.map((t=>t.bottom)))-s;return new e(i,s,o,a)}static matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get minX(){return this.x}get minY(){return this.y}get maxX(){return this.minX+this.width}get maxY(){return this.minY+this.height}get top(){return this.minY}get right(){return this.maxX}get bottom(){return this.maxY}get left(){return this.minX}isBoundedBy(t){let r=e.matching(t);return this.minX>=r.minX&&this.minY>=r.minY&&this.maxX<=r.maxX&&this.maxY<=r.maxY}padded(t,r){return"number"!=typeof r&&(r=t),new e(this.x-t,this.y-r,this.width+2*t,this.height+2*r)}}})(),n})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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,{CoordinateSystem:()=>h,HorizontalClientScaling:()=>l,Scaling:()=>c,VerticalClientScaling:()=>f,assignUUID:()=>u,bringToFront:()=>d,sendToBack:()=>p});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const i=new Uint8Array(16);function s(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+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 u(t){t.id="uuid-"+a()}var h=function(){function t(t){this.targetSVGDoc=t}return Object.defineProperty(t.prototype,"width",{get:function(){return this.targetSVGDoc.viewBox.baseVal.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.targetSVGDoc.viewBox.baseVal.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minX",{get:function(){return this.targetSVGDoc.viewBox.baseVal.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.minX+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.targetSVGDoc.viewBox.baseVal.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.minY+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalScaling",{get:function(){return this.targetSVGDoc.width.baseVal.value/this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalScaling",{get:function(){return this.targetSVGDoc.height.baseVal.value/this.height},enumerable:!1,configurable:!0}),t.prototype.setScaling=function(t){this.targetSVGDoc.setAttribute("width","".concat(t*this.width)),this.targetSVGDoc.setAttribute("height","".concat(t*this.height))},Object.defineProperty(t.prototype,"clientWidth",{get:function(){return this.targetSVGDoc.getBoundingClientRect().width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientHeight",{get:function(){return this.targetSVGDoc.getBoundingClientRect().height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalClientScaling",{get:function(){return this.clientWidth/this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalClientScaling",{get:function(){return this.clientHeight/this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minClientX",{get:function(){return this.targetSVGDoc.getBoundingClientRect().x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minClientY",{get:function(){return this.targetSVGDoc.getBoundingClientRect().y},enumerable:!1,configurable:!0}),t.prototype.fromClientX=function(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling},t.prototype.fromClientY=function(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling},t.prototype.fromClientCoordinates=function(t,e){return[this.fromClientX(t),this.fromClientY(e)]},t.prototype.fromClientPoint=function(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}},t.prototype.toClientX=function(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)},t.prototype.toClientY=function(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)},t.prototype.toClientCoordinates=function(t,e){return[this.toClientX(t),this.toClientY(e)]},t.prototype.toClientPoint=function(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}},t}(),c=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}(),f=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 p(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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{ClickSelectTool:()=>t,PinchToScaleFeature:()=>u,SelectingRect:()=>o});class t{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()}}var e=r(726),i=r(645);function s(t){return t instanceof SVGGraphicsElement}class o{constructor(t,r){this.targetSVGDoc=t,this.selectedSVGElements=r,this.defaultLineThickness=.625,this.lastMouseDownX=0,this.lastMouseDownY=0,this.mouseIsDown=!1,this.isDrawn=!1,this.targetSVGDocCoordinateSystem=new e.CoordinateSystem(t),this.domNode=document.createElementNS("http://www.w3.org/2000/svg","path"),this.domNode.setAttribute("stroke","blue"),this.refreshLineThickness(),this.domNode.setAttribute("fill","blue"),this.domNode.setAttribute("fill-opacity","0.1"),new MutationObserver((()=>this.refreshLineThickness())).observe(t,{attributes:!0,attributeFilter:["viewBox","width","height"]}),this.domNode.style.pointerEvents="none",this.domNode.style.visibility="hidden",window.addEventListener("mousedown",(t=>this.handleMouseDown(t))),window.addEventListener("mousemove",(t=>this.handleMouseMove(t))),window.addEventListener("mouseup",(t=>this.handleMouseUp(t)))}refreshLineThickness(){this.domNode.setAttribute("stroke-width",""+this.defaultLineThickness/this.targetSVGDocCoordinateSystem.horizontalScaling)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}handleMouseDown(t){this.lastMouseDown=t,this.lastMouseDownX=this.targetSVGDocCoordinateSystem.fromClientX(t.clientX),this.lastMouseDownY=this.targetSVGDocCoordinateSystem.fromClientY(t.clientY),this.mouseIsDown=!0}handleMouseMove(t){if(!this.mouseIsDown)return;if(!this.lastMouseDown)return;if(this.lastMouseDown.target!==this.targetSVGDoc)return;let e=this.targetSVGDocCoordinateSystem.fromClientX(t.clientX),r=this.targetSVGDocCoordinateSystem.fromClientY(t.clientY),n=`M ${this.lastMouseDownX} ${this.lastMouseDownY} H ${e} V ${r} H ${this.lastMouseDownX} z`;this.domNode.setAttribute("d",n),this.domNode.style.visibility="visible",this.isDrawn=!0}handleMouseUp(t){var e;this.mouseIsDown=!1,this.domNode.style.visibility="hidden";let r=this.isDrawn;if(this.isDrawn=!1,!r)return;let n=this.targetSVGDocCoordinateSystem.fromClientX(t.clientX),o=this.targetSVGDocCoordinateSystem.fromClientY(t.clientY),a=i.Box.bounding([{x:this.lastMouseDownX,y:this.lastMouseDownY,width:0,height:0},{x:n,y:o,width:0,height:0}]),u=[...this.targetSVGDoc.children].filter(s).filter((t=>i.Box.matching(t.getBBox()).isBoundedBy(a)));(null===(e=this.lastMouseDown)||void 0===e?void 0:e.shiftKey)||this.selectedSVGElements.clear(),this.selectedSVGElements.addAll(u)}}var a=r(986);class u{constructor(t,r,n){this.targetSVGDoc=t,this.targetSVGDocCoordinateSystem=new e.CoordinateSystem(t),this.horizontalScrollbar=r,this.verticalScrollbar=n,window.addEventListener("wheel",(t=>this.handleWheel(t)),{passive:!1})}handleWheel(t){if(!t.ctrlKey)return;if(!(t.target instanceof Node))return;if(!this.targetSVGDoc.contains(t.target))return;t.preventDefault();let e=1-(0,a.clamp)(t.deltaY,-25,25)/150,r=this.targetSVGDocCoordinateSystem.horizontalScaling,n=e*r;n=Number.isFinite(n)?n:1,n=(0,a.clamp)(n,.1,500),e=n/r;let i=e*this.horizontalScrollbar.thumb.centerX,s=e*this.verticalScrollbar.thumb.centerY;this.targetSVGDocCoordinateSystem.setScaling(n),this.horizontalScrollbar.thumb.centerX=i,this.verticalScrollbar.thumb.centerY=s}}})(),n})(),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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>c,PositionPairs:()=>t,Stems:()=>h,TrailingDanglingBases:()=>a,consecutivePairs:()=>f,parseDotBracket:()=>l});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 r=e.flat(),n=t.findIndex((t=>r.includes(t)));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var i=r(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 r=e.flat().map((e=>t.indexOf(e)));if((0,i.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(r)]}}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 r=new e(...this.targetStructure).get(),n=t.indexOf(r);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(0,n)}}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(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)}}var u=r(369);class h{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],r=new t(...this.targetStructure).get();return new u.Stems(e,r).get().map((t=>t.map((t=>[e[t[0]-1],e[t[1]-1]]))))}}class c{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],r=new t(...this.targetStructure).get();return new u.Linkers(e,r).get().map((t=>t.map((t=>e[t-1]))))}}function l(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,u.parseDotBracket)(e)].map((e=>{let r=e[0],n=e[1];return[t[r-1],t[n-1]]}))}function f(t){return t.length<2?[]:t.slice(0,-1).map(((e,r)=>[t[r],t[r+1]]))}})(),n})(),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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>c,PositionPairs:()=>t,Stems:()=>h,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 r=e.flat(),n=t.findIndex((function(t){return r.includes(t)}));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]},t}(),i=r(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 r=e.flat().map((function(e){return t.indexOf(e)}));if((0,i.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(r)]},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 r=(new(e.bind.apply(e,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),n=t.indexOf(r);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(0,n)},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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)},t}(),u=r(369),h=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],r=(new(t.bind.apply(t,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Stems(e,r).get().map((function(t){return t.map((function(t){return[e[t[0]-1],e[t[1]-1]]}))}))},e}(),c=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],r=(new(t.bind.apply(t,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Linkers(e,r).get().map((function(t){return t.map((function(t){return e[t-1]}))}))},e}()})(),n})(),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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}return t.r(e),t.d(e,{average:()=>n,mean:()=>n,sum:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}r.r(n),r.d(n,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=r(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])}})(),n})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{CircularSegment:()=>a,Semicircle:()=>e});var t=r(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=r(872),s=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(n<=i)throw new Error("Arc length is too small.");if(n>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(n/i*Math.sin(s)-s)/(n/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 r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(n<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(n/i*Math.sin(Math.PI-s)-s)/(-n/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 r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function r(r,n){this.chord=r,this.moreProps=n;var i=n.arcLength,a=(0,t.distance)(r[0],r[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var u=a<.001&&i<.001,h=Math.PI*a/2,c=Math.abs(i-h)<.001;this.wrappedCircularSegment=u||c?new e(r):i<h?new s(r,{arcLength:i}):new o(r,{arcLength:i})}return Object.defineProperty(r.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),r}()})(),n})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>m,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function p(t,e){return d([t,e])}})(),n})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Centroid:()=>s,Direction:()=>d,MaxCenterX:()=>u,MaxCenterY:()=>c,MinCenterX:()=>a,MinCenterY:()=>h,NucleobaseMock:()=>t,circularize:()=>x,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>p,flipY:()=>m,linearize:()=>b,radialize:()=>I,rotate:()=>f,round:()=>S,shift:()=>e,stemmify:()=>v,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 r=t.getCenterPoint();t.setCenterPoint({x:r.x+e.x,y:r.y+e.y})}))}var i=r(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 r=this.get(),n=(0,i.displacement)(r,t);e(this.targetBases,n)}}var o=r(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}class c{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}var l=r(30);function f(t,e){if(0==t.length)return;let r=new s(t).get();t.forEach((t=>{let n=t.getCenterPoint(),s=(0,i.distance)(r,n),o=(0,l.direction)((0,i.displacement)(r,n));o+=e,t.setCenterPoint({x:r.x+s*Math.cos(o),y:r.y+s*Math.sin(o)})}))}class d{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,l.direction)((0,i.displacement)(t.getCenterPoint(),e.getCenterPoint()))}set(t){let e=t-this.get();f(this.targetBases,e)}}function p(t){let e=new s(t).get().y;t.forEach((t=>{let r=t.getCenterPoint(),n=r.y-e;t.setCenterPoint({x:r.x,y:e-n})}))}function m(t){let e=new s(t).get().x;t.forEach((t=>{let r=t.getCenterPoint(),n=r.x-e;t.setCenterPoint({x:e-n,y:r.y})}))}function g(t){if(0==t.length)return;let r=t[0],{x:n,y:s}=r.getCenterPoint(),o={x:n,y:s},a=new d(t).get();f(t,-a),p(t),f(t,a),e(t,(0,i.displacement)(r.getCenterPoint(),o))}function y(t){let e=new s(t),{x:r,y:n}=e.get(),i=r,o=n,a=new d(t).get();f(t,-a),m(t),f(t,a),e.set({x:i,y:o})}function b(t,e){let{spacing:r}=e;if(t.length<2)return;let n=new d(t),i=n.get(),o=new s(t),{x:a,y:u}=o.get(),h={x:a,y:u};t.forEach(((t,e)=>{t.setCenterPoint({x:e*r,y:0})})),n.set(i),o.set(h)}function w(t){if(t.length<3)return;let e=t[0],r=t[t.length-1],n=[e.getCenterPoint(),r.getCenterPoint()],s=(0,i.distance)(n[0],n[1]),o=(0,l.direction)((0,i.displacement)(n[0],n[1])),a=s/(t.length-1),u=a*Math.cos(o),h=a*Math.sin(o),{x:c,y:f}=n[0];t.forEach((t=>{t.setCenterPoint({x:c,y:f}),c+=u,f+=h}))}function v(t,r){let{basePairLength:n,basePairSpacing:o}=r;if(t.length<2)return;let a=Math.ceil(t.length/2),u=t.slice(0,a),h=t.slice(a),c=new s(t),{x:l,y:p}=c.get(),m={x:l,y:p},g=new d(t).get();b(u,{spacing:o}),b(h,{spacing:o}),new d(u).set(-Math.PI/2),new d(h).set(Math.PI/2);let y=t[0],w=t[t.length-1];e(u,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(h,(0,i.displacement)(w.getCenterPoint(),{x:n,y:0})),f(t,g),c.set(m)}function x(t,e){let{spacing:r,terminiGap:n}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),u=o,h=a,c=new d(t).get(),l=r*(t.length-1);l+=n,Math.abs(l)<1e-5&&(l=1e-5);let p=l/(2*Math.PI),m=Math.PI/2+2*Math.PI*(.5*n/l);t.forEach(((t,e)=>{let n=m+2*Math.PI*(e*r)/l;t.setCenterPoint({x:p*Math.cos(n),y:p*Math.sin(n)})})),f(t,c),i.set({x:u,y:h})}var _=r(173);function S(t,r){let{spacing:n}=r;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],u=(0,i.distance)(a[0],a[1]),h=n*(t.length-1);if(h-u<.001)return void w(t);if(u<.001){let{x:r,y:o}=s.getCenterPoint();return x(t,{spacing:n,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:r,y:o}))}let c=new _.CircularSegment(a,{arcLength:h}),f=c.parentCircleCenterPoint,d=c.parentCircleRadius,p=(0,l.direction)((0,i.displacement)(f,s.getCenterPoint())),m=c.arcAngle/(t.length-1);t.forEach((t=>{t.setCenterPoint({x:f.x+d*Math.cos(p),y:f.y+d*Math.sin(p)}),p+=m}))}var O=r(127),M=r(369);class P{static from(t){return{to:e=>({inclusive:()=>{let r=e-t+1;return Array.from({length:r},((e,r)=>t+r))}})}}}class N{static of(...t){let[e,r]=t,n=new O.PositionPairs(...t).get();n=(0,M.sorted)(n);let i=n.map((t=>t.map((t=>t-1)))),s=[],a=0;return e.forEach(((t,e)=>{let r=i.find((t=>t.includes(e)));r&&e==(0,o.min)(r)?(s.push(a),a+=1):r&&e==(0,o.max)(r)?(a-=1,s.push(a)):s.push(a)})),s}}class C{constructor(...t){let[e,r]=t;this.rawForm=t,this.mountainPlotTraversal=N.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(r.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 j{static correspondingTo(t){return{in:e=>t.map((t=>e.sequence.indexOf(t)))}}}class A{static composedOf(t){if(0==t.length)throw new Error("All stems must have at least one base-pair.");let r=t[0],n=t[t.length-1],s=t.map((t=>t[0])),o=t.map((t=>t[1])).reverse(),a=r[0],u=r[1],h=[...s,...o];return{[Symbol.iterator]:()=>t.values(),bottomBasePair:r,topBasePair:n,side5:s,side3:o,flat:()=>h,firstBase:a,lastBase:u,stemmify:()=>({with:t=>{let{basePairLength:r,basePairSpacing:n}=t,s=Object.assign({},a.getCenterPoint());v(h,{basePairLength:r,basePairSpacing:n}),e(h,(0,i.displacement)(a.getCenterPoint(),s))}})}}}class E{static in(t){return{[Symbol.iterator]:()=>new O.Stems(t.sequence,t.basePairs).get().map((t=>A.composedOf(t))).values()}}}class D{static composedOf(t){if(t.length<2)throw new Error("Linkers must have at least two bases.");let r=t[0],n=t[t.length-1],s=t.slice(1,-1);return{in:o=>{let a=o.sequence.indexOf(r),u=o.sequence.indexOf(n),h=P.from(a).to(u).inclusive(),c=!!o.indexPairs.find((t=>t.includes(a)&&t.includes(u))),l=h.every((t=>0==o.mountainPlotTraversal[t])),f=1==new Set(h.map((t=>o.mountainPlotTraversal[t]))).size&&!c;return{[Symbol.iterator]:()=>t.values(),indices:h,firstBase:r,lastBase:n,firstIndex:a,lastIndex:u,unpairedBases:{[Symbol.iterator]:()=>s.values(),stemmify:()=>({with:t=>{let{spacing:r}=t;if(s.length<3)return;let n=s[0],o=s[s.length-1],a=Object.assign({},n.getCenterPoint());v(s,{basePairLength:(0,i.distance)(n.getCenterPoint(),o.getCenterPoint()),basePairSpacing:r}),e(s,(0,i.displacement)(n.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:()=>c,isInOutermostLoop:()=>l,isBetweenSiblingStems:()=>f,round:()=>({with:e=>{let{spacing:r}=e;S(t,{spacing:r})}})}}}}}class T{static in(t){let e=new O.Linkers(t.sequence,t.basePairs).get().map((e=>D.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(r){return{in:n=>{let s=r.topBasePair,a=j.correspondingTo(s).in(n),u=(0,o.min)(a),h=n.sequence.filter(((t,e)=>e>(0,o.min)(a)&&e<(0,o.max)(a)&&n.mountainPlotTraversal[e]==n.mountainPlotTraversal[u]+1)),c=h.map((t=>n.sequence.indexOf(t))),l=h.filter((t=>n.pairedBases.has(t))),f=c.filter((t=>n.pairedIndices.has(t))),d=[s[0],...h,s[1]];return{[Symbol.iterator]:()=>d.values(),parentStructure:n,closingStem:r,closingBasePair:s,closingIndexPair:a,enclosedBases:h,enclosedIndices:c,enclosedPairedBases:l,enclosedPairedIndices:f,get platform(){if(0==f.length)throw new Error("This loop does not have a platform.");let r=(0,o.min)(f),u=(0,o.max)(f),h=n.sequence.filter(((t,e)=>e>=r&&e<=u&&c.includes(e)&&[e-1,e,e+1].some((t=>f.includes(t)))));return{[Symbol.iterator]:()=>h.values(),firstIndex:r,lastIndex:u,arch:()=>({with:n=>{let{spacing:c}=n,l=(0,o.max)([h.length-2,r-(0,o.min)(a)-1,(0,o.max)(a)-u-1,0]),f=P.from(1).to(l).inclusive().map((()=>new t({centerPoint:{x:0,y:0}}))),d=f.map((()=>new t({centerPoint:{x:0,y:0}}))),p=Object.assign({},s[0].getCenterPoint());x([s[0],...f,...h,...d,s[1]],{spacing:c,terminiGap:c}),e([...s,...h],(0,i.displacement)(s[0].getCenterPoint(),p))}})}}}}}}}class B{static of(t){let e=t.sequence.filter(((e,r)=>0==t.mountainPlotTraversal[r]));return{[Symbol.iterator]:()=>e.values()}}}function I(t,e,r){var n;let{spacing:i,basePairSpacing:o}=r,a=null!==(n=r.hairpinLoopSpacing)&&void 0!==n?n:i,u=new C(t,e);if(t.length<2)return;if(0==e.length)return void x(t,{spacing:i,terminiGap:2*i});let h=Object.assign({},new s(t).get()),c=new d(t).get(),l=E.in(u),f=T.in(u);x([...B.of(u)],{spacing:i,terminiGap:2*i});let p=[...l].map((t=>k.closedBy(t).in(u)));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}))),[...f.notBetweenSiblingStems].forEach((t=>t.round().with({spacing:i}))),[...f.thatAreHairpinLoops].forEach((t=>t.round().with({spacing:a}))),[...f.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 d(t).set(c),new s(t).set(h)}})(),n})(),t.exports=e()},358:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>c,Scaling:()=>h,VerticalClientScaling:()=>l,assignUUID:()=>u,bringToFront:()=>f,sendToBack:()=>d});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const i=new Uint8Array(16);function s(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+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 u(t){t.id="uuid-"+a()}var h=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}(),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.width/e.width},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.height/e.height},t}();function f(t){var e=t.parentNode;e&&e.appendChild(t)}function d(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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Nucleobase:()=>He});const t={},e=[];function i(e,r){if(Array.isArray(e))for(const t of e)i(t,r);else if("object"!=typeof e)o(Object.getOwnPropertyNames(r)),t[e]=Object.assign(t[e]||{},r);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 r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function u(t){return t%360*Math.PI/180}function h(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function f(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,i]}const d="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 v(t,e=d){return g.document.createElementNS(e,t)}function x(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 r=e?g.document.createElement("div"):v("svg");return r.innerHTML=t,t=O(r.firstChild),r.removeChild(r.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:v(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=c(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,r=!1){return b[e]=t,r&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let P=1e3;function N(t){return"Svgjs"+c(t)+P++}function C(t){for(let e=t.children.length-1;e>=0;e--)C(t.children[e]);return t.id?(t.id=N(t.nodeName),t):t}function j(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function A(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}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=x(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=x(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=x(t)).before(this),this},insertAfter:function(t){return(t=x(t)).after(this),this}});const E=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,D=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,T=/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+)?$/,V=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,F=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,q=/[\s,]+/,G=/[MLHVCSQTAZ]/i;function X(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Y(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function U(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(q)},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 r={};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*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=h(e);r[e]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[h(t)];if("object"==typeof t)for(const e in t)this.node.style[h(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[h(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,r){if(null==t)return this.data(a(function(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)e(t[r])&&i.push(t[r]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);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===r||"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,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new H(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=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,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new H(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new H(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new H(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new H(t,e,r,"lab")}if("grey"===t){const t=255*n();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:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new H(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=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 n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,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 r=function(t,e){const r=Y(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Y(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Y(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Y(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Y(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Y(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 r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[r,n,i]=T.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_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),[,r,n,i]=D.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:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="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:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new H(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*U(i,n,t+1/3),o=255*U(i,n,t),a=255*U(i,n,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(X);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new H(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const r=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==r.x?0:r.x,this.y=null==r.y?0:r.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:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function W(t,e,r){return Math.abs(e-t)<(r||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.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:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,oy:f,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,r){const n=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,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new Q(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/u,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*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(q).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,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,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,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=u(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:c,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=c*n-l*i+r*i-e*n+e,this.f=l*n+c*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=u(t),e=u(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:c,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+c*i,this.d=c+h*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}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:r,y:n}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new $(r,n).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=x().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(q).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),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new K(e,r,n,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,r=-1/0,n=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),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new K(e,n,r-e,i-n)}}function tt(t,e,r){let n;try{if(n=e(t.node),Z(n)&&(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){n=r(t)}var i;return n}i({viewbox:{viewbox(t,e,r,n){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)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=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new $(r/2/s+i.x,n/2/o+i.y);const h=new K(i).transform(new Q({scale:u,origin:e}));return this.viewbox(h)}}}),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)}}j([et],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const rt=["toArray","constructor","each"];function nt(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)=>(rt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),j([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 ut(t,e,r,n,i){const s=r.bind(n||t),o=x(t),a=ot(o),u=at(o);e=Array.isArray(e)?e:e.split(q),r._svgjsListenerId||(r._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function ht(t,e,r,n){const i=x(t),s=ot(i),o=at(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])ht(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ht(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ht(o,[e,u].join("."));delete s[e]}}else{for(t in s)ht(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class ct extends y{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return ht(this,t,e,r),this}on(t,e,r,n){return ut(this,t,e,r,n),this}removeEventListener(){}}function lt(){}M(ct,"EventTarget");const ft={"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 dt 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(q).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(E))&&(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 ct{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=x(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 x(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 r=this.node.cloneNode(t);return e&&(r=C(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new gt(v(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=N(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,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.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=x(t),this.add(t,e),t}putIn(t,e){return x(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=x(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,d)}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 r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=S(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=v("wrapper",r),i=g.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}j(gt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=V.test(r.nodeValue)?parseFloat(r.nodeValue):r.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))?ft[t]:V.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,r)=>r(t,e,this)),e))?e=new pt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new dt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return nt(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=x(t));const r=new et;let n=this;for(;(n=n.parent())&&n.node!==g.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?x(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 r=l(this,t,e);return this.width(new pt(r.width)).height(new pt(r.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)}}j(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),r=e.node.getBBox();return e.remove(),r}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`)})),r=new K(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.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 r;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(r=bt[t].length-1;r>=0;r--)null!=e[bt[t][r]]&&this.attr(bt.prefix(t,bt[t][r]),e[bt[t][r]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!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(q).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 r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),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:f(t,this)});const r=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});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(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class vt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(vt,"Defs");class xt 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 Pt(t){return this.attr("cx",t)}function Nt(t){return this.attr("cy",t)}function Ct(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function jt(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(xt,"Shape");var At={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt};class Et extends xt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const r=l(this,t,e);return this.rx(new pt(r.width).divide(2)).ry(new pt(r.height).divide(2))}}j(Et,At),i("Container",{ellipse:A((function(t=0,e=t){return this.put(new Et).size(t,e).move(0,0)}))}),M(Et,"Ellipse");class Dt extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(v("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Tt(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(Dt,"Fragment");var Bt,It={__proto__:null,from:Tt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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()+")"}}j(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:A((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,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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:A((function(t,e,r){return this.put(new zt).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends xt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const r=new g.window.Image;return ut(r,"load",(function(t){const n=this.parent(zt);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof zt&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(r,"load error",(function(){ht(r)})),this.attr("href",r.src=t,m)}}Bt=function(t,e,r){return"fill"!==t&&"stroke"!==t||F.test(e)&&(e=r.root().defs().image(e)),e instanceof Rt&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:A((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Vt extends dt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new K(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.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,r=this.length;e<r;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[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}var Ft={__proto__:null,MorphArray:Vt,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 qt extends xt{constructor(t,e=t){super(_("line",t),e)}array(){return new Vt([[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,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new Vt(t).toLine(),this.attr(t))}size(t,e){const r=l(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}j(qt,Ft),i({Container:{line:A((function(...t){return qt.prototype.plot.apply(this.put(new qt),null!=t[0]?t:[0,0,0,0])}))}}),M(qt,"Line");class Gt 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 Xt(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:A((function(t,e,r){return this.put(new Gt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Gt?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),M(Gt,"Marker");const Yt={"-":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,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Yt[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}j(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:Xt("_duration",Wt),overshoot:Xt("_overshoot",Wt)}),j(class extends $t{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Xt("_windup"),p:Xt("P"),i:Xt("I"),d:Xt("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,r){return e.x=r.x=t[0],e.y=r.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,r){return e.x=r.x,e.y=r.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,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return Jt[t](e,r,n)}}(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 r=G.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}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)&&re(t)}function re(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 ne(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends dt{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!te(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(G.test(n)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");re(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||ne(i)){i.inNumber=!0,i.number=n,ee(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&re(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:q.test(t)?G.test(t)?se:dt:E.test(t)?pt:ue:fe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?dt:"object"===e?le:ue};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===le&&(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 ue{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 he{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,he.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}he.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const ce=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class le{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===H&&t[r+7]!==e[r+7]){const e=t[r+7],n=new H(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=oe(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(ce),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const fe=[ue,he,le];class de extends xt{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 r=l(this,t,e);return this.attr("d",this.array().size(r.width,r.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)}}de.prototype.MorphArray=se,i({Container:{path:A((function(t){return this.put(new de).plot(t||new se)}))}}),M(de,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new Vt(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 Vt(t))},size:function(t,e){const r=l(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class me extends xt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:A((function(t){return this.put(new me).plot(t||new Vt)}))}}),j(me,Ft),j(me,pe),M(me,"Polygon");class ge extends xt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:A((function(t){return this.put(new ge).plot(t||new Vt)}))}}),j(ge,Ft),j(ge,pe),M(ge,"Polyline");class ye extends xt{constructor(t,e=t){super(_("rect",t),e)}}j(ye,{rx:_t,ry:St}),i({Container:{rect:A((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 r=we.timer().now()+e,n=we.timeouts.push({run:t,time:r});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),n},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 r=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==r););let n=null;const i=we.frames.last();for(;n!==i&&(n=we.frames.shift());)n.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}},ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},xe=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends ct{constructor(t=xe){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 r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+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 r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,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],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.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 ct{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,r){let n=1,i=!1,s=0;return e=e||0,r=r||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}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,r){const n=Se.sanitise(t,e,r),i=new Se(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.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,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||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),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=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*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?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,r,n){return this._queue.push({initialiser:t||lt,runner:e||lt,retarget:r,isTransform:n,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,r){if(t instanceof _e||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),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,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.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 r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){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,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}j([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Pe=t=>t.transforms;function Ne(){const t=this._transformationRunners.runners.map(Pe).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ce{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 r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,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 r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--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,r){const n=Se.sanitise(t,e,r),i=this.timeline();return new Se(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.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(Pe).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Ne.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ce).add(new Oe(new Q(this))))}}}),j(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ae(this._stepper).to(n),s=Object.keys(n);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 r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new le(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ae(this._stepper).to(new pt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Q.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ae(this._stepper).type(r?he:Q);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||f(t,o),h=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new $(s).transform(o._currentTransform(this));let d=new Q({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(d);const m=i.at(c);return u=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=f(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 r=new ae(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new pt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ae(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),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 r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);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,r,n){return this._queueObject("viewbox",new K(t,e,r,n))},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)}}),j(Se,{rx:_t,ry:St,from:Tt,to:kt}),M(Se,"Runner");class je extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new vt):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:d,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:A((function(){return this.put(new je)}))}}),M(je,"Svg",!0);class Ae extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:A((function(){return this.put(new Ae)}))}}),M(Ae,"Symbol");var Ee={__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,r=this.bbox()){return this.x(t,r).y(e,r)},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,r=this.bbox()){return this.cx(t,r).cy(e,r)},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 De extends xt{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 r=this.dom.leading;this.each((function(n){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?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 r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"!==e[n].nodeName?(n!==r&&3!==e[n].nodeType&&!0===S(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent):0===n&&(r=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}j(De,Ee),i({Container:{text:A((function(t=""){return this.put(new De).text(t)})),plain:A((function(t=""){return this.put(new De).plain(t)}))}}),M(De,"Text");class Te extends xt{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 De))return this;const e=t.index(this),r=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new pt(r);return this.dy(e?n: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)}}j(Te,Ee),i({Tspan:{tspan:A((function(t=""){const e=new Te;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(Te,"Tspan");class ke extends xt{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))}}j(ke,{x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt}),i({Container:{circle:A((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 nt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:A((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:A((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(((r,n)=>{let i;try{i=r.bbox()}catch(t){return}const s=new Q(r),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);r.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,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=l(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new $(r).transform(new Q(t).inverse());t.scale(i,s,n.x,n.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)}}j(ze,Le),i({Container:{group:A((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)}}j(Re,Le),i({Container:{link:A((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 r=e.index(t);return e.add(this,r),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 Ve extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return nt("svg [mask*="+this.id()+"]")}}i({Container:{mask:A((function(){return this.defs().put(new Ve)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ve?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Ve,"Mask");class Fe 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,r){return this.put(new Fe).update(t,e,r)}}}),M(Fe,"Stop");class qe extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}i("Dom",{style(t,e){return this.put(new qe).rule(t,e)},fontface(t,e,r){return this.put(new qe).font(t,e,r)}}),M(qe,"Style");class Ge extends De{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 r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}i({Container:{textPath:A((function(t,e){return t instanceof De||(t=this.text(t)),t.path(e)}))},Text:{path:A((function(t,e=!0){const r=new Ge;let n;if(t instanceof de||(t=this.defs().path(t)),r.attr("href","#"+t,m),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:A((function(t){return t instanceof De||(t=(new De).addTo(this.parent()).text(t)),t.path(this)})),targets(){return nt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Ge.prototype.MorphArray=se,M(Ge,"TextPath");class Xe extends xt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:A((function(t,e){return this.put(new Xe).use(t,e)}))}}),M(Xe,"Use"),j([je,Ae,Rt,zt,Gt],s("viewbox")),j([qt,ge,me,de],s("marker")),j(De,s("Text")),j(de,s("Path")),j(vt,s("Defs")),j([De,Te],s("Tspan")),j([ye,Et,Lt,Se],s("radius")),j(ct,s("EventTarget")),j(gt,s("Dom")),j(yt,s("Element")),j(xt,s("Shape")),j([wt,Dt],s("Container")),j(Lt,s("Gradient")),j(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){fe.push(...[].concat(t))}([pt,H,K,Q,dt,Vt,se,$]),j(fe,{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,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Ye=r(726),Ue=r(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 r=document.createElementNS("http://www.w3.org/2000/svg","text");r.textContent=e;var n=new t(r);return n.assignUUID(),n.setAttributes(t.defaultAttributes),n},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,Ye.bringToFront)(this.domNode)},t.prototype.sendToBack=function(){(0,Ye.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 De(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,Ye.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 De(this.domNode).bbox();return{x:t.cx,y:t.cy}},set:function(t){new De(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},t.prototype.maintainingCenterPoint=function(t){var e=this.centerPoint;t(),this.centerPoint=e},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}()})(),n})(),t.exports=e()},298:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>c,Scaling:()=>h,VerticalClientScaling:()=>l,assignUUID:()=>u});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const i=new Uint8Array(16);function s(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+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 u(t){t.id="uuid-"+a()}var h=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}(),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.width/e.width},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.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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,degrees:()=>m,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return Math.abs(t-e)<=r}function d(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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var f=r(986);function d(t){return{x:(0,f.mean)(t.map((function(t){return t.x}))),y:(0,f.mean)(t.map((function(t){return t.y})))}}function p(t,e){return d([t,e])}})(),n})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{StraightBond:()=>Qe});const t={},e=[];function i(e,r){if(Array.isArray(e))for(const t of e)i(t,r);else if("object"!=typeof e)o(Object.getOwnPropertyNames(r)),t[e]=Object.assign(t[e]||{},r);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 r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function u(t){return t%360*Math.PI/180}function h(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function f(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,i]}const d="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 v(t,e=d){return g.document.createElementNS(e,t)}function x(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 r=e?g.document.createElement("div"):v("svg");return r.innerHTML=t,t=O(r.firstChild),r.removeChild(r.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:v(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=c(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,r=!1){return b[e]=t,r&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let P=1e3;function N(t){return"Svgjs"+c(t)+P++}function C(t){for(let e=t.children.length-1;e>=0;e--)C(t.children[e]);return t.id?(t.id=N(t.nodeName),t):t}function j(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function A(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}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=x(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=x(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=x(t)).before(this),this},insertAfter:function(t){return(t=x(t)).after(this),this}});const E=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,D=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,T=/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+)?$/,V=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,F=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,q=/[\s,]+/,G=/[MLHVCSQTAZ]/i;function X(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Y(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function U(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(q)},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 r={};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*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=h(e);r[e]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[h(t)];if("object"==typeof t)for(const e in t)this.node.style[h(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[h(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,r){if(null==t)return this.data(a(function(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)e(t[r])&&i.push(t[r]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);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===r||"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,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new H(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=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,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new H(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new H(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new H(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new H(t,e,r,"lab")}if("grey"===t){const t=255*n();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:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new H(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=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 n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,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 r=function(t,e){const r=Y(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Y(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Y(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Y(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Y(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Y(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 r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[r,n,i]=T.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_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),[,r,n,i]=D.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:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="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:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new H(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*U(i,n,t+1/3),o=255*U(i,n,t),a=255*U(i,n,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(X);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new H(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const r=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==r.x?0:r.x,this.y=null==r.y?0:r.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:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function W(t,e,r){return Math.abs(e-t)<(r||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.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:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,oy:f,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,r){const n=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,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new Q(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/u,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*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(q).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,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,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,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=u(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:c,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=c*n-l*i+r*i-e*n+e,this.f=l*n+c*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=u(t),e=u(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:c,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+c*i,this.d=c+h*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}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:r,y:n}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new $(r,n).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=x().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(q).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),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new K(e,r,n,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,r=-1/0,n=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),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new K(e,n,r-e,i-n)}}function tt(t,e,r){let n;try{if(n=e(t.node),Z(n)&&(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){n=r(t)}var i;return n}i({viewbox:{viewbox(t,e,r,n){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)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=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new $(r/2/s+i.x,n/2/o+i.y);const h=new K(i).transform(new Q({scale:u,origin:e}));return this.viewbox(h)}}}),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)}}j([et],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const rt=["toArray","constructor","each"];function nt(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)=>(rt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),j([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 ut(t,e,r,n,i){const s=r.bind(n||t),o=x(t),a=ot(o),u=at(o);e=Array.isArray(e)?e:e.split(q),r._svgjsListenerId||(r._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function ht(t,e,r,n){const i=x(t),s=ot(i),o=at(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])ht(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ht(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ht(o,[e,u].join("."));delete s[e]}}else{for(t in s)ht(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class ct extends y{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return ht(this,t,e,r),this}on(t,e,r,n){return ut(this,t,e,r,n),this}removeEventListener(){}}function lt(){}M(ct,"EventTarget");const ft={"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 dt 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(q).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(E))&&(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 ct{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=x(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 x(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 r=this.node.cloneNode(t);return e&&(r=C(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new gt(v(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=N(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,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.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=x(t),this.add(t,e),t}putIn(t,e){return x(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=x(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,d)}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 r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=S(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=v("wrapper",r),i=g.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}j(gt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=V.test(r.nodeValue)?parseFloat(r.nodeValue):r.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))?ft[t]:V.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,r)=>r(t,e,this)),e))?e=new pt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new dt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return nt(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=x(t));const r=new et;let n=this;for(;(n=n.parent())&&n.node!==g.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?x(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 r=l(this,t,e);return this.width(new pt(r.width)).height(new pt(r.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)}}j(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),r=e.node.getBBox();return e.remove(),r}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`)})),r=new K(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.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 r;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(r=bt[t].length-1;r>=0;r--)null!=e[bt[t][r]]&&this.attr(bt.prefix(t,bt[t][r]),e[bt[t][r]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!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(q).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 r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),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:f(t,this)});const r=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});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(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class vt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(vt,"Defs");class xt 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 Pt(t){return this.attr("cx",t)}function Nt(t){return this.attr("cy",t)}function Ct(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function jt(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(xt,"Shape");var At={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt};class Et extends xt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const r=l(this,t,e);return this.rx(new pt(r.width).divide(2)).ry(new pt(r.height).divide(2))}}j(Et,At),i("Container",{ellipse:A((function(t=0,e=t){return this.put(new Et).size(t,e).move(0,0)}))}),M(Et,"Ellipse");class Dt extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(v("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Tt(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(Dt,"Fragment");var Bt,It={__proto__:null,from:Tt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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()+")"}}j(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:A((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,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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:A((function(t,e,r){return this.put(new zt).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends xt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const r=new g.window.Image;return ut(r,"load",(function(t){const n=this.parent(zt);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof zt&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(r,"load error",(function(){ht(r)})),this.attr("href",r.src=t,m)}}Bt=function(t,e,r){return"fill"!==t&&"stroke"!==t||F.test(e)&&(e=r.root().defs().image(e)),e instanceof Rt&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:A((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Vt extends dt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new K(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.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,r=this.length;e<r;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[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}var Ft={__proto__:null,MorphArray:Vt,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 qt extends xt{constructor(t,e=t){super(_("line",t),e)}array(){return new Vt([[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,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new Vt(t).toLine(),this.attr(t))}size(t,e){const r=l(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}j(qt,Ft),i({Container:{line:A((function(...t){return qt.prototype.plot.apply(this.put(new qt),null!=t[0]?t:[0,0,0,0])}))}}),M(qt,"Line");class Gt 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 Xt(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:A((function(t,e,r){return this.put(new Gt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Gt?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),M(Gt,"Marker");const Yt={"-":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,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Yt[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}j(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:Xt("_duration",Wt),overshoot:Xt("_overshoot",Wt)}),j(class extends $t{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Xt("_windup"),p:Xt("P"),i:Xt("I"),d:Xt("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,r){return e.x=r.x=t[0],e.y=r.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,r){return e.x=r.x,e.y=r.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,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return Jt[t](e,r,n)}}(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 r=G.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}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)&&re(t)}function re(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 ne(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends dt{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!te(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(G.test(n)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");re(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||ne(i)){i.inNumber=!0,i.number=n,ee(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&re(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:q.test(t)?G.test(t)?se:dt:E.test(t)?pt:ue:fe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?dt:"object"===e?le:ue};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===le&&(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 ue{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 he{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,he.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}he.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const ce=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class le{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===H&&t[r+7]!==e[r+7]){const e=t[r+7],n=new H(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=oe(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(ce),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const fe=[ue,he,le];class de extends xt{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 r=l(this,t,e);return this.attr("d",this.array().size(r.width,r.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)}}de.prototype.MorphArray=se,i({Container:{path:A((function(t){return this.put(new de).plot(t||new se)}))}}),M(de,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new Vt(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 Vt(t))},size:function(t,e){const r=l(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class me extends xt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:A((function(t){return this.put(new me).plot(t||new Vt)}))}}),j(me,Ft),j(me,pe),M(me,"Polygon");class ge extends xt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:A((function(t){return this.put(new ge).plot(t||new Vt)}))}}),j(ge,Ft),j(ge,pe),M(ge,"Polyline");class ye extends xt{constructor(t,e=t){super(_("rect",t),e)}}j(ye,{rx:_t,ry:St}),i({Container:{rect:A((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 r=we.timer().now()+e,n=we.timeouts.push({run:t,time:r});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),n},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 r=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==r););let n=null;const i=we.frames.last();for(;n!==i&&(n=we.frames.shift());)n.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}},ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},xe=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends ct{constructor(t=xe){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 r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+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 r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,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],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.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 ct{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,r){let n=1,i=!1,s=0;return e=e||0,r=r||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}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,r){const n=Se.sanitise(t,e,r),i=new Se(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.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,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||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),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=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*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?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,r,n){return this._queue.push({initialiser:t||lt,runner:e||lt,retarget:r,isTransform:n,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,r){if(t instanceof _e||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),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,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.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 r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){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,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}j([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Pe=t=>t.transforms;function Ne(){const t=this._transformationRunners.runners.map(Pe).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ce{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 r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,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 r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--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,r){const n=Se.sanitise(t,e,r),i=this.timeline();return new Se(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.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(Pe).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Ne.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ce).add(new Oe(new Q(this))))}}}),j(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ae(this._stepper).to(n),s=Object.keys(n);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 r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new le(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ae(this._stepper).to(new pt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Q.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ae(this._stepper).type(r?he:Q);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||f(t,o),h=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new $(s).transform(o._currentTransform(this));let d=new Q({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(d);const m=i.at(c);return u=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=f(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 r=new ae(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new pt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ae(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),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 r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);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,r,n){return this._queueObject("viewbox",new K(t,e,r,n))},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)}}),j(Se,{rx:_t,ry:St,from:Tt,to:kt}),M(Se,"Runner");class je extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new vt):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:d,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:A((function(){return this.put(new je)}))}}),M(je,"Svg",!0);class Ae extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:A((function(){return this.put(new Ae)}))}}),M(Ae,"Symbol");var Ee={__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,r=this.bbox()){return this.x(t,r).y(e,r)},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,r=this.bbox()){return this.cx(t,r).cy(e,r)},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 De extends xt{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 r=this.dom.leading;this.each((function(n){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?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 r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"!==e[n].nodeName?(n!==r&&3!==e[n].nodeType&&!0===S(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent):0===n&&(r=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}j(De,Ee),i({Container:{text:A((function(t=""){return this.put(new De).text(t)})),plain:A((function(t=""){return this.put(new De).plain(t)}))}}),M(De,"Text");class Te extends xt{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 De))return this;const e=t.index(this),r=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new pt(r);return this.dy(e?n: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)}}j(Te,Ee),i({Tspan:{tspan:A((function(t=""){const e=new Te;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(Te,"Tspan");class ke extends xt{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))}}j(ke,{x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt}),i({Container:{circle:A((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 nt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:A((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:A((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(((r,n)=>{let i;try{i=r.bbox()}catch(t){return}const s=new Q(r),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);r.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,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=l(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new $(r).transform(new Q(t).inverse());t.scale(i,s,n.x,n.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)}}j(ze,Le),i({Container:{group:A((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)}}j(Re,Le),i({Container:{link:A((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 r=e.index(t);return e.add(this,r),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 Ve extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return nt("svg [mask*="+this.id()+"]")}}i({Container:{mask:A((function(){return this.defs().put(new Ve)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ve?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Ve,"Mask");class Fe 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,r){return this.put(new Fe).update(t,e,r)}}}),M(Fe,"Stop");class qe extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}i("Dom",{style(t,e){return this.put(new qe).rule(t,e)},fontface(t,e,r){return this.put(new qe).font(t,e,r)}}),M(qe,"Style");class Ge extends De{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 r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}i({Container:{textPath:A((function(t,e){return t instanceof De||(t=this.text(t)),t.path(e)}))},Text:{path:A((function(t,e=!0){const r=new Ge;let n;if(t instanceof de||(t=this.defs().path(t)),r.attr("href","#"+t,m),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:A((function(t){return t instanceof De||(t=(new De).addTo(this.parent()).text(t)),t.path(this)})),targets(){return nt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Ge.prototype.MorphArray=se,M(Ge,"TextPath");class Xe extends xt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:A((function(t,e){return this.put(new Xe).use(t,e)}))}}),M(Xe,"Use"),j([je,Ae,Rt,zt,Gt],s("viewbox")),j([qt,ge,me,de],s("marker")),j(De,s("Text")),j(de,s("Path")),j(vt,s("Defs")),j([De,Te],s("Tspan")),j([ye,Et,Lt,Se],s("radius")),j(ct,s("EventTarget")),j(gt,s("Dom")),j(yt,s("Element")),j(xt,s("Shape")),j([wt,Dt],s("Container")),j(Lt,s("Gradient")),j(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){fe.push(...[].concat(t))}([pt,H,K,Q,dt,Vt,se,$]),j(fe,{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,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Ye=r(726),Ue=r(725),He=r(854),$e=["basePadding1","basePadding2"],We={basePadding1:"setBasePadding1",basePadding2:"setBasePadding2"},Qe=function(){function t(t,e,r){var n=this;this.line=t,this.base1=e,this.base2=r,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 n.reposition()})),r.addEventListener("move",(function(){return n.reposition()}))}return t.between=function(e,r){var n=new t((new qt).node,e,r);return n.assignUUID(),n.set(t.defaultValues),n.reposition(),n},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 qt(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,Ye.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(r){try{e[We[r]](t[r])}catch(t){}}))},t.prototype.reposition=function(){var t=this.base1.centerPoint,e=this.base2.centerPoint,r=(0,Ue.direction)(t,e);this.setAttribute("x1","".concat(t.x+this.basePadding1*Math.cos(r))),this.setAttribute("y1","".concat(t.y+this.basePadding1*Math.sin(r))),this.setAttribute("x2","".concat(e.x-this.basePadding2*Math.cos(r))),this.setAttribute("y2","".concat(e.y-this.basePadding2*Math.sin(r)))},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}()})(),n})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>c,Scaling:()=>h,VerticalClientScaling:()=>l,assignUUID:()=>u,bringToFront:()=>f,sendToBack:()=>d});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const i=new Uint8Array(16);function s(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+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 u(t){t.id="uuid-"+a()}var h=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}(),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.width/e.width},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.height/e.height},t}();function f(t){var e=t.parentNode;e&&e.appendChild(t)}function d(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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function d(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{DotBracketDrawer:()=>nr,Drawing:()=>Ke,Nucleobase:()=>Ue.Nucleobase,StraightBond:()=>We.StraightBond});const t={},e=[];function i(e,r){if(Array.isArray(e))for(const t of e)i(t,r);else if("object"!=typeof e)o(Object.getOwnPropertyNames(r)),t[e]=Object.assign(t[e]||{},r);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 r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function u(t){return t%360*Math.PI/180}function h(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function f(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,i]}const d="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 v(t,e=d){return g.document.createElementNS(e,t)}function x(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 r=e?g.document.createElement("div"):v("svg");return r.innerHTML=t,t=O(r.firstChild),r.removeChild(r.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:v(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=c(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,r=!1){return b[e]=t,r&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let P=1e3;function N(t){return"Svgjs"+c(t)+P++}function C(t){for(let e=t.children.length-1;e>=0;e--)C(t.children[e]);return t.id?(t.id=N(t.nodeName),t):t}function j(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function A(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}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=x(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=x(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=x(t)).before(this),this},insertAfter:function(t){return(t=x(t)).after(this),this}});const E=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,D=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,T=/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+)?$/,V=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,F=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,q=/[\s,]+/,G=/[MLHVCSQTAZ]/i;function X(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Y(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function U(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(q)},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 r={};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*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=h(e);r[e]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[h(t)];if("object"==typeof t)for(const e in t)this.node.style[h(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[h(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,r){if(null==t)return this.data(a(function(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)e(t[r])&&i.push(t[r]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);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===r||"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,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new H(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=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,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new H(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new H(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new H(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new H(t,e,r,"lab")}if("grey"===t){const t=255*n();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:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new H(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=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 n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,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 r=function(t,e){const r=Y(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Y(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Y(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Y(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Y(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Y(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 r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[r,n,i]=T.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_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),[,r,n,i]=D.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:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="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:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new H(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*U(i,n,t+1/3),o=255*U(i,n,t),a=255*U(i,n,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(X);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new H(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const r=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==r.x?0:r.x,this.y=null==r.y?0:r.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:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function W(t,e,r){return Math.abs(e-t)<(r||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,f=c.y,d=new $(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.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:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,oy:f,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,r){const n=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,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new Q(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),f=180/Math.PI*l,d=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/u,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*c+e*(m*d*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+d*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(q).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,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),f=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,this.f=f,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,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=u(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:c,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=c*n-l*i+r*i-e*n+e,this.f=l*n+c*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=u(t),e=u(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:c,e:l,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+c*i,this.d=c+h*s,this.e=l+f*i-n*i,this.f=f+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}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:r,y:n}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new $(r,n).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=x().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(q).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),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new K(e,r,n,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,r=-1/0,n=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),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new K(e,n,r-e,i-n)}}function tt(t,e,r){let n;try{if(n=e(t.node),Z(n)&&(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){n=r(t)}var i;return n}i({viewbox:{viewbox(t,e,r,n){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)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=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new $(r/2/s+i.x,n/2/o+i.y);const h=new K(i).transform(new Q({scale:u,origin:e}));return this.viewbox(h)}}}),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)}}j([et],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const rt=["toArray","constructor","each"];function nt(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)=>(rt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),j([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 ut(t,e,r,n,i){const s=r.bind(n||t),o=x(t),a=ot(o),u=at(o);e=Array.isArray(e)?e:e.split(q),r._svgjsListenerId||(r._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function ht(t,e,r,n){const i=x(t),s=ot(i),o=at(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])ht(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ht(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ht(o,[e,u].join("."));delete s[e]}}else{for(t in s)ht(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class ct extends y{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return ht(this,t,e,r),this}on(t,e,r,n){return ut(this,t,e,r,n),this}removeEventListener(){}}function lt(){}M(ct,"EventTarget");const ft={"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 dt 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(q).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(E))&&(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 ct{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=x(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 x(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 r=this.node.cloneNode(t);return e&&(r=C(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new gt(v(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=N(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,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.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=x(t),this.add(t,e),t}putIn(t,e){return x(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=x(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),this}svg(t,e){return this.xml(t,e,d)}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 r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=S(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=v("wrapper",r),i=g.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}j(gt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=V.test(r.nodeValue)?parseFloat(r.nodeValue):r.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))?ft[t]:V.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,r)=>r(t,e,this)),e))?e=new pt(e):H.isColor(e)?e=new H(e):e.constructor===Array&&(e=new dt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return nt(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=x(t));const r=new et;let n=this;for(;(n=n.parent())&&n.node!==g.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?x(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 r=l(this,t,e);return this.width(new pt(r.width)).height(new pt(r.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)}}j(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),r=e.node.getBBox();return e.remove(),r}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`)})),r=new K(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.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 r;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(r=bt[t].length-1;r>=0;r--)null!=e[bt[t][r]]&&this.attr(bt.prefix(t,bt[t][r]),e[bt[t][r]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!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(q).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 r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),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:f(t,this)});const r=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});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(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class vt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(vt,"Defs");class xt 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 Pt(t){return this.attr("cx",t)}function Nt(t){return this.attr("cy",t)}function Ct(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function jt(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(xt,"Shape");var At={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt};class Et extends xt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const r=l(this,t,e);return this.rx(new pt(r.width).divide(2)).ry(new pt(r.height).divide(2))}}j(Et,At),i("Container",{ellipse:A((function(t=0,e=t){return this.put(new Et).size(t,e).move(0,0)}))}),M(Et,"Ellipse");class Dt extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(v("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Tt(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(Dt,"Fragment");var Bt,It={__proto__:null,from:Tt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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()+")"}}j(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:A((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,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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:A((function(t,e,r){return this.put(new zt).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends xt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const r=new g.window.Image;return ut(r,"load",(function(t){const n=this.parent(zt);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof zt&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(r,"load error",(function(){ht(r)})),this.attr("href",r.src=t,m)}}Bt=function(t,e,r){return"fill"!==t&&"stroke"!==t||F.test(e)&&(e=r.root().defs().image(e)),e instanceof Rt&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:A((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Vt extends dt{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new K(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.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,r=this.length;e<r;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[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}var Ft={__proto__:null,MorphArray:Vt,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 qt extends xt{constructor(t,e=t){super(_("line",t),e)}array(){return new Vt([[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,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new Vt(t).toLine(),this.attr(t))}size(t,e){const r=l(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}j(qt,Ft),i({Container:{line:A((function(...t){return qt.prototype.plot.apply(this.put(new qt),null!=t[0]?t:[0,0,0,0])}))}}),M(qt,"Line");class Gt 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 Xt(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:A((function(t,e,r){return this.put(new Gt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Gt?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),M(Gt,"Marker");const Yt={"-":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,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Yt[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}j(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:Xt("_duration",Wt),overshoot:Xt("_overshoot",Wt)}),j(class extends $t{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Xt("_windup"),p:Xt("P"),i:Xt("I"),d:Xt("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,r){return e.x=r.x=t[0],e.y=r.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,r){return e.x=r.x,e.y=r.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,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return Jt[t](e,r,n)}}(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 r=G.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}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)&&re(t)}function re(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 ne(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends dt{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!te(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(G.test(n)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");re(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||ne(i)){i.inNumber=!0,i.number=n,ee(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&re(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:q.test(t)?G.test(t)?se:dt:E.test(t)?pt:ue:fe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?dt:"object"===e?le:ue};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===le&&(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 ue{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 he{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,he.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}he.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const ce=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class le{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===H&&t[r+7]!==e[r+7]){const e=t[r+7],n=new H(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=oe(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(ce),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const fe=[ue,he,le];class de extends xt{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 r=l(this,t,e);return this.attr("d",this.array().size(r.width,r.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)}}de.prototype.MorphArray=se,i({Container:{path:A((function(t){return this.put(new de).plot(t||new se)}))}}),M(de,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new Vt(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 Vt(t))},size:function(t,e){const r=l(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class me extends xt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:A((function(t){return this.put(new me).plot(t||new Vt)}))}}),j(me,Ft),j(me,pe),M(me,"Polygon");class ge extends xt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:A((function(t){return this.put(new ge).plot(t||new Vt)}))}}),j(ge,Ft),j(ge,pe),M(ge,"Polyline");class ye extends xt{constructor(t,e=t){super(_("rect",t),e)}}j(ye,{rx:_t,ry:St}),i({Container:{rect:A((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 r=we.timer().now()+e,n=we.timeouts.push({run:t,time:r});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),n},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 r=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==r););let n=null;const i=we.frames.last();for(;n!==i&&(n=we.frames.shift());)n.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}},ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},xe=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends ct{constructor(t=xe){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 r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+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 r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,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],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.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 ct{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,r){let n=1,i=!1,s=0;return e=e||0,r=r||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}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,r){const n=Se.sanitise(t,e,r),i=new Se(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.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,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||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),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=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*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?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,r,n){return this._queue.push({initialiser:t||lt,runner:e||lt,retarget:r,isTransform:n,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,r){if(t instanceof _e||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),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,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.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 r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){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,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}j([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Pe=t=>t.transforms;function Ne(){const t=this._transformationRunners.runners.map(Pe).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ce{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 r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,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 r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--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,r){const n=Se.sanitise(t,e,r),i=this.timeline();return new Se(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.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(Pe).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Ne.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ce).add(new Oe(new Q(this))))}}}),j(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ae(this._stepper).to(n),s=Object.keys(n);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 r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new le(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ae(this._stepper).to(new pt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Q.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ae(this._stepper).type(r?he:Q);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||f(t,o),h=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:f}=new $(s).transform(o._currentTransform(this));let d=new Q({...t,origin:[l,f]}),p=this._isDeclarative&&a?a:h;if(r){d=d.decompose(l,f),p=p.decompose(l,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);d.rotate=r[s]}e&&(n||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(d);const m=i.at(c);return u=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=f(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 r=new ae(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new pt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ae(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),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 r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);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,r,n){return this._queueObject("viewbox",new K(t,e,r,n))},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)}}),j(Se,{rx:_t,ry:St,from:Tt,to:kt}),M(Se,"Runner");class je extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new vt):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:d,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:A((function(){return this.put(new je)}))}}),M(je,"Svg",!0);class Ae extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:A((function(){return this.put(new Ae)}))}}),M(Ae,"Symbol");var Ee={__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,r=this.bbox()){return this.x(t,r).y(e,r)},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,r=this.bbox()){return this.cx(t,r).cy(e,r)},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 De extends xt{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 r=this.dom.leading;this.each((function(n){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?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 r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"!==e[n].nodeName?(n!==r&&3!==e[n].nodeType&&!0===S(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent):0===n&&(r=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}j(De,Ee),i({Container:{text:A((function(t=""){return this.put(new De).text(t)})),plain:A((function(t=""){return this.put(new De).plain(t)}))}}),M(De,"Text");class Te extends xt{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 De))return this;const e=t.index(this),r=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new pt(r);return this.dy(e?n: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)}}j(Te,Ee),i({Tspan:{tspan:A((function(t=""){const e=new Te;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(Te,"Tspan");class ke extends xt{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))}}j(ke,{x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt}),i({Container:{circle:A((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 nt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:A((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:A((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(((r,n)=>{let i;try{i=r.bbox()}catch(t){return}const s=new Q(r),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);r.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,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=l(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new $(r).transform(new Q(t).inverse());t.scale(i,s,n.x,n.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)}}j(ze,Le),i({Container:{group:A((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)}}j(Re,Le),i({Container:{link:A((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 r=e.index(t);return e.add(this,r),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 Ve extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return nt("svg [mask*="+this.id()+"]")}}i({Container:{mask:A((function(){return this.defs().put(new Ve)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ve?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Ve,"Mask");class Fe 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,r){return this.put(new Fe).update(t,e,r)}}}),M(Fe,"Stop");class qe extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}i("Dom",{style(t,e){return this.put(new qe).rule(t,e)},fontface(t,e,r){return this.put(new qe).font(t,e,r)}}),M(qe,"Style");class Ge extends De{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 r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}i({Container:{textPath:A((function(t,e){return t instanceof De||(t=this.text(t)),t.path(e)}))},Text:{path:A((function(t,e=!0){const r=new Ge;let n;if(t instanceof de||(t=this.defs().path(t)),r.attr("href","#"+t,m),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:A((function(t){return t instanceof De||(t=(new De).addTo(this.parent()).text(t)),t.path(this)})),targets(){return nt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Ge.prototype.MorphArray=se,M(Ge,"TextPath");class Xe extends xt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:A((function(t,e){return this.put(new Xe).use(t,e)}))}}),M(Xe,"Use"),j([je,Ae,Rt,zt,Gt],s("viewbox")),j([qt,ge,me,de],s("marker")),j(De,s("Text")),j(de,s("Path")),j(vt,s("Defs")),j([De,Te],s("Tspan")),j([ye,Et,Lt,Se],s("radius")),j(ct,s("EventTarget")),j(gt,s("Dom")),j(yt,s("Element")),j(xt,s("Shape")),j([wt,Dt],s("Container")),j(Lt,s("Gradient")),j(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){fe.push(...[].concat(t))}([pt,H,K,Q,dt,Vt,se,$]),j(fe,{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,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Ye=r(726),Ue=r(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=r(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 r=We.StraightBond.between(t,e);return r.set(this.primaryBondDefaultValues),this.append(r),r}}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 r=We.StraightBond.between(t,e);return r.set(this.secondaryBondDefaultValues),this.append(r),r}}class Ke{constructor(){this.domNode=(new je).node,this.domNode.setAttribute("viewBox","0 0 250 250"),this.domNode.setAttribute("width","250"),this.domNode.setAttribute("height","250"),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,r=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${t} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(r*e).toString())}get maxX(){return this.minX+this.width}set maxX(t){let e=t-this.minX,r=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(r*e).toString())}get minY(){return this.domNode.viewBox.baseVal.y}set minY(t){let e=this.maxY-t,r=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${t} ${this.width} ${e}`),this.domNode.setAttribute("height",(r*e).toString())}get maxY(){return this.minY+this.height}set maxY(t){let e=t-this.minY,r=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${this.width} ${e}`),this.domNode.setAttribute("height",(r*e).toString())}setBoundaries({minX:t,maxX:e,minY:r,maxY:n}){this.minX=t,this.maxX=e,this.minY=r,this.maxY=n}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 Ye.HorizontalClientScaling(this.domNode).get()}get verticalClientScaling(){return new Ye.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 tr=r(127),er=r(661),rr=r(986);class nr{constructor(t){this.targetDrawing=t}draw(t,e){let r=[...t].map((t=>this.targetDrawing.addBase(t)));(0,tr.consecutivePairs)(r).forEach((t=>this.targetDrawing.addPrimaryBond(...t)));let n=[...(0,tr.parseDotBracket)(r,e)];n.forEach((t=>this.targetDrawing.addSecondaryBond(...t))),r.forEach((t=>t.bringToFront()));let i=1.87*(0,rr.mean)(r.map((t=>t.bbox.height)));(0,er.radialize)(r,n,{spacing:i,basePairSpacing:i/2,hairpinLoopSpacing:i/2})}}})(),n})(),t.exports=e()},925:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>n,HorizontalScrollbarThumb:()=>r,Scrollbars:()=>o,VerticalScrollbar:()=>s,VerticalScrollbarThumb:()=>i});class r{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 n{constructor(t){this.targetElement=t,this.thumb=new r(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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return t.map((t=>({v:t,priority:Math.random()}))).sort(((t,e)=>t.priority-e.priority)).map((({v:t})=>t))}function n(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}t.r(e),t.d(e,{DownloadableFile:()=>i,EventfulSet:()=>s,detectMac:()=>n,shuffled:()=>r});class i{constructor(t){this.textContent=t}downloadAs(t,e){let r=new File([this.textContent],t,{type:e.type}),n=URL.createObjectURL(r),i=document.createElement("a");i.href=n,i.download=r.name,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(n)}}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{RNAcanvas:()=>c});var t=r(662),e=r(925);class i{constructor(){this.domNode=document.createElement("div"),this.domNode.style.overflow="auto";let t=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div");t.style.flexGrow="1",r.style.flexGrow="0",n.style.flexGrow="1",this.domNode.style.display="flex",this.domNode.style.flexDirection="column",this.domNode.append(t,r,n);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",r.style.display="flex",r.style.flexDirection="row",r.append(i,s,o);let a=document.createElement("div");this.contentContainer=document.createElement("div");let u=document.createElement("div");a.style.flexGrow="1",this.contentContainer.style.flexGrow="0",u.style.flexGrow="1",s.style.display="flex",s.style.flexDirection="column",s.append(a,this.contentContainer,u),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,r){this.targetDrawing=t,this.horizontalScrollbar=e,this.verticalScrollbar=r}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=r(460),a=r(106),u=r(524),h=r(124);class c{constructor(){this.selectedSVGElements=new a.EventfulSet,this.domNode=document.createElement("div"),this.domNode.style.background="repeating-conic-gradient(#eee 0% 25%, white 0% 50%) 50% / 20px 20px",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.backgroundColor="white",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.pinchToScaleFeature=new o.PinchToScaleFeature(this.drawing.domNode,this.horizontalDrawingScrollbar,this.verticalDrawingScrollbar),this.selectedSVGElementHighlightings=new u.LiveSVGElementHighlightings(this.selectedSVGElements,this.drawing.domNode),this.selectedSVGElementHighlightings.appendTo(this.overlaidDrawing.domNode),this.clickSelectTool=new o.ClickSelectTool(this.drawing.domNode,this.selectedSVGElements),this.selectingRect=new o.SelectingRect(this.drawing.domNode,this.selectedSVGElements),this.selectingRect.appendTo(this.overlaidDrawing.domNode),this.selectedBases=new h.SelectedBases(this.drawing,this.selectedSVGElements),this.consecutiveBasesSelectingTool=new h.ConsecutiveBasesSelectingTool(this.drawing,this.selectedBases),this.draggingTool=new h.DraggingTool(this.drawing,{svgElements:this.selectedSVGElements,bases: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}}})(),n})()));
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=()=>(()=>{var t={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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>c,PositionPairs:()=>t,Stems:()=>h,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 r=e.flat(),n=t.findIndex((function(t){return r.includes(t)}));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]},t}(),i=r(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 r=e.flat().map((function(e){return t.indexOf(e)}));if((0,i.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(r)]},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 r=(new(e.bind.apply(e,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),n=t.indexOf(r);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(0,n)},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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)},t}(),u=r(369),h=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],r=(new(t.bind.apply(t,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Stems(e,r).get().map((function(t){return t.map((function(t){return[e[t[0]-1],e[t[1]-1]]}))}))},e}(),c=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],r=(new(t.bind.apply(t,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Linkers(e,r).get().map((function(t){return t.map((function(t){return e[t-1]}))}))},e}()})(),n})(),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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}return t.r(e),t.d(e,{average:()=>n,mean:()=>n,sum:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}r.r(n),r.d(n,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=r(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])}})(),n})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{CircularSegment:()=>a,Semicircle:()=>e});var t=r(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=r(872),s=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(n<=i)throw new Error("Arc length is too small.");if(n>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(n/i*Math.sin(s)-s)/(n/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 r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(n<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(n/i*Math.sin(Math.PI-s)-s)/(-n/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 r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function r(r,n){this.chord=r,this.moreProps=n;var i=n.arcLength,a=(0,t.distance)(r[0],r[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var u=a<.001&&i<.001,h=Math.PI*a/2,c=Math.abs(i-h)<.001;this.wrappedCircularSegment=u||c?new e(r):i<h?new s(r,{arcLength:i}):new o(r,{arcLength:i})}return Object.defineProperty(r.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),r}()})(),n})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,degrees:()=>m,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>f,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var d=r(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])}})(),n})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Centroid:()=>s,Direction:()=>f,MaxCenterX:()=>u,MaxCenterY:()=>c,MinCenterX:()=>a,MinCenterY:()=>h,NucleobaseMock:()=>t,circularize:()=>x,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>p,flipY:()=>m,linearize:()=>b,radialize:()=>I,rotate:()=>d,round:()=>S,shift:()=>e,stemmify:()=>v,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 r=t.getCenterPoint();t.setCenterPoint({x:r.x+e.x,y:r.y+e.y})}))}var i=r(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 r=this.get(),n=(0,i.displacement)(r,t);e(this.targetBases,n)}}var o=r(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}class c{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}var l=r(30);function d(t,e){if(0==t.length)return;let r=new s(t).get();t.forEach((t=>{let n=t.getCenterPoint(),s=(0,i.distance)(r,n),o=(0,l.direction)((0,i.displacement)(r,n));o+=e,t.setCenterPoint({x:r.x+s*Math.cos(o),y:r.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,l.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 r=t.getCenterPoint(),n=r.y-e;t.setCenterPoint({x:r.x,y:e-n})}))}function m(t){let e=new s(t).get().x;t.forEach((t=>{let r=t.getCenterPoint(),n=r.x-e;t.setCenterPoint({x:e-n,y:r.y})}))}function g(t){if(0==t.length)return;let r=t[0],{x:n,y:s}=r.getCenterPoint(),o={x:n,y:s},a=new f(t).get();d(t,-a),p(t),d(t,a),e(t,(0,i.displacement)(r.getCenterPoint(),o))}function y(t){let e=new s(t),{x:r,y:n}=e.get(),i=r,o=n,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:r}=e;if(t.length<2)return;let n=new f(t),i=n.get(),o=new s(t),{x:a,y:u}=o.get(),h={x:a,y:u};t.forEach(((t,e)=>{t.setCenterPoint({x:e*r,y:0})})),n.set(i),o.set(h)}function w(t){if(t.length<3)return;let e=t[0],r=t[t.length-1],n=[e.getCenterPoint(),r.getCenterPoint()],s=(0,i.distance)(n[0],n[1]),o=(0,l.direction)((0,i.displacement)(n[0],n[1])),a=s/(t.length-1),u=a*Math.cos(o),h=a*Math.sin(o),{x:c,y:d}=n[0];t.forEach((t=>{t.setCenterPoint({x:c,y:d}),c+=u,d+=h}))}function v(t,r){let{basePairLength:n,basePairSpacing:o}=r;if(t.length<2)return;let a=Math.ceil(t.length/2),u=t.slice(0,a),h=t.slice(a),c=new s(t),{x:l,y:p}=c.get(),m={x:l,y:p},g=new f(t).get();b(u,{spacing:o}),b(h,{spacing:o}),new f(u).set(-Math.PI/2),new f(h).set(Math.PI/2);let y=t[0],w=t[t.length-1];e(u,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(h,(0,i.displacement)(w.getCenterPoint(),{x:n,y:0})),d(t,g),c.set(m)}function x(t,e){let{spacing:r,terminiGap:n}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),u=o,h=a,c=new f(t).get(),l=r*(t.length-1);l+=n,Math.abs(l)<1e-5&&(l=1e-5);let p=l/(2*Math.PI),m=Math.PI/2+2*Math.PI*(.5*n/l);t.forEach(((t,e)=>{let n=m+2*Math.PI*(e*r)/l;t.setCenterPoint({x:p*Math.cos(n),y:p*Math.sin(n)})})),d(t,c),i.set({x:u,y:h})}var _=r(173);function S(t,r){let{spacing:n}=r;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],u=(0,i.distance)(a[0],a[1]),h=n*(t.length-1);if(h-u<.001)return void w(t);if(u<.001){let{x:r,y:o}=s.getCenterPoint();return x(t,{spacing:n,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:r,y:o}))}let c=new _.CircularSegment(a,{arcLength:h}),d=c.parentCircleCenterPoint,f=c.parentCircleRadius,p=(0,l.direction)((0,i.displacement)(d,s.getCenterPoint())),m=c.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=r(127),M=r(369);class P{static from(t){return{to:e=>({inclusive:()=>{let r=e-t+1;return Array.from({length:r},((e,r)=>t+r))}})}}}class N{static of(...t){let[e,r]=t,n=new O.PositionPairs(...t).get();n=(0,M.sorted)(n);let i=n.map((t=>t.map((t=>t-1)))),s=[],a=0;return e.forEach(((t,e)=>{let r=i.find((t=>t.includes(e)));r&&e==(0,o.min)(r)?(s.push(a),a+=1):r&&e==(0,o.max)(r)?(a-=1,s.push(a)):s.push(a)})),s}}class C{constructor(...t){let[e,r]=t;this.rawForm=t,this.mountainPlotTraversal=N.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(r.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 j{static correspondingTo(t){return{in:e=>t.map((t=>e.sequence.indexOf(t)))}}}class A{static composedOf(t){if(0==t.length)throw new Error("All stems must have at least one base-pair.");let r=t[0],n=t[t.length-1],s=t.map((t=>t[0])),o=t.map((t=>t[1])).reverse(),a=r[0],u=r[1],h=[...s,...o];return{[Symbol.iterator]:()=>t.values(),bottomBasePair:r,topBasePair:n,side5:s,side3:o,flat:()=>h,firstBase:a,lastBase:u,stemmify:()=>({with:t=>{let{basePairLength:r,basePairSpacing:n}=t,s=Object.assign({},a.getCenterPoint());v(h,{basePairLength:r,basePairSpacing:n}),e(h,(0,i.displacement)(a.getCenterPoint(),s))}})}}}class E{static in(t){return{[Symbol.iterator]:()=>new O.Stems(t.sequence,t.basePairs).get().map((t=>A.composedOf(t))).values()}}}class D{static composedOf(t){if(t.length<2)throw new Error("Linkers must have at least two bases.");let r=t[0],n=t[t.length-1],s=t.slice(1,-1);return{in:o=>{let a=o.sequence.indexOf(r),u=o.sequence.indexOf(n),h=P.from(a).to(u).inclusive(),c=!!o.indexPairs.find((t=>t.includes(a)&&t.includes(u))),l=h.every((t=>0==o.mountainPlotTraversal[t])),d=1==new Set(h.map((t=>o.mountainPlotTraversal[t]))).size&&!c;return{[Symbol.iterator]:()=>t.values(),indices:h,firstBase:r,lastBase:n,firstIndex:a,lastIndex:u,unpairedBases:{[Symbol.iterator]:()=>s.values(),stemmify:()=>({with:t=>{let{spacing:r}=t;if(s.length<3)return;let n=s[0],o=s[s.length-1],a=Object.assign({},n.getCenterPoint());v(s,{basePairLength:(0,i.distance)(n.getCenterPoint(),o.getCenterPoint()),basePairSpacing:r}),e(s,(0,i.displacement)(n.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:()=>c,isInOutermostLoop:()=>l,isBetweenSiblingStems:()=>d,round:()=>({with:e=>{let{spacing:r}=e;S(t,{spacing:r})}})}}}}}class T{static in(t){let e=new O.Linkers(t.sequence,t.basePairs).get().map((e=>D.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(r){return{in:n=>{let s=r.topBasePair,a=j.correspondingTo(s).in(n),u=(0,o.min)(a),h=n.sequence.filter(((t,e)=>e>(0,o.min)(a)&&e<(0,o.max)(a)&&n.mountainPlotTraversal[e]==n.mountainPlotTraversal[u]+1)),c=h.map((t=>n.sequence.indexOf(t))),l=h.filter((t=>n.pairedBases.has(t))),d=c.filter((t=>n.pairedIndices.has(t))),f=[s[0],...h,s[1]];return{[Symbol.iterator]:()=>f.values(),parentStructure:n,closingStem:r,closingBasePair:s,closingIndexPair:a,enclosedBases:h,enclosedIndices:c,enclosedPairedBases:l,enclosedPairedIndices:d,get platform(){if(0==d.length)throw new Error("This loop does not have a platform.");let r=(0,o.min)(d),u=(0,o.max)(d),h=n.sequence.filter(((t,e)=>e>=r&&e<=u&&c.includes(e)&&[e-1,e,e+1].some((t=>d.includes(t)))));return{[Symbol.iterator]:()=>h.values(),firstIndex:r,lastIndex:u,arch:()=>({with:n=>{let{spacing:c}=n,l=(0,o.max)([h.length-2,r-(0,o.min)(a)-1,(0,o.max)(a)-u-1,0]),d=P.from(1).to(l).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());x([s[0],...d,...h,...f,s[1]],{spacing:c,terminiGap:c}),e([...s,...h],(0,i.displacement)(s[0].getCenterPoint(),p))}})}}}}}}}class B{static of(t){let e=t.sequence.filter(((e,r)=>0==t.mountainPlotTraversal[r]));return{[Symbol.iterator]:()=>e.values()}}}function I(t,e,r){var n;let{spacing:i,basePairSpacing:o}=r,a=null!==(n=r.hairpinLoopSpacing)&&void 0!==n?n:i,u=new C(t,e);if(t.length<2)return;if(0==e.length)return void x(t,{spacing:i,terminiGap:2*i});let h=Object.assign({},new s(t).get()),c=new f(t).get(),l=E.in(u),d=T.in(u);x([...B.of(u)],{spacing:i,terminiGap:2*i});let p=[...l].map((t=>k.closedBy(t).in(u)));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(c),new s(t).set(h)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{ConsecutiveBasesSelectingTool:()=>t,DraggingTool:()=>s,SelectedBases:()=>e});class t{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 r=[...this.targetDrawing.bases],n=r.findIndex((e=>e.domNode===t.target));if(n<0)return;let i=r.findIndex((t=>t.domNode===e.target));if(i<0)return;try{let t=r[i];if(!this.selectedBases.include(t))return}catch(t){console.error(t)}let s=Math.min(i,n),o=Math.max(i,n);this.selectedBases.addAll(r.slice(s,o+1))}}class e{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)))}}var i=r(661);class s{constructor(t,e,r){this.targetDrawing=t,this.selectedElements=e,this.options=r,this.mouseIsDown=!1,this.dragged=!1,window.addEventListener("mousedown",(t=>this.handleMouseDown(t))),window.addEventListener("mousemove",(t=>this.handleMouseMove(t))),window.addEventListener("mouseup",(t=>this.handleMouseUp(t)))}handleMouseDown(t){this.lastMouseDown=t,this.mouseIsDown=!0,this.dragged=!1}handleMouseMove(t){var e;if(!this.mouseIsDown)return;if(!this.lastMouseDown)return;if(this.lastMouseDown.shiftKey)return;if(!(this.lastMouseDown.target instanceof SVGGraphicsElement))return;if(!this.selectedElements.svgElements.include(this.lastMouseDown.target))return;let r=t.movementX/this.targetDrawing.horizontalClientScaling,n=t.movementY/this.targetDrawing.verticalClientScaling;this.dragged||!(null===(e=this.options)||void 0===e?void 0:e.beforeDragging)||this.options.beforeDragging(),(0,i.shift)([...this.selectedElements.bases],{x:r,y:n}),this.dragged=!0}handleMouseUp(t){var e;this.mouseIsDown=!1,!this.dragged||!(null===(e=this.options)||void 0===e?void 0:e.afterDragging)||this.options.afterDragging(),this.dragged=!1}}})(),n})(),t.exports=e()},524:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>r,LiveSVGElementHighlightings:()=>n});class r{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 n{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 r;t.appendTo(this.domNode),this.boxTraces.push(t)})),t.forEach(((t,e)=>{try{let r=this.boxTraces[e];r.trace(t.getBBox()),r.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=()=>(()=>{var t={645:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Box:()=>e});var t=r(986);class e{static bounding(r){let n=r.map((t=>e.matching(t))),i=(0,t.min)(n.map((t=>t.left))),s=(0,t.min)(n.map((t=>t.top))),o=(0,t.max)(n.map((t=>t.right)))-i,a=(0,t.max)(n.map((t=>t.bottom)))-s;return new e(i,s,o,a)}static matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get minX(){return this.x}get minY(){return this.y}get maxX(){return this.minX+this.width}get maxY(){return this.minY+this.height}get top(){return this.minY}get right(){return this.maxX}get bottom(){return this.maxY}get left(){return this.minX}isBoundedBy(t){let r=e.matching(t);return this.minX>=r.minX&&this.minY>=r.minY&&this.maxX<=r.maxX&&this.maxY<=r.maxY}padded(t,r){return"number"!=typeof r&&(r=t),new e(this.x-t,this.y-r,this.width+2*t,this.height+2*r)}}})(),n})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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,{CoordinateSystem:()=>h,HorizontalClientScaling:()=>l,Scaling:()=>c,VerticalClientScaling:()=>d,assignUUID:()=>u,bringToFront:()=>f,sendToBack:()=>p});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const i=new Uint8Array(16);function s(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+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 u(t){t.id="uuid-"+a()}var h=function(){function t(t){this.targetSVGDoc=t}return Object.defineProperty(t.prototype,"width",{get:function(){return this.targetSVGDoc.viewBox.baseVal.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.targetSVGDoc.viewBox.baseVal.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minX",{get:function(){return this.targetSVGDoc.viewBox.baseVal.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.minX+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.targetSVGDoc.viewBox.baseVal.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.minY+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalScaling",{get:function(){return this.targetSVGDoc.width.baseVal.value/this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalScaling",{get:function(){return this.targetSVGDoc.height.baseVal.value/this.height},enumerable:!1,configurable:!0}),t.prototype.setScaling=function(t){this.targetSVGDoc.setAttribute("width","".concat(t*this.width)),this.targetSVGDoc.setAttribute("height","".concat(t*this.height))},Object.defineProperty(t.prototype,"clientWidth",{get:function(){return this.targetSVGDoc.getBoundingClientRect().width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientHeight",{get:function(){return this.targetSVGDoc.getBoundingClientRect().height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"horizontalClientScaling",{get:function(){return this.clientWidth/this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalClientScaling",{get:function(){return this.clientHeight/this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minClientX",{get:function(){return this.targetSVGDoc.getBoundingClientRect().x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minClientY",{get:function(){return this.targetSVGDoc.getBoundingClientRect().y},enumerable:!1,configurable:!0}),t.prototype.fromClientX=function(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling},t.prototype.fromClientY=function(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling},t.prototype.fromClientCoordinates=function(t,e){return[this.fromClientX(t),this.fromClientY(e)]},t.prototype.fromClientPoint=function(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}},t.prototype.toClientX=function(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)},t.prototype.toClientY=function(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)},t.prototype.toClientCoordinates=function(t,e){return[this.toClientX(t),this.toClientY(e)]},t.prototype.toClientPoint=function(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}},t}(),c=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}(),d=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 f(t){var e=t.parentNode;e&&e.appendChild(t)}function p(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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{ClickSelectTool:()=>t,PinchToScaleFeature:()=>u,SelectingRect:()=>o});class t{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()}}var e=r(726),i=r(645);function s(t){return t instanceof SVGGraphicsElement}class o{constructor(t,r){this.targetSVGDoc=t,this.selectedSVGElements=r,this.defaultLineThickness=.625,this.lastMouseDownX=0,this.lastMouseDownY=0,this.mouseIsDown=!1,this.isDrawn=!1,this.targetSVGDocCoordinateSystem=new e.CoordinateSystem(t),this.domNode=document.createElementNS("http://www.w3.org/2000/svg","path"),this.domNode.setAttribute("stroke","blue"),this.refreshLineThickness(),this.domNode.setAttribute("fill","blue"),this.domNode.setAttribute("fill-opacity","0.1"),new MutationObserver((()=>this.refreshLineThickness())).observe(t,{attributes:!0,attributeFilter:["viewBox","width","height"]}),this.domNode.style.pointerEvents="none",this.domNode.style.visibility="hidden",window.addEventListener("mousedown",(t=>this.handleMouseDown(t))),window.addEventListener("mousemove",(t=>this.handleMouseMove(t))),window.addEventListener("mouseup",(t=>this.handleMouseUp(t)))}refreshLineThickness(){this.domNode.setAttribute("stroke-width",""+this.defaultLineThickness/this.targetSVGDocCoordinateSystem.horizontalScaling)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}handleMouseDown(t){this.lastMouseDown=t,this.lastMouseDownX=this.targetSVGDocCoordinateSystem.fromClientX(t.clientX),this.lastMouseDownY=this.targetSVGDocCoordinateSystem.fromClientY(t.clientY),this.mouseIsDown=!0}handleMouseMove(t){if(!this.mouseIsDown)return;if(!this.lastMouseDown)return;if(this.lastMouseDown.target!==this.targetSVGDoc)return;let e=this.targetSVGDocCoordinateSystem.fromClientX(t.clientX),r=this.targetSVGDocCoordinateSystem.fromClientY(t.clientY),n=`M ${this.lastMouseDownX} ${this.lastMouseDownY} H ${e} V ${r} H ${this.lastMouseDownX} z`;this.domNode.setAttribute("d",n),this.domNode.style.visibility="visible",this.isDrawn=!0}handleMouseUp(t){var e;this.mouseIsDown=!1,this.domNode.style.visibility="hidden";let r=this.isDrawn;if(this.isDrawn=!1,!r)return;let n=this.targetSVGDocCoordinateSystem.fromClientX(t.clientX),o=this.targetSVGDocCoordinateSystem.fromClientY(t.clientY),a=i.Box.bounding([{x:this.lastMouseDownX,y:this.lastMouseDownY,width:0,height:0},{x:n,y:o,width:0,height:0}]),u=[...this.targetSVGDoc.children].filter(s).filter((t=>i.Box.matching(t.getBBox()).isBoundedBy(a)));(null===(e=this.lastMouseDown)||void 0===e?void 0:e.shiftKey)||this.selectedSVGElements.clear(),this.selectedSVGElements.addAll(u)}}var a=r(986);class u{constructor(t,r,n){this.targetSVGDoc=t,this.targetSVGDocCoordinateSystem=new e.CoordinateSystem(t),this.horizontalScrollbar=r,this.verticalScrollbar=n,window.addEventListener("wheel",(t=>this.handleWheel(t)),{passive:!1})}handleWheel(t){if(!t.ctrlKey)return;if(!(t.target instanceof Node))return;if(!this.targetSVGDoc.contains(t.target))return;t.preventDefault();let e=1-(0,a.clamp)(t.deltaY,-25,25)/150,r=this.targetSVGDocCoordinateSystem.horizontalScaling,n=e*r;n=Number.isFinite(n)?n:1,n=(0,a.clamp)(n,.1,500),e=n/r;let i=e*this.horizontalScrollbar.thumb.centerX,s=e*this.verticalScrollbar.thumb.centerY;this.targetSVGDocCoordinateSystem.setScaling(n),this.horizontalScrollbar.thumb.centerX=i,this.verticalScrollbar.thumb.centerY=s}}})(),n})(),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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>c,PositionPairs:()=>t,Stems:()=>h,TrailingDanglingBases:()=>a,consecutivePairs:()=>d,parseDotBracket:()=>l});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 r=e.flat(),n=t.findIndex((t=>r.includes(t)));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var i=r(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 r=e.flat().map((e=>t.indexOf(e)));if((0,i.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(r)]}}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 r=new e(...this.targetStructure).get(),n=t.indexOf(r);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(0,n)}}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(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)}}var u=r(369);class h{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],r=new t(...this.targetStructure).get();return new u.Stems(e,r).get().map((t=>t.map((t=>[e[t[0]-1],e[t[1]-1]]))))}}class c{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],r=new t(...this.targetStructure).get();return new u.Linkers(e,r).get().map((t=>t.map((t=>e[t-1]))))}}function l(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,u.parseDotBracket)(e)].map((e=>{let r=e[0],n=e[1];return[t[r-1],t[n-1]]}))}function d(t){return t.length<2?[]:t.slice(0,-1).map(((e,r)=>[t[r],t[r+1]]))}})(),n})(),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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>c,PositionPairs:()=>t,Stems:()=>h,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 r=e.flat(),n=t.findIndex((function(t){return r.includes(t)}));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]},t}(),i=r(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 r=e.flat().map((function(e){return t.indexOf(e)}));if((0,i.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(r)]},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 r=(new(e.bind.apply(e,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),n=t.indexOf(r);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(0,n)},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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),r=t.indexOf(e);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(r+1)},t}(),u=r(369),h=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],r=(new(t.bind.apply(t,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Stems(e,r).get().map((function(t){return t.map((function(t){return[e[t[0]-1],e[t[1]-1]]}))}))},e}(),c=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],r=(new(t.bind.apply(t,function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Linkers(e,r).get().map((function(t){return t.map((function(t){return e[t-1]}))}))},e}()})(),n})(),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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}return t.r(e),t.d(e,{average:()=>n,mean:()=>n,sum:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}r.r(n),r.d(n,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=r(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])}})(),n})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{CircularSegment:()=>a,Semicircle:()=>e});var t=r(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=r(872),s=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(n<=i)throw new Error("Arc length is too small.");if(n>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(n/i*Math.sin(s)-s)/(n/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 r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,r){this.chord=e,this.moreProps=r;var n=r.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(n<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(n/i*Math.sin(Math.PI-s)-s)/(-n/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 r=this.parentCircleRadius;return{x:this.chord[0].x+r*Math.cos(e),y:this.chord[0].y+r*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function r(r,n){this.chord=r,this.moreProps=n;var i=n.arcLength,a=(0,t.distance)(r[0],r[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var u=a<.001&&i<.001,h=Math.PI*a/2,c=Math.abs(i-h)<.001;this.wrappedCircularSegment=u||c?new e(r):i<h?new s(r,{arcLength:i}):new o(r,{arcLength:i})}return Object.defineProperty(r.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),r}()})(),n})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,degrees:()=>m,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>f,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var d=r(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])}})(),n})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=r(986);function s(t){var r=e(t);return r.forEach(i.sortNumbers),r.sort((function(t,e){return t[0]-e[0]})),r}function o(t,e){var r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[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),r=[],n=[];return e.forEach((function(t){var e=0==n.length?null:n[n.length-1];!e||o(e,t)?n.push(t):(r.push(n),n=[t])})),r.push(n),r},t}(),u=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,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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=[],r=t.shift(),n=t.shift();r&&n;){for(var s=[],o=(0,i.max)(r),u=(0,i.min)(n),h=o;h<=u;h++)s.push(h);e.push(s),r=n,n=t.shift()}return e},t}();function h(t){var e=t.split(""),r=[".","(",")"];e.forEach((function(t){if(!r.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var n=[],i=[];if(e.forEach((function(t,e){var r=e+1;if("("==t)i.push(r);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");n.push([s,r])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(n)}})(),n})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Centroid:()=>s,Direction:()=>f,MaxCenterX:()=>u,MaxCenterY:()=>c,MinCenterX:()=>a,MinCenterY:()=>h,NucleobaseMock:()=>t,circularize:()=>x,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>p,flipY:()=>m,linearize:()=>b,radialize:()=>I,rotate:()=>d,round:()=>S,shift:()=>e,stemmify:()=>v,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 r=t.getCenterPoint();t.setCenterPoint({x:r.x+e.x,y:r.y+e.y})}))}var i=r(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 r=this.get(),n=(0,i.displacement)(r,t);e(this.targetBases,n)}}var o=r(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let r=this.get();e(this.targetBases,{x:t-r,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}class c{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let r=this.get();e(this.targetBases,{x:0,y:t-r})}}var l=r(30);function d(t,e){if(0==t.length)return;let r=new s(t).get();t.forEach((t=>{let n=t.getCenterPoint(),s=(0,i.distance)(r,n),o=(0,l.direction)((0,i.displacement)(r,n));o+=e,t.setCenterPoint({x:r.x+s*Math.cos(o),y:r.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,l.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 r=t.getCenterPoint(),n=r.y-e;t.setCenterPoint({x:r.x,y:e-n})}))}function m(t){let e=new s(t).get().x;t.forEach((t=>{let r=t.getCenterPoint(),n=r.x-e;t.setCenterPoint({x:e-n,y:r.y})}))}function g(t){if(0==t.length)return;let r=t[0],{x:n,y:s}=r.getCenterPoint(),o={x:n,y:s},a=new f(t).get();d(t,-a),p(t),d(t,a),e(t,(0,i.displacement)(r.getCenterPoint(),o))}function y(t){let e=new s(t),{x:r,y:n}=e.get(),i=r,o=n,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:r}=e;if(t.length<2)return;let n=new f(t),i=n.get(),o=new s(t),{x:a,y:u}=o.get(),h={x:a,y:u};t.forEach(((t,e)=>{t.setCenterPoint({x:e*r,y:0})})),n.set(i),o.set(h)}function w(t){if(t.length<3)return;let e=t[0],r=t[t.length-1],n=[e.getCenterPoint(),r.getCenterPoint()],s=(0,i.distance)(n[0],n[1]),o=(0,l.direction)((0,i.displacement)(n[0],n[1])),a=s/(t.length-1),u=a*Math.cos(o),h=a*Math.sin(o),{x:c,y:d}=n[0];t.forEach((t=>{t.setCenterPoint({x:c,y:d}),c+=u,d+=h}))}function v(t,r){let{basePairLength:n,basePairSpacing:o}=r;if(t.length<2)return;let a=Math.ceil(t.length/2),u=t.slice(0,a),h=t.slice(a),c=new s(t),{x:l,y:p}=c.get(),m={x:l,y:p},g=new f(t).get();b(u,{spacing:o}),b(h,{spacing:o}),new f(u).set(-Math.PI/2),new f(h).set(Math.PI/2);let y=t[0],w=t[t.length-1];e(u,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(h,(0,i.displacement)(w.getCenterPoint(),{x:n,y:0})),d(t,g),c.set(m)}function x(t,e){let{spacing:r,terminiGap:n}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),u=o,h=a,c=new f(t).get(),l=r*(t.length-1);l+=n,Math.abs(l)<1e-5&&(l=1e-5);let p=l/(2*Math.PI),m=Math.PI/2+2*Math.PI*(.5*n/l);t.forEach(((t,e)=>{let n=m+2*Math.PI*(e*r)/l;t.setCenterPoint({x:p*Math.cos(n),y:p*Math.sin(n)})})),d(t,c),i.set({x:u,y:h})}var _=r(173);function S(t,r){let{spacing:n}=r;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],u=(0,i.distance)(a[0],a[1]),h=n*(t.length-1);if(h-u<.001)return void w(t);if(u<.001){let{x:r,y:o}=s.getCenterPoint();return x(t,{spacing:n,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:r,y:o}))}let c=new _.CircularSegment(a,{arcLength:h}),d=c.parentCircleCenterPoint,f=c.parentCircleRadius,p=(0,l.direction)((0,i.displacement)(d,s.getCenterPoint())),m=c.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=r(127),M=r(369);class P{static from(t){return{to:e=>({inclusive:()=>{let r=e-t+1;return Array.from({length:r},((e,r)=>t+r))}})}}}class N{static of(...t){let[e,r]=t,n=new O.PositionPairs(...t).get();n=(0,M.sorted)(n);let i=n.map((t=>t.map((t=>t-1)))),s=[],a=0;return e.forEach(((t,e)=>{let r=i.find((t=>t.includes(e)));r&&e==(0,o.min)(r)?(s.push(a),a+=1):r&&e==(0,o.max)(r)?(a-=1,s.push(a)):s.push(a)})),s}}class C{constructor(...t){let[e,r]=t;this.rawForm=t,this.mountainPlotTraversal=N.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(r.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 j{static correspondingTo(t){return{in:e=>t.map((t=>e.sequence.indexOf(t)))}}}class A{static composedOf(t){if(0==t.length)throw new Error("All stems must have at least one base-pair.");let r=t[0],n=t[t.length-1],s=t.map((t=>t[0])),o=t.map((t=>t[1])).reverse(),a=r[0],u=r[1],h=[...s,...o];return{[Symbol.iterator]:()=>t.values(),bottomBasePair:r,topBasePair:n,side5:s,side3:o,flat:()=>h,firstBase:a,lastBase:u,stemmify:()=>({with:t=>{let{basePairLength:r,basePairSpacing:n}=t,s=Object.assign({},a.getCenterPoint());v(h,{basePairLength:r,basePairSpacing:n}),e(h,(0,i.displacement)(a.getCenterPoint(),s))}})}}}class E{static in(t){return{[Symbol.iterator]:()=>new O.Stems(t.sequence,t.basePairs).get().map((t=>A.composedOf(t))).values()}}}class D{static composedOf(t){if(t.length<2)throw new Error("Linkers must have at least two bases.");let r=t[0],n=t[t.length-1],s=t.slice(1,-1);return{in:o=>{let a=o.sequence.indexOf(r),u=o.sequence.indexOf(n),h=P.from(a).to(u).inclusive(),c=!!o.indexPairs.find((t=>t.includes(a)&&t.includes(u))),l=h.every((t=>0==o.mountainPlotTraversal[t])),d=1==new Set(h.map((t=>o.mountainPlotTraversal[t]))).size&&!c;return{[Symbol.iterator]:()=>t.values(),indices:h,firstBase:r,lastBase:n,firstIndex:a,lastIndex:u,unpairedBases:{[Symbol.iterator]:()=>s.values(),stemmify:()=>({with:t=>{let{spacing:r}=t;if(s.length<3)return;let n=s[0],o=s[s.length-1],a=Object.assign({},n.getCenterPoint());v(s,{basePairLength:(0,i.distance)(n.getCenterPoint(),o.getCenterPoint()),basePairSpacing:r}),e(s,(0,i.displacement)(n.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:()=>c,isInOutermostLoop:()=>l,isBetweenSiblingStems:()=>d,round:()=>({with:e=>{let{spacing:r}=e;S(t,{spacing:r})}})}}}}}class T{static in(t){let e=new O.Linkers(t.sequence,t.basePairs).get().map((e=>D.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(r){return{in:n=>{let s=r.topBasePair,a=j.correspondingTo(s).in(n),u=(0,o.min)(a),h=n.sequence.filter(((t,e)=>e>(0,o.min)(a)&&e<(0,o.max)(a)&&n.mountainPlotTraversal[e]==n.mountainPlotTraversal[u]+1)),c=h.map((t=>n.sequence.indexOf(t))),l=h.filter((t=>n.pairedBases.has(t))),d=c.filter((t=>n.pairedIndices.has(t))),f=[s[0],...h,s[1]];return{[Symbol.iterator]:()=>f.values(),parentStructure:n,closingStem:r,closingBasePair:s,closingIndexPair:a,enclosedBases:h,enclosedIndices:c,enclosedPairedBases:l,enclosedPairedIndices:d,get platform(){if(0==d.length)throw new Error("This loop does not have a platform.");let r=(0,o.min)(d),u=(0,o.max)(d),h=n.sequence.filter(((t,e)=>e>=r&&e<=u&&c.includes(e)&&[e-1,e,e+1].some((t=>d.includes(t)))));return{[Symbol.iterator]:()=>h.values(),firstIndex:r,lastIndex:u,arch:()=>({with:n=>{let{spacing:c}=n,l=(0,o.max)([h.length-2,r-(0,o.min)(a)-1,(0,o.max)(a)-u-1,0]),d=P.from(1).to(l).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());x([s[0],...d,...h,...f,s[1]],{spacing:c,terminiGap:c}),e([...s,...h],(0,i.displacement)(s[0].getCenterPoint(),p))}})}}}}}}}class B{static of(t){let e=t.sequence.filter(((e,r)=>0==t.mountainPlotTraversal[r]));return{[Symbol.iterator]:()=>e.values()}}}function I(t,e,r){var n;let{spacing:i,basePairSpacing:o}=r,a=null!==(n=r.hairpinLoopSpacing)&&void 0!==n?n:i,u=new C(t,e);if(t.length<2)return;if(0==e.length)return void x(t,{spacing:i,terminiGap:2*i});let h=Object.assign({},new s(t).get()),c=new f(t).get(),l=E.in(u),d=T.in(u);x([...B.of(u)],{spacing:i,terminiGap:2*i});let p=[...l].map((t=>k.closedBy(t).in(u)));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(c),new s(t).set(h)}})(),n})(),t.exports=e()},358:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>c,Scaling:()=>h,VerticalClientScaling:()=>l,assignUUID:()=>u,bringToFront:()=>d,sendToBack:()=>f});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const i=new Uint8Array(16);function s(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+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 u(t){t.id="uuid-"+a()}var h=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}(),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.width/e.width},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.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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{Nucleobase:()=>He});const t={},e=[];function i(e,r){if(Array.isArray(e))for(const t of e)i(t,r);else if("object"!=typeof e)o(Object.getOwnPropertyNames(r)),t[e]=Object.assign(t[e]||{},r);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 r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function u(t){return t%360*Math.PI/180}function h(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function d(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,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 v(t,e=f){return g.document.createElementNS(e,t)}function x(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 r=e?g.document.createElement("div"):v("svg");return r.innerHTML=t,t=O(r.firstChild),r.removeChild(r.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:v(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=c(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,r=!1){return b[e]=t,r&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let P=1e3;function N(t){return"Svgjs"+c(t)+P++}function C(t){for(let e=t.children.length-1;e>=0;e--)C(t.children[e]);return t.id?(t.id=N(t.nodeName),t):t}function j(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function A(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}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=x(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=x(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=x(t)).before(this),this},insertAfter:function(t){return(t=x(t)).after(this),this}});const E=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,D=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,T=/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+)?$/,V=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,F=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,q=/[\s,]+/,G=/[MLHVCSQTAZ]/i;function X(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Y(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function U(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(q)},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 r={};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*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=h(e);r[e]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[h(t)];if("object"==typeof t)for(const e in t)this.node.style[h(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[h(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,r){if(null==t)return this.data(a(function(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)e(t[r])&&i.push(t[r]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);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===r||"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,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new H(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=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,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new H(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new H(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new H(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new H(t,e,r,"lab")}if("grey"===t){const t=255*n();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:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new H(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=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 n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,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 r=function(t,e){const r=Y(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Y(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Y(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Y(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Y(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Y(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 r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[r,n,i]=T.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_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),[,r,n,i]=D.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:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="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:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new H(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*U(i,n,t+1/3),o=255*U(i,n,t),a=255*U(i,n,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(X);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,d=h>.008856?Math.pow(h,1/3):7.787*h+16/116,f=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new H(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const r=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==r.x?0:r.x,this.y=null==r.y?0:r.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:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function W(t,e,r){return Math.abs(e-t)<(r||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,d=c.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:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,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,r){const n=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,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new Q(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),d=180/Math.PI*l,f=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/u,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*c+e*(m*f*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+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(q).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,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),d=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,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,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=u(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:c,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=c*n-l*i+r*i-e*n+e,this.f=l*n+c*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=u(t),e=u(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:c,e:l,f:d}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+c*i,this.d=c+h*s,this.e=l+d*i-n*i,this.f=d+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}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:r,y:n}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new $(r,n).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=x().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(q).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),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new K(e,r,n,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,r=-1/0,n=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),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new K(e,n,r-e,i-n)}}function tt(t,e,r){let n;try{if(n=e(t.node),Z(n)&&(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){n=r(t)}var i;return n}i({viewbox:{viewbox(t,e,r,n){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)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=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new $(r/2/s+i.x,n/2/o+i.y);const h=new K(i).transform(new Q({scale:u,origin:e}));return this.viewbox(h)}}}),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)}}j([et],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const rt=["toArray","constructor","each"];function nt(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)=>(rt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),j([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 ut(t,e,r,n,i){const s=r.bind(n||t),o=x(t),a=ot(o),u=at(o);e=Array.isArray(e)?e:e.split(q),r._svgjsListenerId||(r._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function ht(t,e,r,n){const i=x(t),s=ot(i),o=at(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])ht(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ht(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ht(o,[e,u].join("."));delete s[e]}}else{for(t in s)ht(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class ct extends y{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return ht(this,t,e,r),this}on(t,e,r,n){return ut(this,t,e,r,n),this}removeEventListener(){}}function lt(){}M(ct,"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(q).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(E))&&(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 ct{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=x(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 x(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 r=this.node.cloneNode(t);return e&&(r=C(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new gt(v(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=N(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,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.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=x(t),this.add(t,e),t}putIn(t,e){return x(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=x(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),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 r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=S(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=v("wrapper",r),i=g.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}j(gt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=V.test(r.nodeValue)?parseFloat(r.nodeValue):r.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]:V.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,r)=>r(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 r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return nt(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=x(t));const r=new et;let n=this;for(;(n=n.parent())&&n.node!==g.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?x(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 r=l(this,t,e);return this.width(new pt(r.width)).height(new pt(r.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)}}j(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),r=e.node.getBBox();return e.remove(),r}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`)})),r=new K(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.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 r;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(r=bt[t].length-1;r>=0;r--)null!=e[bt[t][r]]&&this.attr(bt.prefix(t,bt[t][r]),e[bt[t][r]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!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(q).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 r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),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 r=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});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(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class vt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(vt,"Defs");class xt 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 Pt(t){return this.attr("cx",t)}function Nt(t){return this.attr("cy",t)}function Ct(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function jt(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(xt,"Shape");var At={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt};class Et extends xt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const r=l(this,t,e);return this.rx(new pt(r.width).divide(2)).ry(new pt(r.height).divide(2))}}j(Et,At),i("Container",{ellipse:A((function(t=0,e=t){return this.put(new Et).size(t,e).move(0,0)}))}),M(Et,"Ellipse");class Dt extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(v("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Tt(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(Dt,"Fragment");var Bt,It={__proto__:null,from:Tt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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()+")"}}j(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:A((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,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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:A((function(t,e,r){return this.put(new zt).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends xt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const r=new g.window.Image;return ut(r,"load",(function(t){const n=this.parent(zt);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof zt&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(r,"load error",(function(){ht(r)})),this.attr("href",r.src=t,m)}}Bt=function(t,e,r){return"fill"!==t&&"stroke"!==t||F.test(e)&&(e=r.root().defs().image(e)),e instanceof Rt&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:A((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Vt extends ft{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new K(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.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,r=this.length;e<r;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[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}var Ft={__proto__:null,MorphArray:Vt,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 qt extends xt{constructor(t,e=t){super(_("line",t),e)}array(){return new Vt([[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,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new Vt(t).toLine(),this.attr(t))}size(t,e){const r=l(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}j(qt,Ft),i({Container:{line:A((function(...t){return qt.prototype.plot.apply(this.put(new qt),null!=t[0]?t:[0,0,0,0])}))}}),M(qt,"Line");class Gt 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 Xt(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:A((function(t,e,r){return this.put(new Gt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Gt?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),M(Gt,"Marker");const Yt={"-":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,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Yt[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}j(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:Xt("_duration",Wt),overshoot:Xt("_overshoot",Wt)}),j(class extends $t{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Xt("_windup"),p:Xt("P"),i:Xt("I"),d:Xt("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,r){return e.x=r.x=t[0],e.y=r.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,r){return e.x=r.x,e.y=r.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,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return Jt[t](e,r,n)}}(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 r=G.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}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)&&re(t)}function re(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 ne(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}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 r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!te(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(G.test(n)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");re(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||ne(i)){i.inNumber=!0,i.number=n,ee(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&re(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:q.test(t)?G.test(t)?se:ft:E.test(t)?pt:ue:de.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ft:"object"===e?le:ue};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===le&&(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 ue{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 he{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,he.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}he.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const ce=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class le{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===H&&t[r+7]!==e[r+7]){const e=t[r+7],n=new H(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=oe(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(ce),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const de=[ue,he,le];class fe extends xt{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 r=l(this,t,e);return this.attr("d",this.array().size(r.width,r.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:A((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 Vt(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 Vt(t))},size:function(t,e){const r=l(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class me extends xt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:A((function(t){return this.put(new me).plot(t||new Vt)}))}}),j(me,Ft),j(me,pe),M(me,"Polygon");class ge extends xt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:A((function(t){return this.put(new ge).plot(t||new Vt)}))}}),j(ge,Ft),j(ge,pe),M(ge,"Polyline");class ye extends xt{constructor(t,e=t){super(_("rect",t),e)}}j(ye,{rx:_t,ry:St}),i({Container:{rect:A((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 r=we.timer().now()+e,n=we.timeouts.push({run:t,time:r});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),n},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 r=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==r););let n=null;const i=we.frames.last();for(;n!==i&&(n=we.frames.shift());)n.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}},ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},xe=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends ct{constructor(t=xe){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 r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+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 r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,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],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.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 ct{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,r){let n=1,i=!1,s=0;return e=e||0,r=r||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}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,r){const n=Se.sanitise(t,e,r),i=new Se(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.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,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||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),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=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*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?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,r,n){return this._queue.push({initialiser:t||lt,runner:e||lt,retarget:r,isTransform:n,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,r){if(t instanceof _e||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),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,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.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 r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){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,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}j([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Pe=t=>t.transforms;function Ne(){const t=this._transformationRunners.runners.map(Pe).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ce{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 r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,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 r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--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,r){const n=Se.sanitise(t,e,r),i=this.timeline();return new Se(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.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(Pe).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Ne.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ce).add(new Oe(new Q(this))))}}}),j(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ae(this._stepper).to(n),s=Object.keys(n);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 r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new le(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ae(this._stepper).to(new pt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Q.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ae(this._stepper).type(r?he:Q);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||d(t,o),h=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:d}=new $(s).transform(o._currentTransform(this));let f=new Q({...t,origin:[l,d]}),p=this._isDeclarative&&a?a:h;if(r){f=f.decompose(l,d),p=p.decompose(l,d);const t=f.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);f.rotate=r[s]}e&&(n||(f.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(f);const m=i.at(c);return u=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 r=new ae(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new pt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ae(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),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 r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);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,r,n){return this._queueObject("viewbox",new K(t,e,r,n))},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)}}),j(Se,{rx:_t,ry:St,from:Tt,to:kt}),M(Se,"Runner");class je extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new vt):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:A((function(){return this.put(new je)}))}}),M(je,"Svg",!0);class Ae extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:A((function(){return this.put(new Ae)}))}}),M(Ae,"Symbol");var Ee={__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,r=this.bbox()){return this.x(t,r).y(e,r)},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,r=this.bbox()){return this.cx(t,r).cy(e,r)},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 De extends xt{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 r=this.dom.leading;this.each((function(n){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?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 r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"!==e[n].nodeName?(n!==r&&3!==e[n].nodeType&&!0===S(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent):0===n&&(r=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}j(De,Ee),i({Container:{text:A((function(t=""){return this.put(new De).text(t)})),plain:A((function(t=""){return this.put(new De).plain(t)}))}}),M(De,"Text");class Te extends xt{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 De))return this;const e=t.index(this),r=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new pt(r);return this.dy(e?n: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)}}j(Te,Ee),i({Tspan:{tspan:A((function(t=""){const e=new Te;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(Te,"Tspan");class ke extends xt{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))}}j(ke,{x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt}),i({Container:{circle:A((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 nt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:A((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:A((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(((r,n)=>{let i;try{i=r.bbox()}catch(t){return}const s=new Q(r),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);r.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,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=l(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new $(r).transform(new Q(t).inverse());t.scale(i,s,n.x,n.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)}}j(ze,Le),i({Container:{group:A((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)}}j(Re,Le),i({Container:{link:A((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 r=e.index(t);return e.add(this,r),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 Ve extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return nt("svg [mask*="+this.id()+"]")}}i({Container:{mask:A((function(){return this.defs().put(new Ve)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ve?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Ve,"Mask");class Fe 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,r){return this.put(new Fe).update(t,e,r)}}}),M(Fe,"Stop");class qe extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}i("Dom",{style(t,e){return this.put(new qe).rule(t,e)},fontface(t,e,r){return this.put(new qe).font(t,e,r)}}),M(qe,"Style");class Ge extends De{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 r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}i({Container:{textPath:A((function(t,e){return t instanceof De||(t=this.text(t)),t.path(e)}))},Text:{path:A((function(t,e=!0){const r=new Ge;let n;if(t instanceof fe||(t=this.defs().path(t)),r.attr("href","#"+t,m),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:A((function(t){return t instanceof De||(t=(new De).addTo(this.parent()).text(t)),t.path(this)})),targets(){return nt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Ge.prototype.MorphArray=se,M(Ge,"TextPath");class Xe extends xt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:A((function(t,e){return this.put(new Xe).use(t,e)}))}}),M(Xe,"Use"),j([je,Ae,Rt,zt,Gt],s("viewbox")),j([qt,ge,me,fe],s("marker")),j(De,s("Text")),j(fe,s("Path")),j(vt,s("Defs")),j([De,Te],s("Tspan")),j([ye,Et,Lt,Se],s("radius")),j(ct,s("EventTarget")),j(gt,s("Dom")),j(yt,s("Element")),j(xt,s("Shape")),j([wt,Dt],s("Container")),j(Lt,s("Gradient")),j(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){de.push(...[].concat(t))}([pt,H,K,Q,ft,Vt,se,$]),j(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,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Ye=r(726),Ue=r(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 r=document.createElementNS("http://www.w3.org/2000/svg","text");r.textContent=e;var n=new t(r);return n.assignUUID(),n.setAttributes(t.defaultAttributes),n},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,Ye.bringToFront)(this.domNode)},t.prototype.sendToBack=function(){(0,Ye.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 De(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,Ye.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 De(this.domNode).bbox();return{x:t.cx,y:t.cy}},set:function(t){new De(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},t.prototype.maintainingCenterPoint=function(t){var e=this.centerPoint;t(),this.centerPoint=e},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}()})(),n})(),t.exports=e()},298:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>c,Scaling:()=>h,VerticalClientScaling:()=>l,assignUUID:()=>u});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const i=new Uint8Array(16);function s(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+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 u(t){t.id="uuid-"+a()}var h=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}(),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.width/e.width},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.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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>n,degrees:()=>m,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return Math.abs(t-e)<=r}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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n,magnitude:()=>r}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{areWithin:()=>a,centroid:()=>f,deepCopy:()=>s,direction:()=>l,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=r(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(r){return e(r)&&(0,t.isFiniteNumber)(r.x)&&(0,t.isFiniteNumber)(r.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var r=e.x-t.x,n=e.y-t.y;return Math.pow(Math.pow(r,2)+Math.pow(n,2),.5)}function a(t,e,r){return o(t,e)<=r}function u(t,e){return{x:e.x-t.x,y:e.y-t.y}}function h(t,e){return{x:t.x+e.x,y:t.y+e.y}}var c=r(30);function l(t,e){return(0,c.direction)(u(t,e))}var d=r(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])}})(),n})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return"number"==typeof t}function n(t){return r(t)&&Number.isFinite(t)}function i(t){return r(t)&&!Number.isFinite(t)}function s(t){return n(t)&&t>0}function o(t){return n(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function c(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>c,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{StraightBond:()=>Qe});const t={},e=[];function i(e,r){if(Array.isArray(e))for(const t of e)i(t,r);else if("object"!=typeof e)o(Object.getOwnPropertyNames(r)),t[e]=Object.assign(t[e]||{},r);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 r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function u(t){return t%360*Math.PI/180}function h(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function d(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,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 v(t,e=f){return g.document.createElementNS(e,t)}function x(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 r=e?g.document.createElement("div"):v("svg");return r.innerHTML=t,t=O(r.firstChild),r.removeChild(r.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:v(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=c(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,r=!1){return b[e]=t,r&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let P=1e3;function N(t){return"Svgjs"+c(t)+P++}function C(t){for(let e=t.children.length-1;e>=0;e--)C(t.children[e]);return t.id?(t.id=N(t.nodeName),t):t}function j(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function A(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}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=x(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=x(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=x(t)).before(this),this},insertAfter:function(t){return(t=x(t)).after(this),this}});const E=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,D=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,T=/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+)?$/,V=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,F=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,q=/[\s,]+/,G=/[MLHVCSQTAZ]/i;function X(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Y(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function U(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(q)},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 r={};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*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=h(e);r[e]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[h(t)];if("object"==typeof t)for(const e in t)this.node.style[h(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[h(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,r){if(null==t)return this.data(a(function(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)e(t[r])&&i.push(t[r]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);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===r||"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,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new H(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=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,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new H(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new H(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new H(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new H(t,e,r,"lab")}if("grey"===t){const t=255*n();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:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new H(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=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 n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,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 r=function(t,e){const r=Y(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Y(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Y(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Y(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Y(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Y(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 r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[r,n,i]=T.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_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),[,r,n,i]=D.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:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="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:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new H(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*U(i,n,t+1/3),o=255*U(i,n,t),a=255*U(i,n,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(X);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,d=h>.008856?Math.pow(h,1/3):7.787*h+16/116,f=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new H(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const r=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==r.x?0:r.x,this.y=null==r.y?0:r.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:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function W(t,e,r){return Math.abs(e-t)<(r||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,d=c.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:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,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,r){const n=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,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new Q(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),d=180/Math.PI*l,f=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/u,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*c+e*(m*f*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+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(q).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,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),d=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,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,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=u(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:c,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=c*n-l*i+r*i-e*n+e,this.f=l*n+c*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=u(t),e=u(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:c,e:l,f:d}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+c*i,this.d=c+h*s,this.e=l+d*i-n*i,this.f=d+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}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:r,y:n}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new $(r,n).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=x().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(q).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),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new K(e,r,n,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,r=-1/0,n=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),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new K(e,n,r-e,i-n)}}function tt(t,e,r){let n;try{if(n=e(t.node),Z(n)&&(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){n=r(t)}var i;return n}i({viewbox:{viewbox(t,e,r,n){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)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=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new $(r/2/s+i.x,n/2/o+i.y);const h=new K(i).transform(new Q({scale:u,origin:e}));return this.viewbox(h)}}}),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)}}j([et],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const rt=["toArray","constructor","each"];function nt(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)=>(rt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),j([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 ut(t,e,r,n,i){const s=r.bind(n||t),o=x(t),a=ot(o),u=at(o);e=Array.isArray(e)?e:e.split(q),r._svgjsListenerId||(r._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function ht(t,e,r,n){const i=x(t),s=ot(i),o=at(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])ht(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ht(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ht(o,[e,u].join("."));delete s[e]}}else{for(t in s)ht(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class ct extends y{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return ht(this,t,e,r),this}on(t,e,r,n){return ut(this,t,e,r,n),this}removeEventListener(){}}function lt(){}M(ct,"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(q).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(E))&&(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 ct{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=x(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 x(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 r=this.node.cloneNode(t);return e&&(r=C(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new gt(v(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=N(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,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.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=x(t),this.add(t,e),t}putIn(t,e){return x(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=x(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),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 r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=S(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=v("wrapper",r),i=g.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}j(gt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=V.test(r.nodeValue)?parseFloat(r.nodeValue):r.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]:V.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,r)=>r(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 r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return nt(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=x(t));const r=new et;let n=this;for(;(n=n.parent())&&n.node!==g.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?x(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 r=l(this,t,e);return this.width(new pt(r.width)).height(new pt(r.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)}}j(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),r=e.node.getBBox();return e.remove(),r}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`)})),r=new K(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.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 r;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(r=bt[t].length-1;r>=0;r--)null!=e[bt[t][r]]&&this.attr(bt.prefix(t,bt[t][r]),e[bt[t][r]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!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(q).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 r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),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 r=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});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(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class vt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(vt,"Defs");class xt 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 Pt(t){return this.attr("cx",t)}function Nt(t){return this.attr("cy",t)}function Ct(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function jt(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(xt,"Shape");var At={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt};class Et extends xt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const r=l(this,t,e);return this.rx(new pt(r.width).divide(2)).ry(new pt(r.height).divide(2))}}j(Et,At),i("Container",{ellipse:A((function(t=0,e=t){return this.put(new Et).size(t,e).move(0,0)}))}),M(Et,"Ellipse");class Dt extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(v("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Tt(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(Dt,"Fragment");var Bt,It={__proto__:null,from:Tt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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()+")"}}j(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:A((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,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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:A((function(t,e,r){return this.put(new zt).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends xt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const r=new g.window.Image;return ut(r,"load",(function(t){const n=this.parent(zt);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof zt&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(r,"load error",(function(){ht(r)})),this.attr("href",r.src=t,m)}}Bt=function(t,e,r){return"fill"!==t&&"stroke"!==t||F.test(e)&&(e=r.root().defs().image(e)),e instanceof Rt&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:A((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Vt extends ft{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new K(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.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,r=this.length;e<r;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[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}var Ft={__proto__:null,MorphArray:Vt,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 qt extends xt{constructor(t,e=t){super(_("line",t),e)}array(){return new Vt([[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,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new Vt(t).toLine(),this.attr(t))}size(t,e){const r=l(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}j(qt,Ft),i({Container:{line:A((function(...t){return qt.prototype.plot.apply(this.put(new qt),null!=t[0]?t:[0,0,0,0])}))}}),M(qt,"Line");class Gt 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 Xt(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:A((function(t,e,r){return this.put(new Gt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Gt?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),M(Gt,"Marker");const Yt={"-":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,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Yt[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}j(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:Xt("_duration",Wt),overshoot:Xt("_overshoot",Wt)}),j(class extends $t{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Xt("_windup"),p:Xt("P"),i:Xt("I"),d:Xt("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,r){return e.x=r.x=t[0],e.y=r.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,r){return e.x=r.x,e.y=r.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,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return Jt[t](e,r,n)}}(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 r=G.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}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)&&re(t)}function re(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 ne(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}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 r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!te(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(G.test(n)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");re(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||ne(i)){i.inNumber=!0,i.number=n,ee(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&re(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:q.test(t)?G.test(t)?se:ft:E.test(t)?pt:ue:de.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ft:"object"===e?le:ue};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===le&&(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 ue{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 he{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,he.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}he.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const ce=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class le{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===H&&t[r+7]!==e[r+7]){const e=t[r+7],n=new H(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=oe(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(ce),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const de=[ue,he,le];class fe extends xt{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 r=l(this,t,e);return this.attr("d",this.array().size(r.width,r.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:A((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 Vt(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 Vt(t))},size:function(t,e){const r=l(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class me extends xt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:A((function(t){return this.put(new me).plot(t||new Vt)}))}}),j(me,Ft),j(me,pe),M(me,"Polygon");class ge extends xt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:A((function(t){return this.put(new ge).plot(t||new Vt)}))}}),j(ge,Ft),j(ge,pe),M(ge,"Polyline");class ye extends xt{constructor(t,e=t){super(_("rect",t),e)}}j(ye,{rx:_t,ry:St}),i({Container:{rect:A((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 r=we.timer().now()+e,n=we.timeouts.push({run:t,time:r});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),n},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 r=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==r););let n=null;const i=we.frames.last();for(;n!==i&&(n=we.frames.shift());)n.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}},ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},xe=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends ct{constructor(t=xe){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 r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+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 r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,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],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.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 ct{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,r){let n=1,i=!1,s=0;return e=e||0,r=r||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}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,r){const n=Se.sanitise(t,e,r),i=new Se(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.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,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||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),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=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*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?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,r,n){return this._queue.push({initialiser:t||lt,runner:e||lt,retarget:r,isTransform:n,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,r){if(t instanceof _e||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),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,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.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 r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){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,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}j([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Pe=t=>t.transforms;function Ne(){const t=this._transformationRunners.runners.map(Pe).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ce{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 r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,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 r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--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,r){const n=Se.sanitise(t,e,r),i=this.timeline();return new Se(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.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(Pe).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Ne.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ce).add(new Oe(new Q(this))))}}}),j(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ae(this._stepper).to(n),s=Object.keys(n);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 r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new le(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ae(this._stepper).to(new pt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Q.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ae(this._stepper).type(r?he:Q);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||d(t,o),h=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:d}=new $(s).transform(o._currentTransform(this));let f=new Q({...t,origin:[l,d]}),p=this._isDeclarative&&a?a:h;if(r){f=f.decompose(l,d),p=p.decompose(l,d);const t=f.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);f.rotate=r[s]}e&&(n||(f.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(f);const m=i.at(c);return u=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 r=new ae(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new pt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ae(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),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 r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);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,r,n){return this._queueObject("viewbox",new K(t,e,r,n))},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)}}),j(Se,{rx:_t,ry:St,from:Tt,to:kt}),M(Se,"Runner");class je extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new vt):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:A((function(){return this.put(new je)}))}}),M(je,"Svg",!0);class Ae extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:A((function(){return this.put(new Ae)}))}}),M(Ae,"Symbol");var Ee={__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,r=this.bbox()){return this.x(t,r).y(e,r)},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,r=this.bbox()){return this.cx(t,r).cy(e,r)},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 De extends xt{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 r=this.dom.leading;this.each((function(n){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?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 r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"!==e[n].nodeName?(n!==r&&3!==e[n].nodeType&&!0===S(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent):0===n&&(r=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}j(De,Ee),i({Container:{text:A((function(t=""){return this.put(new De).text(t)})),plain:A((function(t=""){return this.put(new De).plain(t)}))}}),M(De,"Text");class Te extends xt{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 De))return this;const e=t.index(this),r=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new pt(r);return this.dy(e?n: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)}}j(Te,Ee),i({Tspan:{tspan:A((function(t=""){const e=new Te;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(Te,"Tspan");class ke extends xt{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))}}j(ke,{x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt}),i({Container:{circle:A((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 nt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:A((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:A((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(((r,n)=>{let i;try{i=r.bbox()}catch(t){return}const s=new Q(r),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);r.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,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=l(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new $(r).transform(new Q(t).inverse());t.scale(i,s,n.x,n.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)}}j(ze,Le),i({Container:{group:A((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)}}j(Re,Le),i({Container:{link:A((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 r=e.index(t);return e.add(this,r),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 Ve extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return nt("svg [mask*="+this.id()+"]")}}i({Container:{mask:A((function(){return this.defs().put(new Ve)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ve?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Ve,"Mask");class Fe 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,r){return this.put(new Fe).update(t,e,r)}}}),M(Fe,"Stop");class qe extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}i("Dom",{style(t,e){return this.put(new qe).rule(t,e)},fontface(t,e,r){return this.put(new qe).font(t,e,r)}}),M(qe,"Style");class Ge extends De{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 r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}i({Container:{textPath:A((function(t,e){return t instanceof De||(t=this.text(t)),t.path(e)}))},Text:{path:A((function(t,e=!0){const r=new Ge;let n;if(t instanceof fe||(t=this.defs().path(t)),r.attr("href","#"+t,m),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:A((function(t){return t instanceof De||(t=(new De).addTo(this.parent()).text(t)),t.path(this)})),targets(){return nt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Ge.prototype.MorphArray=se,M(Ge,"TextPath");class Xe extends xt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:A((function(t,e){return this.put(new Xe).use(t,e)}))}}),M(Xe,"Use"),j([je,Ae,Rt,zt,Gt],s("viewbox")),j([qt,ge,me,fe],s("marker")),j(De,s("Text")),j(fe,s("Path")),j(vt,s("Defs")),j([De,Te],s("Tspan")),j([ye,Et,Lt,Se],s("radius")),j(ct,s("EventTarget")),j(gt,s("Dom")),j(yt,s("Element")),j(xt,s("Shape")),j([wt,Dt],s("Container")),j(Lt,s("Gradient")),j(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){de.push(...[].concat(t))}([pt,H,K,Q,ft,Vt,se,$]),j(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,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Ye=r(726),Ue=r(725),He=r(854),$e=["basePadding1","basePadding2"],We={basePadding1:"setBasePadding1",basePadding2:"setBasePadding2"},Qe=function(){function t(t,e,r){var n=this;this.line=t,this.base1=e,this.base2=r,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 n.reposition()})),r.addEventListener("move",(function(){return n.reposition()}))}return t.between=function(e,r){var n=new t((new qt).node,e,r);return n.assignUUID(),n.set(t.defaultValues),n.reposition(),n},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 qt(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,Ye.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(r){try{e[We[r]](t[r])}catch(t){}}))},t.prototype.reposition=function(){var t=this.base1.centerPoint,e=this.base2.centerPoint,r=(0,Ue.direction)(t,e);this.setAttribute("x1","".concat(t.x+this.basePadding1*Math.cos(r))),this.setAttribute("y1","".concat(t.y+this.basePadding1*Math.sin(r))),this.setAttribute("x2","".concat(e.x-this.basePadding2*Math.cos(r))),this.setAttribute("y2","".concat(e.y-this.basePadding2*Math.sin(r)))},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}()})(),n})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>c,Scaling:()=>h,VerticalClientScaling:()=>l,assignUUID:()=>u,bringToFront:()=>d,sendToBack:()=>f});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let n;const i=new Uint8Array(16);function s(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+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 u(t){t.id="uuid-"+a()}var h=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}(),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.width/e.width},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.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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){var e=0;return t.forEach((function(t){return e+=t})),e}function n(t){return r(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>n,clamp:()=>d,degrees:()=>g,isBetweenExclusive:()=>l,isBetweenInclusive:()=>c,max:()=>h,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>r});var s=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,s=e.length;i<s;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||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 r=e.length/2,i=r-1;return n([e[r],e[i]])}function u(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 h(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 c(t,e,r){return t>=e&&t<=r}function l(t,e,r){return t>e&&t<r}function d(t,e,r){return t<e?e:t>r?r:t}function f(t,e,r){return Math.abs(t-e)<=r}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{DotBracketDrawer:()=>nr,Drawing:()=>Ke,Nucleobase:()=>Ue.Nucleobase,StraightBond:()=>We.StraightBond});const t={},e=[];function i(e,r){if(Array.isArray(e))for(const t of e)i(t,r);else if("object"!=typeof e)o(Object.getOwnPropertyNames(r)),t[e]=Object.assign(t[e]||{},r);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 r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function u(t){return t%360*Math.PI/180}function h(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function l(t,e,r,n){return null!=e&&null!=r||(n=n||t.bbox(),null==e?e=n.width/n.height*r:null==r&&(r=n.height/n.width*e)),{width:e,height:r}}function d(t,e){const r=t.origin;let n=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=r&&([n,i]=Array.isArray(r)?r:"object"==typeof r?[r.x,r.y]:[r,r]);const s="string"==typeof n,o="string"==typeof i;if(s||o){const{height:t,width:r,x:a,y:u}=e.bbox();s&&(n=n.includes("left")?a:n.includes("right")?a+r:a+r/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[n,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 v(t,e=f){return g.document.createElementNS(e,t)}function x(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 r=e?g.document.createElement("div"):v("svg");return r.innerHTML=t,t=O(r.firstChild),r.removeChild(r.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:v(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=c(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,r=!1){return b[e]=t,r&&(b[w]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let P=1e3;function N(t){return"Svgjs"+c(t)+P++}function C(t){for(let e=t.children.length-1;e>=0;e--)C(t.children[e]);return t.id?(t.id=N(t.nodeName),t):t}function j(t,e){let r,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(r in e)t[n].prototype[r]=e[r]}function A(t){return function(...e){const r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}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=x(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=x(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=x(t)).before(this),this},insertAfter:function(t){return(t=x(t)).after(this),this}});const E=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,D=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,T=/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+)?$/,V=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,F=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,q=/[\s,]+/,G=/[MLHVCSQTAZ]/i;function X(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function Y(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function U(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(q)},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 r={};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*/);r[e[0]]=e[1]})),r;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=h(e);r[e]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[h(t)];if("object"==typeof t)for(const e in t)this.node.style[h(e)]=null==t[e]||R.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[h(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,r){if(null==t)return this.data(a(function(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)e(t[r])&&i.push(t[r]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const r of t)e[r]=this.data(r);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===r||"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,r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new H(t,e,r,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?n():e)/.5+.01)+150),r=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,r,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new H(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new H(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new H(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new H(t,e,r,"lab")}if("grey"===t){const t=255*n();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:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.min(1-n,1-i,1-s);return 1===o?new H(0,0,0,1,"cmyk"):new H((1-n-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=Math.max(n,i,s),a=Math.min(n,i,s),u=(o+a)/2,h=o===a,c=o-a;return new H(360*(h?0:o===n?((i-s)/c+(i<s?6:0))/6:o===i?((s-n)/c+2)/6:o===s?((n-i)/c+4)/6:0),100*(h?0:u>.5?c/(2-o-a):c/(o+a)),100*u,"hsl")}init(t=0,e=0,r=0,n=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 n?n:i,n="string"==typeof n?0:n,Object.assign(this,{_a:t,_b:e,_c:r,_d:n,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 r=function(t,e){const r=Y(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Y(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Y(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Y(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Y(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Y(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 r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(z.test(t)){const e=t.replace(I,""),[r,n,i]=T.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:r,_b:n,_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),[,r,n,i]=D.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:r,_b:n,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d:u}=this,h="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:u}:{};Object.assign(this,h)}lab(){const{x:t,y:e,z:r}=this.xyz();return new H(116*e-16,500*(t-e),200*(e-r),"lab")}lch(){const{l:t,a:e,b:r}=this.lab(),n=Math.sqrt(e**2+r**2);let i=180*Math.atan2(r,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new H(t,n,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:n,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,r=Math.PI/180;i=t*Math.cos(r*e),s=t*Math.sin(r*e)}const o=(n+16)/116,a=i/500+o,u=o-s/200,h=16/116,c=.008856,l=7.787;t=.95047*(a**3>c?a**3:(a-h)/l),e=1*(o**3>c?o**3:(o-h)/l),r=1.08883*(u**3>c?u**3:(u-h)/l)}const n=3.2406*t+-1.5372*e+-.4986*r,i=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r,o=Math.pow,a=.0031308,u=n>a?1.055*o(n,1/2.4)-.055:12.92*n,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,c=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new H(255*u,255*h,255*c)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,e/=100,r/=100,0===e)return r*=255,new H(r,r,r);const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,s=255*U(i,n,t+1/3),o=255*U(i,n,t),a=255*U(i,n,t-1/3);return new H(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:n}=this,i=255*(1-Math.min(1,t*(1-n)+n)),s=255*(1-Math.min(1,e*(1-n)+n)),o=255*(1-Math.min(1,r*(1-n)+n));return new H(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:r,_d:n,space:i}=this;return[t,e,r,n,i]}toHex(){const[t,e,r]=this._clamped().map(X);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[n,i,s]=[t,e,r].map((t=>t/255)),o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,c=(.2126*o+.7152*a+.0722*u)/1,l=(.0193*o+.1192*a+.9505*u)/1.08883,d=h>.008856?Math.pow(h,1/3):7.787*h+16/116,f=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116;return new H(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:r}=this.rgb(),{max:n,min:i,round:s}=Math;return[t,e,r].map((t=>n(0,i(s(t),255))))}}class ${constructor(...t){this.init(...t)}clone(){return new $(this)}init(t,e){const r=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==r.x?0:r.x,this.y=null==r.y?0:r.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:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}}function W(t,e,r){return Math.abs(e-t)<(r||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,n=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]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,a=t.scale&&t.scale.length?t.scale[1]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleY)?t.scaleY*n:n,u=t.shear||0,h=t.rotate||t.theta||0,c=new $(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=c.x,d=c.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:u,theta:h,rx:w.x,ry:w.y,tx:y,ty:b,ox:l,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,r){const n=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,u=t.f+t.b*e.e+t.d*e.f;return r.a=n,r.b=i,r.c=s,r.d=o,r.e=a,r.f=u,r}around(t,e,r){return this.clone().aroundO(t,e,r)}aroundO(t,e,r){const n=t||0,i=e||0;return this.translateO(-n,-i).lmultiplyO(r).translateO(n,i)}clone(){return new Q(this)}decompose(t=0,e=0){const r=this.a,n=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=r*s-n*i,h=u>0?1:-1,c=h*Math.sqrt(r*r+n*n),l=Math.atan2(h*n,h*r),d=180/Math.PI*l,f=Math.cos(l),p=Math.sin(l),m=(r*i+n*s)/u,g=i*c/(m*r-n)||s*c/(m*n+r);return{scaleX:c,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*c+e*(m*f*c-p*g),translateY:a-e+t*p*c+e*(m*p*c+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(q).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,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r;if(!o)throw new Error("Cannot invert "+this);const a=n/o,u=-e/o,h=-r/o,c=t/o,l=-(a*i+h*s),d=-(u*i+c*s);return this.a=a,this.b=u,this.c=h,this.d=c,this.e=l,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,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=u(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:c,f:l}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-h*i,this.d=h*n+a*i,this.e=c*n-l*i+r*i-e*n+e,this.f=l*n+c*i-e*i-r*n+r,this}scale(t,e,r,n){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t);const{a:i,b:s,c:o,d:a,e:u,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=a*e,this.e=u*t-r*t+r,this.f=h*e-n*e+n,this}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){const{a:n,b:i,c:s,d:o,e:a,f:u}=this;return this.a=n+i*t,this.c=s+o*t,this.e=a+u*t-r*t,this}skew(t,e,r,n){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=u(t),e=u(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:c,e:l,f:d}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+c*i,this.d=c+h*s,this.e=l+d*i-n*i,this.f=d+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}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:r,y:n}=new $(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-n).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,n);if(isFinite(e.px)||isFinite(e.py)){const t=new $(r,n).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=x().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(q).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),r=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-r;return new K(e,r,n,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,r=-1/0,n=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),r=Math.max(r,s.x),n=Math.min(n,s.y),i=Math.max(i,s.y)})),new K(e,n,r-e,i-n)}}function tt(t,e,r){let n;try{if(n=e(t.node),Z(n)&&(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){n=r(t)}var i;return n}i({viewbox:{viewbox(t,e,r,n){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,r,n))},zoom(t,e){let{width:r,height:n}=this.attr(["width","height"]);if((r||n)&&"string"!=typeof r&&"string"!=typeof n||(r=this.node.clientWidth,n=this.node.clientHeight),!r||!n)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=r/i.width,o=n/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new $(r/2/s+i.x,n/2/o+i.y);const h=new K(i).transform(new Q({scale:u,origin:e}));return this.viewbox(h)}}}),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)}}j([et],{each(t,...e){return"function"==typeof t?this.map(((e,r,n)=>t.call(e,e,r,n))):this.map((r=>r[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const rt=["toArray","constructor","each"];function nt(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)=>(rt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),j([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 ut(t,e,r,n,i){const s=r.bind(n||t),o=x(t),a=ot(o),u=at(o);e=Array.isArray(e)?e:e.split(q),r._svgjsListenerId||(r._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],n=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][n]=a[e][n]||{},a[e][n][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function ht(t,e,r,n){const i=x(t),s=ot(i),o=at(i);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(q)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(r)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][r],n||!1),delete s[e][a||"*"][r]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])ht(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ht(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ht(o,[e,u].join("."));delete s[e]}}else{for(t in s)ht(o,t);!function(t){let e=t.getEventHolder();e===g.window&&(e=st),e.events&&(e.events={})}(i)}}))}class ct extends y{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(const e in r)for(const n in r[e])r[e][n](t);return!t.defaultPrevented}fire(t,e,r){return this.dispatch(t,e,r),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,r){return ht(this,t,e,r),this}on(t,e,r,n){return ut(this,t,e,r,n),this}removeEventListener(){}}function lt(){}M(ct,"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(q).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(E))&&(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 ct{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=x(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 x(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 r=this.node.cloneNode(t);return e&&(r=C(r)),new this.constructor(r)}each(t,e){const r=this.children();let n,i;for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}element(t,e){return this.put(new gt(v(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=N(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,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return r&&r.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=x(t),this.add(t,e),t}putIn(t,e){return x(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=x(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const r=10**t,n=this.attr(e);for(const t in n)"number"==typeof n[t]&&(n[t]=Math.round(n[t]*r)/r);return this.attr(n),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 r=e.index(this);return e.put(t,r).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=S(r.node.cloneNode(!0)),e){const e=t(r);if(r=e||r,!1===e)return""}r.each((function(){const e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)}),!0)}return e?r.node.outerHTML:r.node.innerHTML}e=null!=e&&e;const n=v("wrapper",r),i=g.document.createDocumentFragment();n.innerHTML=t;for(let t=n.children.length;t--;)i.appendChild(n.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}j(gt,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=V.test(r.nodeValue)?parseFloat(r.nodeValue):r.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]:V.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,r)=>r(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 r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return nt(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=x(t));const r=new et;let n=this;for(;(n=n.parent())&&n.node!==g.document&&"#document-fragment"!==n.nodeName&&(r.push(n),e||n.node!==t.node)&&(!e||!n.matches(t));)if(n.node===this.root().node)return null;return r}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?x(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 r=l(this,t,e);return this.width(new pt(r.width)).height(new pt(r.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)}}j(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),r=e.node.getBBox();return e.remove(),r}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`)})),r=new K(e);return t?r.transform(t.screenCTM().inverseO()):r.addOffset()},inside:function(t,e){const r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.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 r;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(r=bt[t].length-1;r>=0;r--)null!=e[bt[t][r]]&&this.attr(bt.prefix(t,bt[t][r]),e[bt[t][r]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,r,n,i,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:n},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,n){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:n},!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(q).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 r=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(n.multiply(r)),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 r=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});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(r,n){return n[n.length-r-1].toParent(t,e)})),this.remove()}}M(wt,"Container");class vt extends wt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}M(vt,"Defs");class xt 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 Pt(t){return this.attr("cx",t)}function Nt(t){return this.attr("cy",t)}function Ct(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function jt(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}M(xt,"Shape");var At={__proto__:null,rx:_t,ry:St,x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt};class Et extends xt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const r=l(this,t,e);return this.rx(new pt(r.width).divide(2)).ry(new pt(r.height).divide(2))}}j(Et,At),i("Container",{ellipse:A((function(t=0,e=t){return this.put(new Et).size(t,e).move(0,0)}))}),M(Et,"Ellipse");class Dt extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,r){if("boolean"==typeof t&&(r=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(v("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}}function Tt(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(Dt,"Fragment");var Bt,It={__proto__:null,from:Tt,to:kt};class Lt extends wt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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()+")"}}j(Lt,It),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:A((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,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new K}targets(){return nt("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:A((function(t,e,r){return this.put(new zt).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),M(zt,"Pattern");class Rt extends xt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const r=new g.window.Image;return ut(r,"load",(function(t){const n=this.parent(zt);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof zt&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(r,"load error",(function(){ht(r)})),this.attr("href",r.src=t,m)}}Bt=function(t,e,r){return"fill"!==t&&"stroke"!==t||F.test(e)&&(e=r.root().defs().image(e)),e instanceof Rt&&(e=r.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:A((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),M(Rt,"Image");class Vt extends ft{bbox(){let t=-1/0,e=-1/0,r=1/0,n=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),r=Math.min(i[0],r),n=Math.min(i[1],n)})),new K(r,n,t-r,e-n)}move(t,e){const r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(q).map(parseFloat)).length%2!=0&&t.pop();for(let r=0,n=t.length;r<n;r+=2)e.push([t[r],t[r+1]]);return e}size(t,e){let r;const n=this.bbox();for(r=this.length-1;r>=0;r--)n.width&&(this[r][0]=(this[r][0]-n.x)*t/n.width+n.x),n.height&&(this[r][1]=(this[r][1]-n.y)*e/n.height+n.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,r=this.length;e<r;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[r,n]=this[e];this[e][0]=t.a*r+t.c*n+t.e,this[e][1]=t.b*r+t.d*n+t.f}return this}}var Ft={__proto__:null,MorphArray:Vt,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 qt extends xt{constructor(t,e=t){super(_("line",t),e)}array(){return new Vt([[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,r,n){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:n}:new Vt(t).toLine(),this.attr(t))}size(t,e){const r=l(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}j(qt,Ft),i({Container:{line:A((function(...t){return qt.prototype.plot.apply(this.put(new qt),null!=t[0]?t:[0,0,0,0])}))}}),M(qt,"Line");class Gt 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 Xt(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:A((function(t,e,r){return this.put(new Gt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)}))},marker:{marker(t,e,r,n){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Gt?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),M(Gt,"Marker");const Yt={"-":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,r,n){return function(i){return i<0?t>0?e/t*i:r>0?n/r*i:0:i>1?r<1?(1-n)/(1-r)*i+(n-r)/(1-r):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*n+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(n,i=!1)=>{let s=Math.floor(n*t);const o=n*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,n>=0&&s<0&&(s=0),n<=1&&s>r&&(s=r),s/r}}};class Ut{done(){return!1}}class Ht extends Ut{constructor(t=">"){super(),this.ease=Yt[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class $t extends Ut{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}}function Wt(){const t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,n=Math.log(e/100+1e-10),i=-n/Math.sqrt(r*r+n*n),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}j(class extends $t{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;const i=n.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*r+s*r*r/2;return n.velocity=i+s*r,n.done=Math.abs(e-o)+Math.abs(i)<.002,n.done?e:o}},{duration:Xt("_duration",Wt),overshoot:Xt("_overshoot",Wt)}),j(class extends $t{constructor(t=.1,e=.01,r=0,n=1e3){super(),this.p(t).i(e).d(r).windup(n)}step(t,e,r,n){if("string"==typeof t)return t;if(n.done=r===1/0,r===1/0)return e;if(0===r)return t;const i=e-t;let s=(n.integral||0)+i*r;const o=(i-(n.error||0))/r,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),n.error=i,n.integral=s,n.done=Math.abs(i)<.001,n.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Xt("_windup"),p:Xt("P"),i:Xt("I"),d:Xt("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,r){return e.x=r.x=t[0],e.y=r.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,r){return e.x=r.x,e.y=r.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,r,n){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(let t=0,n=e.length;t<n;++t)e[t]=e[t]+(t%2?r.y:r.x);return Jt[t](e,r,n)}}(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 r=G.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase(),n=e===r;t.segment=["m"===r?n?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}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)&&re(t)}function re(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 ne(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),r=t.segment.length;return e&&(4===r||5===r)}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 r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(let r,n=this.length-1;n>=0;n--)r=this[n][0],"M"===r||"L"===r||"T"===r?(this[n][1]+=t,this[n][2]+=e):"H"===r?this[n][1]+=t:"V"===r?this[n][1]+=e:"C"===r||"S"===r||"Q"===r?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===r&&(this[n][5]+=t,this[n][6]+=e)):"A"===r&&(this[n][6]+=t,this[n][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let r=0,n="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new $,p:new $};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!te(i,n))if("."!==n)if(isNaN(parseInt(n)))if(" "!==n&&","!==n)if("-"!==n)if("E"!==n.toUpperCase()){if(G.test(n)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");re(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||ne(i)){i.inNumber=!0,i.number=n,ee(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&re(i),i.segments}(t)}size(t,e){const r=this.bbox();let n,i;for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;n>=0;n--)i=this[n][0],"M"===i||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this}toString(){return function(t){let e="";for(let r=0,n=t.length;r<n;r++)e+=t[r][0],null!=t[r][1]&&(e+=t[r][1],null!=t[r][2]&&(e+=" ",e+=t[r][2],null!=t[r][3]&&(e+=" ",e+=t[r][3],e+=" ",e+=t[r][4],null!=t[r][5]&&(e+=" ",e+=t[r][5],e+=" ",e+=t[r][6],null!=t[r][7]&&(e+=" ",e+=t[r][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?H.isColor(t)?H:q.test(t)?G.test(t)?se:ft:E.test(t)?pt:ue:de.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ft:"object"===e?le:ue};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===le&&(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 ue{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 he{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,he.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}he.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const ce=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class le{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let r=0,n=e.length;r<n;++r){if(e[r+1]===t[r+1]){if(e[r+1]===H&&t[r+7]!==e[r+7]){const e=t[r+7],n=new H(this.values.splice(r+3,5))[e]().toArray();this.values.splice(r+3,0,...n)}r+=e[r+2]+2;continue}if(!t[r+1])return this;const n=(new t[r+1]).toArray(),i=e[r+2]+3;e.splice(r,i,t[r],t[r+1],t[r+2],...n),r+=e[r+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const r in t){const n=oe(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort(ce),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const r=e.shift(),n=e.shift(),i=e.shift(),s=e.splice(0,i);t[r]=new n(s)}return t}}const de=[ue,he,le];class fe extends xt{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 r=l(this,t,e);return this.attr("d",this.array().size(r.width,r.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:A((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 Vt(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 Vt(t))},size:function(t,e){const r=l(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}};class me extends xt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:A((function(t){return this.put(new me).plot(t||new Vt)}))}}),j(me,Ft),j(me,pe),M(me,"Polygon");class ge extends xt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:A((function(t){return this.put(new ge).plot(t||new Vt)}))}}),j(ge,Ft),j(ge,pe),M(ge,"Polyline");class ye extends xt{constructor(t,e=t){super(_("rect",t),e)}}j(ye,{rx:_t,ry:St}),i({Container:{rect:A((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 r=we.timer().now()+e,n=we.timeouts.push({run:t,time:r});return null===we.nextDraw&&(we.nextDraw=g.window.requestAnimationFrame(we._draw)),n},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 r=we.timeouts.last();for(;(e=we.timeouts.shift())&&(t>=e.time?e.run():we.timeouts.push(e),e!==r););let n=null;const i=we.frames.last();for(;n!==i&&(n=we.frames.shift());)n.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}},ve=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},xe=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends ct{constructor(t=xe){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 r=Math.abs(e);return this.speed(t?-r:r)}schedule(t,e,r){if(null==t)return this._runners.map(ve);let n=0;const i=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)n=i;else if("absolute"===r||"start"===r)n=e,e=0;else if("now"===r)n=this._time;else if("relative"===r){const r=this.getRunnerInfoById(t.id);r&&(n=r.start+e,e=0)}else{if("with-last"!==r)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();n=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:n+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 r=e-this._lastSourceTime;t&&(r=0);const n=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=n,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],r=e.runner;this._time-e.start<=0&&r.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const r=this._runners[t],s=r.runner;let o=n;const a=this._time-r.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==r.persist&&s.duration()-s.time()+this._time+r.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 ct{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,r){let n=1,i=!1,s=0;return e=e||0,r=r||"last","object"!=typeof(t=t||400)||t instanceof Ut||(e=t.delay||e,r=t.when||r,i=t.swing||i,n=t.times||n,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:n,wait:s,when:r}}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,r){const n=Se.sanitise(t,e,r),i=new Se(n.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(n).schedule(n.delay,n.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,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||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),r=(this._time-t*e)/this._duration;return Math.min(t+r,this._times)}const r=t%1,n=e*Math.floor(t)+this._duration*r;return this.time(n)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,r=this._duration,n=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*(n+r))/(n+r)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(n+r))/r+i;return Math.max(Math.min(a,1),0)},u=i*(n+r)-n;return a=e<=0?Math.round(t(1e-5)):e<u?t(e):Math.round(t(u-1e-5)),a}const u=Math.floor(this.loops()),h=s&&u%2==0;return a=u+(h&&!o||o&&h?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,r,n){return this._queue.push({initialiser:t||lt,runner:e||lt,retarget:r,isTransform:n,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,r){if(t instanceof _e||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const n=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<n&&this._time>=n;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=n,this._reseted=!1;let a=!1;return(r||o)&&(this._initialise(r),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,r=this._queue.length;e<r;++e){const r=this._queue[e],n=this._isDeclarative||!r.initialised&&t;t=!r.finished,n&&t&&(r.initialiser.call(this),r.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 r=0,n=this._queue.length;r<n;++r){const n=this._queue[r],i=n.runner.call(this,t);n.finished=n.finished||!0===i,e=e&&n.finished}return e}_tryRetarget(t,e,r){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,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const n=this.timeline();return n&&n.play(),!0}return!1}}Se.id=0;class Oe{constructor(t=new Q,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}j([Se,Oe],{mergeWith(t){return new Oe(t.transforms.lmultiply(this.transforms),t.id)}});const Me=(t,e)=>t.lmultiplyO(e),Pe=t=>t.transforms;function Ne(){const t=this._transformationRunners.runners.map(Pe).reduce(Me,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ce{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 r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,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 r=this.runners[e];if(!(t&&r.done&&t.done)||r._timeline&&r._timeline._runnerIds.includes(r.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=r;else{this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--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,r){const n=Se.sanitise(t,e,r),i=this.timeline();return new Se(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.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(Pe).reduce(Me,new Q)},_addRunner(t){this._transformationRunners.add(t),we.cancelImmediate(this._frameId),this._frameId=we.immediate(Ne.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ce).add(new Oe(new Q(this))))}}}),j(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("string"==typeof e)return this.styleAttr(t,{[e]:r});let n=e;if(this._tryRetarget(t,n))return this;let i=new ae(this._stepper).to(n),s=Object.keys(n);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 r=Object.keys(e),o=(a=s,r.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),r=new le(i.from()).valueOf();Object.assign(r,e),i.from(r)}const u=new le(i.to()).valueOf();Object.assign(u,e),i.to(u),s=r,n=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new ae(this._stepper).to(new pt(t));return this.queue((function(){r=r.from(this.element().zoom())}),(function(t){return this.element().zoom(r.at(t),e),r.done()}),(function(t,n){e=n,r.to(t)})),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Q.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new ae(this._stepper).type(r?he:Q);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||d(t,o),h=new Q(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(c){e||this.clearTransform();const{x:l,y:d}=new $(s).transform(o._currentTransform(this));let f=new Q({...t,origin:[l,d]}),p=this._isDeclarative&&a?a:h;if(r){f=f.decompose(l,d),p=p.decompose(l,d);const t=f.rotate,e=p.rotate,r=[t-360,t,t+360],n=r.map((t=>Math.abs(t-e))),i=Math.min(...n),s=n.indexOf(i);f.rotate=r[s]}e&&(n||(f.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(f);const m=i.at(c);return u=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 r=new ae(this._stepper).to(e);let n=null;return this.queue((function(){n=this.element()[t](),r.from(n),r.to(n+e)}),(function(e){return this.element()[t](r.at(e)),r.done()}),(function(t){r.to(n+new pt(t))})),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new ae(this._stepper).to(e);return this.queue((function(){r.from(this.element()[t]())}),(function(e){return this.element()[t](r.at(e)),r.done()})),this._rememberMorpher(t,r),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 r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,n){if(4===arguments.length)return this.plot([t,e,r,n]);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,r,n){return this._queueObject("viewbox",new K(t,e,r,n))},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)}}),j(Se,{rx:_t,ry:St,from:Tt,to:kt}),M(Se,"Runner");class je extends wt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new vt):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:A((function(){return this.put(new je)}))}}),M(je,"Svg",!0);class Ae extends wt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:A((function(){return this.put(new Ae)}))}}),M(Ae,"Symbol");var Ee={__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,r=this.bbox()){return this.x(t,r).y(e,r)},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,r=this.bbox()){return this.cx(t,r).cy(e,r)},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 De extends xt{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 r=this.dom.leading;this.each((function(n){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",n?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 r=0;t="";for(let n=0,i=e.length;n<i;++n)"textPath"!==e[n].nodeName?(n!==r&&3!==e[n].nodeType&&!0===S(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent):0===n&&(r=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,r=(t=(t+"").split("\n")).length;e<r;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}j(De,Ee),i({Container:{text:A((function(t=""){return this.put(new De).text(t)})),plain:A((function(t=""){return this.put(new De).plain(t)}))}}),M(De,"Text");class Te extends xt{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 De))return this;const e=t.index(this),r=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new pt(r);return this.dy(e?n: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)}}j(Te,Ee),i({Tspan:{tspan:A((function(t=""){const e=new Te;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),M(Te,"Tspan");class ke extends xt{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))}}j(ke,{x:Ot,y:Mt,cx:Pt,cy:Nt,width:Ct,height:jt}),i({Container:{circle:A((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 nt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:A((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:A((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(((r,n)=>{let i;try{i=r.bbox()}catch(t){return}const s=new Q(r),o=s.translate(t,e).transform(s.inverse()),a=new $(i.x,i.y).transform(o);r.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,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)},size:function(t,e,r=this.bbox()){const n=l(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(((t,e)=>{const n=new $(r).transform(new Q(t).inverse());t.scale(i,s,n.x,n.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)}}j(ze,Le),i({Container:{group:A((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)}}j(Re,Le),i({Container:{link:A((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 r=e.index(t);return e.add(this,r),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 Ve extends wt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return nt("svg [mask*="+this.id()+"]")}}i({Container:{mask:A((function(){return this.defs().put(new Ve)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Ve?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),M(Ve,"Mask");class Fe 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,r){return this.put(new Fe).update(t,e,r)}}}),M(Fe,"Stop");class qe extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let r=t+"{";for(const t in e)r+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return r+="}",r}(t,e))}}i("Dom",{style(t,e){return this.put(new qe).rule(t,e)},fontface(t,e,r){return this.put(new qe).font(t,e,r)}}),M(qe,"Style");class Ge extends De{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 r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}i({Container:{textPath:A((function(t,e){return t instanceof De||(t=this.text(t)),t.path(e)}))},Text:{path:A((function(t,e=!0){const r=new Ge;let n;if(t instanceof fe||(t=this.defs().path(t)),r.attr("href","#"+t,m),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)})),textPath(){return this.findOne("textPath")}},Path:{text:A((function(t){return t instanceof De||(t=(new De).addTo(this.parent()).text(t)),t.path(this)})),targets(){return nt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Ge.prototype.MorphArray=se,M(Ge,"TextPath");class Xe extends xt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:A((function(t,e){return this.put(new Xe).use(t,e)}))}}),M(Xe,"Use"),j([je,Ae,Rt,zt,Gt],s("viewbox")),j([qt,ge,me,fe],s("marker")),j(De,s("Text")),j(fe,s("Path")),j(vt,s("Defs")),j([De,Te],s("Tspan")),j([ye,Et,Lt,Se],s("radius")),j(ct,s("EventTarget")),j(gt,s("Dom")),j(yt,s("Element")),j(xt,s("Shape")),j([wt,Dt],s("Container")),j(Lt,s("Gradient")),j(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){de.push(...[].concat(t))}([pt,H,K,Q,ft,Vt,se,$]),j(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,r,n,i){return this.fromArray(t.map((function(t,s){return n.step(t,e[s],r,i[s],i)})))}});var Ye=r(726),Ue=r(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=r(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 r=We.StraightBond.between(t,e);return r.set(this.primaryBondDefaultValues),this.append(r),r}}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 r=We.StraightBond.between(t,e);return r.set(this.secondaryBondDefaultValues),this.append(r),r}}class Ke{constructor(){this.domNode=(new je).node,this.domNode.setAttribute("viewBox","0 0 250 250"),this.domNode.setAttribute("width","250"),this.domNode.setAttribute("height","250"),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,r=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${t} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(r*e).toString())}get maxX(){return this.minX+this.width}set maxX(t){let e=t-this.minX,r=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(r*e).toString())}get minY(){return this.domNode.viewBox.baseVal.y}set minY(t){let e=this.maxY-t,r=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${t} ${this.width} ${e}`),this.domNode.setAttribute("height",(r*e).toString())}get maxY(){return this.minY+this.height}set maxY(t){let e=t-this.minY,r=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${this.width} ${e}`),this.domNode.setAttribute("height",(r*e).toString())}setBoundaries({minX:t,maxX:e,minY:r,maxY:n}){this.minX=t,this.maxX=e,this.minY=r,this.maxY=n}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 Ye.HorizontalClientScaling(this.domNode).get()}get verticalClientScaling(){return new Ye.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 tr=r(127),er=r(661),rr=r(986);class nr{constructor(t){this.targetDrawing=t}draw(t,e){let r=[...t].map((t=>this.targetDrawing.addBase(t)));(0,tr.consecutivePairs)(r).forEach((t=>this.targetDrawing.addPrimaryBond(...t)));let n=[...(0,tr.parseDotBracket)(r,e)];n.forEach((t=>this.targetDrawing.addSecondaryBond(...t))),r.forEach((t=>t.bringToFront()));let i=1.87*(0,rr.mean)(r.map((t=>t.bbox.height)));(0,er.radialize)(r,n,{spacing:i,basePairSpacing:i/2,hairpinLoopSpacing:i/2})}}})(),n})(),t.exports=e()},925:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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:()=>n,HorizontalScrollbarThumb:()=>r,Scrollbars:()=>o,VerticalScrollbar:()=>s,VerticalScrollbarThumb:()=>i});class r{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 n{constructor(t){this.targetElement=t,this.thumb=new r(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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(t){return t.map((t=>({v:t,priority:Math.random()}))).sort(((t,e)=>t.priority-e.priority)).map((({v:t})=>t))}function n(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}t.r(e),t.d(e,{DownloadableFile:()=>i,EventfulSet:()=>s,detectMac:()=>n,shuffled:()=>r});class i{constructor(t){this.textContent=t}downloadAs(t,e){let r=new File([this.textContent],t,{type:e.type}),n=URL.createObjectURL(r),i=document.createElement("a");i.href=n,i.download=r.name,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(n)}}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 r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{RNAcanvas:()=>c});var t=r(662),e=r(925);class i{constructor(){this.domNode=document.createElement("div"),this.domNode.style.overflow="auto";let t=document.createElement("div"),r=document.createElement("div"),n=document.createElement("div");t.style.flexGrow="1",r.style.flexGrow="0",n.style.flexGrow="1",this.domNode.style.display="flex",this.domNode.style.flexDirection="column",this.domNode.append(t,r,n);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",r.style.display="flex",r.style.flexDirection="row",r.append(i,s,o);let a=document.createElement("div");this.contentContainer=document.createElement("div");let u=document.createElement("div");a.style.flexGrow="1",this.contentContainer.style.flexGrow="0",u.style.flexGrow="1",s.style.display="flex",s.style.flexDirection="column",s.append(a,this.contentContainer,u),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,r){this.targetDrawing=t,this.horizontalScrollbar=e,this.verticalScrollbar=r}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=r(460),a=r(106),u=r(524),h=r(124);class c{constructor(){this.selectedSVGElements=new a.EventfulSet,this.domNode=document.createElement("div"),this.domNode.style.background="repeating-conic-gradient(#eee 0% 25%, white 0% 50%) 50% / 20px 20px",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.backgroundColor="white",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.pinchToScaleFeature=new o.PinchToScaleFeature(this.drawing.domNode,this.horizontalDrawingScrollbar,this.verticalDrawingScrollbar),this.selectedSVGElementHighlightings=new u.LiveSVGElementHighlightings(this.selectedSVGElements,this.drawing.domNode),this.selectedSVGElementHighlightings.appendTo(this.overlaidDrawing.domNode),this.clickSelectTool=new o.ClickSelectTool(this.drawing.domNode,this.selectedSVGElements),this.selectingRect=new o.SelectingRect(this.drawing.domNode,this.selectedSVGElements),this.selectingRect.appendTo(this.overlaidDrawing.domNode),this.selectedBases=new h.SelectedBases(this.drawing,this.selectedSVGElements),this.consecutiveBasesSelectingTool=new h.ConsecutiveBasesSelectingTool(this.drawing,this.selectedBases),this.draggingTool=new h.DraggingTool(this.drawing,{svgElements:this.selectedSVGElements,bases:this.selectedBases},{beforeDragging:()=>this.hideOverlaidDrawing(),afterDragging:()=>this.unhideOverlaidDrawing()}),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}hideOverlaidDrawing(){this.overlaidDrawing.domNode.style.visibility="hidden"}unhideOverlaidDrawing(){this.overlaidDrawing.domNode.style.visibility="visible"}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}}})(),n})()));