@rnacanvas/app-object 3.10.3 → 3.12.0
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/RNAcanvas.d.ts +2 -0
- package/dist/RNAcanvas.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -3
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:()=>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=.5,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})()));
|
|
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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),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,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),u=(0,i.min)(r),h=o;h<=u;h++)s.push(h);e.push(s),n=r,r=t.shift()}return e},t}();function h(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>l,PositionPairs:()=>t,Stems:()=>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 n=e.flat(),r=t.findIndex((function(t){return n.includes(t)}));if(r<0)throw new Error("No paired bases present in sequence.");return t[r]},t}(),i=n(986),s=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");var n=e.flat().map((function(e){return t.indexOf(e)}));if((0,i.max)(n)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(n)]},t}(),o=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var n=(new(e.bind.apply(e,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),r=t.indexOf(n);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)},t}(),a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var e=(new(s.bind.apply(s,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),n=t.indexOf(e);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(n+1)},t}(),u=n(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],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Stems(e,n).get().map((function(t){return t.map((function(t){return[e[t[0]-1],e[t[1]-1]]}))}))},e}(),l=function(){function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return e.prototype.get=function(){var e=this.targetStructure[0],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Linkers(e,n).get().map((function(t){return t.map((function(t){return e[t-1]}))}))},e}()})(),r})(),t.exports=e()},173:function(t){var e;e=()=>(()=>{var t={422:function(t){t.exports=(()=>{var t={138:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}return t.r(e),t.d(e,{average:()=>r,mean:()=>r,sum:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function t(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}n.r(r),n.d(r,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=n(138);function s(t){return{x:(0,i.mean)(t.map((function(t){return t.x}))),y:(0,i.mean)(t.map((function(t){return t.y})))}}function o(t,e){return s([t,e])}})(),r})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{CircularSegment:()=>a,Semicircle:()=>e});var t=n(422),e=function(){function e(t){this.chord=t}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return Math.PI*this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcAngle",{get:function(){return Math.PI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){return(0,t.midpoint)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),e}(),i=n(872),s=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(r<=i)throw new Error("Arc length is too small.");if(r>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(r/i*Math.sin(s)-s)/(r/i*Math.cos(s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e+=(Math.PI-this.arcAngle)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(r<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(r/i*Math.sin(Math.PI-s)-s)/(-r/i*Math.cos(Math.PI-s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e-=(this.arcAngle-Math.PI)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function n(n,r){this.chord=n,this.moreProps=r;var i=r.arcLength,a=(0,t.distance)(n[0],n[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var u=a<.001&&i<.001,h=Math.PI*a/2,l=Math.abs(i-h)<.001;this.wrappedCircularSegment=u||l?new e(n):i<h?new s(n,{arcLength:i}):new o(n,{arcLength:i})}return Object.defineProperty(n.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),n}()})(),r})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,degrees:()=>m,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return Math.abs(t-e)<=n}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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>c,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=n(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(n){return e(n)&&(0,t.isFiniteNumber)(n.x)&&(0,t.isFiniteNumber)(n.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function a(t,e,n){return o(t,e)<=n}function 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 l=n(30);function c(t,e){return(0,l.direction)(u(t,e))}var f=n(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])}})(),r})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),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,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),u=(0,i.min)(r),h=o;h<=u;h++)s.push(h);e.push(s),n=r,r=t.shift()}return e},t}();function h(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Centroid:()=>s,Direction:()=>d,MaxCenterX:()=>u,MaxCenterY:()=>l,MinCenterX:()=>a,MinCenterY:()=>h,NucleobaseMock:()=>t,circularize:()=>w,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>p,flipY:()=>m,linearize:()=>b,radialize:()=>L,rotate:()=>f,round:()=>S,shift:()=>e,stemmify:()=>x,straighten:()=>v});class t{constructor(t){this.props=t}getCenterPoint(){return this.props.centerPoint}setCenterPoint(t){this.props.centerPoint=t}}function e(t,e){t.forEach((t=>{let n=t.getCenterPoint();t.setCenterPoint({x:n.x+e.x,y:n.y+e.y})}))}var i=n(725);class s{constructor(t){this.targetBases=t}get(){let t=this.targetBases.map((t=>t.getCenterPoint()));return(0,i.centroid)(t)}set(t){let n=this.get(),r=(0,i.displacement)(n,t);e(this.targetBases,r)}}var o=n(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}class l{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}var c=n(30);function f(t,e){if(0==t.length)return;let n=new s(t).get();t.forEach((t=>{let r=t.getCenterPoint(),s=(0,i.distance)(n,r),o=(0,c.direction)((0,i.displacement)(n,r));o+=e,t.setCenterPoint({x:n.x+s*Math.cos(o),y:n.y+s*Math.sin(o)})}))}class 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,c.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 n=t.getCenterPoint(),r=n.y-e;t.setCenterPoint({x:n.x,y:e-r})}))}function m(t){let e=new s(t).get().x;t.forEach((t=>{let n=t.getCenterPoint(),r=n.x-e;t.setCenterPoint({x:e-r,y:n.y})}))}function g(t){if(0==t.length)return;let n=t[0],{x:r,y:s}=n.getCenterPoint(),o={x:r,y:s},a=new d(t).get();f(t,-a),p(t),f(t,a),e(t,(0,i.displacement)(n.getCenterPoint(),o))}function y(t){let e=new s(t),{x:n,y:r}=e.get(),i=n,o=r,a=new d(t).get();f(t,-a),m(t),f(t,a),e.set({x:i,y:o})}function b(t,e){let{spacing:n}=e;if(t.length<2)return;let r=new d(t),i=r.get(),o=new s(t),{x:a,y:u}=o.get(),h={x:a,y:u};t.forEach(((t,e)=>{t.setCenterPoint({x:e*n,y:0})})),r.set(i),o.set(h)}function v(t){if(t.length<3)return;let e=t[0],n=t[t.length-1],r=[e.getCenterPoint(),n.getCenterPoint()],s=(0,i.distance)(r[0],r[1]),o=(0,c.direction)((0,i.displacement)(r[0],r[1])),a=s/(t.length-1),u=a*Math.cos(o),h=a*Math.sin(o),{x:l,y:f}=r[0];t.forEach((t=>{t.setCenterPoint({x:l,y:f}),l+=u,f+=h}))}function x(t,n){let{basePairLength:r,basePairSpacing:o}=n;if(t.length<2)return;let a=Math.ceil(t.length/2),u=t.slice(0,a),h=t.slice(a),l=new s(t),{x:c,y:p}=l.get(),m={x:c,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],v=t[t.length-1];e(u,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(h,(0,i.displacement)(v.getCenterPoint(),{x:r,y:0})),f(t,g),l.set(m)}function w(t,e){let{spacing:n,terminiGap:r}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),u=o,h=a,l=new d(t).get(),c=n*(t.length-1);c+=r,Math.abs(c)<1e-5&&(c=1e-5);let p=c/(2*Math.PI),m=Math.PI/2+2*Math.PI*(.5*r/c);t.forEach(((t,e)=>{let r=m+2*Math.PI*(e*n)/c;t.setCenterPoint({x:p*Math.cos(r),y:p*Math.sin(r)})})),f(t,l),i.set({x:u,y:h})}var _=n(173);function S(t,n){let{spacing:r}=n;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],u=(0,i.distance)(a[0],a[1]),h=r*(t.length-1);if(h-u<.001)return void v(t);if(u<.001){let{x:n,y:o}=s.getCenterPoint();return w(t,{spacing:r,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:n,y:o}))}let l=new _.CircularSegment(a,{arcLength:h}),f=l.parentCircleCenterPoint,d=l.parentCircleRadius,p=(0,c.direction)((0,i.displacement)(f,s.getCenterPoint())),m=l.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 M=n(127),P=n(369);class O{static from(t){return{to:e=>({inclusive:()=>{let n=e-t+1;return Array.from({length:n},((e,n)=>t+n))}})}}}class C{static of(...t){let[e,n]=t,r=new M.PositionPairs(...t).get();r=(0,P.sorted)(r);let i=r.map((t=>t.map((t=>t-1)))),s=[],a=0;return e.forEach(((t,e)=>{let n=i.find((t=>t.includes(e)));n&&e==(0,o.min)(n)?(s.push(a),a+=1):n&&e==(0,o.max)(n)?(a-=1,s.push(a)):s.push(a)})),s}}class N{constructor(...t){let[e,n]=t;this.rawForm=t,this.mountainPlotTraversal=C.of(...t),this.positionPairs=new M.PositionPairs(...t).get(),this.indexPairs=this.positionPairs.map((t=>[t[0]-1,t[1]-1])),this.pairedBases=new Set(n.flat()),this.pairedIndices=new Set(e.map(((t,e)=>({b:t,i:e}))).filter((t=>this.pairedBases.has(t.b))).map((t=>t.i)))}[Symbol.iterator](){return this.rawForm.values()}get sequence(){return this.rawForm[0]}get basePairs(){return this.rawForm[1]}}class A{static correspondingTo(t){return{in:e=>t.map((t=>e.sequence.indexOf(t)))}}}class T{static composedOf(t){if(0==t.length)throw new Error("All stems must have at least one base-pair.");let n=t[0],r=t[t.length-1],s=t.map((t=>t[0])),o=t.map((t=>t[1])).reverse(),a=n[0],u=n[1],h=[...s,...o];return{[Symbol.iterator]:()=>t.values(),bottomBasePair:n,topBasePair:r,side5:s,side3:o,flat:()=>h,firstBase:a,lastBase:u,stemmify:()=>({with:t=>{let{basePairLength:n,basePairSpacing:r}=t,s=Object.assign({},a.getCenterPoint());x(h,{basePairLength:n,basePairSpacing:r}),e(h,(0,i.displacement)(a.getCenterPoint(),s))}})}}}class j{static in(t){return{[Symbol.iterator]:()=>new M.Stems(t.sequence,t.basePairs).get().map((t=>T.composedOf(t))).values()}}}class E{static composedOf(t){if(t.length<2)throw new Error("Linkers must have at least two bases.");let n=t[0],r=t[t.length-1],s=t.slice(1,-1);return{in:o=>{let a=o.sequence.indexOf(n),u=o.sequence.indexOf(r),h=O.from(a).to(u).inclusive(),l=!!o.indexPairs.find((t=>t.includes(a)&&t.includes(u))),c=h.every((t=>0==o.mountainPlotTraversal[t])),f=1==new Set(h.map((t=>o.mountainPlotTraversal[t]))).size&&!l;return{[Symbol.iterator]:()=>t.values(),indices:h,firstBase:n,lastBase:r,firstIndex:a,lastIndex:u,unpairedBases:{[Symbol.iterator]:()=>s.values(),stemmify:()=>({with:t=>{let{spacing:n}=t;if(s.length<3)return;let r=s[0],o=s[s.length-1],a=Object.assign({},r.getCenterPoint());x(s,{basePairLength:(0,i.distance)(r.getCenterPoint(),o.getCenterPoint()),basePairSpacing:n}),e(s,(0,i.displacement)(r.getCenterPoint(),a))}})},get middleThreeUnpairedBases(){if(s.length<3)throw new Error("This linker has less than three unpaired bases.");if(s.length%2==0)throw new Error("This linker has an even number of unpaired bases.");let t=Math.floor(s.length/2);return[s[t-1],s[t],s[t+1]]},isHairpinLoop:()=>l,isInOutermostLoop:()=>c,isBetweenSiblingStems:()=>f,round:()=>({with:e=>{let{spacing:n}=e;S(t,{spacing:n})}})}}}}}class D{static in(t){let e=new M.Linkers(t.sequence,t.basePairs).get().map((e=>E.composedOf(e).in(t)));return{[Symbol.iterator]:()=>e.values(),thatAreHairpinLoops:{[Symbol.iterator]:()=>e.filter((t=>t.isHairpinLoop())).values()},inOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>t.isInOutermostLoop())).values()},notInOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).values(),betweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).filter((t=>t.isBetweenSiblingStems())).values()}},notBetweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isBetweenSiblingStems())).values()}}}}class k{static closedBy(n){return{in:r=>{let s=n.topBasePair,a=A.correspondingTo(s).in(r),u=(0,o.min)(a),h=r.sequence.filter(((t,e)=>e>(0,o.min)(a)&&e<(0,o.max)(a)&&r.mountainPlotTraversal[e]==r.mountainPlotTraversal[u]+1)),l=h.map((t=>r.sequence.indexOf(t))),c=h.filter((t=>r.pairedBases.has(t))),f=l.filter((t=>r.pairedIndices.has(t))),d=[s[0],...h,s[1]];return{[Symbol.iterator]:()=>d.values(),parentStructure:r,closingStem:n,closingBasePair:s,closingIndexPair:a,enclosedBases:h,enclosedIndices:l,enclosedPairedBases:c,enclosedPairedIndices:f,get platform(){if(0==f.length)throw new Error("This loop does not have a platform.");let n=(0,o.min)(f),u=(0,o.max)(f),h=r.sequence.filter(((t,e)=>e>=n&&e<=u&&l.includes(e)&&[e-1,e,e+1].some((t=>f.includes(t)))));return{[Symbol.iterator]:()=>h.values(),firstIndex:n,lastIndex:u,arch:()=>({with:r=>{let{spacing:l}=r,c=(0,o.max)([h.length-2,n-(0,o.min)(a)-1,(0,o.max)(a)-u-1,0]),f=O.from(1).to(c).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());w([s[0],...f,...h,...d,s[1]],{spacing:l,terminiGap:l}),e([...s,...h],(0,i.displacement)(s[0].getCenterPoint(),p))}})}}}}}}}class B{static of(t){let e=t.sequence.filter(((e,n)=>0==t.mountainPlotTraversal[n]));return{[Symbol.iterator]:()=>e.values()}}}function L(t,e,n){var r;let{spacing:i,basePairSpacing:o}=n,a=null!==(r=n.hairpinLoopSpacing)&&void 0!==r?r:i,u=new N(t,e);if(t.length<2)return;if(0==e.length)return void w(t,{spacing:i,terminiGap:2*i});let h=Object.assign({},new s(t).get()),l=new d(t).get(),c=j.in(u),f=D.in(u);w([...B.of(u)],{spacing:i,terminiGap:2*i});let p=[...c].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(l),new s(t).set(h)}})(),r})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{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 n=[...this.targetDrawing.bases],r=n.findIndex((e=>e.domNode===t.target));if(r<0)return;let i=n.findIndex((t=>t.domNode===e.target));if(i<0)return;try{let t=n[i];if(!this.selectedBases.include(t))return}catch(t){console.error(t)}let s=Math.min(i,r),o=Math.max(i,r);this.selectedBases.addAll(n.slice(s,o+1))}}class 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)))}addEventListener(t,e){this.selectedSVGElements.addEventListener(t,e)}}var i=n(661);class s{constructor(t,e,n){this.targetDrawing=t,this.selectedElements=e,this.options=n,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 n=t.movementX/this.targetDrawing.horizontalClientScaling,r=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:n,y:r}),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}}})(),r})(),t.exports=e()},524: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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Box:()=>e});var t=n(986);class e{static bounding(n){let r=n.map((t=>e.matching(t))),i=(0,t.min)(r.map((t=>t.left))),s=(0,t.min)(r.map((t=>t.top))),o=(0,t.max)(r.map((t=>t.right)))-i,a=(0,t.max)(r.map((t=>t.bottom)))-s;return new e(i,s,o,a)}static matching(t){let{x:n,y:r,width:i,height:s}=t;return new e(n,r,i,s)}constructor(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r}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 n=e.matching(t);return this.minX>=n.minX&&this.minY>=n.minY&&this.maxX<=n.maxX&&this.maxY<=n.maxY}padded(t,n){return"number"!=typeof n&&(n=t),new e(this.x-t,this.y-n,this.width+2*t,this.height+2*n)}}})(),r})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{CoordinateSystem:()=>h,HorizontalClientScaling:()=>c,Scaling:()=>l,VerticalClientScaling:()=>f,assignUUID:()=>u,bringToFront:()=>d,sendToBack:()=>p});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function 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}(),l=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}(),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()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{BoxHighlighting:()=>s,LiveSVGElementHighlightings:()=>a});var t,e=n(645),i=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};class s{constructor(){t.set(this,.2),this.domNode=document.createElementNS("http://www.w3.org/2000/svg","g"),this.boxTrace=document.createElementNS("http://www.w3.org/2000/svg","path"),this.topLeftCornerBox=document.createElementNS("http://www.w3.org/2000/svg","path"),this.topRightCornerBox=document.createElementNS("http://www.w3.org/2000/svg","path"),this.bottomRightCornerBox=document.createElementNS("http://www.w3.org/2000/svg","path"),this.bottomLeftCornerBox=document.createElementNS("http://www.w3.org/2000/svg","path"),this.domNode.append(this.boxTrace,...this.cornerBoxes),this.domNode.style.pointerEvents="none",this.boxTrace.setAttribute("stroke","blue"),this.boxTrace.setAttribute("stroke-width",`${i(this,t,"f")}`),this.boxTrace.setAttribute("fill","none"),this.cornerBoxes.forEach((e=>{e.setAttribute("stroke","blue"),e.setAttribute("stroke-width",`${i(this,t,"f")}`),e.setAttribute("fill","white")}))}get cornerBoxes(){return[this.topLeftCornerBox,this.topRightCornerBox,this.bottomRightCornerBox,this.bottomLeftCornerBox]}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}cornerBoxD({centerPoint:e}){return`M ${e.x-i(this,t,"f")} ${e.y-i(this,t,"f")} H ${e.x+i(this,t,"f")} V ${e.y+i(this,t,"f")} H `+(e.x-i(this,t,"f"))+" z"}highlight(t){let n=e.Box.matching(t);this.boxTrace.setAttribute("d",`M ${n.x} ${n.y} h ${n.width} v ${n.height} h ${-n.width} z`),this.topLeftCornerBox.setAttribute("d",this.cornerBoxD({centerPoint:{x:n.minX,y:n.minY}})),this.topRightCornerBox.setAttribute("d",this.cornerBoxD({centerPoint:{x:n.maxX,y:n.minY}})),this.bottomRightCornerBox.setAttribute("d",this.cornerBoxD({centerPoint:{x:n.maxX,y:n.maxY}})),this.bottomLeftCornerBox.setAttribute("d",this.cornerBoxD({centerPoint:{x:n.minX,y:n.maxY}})),this.highlightedBox=n}get lineThickness(){return i(this,t,"f")}set lineThickness(t){[this.boxTrace,...this.cornerBoxes].forEach((e=>{e.setAttribute("stroke-width",`${t}`)})),!this.highlightedBox||this.highlight(this.highlightedBox)}setOpacity(t){this.domNode.setAttribute("opacity",`${t}`)}}t=new WeakMap;var o=n(726);class a{constructor(t,e){this.targetSVGElements=t,this.domNode=document.createElementNS("http://www.w3.org/2000/svg","g"),this.boxHighlightings=[],this.parentSVGDocCoordinateSystem=new o.CoordinateSystem(e),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.boxHighlightings.length).forEach((()=>{let t=new s;t.appendTo(this.domNode),this.boxHighlightings.push(t)}));let e=.5/this.parentSVGDocCoordinateSystem.horizontalScaling;t.forEach(((t,n)=>{try{let r=this.boxHighlightings[n];r.highlight(t.getBBox()),r.lineThickness=e,r.setOpacity(1)}catch(t){console.error(t)}})),this.boxHighlightings.slice(t.length).forEach((t=>t.setOpacity(0)))}}})(),r})(),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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Box:()=>e});var t=n(986);class e{static bounding(n){let r=n.map((t=>e.matching(t))),i=(0,t.min)(r.map((t=>t.left))),s=(0,t.min)(r.map((t=>t.top))),o=(0,t.max)(r.map((t=>t.right)))-i,a=(0,t.max)(r.map((t=>t.bottom)))-s;return new e(i,s,o,a)}static matching(t){let{x:n,y:r,width:i,height:s}=t;return new e(n,r,i,s)}constructor(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r}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 n=e.matching(t);return this.minX>=n.minX&&this.minY>=n.minY&&this.maxX<=n.maxX&&this.maxY<=n.maxY}padded(t,n){return"number"!=typeof n&&(n=t),new e(this.x-t,this.y-n,this.width+2*t,this.height+2*n)}}})(),r})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{CoordinateSystem:()=>h,HorizontalClientScaling:()=>c,Scaling:()=>l,VerticalClientScaling:()=>f,assignUUID:()=>u,bringToFront:()=>d,sendToBack:()=>p});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function 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}(),l=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}(),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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{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=n(726),i=n(645);function s(t){return t instanceof SVGGraphicsElement}class o{constructor(t,n){this.targetSVGDoc=t,this.selectedSVGElements=n,this.defaultLineThickness=.5,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),n=this.targetSVGDocCoordinateSystem.fromClientY(t.clientY),r=`M ${this.lastMouseDownX} ${this.lastMouseDownY} H ${e} V ${n} H ${this.lastMouseDownX} z`;this.domNode.setAttribute("d",r),this.domNode.style.visibility="visible",this.isDrawn=!0}handleMouseUp(t){var e;this.mouseIsDown=!1,this.domNode.style.visibility="hidden";let n=this.isDrawn;if(this.isDrawn=!1,!n)return;let r=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:r,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=n(986);class u{constructor(t,n,r){this.targetSVGDoc=t,this.targetSVGDocCoordinateSystem=new e.CoordinateSystem(t),this.horizontalScrollbar=n,this.verticalScrollbar=r,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,n=this.targetSVGDocCoordinateSystem.horizontalScaling,r=e*n;r=Number.isFinite(r)?r:1,r=(0,a.clamp)(r,.1,500),e=r/n;let i=e*this.horizontalScrollbar.thumb.centerX,s=e*this.verticalScrollbar.thumb.centerY;this.targetSVGDocCoordinateSystem.setScaling(r),this.horizontalScrollbar.thumb.centerX=i,this.verticalScrollbar.thumb.centerY=s}}})(),r})(),t.exports=e()},662:function(t){var e;e=()=>(()=>{var t={127:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),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,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),u=(0,i.min)(r),h=o;h<=u;h++)s.push(h);e.push(s),n=r,r=t.shift()}return e},t}();function h(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>l,PositionPairs:()=>t,Stems:()=>h,TrailingDanglingBases:()=>a,consecutivePairs:()=>f,parseDotBracket:()=>c});class t{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];return this.targetStructure[1].map((e=>[t.indexOf(e[0])+1,t.indexOf(e[1])+1]))}}class e{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let n=e.flat(),r=t.findIndex((t=>n.includes(t)));if(r<0)throw new Error("No paired bases present in sequence.");return t[r]}}var i=n(986);class s{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");let n=e.flat().map((e=>t.indexOf(e)));if((0,i.max)(n)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(n)]}}class o{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let n=new e(...this.targetStructure).get(),r=t.indexOf(n);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)}}class a{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");let e=new s(...this.targetStructure).get(),n=t.indexOf(e);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(n+1)}}var u=n(369);class h{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],n=new t(...this.targetStructure).get();return new u.Stems(e,n).get().map((t=>t.map((t=>[e[t[0]-1],e[t[1]-1]]))))}}class l{constructor(...t){this.targetStructure=t}get(){let e=this.targetStructure[0],n=new t(...this.targetStructure).get();return new u.Linkers(e,n).get().map((t=>t.map((t=>e[t-1]))))}}function c(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,u.parseDotBracket)(e)].map((e=>{let n=e[0],r=e[1];return[t[n-1],t[r-1]]}))}function f(t){return t.length<2?[]:t.slice(0,-1).map(((e,n)=>[t[n],t[n+1]]))}})(),r})(),t.exports=e()},661:function(t){var e;e=()=>(()=>{var t={127:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),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,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),u=(0,i.min)(r),h=o;h<=u;h++)s.push(h);e.push(s),n=r,r=t.shift()}return e},t}();function h(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>l,PositionPairs:()=>t,Stems:()=>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 n=e.flat(),r=t.findIndex((function(t){return n.includes(t)}));if(r<0)throw new Error("No paired bases present in sequence.");return t[r]},t}(),i=n(986),s=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");var n=e.flat().map((function(e){return t.indexOf(e)}));if((0,i.max)(n)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(n)]},t}(),o=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var n=(new(e.bind.apply(e,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),r=t.indexOf(n);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)},t}(),a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var e=(new(s.bind.apply(s,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),n=t.indexOf(e);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(n+1)},t}(),u=n(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],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Stems(e,n).get().map((function(t){return t.map((function(t){return[e[t[0]-1],e[t[1]-1]]}))}))},e}(),l=function(){function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return e.prototype.get=function(){var e=this.targetStructure[0],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Linkers(e,n).get().map((function(t){return t.map((function(t){return e[t-1]}))}))},e}()})(),r})(),t.exports=e()},173:function(t){var e;e=()=>(()=>{var t={422:function(t){t.exports=(()=>{var t={138:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}return t.r(e),t.d(e,{average:()=>r,mean:()=>r,sum:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function t(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}n.r(r),n.d(r,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=n(138);function s(t){return{x:(0,i.mean)(t.map((function(t){return t.x}))),y:(0,i.mean)(t.map((function(t){return t.y})))}}function o(t,e){return s([t,e])}})(),r})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{CircularSegment:()=>a,Semicircle:()=>e});var t=n(422),e=function(){function e(t){this.chord=t}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return Math.PI*this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcAngle",{get:function(){return Math.PI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){return(0,t.midpoint)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),e}(),i=n(872),s=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(r<=i)throw new Error("Arc length is too small.");if(r>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(r/i*Math.sin(s)-s)/(r/i*Math.cos(s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e+=(Math.PI-this.arcAngle)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(r<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(r/i*Math.sin(Math.PI-s)-s)/(-r/i*Math.cos(Math.PI-s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e-=(this.arcAngle-Math.PI)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function n(n,r){this.chord=n,this.moreProps=r;var i=r.arcLength,a=(0,t.distance)(n[0],n[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var u=a<.001&&i<.001,h=Math.PI*a/2,l=Math.abs(i-h)<.001;this.wrappedCircularSegment=u||l?new e(n):i<h?new s(n,{arcLength:i}):new o(n,{arcLength:i})}return Object.defineProperty(n.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),n}()})(),r})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,degrees:()=>m,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return Math.abs(t-e)<=n}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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>c,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=n(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(n){return e(n)&&(0,t.isFiniteNumber)(n.x)&&(0,t.isFiniteNumber)(n.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function a(t,e,n){return o(t,e)<=n}function 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 l=n(30);function c(t,e){return(0,l.direction)(u(t,e))}var f=n(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])}})(),r})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),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,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),u=(0,i.min)(r),h=o;h<=u;h++)s.push(h);e.push(s),n=r,r=t.shift()}return e},t}();function h(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Centroid:()=>s,Direction:()=>d,MaxCenterX:()=>u,MaxCenterY:()=>l,MinCenterX:()=>a,MinCenterY:()=>h,NucleobaseMock:()=>t,circularize:()=>w,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>p,flipY:()=>m,linearize:()=>b,radialize:()=>L,rotate:()=>f,round:()=>S,shift:()=>e,stemmify:()=>x,straighten:()=>v});class t{constructor(t){this.props=t}getCenterPoint(){return this.props.centerPoint}setCenterPoint(t){this.props.centerPoint=t}}function e(t,e){t.forEach((t=>{let n=t.getCenterPoint();t.setCenterPoint({x:n.x+e.x,y:n.y+e.y})}))}var i=n(725);class s{constructor(t){this.targetBases=t}get(){let t=this.targetBases.map((t=>t.getCenterPoint()));return(0,i.centroid)(t)}set(t){let n=this.get(),r=(0,i.displacement)(n,t);e(this.targetBases,r)}}var o=n(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}class l{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}var c=n(30);function f(t,e){if(0==t.length)return;let n=new s(t).get();t.forEach((t=>{let r=t.getCenterPoint(),s=(0,i.distance)(n,r),o=(0,c.direction)((0,i.displacement)(n,r));o+=e,t.setCenterPoint({x:n.x+s*Math.cos(o),y:n.y+s*Math.sin(o)})}))}class 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,c.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 n=t.getCenterPoint(),r=n.y-e;t.setCenterPoint({x:n.x,y:e-r})}))}function m(t){let e=new s(t).get().x;t.forEach((t=>{let n=t.getCenterPoint(),r=n.x-e;t.setCenterPoint({x:e-r,y:n.y})}))}function g(t){if(0==t.length)return;let n=t[0],{x:r,y:s}=n.getCenterPoint(),o={x:r,y:s},a=new d(t).get();f(t,-a),p(t),f(t,a),e(t,(0,i.displacement)(n.getCenterPoint(),o))}function y(t){let e=new s(t),{x:n,y:r}=e.get(),i=n,o=r,a=new d(t).get();f(t,-a),m(t),f(t,a),e.set({x:i,y:o})}function b(t,e){let{spacing:n}=e;if(t.length<2)return;let r=new d(t),i=r.get(),o=new s(t),{x:a,y:u}=o.get(),h={x:a,y:u};t.forEach(((t,e)=>{t.setCenterPoint({x:e*n,y:0})})),r.set(i),o.set(h)}function v(t){if(t.length<3)return;let e=t[0],n=t[t.length-1],r=[e.getCenterPoint(),n.getCenterPoint()],s=(0,i.distance)(r[0],r[1]),o=(0,c.direction)((0,i.displacement)(r[0],r[1])),a=s/(t.length-1),u=a*Math.cos(o),h=a*Math.sin(o),{x:l,y:f}=r[0];t.forEach((t=>{t.setCenterPoint({x:l,y:f}),l+=u,f+=h}))}function x(t,n){let{basePairLength:r,basePairSpacing:o}=n;if(t.length<2)return;let a=Math.ceil(t.length/2),u=t.slice(0,a),h=t.slice(a),l=new s(t),{x:c,y:p}=l.get(),m={x:c,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],v=t[t.length-1];e(u,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(h,(0,i.displacement)(v.getCenterPoint(),{x:r,y:0})),f(t,g),l.set(m)}function w(t,e){let{spacing:n,terminiGap:r}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),u=o,h=a,l=new d(t).get(),c=n*(t.length-1);c+=r,Math.abs(c)<1e-5&&(c=1e-5);let p=c/(2*Math.PI),m=Math.PI/2+2*Math.PI*(.5*r/c);t.forEach(((t,e)=>{let r=m+2*Math.PI*(e*n)/c;t.setCenterPoint({x:p*Math.cos(r),y:p*Math.sin(r)})})),f(t,l),i.set({x:u,y:h})}var _=n(173);function S(t,n){let{spacing:r}=n;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],u=(0,i.distance)(a[0],a[1]),h=r*(t.length-1);if(h-u<.001)return void v(t);if(u<.001){let{x:n,y:o}=s.getCenterPoint();return w(t,{spacing:r,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:n,y:o}))}let l=new _.CircularSegment(a,{arcLength:h}),f=l.parentCircleCenterPoint,d=l.parentCircleRadius,p=(0,c.direction)((0,i.displacement)(f,s.getCenterPoint())),m=l.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 M=n(127),P=n(369);class O{static from(t){return{to:e=>({inclusive:()=>{let n=e-t+1;return Array.from({length:n},((e,n)=>t+n))}})}}}class C{static of(...t){let[e,n]=t,r=new M.PositionPairs(...t).get();r=(0,P.sorted)(r);let i=r.map((t=>t.map((t=>t-1)))),s=[],a=0;return e.forEach(((t,e)=>{let n=i.find((t=>t.includes(e)));n&&e==(0,o.min)(n)?(s.push(a),a+=1):n&&e==(0,o.max)(n)?(a-=1,s.push(a)):s.push(a)})),s}}class N{constructor(...t){let[e,n]=t;this.rawForm=t,this.mountainPlotTraversal=C.of(...t),this.positionPairs=new M.PositionPairs(...t).get(),this.indexPairs=this.positionPairs.map((t=>[t[0]-1,t[1]-1])),this.pairedBases=new Set(n.flat()),this.pairedIndices=new Set(e.map(((t,e)=>({b:t,i:e}))).filter((t=>this.pairedBases.has(t.b))).map((t=>t.i)))}[Symbol.iterator](){return this.rawForm.values()}get sequence(){return this.rawForm[0]}get basePairs(){return this.rawForm[1]}}class A{static correspondingTo(t){return{in:e=>t.map((t=>e.sequence.indexOf(t)))}}}class T{static composedOf(t){if(0==t.length)throw new Error("All stems must have at least one base-pair.");let n=t[0],r=t[t.length-1],s=t.map((t=>t[0])),o=t.map((t=>t[1])).reverse(),a=n[0],u=n[1],h=[...s,...o];return{[Symbol.iterator]:()=>t.values(),bottomBasePair:n,topBasePair:r,side5:s,side3:o,flat:()=>h,firstBase:a,lastBase:u,stemmify:()=>({with:t=>{let{basePairLength:n,basePairSpacing:r}=t,s=Object.assign({},a.getCenterPoint());x(h,{basePairLength:n,basePairSpacing:r}),e(h,(0,i.displacement)(a.getCenterPoint(),s))}})}}}class j{static in(t){return{[Symbol.iterator]:()=>new M.Stems(t.sequence,t.basePairs).get().map((t=>T.composedOf(t))).values()}}}class E{static composedOf(t){if(t.length<2)throw new Error("Linkers must have at least two bases.");let n=t[0],r=t[t.length-1],s=t.slice(1,-1);return{in:o=>{let a=o.sequence.indexOf(n),u=o.sequence.indexOf(r),h=O.from(a).to(u).inclusive(),l=!!o.indexPairs.find((t=>t.includes(a)&&t.includes(u))),c=h.every((t=>0==o.mountainPlotTraversal[t])),f=1==new Set(h.map((t=>o.mountainPlotTraversal[t]))).size&&!l;return{[Symbol.iterator]:()=>t.values(),indices:h,firstBase:n,lastBase:r,firstIndex:a,lastIndex:u,unpairedBases:{[Symbol.iterator]:()=>s.values(),stemmify:()=>({with:t=>{let{spacing:n}=t;if(s.length<3)return;let r=s[0],o=s[s.length-1],a=Object.assign({},r.getCenterPoint());x(s,{basePairLength:(0,i.distance)(r.getCenterPoint(),o.getCenterPoint()),basePairSpacing:n}),e(s,(0,i.displacement)(r.getCenterPoint(),a))}})},get middleThreeUnpairedBases(){if(s.length<3)throw new Error("This linker has less than three unpaired bases.");if(s.length%2==0)throw new Error("This linker has an even number of unpaired bases.");let t=Math.floor(s.length/2);return[s[t-1],s[t],s[t+1]]},isHairpinLoop:()=>l,isInOutermostLoop:()=>c,isBetweenSiblingStems:()=>f,round:()=>({with:e=>{let{spacing:n}=e;S(t,{spacing:n})}})}}}}}class D{static in(t){let e=new M.Linkers(t.sequence,t.basePairs).get().map((e=>E.composedOf(e).in(t)));return{[Symbol.iterator]:()=>e.values(),thatAreHairpinLoops:{[Symbol.iterator]:()=>e.filter((t=>t.isHairpinLoop())).values()},inOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>t.isInOutermostLoop())).values()},notInOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).values(),betweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).filter((t=>t.isBetweenSiblingStems())).values()}},notBetweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isBetweenSiblingStems())).values()}}}}class k{static closedBy(n){return{in:r=>{let s=n.topBasePair,a=A.correspondingTo(s).in(r),u=(0,o.min)(a),h=r.sequence.filter(((t,e)=>e>(0,o.min)(a)&&e<(0,o.max)(a)&&r.mountainPlotTraversal[e]==r.mountainPlotTraversal[u]+1)),l=h.map((t=>r.sequence.indexOf(t))),c=h.filter((t=>r.pairedBases.has(t))),f=l.filter((t=>r.pairedIndices.has(t))),d=[s[0],...h,s[1]];return{[Symbol.iterator]:()=>d.values(),parentStructure:r,closingStem:n,closingBasePair:s,closingIndexPair:a,enclosedBases:h,enclosedIndices:l,enclosedPairedBases:c,enclosedPairedIndices:f,get platform(){if(0==f.length)throw new Error("This loop does not have a platform.");let n=(0,o.min)(f),u=(0,o.max)(f),h=r.sequence.filter(((t,e)=>e>=n&&e<=u&&l.includes(e)&&[e-1,e,e+1].some((t=>f.includes(t)))));return{[Symbol.iterator]:()=>h.values(),firstIndex:n,lastIndex:u,arch:()=>({with:r=>{let{spacing:l}=r,c=(0,o.max)([h.length-2,n-(0,o.min)(a)-1,(0,o.max)(a)-u-1,0]),f=O.from(1).to(c).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());w([s[0],...f,...h,...d,s[1]],{spacing:l,terminiGap:l}),e([...s,...h],(0,i.displacement)(s[0].getCenterPoint(),p))}})}}}}}}}class B{static of(t){let e=t.sequence.filter(((e,n)=>0==t.mountainPlotTraversal[n]));return{[Symbol.iterator]:()=>e.values()}}}function L(t,e,n){var r;let{spacing:i,basePairSpacing:o}=n,a=null!==(r=n.hairpinLoopSpacing)&&void 0!==r?r:i,u=new N(t,e);if(t.length<2)return;if(0==e.length)return void w(t,{spacing:i,terminiGap:2*i});let h=Object.assign({},new s(t).get()),l=new d(t).get(),c=j.in(u),f=D.in(u);w([...B.of(u)],{spacing:i,terminiGap:2*i});let p=[...c].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(l),new s(t).set(h)}})(),r})(),t.exports=e()},358:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>h,VerticalClientScaling:()=>c,assignUUID:()=>u,bringToFront:()=>f,sendToBack:()=>d});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function 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}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();function 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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Nucleobase:()=>Ue});const t={},e=[];function i(e,n){if(Array.isArray(e))for(const t of e)i(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)i(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function a(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function u(t){return t%360*Math.PI/180}function h(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function f(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:u}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[r,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={},v="___SYMBOL___ROOT___";function x(t,e=d){return g.document.createElementNS(e,t)}function w(t,e=!1){if(t instanceof y)return t;if("object"==typeof t)return M(t);if(null==t)return new b[v];if("string"==typeof t&&"<"!==t.charAt(0))return M(g.document.querySelector(t));const n=e?g.document.createElement("div"):x("svg");return n.innerHTML=t,t=M(n.firstChild),n.removeChild(n.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function S(t){if(!t)return null;if(t.instance instanceof y)return t.instance;if("#document-fragment"===t.nodeName)return new b.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":b[e]||(e="Dom"),new b[e](t)}let M=S;function P(t,e=t.name,n=!1){return b[e]=t,n&&(b[v]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let O=1e3;function C(t){return"Svgjs"+l(t)+O++}function N(t){for(let e=t.children.length-1;e>=0;e--)N(t.children[e]);return t.id?(t.id=C(t.nodeName),t):t}function A(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function T(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}i("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=w(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=w(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=w(t)).before(this),this},insertAfter:function(t){return(t=w(t)).after(this),this}});const j=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,E=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,k=/(#[a-z_][a-z0-9\-_]*)/i,B=/\)\s*,?\s*/,L=/\s/g,I=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,F=/^rgb\(/,R=/^(\s+)?$/,q=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,z=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,V=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function Y(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function H(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function G(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(V)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),i("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=h(e);n[e]=this.node.style[t]}return n}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,n){if(null==t)return this.data(a(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),i("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class U{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof U||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new U(t,e,n,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?r():e)/.5+.01)+150),n=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new U(t,n,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new U(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new U(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new U(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new U(t,e,n,"lab")}if("grey"===t){const t=255*r();return new U(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(I.test(t)||F.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new U(0,0,0,1,"cmyk"):new U((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),u=(o+a)/2,h=o===a,l=o-a;return new U(360*(h?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(h?0:u>.5?l/(2-o-a):l/(o+a)),100*u,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=H(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:H(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:H(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:H(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:H(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:H(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(F.test(t)){const e=t.replace(L,""),[n,r,i]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!I.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=E.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d: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:n}=this.xyz();return new U(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new U(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,u=o-s/200,h=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-h)/c),e=1*(o**3>l?o**3:(o-h)/c),n=1.08883*(u**3>l?u**3:(u-h)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,u=r>a?1.055*o(r,1/2.4)-.055:12.92*r,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new U(255*u,255*h,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new U(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*G(i,r,t+1/3),o=255*G(i,r,t),a=255*G(i,r,t-1/3);return new U(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new U(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Y);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,l=(.2126*o+.7152*a+.0722*u)/1,c=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new U(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class W{constructor(...t){this.init(...t)}clone(){return new W(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function $(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,u=t.shear||0,h=t.rotate||t.theta||0,l=new W(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new W(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new W(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,v=new W(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:v.x,ry:v.y,tx:y,ty:b,ox:c,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,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=u,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new Q(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=n*s-r*i,h=u>0?1:-1,l=h*Math.sqrt(n*n+r*r),c=Math.atan2(h*r,h*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/u,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+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 $(this.a,e.a)&&$(this.b,e.b)&&$(this.c,e.c)&&$(this.d,e.d)&&$(this.e,e.e)&&$(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Q.fromArray([1,0,0,1,0,0]);return t=t instanceof yt?t.matrixify():"string"==typeof t?Q.fromArray(t.split(V).map(parseFloat)):Array.isArray(t)?Q.fromArray(t):"object"==typeof t&&Q.isMatrixLike(t)?t:"object"==typeof t?(new Q).transform(t):6===arguments.length?Q.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,u=-e/o,h=-n/o,l=t/o,c=-(a*i+h*s),f=-(u*i+l*s);return this.a=a,this.b=u,this.c=h,this.d=l,this.e=c,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,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=u(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:l,f:c}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-h*i,this.d=h*r+a*i,this.e=l*r-c*i+n*i-e*r+e,this.f=c*r+l*i-e*i-n*r+n,this}scale(t,e,n,r){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e: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-n*t+n,this.f=h*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:u}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+u*t-n*t,this}skew(t,e,n,r){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=u(t),e=u(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:l,e:c,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+l*i,this.d=l+h*s,this.e=c+f*i-r*i,this.f=f+c*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Q.isMatrixLike(t))return new Q(t).multiplyO(this);const e=Q.formatTransforms(t),{x:n,y:r}=new W(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new W(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function J(){if(!J.nodes){const t=w().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)}P(Q,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=g.window.pageXOffset,this.y+=g.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(V).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Z(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Q||(t=new Q(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new W(this.x,this.y),new W(this.x2,this.y),new W(this.x,this.y2),new W(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new K(e,r,n-e,i-r)}}function tt(t,e,n){let r;try{if(r=e(t.node),Z(r)&&(i=t.node)!==g.document&&!(g.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===g.document}).call(g.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}i({viewbox:{viewbox(t,e,n,r){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new W(n/2/s+i.x,r/2/o+i.y);const h=new K(i).transform(new Q({scale:u,origin:e}));return this.viewbox(h)}}}),P(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}A([et],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const nt=["toArray","constructor","each"];function rt(t,e){return new et(a((e||g.document).querySelectorAll(t),(function(t){return S(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),A([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,n,r,i){const s=n.bind(r||t),o=w(t),a=ot(o),u=at(o);e=Array.isArray(e)?e:e.split(V),n._svgjsListenerId||(n._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function ht(t,e,n,r){const i=w(t),s=ot(i),o=at(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(V)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(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 lt extends y{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ht(this,t,e,n),this}on(t,e,n,r){return ut(this,t,e,n,r),this}removeEventListener(){}}function ct(){}P(lt,"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(V).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class pt{constructor(...t){this.init(...t)}convert(t){return new pt(this.value,t)}divide(t){return t=new pt(t),new pt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(j))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof pt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new pt(t),new pt(this-t,this.unit||t.unit)}plus(t){return t=new pt(t),new pt(this+t,this.unit||t.unit)}times(t){return t=new pt(t),new pt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const mt=[];class gt extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=w(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 w(t).put(this,e)}children(){return new et(a(this.node.children,(function(t){return S(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=N(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new gt(x(t),e))}first(){return S(this.node.firstChild)}get(t){return S(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=C(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=w(t),this.add(t,e),t}putIn(t,e){return w(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=w(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,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 n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=S(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=x("wrapper",n),i=g.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}A(gt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=q.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?ft[t]:q.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,n)=>n(t,e,this)),e))?e=new pt(e):U.isColor(e)?e=new U(e):e.constructor===Array&&(e=new dt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return S(this.node.querySelector(t))}}),P(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=w(t));const n=new et;let r=this;for(;(r=r.parent())&&r.node!==g.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?w(e[1]):null}root(){const t=this.parent(b[v]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new pt(n.width)).height(new pt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}A(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new W(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())}}),P(yt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof U||U.isRgb(e)||e instanceof yt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),i("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new pt(t)):this.rx(t).ry(e)}}),i("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new W(this.node.getPointAtLength(t))}}),i(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),i("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),i("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(B).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(V).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Q.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Q)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Q(this).decompose();return null==t?e:e[t]}Q.isMatrixLike(t)||(t={...t,origin:f(t,this)});const n=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class vt extends yt{flatten(t=this,e){return this.each((function(){if(this instanceof vt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}P(vt,"Container");class xt extends vt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}P(xt,"Defs");class wt extends yt{}function _t(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function Mt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Pt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ot(t){return this.attr("cx",t)}function Ct(t){return this.attr("cy",t)}function Nt(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function At(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}P(wt,"Shape");var Tt={__proto__:null,rx:_t,ry:St,x:Mt,y:Pt,cx:Ot,cy:Ct,width:Nt,height:At};class jt extends wt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new pt(n.width).divide(2)).ry(new pt(n.height).divide(2))}}A(jt,Tt),i("Container",{ellipse:T((function(t=0,e=t){return this.put(new jt).size(t,e).move(0,0)}))}),P(jt,"Ellipse");class Et extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Dt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new pt(t),fy:new pt(e)}):this.attr({x1:new pt(t),y1:new pt(e)})}function kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new pt(t),cy:new pt(e)}):this.attr({x2:new pt(t),y2:new pt(e)})}P(Et,"Fragment");var Bt,Lt={__proto__:null,from:Dt,to:kt};class It extends vt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}A(It,Lt),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:T((function(t,e){return this.put(new It(t)).update(e)}))}}),P(It,"Gradient");class Ft extends vt{constructor(t,e=t){super(_("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}i({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:T((function(t,e,n){return this.put(new Ft).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),P(Ft,"Pattern");class Rt extends wt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const n=new g.window.Image;return ut(n,"load",(function(t){const r=this.parent(Ft);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Ft&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(n,"load error",(function(){ht(n)})),this.attr("href",n.src=t,m)}}Bt=function(t,e,n){return"fill"!==t&&"stroke"!==t||z.test(e)&&(e=n.root().defs().image(e)),e instanceof Rt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:T((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),P(Rt,"Image");class qt extends dt{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new K(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(V).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}var zt={__proto__:null,MorphArray:qt,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Vt extends wt{constructor(t,e=t){super(_("line",t),e)}array(){return new qt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new qt(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}A(Vt,zt),i({Container:{line:T((function(...t){return Vt.prototype.plot.apply(this.put(new Vt),null!=t[0]?t:[0,0,0,0])}))}}),P(Vt,"Line");class Xt extends vt{constructor(t,e=t){super(_("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Yt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:T((function(t,e,n){return this.put(new Xt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Xt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),P(Xt,"Marker");const Ht={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Gt{done(){return!1}}class Ut extends Gt{constructor(t=">"){super(),this.ease=Ht[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class Wt extends Gt{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function $t(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}A(class extends Wt{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Yt("_duration",$t),overshoot:Yt("_overshoot",$t)}),A(class extends Wt{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Yt("_windup"),p:Yt("P"),i:Yt("I"),d:Yt("D")});const Qt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jt={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Zt="mlhvqtcsaz".split("");for(let t=0,e=Zt.length;t<e;++t)Jt[Zt[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Jt[t](e,n,r)}}(Zt[t].toUpperCase());function Kt(t){return t.segment.length&&t.segment.length-1===Qt[t.segment[0].toUpperCase()]}function te(t,e){t.inNumber&&ee(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ee(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Kt(t)&&ne(t)}function ne(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Jt[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function re(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends dt{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new W,p:new W};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!te(i,r))if("."!==r)if(isNaN(parseInt(r)))if(" "!==r&&","!==r)if("-"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");ne(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||re(i)){i.inNumber=!0,i.number=r,ee(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&ne(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?U.isColor(t)?U:V.test(t)?X.test(t)?se:dt:j.test(t)?pt:ue:fe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?dt:"object"===e?ce:ue};class ae{constructor(t){this._stepper=t||new Ut("-"),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===U&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ce&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class 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 le=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class ce{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===U&&t[n+7]!==e[n+7]){const e=t[n+7],r=new U(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=oe(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(le),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const fe=[ue,he,ce];class de extends wt{constructor(t,e=t){super(_("path",t),e)}array(){return this._array||(this._array=new se(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new se(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}de.prototype.MorphArray=se,i({Container:{path:T((function(t){return this.put(new de).plot(t||new se)}))}}),P(de,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new qt(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 qt(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class me extends wt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:T((function(t){return this.put(new me).plot(t||new qt)}))}}),A(me,zt),A(me,pe),P(me,"Polygon");class ge extends wt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:T((function(t){return this.put(new ge).plot(t||new qt)}))}}),A(ge,zt),A(ge,pe),P(ge,"Polyline");class ye extends wt{constructor(t,e=t){super(_("rect",t),e)}}A(ye,{rx:_t,ry:St}),i({Container:{rect:T((function(t,e){return this.put(new ye).size(t,e)}))}}),P(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 ve={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>g.window.performance||g.window.Date,transforms:[],frame(t){const e=ve.frames.push({run:t});return null===ve.nextDraw&&(ve.nextDraw=g.window.requestAnimationFrame(ve._draw)),e},timeout(t,e){e=e||0;const n=ve.timer().now()+e,r=ve.timeouts.push({run:t,time:n});return null===ve.nextDraw&&(ve.nextDraw=g.window.requestAnimationFrame(ve._draw)),r},immediate(t){const e=ve.immediates.push(t);return null===ve.nextDraw&&(ve.nextDraw=g.window.requestAnimationFrame(ve._draw)),e},cancelFrame(t){null!=t&&ve.frames.remove(t)},clearTimeout(t){null!=t&&ve.timeouts.remove(t)},cancelImmediate(t){null!=t&&ve.immediates.remove(t)},_draw(t){let e=null;const n=ve.timeouts.last();for(;(e=ve.timeouts.shift())&&(t>=e.time?e.run():ve.timeouts.push(e),e!==n););let r=null;const i=ve.frames.last();for(;r!==i&&(r=ve.frames.shift());)r.run(t);let s=null;for(;s=ve.immediates.shift();)s();ve.nextDraw=ve.timeouts.first()||ve.frames.first()?g.window.requestAnimationFrame(ve._draw):null}},xe=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},we=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends lt{constructor(t=we){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(xe);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}i({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new _e,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?400:t)?new Wt(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof Wt,this._stepper=this._isDeclarative?t:new Ut,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e||0,n=n||"last","object"!=typeof(t=t||400)||t instanceof Gt||(e=t.delay||e,n=t.when||n,i=t.swing||i,r=t.times||r,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Se.sanitise(t,e,n),i=new Se(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new Q,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Ut(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},u=i*(r+n)-r;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,n,r){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof _e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new Q,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Se.id=0;class Me{constructor(t=new Q,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}A([Se,Me],{mergeWith(t){return new Me(t.transforms.lmultiply(this.transforms),t.id)}});const Pe=(t,e)=>t.lmultiplyO(e),Oe=t=>t.transforms;function Ce(){const t=this._transformationRunners.runners.map(Oe).reduce(Pe,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ne{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 Me).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}i({Element:{animate(t,e,n){const r=Se.sanitise(t,e,n),i=this.timeline();return new Se(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Oe).reduce(Pe,new Q)},_addRunner(t){this._transformationRunners.add(t),ve.cancelImmediate(this._frameId),this._frameId=ve.immediate(Ce.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ne).add(new Me(new Q(this))))}}}),A(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ae(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new ce(i.from()).valueOf();Object.assign(n,e),i.from(n)}const u=new ce(i.to()).valueOf();Object.assign(u,e),i.to(u),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ae(this._stepper).to(new pt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=Q.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ae(this._stepper).type(n?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(l){e||this.clearTransform();const{x:c,y:f}=new W(s).transform(o._currentTransform(this));let d=new Q({...t,origin:[c,f]}),p=this._isDeclarative&&a?a:h;if(n){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);d.rotate=n[s]}e&&(r||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(d);const m=i.at(l);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 n=new ae(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new pt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new pt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ae(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new K(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),A(Se,{rx:_t,ry:St,from:Dt,to:kt}),P(Se,"Runner");class Ae extends vt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new xt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof g.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns: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:T((function(){return this.put(new Ae)}))}}),P(Ae,"Svg",!0);class Te extends vt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:T((function(){return this.put(new Te)}))}}),P(Te,"Symbol");var je={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(g.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class Ee extends wt{constructor(t,e=t){super(_("text",t),e),this.dom.leading=new pt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new pt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new pt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"!==e[r].nodeName?(r!==n&&3!==e[r].nodeType&&!0===S(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent):0===r&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}A(Ee,je),i({Container:{text:T((function(t=""){return this.put(new Ee).text(t)})),plain:T((function(t=""){return this.put(new Ee).plain(t)}))}}),P(Ee,"Text");class De extends wt{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 Ee))return this;const e=t.index(this),n=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new pt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}A(De,je),i({Tspan:{tspan:T((function(t=""){const e=new De;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),P(De,"Tspan");class ke extends wt{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))}}A(ke,{x:Mt,y:Pt,cx:Ot,cy:Ct,width:Nt,height:At}),i({Container:{circle:T((function(t=0){return this.put(new ke).size(t).move(0,0)}))}}),P(ke,"Circle");class Be extends vt{constructor(t,e=t){super(_("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return rt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:T((function(){return this.defs().put(new Be)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Be?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),P(Be,"ClipPath");class Le extends yt{constructor(t,e=t){super(_("foreignObject",t),e)}}i({Container:{foreignObject:T((function(t,e){return this.put(new Le).size(t,e)}))}}),P(Le,"ForeignObject");var Ie={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,r)=>{let i;try{i=n.bbox()}catch(t){return}const s=new Q(n),o=s.translate(t,e).transform(s.inverse()),a=new W(i.x,i.y).transform(o);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=c(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach(((t,e)=>{const r=new W(n).transform(new Q(t).inverse());t.scale(i,s,r.x,r.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class Fe extends vt{constructor(t,e=t){super(_("g",t),e)}}A(Fe,Ie),i({Container:{group:T((function(){return this.put(new Fe)}))}}),P(Fe,"G");class Re extends vt{constructor(t,e=t){super(_("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}A(Re,Ie),i({Container:{link:T((function(t){return this.put(new Re).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Re,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),P(Re,"A");class qe extends vt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}i({Container:{mask:T((function(){return this.defs().put(new qe)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof qe?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),P(qe,"Mask");class ze extends yt{constructor(t,e=t){super(_("stop",t),e)}update(t){return("number"==typeof t||t instanceof pt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new pt(t.offset)),this}}i({Gradient:{stop:function(t,e,n){return this.put(new ze).update(t,e,n)}}}),P(ze,"Stop");class Ve extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}i("Dom",{style(t,e){return this.put(new Ve).rule(t,e)},fontface(t,e,n){return this.put(new Ve).font(t,e,n)}}),P(Ve,"Style");class Xe extends Ee{constructor(t,e=t){super(_("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}i({Container:{textPath:T((function(t,e){return t instanceof Ee||(t=this.text(t)),t.path(e)}))},Text:{path:T((function(t,e=!0){const n=new Xe;let r;if(t instanceof de||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:T((function(t){return t instanceof Ee||(t=(new Ee).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Xe.prototype.MorphArray=se,P(Xe,"TextPath");class Ye extends wt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:T((function(t,e){return this.put(new Ye).use(t,e)}))}}),P(Ye,"Use"),A([Ae,Te,Rt,Ft,Xt],s("viewbox")),A([Vt,ge,me,de],s("marker")),A(Ee,s("Text")),A(de,s("Path")),A(xt,s("Defs")),A([Ee,De],s("Tspan")),A([ye,jt,It,Se],s("radius")),A(lt,s("EventTarget")),A(gt,s("Dom")),A(yt,s("Element")),A(wt,s("Shape")),A([vt,Et],s("Container")),A(It,s("Gradient")),A(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){fe.push(...[].concat(t))}([pt,U,K,Q,dt,qt,se,W]),A(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,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var He=n(726),Ge=n(986),Ue=function(){function t(t){var e=this;this.textElement=t,this.eventListeners={move:[]},new MutationObserver((function(){return e.callEventListeners("move")})).observe(t,{attributes:!0,attributeFilter:["x","y"]})}return t.create=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","text");n.textContent=e;var r=new t(n);return r.assignUUID(),r.setAttributes(t.defaultAttributes),r},Object.defineProperty(t.prototype,"domNode",{get:function(){return this.textElement},enumerable:!1,configurable:!0}),t.prototype.appendTo=function(t){t.appendChild(this.domNode)},t.prototype.remove=function(){this.domNode.remove()},t.prototype.isIn=function(t){return t.contains(this.domNode)&&t!==this.domNode},t.prototype.hasParent=function(){return!!this.domNode.parentNode},t.prototype.bringToFront=function(){(0,He.bringToFront)(this.domNode)},t.prototype.sendToBack=function(){(0,He.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 Ee(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,He.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 Ee(this.domNode).bbox();return{x:t.cx,y:t.cy}},set:function(t){new Ee(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,Ge.mean)([t.left,t.right]),y:(0,Ge.mean)([t.top,t.bottom])}},enumerable:!1,configurable:!0}),t.prototype.getCenterClientPoint=function(){return this.centerClientPoint},t.prototype.addEventListener=function(t,e){this.eventListeners[t].push(e)},t.prototype.callEventListeners=function(t){this.eventListeners[t].forEach((function(t){return t()}))},t.defaultAttributes={"font-family":"Arial","font-size":"9","font-weight":"700"},t.defaultAttributeNames=["font-family","font-size","font-weight"],t}()})(),r})(),t.exports=e()},298:function(t){var e;e=()=>(()=>{var t={726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>h,VerticalClientScaling:()=>c,assignUUID:()=>u});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function 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}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();return e})(),t.exports=e()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,degrees:()=>m,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return Math.abs(t-e)<=n}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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>c,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=n(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(n){return e(n)&&(0,t.isFiniteNumber)(n.x)&&(0,t.isFiniteNumber)(n.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function a(t,e,n){return o(t,e)<=n}function 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 l=n(30);function c(t,e){return(0,l.direction)(u(t,e))}var f=n(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])}})(),r})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{StraightBond:()=>Qe});const t={},e=[];function i(e,n){if(Array.isArray(e))for(const t of e)i(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)i(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function a(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function u(t){return t%360*Math.PI/180}function h(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function f(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:u}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[r,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={},v="___SYMBOL___ROOT___";function x(t,e=d){return g.document.createElementNS(e,t)}function w(t,e=!1){if(t instanceof y)return t;if("object"==typeof t)return M(t);if(null==t)return new b[v];if("string"==typeof t&&"<"!==t.charAt(0))return M(g.document.querySelector(t));const n=e?g.document.createElement("div"):x("svg");return n.innerHTML=t,t=M(n.firstChild),n.removeChild(n.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function S(t){if(!t)return null;if(t.instance instanceof y)return t.instance;if("#document-fragment"===t.nodeName)return new b.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":b[e]||(e="Dom"),new b[e](t)}let M=S;function P(t,e=t.name,n=!1){return b[e]=t,n&&(b[v]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let O=1e3;function C(t){return"Svgjs"+l(t)+O++}function N(t){for(let e=t.children.length-1;e>=0;e--)N(t.children[e]);return t.id?(t.id=C(t.nodeName),t):t}function A(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function T(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}i("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=w(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=w(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=w(t)).before(this),this},insertAfter:function(t){return(t=w(t)).after(this),this}});const j=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,E=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,k=/(#[a-z_][a-z0-9\-_]*)/i,B=/\)\s*,?\s*/,L=/\s/g,I=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,F=/^rgb\(/,R=/^(\s+)?$/,q=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,z=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,V=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function Y(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function H(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function G(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(V)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),i("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=h(e);n[e]=this.node.style[t]}return n}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,n){if(null==t)return this.data(a(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),i("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class U{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof U||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new U(t,e,n,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?r():e)/.5+.01)+150),n=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new U(t,n,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new U(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new U(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new U(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new U(t,e,n,"lab")}if("grey"===t){const t=255*r();return new U(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(I.test(t)||F.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new U(0,0,0,1,"cmyk"):new U((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),u=(o+a)/2,h=o===a,l=o-a;return new U(360*(h?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(h?0:u>.5?l/(2-o-a):l/(o+a)),100*u,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=H(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:H(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:H(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:H(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:H(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:H(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(F.test(t)){const e=t.replace(L,""),[n,r,i]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!I.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=E.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d: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:n}=this.xyz();return new U(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new U(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,u=o-s/200,h=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-h)/c),e=1*(o**3>l?o**3:(o-h)/c),n=1.08883*(u**3>l?u**3:(u-h)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,u=r>a?1.055*o(r,1/2.4)-.055:12.92*r,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new U(255*u,255*h,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new U(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*G(i,r,t+1/3),o=255*G(i,r,t),a=255*G(i,r,t-1/3);return new U(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new U(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Y);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,l=(.2126*o+.7152*a+.0722*u)/1,c=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new U(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class W{constructor(...t){this.init(...t)}clone(){return new W(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function $(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,u=t.shear||0,h=t.rotate||t.theta||0,l=new W(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new W(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new W(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,v=new W(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:v.x,ry:v.y,tx:y,ty:b,ox:c,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,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=u,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new Q(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=n*s-r*i,h=u>0?1:-1,l=h*Math.sqrt(n*n+r*r),c=Math.atan2(h*r,h*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/u,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+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 $(this.a,e.a)&&$(this.b,e.b)&&$(this.c,e.c)&&$(this.d,e.d)&&$(this.e,e.e)&&$(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Q.fromArray([1,0,0,1,0,0]);return t=t instanceof yt?t.matrixify():"string"==typeof t?Q.fromArray(t.split(V).map(parseFloat)):Array.isArray(t)?Q.fromArray(t):"object"==typeof t&&Q.isMatrixLike(t)?t:"object"==typeof t?(new Q).transform(t):6===arguments.length?Q.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,u=-e/o,h=-n/o,l=t/o,c=-(a*i+h*s),f=-(u*i+l*s);return this.a=a,this.b=u,this.c=h,this.d=l,this.e=c,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,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=u(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:l,f:c}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-h*i,this.d=h*r+a*i,this.e=l*r-c*i+n*i-e*r+e,this.f=c*r+l*i-e*i-n*r+n,this}scale(t,e,n,r){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e: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-n*t+n,this.f=h*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:u}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+u*t-n*t,this}skew(t,e,n,r){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=u(t),e=u(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:l,e:c,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+l*i,this.d=l+h*s,this.e=c+f*i-r*i,this.f=f+c*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Q.isMatrixLike(t))return new Q(t).multiplyO(this);const e=Q.formatTransforms(t),{x:n,y:r}=new W(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new W(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function J(){if(!J.nodes){const t=w().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)}P(Q,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=g.window.pageXOffset,this.y+=g.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(V).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Z(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Q||(t=new Q(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new W(this.x,this.y),new W(this.x2,this.y),new W(this.x,this.y2),new W(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new K(e,r,n-e,i-r)}}function tt(t,e,n){let r;try{if(r=e(t.node),Z(r)&&(i=t.node)!==g.document&&!(g.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===g.document}).call(g.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}i({viewbox:{viewbox(t,e,n,r){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new W(n/2/s+i.x,r/2/o+i.y);const h=new K(i).transform(new Q({scale:u,origin:e}));return this.viewbox(h)}}}),P(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}A([et],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const nt=["toArray","constructor","each"];function rt(t,e){return new et(a((e||g.document).querySelectorAll(t),(function(t){return S(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),A([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,n,r,i){const s=n.bind(r||t),o=w(t),a=ot(o),u=at(o);e=Array.isArray(e)?e:e.split(V),n._svgjsListenerId||(n._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function ht(t,e,n,r){const i=w(t),s=ot(i),o=at(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(V)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(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 lt extends y{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ht(this,t,e,n),this}on(t,e,n,r){return ut(this,t,e,n,r),this}removeEventListener(){}}function ct(){}P(lt,"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(V).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class pt{constructor(...t){this.init(...t)}convert(t){return new pt(this.value,t)}divide(t){return t=new pt(t),new pt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(j))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof pt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new pt(t),new pt(this-t,this.unit||t.unit)}plus(t){return t=new pt(t),new pt(this+t,this.unit||t.unit)}times(t){return t=new pt(t),new pt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const mt=[];class gt extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=w(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 w(t).put(this,e)}children(){return new et(a(this.node.children,(function(t){return S(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=N(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new gt(x(t),e))}first(){return S(this.node.firstChild)}get(t){return S(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=C(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=w(t),this.add(t,e),t}putIn(t,e){return w(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=w(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,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 n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=S(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=x("wrapper",n),i=g.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}A(gt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=q.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?ft[t]:q.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,n)=>n(t,e,this)),e))?e=new pt(e):U.isColor(e)?e=new U(e):e.constructor===Array&&(e=new dt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return S(this.node.querySelector(t))}}),P(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=w(t));const n=new et;let r=this;for(;(r=r.parent())&&r.node!==g.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?w(e[1]):null}root(){const t=this.parent(b[v]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new pt(n.width)).height(new pt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}A(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new W(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())}}),P(yt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof U||U.isRgb(e)||e instanceof yt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),i("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new pt(t)):this.rx(t).ry(e)}}),i("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new W(this.node.getPointAtLength(t))}}),i(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),i("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),i("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(B).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(V).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Q.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Q)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Q(this).decompose();return null==t?e:e[t]}Q.isMatrixLike(t)||(t={...t,origin:f(t,this)});const n=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class vt extends yt{flatten(t=this,e){return this.each((function(){if(this instanceof vt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}P(vt,"Container");class xt extends vt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}P(xt,"Defs");class wt extends yt{}function _t(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function Mt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Pt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ot(t){return this.attr("cx",t)}function Ct(t){return this.attr("cy",t)}function Nt(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function At(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}P(wt,"Shape");var Tt={__proto__:null,rx:_t,ry:St,x:Mt,y:Pt,cx:Ot,cy:Ct,width:Nt,height:At};class jt extends wt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new pt(n.width).divide(2)).ry(new pt(n.height).divide(2))}}A(jt,Tt),i("Container",{ellipse:T((function(t=0,e=t){return this.put(new jt).size(t,e).move(0,0)}))}),P(jt,"Ellipse");class Et extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Dt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new pt(t),fy:new pt(e)}):this.attr({x1:new pt(t),y1:new pt(e)})}function kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new pt(t),cy:new pt(e)}):this.attr({x2:new pt(t),y2:new pt(e)})}P(Et,"Fragment");var Bt,Lt={__proto__:null,from:Dt,to:kt};class It extends vt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}A(It,Lt),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:T((function(t,e){return this.put(new It(t)).update(e)}))}}),P(It,"Gradient");class Ft extends vt{constructor(t,e=t){super(_("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}i({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:T((function(t,e,n){return this.put(new Ft).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),P(Ft,"Pattern");class Rt extends wt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const n=new g.window.Image;return ut(n,"load",(function(t){const r=this.parent(Ft);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Ft&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(n,"load error",(function(){ht(n)})),this.attr("href",n.src=t,m)}}Bt=function(t,e,n){return"fill"!==t&&"stroke"!==t||z.test(e)&&(e=n.root().defs().image(e)),e instanceof Rt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:T((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),P(Rt,"Image");class qt extends dt{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new K(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(V).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}var zt={__proto__:null,MorphArray:qt,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Vt extends wt{constructor(t,e=t){super(_("line",t),e)}array(){return new qt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new qt(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}A(Vt,zt),i({Container:{line:T((function(...t){return Vt.prototype.plot.apply(this.put(new Vt),null!=t[0]?t:[0,0,0,0])}))}}),P(Vt,"Line");class Xt extends vt{constructor(t,e=t){super(_("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Yt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:T((function(t,e,n){return this.put(new Xt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Xt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),P(Xt,"Marker");const Ht={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Gt{done(){return!1}}class Ut extends Gt{constructor(t=">"){super(),this.ease=Ht[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class Wt extends Gt{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function $t(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}A(class extends Wt{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Yt("_duration",$t),overshoot:Yt("_overshoot",$t)}),A(class extends Wt{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Yt("_windup"),p:Yt("P"),i:Yt("I"),d:Yt("D")});const Qt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jt={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Zt="mlhvqtcsaz".split("");for(let t=0,e=Zt.length;t<e;++t)Jt[Zt[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Jt[t](e,n,r)}}(Zt[t].toUpperCase());function Kt(t){return t.segment.length&&t.segment.length-1===Qt[t.segment[0].toUpperCase()]}function te(t,e){t.inNumber&&ee(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ee(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Kt(t)&&ne(t)}function ne(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Jt[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function re(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends dt{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new W,p:new W};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!te(i,r))if("."!==r)if(isNaN(parseInt(r)))if(" "!==r&&","!==r)if("-"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");ne(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||re(i)){i.inNumber=!0,i.number=r,ee(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&ne(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?U.isColor(t)?U:V.test(t)?X.test(t)?se:dt:j.test(t)?pt:ue:fe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?dt:"object"===e?ce:ue};class ae{constructor(t){this._stepper=t||new Ut("-"),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===U&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ce&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class 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 le=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class ce{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===U&&t[n+7]!==e[n+7]){const e=t[n+7],r=new U(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=oe(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(le),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const fe=[ue,he,ce];class de extends wt{constructor(t,e=t){super(_("path",t),e)}array(){return this._array||(this._array=new se(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new se(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}de.prototype.MorphArray=se,i({Container:{path:T((function(t){return this.put(new de).plot(t||new se)}))}}),P(de,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new qt(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 qt(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class me extends wt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:T((function(t){return this.put(new me).plot(t||new qt)}))}}),A(me,zt),A(me,pe),P(me,"Polygon");class ge extends wt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:T((function(t){return this.put(new ge).plot(t||new qt)}))}}),A(ge,zt),A(ge,pe),P(ge,"Polyline");class ye extends wt{constructor(t,e=t){super(_("rect",t),e)}}A(ye,{rx:_t,ry:St}),i({Container:{rect:T((function(t,e){return this.put(new ye).size(t,e)}))}}),P(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 ve={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>g.window.performance||g.window.Date,transforms:[],frame(t){const e=ve.frames.push({run:t});return null===ve.nextDraw&&(ve.nextDraw=g.window.requestAnimationFrame(ve._draw)),e},timeout(t,e){e=e||0;const n=ve.timer().now()+e,r=ve.timeouts.push({run:t,time:n});return null===ve.nextDraw&&(ve.nextDraw=g.window.requestAnimationFrame(ve._draw)),r},immediate(t){const e=ve.immediates.push(t);return null===ve.nextDraw&&(ve.nextDraw=g.window.requestAnimationFrame(ve._draw)),e},cancelFrame(t){null!=t&&ve.frames.remove(t)},clearTimeout(t){null!=t&&ve.timeouts.remove(t)},cancelImmediate(t){null!=t&&ve.immediates.remove(t)},_draw(t){let e=null;const n=ve.timeouts.last();for(;(e=ve.timeouts.shift())&&(t>=e.time?e.run():ve.timeouts.push(e),e!==n););let r=null;const i=ve.frames.last();for(;r!==i&&(r=ve.frames.shift());)r.run(t);let s=null;for(;s=ve.immediates.shift();)s();ve.nextDraw=ve.timeouts.first()||ve.frames.first()?g.window.requestAnimationFrame(ve._draw):null}},xe=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},we=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends lt{constructor(t=we){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(xe);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}i({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new _e,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?400:t)?new Wt(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof Wt,this._stepper=this._isDeclarative?t:new Ut,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e||0,n=n||"last","object"!=typeof(t=t||400)||t instanceof Gt||(e=t.delay||e,n=t.when||n,i=t.swing||i,r=t.times||r,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Se.sanitise(t,e,n),i=new Se(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new Q,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Ut(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},u=i*(r+n)-r;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,n,r){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof _e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new Q,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Se.id=0;class Me{constructor(t=new Q,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}A([Se,Me],{mergeWith(t){return new Me(t.transforms.lmultiply(this.transforms),t.id)}});const Pe=(t,e)=>t.lmultiplyO(e),Oe=t=>t.transforms;function Ce(){const t=this._transformationRunners.runners.map(Oe).reduce(Pe,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ne{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 Me).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}i({Element:{animate(t,e,n){const r=Se.sanitise(t,e,n),i=this.timeline();return new Se(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Oe).reduce(Pe,new Q)},_addRunner(t){this._transformationRunners.add(t),ve.cancelImmediate(this._frameId),this._frameId=ve.immediate(Ce.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ne).add(new Me(new Q(this))))}}}),A(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ae(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new ce(i.from()).valueOf();Object.assign(n,e),i.from(n)}const u=new ce(i.to()).valueOf();Object.assign(u,e),i.to(u),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ae(this._stepper).to(new pt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=Q.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ae(this._stepper).type(n?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(l){e||this.clearTransform();const{x:c,y:f}=new W(s).transform(o._currentTransform(this));let d=new Q({...t,origin:[c,f]}),p=this._isDeclarative&&a?a:h;if(n){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);d.rotate=n[s]}e&&(r||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(d);const m=i.at(l);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 n=new ae(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new pt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new pt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ae(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new K(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),A(Se,{rx:_t,ry:St,from:Dt,to:kt}),P(Se,"Runner");class Ae extends vt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new xt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof g.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns: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:T((function(){return this.put(new Ae)}))}}),P(Ae,"Svg",!0);class Te extends vt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:T((function(){return this.put(new Te)}))}}),P(Te,"Symbol");var je={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(g.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class Ee extends wt{constructor(t,e=t){super(_("text",t),e),this.dom.leading=new pt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new pt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new pt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"!==e[r].nodeName?(r!==n&&3!==e[r].nodeType&&!0===S(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent):0===r&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}A(Ee,je),i({Container:{text:T((function(t=""){return this.put(new Ee).text(t)})),plain:T((function(t=""){return this.put(new Ee).plain(t)}))}}),P(Ee,"Text");class De extends wt{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 Ee))return this;const e=t.index(this),n=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new pt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}A(De,je),i({Tspan:{tspan:T((function(t=""){const e=new De;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),P(De,"Tspan");class ke extends wt{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))}}A(ke,{x:Mt,y:Pt,cx:Ot,cy:Ct,width:Nt,height:At}),i({Container:{circle:T((function(t=0){return this.put(new ke).size(t).move(0,0)}))}}),P(ke,"Circle");class Be extends vt{constructor(t,e=t){super(_("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return rt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:T((function(){return this.defs().put(new Be)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Be?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),P(Be,"ClipPath");class Le extends yt{constructor(t,e=t){super(_("foreignObject",t),e)}}i({Container:{foreignObject:T((function(t,e){return this.put(new Le).size(t,e)}))}}),P(Le,"ForeignObject");var Ie={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,r)=>{let i;try{i=n.bbox()}catch(t){return}const s=new Q(n),o=s.translate(t,e).transform(s.inverse()),a=new W(i.x,i.y).transform(o);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=c(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach(((t,e)=>{const r=new W(n).transform(new Q(t).inverse());t.scale(i,s,r.x,r.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class Fe extends vt{constructor(t,e=t){super(_("g",t),e)}}A(Fe,Ie),i({Container:{group:T((function(){return this.put(new Fe)}))}}),P(Fe,"G");class Re extends vt{constructor(t,e=t){super(_("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}A(Re,Ie),i({Container:{link:T((function(t){return this.put(new Re).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Re,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),P(Re,"A");class qe extends vt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}i({Container:{mask:T((function(){return this.defs().put(new qe)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof qe?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),P(qe,"Mask");class ze extends yt{constructor(t,e=t){super(_("stop",t),e)}update(t){return("number"==typeof t||t instanceof pt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new pt(t.offset)),this}}i({Gradient:{stop:function(t,e,n){return this.put(new ze).update(t,e,n)}}}),P(ze,"Stop");class Ve extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}i("Dom",{style(t,e){return this.put(new Ve).rule(t,e)},fontface(t,e,n){return this.put(new Ve).font(t,e,n)}}),P(Ve,"Style");class Xe extends Ee{constructor(t,e=t){super(_("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}i({Container:{textPath:T((function(t,e){return t instanceof Ee||(t=this.text(t)),t.path(e)}))},Text:{path:T((function(t,e=!0){const n=new Xe;let r;if(t instanceof de||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:T((function(t){return t instanceof Ee||(t=(new Ee).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Xe.prototype.MorphArray=se,P(Xe,"TextPath");class Ye extends wt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:T((function(t,e){return this.put(new Ye).use(t,e)}))}}),P(Ye,"Use"),A([Ae,Te,Rt,Ft,Xt],s("viewbox")),A([Vt,ge,me,de],s("marker")),A(Ee,s("Text")),A(de,s("Path")),A(xt,s("Defs")),A([Ee,De],s("Tspan")),A([ye,jt,It,Se],s("radius")),A(lt,s("EventTarget")),A(gt,s("Dom")),A(yt,s("Element")),A(wt,s("Shape")),A([vt,Et],s("Container")),A(It,s("Gradient")),A(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){fe.push(...[].concat(t))}([pt,U,K,Q,dt,qt,se,W]),A(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,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var He=n(726),Ge=n(725),Ue=n(854),We=["basePadding1","basePadding2"],$e={basePadding1:"setBasePadding1",basePadding2:"setBasePadding2"},Qe=function(){function t(t,e,n){var r=this;this.line=t,this.base1=e,this.base2=n,this.cachedBasePadding1=(0,Ge.distance)(this.point1,this.base1.centerPoint),this.cachedBasePadding2=(0,Ge.distance)(this.point2,this.base2.centerPoint),e.addEventListener("move",(function(){return r.reposition()})),n.addEventListener("move",(function(){return r.reposition()}))}return t.between=function(e,n){var r=new t((new Vt).node,e,n);return r.assignUUID(),r.set(t.defaultValues),r.reposition(),r},Object.defineProperty(t.prototype,"basePair",{get:function(){return[this.base1,this.base2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"domNode",{get:function(){return this.line},enumerable:!1,configurable:!0}),t.prototype.getAttribute=function(t){return this.domNode.getAttribute(t)},t.prototype.setAttribute=function(t,e){this.domNode.setAttribute(t,e)},t.prototype.setAttributes=function(t){if((0,Ue.isNonNullObject)(t))try{new Vt(this.domNode).attr(t)}catch(t){}},Object.defineProperty(t.prototype,"id",{get:function(){return this.domNode.id},enumerable:!1,configurable:!0}),t.prototype.assignUUID=function(){(0,He.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,Ue.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,Ue.isFiniteNumber)(t)&&(this.basePadding2=Math.max(0,t))},t.prototype.set=function(t){var e=this;try{this.setAttributes(t.attributes)}catch(t){}We.forEach((function(n){try{e[$e[n]](t[n])}catch(t){}}))},t.prototype.reposition=function(){var t=this.base1.centerPoint,e=this.base2.centerPoint,n=(0,Ge.direction)(t,e);this.setAttribute("x1","".concat(t.x+this.basePadding1*Math.cos(n))),this.setAttribute("y1","".concat(t.y+this.basePadding1*Math.sin(n))),this.setAttribute("x2","".concat(e.x-this.basePadding2*Math.cos(n))),this.setAttribute("y2","".concat(e.y-this.basePadding2*Math.sin(n)))},t.prototype.basesMoved=function(){this.reposition()},t.prototype.basesRemoved=function(){this.base1.hasParent()&&this.base2.hasParent()||this.remove()},t.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},t}()})(),r})(),t.exports=e()},726:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalClientScaling:()=>l,Scaling:()=>h,VerticalClientScaling:()=>c,assignUUID:()=>u,bringToFront:()=>f,sendToBack:()=>d});const n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const i=new Uint8Array(16);function s(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(i)};function 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}(),l=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width},t}(),c=function(){function t(t){this.targetSVGDoc=t}return t.prototype.get=function(){var t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height},t}();function 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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{DotBracketDrawer:()=>rn,Drawing:()=>Ke,Nucleobase:()=>Ge.Nucleobase,StraightBond:()=>$e.StraightBond});const t={},e=[];function i(e,n){if(Array.isArray(e))for(const t of e)i(t,n);else if("object"!=typeof e)o(Object.getOwnPropertyNames(n)),t[e]=Object.assign(t[e]||{},n);else for(const t in e)i(t,e[t])}function s(e){return t[e]||{}}function o(t){e.push(...t)}function a(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function u(t){return t%360*Math.PI/180}function h(t){return t.toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()}))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function f(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:u}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[r,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={},v="___SYMBOL___ROOT___";function x(t,e=d){return g.document.createElementNS(e,t)}function w(t,e=!1){if(t instanceof y)return t;if("object"==typeof t)return M(t);if(null==t)return new b[v];if("string"==typeof t&&"<"!==t.charAt(0))return M(g.document.querySelector(t));const n=e?g.document.createElement("div"):x("svg");return n.innerHTML=t,t=M(n.firstChild),n.removeChild(n.firstChild),t}function _(t,e){return e&&e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node?e:x(t)}function S(t){if(!t)return null;if(t.instance instanceof y)return t.instance;if("#document-fragment"===t.nodeName)return new b.Fragment(t);let e=l(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":b[e]||(e="Dom"),new b[e](t)}let M=S;function P(t,e=t.name,n=!1){return b[e]=t,n&&(b[v]=t),o(Object.getOwnPropertyNames(t.prototype)),t}let O=1e3;function C(t){return"Svgjs"+l(t)+O++}function N(t){for(let e=t.children.length-1;e>=0;e--)N(t.children[e]);return t.id?(t.id=C(t.nodeName),t):t}function A(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function T(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}i("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=w(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=w(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=w(t)).before(this),this},insertAfter:function(t){return(t=w(t)).after(this),this}});const j=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,E=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,D=/rgb\((\d+),(\d+),(\d+)\)/,k=/(#[a-z_][a-z0-9\-_]*)/i,B=/\)\s*,?\s*/,L=/\s/g,I=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,F=/^rgb\(/,R=/^(\s+)?$/,q=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,z=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,V=/[\s,]+/,X=/[MLHVCSQTAZ]/i;function Y(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function H(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function G(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}i("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(V)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),i("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=h(e);n[e]=this.node.style[t]}return n}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,n){if(null==t)return this.data(a(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),i("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const e in t)this.remember(e,t[e]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class U{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof U||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e,n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===t){const t=24*r()+57,e=38*r()+45,n=360*r();return new U(t,e,n,"lch")}if("sine"===t){const t=i(80*s(2*o*(e=null==e?r():e)/.5+.01)+150),n=i(50*s(2*o*e/.5+4.6)+200),a=i(100*s(2*o*e/.5+2.3)+150);return new U(t,n,a)}if("pastel"===t){const t=8*r()+86,e=17*r()+9,n=360*r();return new U(t,e,n,"lch")}if("dark"===t){const t=10+10*r(),e=50*r()+86,n=360*r();return new U(t,e,n,"lch")}if("rgb"===t){const t=255*r(),e=255*r(),n=255*r();return new U(t,e,n)}if("lab"===t){const t=100*r(),e=256*r()-128,n=256*r()-128;return new U(t,e,n,"lab")}if("grey"===t){const t=255*r();return new U(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(I.test(t)||F.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new U(0,0,0,1,"cmyk"):new U((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),u=(o+a)/2,h=o===a,l=o-a;return new U(360*(h?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(h?0:u>.5?l/(2-o-a):l/(o+a)),100*u,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=H(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:H(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:H(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:H(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:H(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:H(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(F.test(t)){const e=t.replace(L,""),[n,r,i]=D.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!I.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=E.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d: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:n}=this.xyz();return new U(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new U(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,u=o-s/200,h=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-h)/c),e=1*(o**3>l?o**3:(o-h)/c),n=1.08883*(u**3>l?u**3:(u-h)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,u=r>a?1.055*o(r,1/2.4)-.055:12.92*r,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new U(255*u,255*h,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new U(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*G(i,r,t+1/3),o=255*G(i,r,t),a=255*G(i,r,t-1/3);return new U(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new U(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Y);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,l=(.2126*o+.7152*a+.0722*u)/1,c=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new U(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class W{constructor(...t){this.init(...t)}clone(){return new W(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function $(t,e,n){return Math.abs(e-t)<(n||1e-6)}class Q{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,u=t.shear||0,h=t.rotate||t.theta||0,l=new W(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new W(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new W(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,v=new W(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:v.x,ry:v.y,tx:y,ty:b,ox:c,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,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=u,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new Q(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=n*s-r*i,h=u>0?1:-1,l=h*Math.sqrt(n*n+r*r),c=Math.atan2(h*r,h*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/u,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+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 $(this.a,e.a)&&$(this.b,e.b)&&$(this.c,e.c)&&$(this.d,e.d)&&$(this.e,e.e)&&$(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Q.fromArray([1,0,0,1,0,0]);return t=t instanceof yt?t.matrixify():"string"==typeof t?Q.fromArray(t.split(V).map(parseFloat)):Array.isArray(t)?Q.fromArray(t):"object"==typeof t&&Q.isMatrixLike(t)?t:"object"==typeof t?(new Q).transform(t):6===arguments.length?Q.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,u=-e/o,h=-n/o,l=t/o,c=-(a*i+h*s),f=-(u*i+l*s);return this.a=a,this.b=u,this.c=h,this.d=l,this.e=c,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,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=u(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:h,e:l,f:c}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-h*i,this.d=h*r+a*i,this.e=l*r-c*i+n*i-e*r+e,this.f=c*r+l*i-e*i-n*r+n,this}scale(t,e,n,r){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e: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-n*t+n,this.f=h*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:u}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+u*t-n*t,this}skew(t,e,n,r){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=u(t),e=u(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:h,d:l,e:c,f}=this;return this.a=o+a*i,this.b=a+o*s,this.c=h+l*i,this.d=l+h*s,this.e=c+f*i-r*i,this.f=f+c*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Q.isMatrixLike(t))return new Q(t).multiplyO(this);const e=Q.formatTransforms(t),{x:n,y:r}=new W(e.ox,e.oy).transform(this),i=(new Q).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new W(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function J(){if(!J.nodes){const t=w().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)}P(Q,"Matrix");class K{constructor(...t){this.init(...t)}addOffset(){return this.x+=g.window.pageXOffset,this.y+=g.window.pageYOffset,new K(this)}init(t){return t="string"==typeof t?t.split(V).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Z(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new K(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Q||(t=new Q(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new W(this.x,this.y),new W(this.x2,this.y),new W(this.x,this.y2),new W(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new K(e,r,n-e,i-r)}}function tt(t,e,n){let r;try{if(r=e(t.node),Z(r)&&(i=t.node)!==g.document&&!(g.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===g.document}).call(g.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}i({viewbox:{viewbox(t,e,n,r){return null==t?new K(this.attr("viewBox")):this.attr("viewBox",new K(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new W(n/2/s+i.x,r/2/o+i.y);const h=new K(i).transform(new Q({scale:u,origin:e}));return this.viewbox(h)}}}),P(K,"Box");class et extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}A([et],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const nt=["toArray","constructor","each"];function rt(t,e){return new et(a((e||g.document).querySelectorAll(t),(function(t){return S(t)})))}et.extend=function(t){t=t.reduce(((t,e)=>(nt.includes(e)||"_"===e[0]||(t[e]=function(...t){return this.each(e,...t)}),t)),{}),A([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,n,r,i){const s=n.bind(r||t),o=w(t),a=ot(o),u=at(o);e=Array.isArray(e)?e:e.split(V),n._svgjsListenerId||(n._svgjsListenerId=++it),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function ht(t,e,n,r){const i=w(t),s=ot(i),o=at(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(V)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(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 lt extends y{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=at(t);return e instanceof g.window.Event||(e=new g.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ht(this,t,e,n),this}on(t,e,n,r){return ut(this,t,e,n,r),this}removeEventListener(){}}function ct(){}P(lt,"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(V).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class pt{constructor(...t){this.init(...t)}convert(t){return new pt(this.value,t)}divide(t){return t=new pt(t),new pt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(j))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof pt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new pt(t),new pt(this-t,this.unit||t.unit)}plus(t){return t=new pt(t),new pt(this+t,this.unit||t.unit)}times(t){return t=new pt(t),new pt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const mt=[];class gt extends lt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=w(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 w(t).put(this,e)}children(){return new et(a(this.node.children,(function(t){return S(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=N(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new gt(x(t),e))}first(){return S(this.node.firstChild)}get(t){return S(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=C(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return S(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=S(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=S(e.node.parentNode));return e}put(t,e){return t=w(t),this.add(t,e),t}putIn(t,e){return w(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=w(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,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 n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=S(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=x("wrapper",n),i=g.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}A(gt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=q.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?ft[t]:q.test(e)?parseFloat(e):e;"number"==typeof(e=mt.reduce(((e,n)=>n(t,e,this)),e))?e=new pt(e):U.isColor(e)?e=new U(e):e.constructor===Array&&(e=new dt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return rt(t,this.node)},findOne:function(t){return S(this.node.querySelector(t))}}),P(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=w(t));const n=new et;let r=this;for(;(r=r.parent())&&r.node!==g.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(k);return e?w(e[1]):null}root(){const t=this.parent(b[v]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=c(this,t,e);return this.width(new pt(n.width)).height(new pt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}A(yt,{bbox:function(){const t=tt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(J().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new K(t)},rbox:function(t){const e=tt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new K(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new W(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())}}),P(yt,"Element");const bt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof U||U.isRgb(e)||e instanceof yt)this.attr(t,e);else for(n=bt[t].length-1;n>=0;n--)null!=e[bt[t][n]]&&this.attr(bt.prefix(t,bt[t][n]),e[bt[t][n]]);return this},i(["Element","Runner"],e)})),i(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new Q(this):this.attr("transform",new Q(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),i("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new pt(t)):this.rx(t).ry(e)}}),i("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new W(this.node.getPointAtLength(t))}}),i(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}}),i("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),i("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(B).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(V).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Q.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Q)},toParent:function(t,e){if(this===t)return this;const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Q(this).decompose();return null==t?e:e[t]}Q.isMatrixLike(t)||(t={...t,origin:f(t,this)});const n=new Q(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class vt extends yt{flatten(t=this,e){return this.each((function(){if(this instanceof vt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}P(vt,"Container");class xt extends vt{constructor(t,e=t){super(_("defs",t),e)}flatten(){return this}ungroup(){return this}}P(xt,"Defs");class wt extends yt{}function _t(t){return this.attr("rx",t)}function St(t){return this.attr("ry",t)}function Mt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Pt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ot(t){return this.attr("cx",t)}function Ct(t){return this.attr("cy",t)}function Nt(t){return null==t?2*this.rx():this.rx(new pt(t).divide(2))}function At(t){return null==t?2*this.ry():this.ry(new pt(t).divide(2))}P(wt,"Shape");var Tt={__proto__:null,rx:_t,ry:St,x:Mt,y:Pt,cx:Ot,cy:Ct,width:Nt,height:At};class jt extends wt{constructor(t,e=t){super(_("ellipse",t),e)}size(t,e){const n=c(this,t,e);return this.rx(new pt(n.width).divide(2)).ry(new pt(n.height).divide(2))}}A(jt,Tt),i("Container",{ellipse:T((function(t=0,e=t){return this.put(new jt).size(t,e).move(0,0)}))}),P(jt,"Ellipse");class Et extends gt{constructor(t=g.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new gt(x("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Dt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new pt(t),fy:new pt(e)}):this.attr({x1:new pt(t),y1:new pt(e)})}function kt(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new pt(t),cy:new pt(e)}):this.attr({x2:new pt(t),y2:new pt(e)})}P(Et,"Fragment");var Bt,Lt={__proto__:null,from:Dt,to:kt};class It extends vt{constructor(t,e){super(_(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}A(It,Lt),i({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:T((function(t,e){return this.put(new It(t)).update(e)}))}}),P(It,"Gradient");class Ft extends vt{constructor(t,e=t){super(_("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new K}targets(){return rt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}i({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:T((function(t,e,n){return this.put(new Ft).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),P(Ft,"Pattern");class Rt extends wt{constructor(t,e=t){super(_("image",t),e)}load(t,e){if(!t)return this;const n=new g.window.Image;return ut(n,"load",(function(t){const r=this.parent(Ft);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Ft&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ut(n,"load error",(function(){ht(n)})),this.attr("href",n.src=t,m)}}Bt=function(t,e,n){return"fill"!==t&&"stroke"!==t||z.test(e)&&(e=n.root().defs().image(e)),e instanceof Rt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},mt.push(Bt),i({Container:{image:T((function(t,e){return this.put(new Rt).size(0,0).load(t,e)}))}}),P(Rt,"Image");class qt extends dt{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new K(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(V).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Q.isMatrixLike(t)||(t=new Q(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}var zt={__proto__:null,MorphArray:qt,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}};class Vt extends wt{constructor(t,e=t){super(_("line",t),e)}array(){return new qt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new qt(t).toLine(),this.attr(t))}size(t,e){const n=c(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}A(Vt,zt),i({Container:{line:T((function(...t){return Vt.prototype.plot.apply(this.put(new Vt),null!=t[0]?t:[0,0,0,0])}))}}),P(Vt,"Line");class Xt extends vt{constructor(t,e=t){super(_("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Yt(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}i({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:T((function(t,e,n){return this.put(new Xt).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Xt?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),P(Xt,"Marker");const Ht={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Gt{done(){return!1}}class Ut extends Gt{constructor(t=">"){super(),this.ease=Ht[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class Wt extends Gt{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function $t(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}A(class extends Wt{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Yt("_duration",$t),overshoot:Yt("_overshoot",$t)}),A(class extends Wt{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Yt("_windup"),p:Yt("P"),i:Yt("I"),d:Yt("D")});const Qt={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Jt={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Zt="mlhvqtcsaz".split("");for(let t=0,e=Zt.length;t<e;++t)Jt[Zt[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Jt[t](e,n,r)}}(Zt[t].toUpperCase());function Kt(t){return t.segment.length&&t.segment.length-1===Qt[t.segment[0].toUpperCase()]}function te(t,e){t.inNumber&&ee(t,!1);const n=X.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function ee(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Kt(t)&&ne(t)}function ne(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Jt[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function re(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function ie(t){return"E"===t.lastToken.toUpperCase()}class se extends dt{bbox(){return J().path.setAttribute("d",this.toString()),new K(J.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new W,p:new W};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!te(i,r))if("."!==r)if(isNaN(parseInt(r)))if(" "!==r&&","!==r)if("-"!==r)if("E"!==r.toUpperCase()){if(X.test(r)){if(i.inNumber)ee(i,!1);else{if(!Kt(i))throw new Error("parser Error");ne(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!ie(i)){ee(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else i.inNumber&&ee(i,!1);else{if("0"===i.number||re(i)){i.inNumber=!0,i.number=r,ee(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){ee(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&ee(i,!1),i.inSegment&&Kt(i)&&ne(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const oe=t=>{const e=typeof t;return"number"===e?pt:"string"===e?U.isColor(t)?U:V.test(t)?X.test(t)?se:dt:j.test(t)?pt:ue:fe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?dt:"object"===e?ce:ue};class ae{constructor(t){this._stepper=t||new Ut("-"),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===U&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===ce&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class 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 le=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class ce{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===U&&t[n+7]!==e[n+7]){const e=t[n+7],r=new U(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=oe(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(le),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const fe=[ue,he,ce];class de extends wt{constructor(t,e=t){super(_("path",t),e)}array(){return this._array||(this._array=new se(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new se(t))}size(t,e){const n=c(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}de.prototype.MorphArray=se,i({Container:{path:T((function(t){return this.put(new de).plot(t||new se)}))}}),P(de,"Path");var pe={__proto__:null,array:function(){return this._array||(this._array=new qt(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 qt(t))},size:function(t,e){const n=c(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}};class me extends wt{constructor(t,e=t){super(_("polygon",t),e)}}i({Container:{polygon:T((function(t){return this.put(new me).plot(t||new qt)}))}}),A(me,zt),A(me,pe),P(me,"Polygon");class ge extends wt{constructor(t,e=t){super(_("polyline",t),e)}}i({Container:{polyline:T((function(t){return this.put(new ge).plot(t||new qt)}))}}),A(ge,zt),A(ge,pe),P(ge,"Polyline");class ye extends wt{constructor(t,e=t){super(_("rect",t),e)}}A(ye,{rx:_t,ry:St}),i({Container:{rect:T((function(t,e){return this.put(new ye).size(t,e)}))}}),P(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 ve={nextDraw:null,frames:new be,timeouts:new be,immediates:new be,timer:()=>g.window.performance||g.window.Date,transforms:[],frame(t){const e=ve.frames.push({run:t});return null===ve.nextDraw&&(ve.nextDraw=g.window.requestAnimationFrame(ve._draw)),e},timeout(t,e){e=e||0;const n=ve.timer().now()+e,r=ve.timeouts.push({run:t,time:n});return null===ve.nextDraw&&(ve.nextDraw=g.window.requestAnimationFrame(ve._draw)),r},immediate(t){const e=ve.immediates.push(t);return null===ve.nextDraw&&(ve.nextDraw=g.window.requestAnimationFrame(ve._draw)),e},cancelFrame(t){null!=t&&ve.frames.remove(t)},clearTimeout(t){null!=t&&ve.timeouts.remove(t)},cancelImmediate(t){null!=t&&ve.immediates.remove(t)},_draw(t){let e=null;const n=ve.timeouts.last();for(;(e=ve.timeouts.shift())&&(t>=e.time?e.run():ve.timeouts.push(e),e!==n););let r=null;const i=ve.frames.last();for(;r!==i&&(r=ve.frames.shift());)r.run(t);let s=null;for(;s=ve.immediates.shift();)s();ve.nextDraw=ve.timeouts.first()||ve.frames.first()?g.window.requestAnimationFrame(ve._draw):null}},xe=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},we=function(){const t=g.window;return(t.performance||t.Date).now()};class _e extends lt{constructor(t=we){super(),this._timeSource=t,this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(xe);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return ve.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=ve.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}}i({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new _e,this._timeline):(this._timeline=t,this)}}});class Se extends lt{constructor(t){super(),this.id=Se.id++,t="function"==typeof(t=null==t?400:t)?new Wt(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof Wt,this._stepper=this._isDeclarative?t:new Ut,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Q,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e||0,n=n||"last","object"!=typeof(t=t||400)||t instanceof Gt||(e=t.delay||e,n=t.when||n,i=t.swing||i,r=t.times||r,s=t.wait||s,t=t.duration||400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t,e){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Se.sanitise(t,e,n),i=new Se(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new Q,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Ut(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},u=i*(r+n)-r;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,n,r){return this._queue.push({initialiser:t||ct,runner:e||ct,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof _e||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new Q,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Se.id=0;class Me{constructor(t=new Q,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}A([Se,Me],{mergeWith(t){return new Me(t.transforms.lmultiply(this.transforms),t.id)}});const Pe=(t,e)=>t.lmultiplyO(e),Oe=t=>t.transforms;function Ce(){const t=this._transformationRunners.runners.map(Oe).reduce(Pe,new Q);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ne{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 Me).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}i({Element:{animate(t,e,n){const r=Se.sanitise(t,e,n),i=this.timeline();return new Se(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Oe).reduce(Pe,new Q)},_addRunner(t){this._transformationRunners.add(t),ve.cancelImmediate(this._frameId),this._frameId=ve.immediate(Ce.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ne).add(new Me(new Q(this))))}}}),A(Se,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ae(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new ce(i.from()).valueOf();Object.assign(n,e),i.from(n)}const u=new ce(i.to()).valueOf();Object.assign(u,e),i.to(u),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ae(this._stepper).to(new pt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=Q.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ae(this._stepper).type(n?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(l){e||this.clearTransform();const{x:c,y:f}=new W(s).transform(o._currentTransform(this));let d=new Q({...t,origin:[c,f]}),p=this._isDeclarative&&a?a:h;if(n){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);d.rotate=n[s]}e&&(r||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(d);const m=i.at(l);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 n=new ae(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new pt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ae(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new pt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ae(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new K(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),A(Se,{rx:_t,ry:St,from:Dt,to:kt}),P(Se,"Runner");class Ae extends vt{constructor(t,e=t){super(_("svg",t),e),this.namespace()}defs(){return this.isRoot()?S(this.node.querySelector("defs"))||this.put(new xt):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof g.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns: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:T((function(){return this.put(new Ae)}))}}),P(Ae,"Svg",!0);class Te extends vt{constructor(t,e=t){super(_("symbol",t),e)}}i({Container:{symbol:T((function(){return this.put(new Te)}))}}),P(Te,"Symbol");var je={__proto__:null,plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(g.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)},build:function(t){return this._build=!!t,this}};class Ee extends wt{constructor(t,e=t){super(_("text",t),e),this.dom.leading=new pt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new pt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){const i=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new pt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new pt(t.leading||1.3),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"!==e[r].nodeName?(r!==n&&3!==e[r].nodeType&&!0===S(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent):0===r&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}A(Ee,je),i({Container:{text:T((function(t=""){return this.put(new Ee).text(t)})),plain:T((function(t=""){return this.put(new Ee).plain(t)}))}}),P(Ee,"Text");class De extends wt{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 Ee))return this;const e=t.index(this),n=g.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new pt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}A(De,je),i({Tspan:{tspan:T((function(t=""){const e=new De;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),P(De,"Tspan");class ke extends wt{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))}}A(ke,{x:Mt,y:Pt,cx:Ot,cy:Ct,width:Nt,height:At}),i({Container:{circle:T((function(t=0){return this.put(new ke).size(t).move(0,0)}))}}),P(ke,"Circle");class Be extends vt{constructor(t,e=t){super(_("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return rt("svg [clip-path*="+this.id()+"]")}}i({Container:{clip:T((function(){return this.defs().put(new Be)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Be?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),P(Be,"ClipPath");class Le extends yt{constructor(t,e=t){super(_("foreignObject",t),e)}}i({Container:{foreignObject:T((function(t,e){return this.put(new Le).size(t,e)}))}}),P(Le,"ForeignObject");var Ie={__proto__:null,dmove:function(t,e){return this.children().forEach(((n,r)=>{let i;try{i=n.bbox()}catch(t){return}const s=new Q(n),o=s.translate(t,e).transform(s.inverse()),a=new W(i.x,i.y).transform(o);n.move(a.x,a.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=c(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach(((t,e)=>{const r=new W(n).transform(new Q(t).inverse());t.scale(i,s,r.x,r.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}};class Fe extends vt{constructor(t,e=t){super(_("g",t),e)}}A(Fe,Ie),i({Container:{group:T((function(){return this.put(new Fe)}))}}),P(Fe,"G");class Re extends vt{constructor(t,e=t){super(_("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,m)}}A(Re,Ie),i({Container:{link:T((function(t){return this.put(new Re).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Re,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),P(Re,"A");class qe extends vt{constructor(t,e=t){super(_("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return rt("svg [mask*="+this.id()+"]")}}i({Container:{mask:T((function(){return this.defs().put(new qe)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof qe?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),P(qe,"Mask");class ze extends yt{constructor(t,e=t){super(_("stop",t),e)}update(t){return("number"==typeof t||t instanceof pt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new pt(t.offset)),this}}i({Gradient:{stop:function(t,e,n){return this.put(new ze).update(t,e,n)}}}),P(ze,"Stop");class Ve extends yt{constructor(t,e=t){super(_("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}i("Dom",{style(t,e){return this.put(new Ve).rule(t,e)},fontface(t,e,n){return this.put(new Ve).font(t,e,n)}}),P(Ve,"Style");class Xe extends Ee{constructor(t,e=t){super(_("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}i({Container:{textPath:T((function(t,e){return t instanceof Ee||(t=this.text(t)),t.path(e)}))},Text:{path:T((function(t,e=!0){const n=new Xe;let r;if(t instanceof de||(t=this.defs().path(t)),n.attr("href","#"+t,m),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:T((function(t){return t instanceof Ee||(t=(new Ee).addTo(this.parent()).text(t)),t.path(this)})),targets(){return rt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),Xe.prototype.MorphArray=se,P(Xe,"TextPath");class Ye extends wt{constructor(t,e=t){super(_("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,m)}}i({Container:{use:T((function(t,e){return this.put(new Ye).use(t,e)}))}}),P(Ye,"Use"),A([Ae,Te,Rt,Ft,Xt],s("viewbox")),A([Vt,ge,me,de],s("marker")),A(Ee,s("Text")),A(de,s("Path")),A(xt,s("Defs")),A([Ee,De],s("Tspan")),A([ye,jt,It,Se],s("radius")),A(lt,s("EventTarget")),A(gt,s("Dom")),A(yt,s("Element")),A(wt,s("Shape")),A([vt,Et],s("Container")),A(It,s("Gradient")),A(Se,s("Runner")),et.extend([...new Set(e)]),function(t=[]){fe.push(...[].concat(t))}([pt,U,K,Q,dt,qt,se,W]),A(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,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var He=n(726),Ge=n(358);class Ue{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 We{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new Ue(t,e)}get bases(){return this.elementsDrawing.elements}append(t){t.appendTo(this.svgDoc),this.bases.push(t)}add(t){let e=Ge.Nucleobase.create(t);return this.append(e),e}}var $e=n(298);class Qe{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new Ue(t,e),new MutationObserver((()=>{this.bonds.forEach((t=>{t.base1.isIn(this.svgDoc)&&t.base2.isIn(this.svgDoc)||t.remove()}))})).observe(t,{childList:!0,subtree:!0})}get bonds(){return this.elementsDrawing.elements}set bonds(t){this.elementsDrawing.elements=t}}class Je{constructor(t,e){this.svgDoc=t,this.primaryBondDefaultValues={attributes:{stroke:"#808080","stroke-width":"1"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Qe(t,e)}get primaryBonds(){return this.bondsDrawing.bonds}set primaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.primaryBonds.push(t)}add(t,e){let n=$e.StraightBond.between(t,e);return n.set(this.primaryBondDefaultValues),this.append(n),n}}class Ze{constructor(t,e){this.svgDoc=t,this.secondaryBondDefaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},this.bondsDrawing=new Qe(t,e)}get secondaryBonds(){return this.bondsDrawing.bonds}set secondaryBonds(t){this.bondsDrawing.bonds=t}append(t){t.appendTo(this.svgDoc),this.secondaryBonds.push(t)}add(t,e){let n=$e.StraightBond.between(t,e);return n.set(this.secondaryBondDefaultValues),this.append(n),n}}class Ke{constructor(){this.domNode=(new Ae).node,this.domNode.setAttribute("viewBox","0 0 250 250"),this.domNode.setAttribute("width","250"),this.domNode.setAttribute("height","250"),this.basesDrawing=new We(this.domNode,[]),this.primaryBondsDrawing=new Je(this.domNode,[]),this.secondaryBondsDrawing=new Ze(this.domNode,[])}get outerHTML(){return this.domNode.outerHTML}get innerHTML(){return this.domNode.innerHTML}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}get minX(){return this.domNode.viewBox.baseVal.x}set minX(t){let e=this.maxX-t,n=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${t} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(n*e).toString())}get maxX(){return this.minX+this.width}set maxX(t){let e=t-this.minX,n=this.horizontalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${e} ${this.height}`),this.domNode.setAttribute("width",(n*e).toString())}get minY(){return this.domNode.viewBox.baseVal.y}set minY(t){let e=this.maxY-t,n=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${t} ${this.width} ${e}`),this.domNode.setAttribute("height",(n*e).toString())}get maxY(){return this.minY+this.height}set maxY(t){let e=t-this.minY,n=this.verticalScaling;this.domNode.setAttribute("viewBox",`${this.minX} ${this.minY} ${this.width} ${e}`),this.domNode.setAttribute("height",(n*e).toString())}setBoundaries({minX:t,maxX:e,minY:n,maxY:r}){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}get width(){return this.domNode.viewBox.baseVal.width}set width(t){this.maxX=this.minX+t}get height(){return this.domNode.viewBox.baseVal.height}set height(t){this.maxY=this.minY+t}get horizontalScaling(){let t=this.width;return this.domNode.width.baseVal.value/t}set horizontalScaling(t){let e=this.width;this.domNode.setAttribute("width",(t*e).toString())}get verticalScaling(){let t=this.height;return this.domNode.height.baseVal.value/t}set verticalScaling(t){let e=this.height;this.domNode.setAttribute("height",(t*e).toString())}setScaling(t){this.horizontalScaling=t,this.verticalScaling=t}get horizontalClientScaling(){return new He.HorizontalClientScaling(this.domNode).get()}get verticalClientScaling(){return new He.VerticalClientScaling(this.domNode).get()}get bases(){return this.basesDrawing.bases}appendBase(t){this.basesDrawing.append(t)}addBase(t){return this.basesDrawing.add(t)}get primaryBondDefaultValues(){return this.primaryBondsDrawing.primaryBondDefaultValues}set primaryBondDefaultValues(t){this.primaryBondsDrawing.primaryBondDefaultValues=t}get primaryBonds(){return this.primaryBondsDrawing.primaryBonds}set primaryBonds(t){this.primaryBondsDrawing.primaryBonds=[...t]}appendPrimaryBond(t){this.primaryBondsDrawing.append(t)}addPrimaryBond(t,e){return this.primaryBondsDrawing.add(t,e)}get secondaryBondDefaultValues(){return this.secondaryBondsDrawing.secondaryBondDefaultValues}set secondaryBondDefaultValues(t){this.secondaryBondsDrawing.secondaryBondDefaultValues=t}get secondaryBonds(){return this.secondaryBondsDrawing.secondaryBonds}set secondaryBonds(t){this.secondaryBondsDrawing.secondaryBonds=[...t]}appendSecondaryBond(t){this.secondaryBondsDrawing.append(t)}addSecondaryBond(t,e){return this.secondaryBondsDrawing.add(t,e)}get contentBBox(){return this.domNode.getBBox()}setPadding(t){let e=this.contentBBox;this.setBoundaries({minX:e.x-t,maxX:e.x+e.width+t,minY:e.y-t,maxY:e.y+e.height+t})}}var tn=n(127),en=n(661),nn=n(986);class rn{constructor(t){this.targetDrawing=t}draw(t,e){let n=[...t].map((t=>this.targetDrawing.addBase(t)));(0,tn.consecutivePairs)(n).forEach((t=>this.targetDrawing.addPrimaryBond(...t)));let r=[...(0,tn.parseDotBracket)(n,e)];r.forEach((t=>this.targetDrawing.addSecondaryBond(...t))),n.forEach((t=>t.bringToFront()));let i=1.87*(0,nn.mean)(n.map((t=>t.bbox.height)));(0,en.radialize)(n,r,{spacing:i,basePairSpacing:i/2,hairpinLoopSpacing:i/2})}}})(),r})(),t.exports=e()},628: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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),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,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),u=(0,i.min)(r),h=o;h<=u;h++)s.push(h);e.push(s),n=r,r=t.shift()}return e},t}();function h(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FirstPairedBase:()=>e,LastPairedBase:()=>s,LeadingDanglingBases:()=>o,Linkers:()=>l,PositionPairs:()=>t,Stems:()=>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 n=e.flat(),r=t.findIndex((function(t){return n.includes(t)}));if(r<0)throw new Error("No paired bases present in sequence.");return t[r]},t}(),i=n(986),s=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0],e=this.targetStructure[1];if(0==e.length)throw new Error("There are no paired bases.");var n=e.flat().map((function(e){return t.indexOf(e)}));if((0,i.max)(n)<0)throw new Error("No paired bases present in sequence.");return t[(0,i.max)(n)]},t}(),o=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var n=(new(e.bind.apply(e,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),r=t.indexOf(n);if(r<0)throw new Error("No paired bases present in sequence.");return t.slice(0,r)},t}(),a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[0];if(0==this.targetStructure[1].length)throw new Error("There are no paired bases.");var e=(new(s.bind.apply(s,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get(),n=t.indexOf(e);if(n<0)throw new Error("No paired bases present in sequence.");return t.slice(n+1)},t}(),u=n(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],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Stems(e,n).get().map((function(t){return t.map((function(t){return[e[t[0]-1],e[t[1]-1]]}))}))},e}(),l=function(){function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return e.prototype.get=function(){var e=this.targetStructure[0],n=(new(t.bind.apply(t,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get();return new u.Linkers(e,n).get().map((function(t){return t.map((function(t){return e[t-1]}))}))},e}()})(),r})(),t.exports=e()},173:function(t){var e;e=()=>(()=>{var t={422:function(t){t.exports=(()=>{var t={138:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}return t.r(e),t.d(e,{average:()=>r,mean:()=>r,sum:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function t(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function e(t,e){return{x:e.x-t.x,y:e.y-t.y}}n.r(r),n.d(r,{centroid:()=>s,displacement:()=>e,distance:()=>t,midpoint:()=>o});var i=n(138);function s(t){return{x:(0,i.mean)(t.map((function(t){return t.x}))),y:(0,i.mean)(t.map((function(t){return t.y})))}}function o(t,e){return s([t,e])}})(),r})()},872:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{CircularSegment:()=>a,Semicircle:()=>e});var t=n(422),e=function(){function e(t){this.chord=t}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return Math.PI*this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcAngle",{get:function(){return Math.PI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.chordLength/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){return(0,t.midpoint)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),e}(),i=n(872),s=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(r<=i)throw new Error("Arc length is too small.");if(r>=Math.PI*i/2)throw new Error("Arc length is too big.");for(var s=Math.PI/2,o=0;o<20;o++)s-=(r/i*Math.sin(s)-s)/(r/i*Math.cos(s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e+=(Math.PI-this.arcAngle)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),o=function(){function e(e,n){this.chord=e,this.moreProps=n;var r=n.arcLength,i=(0,t.distance)(e[0],e[1]);if(0==i)throw new Error("Chord length cannot be zero.");if(r<=Math.PI*i/2)throw new Error("Arc length is too small.");for(var s=Math.PI,o=0;o<20;o++)s-=(r/i*Math.sin(Math.PI-s)-s)/(-r/i*Math.cos(Math.PI-s)-1);this.arcAngle=2*s}return Object.defineProperty(e.prototype,"chordLength",{get:function(){return(0,t.distance)(this.chord[0],this.chord[1])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleRadius",{get:function(){return this.arcLength/this.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleDiameter",{get:function(){return 2*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCircumference",{get:function(){return 2*Math.PI*this.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentCircleCenterPoint",{get:function(){var e=(0,i.direction)((0,t.displacement)(this.chord[0],this.chord[1]));e-=(this.arcAngle-Math.PI)/2;var n=this.parentCircleRadius;return{x:this.chord[0].x+n*Math.cos(e),y:this.chord[0].y+n*Math.sin(e)}},enumerable:!1,configurable:!0}),e}(),a=function(){function n(n,r){this.chord=n,this.moreProps=r;var i=r.arcLength,a=(0,t.distance)(n[0],n[1]);if(a>0&&i<=a)throw new Error("Arc length is too small.");var u=a<.001&&i<.001,h=Math.PI*a/2,l=Math.abs(i-h)<.001;this.wrappedCircularSegment=u||l?new e(n):i<h?new s(n,{arcLength:i}):new o(n,{arcLength:i})}return Object.defineProperty(n.prototype,"chordLength",{get:function(){return this.wrappedCircularSegment.chordLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcLength",{get:function(){return this.moreProps.arcLength},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"arcAngle",{get:function(){return this.wrappedCircularSegment.arcAngle},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleRadius",{get:function(){return this.wrappedCircularSegment.parentCircleRadius},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleDiameter",{get:function(){return this.wrappedCircularSegment.parentCircleDiameter},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCircumference",{get:function(){return this.wrappedCircularSegment.parentCircleCircumference},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parentCircleCenterPoint",{get:function(){return this.wrappedCircularSegment.parentCircleCenterPoint},enumerable:!1,configurable:!0}),n}()})(),r})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,degrees:()=>m,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return Math.abs(t-e)<=n}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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>c,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=n(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(n){return e(n)&&(0,t.isFiniteNumber)(n.x)&&(0,t.isFiniteNumber)(n.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function a(t,e,n){return o(t,e)<=n}function 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 l=n(30);function c(t,e){return(0,l.direction)(u(t,e))}var f=n(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])}})(),r})()},369:function(t){var e;e=()=>(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Linkers:()=>u,Stems:()=>a,areStacked:()=>o,deepCopy:()=>e,parseDotBracket:()=>h,sorted:()=>s});var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function e(e){return e.map((function(e){return t([],e,!0)}))}var i=n(986);function s(t){var n=e(t);return n.forEach(i.sortNumbers),n.sort((function(t,e){return t[0]-e[0]})),n}function o(t,e){var n=s([t,e]);return n[0][0]==n[1][0]-1&&n[0][1]==n[1][1]+1}var a=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.targetStructure=t}return t.prototype.get=function(){var t=this.targetStructure[1];if(0==t.length)return[];var e=s(t),n=[],r=[];return e.forEach((function(t){var e=0==r.length?null:r[r.length-1];!e||o(e,t)?r.push(t):(n.push(r),r=[t])})),n.push(r),n},t}(),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,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([void 0],this.targetStructure,!1)))).get().flatMap((function(t){return[t.map(i.min),t.map(i.max)]}));t.forEach(i.sortNumbers),t.sort((function(t,e){return(0,i.min)(t)-(0,i.min)(e)}));for(var e=[],n=t.shift(),r=t.shift();n&&r;){for(var s=[],o=(0,i.max)(n),u=(0,i.min)(r),h=o;h<=u;h++)s.push(h);e.push(s),n=r,r=t.shift()}return e},t}();function h(t){var e=t.split(""),n=[".","(",")"];e.forEach((function(t){if(!n.includes(t))throw new Error('Unrecognized character in dot-bracket notation: "'.concat(t,'".'))}));var r=[],i=[];if(e.forEach((function(t,e){var n=e+1;if("("==t)i.push(n);else if(")"==t){var s=i.pop();if("number"!=typeof s)throw new Error("Unmatched downstream partner(s) in dot-bracket notation.");r.push([s,n])}})),i.length>0)throw new Error("Unmatched upstream partner(s) in dot-bracket notation.");return s(r)}})(),r})(),t.exports=e()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Centroid:()=>s,Direction:()=>d,MaxCenterX:()=>u,MaxCenterY:()=>l,MinCenterX:()=>a,MinCenterY:()=>h,NucleobaseMock:()=>t,circularize:()=>w,flipSelfX:()=>g,flipSelfY:()=>y,flipX:()=>p,flipY:()=>m,linearize:()=>b,radialize:()=>L,rotate:()=>f,round:()=>S,shift:()=>e,stemmify:()=>x,straighten:()=>v});class t{constructor(t){this.props=t}getCenterPoint(){return this.props.centerPoint}setCenterPoint(t){this.props.centerPoint=t}}function e(t,e){t.forEach((t=>{let n=t.getCenterPoint();t.setCenterPoint({x:n.x+e.x,y:n.y+e.y})}))}var i=n(725);class s{constructor(t){this.targetBases=t}get(){let t=this.targetBases.map((t=>t.getCenterPoint()));return(0,i.centroid)(t)}set(t){let n=this.get(),r=(0,i.displacement)(n,t);e(this.targetBases,r)}}var o=n(986);class a{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class u{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().x)))}set(t){let n=this.get();e(this.targetBases,{x:t-n,y:0})}}class h{constructor(t){this.targetBases=t}get(){return(0,o.min)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}class l{constructor(t){this.targetBases=t}get(){return(0,o.max)(this.targetBases.map((t=>t.getCenterPoint().y)))}set(t){let n=this.get();e(this.targetBases,{x:0,y:t-n})}}var c=n(30);function f(t,e){if(0==t.length)return;let n=new s(t).get();t.forEach((t=>{let r=t.getCenterPoint(),s=(0,i.distance)(n,r),o=(0,c.direction)((0,i.displacement)(n,r));o+=e,t.setCenterPoint({x:n.x+s*Math.cos(o),y:n.y+s*Math.sin(o)})}))}class 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,c.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 n=t.getCenterPoint(),r=n.y-e;t.setCenterPoint({x:n.x,y:e-r})}))}function m(t){let e=new s(t).get().x;t.forEach((t=>{let n=t.getCenterPoint(),r=n.x-e;t.setCenterPoint({x:e-r,y:n.y})}))}function g(t){if(0==t.length)return;let n=t[0],{x:r,y:s}=n.getCenterPoint(),o={x:r,y:s},a=new d(t).get();f(t,-a),p(t),f(t,a),e(t,(0,i.displacement)(n.getCenterPoint(),o))}function y(t){let e=new s(t),{x:n,y:r}=e.get(),i=n,o=r,a=new d(t).get();f(t,-a),m(t),f(t,a),e.set({x:i,y:o})}function b(t,e){let{spacing:n}=e;if(t.length<2)return;let r=new d(t),i=r.get(),o=new s(t),{x:a,y:u}=o.get(),h={x:a,y:u};t.forEach(((t,e)=>{t.setCenterPoint({x:e*n,y:0})})),r.set(i),o.set(h)}function v(t){if(t.length<3)return;let e=t[0],n=t[t.length-1],r=[e.getCenterPoint(),n.getCenterPoint()],s=(0,i.distance)(r[0],r[1]),o=(0,c.direction)((0,i.displacement)(r[0],r[1])),a=s/(t.length-1),u=a*Math.cos(o),h=a*Math.sin(o),{x:l,y:f}=r[0];t.forEach((t=>{t.setCenterPoint({x:l,y:f}),l+=u,f+=h}))}function x(t,n){let{basePairLength:r,basePairSpacing:o}=n;if(t.length<2)return;let a=Math.ceil(t.length/2),u=t.slice(0,a),h=t.slice(a),l=new s(t),{x:c,y:p}=l.get(),m={x:c,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],v=t[t.length-1];e(u,(0,i.displacement)(y.getCenterPoint(),{x:0,y:0})),e(h,(0,i.displacement)(v.getCenterPoint(),{x:r,y:0})),f(t,g),l.set(m)}function w(t,e){let{spacing:n,terminiGap:r}=e;if(t.length<2)return;let i=new s(t),{x:o,y:a}=i.get(),u=o,h=a,l=new d(t).get(),c=n*(t.length-1);c+=r,Math.abs(c)<1e-5&&(c=1e-5);let p=c/(2*Math.PI),m=Math.PI/2+2*Math.PI*(.5*r/c);t.forEach(((t,e)=>{let r=m+2*Math.PI*(e*n)/c;t.setCenterPoint({x:p*Math.cos(r),y:p*Math.sin(r)})})),f(t,l),i.set({x:u,y:h})}var _=n(173);function S(t,n){let{spacing:r}=n;if(t.length<3)return;let s=t[0],o=t[t.length-1],a=[s.getCenterPoint(),o.getCenterPoint()],u=(0,i.distance)(a[0],a[1]),h=r*(t.length-1);if(h-u<.001)return void v(t);if(u<.001){let{x:n,y:o}=s.getCenterPoint();return w(t,{spacing:r,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:n,y:o}))}let l=new _.CircularSegment(a,{arcLength:h}),f=l.parentCircleCenterPoint,d=l.parentCircleRadius,p=(0,c.direction)((0,i.displacement)(f,s.getCenterPoint())),m=l.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 M=n(127),P=n(369);class O{static from(t){return{to:e=>({inclusive:()=>{let n=e-t+1;return Array.from({length:n},((e,n)=>t+n))}})}}}class C{static of(...t){let[e,n]=t,r=new M.PositionPairs(...t).get();r=(0,P.sorted)(r);let i=r.map((t=>t.map((t=>t-1)))),s=[],a=0;return e.forEach(((t,e)=>{let n=i.find((t=>t.includes(e)));n&&e==(0,o.min)(n)?(s.push(a),a+=1):n&&e==(0,o.max)(n)?(a-=1,s.push(a)):s.push(a)})),s}}class N{constructor(...t){let[e,n]=t;this.rawForm=t,this.mountainPlotTraversal=C.of(...t),this.positionPairs=new M.PositionPairs(...t).get(),this.indexPairs=this.positionPairs.map((t=>[t[0]-1,t[1]-1])),this.pairedBases=new Set(n.flat()),this.pairedIndices=new Set(e.map(((t,e)=>({b:t,i:e}))).filter((t=>this.pairedBases.has(t.b))).map((t=>t.i)))}[Symbol.iterator](){return this.rawForm.values()}get sequence(){return this.rawForm[0]}get basePairs(){return this.rawForm[1]}}class A{static correspondingTo(t){return{in:e=>t.map((t=>e.sequence.indexOf(t)))}}}class T{static composedOf(t){if(0==t.length)throw new Error("All stems must have at least one base-pair.");let n=t[0],r=t[t.length-1],s=t.map((t=>t[0])),o=t.map((t=>t[1])).reverse(),a=n[0],u=n[1],h=[...s,...o];return{[Symbol.iterator]:()=>t.values(),bottomBasePair:n,topBasePair:r,side5:s,side3:o,flat:()=>h,firstBase:a,lastBase:u,stemmify:()=>({with:t=>{let{basePairLength:n,basePairSpacing:r}=t,s=Object.assign({},a.getCenterPoint());x(h,{basePairLength:n,basePairSpacing:r}),e(h,(0,i.displacement)(a.getCenterPoint(),s))}})}}}class j{static in(t){return{[Symbol.iterator]:()=>new M.Stems(t.sequence,t.basePairs).get().map((t=>T.composedOf(t))).values()}}}class E{static composedOf(t){if(t.length<2)throw new Error("Linkers must have at least two bases.");let n=t[0],r=t[t.length-1],s=t.slice(1,-1);return{in:o=>{let a=o.sequence.indexOf(n),u=o.sequence.indexOf(r),h=O.from(a).to(u).inclusive(),l=!!o.indexPairs.find((t=>t.includes(a)&&t.includes(u))),c=h.every((t=>0==o.mountainPlotTraversal[t])),f=1==new Set(h.map((t=>o.mountainPlotTraversal[t]))).size&&!l;return{[Symbol.iterator]:()=>t.values(),indices:h,firstBase:n,lastBase:r,firstIndex:a,lastIndex:u,unpairedBases:{[Symbol.iterator]:()=>s.values(),stemmify:()=>({with:t=>{let{spacing:n}=t;if(s.length<3)return;let r=s[0],o=s[s.length-1],a=Object.assign({},r.getCenterPoint());x(s,{basePairLength:(0,i.distance)(r.getCenterPoint(),o.getCenterPoint()),basePairSpacing:n}),e(s,(0,i.displacement)(r.getCenterPoint(),a))}})},get middleThreeUnpairedBases(){if(s.length<3)throw new Error("This linker has less than three unpaired bases.");if(s.length%2==0)throw new Error("This linker has an even number of unpaired bases.");let t=Math.floor(s.length/2);return[s[t-1],s[t],s[t+1]]},isHairpinLoop:()=>l,isInOutermostLoop:()=>c,isBetweenSiblingStems:()=>f,round:()=>({with:e=>{let{spacing:n}=e;S(t,{spacing:n})}})}}}}}class D{static in(t){let e=new M.Linkers(t.sequence,t.basePairs).get().map((e=>E.composedOf(e).in(t)));return{[Symbol.iterator]:()=>e.values(),thatAreHairpinLoops:{[Symbol.iterator]:()=>e.filter((t=>t.isHairpinLoop())).values()},inOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>t.isInOutermostLoop())).values()},notInOutermostLoop:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).values(),betweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isInOutermostLoop())).filter((t=>t.isBetweenSiblingStems())).values()}},notBetweenSiblingStems:{[Symbol.iterator]:()=>e.filter((t=>!t.isBetweenSiblingStems())).values()}}}}class k{static closedBy(n){return{in:r=>{let s=n.topBasePair,a=A.correspondingTo(s).in(r),u=(0,o.min)(a),h=r.sequence.filter(((t,e)=>e>(0,o.min)(a)&&e<(0,o.max)(a)&&r.mountainPlotTraversal[e]==r.mountainPlotTraversal[u]+1)),l=h.map((t=>r.sequence.indexOf(t))),c=h.filter((t=>r.pairedBases.has(t))),f=l.filter((t=>r.pairedIndices.has(t))),d=[s[0],...h,s[1]];return{[Symbol.iterator]:()=>d.values(),parentStructure:r,closingStem:n,closingBasePair:s,closingIndexPair:a,enclosedBases:h,enclosedIndices:l,enclosedPairedBases:c,enclosedPairedIndices:f,get platform(){if(0==f.length)throw new Error("This loop does not have a platform.");let n=(0,o.min)(f),u=(0,o.max)(f),h=r.sequence.filter(((t,e)=>e>=n&&e<=u&&l.includes(e)&&[e-1,e,e+1].some((t=>f.includes(t)))));return{[Symbol.iterator]:()=>h.values(),firstIndex:n,lastIndex:u,arch:()=>({with:r=>{let{spacing:l}=r,c=(0,o.max)([h.length-2,n-(0,o.min)(a)-1,(0,o.max)(a)-u-1,0]),f=O.from(1).to(c).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());w([s[0],...f,...h,...d,s[1]],{spacing:l,terminiGap:l}),e([...s,...h],(0,i.displacement)(s[0].getCenterPoint(),p))}})}}}}}}}class B{static of(t){let e=t.sequence.filter(((e,n)=>0==t.mountainPlotTraversal[n]));return{[Symbol.iterator]:()=>e.values()}}}function L(t,e,n){var r;let{spacing:i,basePairSpacing:o}=n,a=null!==(r=n.hairpinLoopSpacing)&&void 0!==r?r:i,u=new N(t,e);if(t.length<2)return;if(0==e.length)return void w(t,{spacing:i,terminiGap:2*i});let h=Object.assign({},new s(t).get()),l=new d(t).get(),c=j.in(u),f=D.in(u);w([...B.of(u)],{spacing:i,terminiGap:2*i});let p=[...c].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(l),new s(t).set(h)}})(),r})(),t.exports=e()},139:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{DragTranslater:()=>r,FormFronter:()=>n});class n{constructor(t){this.targetForm=t,t.addEventListener("mousedown",(()=>this.bringToFront()))}bringToFront(){let t=this.targetForm.parentNode;t&&t.lastChild!==this.targetForm&&t.appendChild(this.targetForm)}}class r{constructor(t){this.targetForm=t,this.mouseIsDown=!1,window.addEventListener("mousedown",(t=>this.handleMouseDown(t))),window.addEventListener("mousemove",(t=>this.handleMouseMove(t))),window.addEventListener("mouseup",(t=>this.handleMouseUp(t)))}get currentTranslation(){let t=this.targetForm.getBoundingClientRect(),e=t.x,n=t.y,r=this.targetForm.style.translate;this.targetForm.style.translate="0px 0px";let i=this.targetForm.getBoundingClientRect(),s=i.x,o=i.y;return this.targetForm.style.translate=r,{x:e-s,y:n-o}}set currentTranslation(t){this.targetForm.style.translate=`${t.x}px ${t.y}px`}untranslate(){this.targetForm.style.translate="0px 0px"}handleMouseDown(t){this.lastMouseDown=t,this.mouseIsDown=!0}handleMouseMove(t){if(!this.mouseIsDown)return;if(!this.lastMouseDown)return;if(this.lastMouseDown.target!==this.targetForm)return;let e=this.currentTranslation;this.currentTranslation={x:e.x+t.movementX,y:e.y+t.movementY}}handleMouseUp(t){this.mouseIsDown=!1}}return e})(),t.exports=e()},986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>d,average:()=>r,clamp:()=>f,degrees:()=>g,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>p,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>m,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return t<e?e:t>n?n:t}function d(t,e,n){return Math.abs(t-e)<=n}function p(t){i(t),t.reverse()}function m(t){var e=o(t);return e.reverse(),e}function g(t){return t*(180/Math.PI)}function y(t){return t*(Math.PI/180)}return e})()},725:function(t){t.exports=(()=>{var t={986:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){var e=0;return t.forEach((function(t){return e+=t})),e}function r(t){return n(t)/t.length}function i(t){t.sort((function(t,e){return t-e}))}t.r(e),t.d(e,{areWithin:()=>f,average:()=>r,degrees:()=>m,isBetweenExclusive:()=>c,isBetweenInclusive:()=>l,max:()=>h,mean:()=>r,median:()=>a,min:()=>u,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n});var s=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function o(t){var e=s([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var n=e.length/2,i=n-1;return r([e[n],e[i]])}function 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 l(t,e,n){return t>=e&&t<=n}function c(t,e,n){return t>e&&t<n}function f(t,e,n){return Math.abs(t-e)<=n}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,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},30:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return Math.pow(Math.pow(t.x,2)+Math.pow(t.y,2),.5)}function r(t){return Math.atan2(t.y,t.x)}return t.r(e),t.d(e,{direction:()=>r,magnitude:()=>n}),e})()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{areWithin:()=>a,centroid:()=>d,deepCopy:()=>s,direction:()=>c,displaced:()=>h,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>p});var t=n(854);function e(e){return(0,t.isNonNullObject)(e)&&(0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)}function i(n){return e(n)&&(0,t.isFiniteNumber)(n.x)&&(0,t.isFiniteNumber)(n.y)}function s(t){return{x:t.x,y:t.y}}function o(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.pow(Math.pow(n,2)+Math.pow(r,2),.5)}function a(t,e,n){return o(t,e)<=n}function 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 l=n(30);function c(t,e){return(0,l.direction)(u(t,e))}var f=n(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])}})(),r})()},854:function(t){t.exports=(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"number"==typeof t}function r(t){return n(t)&&Number.isFinite(t)}function i(t){return n(t)&&!Number.isFinite(t)}function s(t){return r(t)&&t>0}function o(t){return r(t)&&t>=0}function a(t){return"string"==typeof t}function u(t){return null==t}function h(t){return"object"==typeof t&&null!==t}function l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>r,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>h,isNullish:()=>u,isNumber:()=>n,isPositiveFiniteNumber:()=>s,isString:()=>a}),e})()},660:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>l,JI:()=>h,nn:()=>a,t0:()=>u});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,".vgysHliQRCkOsZGpvuN3 {\n margin-top: 29px;\n\n display: block;\n}\n\n.njPAl0Ss7BX217yA9uiC {\n position: absolute;\n\n top: 54px;\n right: 82px;\n left: 66px;\n bottom: 60px;\n\n max-width: 311px;\n max-height: 553px;\n margin-right: auto;\n\n overflow: auto;\n\n border: 1px solid #2b0744;\n border-radius: 15px;\n box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.06);\n\n padding: 20px 0px 50px 32px;\n\n background-color: #f0f0ffc2;\n\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n}\n\n.q6SSzmvj00Kk0DdrH3Q4 .vgysHliQRCkOsZGpvuN3 {\n display: none;\n}\n",""]);var a="vgysHliQRCkOsZGpvuN3",u="njPAl0Ss7BX217yA9uiC",h="q6SSzmvj00Kk0DdrH3Q4";const l=o},667:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>h,ML:()=>a,W5:()=>u});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.CDW2oqycaRYI5MF6Wv0G {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.THV2nYuiSzby_E07ALx8 {\n margin-left: 10px;\n\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 700;\n font-style: normal;\n color: black;\n}\n',""]);var a="CDW2oqycaRYI5MF6Wv0G",u="THV2nYuiSzby_E07ALx8";const h=o},882:(t,e,n)=>{"use strict";n.d(e,{A:()=>u,b:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.Bgdw8crkFCxAvMBMu_1a {\n position: absolute;\n top: 13px;\n right: 17px;\n\n border: none;\n outline: none;\n\n padding: 3px 12px;\n border-radius: 3px;\n\n font-family: "Open Sans", sans-serif;\n font-size: 16px;\n font-weight: 600;\n font-style: normal;\n color: #871414;\n\n cursor: pointer;\n\n pointer-events: auto;\n\n background-color: transparent;\n}\n\n.Bgdw8crkFCxAvMBMu_1a:hover {\n background-color: #cab8d99c;\n}\n\n.Bgdw8crkFCxAvMBMu_1a:active {\n background-color: #aa8eba9e;\n}\n',""]);var a="Bgdw8crkFCxAvMBMu_1a";const u=o},95:(t,e,n)=>{"use strict";n.d(e,{A:()=>u,k:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.XUQV0QhCnWsiToeOha12 {\n margin: 0px;\n\n border: none;\n\n padding: 4px 32px 4px 32px;\n border-radius: 2px;\n\n /* use before pseudo-element for background */\n background-color: transparent;\n position: relative;\n isolation: isolate;\n\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 600;\n font-style: normal;\n color: white;\n\n cursor: pointer;\n\n pointer-events: auto;\n}\n\n.XUQV0QhCnWsiToeOha12::before {\n content: "";\n\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n\n border-radius: 2px;\n background-color: #0d0d82;\n box-shadow: 0 3px 3px rgba(213, 213, 255, 0.53);\n\n z-index: -1;\n}\n\n.XUQV0QhCnWsiToeOha12:focus {\n outline: none;\n}\n\n.XUQV0QhCnWsiToeOha12:hover::before {\n transform: scale(1.05);\n transition: transform 0.1s;\n}\n\n.XUQV0QhCnWsiToeOha12:active::before {\n transform: scale(1);\n transition: transform 0s;\n}\n',""]);var a="XUQV0QhCnWsiToeOha12";const u=o},284:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>h,oP:()=>a,ps:()=>u});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.mDefkyz5cznJW6JNsyQO {\n margin-right: 1px;\n\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 700;\n font-style: normal;\n color: black;\n}\n\n.bAaeYfCq0Wuu1tMfImqp {\n margin-top: 22px;\n\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n}\n',""]);var a="mDefkyz5cznJW6JNsyQO",u="bAaeYfCq0Wuu1tMfImqp";const h=o},7:(t,e,n)=>{"use strict";n.d(e,{A:()=>u,w:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.MZbumCZQuLp9LBGHO6TW {\n margin-top: 13px;\n margin-bottom: 0px;\n\n font-family: "Open Sans", sans-serif;\n font-size: 26px;\n font-weight: 700;\n font-style: normal;\n color: black;\n\n user-select: none;\n -webkit-user-select: none;\n\n /**\n * So that the form can be dragged around while clicking on top of the header.\n */\n pointer-events: none;\n}\n',""]);var a="MZbumCZQuLp9LBGHO6TW";const u=o},645:(t,e,n)=>{"use strict";n.d(e,{A:()=>u,E:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.PP0a01AGPBAMFt1rjSWm {\n margin: 0px;\n\n border: none;\n\n padding: 4px 12px;\n border-radius: 3px;\n\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 700;\n font-style: normal;\n color: #06064a;\n\n background-color: rgba(219, 219, 255, 0.9);\n\n cursor: pointer;\n\n pointer-events: auto;\n}\n\n.PP0a01AGPBAMFt1rjSWm:hover {\n background-color: rgba(175, 175, 255, 0.92);\n}\n\n.PP0a01AGPBAMFt1rjSWm:active {\n background-color: rgba(147, 147, 255, 0.92);\n}\n\n.PP0a01AGPBAMFt1rjSWm:focus {\n outline: none;\n}\n',""]);var a="PP0a01AGPBAMFt1rjSWm";const u=o},501:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>f,D:()=>a,Ik:()=>l,Qs:()=>h,ho:()=>c,wx:()=>u});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.lI4aOsJqPJI1m7a5f1my {}\n\n.h4DVv7CxcIZPjNiZT5KM {\n margin: 0px;\n\n border: none;\n box-shadow: none;\n outline: none;\n\n padding: 0px;\n\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 700;\n font-style: normal;\n color: black;\n\n background-color: transparent;\n\n cursor: pointer;\n\n pointer-events: auto;\n\n text-decoration: none;\n}\n\n.h4DVv7CxcIZPjNiZT5KM:hover {\n text-decoration: underline;\n}\n\n.mrSgWpHooARxmcL9jBAN {\n margin: 10px 0px 0px 12px;\n\n display: flex;\n flex-direction: column;\n align-items: start;\n gap: 6px;\n\n visibility: collapse;\n max-height: 0px;\n}\n\n.hsTUoJkpA2rJe2qksZZe {\n margin-top: 30px;\n\n display: flex;\n flex-direction: column;\n align-items: start;\n}\n\n.XNPnnYbKD11ltMOA6cEe .mrSgWpHooARxmcL9jBAN {\n visibility: visible;\n max-height: none;\n}\n\n.XNPnnYbKD11ltMOA6cEe .lI4aOsJqPJI1m7a5f1my {\n transform: rotate(90deg);\n}\n',""]);var a="lI4aOsJqPJI1m7a5f1my",u="h4DVv7CxcIZPjNiZT5KM",h="mrSgWpHooARxmcL9jBAN",l="hsTUoJkpA2rJe2qksZZe",c="XNPnnYbKD11ltMOA6cEe";const f=o},592:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>h,JU:()=>u,bw:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.lp2qOqh0SbxpABJp4ZAg {\n font-weight: 700;\n color: black;\n}\n\n.M6h_Iv9mdsd5EHCJLCqW {\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 600;\n font-style: normal;\n color: #1b1b1c;\n\n user-select: none;\n -webkit-user-select: none;\n}\n',""]);var a="lp2qOqh0SbxpABJp4ZAg",u="M6h_Iv9mdsd5EHCJLCqW";const h=o},213:(t,e,n)=>{"use strict";n.d(e,{A:()=>u,O:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,".t7iwx4NB8G7MjjaXddYK {\n margin-left: 16px;\n\n border: none;\n border-radius: 4px;\n box-shadow: 0px 0px 10px #d4d4dd;\n\n outline: none;\n\n width: 32px;\n height: 32px;\n\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n\n background-color: black;\n\n cursor: grab;\n\n pointer-events: auto;\n}\n\n.t7iwx4NB8G7MjjaXddYK:hover {\n background-color: #404044;\n}\n\n.t7iwx4NB8G7MjjaXddYK:active {\n background-color: #77777d;\n\n cursor: grabbing;\n}\n",""]);var a="t7iwx4NB8G7MjjaXddYK";const u=o},61:(t,e,n)=>{"use strict";n.d(e,{A:()=>u,_:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.Efce4uvUS5MsCZxHnyA4 {\n border: 1px solid #75758c;\n border-radius: 2px;\n\n outline: none;\n\n width: 78px;\n\n padding: 3px 6px;\n\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 700;\n font-style: normal;\n color: black;\n\n pointer-events: auto;\n}\n\n.Efce4uvUS5MsCZxHnyA4:hover {\n border-color: #0a0a0b;\n}\n\n.Efce4uvUS5MsCZxHnyA4:focus {\n border-color: #0a0a0b;\n\n outline: none;\n}\n',""]);var a="Efce4uvUS5MsCZxHnyA4";const u=o},713:(t,e,n)=>{"use strict";n.d(e,{A:()=>u,k:()=>a});var r=n(601),i=n.n(r),s=n(314),o=n.n(s)()(i());o.push([t.id,'.nKVMuzbq51G9t_8NyZb5 {\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 700;\n font-style: normal;\n color: black;\n\n user-select: none;\n\n cursor: text;\n\n pointer-events: auto;\n}\n',""]);var a="nKVMuzbq51G9t_8NyZb5";const u=o},314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,i,s){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(r)for(var a=0;a<this.length;a++){var u=this[a][0];null!=u&&(o[u]=!0)}for(var h=0;h<t.length;h++){var l=[].concat(t[h]);r&&o[l[0]]||(void 0!==s&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=s),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),i&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=i):l[4]="".concat(i)),e.push(l))}},e}},601:t=>{"use strict";t.exports=function(t){return t[1]}},692:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var s=[],o=Object.getPrototypeOf,a=s.slice,u=s.flat?function(t){return s.flat.call(t)}:function(t){return s.concat.apply([],t)},h=s.push,l=s.indexOf,c={},f=c.toString,d=c.hasOwnProperty,p=d.toString,m=p.call(Object),g={},y=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},b=function(t){return null!=t&&t===t.window},v=r.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function w(t,e,n){var r,i,s=(n=n||v).createElement("script");if(s.text=t,e)for(r in x)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&s.setAttribute(r,i);n.head.appendChild(s).parentNode.removeChild(s)}function _(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?c[f.call(t)]||"object":typeof t}var S="3.7.1",M=/HTML$/i,P=function(t,e){return new P.fn.init(t,e)};function O(t){var e=!!t&&"length"in t&&t.length,n=_(t);return!y(t)&&!b(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function C(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}P.fn=P.prototype={jquery:S,constructor:P,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=P.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return P.each(this,t)},map:function(t){return this.pushStack(P.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(P.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(P.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:s.sort,splice:s.splice},P.extend=P.fn.extend=function(){var t,e,n,r,i,s,o=arguments[0]||{},a=1,u=arguments.length,h=!1;for("boolean"==typeof o&&(h=o,o=arguments[a]||{},a++),"object"==typeof o||y(o)||(o={}),a===u&&(o=this,a--);a<u;a++)if(null!=(t=arguments[a]))for(e in t)r=t[e],"__proto__"!==e&&o!==r&&(h&&r&&(P.isPlainObject(r)||(i=Array.isArray(r)))?(n=o[e],s=i&&!Array.isArray(n)?[]:i||P.isPlainObject(n)?n:{},i=!1,o[e]=P.extend(h,s,r)):void 0!==r&&(o[e]=r));return o},P.extend({expando:"jQuery"+(S+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==f.call(t)||(e=o(t))&&("function"!=typeof(n=d.call(e,"constructor")&&e.constructor)||p.call(n)!==m))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){w(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(O(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},text:function(t){var e,n="",r=0,i=t.nodeType;if(!i)for(;e=t[r++];)n+=P.text(e);return 1===i||11===i?t.textContent:9===i?t.documentElement.textContent:3===i||4===i?t.nodeValue:n},makeArray:function(t,e){var n=e||[];return null!=t&&(O(Object(t))?P.merge(n,"string"==typeof t?[t]:t):h.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:l.call(e,t,n)},isXMLDoc:function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!M.test(e||n&&n.nodeName||"HTML")},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;r<n;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r=[],i=0,s=t.length,o=!n;i<s;i++)!e(t[i],i)!==o&&r.push(t[i]);return r},map:function(t,e,n){var r,i,s=0,o=[];if(O(t))for(r=t.length;s<r;s++)null!=(i=e(t[s],s,n))&&o.push(i);else for(s in t)null!=(i=e(t[s],s,n))&&o.push(i);return u(o)},guid:1,support:g}),"function"==typeof Symbol&&(P.fn[Symbol.iterator]=s[Symbol.iterator]),P.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){c["[object "+e+"]"]=e.toLowerCase()}));var N=s.pop,A=s.sort,T=s.splice,j="[\\x20\\t\\r\\n\\f]",E=new RegExp("^"+j+"+|((?:^|[^\\\\])(?:\\\\.)*)"+j+"+$","g");P.contains=function(t,e){var n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(t.contains?t.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))};var D=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function k(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}P.escapeSelector=function(t){return(t+"").replace(D,k)};var B=v,L=h;!function(){var t,e,n,i,o,u,h,c,f,p,m=L,y=P.expando,b=0,v=0,x=tt(),w=tt(),_=tt(),S=tt(),M=function(t,e){return t===e&&(o=!0),0},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",D="(?:\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",k="\\["+j+"*("+D+")(?:"+j+"*([*^$|!~]?=)"+j+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+D+"))|)"+j+"*\\]",I=":("+D+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+k+")*)|.*)\\)|)",F=new RegExp(j+"+","g"),R=new RegExp("^"+j+"*,"+j+"*"),q=new RegExp("^"+j+"*([>+~]|"+j+")"+j+"*"),z=new RegExp(j+"|>"),V=new RegExp(I),X=new RegExp("^"+D+"$"),Y={ID:new RegExp("^#("+D+")"),CLASS:new RegExp("^\\.("+D+")"),TAG:new RegExp("^("+D+"|[*])"),ATTR:new RegExp("^"+k),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,U=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,W=/[+~]/,$=new RegExp("\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\([^\\r\\n\\f])","g"),Q=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){ut()},Z=ft((function(t){return!0===t.disabled&&C(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{m.apply(s=a.call(B.childNodes),B.childNodes),s[B.childNodes.length].nodeType}catch(t){m={apply:function(t,e){L.apply(t,a.call(e))},call:function(t){L.apply(t,a.call(arguments,1))}}}function K(t,e,n,r){var i,s,o,a,h,l,d,p=e&&e.ownerDocument,b=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==b&&9!==b&&11!==b)return n;if(!r&&(ut(e),e=e||u,c)){if(11!==b&&(h=U.exec(t)))if(i=h[1]){if(9===b){if(!(o=e.getElementById(i)))return n;if(o.id===i)return m.call(n,o),n}else if(p&&(o=p.getElementById(i))&&K.contains(e,o)&&o.id===i)return m.call(n,o),n}else{if(h[2])return m.apply(n,e.getElementsByTagName(t)),n;if((i=h[3])&&e.getElementsByClassName)return m.apply(n,e.getElementsByClassName(i)),n}if(!(S[t+" "]||f&&f.test(t))){if(d=t,p=e,1===b&&(z.test(t)||q.test(t))){for((p=W.test(t)&&at(e.parentNode)||e)==e&&g.scope||((a=e.getAttribute("id"))?a=P.escapeSelector(a):e.setAttribute("id",a=y)),s=(l=lt(t)).length;s--;)l[s]=(a?"#"+a:":scope")+" "+ct(l[s]);d=l.join(",")}try{return m.apply(n,p.querySelectorAll(d)),n}catch(e){S(t,!0)}finally{a===y&&e.removeAttribute("id")}}}return bt(t.replace(E,"$1"),e,n,r)}function tt(){var t=[];return function n(r,i){return t.push(r+" ")>e.cacheLength&&delete n[t.shift()],n[r+" "]=i}}function et(t){return t[y]=!0,t}function nt(t){var e=u.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function rt(t){return function(e){return C(e,"input")&&e.type===t}}function it(t){return function(e){return(C(e,"input")||C(e,"button"))&&e.type===t}}function st(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Z(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ot(t){return et((function(e){return e=+e,et((function(n,r){for(var i,s=t([],n.length,e),o=s.length;o--;)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))}))}))}function at(t){return t&&void 0!==t.getElementsByTagName&&t}function ut(t){var n,r=t?t.ownerDocument||t:B;return r!=u&&9===r.nodeType&&r.documentElement?(h=(u=r).documentElement,c=!P.isXMLDoc(u),p=h.matches||h.webkitMatchesSelector||h.msMatchesSelector,h.msMatchesSelector&&B!=u&&(n=u.defaultView)&&n.top!==n&&n.addEventListener("unload",J),g.getById=nt((function(t){return h.appendChild(t).id=P.expando,!u.getElementsByName||!u.getElementsByName(P.expando).length})),g.disconnectedMatch=nt((function(t){return p.call(t,"*")})),g.scope=nt((function(){return u.querySelectorAll(":scope")})),g.cssHas=nt((function(){try{return u.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),g.getById?(e.filter.ID=function(t){var e=t.replace($,Q);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&c){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace($,Q);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&c){var n,r,i,s=e.getElementById(t);if(s){if((n=s.getAttributeNode("id"))&&n.value===t)return[s];for(i=e.getElementsByName(t),r=0;s=i[r++];)if((n=s.getAttributeNode("id"))&&n.value===t)return[s]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&c)return e.getElementsByClassName(t)},f=[],nt((function(t){var e;h.appendChild(t).innerHTML="<a id='"+y+"' href='' disabled='disabled'></a><select id='"+y+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||f.push("\\["+j+"*(?:value|"+O+")"),t.querySelectorAll("[id~="+y+"-]").length||f.push("~="),t.querySelectorAll("a#"+y+"+*").length||f.push(".#.+[+~]"),t.querySelectorAll(":checked").length||f.push(":checked"),(e=u.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&f.push(":enabled",":disabled"),(e=u.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||f.push("\\["+j+"*name"+j+"*="+j+"*(?:''|\"\")")})),g.cssHas||f.push(":has"),f=f.length&&new RegExp(f.join("|")),M=function(t,e){if(t===e)return o=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!g.sortDetached&&e.compareDocumentPosition(t)===n?t===u||t.ownerDocument==B&&K.contains(B,t)?-1:e===u||e.ownerDocument==B&&K.contains(B,e)?1:i?l.call(i,t)-l.call(i,e):0:4&n?-1:1)},u):u}for(t in K.matches=function(t,e){return K(t,null,null,e)},K.matchesSelector=function(t,e){if(ut(t),c&&!S[e+" "]&&(!f||!f.test(e)))try{var n=p.call(t,e);if(n||g.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){S(e,!0)}return K(e,u,null,[t]).length>0},K.contains=function(t,e){return(t.ownerDocument||t)!=u&&ut(t),P.contains(t,e)},K.attr=function(t,n){(t.ownerDocument||t)!=u&&ut(t);var r=e.attrHandle[n.toLowerCase()],i=r&&d.call(e.attrHandle,n.toLowerCase())?r(t,n,!c):void 0;return void 0!==i?i:t.getAttribute(n)},K.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},P.uniqueSort=function(t){var e,n=[],r=0,s=0;if(o=!g.sortStable,i=!g.sortStable&&a.call(t,0),A.call(t,M),o){for(;e=t[s++];)e===t[s]&&(r=n.push(s));for(;r--;)T.call(t,n[r],1)}return i=null,t},P.fn.uniqueSort=function(){return this.pushStack(P.uniqueSort(a.apply(this)))},e=P.expr={cacheLength:50,createPseudo:et,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace($,Q),t[3]=(t[3]||t[4]||t[5]||"").replace($,Q),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||K.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&K.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&V.test(n)&&(e=lt(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace($,Q).toLowerCase();return"*"===t?function(){return!0}:function(t){return C(t,e)}},CLASS:function(t){var e=x[t+" "];return e||(e=new RegExp("(^|"+j+")"+t+"("+j+"|$)"))&&x(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=K.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(F," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var s="nth"!==t.slice(0,3),o="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,u){var h,l,c,f,d,p=s!==o?"nextSibling":"previousSibling",m=e.parentNode,g=a&&e.nodeName.toLowerCase(),v=!u&&!a,x=!1;if(m){if(s){for(;p;){for(c=e;c=c[p];)if(a?C(c,g):1===c.nodeType)return!1;d=p="only"===t&&!d&&"nextSibling"}return!0}if(d=[o?m.firstChild:m.lastChild],o&&v){for(x=(f=(h=(l=m[y]||(m[y]={}))[t]||[])[0]===b&&h[1])&&h[2],c=f&&m.childNodes[f];c=++f&&c&&c[p]||(x=f=0)||d.pop();)if(1===c.nodeType&&++x&&c===e){l[t]=[b,f,x];break}}else if(v&&(x=f=(h=(l=e[y]||(e[y]={}))[t]||[])[0]===b&&h[1]),!1===x)for(;(c=++f&&c&&c[p]||(x=f=0)||d.pop())&&(!(a?C(c,g):1===c.nodeType)||!++x||(v&&((l=c[y]||(c[y]={}))[t]=[b,x]),c!==e)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(t,n){var r,i=e.pseudos[t]||e.setFilters[t.toLowerCase()]||K.error("unsupported pseudo: "+t);return i[y]?i(n):i.length>1?(r=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var r,s=i(t,n),o=s.length;o--;)t[r=l.call(t,s[o])]=!(e[r]=s[o])})):function(t){return i(t,0,r)}):i}},pseudos:{not:et((function(t){var e=[],n=[],r=yt(t.replace(E,"$1"));return r[y]?et((function(t,e,n,i){for(var s,o=r(t,null,i,[]),a=t.length;a--;)(s=o[a])&&(t[a]=!(e[a]=s))})):function(t,i,s){return e[0]=t,r(e,null,s,n),e[0]=null,!n.pop()}})),has:et((function(t){return function(e){return K(t,e).length>0}})),contains:et((function(t){return t=t.replace($,Q),function(e){return(e.textContent||P.text(e)).indexOf(t)>-1}})),lang:et((function(t){return X.test(t||"")||K.error("unsupported lang: "+t),t=t.replace($,Q).toLowerCase(),function(e){var n;do{if(n=c?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=r.location&&r.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===h},focus:function(t){return t===function(){try{return u.activeElement}catch(t){}}()&&u.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:st(!1),disabled:st(!0),checked:function(t){return C(t,"input")&&!!t.checked||C(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return G.test(t.nodeName)},input:function(t){return H.test(t.nodeName)},button:function(t){return C(t,"input")&&"button"===t.type||C(t,"button")},text:function(t){var e;return C(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:ot((function(){return[0]})),last:ot((function(t,e){return[e-1]})),eq:ot((function(t,e,n){return[n<0?n+e:n]})),even:ot((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:ot((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:ot((function(t,e,n){var r;for(r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t})),gt:ot((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}},e.pseudos.nth=e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[t]=rt(t);for(t in{submit:!0,reset:!0})e.pseudos[t]=it(t);function ht(){}function lt(t,n){var r,i,s,o,a,u,h,l=w[t+" "];if(l)return n?0:l.slice(0);for(a=t,u=[],h=e.preFilter;a;){for(o in r&&!(i=R.exec(a))||(i&&(a=a.slice(i[0].length)||a),u.push(s=[])),r=!1,(i=q.exec(a))&&(r=i.shift(),s.push({value:r,type:i[0].replace(E," ")}),a=a.slice(r.length)),e.filter)!(i=Y[o].exec(a))||h[o]&&!(i=h[o](i))||(r=i.shift(),s.push({value:r,type:o,matches:i}),a=a.slice(r.length));if(!r)break}return n?a.length:a?K.error(t):w(t,u).slice(0)}function ct(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function ft(t,e,n){var r=e.dir,i=e.next,s=i||r,o=n&&"parentNode"===s,a=v++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i);return!1}:function(e,n,u){var h,l,c=[b,a];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o)if(l=e[y]||(e[y]={}),i&&C(e,i))e=e[r]||e;else{if((h=l[s])&&h[0]===b&&h[1]===a)return c[2]=h[2];if(l[s]=c,c[2]=t(e,n,u))return!0}return!1}}function dt(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function pt(t,e,n,r,i){for(var s,o=[],a=0,u=t.length,h=null!=e;a<u;a++)(s=t[a])&&(n&&!n(s,r,i)||(o.push(s),h&&e.push(a)));return o}function mt(t,e,n,r,i,s){return r&&!r[y]&&(r=mt(r)),i&&!i[y]&&(i=mt(i,s)),et((function(s,o,a,u){var h,c,f,d,p=[],g=[],y=o.length,b=s||function(t,e,n){for(var r=0,i=e.length;r<i;r++)K(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),v=!t||!s&&e?b:pt(b,p,t,a,u);if(n?n(v,d=i||(s?t:y||r)?[]:o,a,u):d=v,r)for(h=pt(d,g),r(h,[],a,u),c=h.length;c--;)(f=h[c])&&(d[g[c]]=!(v[g[c]]=f));if(s){if(i||t){if(i){for(h=[],c=d.length;c--;)(f=d[c])&&h.push(v[c]=f);i(null,d=[],h,u)}for(c=d.length;c--;)(f=d[c])&&(h=i?l.call(s,f):p[c])>-1&&(s[h]=!(o[h]=f))}}else d=pt(d===o?d.splice(y,d.length):d),i?i(null,o,d,u):m.apply(o,d)}))}function gt(t){for(var r,i,s,o=t.length,a=e.relative[t[0].type],u=a||e.relative[" "],h=a?1:0,c=ft((function(t){return t===r}),u,!0),f=ft((function(t){return l.call(r,t)>-1}),u,!0),d=[function(t,e,i){var s=!a&&(i||e!=n)||((r=e).nodeType?c(t,e,i):f(t,e,i));return r=null,s}];h<o;h++)if(i=e.relative[t[h].type])d=[ft(dt(d),i)];else{if((i=e.filter[t[h].type].apply(null,t[h].matches))[y]){for(s=++h;s<o&&!e.relative[t[s].type];s++);return mt(h>1&&dt(d),h>1&&ct(t.slice(0,h-1).concat({value:" "===t[h-2].type?"*":""})).replace(E,"$1"),i,h<s&>(t.slice(h,s)),s<o&>(t=t.slice(s)),s<o&&ct(t))}d.push(i)}return dt(d)}function yt(t,r){var i,s=[],o=[],a=_[t+" "];if(!a){for(r||(r=lt(t)),i=r.length;i--;)(a=gt(r[i]))[y]?s.push(a):o.push(a);a=_(t,function(t,r){var i=r.length>0,s=t.length>0,o=function(o,a,h,l,f){var d,p,g,y=0,v="0",x=o&&[],w=[],_=n,S=o||s&&e.find.TAG("*",f),M=b+=null==_?1:Math.random()||.1,O=S.length;for(f&&(n=a==u||a||f);v!==O&&null!=(d=S[v]);v++){if(s&&d){for(p=0,a||d.ownerDocument==u||(ut(d),h=!c);g=t[p++];)if(g(d,a||u,h)){m.call(l,d);break}f&&(b=M)}i&&((d=!g&&d)&&y--,o&&x.push(d))}if(y+=v,i&&v!==y){for(p=0;g=r[p++];)g(x,w,a,h);if(o){if(y>0)for(;v--;)x[v]||w[v]||(w[v]=N.call(l));w=pt(w)}m.apply(l,w),f&&!o&&w.length>0&&y+r.length>1&&P.uniqueSort(l)}return f&&(b=M,n=_),x};return i?et(o):o}(o,s)),a.selector=t}return a}function bt(t,n,r,i){var s,o,a,u,h,l="function"==typeof t&&t,f=!i&<(t=l.selector||t);if(r=r||[],1===f.length){if((o=f[0]=f[0].slice(0)).length>2&&"ID"===(a=o[0]).type&&9===n.nodeType&&c&&e.relative[o[1].type]){if(!(n=(e.find.ID(a.matches[0].replace($,Q),n)||[])[0]))return r;l&&(n=n.parentNode),t=t.slice(o.shift().value.length)}for(s=Y.needsContext.test(t)?0:o.length;s--&&(a=o[s],!e.relative[u=a.type]);)if((h=e.find[u])&&(i=h(a.matches[0].replace($,Q),W.test(o[0].type)&&at(n.parentNode)||n))){if(o.splice(s,1),!(t=i.length&&ct(o)))return m.apply(r,i),r;break}}return(l||yt(t,f))(i,n,!c,r,!n||W.test(t)&&at(n.parentNode)||n),r}ht.prototype=e.filters=e.pseudos,e.setFilters=new ht,g.sortStable=y.split("").sort(M).join("")===y,ut(),g.sortDetached=nt((function(t){return 1&t.compareDocumentPosition(u.createElement("fieldset"))})),P.find=K,P.expr[":"]=P.expr.pseudos,P.unique=P.uniqueSort,K.compile=yt,K.select=bt,K.setDocument=ut,K.tokenize=lt,K.escape=P.escapeSelector,K.getText=P.text,K.isXML=P.isXMLDoc,K.selectors=P.expr,K.support=P.support,K.uniqueSort=P.uniqueSort}();var I=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&P(t).is(n))break;r.push(t)}return r},F=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},R=P.expr.match.needsContext,q=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function z(t,e,n){return y(e)?P.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?P.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?P.grep(t,(function(t){return l.call(e,t)>-1!==n})):P.filter(e,t,n)}P.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?P.find.matchesSelector(r,t)?[r]:[]:P.find.matches(t,P.grep(e,(function(t){return 1===t.nodeType})))},P.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(P(t).filter((function(){for(e=0;e<r;e++)if(P.contains(i[e],this))return!0})));for(n=this.pushStack([]),e=0;e<r;e++)P.find(t,i[e],n);return r>1?P.uniqueSort(n):n},filter:function(t){return this.pushStack(z(this,t||[],!1))},not:function(t){return this.pushStack(z(this,t||[],!0))},is:function(t){return!!z(this,"string"==typeof t&&R.test(t)?P(t):t||[],!1).length}});var V,X=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(P.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||V,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:X.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof P?e[0]:e,P.merge(this,P.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:v,!0)),q.test(r[1])&&P.isPlainObject(e))for(r in e)y(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):y(t)?void 0!==n.ready?n.ready(t):t(P):P.makeArray(t,this)}).prototype=P.fn,V=P(v);var Y=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function G(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}P.fn.extend({has:function(t){var e=P(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(P.contains(this,e[t]))return!0}))},closest:function(t,e){var n,r=0,i=this.length,s=[],o="string"!=typeof t&&P(t);if(!R.test(t))for(;r<i;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&P.find.matchesSelector(n,t))){s.push(n);break}return this.pushStack(s.length>1?P.uniqueSort(s):s)},index:function(t){return t?"string"==typeof t?l.call(P(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(P.uniqueSort(P.merge(this.get(),P(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),P.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return I(t,"parentNode")},parentsUntil:function(t,e,n){return I(t,"parentNode",n)},next:function(t){return G(t,"nextSibling")},prev:function(t){return G(t,"previousSibling")},nextAll:function(t){return I(t,"nextSibling")},prevAll:function(t){return I(t,"previousSibling")},nextUntil:function(t,e,n){return I(t,"nextSibling",n)},prevUntil:function(t,e,n){return I(t,"previousSibling",n)},siblings:function(t){return F((t.parentNode||{}).firstChild,t)},children:function(t){return F(t.firstChild)},contents:function(t){return null!=t.contentDocument&&o(t.contentDocument)?t.contentDocument:(C(t,"template")&&(t=t.content||t),P.merge([],t.childNodes))}},(function(t,e){P.fn[t]=function(n,r){var i=P.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=P.filter(r,i)),this.length>1&&(H[t]||P.uniqueSort(i),Y.test(t)&&i.reverse()),this.pushStack(i)}}));var U=/[^\x20\t\r\n\f]+/g;function W(t){return t}function $(t){throw t}function Q(t,e,n,r){var i;try{t&&y(i=t.promise)?i.call(t).done(e).fail(n):t&&y(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}P.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return P.each(t.match(U)||[],(function(t,n){e[n]=!0})),e}(t):P.extend({},t);var e,n,r,i,s=[],o=[],a=-1,u=function(){for(i=i||t.once,r=e=!0;o.length;a=-1)for(n=o.shift();++a<s.length;)!1===s[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=s.length,n=!1);t.memory||(n=!1),e=!1,i&&(s=n?[]:"")},h={add:function(){return s&&(n&&!e&&(a=s.length-1,o.push(n)),function e(n){P.each(n,(function(n,r){y(r)?t.unique&&h.has(r)||s.push(r):r&&r.length&&"string"!==_(r)&&e(r)}))}(arguments),n&&!e&&u()),this},remove:function(){return P.each(arguments,(function(t,e){for(var n;(n=P.inArray(e,s,n))>-1;)s.splice(n,1),n<=a&&a--})),this},has:function(t){return t?P.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return i=o=[],s=n="",this},disabled:function(){return!s},lock:function(){return i=o=[],n||e||(s=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],o.push(n),e||u()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!r}};return h},P.extend({Deferred:function(t){var e=[["notify","progress",P.Callbacks("memory"),P.Callbacks("memory"),2],["resolve","done",P.Callbacks("once memory"),P.Callbacks("once memory"),0,"resolved"],["reject","fail",P.Callbacks("once memory"),P.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return P.Deferred((function(n){P.each(e,(function(e,r){var i=y(t[r[4]])&&t[r[4]];s[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&y(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,i){var s=0;function o(t,e,n,i){return function(){var a=this,u=arguments,h=function(){var r,h;if(!(t<s)){if((r=n.apply(a,u))===e.promise())throw new TypeError("Thenable self-resolution");h=r&&("object"==typeof r||"function"==typeof r)&&r.then,y(h)?i?h.call(r,o(s,e,W,i),o(s,e,$,i)):(s++,h.call(r,o(s,e,W,i),o(s,e,$,i),o(s,e,W,e.notifyWith))):(n!==W&&(a=void 0,u=[r]),(i||e.resolveWith)(a,u))}},l=i?h:function(){try{h()}catch(r){P.Deferred.exceptionHook&&P.Deferred.exceptionHook(r,l.error),t+1>=s&&(n!==$&&(a=void 0,u=[r]),e.rejectWith(a,u))}};t?l():(P.Deferred.getErrorHook?l.error=P.Deferred.getErrorHook():P.Deferred.getStackHook&&(l.error=P.Deferred.getStackHook()),r.setTimeout(l))}}return P.Deferred((function(r){e[0][3].add(o(0,r,y(i)?i:W,r.notifyWith)),e[1][3].add(o(0,r,y(t)?t:W)),e[2][3].add(o(0,r,y(n)?n:$))})).promise()},promise:function(t){return null!=t?P.extend(t,i):i}},s={};return P.each(e,(function(t,r){var o=r[2],a=r[5];i[r[1]]=o.add,a&&o.add((function(){n=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),o.add(r[3].fire),s[r[0]]=function(){return s[r[0]+"With"](this===s?void 0:this,arguments),this},s[r[0]+"With"]=o.fireWith})),i.promise(s),t&&t.call(s,s),s},when:function(t){var e=arguments.length,n=e,r=Array(n),i=a.call(arguments),s=P.Deferred(),o=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?a.call(arguments):n,--e||s.resolveWith(r,i)}};if(e<=1&&(Q(t,s.done(o(n)).resolve,s.reject,!e),"pending"===s.state()||y(i[n]&&i[n].then)))return s.then();for(;n--;)Q(i[n],o(n),s.reject);return s.promise()}});var J=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;P.Deferred.exceptionHook=function(t,e){r.console&&r.console.warn&&t&&J.test(t.name)&&r.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},P.readyException=function(t){r.setTimeout((function(){throw t}))};var Z=P.Deferred();function K(){v.removeEventListener("DOMContentLoaded",K),r.removeEventListener("load",K),P.ready()}P.fn.ready=function(t){return Z.then(t).catch((function(t){P.readyException(t)})),this},P.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--P.readyWait:P.isReady)||(P.isReady=!0,!0!==t&&--P.readyWait>0||Z.resolveWith(v,[P]))}}),P.ready.then=Z.then,"complete"===v.readyState||"loading"!==v.readyState&&!v.documentElement.doScroll?r.setTimeout(P.ready):(v.addEventListener("DOMContentLoaded",K),r.addEventListener("load",K));var tt=function(t,e,n,r,i,s,o){var a=0,u=t.length,h=null==n;if("object"===_(n))for(a in i=!0,n)tt(t,e,a,n[a],!0,s,o);else if(void 0!==r&&(i=!0,y(r)||(o=!0),h&&(o?(e.call(t,r),e=null):(h=e,e=function(t,e,n){return h.call(P(t),n)})),e))for(;a<u;a++)e(t[a],n,o?r:r.call(t[a],a,e(t[a],n)));return i?t:h?e.call(t):u?e(t[0],n):s},et=/^-ms-/,nt=/-([a-z])/g;function rt(t,e){return e.toUpperCase()}function it(t){return t.replace(et,"ms-").replace(nt,rt)}var st=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function ot(){this.expando=P.expando+ot.uid++}ot.uid=1,ot.prototype={cache:function(t){var e=t[this.expando];return e||(e={},st(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,i=this.cache(t);if("string"==typeof e)i[it(e)]=n;else for(r in e)i[it(r)]=e[r];return i},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][it(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map(it):(e=it(e))in r?[e]:e.match(U)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||P.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!P.isEmptyObject(e)}};var at=new ot,ut=new ot,ht=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,lt=/[A-Z]/g;function ct(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(lt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:ht.test(t)?JSON.parse(t):t)}(n)}catch(t){}ut.set(t,e,n)}else n=void 0;return n}P.extend({hasData:function(t){return ut.hasData(t)||at.hasData(t)},data:function(t,e,n){return ut.access(t,e,n)},removeData:function(t,e){ut.remove(t,e)},_data:function(t,e,n){return at.access(t,e,n)},_removeData:function(t,e){at.remove(t,e)}}),P.fn.extend({data:function(t,e){var n,r,i,s=this[0],o=s&&s.attributes;if(void 0===t){if(this.length&&(i=ut.get(s),1===s.nodeType&&!at.get(s,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(r=o[n].name).indexOf("data-")&&(r=it(r.slice(5)),ct(s,r,i[r]));at.set(s,"hasDataAttrs",!0)}return i}return"object"==typeof t?this.each((function(){ut.set(this,t)})):tt(this,(function(e){var n;if(s&&void 0===e)return void 0!==(n=ut.get(s,t))||void 0!==(n=ct(s,t))?n:void 0;this.each((function(){ut.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){ut.remove(this,t)}))}}),P.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=at.get(t,e),n&&(!r||Array.isArray(n)?r=at.access(t,e,P.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=P.queue(t,e),r=n.length,i=n.shift(),s=P._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete s.stop,i.call(t,(function(){P.dequeue(t,e)}),s)),!r&&s&&s.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return at.get(t,n)||at.access(t,n,{empty:P.Callbacks("once memory").add((function(){at.remove(t,[e+"queue",n])}))})}}),P.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?P.queue(this[0],t):void 0===e?this:this.each((function(){var n=P.queue(this,t,e);P._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&P.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){P.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=P.Deferred(),s=this,o=this.length,a=function(){--r||i.resolveWith(s,[s])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";o--;)(n=at.get(s[o],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(e)}});var ft=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,dt=new RegExp("^(?:([+-])=|)("+ft+")([a-z%]*)$","i"),pt=["Top","Right","Bottom","Left"],mt=v.documentElement,gt=function(t){return P.contains(t.ownerDocument,t)},yt={composed:!0};mt.getRootNode&&(gt=function(t){return P.contains(t.ownerDocument,t)||t.getRootNode(yt)===t.ownerDocument});var bt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&>(t)&&"none"===P.css(t,"display")};function vt(t,e,n,r){var i,s,o=20,a=r?function(){return r.cur()}:function(){return P.css(t,e,"")},u=a(),h=n&&n[3]||(P.cssNumber[e]?"":"px"),l=t.nodeType&&(P.cssNumber[e]||"px"!==h&&+u)&&dt.exec(P.css(t,e));if(l&&l[3]!==h){for(u/=2,h=h||l[3],l=+u||1;o--;)P.style(t,e,l+h),(1-s)*(1-(s=a()/u||.5))<=0&&(o=0),l/=s;l*=2,P.style(t,e,l+h),n=n||[]}return n&&(l=+l||+u||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=h,r.start=l,r.end=i)),i}var xt={};function wt(t){var e,n=t.ownerDocument,r=t.nodeName,i=xt[r];return i||(e=n.body.appendChild(n.createElement(r)),i=P.css(e,"display"),e.parentNode.removeChild(e),"none"===i&&(i="block"),xt[r]=i,i)}function _t(t,e){for(var n,r,i=[],s=0,o=t.length;s<o;s++)(r=t[s]).style&&(n=r.style.display,e?("none"===n&&(i[s]=at.get(r,"display")||null,i[s]||(r.style.display="")),""===r.style.display&&bt(r)&&(i[s]=wt(r))):"none"!==n&&(i[s]="none",at.set(r,"display",n)));for(s=0;s<o;s++)null!=i[s]&&(t[s].style.display=i[s]);return t}P.fn.extend({show:function(){return _t(this,!0)},hide:function(){return _t(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){bt(this)?P(this).show():P(this).hide()}))}});var St,Mt,Pt=/^(?:checkbox|radio)$/i,Ot=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ct=/^$|^module$|\/(?:java|ecma)script/i;St=v.createDocumentFragment().appendChild(v.createElement("div")),(Mt=v.createElement("input")).setAttribute("type","radio"),Mt.setAttribute("checked","checked"),Mt.setAttribute("name","t"),St.appendChild(Mt),g.checkClone=St.cloneNode(!0).cloneNode(!0).lastChild.checked,St.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!St.cloneNode(!0).lastChild.defaultValue,St.innerHTML="<option></option>",g.option=!!St.lastChild;var Nt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function At(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&C(t,e)?P.merge([t],n):n}function Tt(t,e){for(var n=0,r=t.length;n<r;n++)at.set(t[n],"globalEval",!e||at.get(e[n],"globalEval"))}Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,g.option||(Nt.optgroup=Nt.option=[1,"<select multiple='multiple'>","</select>"]);var jt=/<|&#?\w+;/;function Et(t,e,n,r,i){for(var s,o,a,u,h,l,c=e.createDocumentFragment(),f=[],d=0,p=t.length;d<p;d++)if((s=t[d])||0===s)if("object"===_(s))P.merge(f,s.nodeType?[s]:s);else if(jt.test(s)){for(o=o||c.appendChild(e.createElement("div")),a=(Ot.exec(s)||["",""])[1].toLowerCase(),u=Nt[a]||Nt._default,o.innerHTML=u[1]+P.htmlPrefilter(s)+u[2],l=u[0];l--;)o=o.lastChild;P.merge(f,o.childNodes),(o=c.firstChild).textContent=""}else f.push(e.createTextNode(s));for(c.textContent="",d=0;s=f[d++];)if(r&&P.inArray(s,r)>-1)i&&i.push(s);else if(h=gt(s),o=At(c.appendChild(s),"script"),h&&Tt(o),n)for(l=0;s=o[l++];)Ct.test(s.type||"")&&n.push(s);return c}var Dt=/^([^.]*)(?:\.(.+)|)/;function kt(){return!0}function Bt(){return!1}function Lt(t,e,n,r,i,s){var o,a;if("object"==typeof e){for(a in"string"!=typeof n&&(r=r||n,n=void 0),e)Lt(t,a,n,r,e[a],s);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Bt;else if(!i)return t;return 1===s&&(o=i,i=function(t){return P().off(t),o.apply(this,arguments)},i.guid=o.guid||(o.guid=P.guid++)),t.each((function(){P.event.add(this,e,i,r,n)}))}function It(t,e,n){n?(at.set(t,e,!1),P.event.add(t,e,{namespace:!1,handler:function(t){var n,r=at.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(P.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=a.call(arguments),at.set(this,e,r),this[e](),n=at.get(this,e),at.set(this,e,!1),r!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else r&&(at.set(this,e,P.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=kt)}})):void 0===at.get(t,e)&&P.event.add(t,e,kt)}P.event={global:{},add:function(t,e,n,r,i){var s,o,a,u,h,l,c,f,d,p,m,g=at.get(t);if(st(t))for(n.handler&&(n=(s=n).handler,i=s.selector),i&&P.find.matchesSelector(mt,i),n.guid||(n.guid=P.guid++),(u=g.events)||(u=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(e){return void 0!==P&&P.event.triggered!==e.type?P.event.dispatch.apply(t,arguments):void 0}),h=(e=(e||"").match(U)||[""]).length;h--;)d=m=(a=Dt.exec(e[h])||[])[1],p=(a[2]||"").split(".").sort(),d&&(c=P.event.special[d]||{},d=(i?c.delegateType:c.bindType)||d,c=P.event.special[d]||{},l=P.extend({type:d,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&P.expr.match.needsContext.test(i),namespace:p.join(".")},s),(f=u[d])||((f=u[d]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(t,r,p,o)||t.addEventListener&&t.addEventListener(d,o)),c.add&&(c.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,l):f.push(l),P.event.global[d]=!0)},remove:function(t,e,n,r,i){var s,o,a,u,h,l,c,f,d,p,m,g=at.hasData(t)&&at.get(t);if(g&&(u=g.events)){for(h=(e=(e||"").match(U)||[""]).length;h--;)if(d=m=(a=Dt.exec(e[h])||[])[1],p=(a[2]||"").split(".").sort(),d){for(c=P.event.special[d]||{},f=u[d=(r?c.delegateType:c.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=f.length;s--;)l=f[s],!i&&m!==l.origType||n&&n.guid!==l.guid||a&&!a.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(f.splice(s,1),l.selector&&f.delegateCount--,c.remove&&c.remove.call(t,l));o&&!f.length&&(c.teardown&&!1!==c.teardown.call(t,p,g.handle)||P.removeEvent(t,d,g.handle),delete u[d])}else for(d in u)P.event.remove(t,d+e[h],n,r,!0);P.isEmptyObject(u)&&at.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,s,o,a=new Array(arguments.length),u=P.event.fix(t),h=(at.get(this,"events")||Object.create(null))[u.type]||[],l=P.event.special[u.type]||{};for(a[0]=u,e=1;e<arguments.length;e++)a[e]=arguments[e];if(u.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,u)){for(o=P.event.handlers.call(this,u,h),e=0;(i=o[e++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(s=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==s.namespace&&!u.rnamespace.test(s.namespace)||(u.handleObj=s,u.data=s.data,void 0!==(r=((P.event.special[s.origType]||{}).handle||s.handler).apply(i.elem,a))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,u),u.result}},handlers:function(t,e){var n,r,i,s,o,a=[],u=e.delegateCount,h=t.target;if(u&&h.nodeType&&!("click"===t.type&&t.button>=1))for(;h!==this;h=h.parentNode||this)if(1===h.nodeType&&("click"!==t.type||!0!==h.disabled)){for(s=[],o={},n=0;n<u;n++)void 0===o[i=(r=e[n]).selector+" "]&&(o[i]=r.needsContext?P(i,this).index(h)>-1:P.find(i,this,null,[h]).length),o[i]&&s.push(r);s.length&&a.push({elem:h,handlers:s})}return h=this,u<e.length&&a.push({elem:h,handlers:e.slice(u)}),a},addProp:function(t,e){Object.defineProperty(P.Event.prototype,t,{enumerable:!0,configurable:!0,get:y(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[P.expando]?t:new P.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return Pt.test(e.type)&&e.click&&C(e,"input")&&It(e,"click",!0),!1},trigger:function(t){var e=this||t;return Pt.test(e.type)&&e.click&&C(e,"input")&&It(e,"click"),!0},_default:function(t){var e=t.target;return Pt.test(e.type)&&e.click&&C(e,"input")&&at.get(e,"click")||C(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},P.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},P.Event=function(t,e){if(!(this instanceof P.Event))return new P.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?kt:Bt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&P.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[P.expando]=!0},P.Event.prototype={constructor:P.Event,isDefaultPrevented:Bt,isPropagationStopped:Bt,isImmediatePropagationStopped:Bt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=kt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=kt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=kt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},P.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},P.event.addProp),P.each({focus:"focusin",blur:"focusout"},(function(t,e){function n(t){if(v.documentMode){var n=at.get(this,"handle"),r=P.event.fix(t);r.type="focusin"===t.type?"focus":"blur",r.isSimulated=!0,n(t),r.target===r.currentTarget&&n(r)}else P.event.simulate(e,t.target,P.event.fix(t))}P.event.special[t]={setup:function(){var r;if(It(this,t,!0),!v.documentMode)return!1;(r=at.get(this,e))||this.addEventListener(e,n),at.set(this,e,(r||0)+1)},trigger:function(){return It(this,t),!0},teardown:function(){var t;if(!v.documentMode)return!1;(t=at.get(this,e)-1)?at.set(this,e,t):(this.removeEventListener(e,n),at.remove(this,e))},_default:function(e){return at.get(e.target,t)},delegateType:e},P.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=v.documentMode?this:r,s=at.get(i,e);s||(v.documentMode?this.addEventListener(e,n):r.addEventListener(t,n,!0)),at.set(i,e,(s||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=v.documentMode?this:r,s=at.get(i,e)-1;s?at.set(i,e,s):(v.documentMode?this.removeEventListener(e,n):r.removeEventListener(t,n,!0),at.remove(i,e))}}})),P.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){P.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=t.relatedTarget,i=t.handleObj;return r&&(r===this||P.contains(this,r))||(t.type=i.origType,n=i.handler.apply(this,arguments),t.type=e),n}}})),P.fn.extend({on:function(t,e,n,r){return Lt(this,t,e,n,r)},one:function(t,e,n,r){return Lt(this,t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,P(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Bt),this.each((function(){P.event.remove(this,t,n,e)}))}});var Ft=/<script|<style|<link/i,Rt=/checked\s*(?:[^=]|=\s*.checked.)/i,qt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function zt(t,e){return C(t,"table")&&C(11!==e.nodeType?e:e.firstChild,"tr")&&P(t).children("tbody")[0]||t}function Vt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Xt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Yt(t,e){var n,r,i,s,o,a;if(1===e.nodeType){if(at.hasData(t)&&(a=at.get(t).events))for(i in at.remove(e,"handle events"),a)for(n=0,r=a[i].length;n<r;n++)P.event.add(e,i,a[i][n]);ut.hasData(t)&&(s=ut.access(t),o=P.extend({},s),ut.set(e,o))}}function Ht(t,e){var n=e.nodeName.toLowerCase();"input"===n&&Pt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Gt(t,e,n,r){e=u(e);var i,s,o,a,h,l,c=0,f=t.length,d=f-1,p=e[0],m=y(p);if(m||f>1&&"string"==typeof p&&!g.checkClone&&Rt.test(p))return t.each((function(i){var s=t.eq(i);m&&(e[0]=p.call(this,i,s.html())),Gt(s,e,n,r)}));if(f&&(s=(i=Et(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=s),s||r)){for(a=(o=P.map(At(i,"script"),Vt)).length;c<f;c++)h=i,c!==d&&(h=P.clone(h,!0,!0),a&&P.merge(o,At(h,"script"))),n.call(t[c],h,c);if(a)for(l=o[o.length-1].ownerDocument,P.map(o,Xt),c=0;c<a;c++)h=o[c],Ct.test(h.type||"")&&!at.access(h,"globalEval")&&P.contains(l,h)&&(h.src&&"module"!==(h.type||"").toLowerCase()?P._evalUrl&&!h.noModule&&P._evalUrl(h.src,{nonce:h.nonce||h.getAttribute("nonce")},l):w(h.textContent.replace(qt,""),h,l))}return t}function Ut(t,e,n){for(var r,i=e?P.filter(e,t):t,s=0;null!=(r=i[s]);s++)n||1!==r.nodeType||P.cleanData(At(r)),r.parentNode&&(n&>(r)&&Tt(At(r,"script")),r.parentNode.removeChild(r));return t}P.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,i,s,o,a=t.cloneNode(!0),u=gt(t);if(!(g.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||P.isXMLDoc(t)))for(o=At(a),r=0,i=(s=At(t)).length;r<i;r++)Ht(s[r],o[r]);if(e)if(n)for(s=s||At(t),o=o||At(a),r=0,i=s.length;r<i;r++)Yt(s[r],o[r]);else Yt(t,a);return(o=At(a,"script")).length>0&&Tt(o,!u&&At(t,"script")),a},cleanData:function(t){for(var e,n,r,i=P.event.special,s=0;void 0!==(n=t[s]);s++)if(st(n)){if(e=n[at.expando]){if(e.events)for(r in e.events)i[r]?P.event.remove(n,r):P.removeEvent(n,r,e.handle);n[at.expando]=void 0}n[ut.expando]&&(n[ut.expando]=void 0)}}}),P.fn.extend({detach:function(t){return Ut(this,t,!0)},remove:function(t){return Ut(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?P.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Gt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||zt(this,t).appendChild(t)}))},prepend:function(){return Gt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=zt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Gt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Gt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(P.cleanData(At(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return P.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Ft.test(t)&&!Nt[(Ot.exec(t)||["",""])[1].toLowerCase()]){t=P.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(P.cleanData(At(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Gt(this,arguments,(function(e){var n=this.parentNode;P.inArray(this,t)<0&&(P.cleanData(At(this)),n&&n.replaceChild(e,this))}),t)}}),P.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){P.fn[t]=function(t){for(var n,r=[],i=P(t),s=i.length-1,o=0;o<=s;o++)n=o===s?this:this.clone(!0),P(i[o])[e](n),h.apply(r,n.get());return this.pushStack(r)}}));var Wt=new RegExp("^("+ft+")(?!px)[a-z%]+$","i"),$t=/^--/,Qt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=r),e.getComputedStyle(t)},Jt=function(t,e,n){var r,i,s={};for(i in e)s[i]=t.style[i],t.style[i]=e[i];for(i in r=n.call(t),e)t.style[i]=s[i];return r},Zt=new RegExp(pt.join("|"),"i");function Kt(t,e,n){var r,i,s,o,a=$t.test(e),u=t.style;return(n=n||Qt(t))&&(o=n.getPropertyValue(e)||n[e],a&&o&&(o=o.replace(E,"$1")||void 0),""!==o||gt(t)||(o=P.style(t,e)),!g.pixelBoxStyles()&&Wt.test(o)&&Zt.test(e)&&(r=u.width,i=u.minWidth,s=u.maxWidth,u.minWidth=u.maxWidth=u.width=o,o=n.width,u.width=r,u.minWidth=i,u.maxWidth=s)),void 0!==o?o+"":o}function te(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(l){h.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",mt.appendChild(h).appendChild(l);var t=r.getComputedStyle(l);n="1%"!==t.top,u=12===e(t.marginLeft),l.style.right="60%",o=36===e(t.right),i=36===e(t.width),l.style.position="absolute",s=12===e(l.offsetWidth/3),mt.removeChild(h),l=null}}function e(t){return Math.round(parseFloat(t))}var n,i,s,o,a,u,h=v.createElement("div"),l=v.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===l.style.backgroundClip,P.extend(g,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),s},reliableTrDimensions:function(){var t,e,n,i;return null==a&&(t=v.createElement("table"),e=v.createElement("tr"),n=v.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="box-sizing:content-box;border:1px solid",e.style.height="1px",n.style.height="9px",n.style.display="block",mt.appendChild(t).appendChild(e).appendChild(n),i=r.getComputedStyle(e),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===e.offsetHeight,mt.removeChild(t)),a}}))}();var ee=["Webkit","Moz","ms"],ne=v.createElement("div").style,re={};function ie(t){return P.cssProps[t]||re[t]||(t in ne?t:re[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=ee.length;n--;)if((t=ee[n]+e)in ne)return t}(t)||t)}var se=/^(none|table(?!-c[ea]).+)/,oe={position:"absolute",visibility:"hidden",display:"block"},ae={letterSpacing:"0",fontWeight:"400"};function ue(t,e,n){var r=dt.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function he(t,e,n,r,i,s){var o="width"===e?1:0,a=0,u=0,h=0;if(n===(r?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(h+=P.css(t,n+pt[o],!0,i)),r?("content"===n&&(u-=P.css(t,"padding"+pt[o],!0,i)),"margin"!==n&&(u-=P.css(t,"border"+pt[o]+"Width",!0,i))):(u+=P.css(t,"padding"+pt[o],!0,i),"padding"!==n?u+=P.css(t,"border"+pt[o]+"Width",!0,i):a+=P.css(t,"border"+pt[o]+"Width",!0,i));return!r&&s>=0&&(u+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-u-a-.5))||0),u+h}function le(t,e,n){var r=Qt(t),i=(!g.boxSizingReliable()||n)&&"border-box"===P.css(t,"boxSizing",!1,r),s=i,o=Kt(t,e,r),a="offset"+e[0].toUpperCase()+e.slice(1);if(Wt.test(o)){if(!n)return o;o="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&C(t,"tr")||"auto"===o||!parseFloat(o)&&"inline"===P.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===P.css(t,"boxSizing",!1,r),(s=a in t)&&(o=t[a])),(o=parseFloat(o)||0)+he(t,e,n||(i?"border":"content"),s,r,o)+"px"}function ce(t,e,n,r,i){return new ce.prototype.init(t,e,n,r,i)}P.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Kt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,s,o,a=it(e),u=$t.test(e),h=t.style;if(u||(e=ie(a)),o=P.cssHooks[e]||P.cssHooks[a],void 0===n)return o&&"get"in o&&void 0!==(i=o.get(t,!1,r))?i:h[e];"string"==(s=typeof n)&&(i=dt.exec(n))&&i[1]&&(n=vt(t,e,i),s="number"),null!=n&&n==n&&("number"!==s||u||(n+=i&&i[3]||(P.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(h[e]="inherit"),o&&"set"in o&&void 0===(n=o.set(t,n,r))||(u?h.setProperty(e,n):h[e]=n))}},css:function(t,e,n,r){var i,s,o,a=it(e);return $t.test(e)||(e=ie(a)),(o=P.cssHooks[e]||P.cssHooks[a])&&"get"in o&&(i=o.get(t,!0,n)),void 0===i&&(i=Kt(t,e,r)),"normal"===i&&e in ae&&(i=ae[e]),""===n||n?(s=parseFloat(i),!0===n||isFinite(s)?s||0:i):i}}),P.each(["height","width"],(function(t,e){P.cssHooks[e]={get:function(t,n,r){if(n)return!se.test(P.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?le(t,e,r):Jt(t,oe,(function(){return le(t,e,r)}))},set:function(t,n,r){var i,s=Qt(t),o=!g.scrollboxSize()&&"absolute"===s.position,a=(o||r)&&"border-box"===P.css(t,"boxSizing",!1,s),u=r?he(t,e,r,a,s):0;return a&&o&&(u-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-he(t,e,"border",!1,s)-.5)),u&&(i=dt.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=P.css(t,e)),ue(0,n,u)}}})),P.cssHooks.marginLeft=te(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Kt(t,"marginLeft"))||t.getBoundingClientRect().left-Jt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),P.each({margin:"",padding:"",border:"Width"},(function(t,e){P.cssHooks[t+e]={expand:function(n){for(var r=0,i={},s="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+pt[r]+e]=s[r]||s[r-2]||s[0];return i}},"margin"!==t&&(P.cssHooks[t+e].set=ue)})),P.fn.extend({css:function(t,e){return tt(this,(function(t,e,n){var r,i,s={},o=0;if(Array.isArray(e)){for(r=Qt(t),i=e.length;o<i;o++)s[e[o]]=P.css(t,e[o],!1,r);return s}return void 0!==n?P.style(t,e,n):P.css(t,e)}),t,e,arguments.length>1)}}),P.Tween=ce,ce.prototype={constructor:ce,init:function(t,e,n,r,i,s){this.elem=t,this.prop=n,this.easing=i||P.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=s||(P.cssNumber[n]?"":"px")},cur:function(){var t=ce.propHooks[this.prop];return t&&t.get?t.get(this):ce.propHooks._default.get(this)},run:function(t){var e,n=ce.propHooks[this.prop];return this.options.duration?this.pos=e=P.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ce.propHooks._default.set(this),this}},ce.prototype.init.prototype=ce.prototype,ce.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=P.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){P.fx.step[t.prop]?P.fx.step[t.prop](t):1!==t.elem.nodeType||!P.cssHooks[t.prop]&&null==t.elem.style[ie(t.prop)]?t.elem[t.prop]=t.now:P.style(t.elem,t.prop,t.now+t.unit)}}},ce.propHooks.scrollTop=ce.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},P.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},P.fx=ce.prototype.init,P.fx.step={};var fe,de,pe=/^(?:toggle|show|hide)$/,me=/queueHooks$/;function ge(){de&&(!1===v.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ge):r.setTimeout(ge,P.fx.interval),P.fx.tick())}function ye(){return r.setTimeout((function(){fe=void 0})),fe=Date.now()}function be(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=pt[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function ve(t,e,n){for(var r,i=(xe.tweeners[e]||[]).concat(xe.tweeners["*"]),s=0,o=i.length;s<o;s++)if(r=i[s].call(n,e,t))return r}function xe(t,e,n){var r,i,s=0,o=xe.prefilters.length,a=P.Deferred().always((function(){delete u.elem})),u=function(){if(i)return!1;for(var e=fe||ye(),n=Math.max(0,h.startTime+h.duration-e),r=1-(n/h.duration||0),s=0,o=h.tweens.length;s<o;s++)h.tweens[s].run(r);return a.notifyWith(t,[h,r,n]),r<1&&o?n:(o||a.notifyWith(t,[h,1,0]),a.resolveWith(t,[h]),!1)},h=a.promise({elem:t,props:P.extend({},e),opts:P.extend(!0,{specialEasing:{},easing:P.easing._default},n),originalProperties:e,originalOptions:n,startTime:fe||ye(),duration:n.duration,tweens:[],createTween:function(e,n){var r=P.Tween(t,h.opts,e,n,h.opts.specialEasing[e]||h.opts.easing);return h.tweens.push(r),r},stop:function(e){var n=0,r=e?h.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)h.tweens[n].run(1);return e?(a.notifyWith(t,[h,1,0]),a.resolveWith(t,[h,e])):a.rejectWith(t,[h,e]),this}}),l=h.props;for(function(t,e){var n,r,i,s,o;for(n in t)if(i=e[r=it(n)],s=t[n],Array.isArray(s)&&(i=s[1],s=t[n]=s[0]),n!==r&&(t[r]=s,delete t[n]),(o=P.cssHooks[r])&&"expand"in o)for(n in s=o.expand(s),delete t[r],s)n in t||(t[n]=s[n],e[n]=i);else e[r]=i}(l,h.opts.specialEasing);s<o;s++)if(r=xe.prefilters[s].call(h,t,l,h.opts))return y(r.stop)&&(P._queueHooks(h.elem,h.opts.queue).stop=r.stop.bind(r)),r;return P.map(l,ve,h),y(h.opts.start)&&h.opts.start.call(t,h),h.progress(h.opts.progress).done(h.opts.done,h.opts.complete).fail(h.opts.fail).always(h.opts.always),P.fx.timer(P.extend(u,{elem:t,anim:h,queue:h.opts.queue})),h}P.Animation=P.extend(xe,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return vt(n.elem,t,dt.exec(e),n),n}]},tweener:function(t,e){y(t)?(e=t,t=["*"]):t=t.match(U);for(var n,r=0,i=t.length;r<i;r++)n=t[r],xe.tweeners[n]=xe.tweeners[n]||[],xe.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,i,s,o,a,u,h,l,c="width"in e||"height"in e,f=this,d={},p=t.style,m=t.nodeType&&bt(t),g=at.get(t,"fxshow");for(r in n.queue||(null==(o=P._queueHooks(t,"fx")).unqueued&&(o.unqueued=0,a=o.empty.fire,o.empty.fire=function(){o.unqueued||a()}),o.unqueued++,f.always((function(){f.always((function(){o.unqueued--,P.queue(t,"fx").length||o.empty.fire()}))}))),e)if(i=e[r],pe.test(i)){if(delete e[r],s=s||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=!0}d[r]=g&&g[r]||P.style(t,r)}if((u=!P.isEmptyObject(e))||!P.isEmptyObject(d))for(r in c&&1===t.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(h=g&&g.display)&&(h=at.get(t,"display")),"none"===(l=P.css(t,"display"))&&(h?l=h:(_t([t],!0),h=t.style.display||h,l=P.css(t,"display"),_t([t]))),("inline"===l||"inline-block"===l&&null!=h)&&"none"===P.css(t,"float")&&(u||(f.done((function(){p.display=h})),null==h&&(l=p.display,h="none"===l?"":l)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",f.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),u=!1,d)u||(g?"hidden"in g&&(m=g.hidden):g=at.access(t,"fxshow",{display:h}),s&&(g.hidden=!m),m&&_t([t],!0),f.done((function(){for(r in m||_t([t]),at.remove(t,"fxshow"),d)P.style(t,r,d[r])}))),u=ve(m?g[r]:0,r,f),r in g||(g[r]=u.start,m&&(u.end=u.start,u.start=0))}],prefilter:function(t,e){e?xe.prefilters.unshift(t):xe.prefilters.push(t)}}),P.speed=function(t,e,n){var r=t&&"object"==typeof t?P.extend({},t):{complete:n||!n&&e||y(t)&&t,duration:t,easing:n&&e||e&&!y(e)&&e};return P.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in P.fx.speeds?r.duration=P.fx.speeds[r.duration]:r.duration=P.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){y(r.old)&&r.old.call(this),r.queue&&P.dequeue(this,r.queue)},r},P.fn.extend({fadeTo:function(t,e,n,r){return this.filter(bt).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=P.isEmptyObject(t),s=P.speed(e,n,r),o=function(){var e=xe(this,P.extend({},t),s);(i||at.get(this,"finish"))&&e.stop(!0)};return o.finish=o,i||!1===s.queue?this.each(o):this.queue(s.queue,o)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,i=null!=t&&t+"queueHooks",s=P.timers,o=at.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&me.test(i)&&r(o[i]);for(i=s.length;i--;)s[i].elem!==this||null!=t&&s[i].queue!==t||(s[i].anim.stop(n),e=!1,s.splice(i,1));!e&&n||P.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=at.get(this),r=n[t+"queue"],i=n[t+"queueHooks"],s=P.timers,o=r?r.length:0;for(n.finish=!0,P.queue(this,t,[]),i&&i.stop&&i.stop.call(this,!0),e=s.length;e--;)s[e].elem===this&&s[e].queue===t&&(s[e].anim.stop(!0),s.splice(e,1));for(e=0;e<o;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish}))}}),P.each(["toggle","show","hide"],(function(t,e){var n=P.fn[e];P.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(be(e,!0),t,r,i)}})),P.each({slideDown:be("show"),slideUp:be("hide"),slideToggle:be("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){P.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}})),P.timers=[],P.fx.tick=function(){var t,e=0,n=P.timers;for(fe=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||P.fx.stop(),fe=void 0},P.fx.timer=function(t){P.timers.push(t),P.fx.start()},P.fx.interval=13,P.fx.start=function(){de||(de=!0,ge())},P.fx.stop=function(){de=null},P.fx.speeds={slow:600,fast:200,_default:400},P.fn.delay=function(t,e){return t=P.fx&&P.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,n){var i=r.setTimeout(e,t);n.stop=function(){r.clearTimeout(i)}}))},function(){var t=v.createElement("input"),e=v.createElement("select").appendChild(v.createElement("option"));t.type="checkbox",g.checkOn=""!==t.value,g.optSelected=e.selected,(t=v.createElement("input")).value="t",t.type="radio",g.radioValue="t"===t.value}();var we,_e=P.expr.attrHandle;P.fn.extend({attr:function(t,e){return tt(this,P.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){P.removeAttr(this,t)}))}}),P.extend({attr:function(t,e,n){var r,i,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?P.prop(t,e,n):(1===s&&P.isXMLDoc(t)||(i=P.attrHooks[e.toLowerCase()]||(P.expr.match.bool.test(e)?we:void 0)),void 0!==n?null===n?void P.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=P.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&C(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(U);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),we={set:function(t,e,n){return!1===e?P.removeAttr(t,n):t.setAttribute(n,n),n}},P.each(P.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=_e[e]||P.find.attr;_e[e]=function(t,e,r){var i,s,o=e.toLowerCase();return r||(s=_e[o],_e[o]=i,i=null!=n(t,e,r)?o:null,_e[o]=s),i}}));var Se=/^(?:input|select|textarea|button)$/i,Me=/^(?:a|area)$/i;function Pe(t){return(t.match(U)||[]).join(" ")}function Oe(t){return t.getAttribute&&t.getAttribute("class")||""}function Ce(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(U)||[]}P.fn.extend({prop:function(t,e){return tt(this,P.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[P.propFix[t]||t]}))}}),P.extend({prop:function(t,e,n){var r,i,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&P.isXMLDoc(t)||(e=P.propFix[e]||e,i=P.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=P.find.attr(t,"tabindex");return e?parseInt(e,10):Se.test(t.nodeName)||Me.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(P.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),P.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){P.propFix[this.toLowerCase()]=this})),P.fn.extend({addClass:function(t){var e,n,r,i,s,o;return y(t)?this.each((function(e){P(this).addClass(t.call(this,e,Oe(this)))})):(e=Ce(t)).length?this.each((function(){if(r=Oe(this),n=1===this.nodeType&&" "+Pe(r)+" "){for(s=0;s<e.length;s++)i=e[s],n.indexOf(" "+i+" ")<0&&(n+=i+" ");o=Pe(n),r!==o&&this.setAttribute("class",o)}})):this},removeClass:function(t){var e,n,r,i,s,o;return y(t)?this.each((function(e){P(this).removeClass(t.call(this,e,Oe(this)))})):arguments.length?(e=Ce(t)).length?this.each((function(){if(r=Oe(this),n=1===this.nodeType&&" "+Pe(r)+" "){for(s=0;s<e.length;s++)for(i=e[s];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");o=Pe(n),r!==o&&this.setAttribute("class",o)}})):this:this.attr("class","")},toggleClass:function(t,e){var n,r,i,s,o=typeof t,a="string"===o||Array.isArray(t);return y(t)?this.each((function(n){P(this).toggleClass(t.call(this,n,Oe(this),e),e)})):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(n=Ce(t),this.each((function(){if(a)for(s=P(this),i=0;i<n.length;i++)r=n[i],s.hasClass(r)?s.removeClass(r):s.addClass(r);else void 0!==t&&"boolean"!==o||((r=Oe(this))&&at.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":at.get(this,"__className__")||""))})))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+Pe(Oe(n))+" ").indexOf(e)>-1)return!0;return!1}});var Ne=/\r/g;P.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=y(t),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,P(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=P.map(i,(function(t){return null==t?"":t+""}))),(e=P.valHooks[this.type]||P.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=P.valHooks[i.type]||P.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Ne,""):null==n?"":n:void 0}}),P.extend({valHooks:{option:{get:function(t){var e=P.find.attr(t,"value");return null!=e?e:Pe(P.text(t))}},select:{get:function(t){var e,n,r,i=t.options,s=t.selectedIndex,o="select-one"===t.type,a=o?null:[],u=o?s+1:i.length;for(r=s<0?u:o?s:0;r<u;r++)if(((n=i[r]).selected||r===s)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(e=P(n).val(),o)return e;a.push(e)}return a},set:function(t,e){for(var n,r,i=t.options,s=P.makeArray(e),o=i.length;o--;)((r=i[o]).selected=P.inArray(P.valHooks.option.get(r),s)>-1)&&(n=!0);return n||(t.selectedIndex=-1),s}}}}),P.each(["radio","checkbox"],(function(){P.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=P.inArray(P(t).val(),e)>-1}},g.checkOn||(P.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Ae=r.location,Te={guid:Date.now()},je=/\?/;P.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||P.error("Invalid XML: "+(n?P.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Ee=/^(?:focusinfocus|focusoutblur)$/,De=function(t){t.stopPropagation()};P.extend(P.event,{trigger:function(t,e,n,i){var s,o,a,u,h,l,c,f,p=[n||v],m=d.call(t,"type")?t.type:t,g=d.call(t,"namespace")?t.namespace.split("."):[];if(o=f=a=n=n||v,3!==n.nodeType&&8!==n.nodeType&&!Ee.test(m+P.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),h=m.indexOf(":")<0&&"on"+m,(t=t[P.expando]?t:new P.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:P.makeArray(e,[t]),c=P.event.special[m]||{},i||!c.trigger||!1!==c.trigger.apply(n,e))){if(!i&&!c.noBubble&&!b(n)){for(u=c.delegateType||m,Ee.test(u+m)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||v)&&p.push(a.defaultView||a.parentWindow||r)}for(s=0;(o=p[s++])&&!t.isPropagationStopped();)f=o,t.type=s>1?u:c.bindType||m,(l=(at.get(o,"events")||Object.create(null))[t.type]&&at.get(o,"handle"))&&l.apply(o,e),(l=h&&o[h])&&l.apply&&st(o)&&(t.result=l.apply(o,e),!1===t.result&&t.preventDefault());return t.type=m,i||t.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),e)||!st(n)||h&&y(n[m])&&!b(n)&&((a=n[h])&&(n[h]=null),P.event.triggered=m,t.isPropagationStopped()&&f.addEventListener(m,De),n[m](),t.isPropagationStopped()&&f.removeEventListener(m,De),P.event.triggered=void 0,a&&(n[h]=a)),t.result}},simulate:function(t,e,n){var r=P.extend(new P.Event,n,{type:t,isSimulated:!0});P.event.trigger(r,null,e)}}),P.fn.extend({trigger:function(t,e){return this.each((function(){P.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return P.event.trigger(t,e,n,!0)}});var ke=/\[\]$/,Be=/\r?\n/g,Le=/^(?:submit|button|image|reset|file)$/i,Ie=/^(?:input|select|textarea|keygen)/i;function Fe(t,e,n,r){var i;if(Array.isArray(e))P.each(e,(function(e,i){n||ke.test(t)?r(t,i):Fe(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==_(e))r(t,e);else for(i in e)Fe(t+"["+i+"]",e[i],n,r)}P.param=function(t,e){var n,r=[],i=function(t,e){var n=y(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!P.isPlainObject(t))P.each(t,(function(){i(this.name,this.value)}));else for(n in t)Fe(n,t[n],e,i);return r.join("&")},P.fn.extend({serialize:function(){return P.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=P.prop(this,"elements");return t?P.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!P(this).is(":disabled")&&Ie.test(this.nodeName)&&!Le.test(t)&&(this.checked||!Pt.test(t))})).map((function(t,e){var n=P(this).val();return null==n?null:Array.isArray(n)?P.map(n,(function(t){return{name:e.name,value:t.replace(Be,"\r\n")}})):{name:e.name,value:n.replace(Be,"\r\n")}})).get()}});var Re=/%20/g,qe=/#.*$/,ze=/([?&])_=[^&]*/,Ve=/^(.*?):[ \t]*([^\r\n]*)$/gm,Xe=/^(?:GET|HEAD)$/,Ye=/^\/\//,He={},Ge={},Ue="*/".concat("*"),We=v.createElement("a");function $e(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,s=e.toLowerCase().match(U)||[];if(y(n))for(;r=s[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Qe(t,e,n,r){var i={},s=t===Ge;function o(a){var u;return i[a]=!0,P.each(t[a]||[],(function(t,a){var h=a(e,n,r);return"string"!=typeof h||s||i[h]?s?!(u=h):void 0:(e.dataTypes.unshift(h),o(h),!1)})),u}return o(e.dataTypes[0])||!i["*"]&&o("*")}function Je(t,e){var n,r,i=P.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&P.extend(!0,t,r),t}We.href=Ae.href,P.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ae.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ae.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ue,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":P.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Je(Je(t,P.ajaxSettings),e):Je(P.ajaxSettings,t)},ajaxPrefilter:$e(He),ajaxTransport:$e(Ge),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,i,s,o,a,u,h,l,c,f,d=P.ajaxSetup({},e),p=d.context||d,m=d.context&&(p.nodeType||p.jquery)?P(p):P.event,g=P.Deferred(),y=P.Callbacks("once memory"),b=d.statusCode||{},x={},w={},_="canceled",S={readyState:0,getResponseHeader:function(t){var e;if(h){if(!o)for(o={};e=Ve.exec(s);)o[e[1].toLowerCase()+" "]=(o[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=o[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return h?s:null},setRequestHeader:function(t,e){return null==h&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,x[t]=e),this},overrideMimeType:function(t){return null==h&&(d.mimeType=t),this},statusCode:function(t){var e;if(t)if(h)S.always(t[S.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||_;return n&&n.abort(e),M(0,e),this}};if(g.promise(S),d.url=((t||d.url||Ae.href)+"").replace(Ye,Ae.protocol+"//"),d.type=e.method||e.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(U)||[""],null==d.crossDomain){u=v.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=We.protocol+"//"+We.host!=u.protocol+"//"+u.host}catch(t){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=P.param(d.data,d.traditional)),Qe(He,d,e,S),h)return S;for(c in(l=P.event&&d.global)&&0==P.active++&&P.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Xe.test(d.type),i=d.url.replace(qe,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Re,"+")):(f=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(je.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(ze,"$1"),f=(je.test(i)?"&":"?")+"_="+Te.guid+++f),d.url=i+f),d.ifModified&&(P.lastModified[i]&&S.setRequestHeader("If-Modified-Since",P.lastModified[i]),P.etag[i]&&S.setRequestHeader("If-None-Match",P.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||e.contentType)&&S.setRequestHeader("Content-Type",d.contentType),S.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Ue+"; q=0.01":""):d.accepts["*"]),d.headers)S.setRequestHeader(c,d.headers[c]);if(d.beforeSend&&(!1===d.beforeSend.call(p,S,d)||h))return S.abort();if(_="abort",y.add(d.complete),S.done(d.success),S.fail(d.error),n=Qe(Ge,d,e,S)){if(S.readyState=1,l&&m.trigger("ajaxSend",[S,d]),h)return S;d.async&&d.timeout>0&&(a=r.setTimeout((function(){S.abort("timeout")}),d.timeout));try{h=!1,n.send(x,M)}catch(t){if(h)throw t;M(-1,t)}}else M(-1,"No Transport");function M(t,e,o,u){var c,f,v,x,w,_=e;h||(h=!0,a&&r.clearTimeout(a),n=void 0,s=u||"",S.readyState=t>0?4:0,c=t>=200&&t<300||304===t,o&&(x=function(t,e,n){for(var r,i,s,o,a=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)s=u[0];else{for(i in n){if(!u[0]||t.converters[i+" "+u[0]]){s=i;break}o||(o=i)}s=s||o}if(s)return s!==u[0]&&u.unshift(s),n[s]}(d,S,o)),!c&&P.inArray("script",d.dataTypes)>-1&&P.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),x=function(t,e,n,r){var i,s,o,a,u,h={},l=t.dataTypes.slice();if(l[1])for(o in t.converters)h[o.toLowerCase()]=t.converters[o];for(s=l.shift();s;)if(t.responseFields[s]&&(n[t.responseFields[s]]=e),!u&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=s,s=l.shift())if("*"===s)s=u;else if("*"!==u&&u!==s){if(!(o=h[u+" "+s]||h["* "+s]))for(i in h)if((a=i.split(" "))[1]===s&&(o=h[u+" "+a[0]]||h["* "+a[0]])){!0===o?o=h[i]:!0!==h[i]&&(s=a[0],l.unshift(a[1]));break}if(!0!==o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+u+" to "+s}}}return{state:"success",data:e}}(d,x,S,c),c?(d.ifModified&&((w=S.getResponseHeader("Last-Modified"))&&(P.lastModified[i]=w),(w=S.getResponseHeader("etag"))&&(P.etag[i]=w)),204===t||"HEAD"===d.type?_="nocontent":304===t?_="notmodified":(_=x.state,f=x.data,c=!(v=x.error))):(v=_,!t&&_||(_="error",t<0&&(t=0))),S.status=t,S.statusText=(e||_)+"",c?g.resolveWith(p,[f,_,S]):g.rejectWith(p,[S,_,v]),S.statusCode(b),b=void 0,l&&m.trigger(c?"ajaxSuccess":"ajaxError",[S,d,c?f:v]),y.fireWith(p,[S,_]),l&&(m.trigger("ajaxComplete",[S,d]),--P.active||P.event.trigger("ajaxStop")))}return S},getJSON:function(t,e,n){return P.get(t,e,n,"json")},getScript:function(t,e){return P.get(t,void 0,e,"script")}}),P.each(["get","post"],(function(t,e){P[e]=function(t,n,r,i){return y(n)&&(i=i||r,r=n,n=void 0),P.ajax(P.extend({url:t,type:e,dataType:i,data:n,success:r},P.isPlainObject(t)&&t))}})),P.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),P._evalUrl=function(t,e,n){return P.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){P.globalEval(t,e,n)}})},P.fn.extend({wrapAll:function(t){var e;return this[0]&&(y(t)&&(t=t.call(this[0])),e=P(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return y(t)?this.each((function(e){P(this).wrapInner(t.call(this,e))})):this.each((function(){var e=P(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=y(t);return this.each((function(n){P(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){P(this).replaceWith(this.childNodes)})),this}}),P.expr.pseudos.hidden=function(t){return!P.expr.pseudos.visible(t)},P.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},P.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Ze={0:200,1223:204},Ke=P.ajaxSettings.xhr();g.cors=!!Ke&&"withCredentials"in Ke,g.ajax=Ke=!!Ke,P.ajaxTransport((function(t){var e,n;if(g.cors||Ke&&!t.crossDomain)return{send:function(i,s){var o,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];for(o in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(o,i[o]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Ze[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),P.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),P.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return P.globalEval(t),t}}}),P.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),P.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=P("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),v.head.appendChild(e[0])},abort:function(){n&&n()}}}));var tn,en=[],nn=/(=)\?(?=&|$)|\?\?/;P.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=en.pop()||P.expando+"_"+Te.guid++;return this[t]=!0,t}}),P.ajaxPrefilter("json jsonp",(function(t,e,n){var i,s,o,a=!1!==t.jsonp&&(nn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=y(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(nn,"$1"+i):!1!==t.jsonp&&(t.url+=(je.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||P.error(i+" was not called"),o[0]},t.dataTypes[0]="json",s=r[i],r[i]=function(){o=arguments},n.always((function(){void 0===s?P(r).removeProp(i):r[i]=s,t[i]&&(t.jsonpCallback=e.jsonpCallback,en.push(i)),o&&y(s)&&s(o[0]),o=s=void 0})),"script"})),g.createHTMLDocument=((tn=v.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===tn.childNodes.length),P.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(g.createHTMLDocument?((r=(e=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,e.head.appendChild(r)):e=v),s=!n&&[],(i=q.exec(t))?[e.createElement(i[1])]:(i=Et([t],e,s),s&&s.length&&P(s).remove(),P.merge([],i.childNodes)));var r,i,s},P.fn.load=function(t,e,n){var r,i,s,o=this,a=t.indexOf(" ");return a>-1&&(r=Pe(t.slice(a)),t=t.slice(0,a)),y(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),o.length>0&&P.ajax({url:t,type:i||"GET",dataType:"html",data:e}).done((function(t){s=arguments,o.html(r?P("<div>").append(P.parseHTML(t)).find(r):t)})).always(n&&function(t,e){o.each((function(){n.apply(this,s||[t.responseText,e,t])}))}),this},P.expr.pseudos.animated=function(t){return P.grep(P.timers,(function(e){return t===e.elem})).length},P.offset={setOffset:function(t,e,n){var r,i,s,o,a,u,h=P.css(t,"position"),l=P(t),c={};"static"===h&&(t.style.position="relative"),a=l.offset(),s=P.css(t,"top"),u=P.css(t,"left"),("absolute"===h||"fixed"===h)&&(s+u).indexOf("auto")>-1?(o=(r=l.position()).top,i=r.left):(o=parseFloat(s)||0,i=parseFloat(u)||0),y(e)&&(e=e.call(t,n,P.extend({},a))),null!=e.top&&(c.top=e.top-a.top+o),null!=e.left&&(c.left=e.left-a.left+i),"using"in e?e.using.call(t,c):l.css(c)}},P.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){P.offset.setOffset(this,t,e)}));var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],i={top:0,left:0};if("fixed"===P.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===P.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((i=P(t).offset()).top+=P.css(t,"borderTopWidth",!0),i.left+=P.css(t,"borderLeftWidth",!0))}return{top:e.top-i.top-P.css(r,"marginTop",!0),left:e.left-i.left-P.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===P.css(t,"position");)t=t.offsetParent;return t||mt}))}}),P.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;P.fn[t]=function(r){return tt(this,(function(t,r,i){var s;if(b(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===i)return s?s[e]:t[r];s?s.scrollTo(n?s.pageXOffset:i,n?i:s.pageYOffset):t[r]=i}),t,r,arguments.length)}})),P.each(["top","left"],(function(t,e){P.cssHooks[e]=te(g.pixelPosition,(function(t,n){if(n)return n=Kt(t,e),Wt.test(n)?P(t).position()[e]+"px":n}))})),P.each({Height:"height",Width:"width"},(function(t,e){P.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,r){P.fn[r]=function(i,s){var o=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===s?"margin":"border");return tt(this,(function(e,n,i){var s;return b(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===i?P.css(e,n,a):P.style(e,n,i,a)}),e,o?i:void 0,o)}}))})),P.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){P.fn[e]=function(t){return this.on(e,t)}})),P.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.on("mouseenter",t).on("mouseleave",e||t)}}),P.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){P.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var rn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;P.proxy=function(t,e){var n,r,i;if("string"==typeof e&&(n=t[e],e=t,t=n),y(t))return r=a.call(arguments,2),i=function(){return t.apply(e||this,r.concat(a.call(arguments)))},i.guid=t.guid=t.guid||P.guid++,i},P.holdReady=function(t){t?P.readyWait++:P.ready(!0)},P.isArray=Array.isArray,P.parseJSON=JSON.parse,P.nodeName=C,P.isFunction=y,P.isWindow=b,P.camelCase=it,P.type=_,P.now=Date.now,P.isNumeric=function(t){var e=P.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},P.trim=function(t){return null==t?"":(t+"").replace(rn,"$1")},void 0===(n=function(){return P}.apply(e,[]))||(t.exports=n);var sn=r.jQuery,on=r.$;return P.noConflict=function(t){return r.$===P&&(r.$=on),t&&r.jQuery===P&&(r.jQuery=sn),P},void 0===i&&(r.jQuery=r.$=P),P}))},72:t=>{"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var s={},o=[],a=0;a<t.length;a++){var u=t[a],h=r.base?u[0]+r.base:u[0],l=s[h]||0,c="".concat(h," ").concat(l);s[h]=l+1;var f=n(c),d={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==f)e[f].references++,e[f].updater(d);else{var p=i(d,r);r.byIndex=a,e.splice(a,0,{identifier:c,updater:p,references:1})}o.push(c)}return o}function i(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,i){var s=r(t=t||[],i=i||{});return function(t){t=t||[];for(var o=0;o<s.length;o++){var a=n(s[o]);e[a].references--}for(var u=r(t,i),h=0;h<s.length;h++){var l=n(s[h]);0===e[l].references&&(e[l].updater(),e.splice(l,1))}s=u}}},659:t=>{"use strict";var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={id:r,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nc=void 0;var r={};return(()=>{"use strict";n.r(r),n.d(r,{BasesLayoutForm:()=>Ir});var t={};n.r(t),n.d(t,{cx:()=>me,cy:()=>ge,height:()=>be,rx:()=>ce,ry:()=>fe,width:()=>ye,x:()=>de,y:()=>pe});var e={};n.r(e),n.d(e,{from:()=>_e,to:()=>Se});var i={};n.r(i),n.d(i,{MorphArray:()=>Ae,height:()=>De,width:()=>Ee,x:()=>Te,y:()=>je});var s={};n.r(s),n.d(s,{array:()=>un,clear:()=>hn,move:()=>ln,plot:()=>cn,size:()=>fn});var o={};n.r(o),n.d(o,{amove:()=>qn,ax:()=>Fn,ay:()=>Rn,build:()=>zn,center:()=>In,cx:()=>Bn,cy:()=>Ln,length:()=>jn,move:()=>kn,plain:()=>Tn,x:()=>En,y:()=>Dn});var a={};n.r(a),n.d(a,{dmove:()=>Un,dx:()=>Wn,dy:()=>$n,height:()=>Qn,move:()=>Jn,size:()=>Zn,width:()=>Kn,x:()=>tr,y:()=>er});var u=n(692),h=n(72),l=n.n(h),c=n(825),f=n.n(c),d=n(659),p=n.n(d),m=n(56),g=n.n(m),y=n(540),b=n.n(y),v=n(113),x=n.n(v),w=n(660),_={};_.styleTagTransform=x(),_.setAttributes=g(),_.insert=p().bind(null,"head"),_.domAPI=f(),_.insertStyleElement=b(),l()(w.Ay,_),w.Ay&&w.Ay.locals&&w.Ay.locals;var S=n(7),M={};M.styleTagTransform=x(),M.setAttributes=g(),M.insert=p().bind(null,"head"),M.domAPI=f(),M.insertStyleElement=b(),l()(S.A,M),S.A&&S.A.locals&&S.A.locals;var P=n(592),O={};O.styleTagTransform=x(),O.setAttributes=g(),O.insert=p().bind(null,"head"),O.domAPI=f(),O.insertStyleElement=b(),l()(P.Ay,O),P.Ay&&P.Ay.locals&&P.Ay.locals;class C{constructor(t){this.selectedBases=t,this.numSpan=document.createElement("span"),u(this.numSpan).addClass(P.bw),this.trailingText=document.createElement("span"),this.domNode=document.createElement("p"),u(this.domNode).addClass(P.JU).append(this.numSpan,this.trailingText)}refresh(){let t=[...this.selectedBases].length;this.numSpan.textContent=t.toString(),this.trailingText.textContent=1==t?" base is selected.":" bases are selected."}}var N=n(667),A={};A.styleTagTransform=x(),A.setAttributes=g(),A.insert=p().bind(null,"head"),A.domAPI=f(),A.insertStyleElement=b(),l()(N.Ay,A),N.Ay&&N.Ay.locals&&N.Ay.locals;var T=n(61),j={};function E(){let t=document.createElement("input");return u(t).attr({type:"text"}).addClass(T._),t}j.styleTagTransform=x(),j.setAttributes=g(),j.insert=p().bind(null,"head"),j.domAPI=f(),j.insertStyleElement=b(),l()(T.A,j),T.A&&T.A.locals&&T.A.locals;var D=n(713),k={};function B(t,e){let n=document.createElement("label"),r=document.createElement("span");return u(r).append(t).css({paddingLeft:"8px"}),u(n).addClass(D.k).append(e,r),n}k.styleTagTransform=x(),k.setAttributes=g(),k.insert=p().bind(null,"head"),k.domAPI=f(),k.insertStyleElement=b(),l()(D.A,k),D.A&&D.A.locals&&D.A.locals;var L=n(661),I=n(854),F=n(986);class R{constructor(t,e,n){this.domNode=E(),this.coordinateName=t,this.selectedBases=e,this.options=n,this.domNode.addEventListener("blur",(()=>this.handleSubmit())),this.domNode.addEventListener("keyup",(t=>{"enter"==t.key.toLowerCase()&&this.handleSubmit()})),this.refresh()}refresh(){let t=new L.Centroid([...this.selectedBases]).get()[this.coordinateName];this.domNode.value=Number.parseFloat(t.toFixed(2)).toString()}handleSubmit(){var t,e;let n=Number.parseFloat(this.domNode.value);if(!(0,I.isFiniteNumber)(n))return;let r=new L.Centroid([...this.selectedBases]);(0,F.areWithin)(n,r.get()[this.coordinateName],.001)||(!(null===(t=this.options)||void 0===t?void 0:t.beforeMovingBases)||this.options.beforeMovingBases(),r.set({x:r.get().x,y:r.get().y,[this.coordinateName]:n}),!(null===(e=this.options)||void 0===e?void 0:e.afterMovingBases)||this.options.afterMovingBases())}}class q{constructor(t,e){this.selectedBases=t,this.centroidXInput=new R("x",t,e),this.centroidYInput=new R("y",t,e);let n=B("X",this.centroidXInput.domNode),r=B("Y",this.centroidYInput.domNode);u(r).css({marginTop:"11px"});let i=document.createElement("div");u(i).append(n,r).css({display:"flex",flexDirection:"column"});let s=document.createElement("p");u(s).addClass(N.W5).append("Center"),this.domNode=document.createElement("div"),u(this.domNode).addClass(N.ML).append(i,s)}refresh(){this.centroidXInput.refresh(),this.centroidYInput.refresh()}}const z={},V=[];function X(t,e){if(Array.isArray(t))for(const n of t)X(n,e);else if("object"!=typeof t)H(Object.getOwnPropertyNames(e)),z[t]=Object.assign(z[t]||{},e);else for(const e in t)X(e,t[e])}function Y(t){return z[t]||{}}function H(t){V.push(...t)}function G(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function U(t){return t%360*Math.PI/180}function W(t){return t.charAt(0).toUpperCase()+t.slice(1)}function $(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function Q(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:a,y:u}=e.bbox();s&&(r=r.includes("left")?a:r.includes("right")?a+n:a+n/2),o&&(i=i.includes("top")?u:i.includes("bottom")?u+t:u+t/2)}return[r,i]}const J=new Set(["desc","metadata","title"]),Z=t=>J.has(t.nodeName),K=(t,e,n={})=>{const r={...e};for(const t in r)r[t].valueOf()===n[t]&&delete r[t];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},tt="http://www.w3.org/2000/svg",et="http://www.w3.org/2000/xmlns/",nt="http://www.w3.org/1999/xlink",rt={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class it{}const st={},ot="___SYMBOL___ROOT___";function at(t,e=tt){return rt.document.createElementNS(e,t)}function ut(t,e=!1){if(t instanceof it)return t;if("object"==typeof t)return ct(t);if(null==t)return new st[ot];if("string"==typeof t&&"<"!==t.charAt(0))return ct(rt.document.querySelector(t));const n=e?rt.document.createElement("div"):at("svg");return n.innerHTML=t,t=ct(n.firstChild),n.removeChild(n.firstChild),t}function ht(t,e){return e&&(e instanceof rt.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:at(t)}function lt(t){if(!t)return null;if(t.instance instanceof it)return t.instance;if("#document-fragment"===t.nodeName)return new st.Fragment(t);let e=W(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":st[e]||(e="Dom"),new st[e](t)}let ct=lt;function ft(t,e=t.name,n=!1){return st[e]=t,n&&(st[ot]=t),H(Object.getOwnPropertyNames(t.prototype)),t}let dt=1e3;function pt(t){return"Svgjs"+W(t)+dt++}function mt(t){for(let e=t.children.length-1;e>=0;e--)mt(t.children[e]);return t.id?(t.id=pt(t.nodeName),t):t}function gt(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function yt(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}X("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=ut(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=ut(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=ut(t)).before(this),this},insertAfter:function(t){return(t=ut(t)).after(this),this}});const bt=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,vt=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,xt=/rgb\((\d+),(\d+),(\d+)\)/,wt=/(#[a-z_][a-z0-9\-_]*)/i,_t=/\)\s*,?\s*/,St=/\s/g,Mt=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,Pt=/^rgb\(/,Ot=/^(\s+)?$/,Ct=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Nt=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,At=/[\s,]+/,Tt=/[MLHVCSQTAZ]/i;function jt(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function Et(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function Dt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}X("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(At)},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)}}),X("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||Ot.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||Ot.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),X("Dom",{data:function(t,e,n){if(null==t)return this.data(G(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)0===t[n].nodeName.indexOf("data-")&&i.push(t[n]);return i}(this.node.attributes),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),X("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 kt{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof kt||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){const{random:n,round:r,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new kt(t,e,r,"lch")}if("sine"===t){const t=r(80*i(2*s*(e=null==e?n():e)/.5+.01)+150),o=r(50*i(2*s*e/.5+4.6)+200),a=r(100*i(2*s*e/.5+2.3)+150);return new kt(t,o,a)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new kt(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new kt(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new kt(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new kt(t,e,r,"lab")}if("grey"===t){const t=255*n();return new kt(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Mt.test(t)||Pt.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);return 1===o?new kt(0,0,0,1,"cmyk"):new kt((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),a=Math.min(r,i,s),u=(o+a)/2,h=o===a,l=o-a;return new kt(360*(h?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(h?0:u>.5?l/(2-o-a):l/(o+a)),100*u,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=Et(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Et(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Et(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Et(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Et(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Et(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(Pt.test(t)){const e=t.replace(St,""),[n,r,i]=xt.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!Mt.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=vt.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:a,_d: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:n}=this.xyz();return new kt(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;return i<0&&(i*=-1,i=360-i),new kt(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,a=i/500+o,u=o-s/200,h=16/116,l=.008856,c=7.787;t=.95047*(a**3>l?a**3:(a-h)/c),e=1*(o**3>l?o**3:(o-h)/c),n=1.08883*(u**3>l?u**3:(u-h)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,a=.0031308,u=r>a?1.055*o(r,1/2.4)-.055:12.92*r,h=i>a?1.055*o(i,1/2.4)-.055:12.92*i,l=s>a?1.055*o(s,1/2.4)-.055:12.92*s;return new kt(255*u,255*h,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e)return n*=255,new kt(n,n,n);const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*Dt(i,r,t+1/3),o=255*Dt(i,r,t),a=255*Dt(i,r,t-1/3);return new kt(s,o,a)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new kt(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(jt);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,u=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*a+.1805*u)/.95047,l=(.2126*o+.7152*a+.0722*u)/1,c=(.0193*o+.1192*a+.9505*u)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new kt(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class Bt{constructor(...t){this.init(...t)}clone(){return new Bt(this)}init(t,e){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){It.isMatrixLike(t)||(t=new It(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function Lt(t,e,n){return Math.abs(e-t)<(n||1e-6)}class It{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,a=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,u=t.shear||0,h=t.rotate||t.theta||0,l=new Bt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new Bt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new Bt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,b=g.y,v=new Bt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:h,rx:v.x,ry:v.y,tx:y,ty:b,ox:c,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,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,a=t.e+t.a*e.e+t.c*e.f,u=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=a,n.f=u,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new It(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,a=this.f,u=n*s-r*i,h=u>0?1:-1,l=h*Math.sqrt(n*n+r*r),c=Math.atan2(h*r,h*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/u,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*g),translateY:a-e+t*p*l+e*(m*p*l+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 It(t);return Lt(this.a,e.a)&&Lt(this.b,e.b)&&Lt(this.c,e.c)&&Lt(this.d,e.d)&&Lt(this.e,e.e)&&Lt(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=It.fromArray([1,0,0,1,0,0]);return t=t instanceof oe?t.matrixify():"string"==typeof t?It.fromArray(t.split(At).map(parseFloat)):Array.isArray(t)?It.fromArray(t):"object"==typeof t&&It.isMatrixLike(t)?t:"object"==typeof t?(new It).transform(t):6===arguments.length?It.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const a=r/o,u=-e/o,h=-n/o,l=t/o,c=-(a*i+h*s),f=-(u*i+l*s);return this.a=a,this.b=u,this.c=h,this.d=l,this.e=c,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof It?t:new It(t);return It.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof It?t:new It(t);return It.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=U(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:h,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=a*r-u*i,this.d=u*r+a*i,this.e=h*r-l*i+n*i-e*r+e,this.f=l*r+h*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:a,e: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-n*t+n,this.f=h*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:a,f:u}=this;return this.a=r+i*t,this.c=s+o*t,this.e=a+u*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=U(t),e=U(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:h,e:l,f:c}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+h*i,this.d=h+u*s,this.e=l+c*i-r*i,this.f=c+l*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(It.isMatrixLike(t))return new It(t).multiplyO(this);const e=It.formatTransforms(t),{x:n,y:r}=new Bt(e.ox,e.oy).transform(this),i=(new It).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new Bt(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function Ft(){if(!Ft.nodes){const t=ut().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;Ft.nodes={svg:t,path:e}}if(!Ft.nodes.svg.node.parentNode){const t=rt.document.body||rt.document.documentElement;Ft.nodes.svg.addTo(t)}return Ft.nodes}function Rt(t){return!(t.width||t.height||t.x||t.y)}ft(It,"Matrix");class qt{constructor(...t){this.init(...t)}addOffset(){return this.x+=rt.window.pageXOffset,this.y+=rt.window.pageYOffset,new qt(this)}init(t){return t="string"==typeof t?t.split(At).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 Rt(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new qt(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof It||(t=new It(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new Bt(this.x,this.y),new Bt(this.x2,this.y),new Bt(this.x,this.y2),new Bt(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new qt(e,r,n-e,i-r)}}function zt(t,e,n){let r;try{if(r=e(t.node),Rt(r)&&(i=t.node)!==rt.document&&!(rt.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===rt.document}).call(rt.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){r=n(t)}var i;return r}X({viewbox:{viewbox(t,e,n,r){return null==t?new qt(this.attr("viewBox")):this.attr("viewBox",new qt(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,a=Math.min(s,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),e=e||new Bt(n/2/s+i.x,r/2/o+i.y);const h=new qt(i).transform(new It({scale:u,origin:e}));return this.viewbox(h)}}}),ft(qt,"Box");class Vt extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}const Xt=Vt;gt([Vt],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const Yt=["toArray","constructor","each"];function Ht(t,e){return new Xt(G((e||rt.document).querySelectorAll(t),(function(t){return lt(t)})))}Vt.extend=function(t){t=t.reduce(((t,e)=>(Yt.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),gt([Vt],t)};let Gt=0;const Ut={};function Wt(t){let e=t.getEventHolder();return e===rt.window&&(e=Ut),e.events||(e.events={}),e.events}function $t(t){return t.getEventTarget()}function Qt(t,e,n,r,i){const s=n.bind(r||t),o=ut(t),a=Wt(o),u=$t(o);e=Array.isArray(e)?e:e.split(At),n._svgjsListenerId||(n._svgjsListenerId=++Gt),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";a[e]=a[e]||{},a[e][r]=a[e][r]||{},a[e][r][n._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)}))}function Jt(t,e,n,r){const i=ut(t),s=Wt(i),o=$t(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(At)).forEach((function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,h;if(n)s[e]&&s[e][a||"*"]&&(o.removeEventListener(e,s[e][a||"*"][n],r||!1),delete s[e][a||"*"][n]);else if(e&&a){if(s[e]&&s[e][a]){for(h in s[e][a])Jt(o,[e,a].join("."),h);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&Jt(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])Jt(o,[e,u].join("."));delete s[e]}}else{for(t in s)Jt(o,t);!function(t){let e=t.getEventHolder();e===rt.window&&(e=Ut),e.events&&(e.events={})}(i)}}))}class Zt extends it{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=$t(t);return e instanceof rt.window.Event||(e=new rt.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const e in n)for(const r in n[e])n[e][r](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return Jt(this,t,e,n),this}on(t,e,n,r){return Qt(this,t,e,n,r),this}removeEventListener(){}}function Kt(){}ft(Zt,"EventTarget");const te={"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 ee 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(At).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 ne{constructor(...t){this.init(...t)}convert(t){return new ne(this.value,t)}divide(t){return t=new ne(t),new ne(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(bt))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof ne&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new ne(t),new ne(this-t,this.unit||t.unit)}plus(t){return t=new ne(t),new ne(this+t,this.unit||t.unit)}times(t){return t=new ne(t),new ne(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 re=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),ie=[];class se extends Zt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=ut(t)).removeNamespace&&this.node instanceof rt.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 ut(t).put(this,e)}children(){return new Xt(G(this.node.children,(function(t){return lt(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=mt(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new se(at(t),e))}first(){return lt(this.node.firstChild)}get(t){return lt(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=pt(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return lt(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=lt(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=lt(e.node.parentNode));return e}put(t,e){return t=ut(t),this.add(t,e),t}putIn(t,e){return ut(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=ut(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,tt)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=lt(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=at("wrapper",n),i=rt.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}gt(se,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=Ct.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?te[t]:Ct.test(e)?parseFloat(e):e;"number"==typeof(e=ie.reduce(((e,n)=>n(t,e,this)),e))?e=new ne(e):re.has(t)&&kt.isColor(e)?e=new kt(e):e.constructor===Array&&(e=new ee(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return Ht(t,this.node)},findOne:function(t){return lt(this.node.querySelector(t))}}),ft(se,"Dom");class oe extends se{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??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 ne(t).plus(this.x()))}dy(t=0){return this.y(new ne(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=ut(t));const n=new Xt;let r=this;for(;(r=r.parent())&&r.node!==rt.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(wt);return e?ut(e[1]):null}root(){const t=this.parent(st[ot]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=$(this,t,e);return this.width(new ne(n.width)).height(new ne(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return K(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}gt(oe,{bbox:function(){const t=zt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(Ft().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new qt(t)},rbox:function(t){const e=zt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new qt(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new Bt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new It(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new It(e)}return new It(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new It}}}),ft(oe,"Element");const ae={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof kt||kt.isRgb(e)||e instanceof oe)this.attr(t,e);else for(n=ae[t].length-1;n>=0;n--)null!=e[ae[t][n]]&&this.attr(ae.prefix(t,ae[t][n]),e[ae[t][n]]);return this},X(["Element","Runner"],e)})),X(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new It(this):this.attr("transform",new It(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),X("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new ne(t)):this.rx(t).ry(e)}}),X("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new Bt(this.node.getPointAtLength(t))}}),X(["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)}}),X("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),X("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(_t).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(At).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(It.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new It)},toParent:function(t,e){if(this===t)return this;if(Z(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new It(this).decompose();return null==t?e:e[t]}It.isMatrixLike(t)||(t={...t,origin:Q(t,this)});const n=new It(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class ue extends oe{flatten(){return this.each((function(){if(this instanceof ue)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}ft(ue,"Container");class he extends ue{constructor(t,e=t){super(ht("defs",t),e)}flatten(){return this}ungroup(){return this}}ft(he,"Defs");class le extends oe{}function ce(t){return this.attr("rx",t)}function fe(t){return this.attr("ry",t)}function de(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function pe(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function me(t){return this.attr("cx",t)}function ge(t){return this.attr("cy",t)}function ye(t){return null==t?2*this.rx():this.rx(new ne(t).divide(2))}function be(t){return null==t?2*this.ry():this.ry(new ne(t).divide(2))}ft(le,"Shape");class ve extends le{constructor(t,e=t){super(ht("ellipse",t),e)}size(t,e){const n=$(this,t,e);return this.rx(new ne(n.width).divide(2)).ry(new ne(n.height).divide(2))}}gt(ve,t),X("Container",{ellipse:yt((function(t=0,e=t){return this.put(new ve).size(t,e).move(0,0)}))}),ft(ve,"Ellipse");class xe extends se{constructor(t=rt.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new se(at("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}ft(xe,"Fragment");const we=xe;function _e(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new ne(t),fy:new ne(e)}):this.attr({x1:new ne(t),y1:new ne(e)})}function Se(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new ne(t),cy:new ne(e)}):this.attr({x2:new ne(t),y2:new ne(e)})}class Me extends ue{constructor(t,e){super(ht(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new qt}targets(){return Ht("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()+")"}}gt(Me,e),X({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:yt((function(t,e){return this.put(new Me(t)).update(e)}))}}),ft(Me,"Gradient");class Pe extends ue{constructor(t,e=t){super(ht("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new qt}targets(){return Ht("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()+")"}}X({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:yt((function(t,e,n){return this.put(new Pe).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),ft(Pe,"Pattern");class Oe extends le{constructor(t,e=t){super(ht("image",t),e)}load(t,e){if(!t)return this;const n=new rt.window.Image;return Qt(n,"load",(function(t){const r=this.parent(Pe);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Pe&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),Qt(n,"load error",(function(){Jt(n)})),this.attr("href",n.src=t,nt)}}var Ce;Ce=function(t,e,n){return"fill"!==t&&"stroke"!==t||Nt.test(e)&&(e=n.root().defs().image(e)),e instanceof Oe&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},ie.push(Ce),X({Container:{image:yt((function(t,e){return this.put(new Oe).size(0,0).load(t,e)}))}}),ft(Oe,"Image");class Ne extends ee{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new qt(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(At).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){It.isMatrixLike(t)||(t=new It(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}const Ae=Ne;function Te(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function je(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Ee(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function De(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}class ke extends le{constructor(t,e=t){super(ht("line",t),e)}array(){return new Ne([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Ne(t).toLine(),this.attr(t))}size(t,e){const n=$(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}gt(ke,i),X({Container:{line:yt((function(...t){return ke.prototype.plot.apply(this.put(new ke),null!=t[0]?t:[0,0,0,0])}))}}),ft(ke,"Line");class Be extends ue{constructor(t,e=t){super(ht("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 Le(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}X({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:yt((function(t,e,n){return this.put(new Be).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof Be?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),ft(Be,"Marker");const Ie={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class Fe{done(){return!1}}class Re extends Fe{constructor(t=">"){super(),this.ease=Ie[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class qe extends Fe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function ze(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}gt(class extends qe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:Le("_duration",ze),overshoot:Le("_overshoot",ze)}),gt(class extends qe{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,a=this._windup;return!1!==a&&(s=Math.max(-a,Math.min(s,a))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:Le("_windup"),p:Le("P"),i:Le("I"),d:Le("D")});const Ve={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Xe={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Ye="mlhvqtcsaz".split("");for(let t=0,e=Ye.length;t<e;++t)Xe[Ye[t]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Xe[t](e,n,r)}}(Ye[t].toUpperCase());function He(t){return t.segment.length&&t.segment.length-1===Ve[t.segment[0].toUpperCase()]}function Ge(t,e){t.inNumber&&Ue(t,!1);const n=Tt.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function Ue(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,He(t)&&We(t)}function We(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Xe[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function $e(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function Qe(t){return"E"===t.lastToken.toUpperCase()}const Je=new Set([" ",",","\t","\n","\r","\f"]);class Ze extends ee{bbox(){return Ft().path.setAttribute("d",this.toString()),new qt(Ft.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new Bt,p:new Bt};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!Ge(i,r))if("."!==r)if(isNaN(parseInt(r)))if(Je.has(r))i.inNumber&&Ue(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(Tt.test(r)){if(i.inNumber)Ue(i,!1);else{if(!He(i))throw new Error("parser Error");We(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!Qe(i)){Ue(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||$e(i)){i.inNumber=!0,i.number=r,Ue(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){Ue(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&Ue(i,!1),i.inSegment&&He(i)&&We(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const Ke=t=>{const e=typeof t;return"number"===e?ne:"string"===e?kt.isColor(t)?kt:At.test(t)?Tt.test(t)?Ze:ee:bt.test(t)?ne:en:on.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?ee:"object"===e?sn:en};class tn{constructor(t){this._stepper=t||new Re("-"),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(Ke(t));let e=new this._type(t);return this._type===kt&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===sn&&(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 en{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 nn{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,nn.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}nn.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const rn=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class sn{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===kt&&t[n+7]!==e[n+7]){const e=t[n+7],r=new kt(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=Ke(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(rn),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const on=[en,nn,sn];class an extends le{constructor(t,e=t){super(ht("path",t),e)}array(){return this._array||(this._array=new Ze(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 Ze(t))}size(t,e){const n=$(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}function un(){return this._array||(this._array=new Ne(this.attr("points")))}function hn(){return delete this._array,this}function ln(t,e){return this.attr("points",this.array().move(t,e))}function cn(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Ne(t))}function fn(t,e){const n=$(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}an.prototype.MorphArray=Ze,X({Container:{path:yt((function(t){return this.put(new an).plot(t||new Ze)}))}}),ft(an,"Path");class dn extends le{constructor(t,e=t){super(ht("polygon",t),e)}}X({Container:{polygon:yt((function(t){return this.put(new dn).plot(t||new Ne)}))}}),gt(dn,i),gt(dn,s),ft(dn,"Polygon");class pn extends le{constructor(t,e=t){super(ht("polyline",t),e)}}X({Container:{polyline:yt((function(t){return this.put(new pn).plot(t||new Ne)}))}}),gt(pn,i),gt(pn,s),ft(pn,"Polyline");class mn extends le{constructor(t,e=t){super(ht("rect",t),e)}}gt(mn,{rx:ce,ry:fe}),X({Container:{rect:yt((function(t,e){return this.put(new mn).size(t,e)}))}}),ft(mn,"Rect");class gn{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 yn={nextDraw:null,frames:new gn,timeouts:new gn,immediates:new gn,timer:()=>rt.window.performance||rt.window.Date,transforms:[],frame(t){const e=yn.frames.push({run:t});return null===yn.nextDraw&&(yn.nextDraw=rt.window.requestAnimationFrame(yn._draw)),e},timeout(t,e){e=e||0;const n=yn.timer().now()+e,r=yn.timeouts.push({run:t,time:n});return null===yn.nextDraw&&(yn.nextDraw=rt.window.requestAnimationFrame(yn._draw)),r},immediate(t){const e=yn.immediates.push(t);return null===yn.nextDraw&&(yn.nextDraw=rt.window.requestAnimationFrame(yn._draw)),e},cancelFrame(t){null!=t&&yn.frames.remove(t)},clearTimeout(t){null!=t&&yn.timeouts.remove(t)},cancelImmediate(t){null!=t&&yn.immediates.remove(t)},_draw(t){let e=null;const n=yn.timeouts.last();for(;(e=yn.timeouts.shift())&&(t>=e.time?e.run():yn.timeouts.push(e),e!==n););let r=null;const i=yn.frames.last();for(;r!==i&&(r=yn.frames.shift());)r.run(t);let s=null;for(;s=yn.immediates.shift();)s();yn.nextDraw=yn.timeouts.first()||yn.frames.first()?rt.window.requestAnimationFrame(yn._draw):null}},bn=yn,vn=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},xn=function(){const t=rt.window;return(t.performance||t.Date).now()};class wn extends Zt{constructor(t=xn){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(vn);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return bn.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=bn.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const e=this._runners[t],n=e.runner;this._time-e.start<=0&&n.reset()}let i=!1;for(let t=0,e=this._runners.length;t<e;t++){const n=this._runners[t],s=n.runner;let o=r;const a=this._time-n.start;a<=0?i=!0:(a<o&&(o=a),s.active()&&(s.step(o).done?!0!==n.persist&&s.duration()-s.time()+this._time+n.persist<this._time&&(s.unschedule(),--t,--e):i=!0))}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){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)}}X({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new wn,this._timeline):(this._timeline=t,this)}}});class _n extends Zt{constructor(t){super(),this.id=_n.id++,t="function"==typeof(t=null==t?400:t)?new qe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof qe,this._stepper=this._isDeclarative?t:new Re,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new It,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e??0,n=n||"last","object"!=typeof(t=t??400)||t instanceof Fe||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??400),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=_n.sanitise(t,e,n),i=new _n(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new It,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 Re(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let a;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,a=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(a,1),0)},u=i*(r+n)-r;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,n,r){return this._queue.push({initialiser:t||Kt,runner:e||Kt,retarget:n,isTransform:r,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof wn||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let a=!1;return(n||o)&&(this._initialise(n),this.transforms=new It,a=this._run(o?t:e),this.fire("step",this)),this.done=this.done||a&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}_n.id=0;class Sn{constructor(t=new It,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}gt([_n,Sn],{mergeWith(t){return new Sn(t.transforms.lmultiply(this.transforms),t.id)}});const Mn=(t,e)=>t.lmultiplyO(e),Pn=t=>t.transforms;function On(){const t=this._transformationRunners.runners.map(Pn).reduce(Mn,new It);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Cn{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 Sn).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}X({Element:{animate(t,e,n){const r=_n.sanitise(t,e,n),i=this.timeline();return new _n(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Pn).reduce(Mn,new It)},_addRunner(t){this._transformationRunners.add(t),bn.cancelImmediate(this._frameId),this._frameId=bn.immediate(On.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Cn).add(new Sn(new It(this))))}}}),gt(_n,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new tn(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(a=s,n.filter((t=>!a.includes(t))));var a;if(o.length){const e=this.element()[t](o),n=new sn(i.from()).valueOf();Object.assign(n,e),i.from(n)}const u=new sn(i.to()).valueOf();Object.assign(u,e),i.to(u),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new tn(this._stepper).to(new ne(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=It.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new tn(this._stepper).type(n?nn:It);let s,o,a,u,h;return this.queue((function(){o=o||this.element(),s=s||Q(t,o),h=new It(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:f}=new Bt(s).transform(o._currentTransform(this));let d=new It({...t,origin:[c,f]}),p=this._isDeclarative&&a?a:h;if(n){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);d.rotate=n[s]}e&&(r||(d.rotate=t.rotate||0),this._isDeclarative&&u&&(p.rotate=u)),i.from(p),i.to(d);const m=i.at(l);return u=m.rotate,a=new It(m),this.addTransform(a),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=Q(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",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 ne(e),this._tryRetarget(t,e))return this;const n=new tn(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new ne(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new tn(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new ne(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new tn(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new qt(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),gt(_n,{rx:ce,ry:fe,from:_e,to:Se}),ft(_n,"Runner");class Nn extends ue{constructor(t,e=t){super(ht("svg",t),e),this.namespace()}defs(){return this.isRoot()?lt(this.node.querySelector("defs"))||this.put(new he):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof rt.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:tt,version:"1.1"}).attr("xmlns:xlink",nt,et):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,et).attr("xmlns:svgjs",null,et)}root(){return this.isRoot()?this:super.root()}}X({Container:{nested:yt((function(){return this.put(new Nn)}))}}),ft(Nn,"Svg",!0);class An extends ue{constructor(t,e=t){super(ht("symbol",t),e)}}function Tn(t){return!1===this._build&&this.clear(),this.node.appendChild(rt.document.createTextNode(t)),this}function jn(){return this.node.getComputedTextLength()}function En(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)}function Dn(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function kn(t,e,n=this.bbox()){return this.x(t,n).y(e,n)}function Bn(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function Ln(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function In(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)}function Fn(t){return this.attr("x",t)}function Rn(t){return this.attr("y",t)}function qn(t,e){return this.ax(t).ay(e)}function zn(t){return this._build=!!t,this}X({Container:{symbol:yt((function(){return this.put(new An)}))}}),ft(An,"Symbol");class Vn extends le{constructor(t,e=t){super(ht("text",t),e),this.dom.leading=this.dom.leading??new ne(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new ne(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(Z(this.node))return;const i=rt.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new ne(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new ne(t.leading||1.3),this}writeDataToDom(){return K(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||Z(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===lt(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}gt(Vn,o),X({Container:{text:yt((function(t=""){return this.put(new Vn).text(t)})),plain:yt((function(t=""){return this.put(new Vn).plain(t)}))}}),ft(Vn,"Text");class Xn extends le{constructor(t,e=t){super(ht("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 Vn))return this;const e=t.index(this),n=rt.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new ne(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}gt(Xn,o),X({Tspan:{tspan:yt((function(t=""){const e=new Xn;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),ft(Xn,"Tspan");class Yn extends le{constructor(t,e=t){super(ht("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 ne(t).divide(2))}}gt(Yn,{x:de,y:pe,cx:me,cy:ge,width:ye,height:be}),X({Container:{circle:yt((function(t=0){return this.put(new Yn).size(t).move(0,0)}))}}),ft(Yn,"Circle");class Hn extends ue{constructor(t,e=t){super(ht("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return Ht("svg [clip-path*="+this.id()+"]")}}X({Container:{clip:yt((function(){return this.defs().put(new Hn)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Hn?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),ft(Hn,"ClipPath");class Gn extends oe{constructor(t,e=t){super(ht("foreignObject",t),e)}}function Un(t,e){return this.children().forEach((n=>{let r;try{r=n.bbox()}catch(t){return}const i=new It(n),s=i.translate(t,e).transform(i.inverse()),o=new Bt(r.x,r.y).transform(s);n.move(o.x,o.y)})),this}function Wn(t){return this.dmove(t,0)}function $n(t){return this.dmove(0,t)}function Qn(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function Jn(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)}function Zn(t,e,n=this.bbox()){const r=$(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new Bt(n).transform(new It(t).inverse());t.scale(i,s,e.x,e.y)})),this}function Kn(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function tr(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function er(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}X({Container:{foreignObject:yt((function(t,e){return this.put(new Gn).size(t,e)}))}}),ft(Gn,"ForeignObject");class nr extends ue{constructor(t,e=t){super(ht("g",t),e)}}gt(nr,a),X({Container:{group:yt((function(){return this.put(new nr)}))}}),ft(nr,"G");class rr extends ue{constructor(t,e=t){super(ht("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,nt)}}gt(rr,a),X({Container:{link:yt((function(t){return this.put(new rr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new rr,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}}}),ft(rr,"A");class ir extends ue{constructor(t,e=t){super(ht("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return Ht("svg [mask*="+this.id()+"]")}}X({Container:{mask:yt((function(){return this.defs().put(new ir)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof ir?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),ft(ir,"Mask");class sr extends oe{constructor(t,e=t){super(ht("stop",t),e)}update(t){return("number"==typeof t||t instanceof ne)&&(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 ne(t.offset)),this}}X({Gradient:{stop:function(t,e,n){return this.put(new sr).update(t,e,n)}}}),ft(sr,"Stop");class or extends oe{constructor(t,e=t){super(ht("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const t in e)n+=t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[t]+";";return n+="}",n}(t,e))}}X("Dom",{style(t,e){return this.put(new or).rule(t,e)},fontface(t,e,n){return this.put(new or).font(t,e,n)}}),ft(or,"Style");class ar extends Vn{constructor(t,e=t){super(ht("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}X({Container:{textPath:yt((function(t,e){return t instanceof Vn||(t=this.text(t)),t.path(e)}))},Text:{path:yt((function(t,e=!0){const n=new ar;let r;if(t instanceof an||(t=this.defs().path(t)),n.attr("href","#"+t,nt),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:yt((function(t){return t instanceof Vn||(t=(new Vn).addTo(this.parent()).text(t)),t.path(this)})),targets(){return Ht("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),ar.prototype.MorphArray=Ze,ft(ar,"TextPath");class ur extends le{constructor(t,e=t){super(ht("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,nt)}}X({Container:{use:yt((function(t,e){return this.put(new ur).use(t,e)}))}}),ft(ur,"Use");const hr=ut;gt([Nn,An,Oe,Pe,Be],Y("viewbox")),gt([ke,pn,dn,an],Y("marker")),gt(Vn,Y("Text")),gt(an,Y("Path")),gt(he,Y("Defs")),gt([Vn,Xn],Y("Tspan")),gt([mn,ve,Me,_n],Y("radius")),gt(Zt,Y("EventTarget")),gt(se,Y("Dom")),gt(oe,Y("Element")),gt(le,Y("Shape")),gt([ue,we],Y("Container")),gt(Me,Y("Gradient")),gt(_n,Y("Runner")),Xt.extend([...new Set(V)]),function(t=[]){on.push(...[].concat(t))}([ne,kt,qt,It,ee,Ne,Ze,Bt]),gt(on,{to(t){return(new tn).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var lr=n(501),cr={};cr.styleTagTransform=x(),cr.setAttributes=g(),cr.insert=p().bind(null,"head"),cr.domAPI=f(),cr.insertStyleElement=b(),l()(lr.Ay,cr),lr.Ay&&lr.Ay.locals&&lr.Ay.locals;const fr=["Left","Right","Top","Bottom"],dr={Left:L.MinCenterX,Right:L.MaxCenterX,Top:L.MinCenterY,Bottom:L.MaxCenterY};class pr{constructor(t,e,n){this.coordinateName=t,this.Coordinate=dr[t],this.selectedBases=e,this.options=n,this.domNode=E(),this.domNode.addEventListener("blur",(()=>this.handleSubmit())),this.domNode.addEventListener("keyup",(t=>{"enter"==t.key.toLowerCase()&&this.handleSubmit()}))}refresh(){let t=new(0,this.Coordinate)([...this.selectedBases]);this.domNode.value=Number.parseFloat(t.get().toFixed(2)).toString()}handleSubmit(){var t,e;let n=Number.parseFloat(this.domNode.value);if(!(0,I.isFiniteNumber)(n))return;let r=new(0,this.Coordinate)([...this.selectedBases]);(0,F.areWithin)(n,r.get(),.001)||(!(null===(t=this.options)||void 0===t?void 0:t.beforeMovingBases)||this.options.beforeMovingBases(),r.set(n),!(null===(e=this.options)||void 0===e?void 0:e.afterMovingBases)||this.options.afterMovingBases)}}class mr{constructor(t,e,n){this.coordinateInput=new pr(t,e,n),this.domNode=B(t,this.coordinateInput.domNode)}refresh(){this.coordinateInput.refresh()}}class gr{constructor(t,e){let n=function(){let t=document.createElement("button");return u(t).addClass(lr.wx).append(function(){let t=hr();return t.addClass(lr.D),t.viewbox(0,0,6,10).attr({width:"6px",height:"10px"}),t.path().attr("d","M 1 1 L 5 5 L 1 9").attr("stroke","black").attr("stroke-width",2).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("fill","none"),t.node}(),"More Coordinates"),t}(),r=document.createElement("div");this.fields=fr.map((n=>new mr(n,t,e))),u(r).addClass(lr.Qs).append(...this.fields.map((t=>t.domNode))),this.domNode=document.createElement("div"),u(this.domNode).addClass(lr.Ik),u(n).on("click",(()=>u(this.domNode).toggleClass(lr.ho))),u(this.domNode).append(n).append(r)}refresh(){this.fields.forEach((t=>t.refresh()))}}var yr=n(213),br={};br.styleTagTransform=x(),br.setAttributes=g(),br.insert=p().bind(null,"head"),br.domAPI=f(),br.insertStyleElement=b(),l()(yr.A,br),yr.A&&yr.A.locals&&yr.A.locals;var vr=n(725);class xr{constructor(t,e){this.domNode=document.createElement("button"),u(this.domNode).addClass(yr.O).append(function(){let t=hr();return t.viewbox(-3.5,-3.5,25,25).attr({width:"25px",height:"25px"}).css({transform:"rotate(45deg)"}),t.path().attr("d","M 17 9 A 8 8 270 1 1 9 1").attr("stroke","white").attr("stroke-width",1.5).attr("fill","none"),t.path().attr("d","M 9 -3 L 13 1 L 9 5 z").attr("stroke","white").attr("stroke-width",1).attr("fill","white"),t.node}());let n=!1,r=!1,i=0;this.domNode.addEventListener("mousedown",(e=>{n=!0,i=(0,vr.direction)((0,vr.centroid)([...t].map((t=>t.getCenterClientPoint()))),{x:e.clientX,y:e.clientY})})),window.addEventListener("mousemove",(s=>{if(n){r||!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases();let n=[...t],o=(0,vr.direction)((0,vr.centroid)(n.map((t=>t.getCenterClientPoint()))),{x:s.clientX,y:s.clientY});(0,L.rotate)(n,o-i),i=o,r=!0}})),window.addEventListener("mouseup",(()=>{n&&r&&(!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()),n=!1,r=!1}))}}const wr=String.fromCharCode(176);class _r{constructor(t,e){this.selectedBases=t,this.options=e,this.domNode=E(),this.domNode.addEventListener("blur",(()=>this.handleSubmit())),this.domNode.addEventListener("keyup",(t=>{"enter"==t.key.toLowerCase()&&this.handleSubmit()}))}refresh(){let t=new L.Direction([...this.selectedBases]);this.domNode.value=Number.parseFloat((0,F.degrees)(t.get()).toFixed(2)).toString(),this.domNode.value+=wr}handleSubmit(){var t,e;let n=(0,F.radians)(Number.parseFloat(this.domNode.value));if(!(0,I.isFiniteNumber)(n))return;let r=new L.Direction([...this.selectedBases]);(0,F.areWithin)(n,r.get(),.001)||(!(null===(t=this.options)||void 0===t?void 0:t.beforeMovingBases)||this.options.beforeMovingBases(),r.set(n),!(null===(e=this.options)||void 0===e?void 0:e.afterMovingBases)||this.options.afterMovingBases())}}class Sr{constructor(t,e){this.directionInput=new _r(t,e);let n=B("Rotation",this.directionInput.domNode),r=new xr(t,e);this.domNode=document.createElement("div"),u(this.domNode).append(n).append(r.domNode).css({display:"flex",flexDirection:"row",alignItems:"center"}),u(this.domNode).css({marginTop:"33px"})}refresh(){this.directionInput.refresh()}}var Mr=n(284),Pr={};Pr.styleTagTransform=x(),Pr.setAttributes=g(),Pr.insert=p().bind(null,"head"),Pr.domAPI=f(),Pr.insertStyleElement=b(),l()(Mr.Ay,Pr),Mr.Ay&&Mr.Ay.locals&&Mr.Ay.locals;var Or=n(645),Cr={};function Nr(){let t=document.createElement("button");return u(t).addClass(Or.E),t}Cr.styleTagTransform=x(),Cr.setAttributes=g(),Cr.insert=p().bind(null,"head"),Cr.domAPI=f(),Cr.insertStyleElement=b(),l()(Or.A,Cr),Or.A&&Or.A.locals&&Or.A.locals;var Ar=n(95),Tr={};function jr(){let t=document.createElement("button");return u(t).addClass(Ar.k),t}function Er(){let t=E();t.value="0";let e="0";t.addEventListener("focus",(()=>e=t.value));let n=()=>{let n=Number.parseFloat(t.value);(0,I.isFiniteNumber)(n)||(t.value=e)};return t.addEventListener("blur",n),t.addEventListener("keyup",(t=>{"enter"==t.key.toLowerCase()&&n()})),t}Tr.styleTagTransform=x(),Tr.setAttributes=g(),Tr.insert=p().bind(null,"head"),Tr.domAPI=f(),Tr.insertStyleElement=b(),l()(Ar.A,Tr),Ar.A&&Ar.A.locals&&Ar.A.locals;class Dr{constructor(t,e){let n=Er(),r=Er();n.value=10..toString(),r.value=20..toString();let i=B("Spacing",n),s=B("Termini Gap",r);u(i).css({margin:"14px 0px 0px 14px"}),u(s).css({margin:"10px 0px 0px 14px"});let o=jr();u(o).text("Circularize"),u(o).on("click",(()=>{let i=Number.parseFloat(n.value),s=Number.parseFloat(r.value);i=(0,I.isFiniteNumber)(i)?i:10,s=(0,I.isFiniteNumber)(s)?s:20,!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases(),(0,L.circularize)([...t],{spacing:i,terminiGap:s}),!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()})),this.domNode=document.createElement("div"),u(this.domNode).append(o).append(i).append(s).css({display:"flex",flexDirection:"column",alignItems:"start"}),u(this.domNode).css({marginTop:"55px"})}}var kr=n(882),Br={};Br.styleTagTransform=x(),Br.setAttributes=g(),Br.insert=p().bind(null,"head"),Br.domAPI=f(),Br.insertStyleElement=b(),l()(kr.A,Br),kr.A&&kr.A.locals&&kr.A.locals;var Lr=n(139);class Ir{constructor(t,e,n){this.selectedBases=e;let r=new C(e),i=new q(e,n),s=new gr(e,n),o=new Sr(e,n),a=function(t,e){let n=Nr(),r=Nr(),i=Nr(),s=Nr();u(n).text("X"),u(r).text("Y"),u(i).text("Self-X"),u(s).text("Self-Y"),u(n).on("click",(()=>{!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases(),(0,L.flipX)([...t]),!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()})),u(r).on("click",(()=>{!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases(),(0,L.flipY)([...t]),!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()})),u(i).on("click",(()=>{!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases(),(0,L.flipSelfX)([...t]),!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()})),u(s).on("click",(()=>{!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases(),(0,L.flipSelfY)([...t]),!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()}));let o=document.createElement("p");u(o).addClass(Mr.oP).text("Flip:");let a=document.createElement("div");return u(a).addClass(Mr.ps).append(o,n,r,i,s),a}(e,n),h=function(t,e){let n=Er();n.value=10..toString();let r=B("Spacing",n);u(r).css({margin:"14px 0px 0px 14px"});let i=jr();i.textContent="Linearize",i.addEventListener("click",(()=>{let r=Number.parseFloat(n.value);r=(0,I.isFiniteNumber)(r)?r:10,!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases(),(0,L.linearize)([...t],{spacing:r}),!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()}));let s=document.createElement("div");return u(s).append(i).append(r).css({display:"flex",flexDirection:"column",alignItems:"start"}),u(s).css({marginTop:"31px"}),s}(e,n),l=function(t,e){let n=jr();return n.textContent="Straighten",u(n).css({marginTop:"35px"}),n.addEventListener("click",(()=>{!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases(),(0,L.straighten)([...t]),!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()})),n}(e,n),c=new Dr(e,n),f=function(t,e){let n=Er();n.value=10..toString();let r=B("Spacing",n);u(r).css({margin:"14px 0px 0px 14px"});let i=jr();u(i).text("Round"),u(i).on("click",(()=>{let r=Number.parseFloat(n.value);r=(0,I.isFiniteNumber)(r)?r:10,!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases(),(0,L.round)([...t],{spacing:r}),!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()}));let s=document.createElement("div");return u(s).append(i).append(r).css({display:"flex",flexDirection:"column",alignItems:"start"}),u(s).css({marginTop:"41px"}),s}(e,n),d=function(t,e){let n=Er(),r=Er();n.value=20..toString(),r.value=10..toString();let i=B("Base-Pair Length",n),s=B("Base-Pair Spacing",r);u(i).css({margin:"14px 0px 0px 14px"}),u(s).css({margin:"10px 0px 0px 14px"});let o=jr();u(o).text("Stemmify"),u(o).on("click",(()=>{let i=Number.parseFloat(n.value),s=Number.parseFloat(r.value);i=(0,I.isFiniteNumber)(i)?i:20,s=(0,I.isFiniteNumber)(s)?s:10,!(null==e?void 0:e.beforeMovingBases)||e.beforeMovingBases(),(0,L.stemmify)([...t],{basePairLength:i,basePairSpacing:s}),!(null==e?void 0:e.afterMovingBases)||e.afterMovingBases()}));let a=document.createElement("div");return u(a).append(o).append(i).append(s).css({display:"flex",flexDirection:"column",alignItems:"start"}),u(a).css({marginTop:"41px"}),a}(e,n),p=function(t,e,n){let r=Er(),i=Er(),s=Er();r.value=20..toString(),i.value=10..toString(),s.value=10..toString();let o=B("Base-Pair Length",r),a=B("Base-Pair Spacing",i),h=B("Hairpin Loop Spacing",s);u(o).css({margin:"14px 0px 0px 14px"}),u(a).css({margin:"10px 0px 0px 14px"}),u(h).css({margin:"10px 0px 0px 14px"});let l=jr();u(l).text("Radialize"),u(l).on("click",(()=>{let o=Number.parseFloat(r.value),a=Number.parseFloat(i.value),u=Number.parseFloat(s.value);o=(0,I.isFiniteNumber)(o)?o:20,a=(0,I.isFiniteNumber)(a)?a:10,u=(0,I.isFiniteNumber)(u)?u:10;let h=new Set([...e]),l=[...t.secondaryBonds].filter((t=>h.has(t.base1)&&h.has(t.base2))).map((t=>[t.base1,t.base2]));!(null==n?void 0:n.beforeMovingBases)||n.beforeMovingBases(),(0,L.radialize)([...e],l,{spacing:o,basePairSpacing:a,hairpinLoopSpacing:u}),!(null==n?void 0:n.afterMovingBases)||n.afterMovingBases()}));let c=document.createElement("div");return u(c).append(l).append(o).append(a).append(h).css({display:"flex",flexDirection:"column",alignItems:"start"}),u(c).css({marginTop:"41px"}),c}(t,e,n),m=document.createElement("div");u(m).addClass(w.nn),u(m).append(i.domNode).append(s.domNode).append(o.domNode).append(a).append(h).append(l).append(c.domNode).append(f).append(d).append(p);let g=document.createElement("div");u(g).append(r.domNode).append(m).css({margin:"24px 0px 0px 21px"}).css({pointerEvents:"none"}),this.domNode=document.createElement("div"),u(this.domNode).addClass(w.t0),u(this.domNode).append(function(){let t=document.createElement("p");return u(t).addClass(S.w).append("Bases Layout"),t}()).append(g),this.refreshableComponents=[r,i,s,o],new MutationObserver((()=>this.isOpen()?this.refresh():{})).observe(t.domNode,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.addEventListener("change",(()=>this.isOpen()?this.refresh():{}));let y=function(){let t=document.createElement("button");return u(t).addClass(kr.b).text("Close"),t}();u(y).on("click",(()=>this.close())),u(this.domNode).append(y),this.fronter=new Lr.FormFronter(this.domNode),this.dragTranslater=new Lr.DragTranslater(this.domNode)}refresh(){this.refreshableComponents.forEach((t=>t.refresh())),0==[...this.selectedBases].length?u(this.domNode).addClass(w.JI):u(this.domNode).removeClass(w.JI)}appendTo(t){this.refresh(),this.dragTranslater.untranslate(),t.appendChild(this.domNode)}remove(){this.domNode.remove()}isOpen(){return document.contains(this.domNode)}close(){this.domNode.remove()}}})(),r})(),t.exports=e()},925:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{HorizontalScrollbar:()=>r,HorizontalScrollbarThumb:()=>n,Scrollbars:()=>o,VerticalScrollbar:()=>s,VerticalScrollbarThumb:()=>i});class n{constructor(t){this.targetElement=t}get leftX(){return this.targetElement.scrollLeft}set leftX(t){this.targetElement.scrollLeft=t}get length(){let t=this.targetElement.scrollLeft;this.targetElement.scrollLeft=this.targetElement.scrollWidth;let e=this.targetElement.scrollWidth-this.targetElement.scrollLeft;return this.targetElement.scrollLeft=t,e}get rightX(){return this.leftX+this.length}set rightX(t){this.targetElement.scrollLeft=t-this.length}get centerX(){return(this.leftX+this.rightX)/2}set centerX(t){this.targetElement.scrollLeft=t-this.length/2}}class r{constructor(t){this.targetElement=t,this.thumb=new n(t)}}class i{constructor(t){this.targetElement=t}get topY(){return this.targetElement.scrollTop}set topY(t){this.targetElement.scrollTop=t}get length(){let t=this.targetElement.scrollTop;this.targetElement.scrollTop=this.targetElement.scrollHeight;let e=this.targetElement.scrollHeight-this.targetElement.scrollTop;return this.targetElement.scrollTop=t,e}get bottomY(){return this.topY+this.length}set bottomY(t){this.targetElement.scrollTop=t-this.length}get centerY(){return this.targetElement.scrollTop+this.length/2}set centerY(t){this.targetElement.scrollTop=t-this.length/2}}class s{constructor(t){this.targetElement=t,this.thumb=new i(t)}}class o{constructor(t){this.targetElement=t}center(){this.targetElement.scrollLeft=this.targetElement.scrollWidth,this.targetElement.scrollTop=this.targetElement.scrollHeight;let t=this.targetElement.scrollWidth-this.targetElement.scrollLeft,e=this.targetElement.scrollHeight-this.targetElement.scrollTop;this.targetElement.scrollLeft=this.targetElement.scrollWidth/2-t/2,this.targetElement.scrollTop=this.targetElement.scrollHeight/2-e/2}}return e})(),t.exports=e()},106:function(t){var e;e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return t.map((t=>({v:t,priority:Math.random()}))).sort(((t,e)=>t.priority-e.priority)).map((({v:t})=>t))}function r(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}t.r(e),t.d(e,{DownloadableFile:()=>i,EventfulSet:()=>s,detectMac:()=>r,shuffled:()=>n});class i{constructor(t){this.textContent=t}downloadAs(t,e){let n=new File([this.textContent],t,{type:e.type}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=n.name,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)}}class s{constructor(){this.eventListeners={change:[]},this.underlyingSet=new Set}[Symbol.iterator](){return this.underlyingSet.values()}includes(t){return this.underlyingSet.has(t)}include(t){return this.includes(t)}addAll(t){let e=[...t];0!=e.length&&(e.every((t=>this.includes(t)))||(e.forEach((t=>this.underlyingSet.add(t))),this.callEventListeners("change")))}removeAll(t){let e=[...t];0!=e.length&&(e.every((t=>!this.includes(t)))||(e.forEach((t=>this.underlyingSet.delete(t))),this.callEventListeners("change")))}clear(){0!=this.underlyingSet.size&&(this.underlyingSet.clear(),this.callEventListeners("change"))}addEventListener(t,e){this.eventListeners[t].push(e)}callEventListeners(t){this.eventListeners[t].forEach((t=>t()))}removeEventListener(t,e){this.eventListeners[t]=this.eventListeners[t].filter((t=>t!==e))}}return e})(),t.exports=e()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{RNAcanvas:()=>c});var t=n(662),e=n(925);class i{constructor(){this.domNode=document.createElement("div"),this.domNode.style.overflow="auto";let t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div");t.style.flexGrow="1",n.style.flexGrow="0",r.style.flexGrow="1",this.domNode.style.display="flex",this.domNode.style.flexDirection="column",this.domNode.append(t,n,r);let i=document.createElement("div"),s=document.createElement("div"),o=document.createElement("div");i.style.flexGrow="1",s.style.flexGrow="0",o.style.flexGrow="1",n.style.display="flex",n.style.flexDirection="row",n.append(i,s,o);let a=document.createElement("div");this.contentContainer=document.createElement("div");let 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,n){this.targetDrawing=t,this.horizontalScrollbar=e,this.verticalScrollbar=n}get centerPoint(){return{x:this.horizontalScrollbar.thumb.centerX/this.targetDrawing.horizontalScaling+this.targetDrawing.minX,y:this.verticalScrollbar.thumb.centerY/this.targetDrawing.verticalScaling+this.targetDrawing.minY}}set centerPoint(t){this.horizontalScrollbar.thumb.centerX=this.targetDrawing.horizontalScaling*(t.x-this.targetDrawing.minX),this.verticalScrollbar.thumb.centerY=this.targetDrawing.verticalScaling*(t.y-this.targetDrawing.minY)}fitToContent(){let t=this.targetDrawing.contentBBox;this.targetDrawing.setScaling(.9*Math.min(this.horizontalScrollbar.thumb.length/t.width,this.verticalScrollbar.thumb.length/t.height)),this.centerPoint={x:t.x+t.width/2,y:t.y+t.height/2}}}var o=n(460),a=n(106),u=n(524),h=n(124),l=n(628);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.basesLayoutForm=new l.BasesLayoutForm(this.drawing,this.selectedBases,{beforeMovingBases:()=>this.hideOverlaidDrawing(),afterMovingBases:()=>this.unhideOverlaidDrawing()}),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}}})(),r})()));
|