@rnacanvas/draw 17.1.0 → 17.2.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/index.js +1 -1
- package/package.json +1 -1
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.draw=e():t.draw=e()}(this,()=>(()=>{var t={127(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},369(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>p,Stems:()=>m,areConflicting:()=>u,areCrossing:()=>l,areEqual:()=>o,areKnotless:()=>h,areStacked:()=>a,basePairs:()=>w,deepCopy:()=>e,knotless:()=>d,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,radializable:()=>f,sorted:()=>s});var t=r(854);function e(e){return(0,t.isNumbersArray)(e)?[...e]:e.map(t=>[...t])}var i=r(986);function s(t){let r=e(t);return r.forEach(i.sortNumbers),r.sort((t,e)=>t[0]-e[0]),r}function o(t,r){let n=e(t),s=e(r);return(0,i.sortNumbers)(n),(0,i.sortNumbers)(s),[0,1].every(t=>n[t]==s[t])}function a(t,e){let r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function u(t,e){return(0,i.min)(t)==(0,i.min)(e)&&(0,i.max)(t)!=(0,i.max)(e)||(0,i.min)(t)!=(0,i.min)(e)&&(0,i.max)(t)==(0,i.max)(e)}function c(t){if(0==t.length)return[];let e=[];for(let r=0;r<(0,i.max)(t.flat());r++)e.push(void 0);return t.forEach(t=>{e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function h(t){let e=c(t),r=[],n=!1;return e.forEach((t,e)=>{let i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function l(t,e){return!h([t,e])}function d(t){let r=[],n=e(t);n.sort((t,e)=>Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1]));let s=[];return n.forEach(t=>{let e=[t[0]-1,t[1]-1],n=(0,i.min)(e),o=(0,i.max)(e);if(!s[n]&&!s[o]){r.push(t);for(let t=n;t<=o;t++)s[t]=!0}}),r}function f(t){let r=e(t);r.sort(([t,e],[r,n])=>Math.abs(t-e)-Math.abs(r-n));let n=[],i=[];return r.forEach(([t,e])=>{t==e||null!=i[t-1]||null!=i[e-1]||(n.push([t,e]),i[t-1]=e,i[e-1]=t)}),d(n)}class m{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[1];if(0==t.length)return[];let e=s(t),r=[],n=[];return e.forEach(t=>{let e=0==n.length?null:n[n.length-1];!e||a(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r}}class p{constructor(...t){this.targetStructure=t}get(){let t=new m(...this.targetStructure).get().flatMap(t=>[t.map(i.min),t.map(i.max)]);t.forEach(i.sortNumbers),t.sort((t,e)=>(0,i.min)(t)-(0,i.min)(e));let e=[],r=t.shift(),n=t.shift();for(;r&&n;){let s=[],o=(0,i.max)(r),a=(0,i.min)(n);for(let t=o;t<=a;t++)s.push(t);e.push(s),r=n,n=t.shift()}return e}}function y(...t){let e=t[0],r=t[1],n=c(r);if(!h(r))throw new Error("Pseudoknot(s) encountered.");let i=[],s=0;return e.forEach((t,e)=>{let r=e+1,o=n[e];null==o?i.push(s):r<o?(i.push(s),s++):(r==o||s--,i.push(s))}),i}var g=r(106);function b(t){t=(0,g.removeWhitespace)(t);let e={"()":[],"[]":[],"{}":[],"<>":[]};v.forEach(r=>{let[n,i]=r.split(""),o=[...t].map(t=>t===n?"(":t===i?")":".").join("");e[r]=function(t){let e=[],r=[];if([...t].forEach((t,n)=>{let i=n+1;if("."==t);else if("("==t)r.push(i);else if(")"==t){let t=r.pop();if("number"!=typeof t)throw new Error(`Unmatched downstream partner in dot-bracket notation at position: ${i}.`);e.push([t,i])}}),r.length>0)throw new Error(`Unmatched upstream partner in dot-bracket notation at position: ${r.pop()}.`);return s(e)}(o)});let r=()=>s(v.flatMap(t=>e[t]));return{[Symbol.iterator]:()=>r()[Symbol.iterator](),toArray:r,...e}}const v=["()","[]","{}","<>"];function w(t,e){return e.forEach(e=>{e.forEach(e=>{if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(e=>[t[e[0]-1],t[e[1]-1]])}})(),n})(),t.exports=e()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t,e){return t[0]===e[0]&&t[1]===e[1]||t[0]===e[1]&&t[1]===e[0]}function e(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>s,LastPairedBase:()=>a,LeadingDanglingBases:()=>u,Linkers:()=>d,PositionPairs:()=>i,Stems:()=>l,TrailingDanglingBases:()=>c,antiParallelPairs:()=>w,areEqual:()=>t,consecutivePairs:()=>b,knotless:()=>f,missing:()=>x,mountainPlotTraversal:()=>p,other:()=>e,parallelPairs:()=>v,parseDotBracket:()=>y,radializable:()=>m});class i{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 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(),n=t.findIndex(t=>r.includes(t));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var o=r(986);class a{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,o.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,o.max)(r)]}}class u{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(0,r)}}class c{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 a(...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 h=r(369);class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Stems(t,e).get().map(e=>e.map(e=>[t[e[0]-1],t[e[1]-1]]))}}class d{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Linkers(t,e).get().map(e=>e.map(e=>t[e-1]))}}function f(...t){let[e,r]=t,n=new i(...t).get();(0,h.areKnotless)(n)||(n=(0,h.knotless)(n));let s=n.map(t=>[e[t[0]-1],e[t[1]-1]]);return[[...e],s]}function m(...t){let[e,r]=t,n=new i(...t).get();return[[...e],(0,h.radializable)(n).map(([t,r])=>[e[t-1],e[r-1]])]}function p(...t){let[e,r]=t,n=new i(...t).get();return(0,h.mountainPlotTraversal)(e,n)}function y(t,e){let r=(0,h.parseDotBracket)(e),n=()=>(0,h.basePairs)(t,r.toArray());return{[Symbol.iterator]:()=>n()[Symbol.iterator](),toArray:n,"()":(0,h.basePairs)(t,r["()"]),"[]":(0,h.basePairs)(t,r["[]"]),"{}":(0,h.basePairs)(t,r["{}"]),"<>":(0,h.basePairs)(t,r["<>"])}}var g=r(106);function b(t){return(0,g.consecutivePairs)(t)}function v(t){let e=[],r=Math.floor(t.length/2)-1,n=Math.ceil(t.length/2);for(let i=0;i<=r;i++){let r=t[i],s=t[n+i];e.push([r,s])}return e}function w(t){let e=[];for(let r=0;r<Math.floor(t.length/2);r++){let n=t[r],i=t[t.length-r-1];e.push([n,i])}return e}function x(e,r){return r.filter(r=>!e.find(e=>t(r,e))).map(t=>[...t])}})(),n})(),t.exports=e()},645(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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 matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}static bounding(r){let n=[...r];if(0==n.length)throw new Error("An empty collection of boxes doesn't have a bounding box.");let i=n.map(t=>e.matching(t)),s=(0,t.min)(i.map(t=>t.left)),o=(0,t.min)(i.map(t=>t.top)),a=(0,t.max)(i.map(t=>t.right))-s,u=(0,t.max)(i.map(t=>t.bottom))-o;return new e(s,o,a,u)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get centerX(){return this.minX+this.width/2}get centerY(){return this.minY+this.height/2}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}bounds(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){let r="number"==typeof t[0]?t[0]:"factor"in t[0]?t[0].factor*this.width:t[0].percentage/100*this.width,n="number"==typeof t[0]&&"number"==typeof t[1]?t[1]:"number"==typeof t[0]?t[0]:"factor"in t[0]?t[0].factor*this.height:t[0].percentage/100*this.height;return new e(this.x-r,this.y-n,this.width+2*r,this.height+2*n)}get periphery(){return{atAngle:t=>{let e=this.width/2,r=this.height/2,n=Math.pow(Math.pow(e,2)+Math.pow(r,2),.5),i=this.centerX+n*Math.cos(t),s=this.centerY+n*Math.sin(t),o=n;return Math.abs(this.centerX-i)>e&&(o=Math.abs(e/Math.cos(t)),o=Number.isFinite(o)?o:r),Math.abs(this.centerY-s)>r&&(o=Math.abs(r/Math.sin(t)),o=Number.isFinite(o)?o:e),{x:this.centerX+o*Math.cos(t),y:this.centerY+o*Math.sin(t)}}}}}})(),n})(),t.exports=e()},297(t){var e;e=()=>(()=>{var t={106(t){var e;e=()=>(()=>{var t={992: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,{KeyBinding:()=>m});var r,n,i,s,o,a,u,c,h,l,d=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},f=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class m{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),d(this,n,e,"f"),d(this,i,t=>f(this,r,"m",l).call(this,t),"f"),d(this,s,a,"f")}get owner(){return f(this,o,"f")}set owner(t){var e;null===(e=f(this,o,"f"))||void 0===e||e.removeEventListener("keydown",f(this,i,"f")),null==t||t.addEventListener("keydown",f(this,i,"f"),{passive:!1}),d(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=f(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=f(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=f(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=f(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&t.key.toUpperCase()===this.key.toUpperCase()&&t.altKey===f(this,r,"a",a)&&t.ctrlKey===f(this,r,"a",u)&&t.metaKey===f(this,r,"a",c)&&t.shiftKey===f(this,r,"a",h)&&(t.preventDefault(),f(this,n,"f").call(this))},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";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.split(/\r\n|\r|\n/)}function a(t){try{return JSON.stringify(t),!0}catch(t){return!1}}function u(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function c(t){return t===document.activeElement}function h(t){return!!document.activeElement&&t.contains(document.activeElement)}r.r(n),r.d(n,{DownloadableFile:()=>g,EventfulSet:()=>b,FiniteStack:()=>S,KeyBinding:()=>l.KeyBinding,containsFocus:()=>h,detectMacOS:()=>f,detectWindows:()=>d,first:()=>t,hasFocus:()=>c,isJSONSerializable:()=>a,isURL:()=>E,last:()=>e,middleFour:()=>s,middleThree:()=>i,shuffled:()=>u,splitLines:()=>o});var l=r(992);function d(){return-1!==navigator.userAgent.indexOf("Windows")}function f(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var m,p=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},y=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class g{constructor(t,e,r){m.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",p(this,m,null==r?void 0:r.type,"f")}get type(){return null!=y(this,m,"f")?y(this,m,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){p(this,m,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}m=new WeakMap;class b{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)}}var v,w,x,N,O=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class S{constructor(t){v.add(this),this.maxSize=t,w.set(this,[]),x.set(this,{change:[]})}get size(){return O(this,w,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,w),O(this,v,"m",N).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return O(this,w,"f")[O(this,w,"f").length-1]}push(t){O(this,w,"f").push(t),this.size>this.maxSize&&O(this,w,"f").shift(),O(this,v,"m",N).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=O(this,w,"f").pop();return O(this,v,"m",N).call(this,"change"),t}addEventListener(t,e){O(this,x,"f")[t].push(e)}removeEventListener(t,e){O(this,x,"f")[t]=O(this,x,"f")[t].filter(t=>t!==e)}}function E(t){try{return new URL(t),!0}catch(t){return!1}}w=new WeakMap,x=new WeakMap,v=new WeakSet,N=function(t){O(this,x,"f")[t].forEach(t=>t())}})(),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,{isCT:()=>d,parseCT:()=>e});var t=r(106);function e(e){let r=function(t){let e=t.findIndex(t=>!i(t)&&!s(t));if(e<0)throw new Error("Unable to find the start of the structure.");let r=[...t].reverse().findIndex(t=>!i(t)&&!s(t));if(r<0)throw new Error("Unable to find the end of the structure.");return r=t.length-r-1,t.slice(e,r+1)}((0,t.splitLines)(e));return{description:o(r),sequence:a(r),positionPairs:u(r),numberingOffset:c(r)}}function i(t){return 0==t.trim().length}function s(t){return"#"==t.trim().charAt(0)}function o(t){if(0==t.length)return;let e=t[0],r=h(e);if(r.length<2)return;let n=r[0];return e.slice(e.indexOf(n)+n.length).trim()}function a(t){return t.slice(1).map(t=>{let e=h(t);if(e.length<2)throw new Error("Line is missing a character.");return e[1]}).join("")}function u(t){let e=t.slice(1),r=[];return e.forEach((t,e)=>{let n=e+1,i=h(t);if(i.length>=5){let t=Number.parseFloat(i[4]);if(Number.isNaN(t))throw new Error("Partner positions must be numbers.");if(!Number.isInteger(t))throw new Error("Partner positions must be integers.");0!=t&&n<=t&&r.push([n,t])}}),r}function c(t){if(t.length<2)return 0;let e=h(t[1]);if(e.length<6)return 0;let r=Number.parseFloat(e[5]);return Number.isNaN(r)?0:Number.isInteger(r)?r-1:0}function h(t){return function(t){return t.split(/\s/)}(t).filter(l)}function l(t){return t.length>0}function d(r){let n;try{n=e(r)}catch(t){return!1}if(0==n.sequence.length)return!1;let i=(0,t.splitLines)(r);if(i=i.filter(e=>!function(t){return 0==t.length}(e)&&!function(t){return 0==t.trim().length}(e)&&!function(e){return!((0,t.splitLines)(e).length>1)&&"#"==e.trim().charAt(0)}(e)),0==i.length)return!1;let s=(0,t.first)(i),o=Number.parseFloat(s.trim().split(/\s+/)[0]);if(!Number.isInteger(o))return!1;let a=i.slice(1);return 0!=a.length&&a.every(t=>{let e=t.trim().split(/\s+/);if(e.length<5)return!1;let r=Number.parseFloat(e[4]);return Number.isInteger(r)})}})(),n})(),t.exports=e()},282(t){var e;e=()=>(()=>{var t={127(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},369(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>p,Stems:()=>m,areConflicting:()=>u,areCrossing:()=>l,areEqual:()=>o,areKnotless:()=>h,areStacked:()=>a,basePairs:()=>w,deepCopy:()=>e,knotless:()=>d,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,radializable:()=>f,sorted:()=>s});var t=r(854);function e(e){return(0,t.isNumbersArray)(e)?[...e]:e.map(t=>[...t])}var i=r(986);function s(t){let r=e(t);return r.forEach(i.sortNumbers),r.sort((t,e)=>t[0]-e[0]),r}function o(t,r){let n=e(t),s=e(r);return(0,i.sortNumbers)(n),(0,i.sortNumbers)(s),[0,1].every(t=>n[t]==s[t])}function a(t,e){let r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function u(t,e){return(0,i.min)(t)==(0,i.min)(e)&&(0,i.max)(t)!=(0,i.max)(e)||(0,i.min)(t)!=(0,i.min)(e)&&(0,i.max)(t)==(0,i.max)(e)}function c(t){if(0==t.length)return[];let e=[];for(let r=0;r<(0,i.max)(t.flat());r++)e.push(void 0);return t.forEach(t=>{e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function h(t){let e=c(t),r=[],n=!1;return e.forEach((t,e)=>{let i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function l(t,e){return!h([t,e])}function d(t){let r=[],n=e(t);n.sort((t,e)=>Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1]));let s=[];return n.forEach(t=>{let e=[t[0]-1,t[1]-1],n=(0,i.min)(e),o=(0,i.max)(e);if(!s[n]&&!s[o]){r.push(t);for(let t=n;t<=o;t++)s[t]=!0}}),r}function f(t){let r=e(t);r.sort(([t,e],[r,n])=>Math.abs(t-e)-Math.abs(r-n));let n=[],i=[];return r.forEach(([t,e])=>{t==e||null!=i[t-1]||null!=i[e-1]||(n.push([t,e]),i[t-1]=e,i[e-1]=t)}),d(n)}class m{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[1];if(0==t.length)return[];let e=s(t),r=[],n=[];return e.forEach(t=>{let e=0==n.length?null:n[n.length-1];!e||a(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r}}class p{constructor(...t){this.targetStructure=t}get(){let t=new m(...this.targetStructure).get().flatMap(t=>[t.map(i.min),t.map(i.max)]);t.forEach(i.sortNumbers),t.sort((t,e)=>(0,i.min)(t)-(0,i.min)(e));let e=[],r=t.shift(),n=t.shift();for(;r&&n;){let s=[],o=(0,i.max)(r),a=(0,i.min)(n);for(let t=o;t<=a;t++)s.push(t);e.push(s),r=n,n=t.shift()}return e}}function y(...t){let e=t[0],r=t[1],n=c(r);if(!h(r))throw new Error("Pseudoknot(s) encountered.");let i=[],s=0;return e.forEach((t,e)=>{let r=e+1,o=n[e];null==o?i.push(s):r<o?(i.push(s),s++):(r==o||s--,i.push(s))}),i}var g=r(106);function b(t){t=(0,g.removeWhitespace)(t);let e={"()":[],"[]":[],"{}":[],"<>":[]};v.forEach(r=>{let[n,i]=r.split(""),o=[...t].map(t=>t===n?"(":t===i?")":".").join("");e[r]=function(t){let e=[],r=[];if([...t].forEach((t,n)=>{let i=n+1;if("."==t);else if("("==t)r.push(i);else if(")"==t){let t=r.pop();if("number"!=typeof t)throw new Error(`Unmatched downstream partner in dot-bracket notation at position: ${i}.`);e.push([t,i])}}),r.length>0)throw new Error(`Unmatched upstream partner in dot-bracket notation at position: ${r.pop()}.`);return s(e)}(o)});let r=()=>s(v.flatMap(t=>e[t]));return{[Symbol.iterator]:()=>r()[Symbol.iterator](),toArray:r,...e}}const v=["()","[]","{}","<>"];function w(t,e){return e.forEach(e=>{e.forEach(e=>{if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(e=>[t[e[0]-1],t[e[1]-1]])}})(),n})(),t.exports=e()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t,e){return t[0]===e[0]&&t[1]===e[1]||t[0]===e[1]&&t[1]===e[0]}function e(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>s,LastPairedBase:()=>a,LeadingDanglingBases:()=>u,Linkers:()=>d,PositionPairs:()=>i,Stems:()=>l,TrailingDanglingBases:()=>c,antiParallelPairs:()=>w,areEqual:()=>t,consecutivePairs:()=>b,knotless:()=>f,missing:()=>x,mountainPlotTraversal:()=>p,other:()=>e,parallelPairs:()=>v,parseDotBracket:()=>y,radializable:()=>m});class i{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 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(),n=t.findIndex(t=>r.includes(t));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var o=r(986);class a{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,o.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,o.max)(r)]}}class u{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(0,r)}}class c{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 a(...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 h=r(369);class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Stems(t,e).get().map(e=>e.map(e=>[t[e[0]-1],t[e[1]-1]]))}}class d{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Linkers(t,e).get().map(e=>e.map(e=>t[e-1]))}}function f(...t){let[e,r]=t,n=new i(...t).get();(0,h.areKnotless)(n)||(n=(0,h.knotless)(n));let s=n.map(t=>[e[t[0]-1],e[t[1]-1]]);return[[...e],s]}function m(...t){let[e,r]=t,n=new i(...t).get();return[[...e],(0,h.radializable)(n).map(([t,r])=>[e[t-1],e[r-1]])]}function p(...t){let[e,r]=t,n=new i(...t).get();return(0,h.mountainPlotTraversal)(e,n)}function y(t,e){let r=(0,h.parseDotBracket)(e),n=()=>(0,h.basePairs)(t,r.toArray());return{[Symbol.iterator]:()=>n()[Symbol.iterator](),toArray:n,"()":(0,h.basePairs)(t,r["()"]),"[]":(0,h.basePairs)(t,r["[]"]),"{}":(0,h.basePairs)(t,r["{}"]),"<>":(0,h.basePairs)(t,r["<>"])}}var g=r(106);function b(t){return(0,g.consecutivePairs)(t)}function v(t){let e=[],r=Math.floor(t.length/2)-1,n=Math.ceil(t.length/2);for(let i=0;i<=r;i++){let r=t[i],s=t[n+i];e.push([r,s])}return e}function w(t){let e=[];for(let r=0;r<Math.floor(t.length/2);r++){let n=t[r],i=t[t.length-r-1];e.push([n,i])}return e}function x(e,r){return r.filter(r=>!e.find(e=>t(r,e))).map(t=>[...t])}})(),n})(),t.exports=e()},801(t){var e;e=()=>(()=>{var t={726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>Q,Circle:()=>u,CoordinateSystem:()=>ot,Ellipse:()=>c,ForeignObject:()=>H,HorizontalClientScaling:()=>ut,Image:()=>Y,InnerXML:()=>mt,Line:()=>a,OuterXML:()=>gt,Path:()=>X,Polygon:()=>p,Polyline:()=>m,Rect:()=>h,SVG:()=>t,Scaling:()=>at,Text:()=>o,Texts:()=>J,Use:()=>z,VerticalClientScaling:()=>ct,assignUUID:()=>st,bringToFront:()=>ht,drawOnCanvas:()=>xt,isSVGGraphicsElement:()=>bt,isSVGGraphicsElementsArray:()=>wt,sendToBack:()=>lt,setAttributes:()=>et,shift:()=>G});class t{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var e,i=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class s{constructor(t){e.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,e,t)}isEmpty(){return 0==i(this,e,"f").numberOfItems}shift(t){for(let r=0;r<i(this,e,"f").numberOfItems;r++)i(this,e,"f").getItem(r).value+=t}}e=new WeakMap;class o{constructor(t){this.domNode=t}shift(t,e){let r=new s(this.domNode.x.baseVal),n=new s(this.domNode.y.baseVal);r.shift(t),n.shift(e),r.isEmpty()&&this.domNode.setAttribute("x",`${t}`),n.isEmpty()&&this.domNode.setAttribute("y",`${e}`),this.domNode.querySelectorAll("tspan").forEach(r=>{new s(r.x.baseVal).shift(t),new s(r.y.baseVal).shift(e)})}}class a{constructor(t){this.domNode=t}shift(t,e){this.domNode.x1.baseVal.value+=t,this.domNode.y1.baseVal.value+=e,this.domNode.x2.baseVal.value+=t,this.domNode.y2.baseVal.value+=e}}class u{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class c{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class h{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var l,d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(t){l.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,l,t)}shift(t,e){for(let r=0;r<d(this,l,"f").numberOfItems;r++){let n=d(this,l,"f").getItem(r);n.x+=t,n.y+=e}}}l=new WeakMap;class m{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}class p{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}var y=r(725);const g=" ";function b([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function v(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const w=Math.PI;function x(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:n,rY:i}=t;const{x:s,y:o}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+o)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*w,[u,c]=b([(e-s)/2,(r-o)/2],-a),h=Math.pow(u,2)/Math.pow(n,2)+Math.pow(c,2)/Math.pow(i,2);1<h&&(n*=Math.sqrt(h),i*=Math.sqrt(h)),t.rX=n,t.rY=i;const l=Math.pow(n,2)*Math.pow(c,2)+Math.pow(i,2)*Math.pow(u,2),d=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-l)/l)),f=n*c/i*d,m=-i*u/n*d,p=b([f,m],a);t.cX=p[0]+(e+s)/2,t.cY=p[1]+(r+o)/2,t.phi1=Math.atan2((c-m)/i,(u-f)/n),t.phi2=Math.atan2((-c-m)/i,(-u-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*w),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*w),t.phi1*=180/w,t.phi2*=180/w}function N(t,e,r){v(t,e,r);const n=t*t+e*e-r*r;if(0>n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}const O=Math.PI/180;function S(t,e,r){return(1-r)*t+r*e}function E(t,e,r,n){return t+Math.cos(n/180*w)*e+Math.sin(n/180*w)*r}function _(t,e,r,n){const i=1e-6,s=e-t,o=r-e,a=3*s+3*(n-r)-6*o,u=6*(o-s),c=3*s;return Math.abs(a)<i?Math.abs(u)<i?[]:[-c/u]:function(t,e,r=1e-6){const n=t*t/4-e;if(n<-r)return[];if(n<=r)return[-t/2];const i=Math.sqrt(n);return[-t/2-i,-t/2+i]}(u/a,c/a,i)}function M(t,e,r,n,i){const s=1-i;return t*(s*s*s)+e*(3*s*s*i)+r*(3*s*i*i)+n*(i*i*i)}function T(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],s=r[0]-t[0],o=r[1]-t[1],a=n*o-i*s;if(!(Math.abs(a)<1e-10))return!1;const u=n*s+i*o,c=s*s+o*o;return 0<=u&&u<=c&&n*n+i*i<=c}function A(t){const e=t[t.length-1]?.type===B.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:B.MOVE_TO,relative:!1,x:t[r].x,y:t[r].y}];for(let e=r;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case B.HORIZ_LINE_TO:n.push({type:B.HORIZ_LINE_TO,relative:!1,x:i.x});break;case B.VERT_LINE_TO:n.push({type:B.VERT_LINE_TO,relative:!1,y:i.y});break;case B.LINE_TO:case B.MOVE_TO:n.push({type:B.LINE_TO,relative:!1,x:i.x,y:i.y});break;case B.CURVE_TO:n.push({type:B.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case B.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case B.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case B.ARC:throw new Error("Unsupported command: A (arc)");case B.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:B.CLOSE_PATH}),n}function P(){return I((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t))}function C(){let t=NaN,e=NaN,r=NaN,n=NaN;return I((i,s,o)=>(i.type&B.SMOOTH_CURVE_TO&&(i.type=B.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?o:e,i.x1=i.relative?s-t:2*s-t,i.y1=i.relative?o-e:2*o-e),i.type&B.CURVE_TO?(t=i.relative?s+i.x2:i.x2,e=i.relative?o+i.y2:i.y2):(t=NaN,e=NaN),i.type&B.SMOOTH_QUAD_TO&&(i.type=B.QUAD_TO,r=isNaN(r)?s:r,n=isNaN(n)?o:n,i.x1=i.relative?s-r:2*s-r,i.y1=i.relative?o-n:2*o-n),i.type&B.QUAD_TO?(r=i.relative?s+i.x1:i.x1,n=i.relative?o+i.y1:i.y1):(r=NaN,n=NaN),i))}function j(){let t=NaN,e=NaN;return I((r,n,i)=>{if(r.type&B.SMOOTH_QUAD_TO&&(r.type=B.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?i:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?i-e:2*i-e),r.type&B.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const s=r.x1,o=r.y1;r.type=B.CURVE_TO,r.x1=((r.relative?0:n)+2*s)/3,r.y1=((r.relative?0:i)+2*o)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*o)/3}else t=NaN,e=NaN;return r})}function I(t){let e=0,r=0,n=NaN,i=NaN;return function(s){if(isNaN(n)&&!(s.type&B.MOVE_TO))throw new Error("path must start with moveto");const o=t(s,e,r,n,i);return s.type&B.CLOSE_PATH&&(e=n,r=i),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&B.MOVE_TO&&(n=e,i=r),o}}function L(t,e,r,n,i,s){return v(t,e,r,n,i,s),I((o,a,u,c)=>{const h=o.x1,l=o.x2,d=o.relative&&!isNaN(c),f=void 0!==o.x?o.x:d?0:a,m=void 0!==o.y?o.y:d?0:u;function p(t){return t*t}o.type&B.HORIZ_LINE_TO&&0!==e&&(o.type=B.LINE_TO,o.y=o.relative?0:u),o.type&B.VERT_LINE_TO&&0!==r&&(o.type=B.LINE_TO,o.x=o.relative?0:a),void 0!==o.x&&(o.x=o.x*t+m*r+(d?0:i)),void 0!==o.y&&(o.y=f*e+o.y*n+(d?0:s)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*r+(d?0:i)),void 0!==o.y1&&(o.y1=h*e+o.y1*n+(d?0:s)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*r+(d?0:i)),void 0!==o.y2&&(o.y2=l*e+o.y2*n+(d?0:s));const y=t*n-e*r;if(void 0!==o.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===y)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=B.LINE_TO;else{const i=o.xRot*Math.PI/180,s=Math.sin(i),a=Math.cos(i),u=1/p(o.rX),c=1/p(o.rY),h=p(a)*u+p(s)*c,l=2*s*a*(u-c),d=p(s)*u+p(a)*c,f=h*n*n-l*e*n+d*e*e,m=l*(t*n+e*r)-2*(h*r*n+d*t*e),g=h*r*r-l*t*r+d*t*t,b=(Math.atan2(m,f-g)+Math.PI)%Math.PI/2,v=Math.sin(b),w=Math.cos(b);o.rX=Math.abs(y)/Math.sqrt(f*p(w)+m*v*w+g*p(v)),o.rY=Math.abs(y)/Math.sqrt(f*p(v)-m*v*w+g*p(w)),o.xRot=180*b/Math.PI}return void 0!==o.sweepFlag&&0>y&&(o.sweepFlag=+!o.sweepFlag),o})}const D={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return v(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:P,TO_REL:function(){return I((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,n=!0){return I((i,s,o,a,u)=>{if(isNaN(a)&&!(i.type&B.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&B.HORIZ_LINE_TO&&(i.type=B.LINE_TO,i.y=i.relative?0:o),r&&i.type&B.VERT_LINE_TO&&(i.type=B.LINE_TO,i.x=i.relative?0:s),t&&i.type&B.CLOSE_PATH&&(i.type=B.LINE_TO,i.x=i.relative?a-s:a,i.y=i.relative?u-o:u),i.type&B.ARC&&(0===i.rX||0===i.rY)&&(i.type=B.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&B.QUAD_TO&&T([s,o],i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],i.relative?[s+i.x,o+i.y]:[i.x,i.y])&&(i.type=B.LINE_TO,delete i.x1,delete i.y1),n&&i.type&B.CURVE_TO){const t=[s,o],e=i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],r=i.relative?[s+i.x2,o+i.y2]:[i.x2,i.y2],n=i.relative?[s+i.x,o+i.y]:[i.x,i.y];T(t,e,n)&&T(t,r,n)&&(i.type=B.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:C,QT_TO_C:j,INFO:I,SANITIZE:function(t=0){v(t);let e=NaN,r=NaN,n=NaN,i=NaN;return I((s,o,a,u,c)=>{const h=Math.abs;let l=!1,d=0,f=0;if(s.type&B.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:o-e,f=isNaN(r)?0:a-r),s.type&(B.CURVE_TO|B.SMOOTH_CURVE_TO)?(e=s.relative?o+s.x2:s.x2,r=s.relative?a+s.y2:s.y2):(e=NaN,r=NaN),s.type&B.SMOOTH_QUAD_TO?(n=isNaN(n)?o:2*o-n,i=isNaN(i)?a:2*a-i):s.type&B.QUAD_TO?(n=s.relative?o+s.x1:s.x1,i=s.relative?a+s.y1:s.y2):(n=NaN,i=NaN),s.type&B.LINE_COMMANDS||s.type&B.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&B.CURVE_TO||s.type&B.SMOOTH_CURVE_TO||s.type&B.QUAD_TO||s.type&B.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-o,r=void 0===s.y?0:s.relative?s.y:s.y-a;d=isNaN(n)?void 0===s.x1?d:s.relative?s.x:s.x1-o:n-o,f=isNaN(i)?void 0===s.y1?f:s.relative?s.y:s.y1-a:i-a;const u=void 0===s.x2?0:s.relative?s.x:s.x2-o,c=void 0===s.y2?0:s.relative?s.y:s.y2-a;h(e)<=t&&h(r)<=t&&h(d)<=t&&h(f)<=t&&h(u)<=t&&h(c)<=t&&(l=!0)}return s.type&B.CLOSE_PATH&&h(o-u)<=t&&h(a-c)<=t&&(l=!0),l?[]:s})},MATRIX:L,ROTATE:function(t,e=0,r=0){v(t,e,r);const n=Math.sin(t),i=Math.cos(t);return L(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},TRANSLATE:function(t,e=0){return v(t,e),L(1,0,0,1,t,e)},SCALE:function(t,e=t){return v(t,e),L(t,0,0,e,0,0)},SKEW_X:function(t){return v(t),L(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return v(t),L(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return v(t),L(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return v(t),L(1,0,0,-1,0,t)},A_TO_C:function(){return I((t,e,r)=>B.ARC===t.type?function(t,e,r){t.cX||x(t,e,r);const n=t.xRot/180*w;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:B.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const i=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-i,o=Math.ceil(s/90),a=new Array(o);let u=e,c=r;const h=(e,r)=>{const[i,s]=b([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+s]};for(let e=0;e<o;e++){const r=S(t.phi1,t.phi2,e/o),n=S(t.phi1,t.phi2,(e+1)/o),i=n-r,s=4/3*Math.tan(i*O/4),l=Math.cos(r*O)-s*Math.sin(r*O),d=Math.sin(r*O)+s*Math.cos(r*O),f=Math.cos(n*O),m=Math.sin(n*O),p=f+s*m,y=m-s*f,g=h(l,d),b=h(p,y),v=h(f,m),w={relative:t.relative,type:B.CURVE_TO,x:v[0],y:v[1],x1:g[0],y1:g[1],x2:b[0],y2:b[1]};t.relative&&(w.x1-=u,w.y1-=c,w.x2-=u,w.y2-=c,w.x-=u,w.y-=c),u=v[0],c=v[1],a[e]=w}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return I((t,e,r)=>(t.relative&&(e=0,r=0),B.ARC===t.type&&x(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=P(),e=j(),r=C(),n=I((i,s,o)=>{const a=r(e(t((t=>({...t}))(i))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(a.type&B.DRAWING_COMMANDS&&(u(s),c(o)),a.type&B.HORIZ_LINE_TO&&u(a.x),a.type&B.VERT_LINE_TO&&c(a.y),a.type&B.LINE_TO&&(u(a.x),c(a.y)),a.type&B.CURVE_TO){u(a.x),c(a.y);const t=_(s,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(M(s,a.x1,a.x2,a.x,e));const e=_(o,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(M(o,a.y1,a.y2,a.y,t))}if(a.type&B.ARC){u(a.x),c(a.y),x(a,s,o);const t=a.xRot/180*Math.PI,e=Math.cos(t)*a.rX,r=Math.sin(t)*a.rX,n=-Math.sin(t)*a.rY,i=Math.cos(t)*a.rY,[h,l]=a.phi1<a.phi2?[a.phi1,a.phi2]:-180>a.phi2?[a.phi2+360,a.phi1+360]:[a.phi2,a.phi1],d=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<h?r+360:r},f=N(n,-e,0).map(d);for(const t of f)t>h&&t<l&&u(E(a.cX,e,n,t));const m=N(i,-r,0).map(d);for(const t of m)t>h&&t<l&&c(E(a.cY,r,i,t))}return i});return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=D.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const s of t){const t=r(s);t.type===B.MOVE_TO&&i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(D.INFO((t,e,r)=>{const n="relative"in t&&t.relative;return["x"in t?t.x+(n?e:0):e,"y"in t?t.y+(n?r:0):r]}));let n=r[0];e.push(t[0]);for(let i=1;i<t.length;i++){const s=t[i],o=t[i+1];if(i<t.length-1&&o&&s.type&B.LINE_COMMANDS&&o.type&B.LINE_COMMANDS){const t=r[i+1];if(T(n,r[i],t)){"relative"in o&&o.relative&&("x"in o&&(o.x=t[0]-n[0]),"y"in o&&(o.y=t[1]-n[1]));continue}}e.push(s),n=r[i]}return e}};class R{round(t){return this.transform(D.ROUND(t))}toAbs(){return this.transform(D.TO_ABS())}toRel(){return this.transform(D.TO_REL())}normalizeHVZ(t,e,r){return this.transform(D.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(D.NORMALIZE_ST())}qtToC(){return this.transform(D.QT_TO_C())}aToC(){return this.transform(D.A_TO_C())}sanitize(t){return this.transform(D.SANITIZE(t))}translate(t,e){return this.transform(D.TRANSLATE(t,e))}scale(t,e){return this.transform(D.SCALE(t,e))}rotate(t,e,r){return this.transform(D.ROTATE(t,e,r))}matrix(t,e,r,n,i,s){return this.transform(D.MATRIX(t,e,r,n,i,s))}skewX(t){return this.transform(D.SKEW_X(t))}skewY(t){return this.transform(D.SKEW_Y(t))}xSymmetry(t){return this.transform(D.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(D.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(D.ANNOTATE_ARCS())}}const V=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,F=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class k extends R{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let n=0;n<t.length;n++){const i=t[n],s=!(this.curCommandType!==B.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=F(i)&&("0"===this.curNumber&&"0"===i||s);if(!F(i)||o)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${n}`);if(this.curCommandType===B.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${n}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${n}"`);this.curArgs.push(t),this.curArgs.length===U[this.curCommandType]&&(B.HORIZ_LINE_TO===this.curCommandType?r({type:B.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):B.VERT_LINE_TO===this.curCommandType?r({type:B.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===B.MOVE_TO||this.curCommandType===B.LINE_TO||this.curCommandType===B.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),B.MOVE_TO===this.curCommandType&&(this.curCommandType=B.LINE_TO)):this.curCommandType===B.CURVE_TO?r({type:B.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===B.SMOOTH_CURVE_TO?r({type:B.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.QUAD_TO?r({type:B.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.ARC&&r({type:B.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!V(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(o)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${n}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${i}" at index ${n}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=B.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=B.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=B.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=B.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=B.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=B.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=B.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=B.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=B.ARC,this.curCommandRelative="a"===i}else e.push({type:B.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const n=Object.getPrototypeOf(this).parse.call(this,e);for(const e of n){const n=t(e);Array.isArray(n)?r.push(...n):r.push(n)}return r}}})}}class B extends R{commands;constructor(t){super(),this.commands="string"==typeof t?B.parse(t):t}encode(){return B.encode(this.commands)}getBounds(){const t=D.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const n=t(r);Array.isArray(n)?e.push(...n):e.push(n)}return this.commands=e,this}reverse(t=!0){return this.commands=D.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=D.REMOVE_COLLINEAR(this.commands),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const n=t[r];if(n.type===B.CLOSE_PATH)e+="z";else if(n.type===B.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===B.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===B.MOVE_TO)e+=(n.relative?"m":"M")+n.x+g+n.y;else if(n.type===B.LINE_TO)e+=(n.relative?"l":"L")+n.x+g+n.y;else if(n.type===B.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+g+n.y1+g+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+g+n.y1+g+n.x+g+n.y;else if(n.type===B.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+g+n.y;else{if(n.type!==B.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+g+n.rY+g+n.xRot+g+ +n.lArcFlag+g+ +n.sweepFlag+g+n.x+g+n.y}}return e}(t)}static parse(t){const e=new k,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=B.LINE_TO|B.HORIZ_LINE_TO|B.VERT_LINE_TO;static DRAWING_COMMANDS=B.HORIZ_LINE_TO|B.VERT_LINE_TO|B.LINE_TO|B.CURVE_TO|B.SMOOTH_CURVE_TO|B.QUAD_TO|B.SMOOTH_QUAD_TO|B.ARC}const U={[B.MOVE_TO]:2,[B.LINE_TO]:2,[B.HORIZ_LINE_TO]:1,[B.VERT_LINE_TO]:1,[B.CLOSE_PATH]:0,[B.QUAD_TO]:4,[B.SMOOTH_QUAD_TO]:2,[B.CURVE_TO]:6,[B.SMOOTH_CURVE_TO]:4,[B.ARC]:7};class X{constructor(t){this.domNode=t}shift(t,e){var r;let n=null!==(r=this.domNode.getAttribute("d"))&&void 0!==r?r:"";this.domNode.setAttribute("d",new B(n).translate(t,e).encode())}closestPoint(t){let e=this.domNode.getTotalLength(),r=[];for(let n=0;n<=16;n++){let i=n/16*e;r.push([i,(0,y.distance)(t,this.domNode.getPointAtLength(i))])}r.sort((t,e)=>t[1]-e[1]);let n=r[0],i=n[0]-e/16,s=n[0]+e/16;i=Math.max(0,i),s=Math.min(e,s);for(let e=0;e<20;e++){let e=(s-i)/3;(0,y.distance)(t,this.domNode.getPointAtLength(i))<(0,y.distance)(t,this.domNode.getPointAtLength(s))?s-=e:i+=e}let o=(i+s)/2,a=this.domNode.getPointAtLength(o);return{x:a.x,y:a.y,length:o}}}class Y{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class z{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class H{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}function G(e,r){let{x:n,y:i}=r,s=e.tagName;if(!$.has(s))switch(s){case"g":Array.from(e.children).forEach(t=>G(t,r));break;case"svg":new t(e).shift(n,i);break;case"text":new o(e).shift(n,i);break;case"line":new a(e).shift(n,i);break;case"circle":new u(e).shift(n,i);break;case"ellipse":new c(e).shift(n,i);break;case"rect":new h(e).shift(n,i);break;case"polyline":new m(e).shift(n,i);break;case"polygon":new p(e).shift(n,i);break;case"path":new X(e).shift(n,i);break;case"image":new Y(e).shift(n,i);break;case"use":new z(e).shift(n,i);break;case"foreignObject":new H(e).shift(n,i);break;default:console.error(`Unrecognized SVG element type: "${s}".`)}}const $=new Set(["defs","title","desc","metadata","style","script","linearGradient","radialGradient","stop","clipPath","mask","marker","pattern","symbol","filter"]);var W,q;class J{constructor(t){W.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,W,t)}toArray(){return Array.from(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,W).querySelectorAll("text")).map(t=>({domNode:t}))}}W=new WeakMap;class Q{constructor(t){q.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,q,t)}closestPoint(t){return document.body.contains(Z)||document.body.append(Z),tt.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,q)),new X(tt).closestPoint(t)}}q=new WeakMap;const K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("viewBox","0 0 100 100"),K.setAttribute("width","100"),K.setAttribute("height","100");const Z=document.createElement("div");Z.append(K),Z.style.height="0px",Z.style.position="fixed",document.body.append(Z);const tt=document.createElementNS("http://www.w3.org/2000/svg","path");function et(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}tt.setAttribute("stroke","black"),tt.setAttribute("stroke-width","1"),K.append(tt);const rt=new Uint8Array(16),nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));const it=function(t,e,r){return e||t||!crypto.randomUUID?function(t,e,r){const n=(t=t||{}).random??t.rng?.()??crypto.getRandomValues(rt);if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return(nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]).toLowerCase()}(n)}(t,e,r):crypto.randomUUID()};function st(t){t.id="uuid-"+it()}class ot{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class at{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class ut{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class ct{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function ht(t){let e=t.parentNode;e&&e.appendChild(t)}function lt(t){let e=t.parentNode;e&&e.prepend(t)}var dt,ft=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class mt{constructor(t){dt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,dt,t)}toString(){return ft(this,dt,"f").innerHTML}set(t){ft(this,dt,"f").innerHTML=t}}dt=new WeakMap;var pt,yt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class gt{constructor(t){pt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,pt,t)}toString(){return yt(this,pt,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=yt(this,pt,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...yt(this,pt,"f").attributes].forEach(t=>yt(this,pt,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>yt(this,pt,"f").setAttribute(t.name,t.value)),yt(this,pt,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function bt(t){return t instanceof SVGGraphicsElement}pt=new WeakMap;var vt=r(854);function wt(t){return(0,vt.isArray)(t)&&t.every(bt)}async function xt(t){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),await i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e}})(),n})(),t.exports=e()},986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){var e=0;return t.forEach(function(t){return e+=t}),e}function i(t){return n(t)/t.length}function s(t){t.sort(function(t,e){return t-e})}t.r(e),t.d(e,{areWithin:()=>m,average:()=>i,clamp:()=>f,degrees:()=>b,distance:()=>r,flipAway:()=>x,isBetween:()=>l,isBetweenExclusive:()=>d,isBetweenInclusive:()=>l,max:()=>h,mean:()=>i,median:()=>u,min:()=>c,normalizeAngle:()=>w,radians:()=>v,round:()=>g,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>p,sortedNumbers:()=>a,sortedNumbersAscending:()=>a,sortedNumbersDescending:()=>y,sum:()=>n});var o=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 a(t){var e=o([],t,!0);return s(e),e}function u(t){if(0==t.length)return NaN;var e=a(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,n=r-1;return i([e[r],e[n]])}function c(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,r){return t>=e&&t<=r}function d(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function m(t,e,r){return Math.abs(t-e)<=r}function p(t){s(t),t.reverse()}function y(t){var e=a(t);return e.reverse(),e}function g(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function b(t){return t*(180/Math.PI)}function v(t){return t*(Math.PI/180)}function w(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function x(t,e){var r=(e=w(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},456(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()},277(t){var e;e=()=>(()=>{var t={854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),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,{Vector:()=>e,isFiniteVectorLike:()=>s,isVectorLike:()=>i});var t=r(854);class e{static matching(t){let r="x"in t?t.x:t.magnitude*Math.cos(t.direction),n="y"in t?t.y:t.magnitude*Math.sin(t.direction);return new e(r,n)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}isFinite(){return(0,t.isFiniteNumber)(this.x)&&(0,t.isFiniteNumber)(this.y)}}function i(e){return!(!(0,t.isNonNullObject)(e)||!((0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)||(0,t.isNumber)(e.magnitude)&&(0,t.isNumber)(e.direction)))}function s(t){return!!i(t)&&e.matching(t).isFinite()}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{FinitePoint:()=>s,Point:()=>i,RelativePoint:()=>d,midpoint:()=>m});var t=r(277),e=r(854);class i{static matching(t){return new i(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}set(t){(0,e.isNumber)(null==t?void 0:t.x)&&(this.x=t.x),(0,e.isNumber)(null==t?void 0:t.y)&&(this.y=t.y)}drag(t,e){this.displace({x:t,y:e})}displace(e){let r=t.Vector.matching(e);this.x+=r.x,this.y+=r.y}displaced(t){let e=i.matching(this);return e.displace(t),e}displacementTo(e){return new t.Vector(e.x-this.x,e.y-this.y)}displacementFrom(e){return new t.Vector(this.x-e.x,this.y-e.y)}distanceTo(t){return this.displacementTo(t).magnitude}distanceFrom(t){return this.distanceTo(t)}directionTo(t){return this.displacementTo(t).direction}directionFrom(t){return this.displacementFrom(t).direction}deepCopy(){return new i(this.x,this.y)}}class s extends i{static matching(t){let e=i.matching(t);return new s(e.x,e.y)}constructor(t,r){if(super(t,r),!(0,e.isFiniteNumber)(t)||!(0,e.isFiniteNumber)(r))throw new Error(`Finite points must have finite number coordinates: (${t}, ${r}).`)}set(...t){let e=new i(0,0);e.set(...t),s.matching(e),super.set(...t)}}var o,a,u,c,h,l=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class d{constructor(e){o.add(this),a.set(this,void 0),u.set(this,new t.Vector(0,0)),c.set(this,{move:[]}),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,a,e),e.addEventListener("move",()=>l(this,o,"m",h).call(this,"move"))}get x(){return l(this,a,"f").x+l(this,u,"f").x}set x(t){l(this,u,"f").x=t-l(this,a,"f").x,l(this,o,"m",h).call(this,"move")}get y(){return l(this,a,"f").y+l(this,u,"f").y}set y(t){l(this,u,"f").y=t-l(this,a,"f").y,l(this,o,"m",h).call(this,"move")}addEventListener(t,e){l(this,c,"f")[t].push(e)}removeEventListener(t,e){l(this,c,"f")[t]=l(this,c,"f")[t].filter(t=>t!==e)}}a=new WeakMap,u=new WeakMap,c=new WeakMap,o=new WeakSet,h=function(t){l(this,c,"f")[t].forEach(t=>t())};var f=r(986);function m(t,e){return new i((0,f.average)([t.x,e.x]),(0,f.average)([t.y,e.y]))}})(),n})(),t.exports=e()},725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()},277(t){var e;e=()=>(()=>{var t={854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),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,{Vector:()=>e,isFiniteVectorLike:()=>s,isVectorLike:()=>i});var t=r(854);class e{static matching(t){let r="x"in t?t.x:t.magnitude*Math.cos(t.direction),n="y"in t?t.y:t.magnitude*Math.sin(t.direction);return new e(r,n)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}isFinite(){return(0,t.isFiniteNumber)(this.x)&&(0,t.isFiniteNumber)(this.y)}}function i(e){return!(!(0,t.isNonNullObject)(e)||!((0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)||(0,t.isNumber)(e.magnitude)&&(0,t.isNumber)(e.direction)))}function s(t){return!!i(t)&&e.matching(t).isFinite()}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{CurvedBond:()=>lt});var t=r(726);const e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let i;const s=new Uint8Array(16),o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));function a(t,e,r){const n=(t=t||{}).random??t.rng?.()??function(){if(!i){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");i=crypto.getRandomValues.bind(crypto)}return i(s)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[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]]).toLowerCase()}(n)}const u=" ";function c([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function h(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const l=Math.PI;function d(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:n,rY:i}=t;const{x:s,y:o}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+o)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*l,[u,h]=c([(e-s)/2,(r-o)/2],-a),d=Math.pow(u,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(i,2);1<d&&(n*=Math.sqrt(d),i*=Math.sqrt(d)),t.rX=n,t.rY=i;const f=Math.pow(n,2)*Math.pow(h,2)+Math.pow(i,2)*Math.pow(u,2),m=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-f)/f)),p=n*h/i*m,y=-i*u/n*m,g=c([p,y],a);t.cX=g[0]+(e+s)/2,t.cY=g[1]+(r+o)/2,t.phi1=Math.atan2((h-y)/i,(u-p)/n),t.phi2=Math.atan2((-h-y)/i,(-u-p)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*l),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*l),t.phi1*=180/l,t.phi2*=180/l}function f(t,e,r){h(t,e,r);const n=t*t+e*e-r*r;if(0>n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}const m=Math.PI/180;function p(t,e,r){return(1-r)*t+r*e}function y(t,e,r,n){return t+Math.cos(n/180*l)*e+Math.sin(n/180*l)*r}function g(t,e,r,n){const i=1e-6,s=e-t,o=r-e,a=3*s+3*(n-r)-6*o,u=6*(o-s),c=3*s;return Math.abs(a)<i?Math.abs(u)<i?[]:[-c/u]:function(t,e,r=1e-6){const n=t*t/4-e;if(n<-r)return[];if(n<=r)return[-t/2];const i=Math.sqrt(n);return[-t/2-i,-t/2+i]}(u/a,c/a,i)}function b(t,e,r,n,i){const s=1-i;return t*(s*s*s)+e*(3*s*s*i)+r*(3*s*i*i)+n*(i*i*i)}function v(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],s=r[0]-t[0],o=r[1]-t[1],a=n*o-i*s;if(!(Math.abs(a)<1e-10))return!1;const u=n*s+i*o,c=s*s+o*o;return 0<=u&&u<=c&&n*n+i*i<=c}function w(t){const e=t[t.length-1]?.type===C.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:C.MOVE_TO,relative:!1,x:t[r].x,y:t[r].y}];for(let e=r;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case C.HORIZ_LINE_TO:n.push({type:C.HORIZ_LINE_TO,relative:!1,x:i.x});break;case C.VERT_LINE_TO:n.push({type:C.VERT_LINE_TO,relative:!1,y:i.y});break;case C.LINE_TO:case C.MOVE_TO:n.push({type:C.LINE_TO,relative:!1,x:i.x,y:i.y});break;case C.CURVE_TO:n.push({type:C.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case C.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case C.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case C.ARC:throw new Error("Unsupported command: A (arc)");case C.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:C.CLOSE_PATH}),n}function x(){return S((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t))}function N(){let t=NaN,e=NaN,r=NaN,n=NaN;return S((i,s,o)=>(i.type&C.SMOOTH_CURVE_TO&&(i.type=C.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?o:e,i.x1=i.relative?s-t:2*s-t,i.y1=i.relative?o-e:2*o-e),i.type&C.CURVE_TO?(t=i.relative?s+i.x2:i.x2,e=i.relative?o+i.y2:i.y2):(t=NaN,e=NaN),i.type&C.SMOOTH_QUAD_TO&&(i.type=C.QUAD_TO,r=isNaN(r)?s:r,n=isNaN(n)?o:n,i.x1=i.relative?s-r:2*s-r,i.y1=i.relative?o-n:2*o-n),i.type&C.QUAD_TO?(r=i.relative?s+i.x1:i.x1,n=i.relative?o+i.y1:i.y1):(r=NaN,n=NaN),i))}function O(){let t=NaN,e=NaN;return S((r,n,i)=>{if(r.type&C.SMOOTH_QUAD_TO&&(r.type=C.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?i:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?i-e:2*i-e),r.type&C.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const s=r.x1,o=r.y1;r.type=C.CURVE_TO,r.x1=((r.relative?0:n)+2*s)/3,r.y1=((r.relative?0:i)+2*o)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*o)/3}else t=NaN,e=NaN;return r})}function S(t){let e=0,r=0,n=NaN,i=NaN;return function(s){if(isNaN(n)&&!(s.type&C.MOVE_TO))throw new Error("path must start with moveto");const o=t(s,e,r,n,i);return s.type&C.CLOSE_PATH&&(e=n,r=i),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&C.MOVE_TO&&(n=e,i=r),o}}function E(t,e,r,n,i,s){return h(t,e,r,n,i,s),S((o,a,u,c)=>{const h=o.x1,l=o.x2,d=o.relative&&!isNaN(c),f=void 0!==o.x?o.x:d?0:a,m=void 0!==o.y?o.y:d?0:u;function p(t){return t*t}o.type&C.HORIZ_LINE_TO&&0!==e&&(o.type=C.LINE_TO,o.y=o.relative?0:u),o.type&C.VERT_LINE_TO&&0!==r&&(o.type=C.LINE_TO,o.x=o.relative?0:a),void 0!==o.x&&(o.x=o.x*t+m*r+(d?0:i)),void 0!==o.y&&(o.y=f*e+o.y*n+(d?0:s)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*r+(d?0:i)),void 0!==o.y1&&(o.y1=h*e+o.y1*n+(d?0:s)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*r+(d?0:i)),void 0!==o.y2&&(o.y2=l*e+o.y2*n+(d?0:s));const y=t*n-e*r;if(void 0!==o.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===y)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=C.LINE_TO;else{const i=o.xRot*Math.PI/180,s=Math.sin(i),a=Math.cos(i),u=1/p(o.rX),c=1/p(o.rY),h=p(a)*u+p(s)*c,l=2*s*a*(u-c),d=p(s)*u+p(a)*c,f=h*n*n-l*e*n+d*e*e,m=l*(t*n+e*r)-2*(h*r*n+d*t*e),g=h*r*r-l*t*r+d*t*t,b=(Math.atan2(m,f-g)+Math.PI)%Math.PI/2,v=Math.sin(b),w=Math.cos(b);o.rX=Math.abs(y)/Math.sqrt(f*p(w)+m*v*w+g*p(v)),o.rY=Math.abs(y)/Math.sqrt(f*p(v)-m*v*w+g*p(w)),o.xRot=180*b/Math.PI}return void 0!==o.sweepFlag&&0>y&&(o.sweepFlag=+!o.sweepFlag),o})}const _={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return h(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:x,TO_REL:function(){return S((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,n=!0){return S((i,s,o,a,u)=>{if(isNaN(a)&&!(i.type&C.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&C.HORIZ_LINE_TO&&(i.type=C.LINE_TO,i.y=i.relative?0:o),r&&i.type&C.VERT_LINE_TO&&(i.type=C.LINE_TO,i.x=i.relative?0:s),t&&i.type&C.CLOSE_PATH&&(i.type=C.LINE_TO,i.x=i.relative?a-s:a,i.y=i.relative?u-o:u),i.type&C.ARC&&(0===i.rX||0===i.rY)&&(i.type=C.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&C.QUAD_TO&&v([s,o],i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],i.relative?[s+i.x,o+i.y]:[i.x,i.y])&&(i.type=C.LINE_TO,delete i.x1,delete i.y1),n&&i.type&C.CURVE_TO){const t=[s,o],e=i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],r=i.relative?[s+i.x2,o+i.y2]:[i.x2,i.y2],n=i.relative?[s+i.x,o+i.y]:[i.x,i.y];v(t,e,n)&&v(t,r,n)&&(i.type=C.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:N,QT_TO_C:O,INFO:S,SANITIZE:function(t=0){h(t);let e=NaN,r=NaN,n=NaN,i=NaN;return S((s,o,a,u,c)=>{const h=Math.abs;let l=!1,d=0,f=0;if(s.type&C.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:o-e,f=isNaN(r)?0:a-r),s.type&(C.CURVE_TO|C.SMOOTH_CURVE_TO)?(e=s.relative?o+s.x2:s.x2,r=s.relative?a+s.y2:s.y2):(e=NaN,r=NaN),s.type&C.SMOOTH_QUAD_TO?(n=isNaN(n)?o:2*o-n,i=isNaN(i)?a:2*a-i):s.type&C.QUAD_TO?(n=s.relative?o+s.x1:s.x1,i=s.relative?a+s.y1:s.y2):(n=NaN,i=NaN),s.type&C.LINE_COMMANDS||s.type&C.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&C.CURVE_TO||s.type&C.SMOOTH_CURVE_TO||s.type&C.QUAD_TO||s.type&C.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-o,r=void 0===s.y?0:s.relative?s.y:s.y-a;d=isNaN(n)?void 0===s.x1?d:s.relative?s.x:s.x1-o:n-o,f=isNaN(i)?void 0===s.y1?f:s.relative?s.y:s.y1-a:i-a;const u=void 0===s.x2?0:s.relative?s.x:s.x2-o,c=void 0===s.y2?0:s.relative?s.y:s.y2-a;h(e)<=t&&h(r)<=t&&h(d)<=t&&h(f)<=t&&h(u)<=t&&h(c)<=t&&(l=!0)}return s.type&C.CLOSE_PATH&&h(o-u)<=t&&h(a-c)<=t&&(l=!0),l?[]:s})},MATRIX:E,ROTATE:function(t,e=0,r=0){h(t,e,r);const n=Math.sin(t),i=Math.cos(t);return E(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},TRANSLATE:function(t,e=0){return h(t,e),E(1,0,0,1,t,e)},SCALE:function(t,e=t){return h(t,e),E(t,0,0,e,0,0)},SKEW_X:function(t){return h(t),E(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return h(t),E(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return h(t),E(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return h(t),E(1,0,0,-1,0,t)},A_TO_C:function(){return S((t,e,r)=>C.ARC===t.type?function(t,e,r){t.cX||d(t,e,r);const n=t.xRot/180*l;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:C.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const i=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-i,o=Math.ceil(s/90),a=new Array(o);let u=e,h=r;const f=(e,r)=>{const[i,s]=c([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+s]};for(let e=0;e<o;e++){const r=p(t.phi1,t.phi2,e/o),n=p(t.phi1,t.phi2,(e+1)/o),i=n-r,s=4/3*Math.tan(i*m/4),c=Math.cos(r*m)-s*Math.sin(r*m),l=Math.sin(r*m)+s*Math.cos(r*m),d=Math.cos(n*m),y=Math.sin(n*m),g=d+s*y,b=y-s*d,v=f(c,l),w=f(g,b),x=f(d,y),N={relative:t.relative,type:C.CURVE_TO,x:x[0],y:x[1],x1:v[0],y1:v[1],x2:w[0],y2:w[1]};t.relative&&(N.x1-=u,N.y1-=h,N.x2-=u,N.y2-=h,N.x-=u,N.y-=h),u=x[0],h=x[1],a[e]=N}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return S((t,e,r)=>(t.relative&&(e=0,r=0),C.ARC===t.type&&d(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=x(),e=O(),r=N(),n=S((i,s,o)=>{const a=r(e(t((t=>({...t}))(i))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(a.type&C.DRAWING_COMMANDS&&(u(s),c(o)),a.type&C.HORIZ_LINE_TO&&u(a.x),a.type&C.VERT_LINE_TO&&c(a.y),a.type&C.LINE_TO&&(u(a.x),c(a.y)),a.type&C.CURVE_TO){u(a.x),c(a.y);const t=g(s,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(b(s,a.x1,a.x2,a.x,e));const e=g(o,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(b(o,a.y1,a.y2,a.y,t))}if(a.type&C.ARC){u(a.x),c(a.y),d(a,s,o);const t=a.xRot/180*Math.PI,e=Math.cos(t)*a.rX,r=Math.sin(t)*a.rX,n=-Math.sin(t)*a.rY,i=Math.cos(t)*a.rY,[h,l]=a.phi1<a.phi2?[a.phi1,a.phi2]:-180>a.phi2?[a.phi2+360,a.phi1+360]:[a.phi2,a.phi1],m=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<h?r+360:r},p=f(n,-e,0).map(m);for(const t of p)t>h&&t<l&&u(y(a.cX,e,n,t));const g=f(i,-r,0).map(m);for(const t of g)t>h&&t<l&&c(y(a.cY,r,i,t))}return i});return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=_.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const s of t){const t=r(s);t.type===C.MOVE_TO&&i.length>0&&(e?n.push(...w(i)):n.unshift(...w(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...w(i)):n.unshift(...w(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(_.INFO((t,e,r)=>{const n="relative"in t&&t.relative;return["x"in t?t.x+(n?e:0):e,"y"in t?t.y+(n?r:0):r]}));let n=r[0];e.push(t[0]);for(let i=1;i<t.length;i++){const s=t[i],o=t[i+1];if(i<t.length-1&&o&&s.type&C.LINE_COMMANDS&&o.type&C.LINE_COMMANDS){const t=r[i+1];if(v(n,r[i],t)){"relative"in o&&o.relative&&("x"in o&&(o.x=t[0]-n[0]),"y"in o&&(o.y=t[1]-n[1]));continue}}e.push(s),n=r[i]}return e}};class M{round(t){return this.transform(_.ROUND(t))}toAbs(){return this.transform(_.TO_ABS())}toRel(){return this.transform(_.TO_REL())}normalizeHVZ(t,e,r){return this.transform(_.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(_.NORMALIZE_ST())}qtToC(){return this.transform(_.QT_TO_C())}aToC(){return this.transform(_.A_TO_C())}sanitize(t){return this.transform(_.SANITIZE(t))}translate(t,e){return this.transform(_.TRANSLATE(t,e))}scale(t,e){return this.transform(_.SCALE(t,e))}rotate(t,e,r){return this.transform(_.ROTATE(t,e,r))}matrix(t,e,r,n,i,s){return this.transform(_.MATRIX(t,e,r,n,i,s))}skewX(t){return this.transform(_.SKEW_X(t))}skewY(t){return this.transform(_.SKEW_Y(t))}xSymmetry(t){return this.transform(_.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(_.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(_.ANNOTATE_ARCS())}}const T=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,A=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class P extends M{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let n=0;n<t.length;n++){const i=t[n],s=!(this.curCommandType!==C.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=A(i)&&("0"===this.curNumber&&"0"===i||s);if(!A(i)||o)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${n}`);if(this.curCommandType===C.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${n}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${n}"`);this.curArgs.push(t),this.curArgs.length===j[this.curCommandType]&&(C.HORIZ_LINE_TO===this.curCommandType?r({type:C.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):C.VERT_LINE_TO===this.curCommandType?r({type:C.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===C.MOVE_TO||this.curCommandType===C.LINE_TO||this.curCommandType===C.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),C.MOVE_TO===this.curCommandType&&(this.curCommandType=C.LINE_TO)):this.curCommandType===C.CURVE_TO?r({type:C.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===C.SMOOTH_CURVE_TO?r({type:C.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.QUAD_TO?r({type:C.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.ARC&&r({type:C.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!T(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(o)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${n}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${i}" at index ${n}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=C.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=C.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=C.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=C.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=C.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=C.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=C.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=C.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=C.ARC,this.curCommandRelative="a"===i}else e.push({type:C.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const n=Object.getPrototypeOf(this).parse.call(this,e);for(const e of n){const n=t(e);Array.isArray(n)?r.push(...n):r.push(n)}return r}}})}}class C extends M{commands;constructor(t){super(),this.commands="string"==typeof t?C.parse(t):t}encode(){return C.encode(this.commands)}getBounds(){const t=_.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const n=t(r);Array.isArray(n)?e.push(...n):e.push(n)}return this.commands=e,this}reverse(t=!0){return this.commands=_.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=_.REMOVE_COLLINEAR(this.commands),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const n=t[r];if(n.type===C.CLOSE_PATH)e+="z";else if(n.type===C.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===C.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===C.MOVE_TO)e+=(n.relative?"m":"M")+n.x+u+n.y;else if(n.type===C.LINE_TO)e+=(n.relative?"l":"L")+n.x+u+n.y;else if(n.type===C.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+u+n.y1+u+n.x2+u+n.y2+u+n.x+u+n.y;else if(n.type===C.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+u+n.y2+u+n.x+u+n.y;else if(n.type===C.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+u+n.y1+u+n.x+u+n.y;else if(n.type===C.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+u+n.y;else{if(n.type!==C.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+u+n.rY+u+n.xRot+u+ +n.lArcFlag+u+ +n.sweepFlag+u+n.x+u+n.y}}return e}(t)}static parse(t){const e=new P,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=C.LINE_TO|C.HORIZ_LINE_TO|C.VERT_LINE_TO;static DRAWING_COMMANDS=C.HORIZ_LINE_TO|C.VERT_LINE_TO|C.LINE_TO|C.CURVE_TO|C.SMOOTH_CURVE_TO|C.QUAD_TO|C.SMOOTH_QUAD_TO|C.ARC}const j={[C.MOVE_TO]:2,[C.LINE_TO]:2,[C.HORIZ_LINE_TO]:1,[C.VERT_LINE_TO]:1,[C.CLOSE_PATH]:0,[C.QUAD_TO]:4,[C.SMOOTH_QUAD_TO]:2,[C.CURVE_TO]:6,[C.SMOOTH_CURVE_TO]:4,[C.ARC]:7};var I=r(456);class L{static matching(t){if(t.type!==C.MOVE_TO)throw new Error('SVG path definition command is not of type "M".');if(t.relative)throw new Error("The input SVG path definition command is a relative command.");let e=new I.FinitePoint(t.x,t.y);return new L(e)}constructor(t){this.startPoint=t}get endPoint(){return this.startPoint}toString(){return`M ${this.startPoint.x} ${this.startPoint.y}`}}class D extends I.FinitePoint{drag(t,e){t*=2,e*=2,super.drag(t,e)}}class R{static matching(t){if(t.type!==C.LINE_TO&&t.type!==C.QUAD_TO&&t.type!==C.CURVE_TO)throw new Error('Trailing segments can only be created for "L", "Q" and "C" SVG path definition commands.');if(t.relative)throw new Error("The input SVG path definition command is a relative command.");var e=[];t.type!==C.QUAD_TO&&t.type!==C.CURVE_TO||e.push(new D(t.x1,t.y1)),t.type===C.CURVE_TO&&e.push(new D(t.x2,t.y2));var r=new I.FinitePoint(t.x,t.y);return new R(e,r)}constructor(t,e){this.controlPoints=t,this.endPoint=e}toString(){if(this.controlPoints.length>2)throw new Error(`There can only be at most 2 control points: ${this.controlPoints.length} control points.`);return(0==this.controlPoints.length?"L":1==this.controlPoints.length?"Q":"C")+" "+this.controlPoints.map(t=>`${t.x} ${t.y}`).join(" ")+" "+`${this.endPoint.x} ${this.endPoint.y}`}}var V,F=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class k{constructor(t,e){this.startPoint=t,V.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,V,e)}get controlPoints(){return F(this,V,"f").controlPoints}get endPoint(){return F(this,V,"f").endPoint}closestPoint(e){return new t.AbstractPath(`M ${this.startPoint.x} ${this.startPoint.y} ${F(this,V,"f").toString()}`).closestPoint(e)}}V=new WeakMap;var B,U=r(725),X=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class Y{constructor(t){B.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,B,t)}closest(t){if(0==X(this,B,"f").length)throw new Error("This points collection is empty.");let e=[...X(this,B,"f")];return e.sort((e,r)=>(0,U.distance)(e,t)-(0,U.distance)(r,t)),e[0]}}B=new WeakMap;var z,H,G=r(106),$=r(854),W=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class q{static matching(t){let e=J.create();if(!(0,$.isString)(t))return e;try{let e=new C(t);e=e.toAbs();let r=L.matching(e.commands[0]),n=[R.matching(e.commands[1]),...e.commands.slice(2).map(t=>R.matching(t))];return new q(r,n)}catch{return e}}constructor(t,e){z.add(this),this.moveToSegment=t,this.trailingSegments=e}get segments(){return[this.moveToSegment,this.trailingSegments[0],...this.trailingSegments.slice(1)]}get definingPoints(){return{toArray:()=>[this.startPoint,...this.trailingSegments.flatMap(t=>[...t.controlPoints,t.endPoint])],anchored:()=>[this.startPoint.deepCopy(),...W(this,z,"a",H).flatMap(t=>[...t.controlPoints.map(e=>t.closestPoint(e)),t.endPoint.deepCopy()])]}}get startPoint(){return this.moveToSegment.startPoint}get interveningPoints(){return[...this.trailingSegments.slice(0,-1).flatMap(t=>[...t.controlPoints,t.endPoint]),...(0,G.last)(this.trailingSegments).controlPoints]}get controlPoints(){return this.trailingSegments.flatMap(t=>t.controlPoints)}get endPoint(){if(0==this.trailingSegments.length)throw new Error("This SVG path definition has no trailing segments.");return(0,G.last)(this.trailingSegments).endPoint}toString(){return this.segments.map(t=>t.toString()).join(" ")}drag(t,e,r){let n=new Y(this.definingPoints.toArray()).closest(r.dragPoint);this.controlPoints.includes(n)&&(t*=2,e*=2),n.displace({x:t,y:e})}}z=new WeakSet,H=function(){return[new k(this.startPoint,this.trailingSegments[0]),...(0,G.consecutivePairs)(this.trailingSegments).map(([t,e])=>new k(t.endPoint,e))]};const J={create:()=>{let t=new C("M 0 0 Q 0 0 0 0");if(t.commands.length<2)throw new Error("Unable to create default SVG path definition.");let e=L.matching(t.commands[0]),r=[R.matching(t.commands[1])];return new q(e,r)}};var Q=r(277);class K{static from(t){let e,r=new K(0,0);if(!(0,$.isString)(t))return r;try{e=JSON.parse(t)}catch{return r}return(0,Q.isVectorLike)(e)?K.matching(e):r}static matching(t){let e=Q.Vector.matching(t);return new K(e.magnitude,e.direction)}constructor(t,e){this.magnitude=t,this.direction=e}toJSON(){return JSON.stringify({magnitude:this.magnitude,direction:this.direction})}}var Z,tt,et,rt,nt,it,st,ot,at,ut,ct=r(986),ht=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class lt{static between(t,r){let n=t.domNode.getBBox().height,i=r.domNode.getBBox().height,s=document.createElementNS("http://www.w3.org/2000/svg","path");s.id="id-"+(e.randomUUID?e.randomUUID():a(void 0,void 0,void 0)),s.setAttribute("stroke","red"),s.setAttribute("stroke-width",""+.122*(0,ct.mean)([n,i])),s.setAttribute("stroke-opacity","1"),s.setAttribute("stroke-dasharray","3 1.5"),s.setAttribute("stroke-linecap",""),s.setAttribute("stroke-linejoin",""),s.setAttribute("fill","none");let o=(0,I.midpoint)(t.centerPoint,r.centerPoint);s.setAttribute("d",`M ${t.centerPoint.x} ${t.centerPoint.y} Q ${o.x} ${o.y} ${r.centerPoint.x} ${r.centerPoint.y}`);let u=new lt(s,t,r);u.basePadding1.magnitude=.591*n,u.basePadding2.magnitude=.591*i,u.basePadding1.direction=-Math.PI/8,u.basePadding2.direction=Math.PI/8;let c=q.matching(u.domNode.getAttribute("d"));return o=(0,I.midpoint)(c.startPoint,c.endPoint),c.trailingSegments[0].controlPoints[0]=I.FinitePoint.matching(o.displaced({magnitude:.2*(0,U.distance)(c.startPoint,c.endPoint),direction:(0,U.direction)(c.startPoint,c.endPoint)-Math.PI/2})),u.domNode.setAttribute("d",c.toString()),u}constructor(t,e,r){Z.add(this),this.domNode=t,this.base1=e,this.base2=r,tt.set(this,void 0),et.set(this,{change:[]}),t.dataset.basePadding1||t.dataset.basePadding2||ht(this,Z,"m",it).call(this),e.addEventListener("change",()=>ht(this,Z,"m",nt).call(this)),r.addEventListener("change",()=>ht(this,Z,"m",nt).call(this)),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,tt,new MutationObserver(()=>ht(this,Z,"m",rt).call(this,"change"))),ht(this,tt,"f").observe(t,{attributes:!0,subtree:!0})}get id(){return this.domNode.id}binds(t){return t===this.base1||t===this.base2}get basePadding1(){let t=()=>K.from(this.domNode.dataset.basePadding1),e=(t,e)=>{let r=new K(t,e);this.domNode.dataset.basePadding1=r.toJSON(),ht(this,Z,"m",nt).call(this)},r=()=>t().magnitude,n=()=>t().direction;return{get magnitude(){return r()},set magnitude(t){(t=>{e(t,n())})(t)},get direction(){return n()},set direction(t){(t=>{e(r(),t)})(t)}}}get basePadding2(){let t=()=>K.from(this.domNode.dataset.basePadding2),e=(t,e)=>{let r=new K(t,e);this.domNode.dataset.basePadding2=r.toJSON(),ht(this,Z,"m",nt).call(this)},r=()=>t().magnitude,n=()=>t().direction;return{get magnitude(){return r()},set magnitude(t){(t=>{e(t,n())})(t)},get direction(){return n()},set direction(t){(t=>{e(r(),t)})(t)}}}get length(){return this.domNode.getTotalLength()}atLength(t){let e=(t=(t=t<0?0:t)>this.length?this.length:t)-.005,r=t+.005;e=(0,ct.max)([e,0]),r=(0,ct.min)([r,this.length]);let n=I.Point.matching(this.domNode.getPointAtLength(e)),i=I.Point.matching(this.domNode.getPointAtLength(r)),s=(0,I.midpoint)(n,i),o=n.directionTo(i);return o=Number.isFinite(o)?o:0,{x:s.x,y:s.y,direction:o}}closestPoint(e){return new t.Path(this.domNode).closestPoint(e)}get definingPoints(){let t=q.matching(this.domNode.getAttribute("d"));return{toArray:()=>t.definingPoints.toArray(),closest:e=>new Y(t.definingPoints.toArray()).closest(e),anchored:()=>({closest:t=>{let e=q.matching(this.domNode.getAttribute("d")).definingPoints.anchored(),r=[...e].sort((e,r)=>(0,U.distance)(e,t)-(0,U.distance)(r,t)),n=e.indexOf(r[0]);return{drag:(t,e)=>{let r=q.matching(this.domNode.getAttribute("d")),i=r.definingPoints.toArray()[n];if(!i)throw new Error("The reference to the closest defining point was lost.");i.drag(t,e),this.domNode.setAttribute("d",r.toString()),ht(this,Z,"m",it).call(this)}}}})}}drag(t,e,r){var n;let i=null==r?void 0:r.dragGroup;if((null==i?void 0:i.has(this.base1.domNode))||(null==i?void 0:i.has(this.base2.domNode)))return;let s=null!==(n=null==r?void 0:r.dragPoint)&&void 0!==n?n:this.domNode.getPointAtLength(this.domNode.getTotalLength()/2),o=q.matching(this.domNode.getAttribute("d"));o.drag(t,e,{dragPoint:s}),this.domNode.setAttribute("d",o.toString()),ht(this,Z,"m",it).call(this)}addEventListener(t,e){ht(this,et,"f")[t].push(e)}removeEventListener(t,e){ht(this,et,"f")[t]=ht(this,et,"f")[t].filter(t=>t!==e)}remove(){this.domNode.remove()}serialized(){return{id:this.id,baseID1:this.base1.id,baseID2:this.base2.id}}static recreate(t,e){var r,n,i;if(!(0,$.isNonNullObject)(t))throw new Error(`Saved curved bond isn't an object: ${t}.`);let s=null!==(r=t.id)&&void 0!==r?r:t.pathId;if(!(0,$.isString)(s))throw new Error(`Saved curved bond ID isn't a string: ${s}.`);let o=null!==(n=t.baseID1)&&void 0!==n?n:t.baseId1,a=null!==(i=t.baseID2)&&void 0!==i?i:t.baseId2;if(!(0,$.isString)(o))throw new Error(`Saved curved bond base 1 ID isn't a string: ${o}.`);if(!(0,$.isString)(a))throw new Error(`Saved curved bond base 2 ID isn't a string: ${a}.`);let u=e.domNode.querySelector("#"+s);if(!u)throw new Error("Unable to find saved curved bond DOM node in parent drawing by ID.");if(!(u instanceof SVGPathElement))throw new Error(`Saved curved bond DOM node isn't an SVG path element: ${u}.`);let c=[...e.bases],h=c.find(t=>t.id===o),l=c.find(t=>t.id===a);if(!h)throw new Error("Unable to find base 1 in parent drawing.");if(!l)throw new Error("Unable to find base 2 in parent drawing.");return new lt(u,h,l)}}tt=new WeakMap,et=new WeakMap,Z=new WeakSet,rt=function(t){for(let e of ht(this,et,"f")[t])e()},nt=function(){let t=K.from(this.domNode.dataset.basePadding1),e=K.from(this.domNode.dataset.basePadding2);t=ht(this,Z,"m",st).call(this,t),e=ht(this,Z,"m",ot).call(this,e);let r=q.matching(this.domNode.getAttribute("d")),n=(0,I.midpoint)(r.startPoint,r.endPoint),i=r.interveningPoints.map(t=>[t,n.displacementTo(t)]);i.forEach(([t,e])=>e.direction-=(0,U.direction)(r.startPoint,r.endPoint)),r.startPoint.set(I.Point.matching(this.base1.centerPoint).displaced(t)),r.endPoint.set(I.Point.matching(this.base2.centerPoint).displaced(e)),n=(0,I.midpoint)(r.startPoint,r.endPoint),i.forEach(([t,e])=>e.direction+=(0,U.direction)(r.startPoint,r.endPoint)),i.forEach(([t,e])=>t.set(n.displaced(e))),this.domNode.setAttribute("d",r.toString())},it=function(){let t=q.matching(this.domNode.getAttribute("d")),e=K.matching(I.Point.matching(this.base1.centerPoint).displacementTo(t.startPoint)),r=K.matching(I.Point.matching(this.base2.centerPoint).displacementTo(t.endPoint));e=ht(this,Z,"m",at).call(this,e),r=ht(this,Z,"m",ut).call(this,r),this.domNode.dataset.basePadding1=e.toJSON(),this.domNode.dataset.basePadding2=r.toJSON()},st=function(t){let e=K.matching(t);return e.direction+=(0,U.direction)(this.base1.centerPoint,this.base2.centerPoint),e},ot=function(t){let e=K.matching(t);return e.direction+=(0,U.direction)(this.base2.centerPoint,this.base1.centerPoint),e},at=function(t){let e=K.matching(t);return e.direction-=(0,U.direction)(this.base1.centerPoint,this.base2.centerPoint),e},ut=function(t){let e=K.matching(t);return e.direction-=(0,U.direction)(this.base2.centerPoint,this.base1.centerPoint),e}})(),n})(),t.exports=e()},726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>Q,Circle:()=>u,CoordinateSystem:()=>ot,Ellipse:()=>c,ForeignObject:()=>H,HorizontalClientScaling:()=>ut,Image:()=>Y,InnerXML:()=>mt,Line:()=>a,OuterXML:()=>gt,Path:()=>X,Polygon:()=>p,Polyline:()=>m,Rect:()=>h,SVG:()=>t,Scaling:()=>at,Text:()=>o,Texts:()=>J,Use:()=>z,VerticalClientScaling:()=>ct,assignUUID:()=>st,bringToFront:()=>ht,drawOnCanvas:()=>xt,isSVGGraphicsElement:()=>bt,isSVGGraphicsElementsArray:()=>wt,sendToBack:()=>lt,setAttributes:()=>et,shift:()=>G});class t{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var e,i=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class s{constructor(t){e.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,e,t)}isEmpty(){return 0==i(this,e,"f").numberOfItems}shift(t){for(let r=0;r<i(this,e,"f").numberOfItems;r++)i(this,e,"f").getItem(r).value+=t}}e=new WeakMap;class o{constructor(t){this.domNode=t}shift(t,e){let r=new s(this.domNode.x.baseVal),n=new s(this.domNode.y.baseVal);r.shift(t),n.shift(e),r.isEmpty()&&this.domNode.setAttribute("x",`${t}`),n.isEmpty()&&this.domNode.setAttribute("y",`${e}`),this.domNode.querySelectorAll("tspan").forEach(r=>{new s(r.x.baseVal).shift(t),new s(r.y.baseVal).shift(e)})}}class a{constructor(t){this.domNode=t}shift(t,e){this.domNode.x1.baseVal.value+=t,this.domNode.y1.baseVal.value+=e,this.domNode.x2.baseVal.value+=t,this.domNode.y2.baseVal.value+=e}}class u{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class c{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class h{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var l,d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(t){l.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,l,t)}shift(t,e){for(let r=0;r<d(this,l,"f").numberOfItems;r++){let n=d(this,l,"f").getItem(r);n.x+=t,n.y+=e}}}l=new WeakMap;class m{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}class p{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}var y=r(725);const g=" ";function b([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function v(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const w=Math.PI;function x(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:n,rY:i}=t;const{x:s,y:o}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+o)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*w,[u,c]=b([(e-s)/2,(r-o)/2],-a),h=Math.pow(u,2)/Math.pow(n,2)+Math.pow(c,2)/Math.pow(i,2);1<h&&(n*=Math.sqrt(h),i*=Math.sqrt(h)),t.rX=n,t.rY=i;const l=Math.pow(n,2)*Math.pow(c,2)+Math.pow(i,2)*Math.pow(u,2),d=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-l)/l)),f=n*c/i*d,m=-i*u/n*d,p=b([f,m],a);t.cX=p[0]+(e+s)/2,t.cY=p[1]+(r+o)/2,t.phi1=Math.atan2((c-m)/i,(u-f)/n),t.phi2=Math.atan2((-c-m)/i,(-u-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*w),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*w),t.phi1*=180/w,t.phi2*=180/w}function N(t,e,r){v(t,e,r);const n=t*t+e*e-r*r;if(0>n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}const O=Math.PI/180;function S(t,e,r){return(1-r)*t+r*e}function E(t,e,r,n){return t+Math.cos(n/180*w)*e+Math.sin(n/180*w)*r}function _(t,e,r,n){const i=1e-6,s=e-t,o=r-e,a=3*s+3*(n-r)-6*o,u=6*(o-s),c=3*s;return Math.abs(a)<i?Math.abs(u)<i?[]:[-c/u]:function(t,e,r=1e-6){const n=t*t/4-e;if(n<-r)return[];if(n<=r)return[-t/2];const i=Math.sqrt(n);return[-t/2-i,-t/2+i]}(u/a,c/a,i)}function M(t,e,r,n,i){const s=1-i;return t*(s*s*s)+e*(3*s*s*i)+r*(3*s*i*i)+n*(i*i*i)}function T(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],s=r[0]-t[0],o=r[1]-t[1],a=n*o-i*s;if(!(Math.abs(a)<1e-10))return!1;const u=n*s+i*o,c=s*s+o*o;return 0<=u&&u<=c&&n*n+i*i<=c}function A(t){const e=t[t.length-1]?.type===B.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:B.MOVE_TO,relative:!1,x:t[r].x,y:t[r].y}];for(let e=r;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case B.HORIZ_LINE_TO:n.push({type:B.HORIZ_LINE_TO,relative:!1,x:i.x});break;case B.VERT_LINE_TO:n.push({type:B.VERT_LINE_TO,relative:!1,y:i.y});break;case B.LINE_TO:case B.MOVE_TO:n.push({type:B.LINE_TO,relative:!1,x:i.x,y:i.y});break;case B.CURVE_TO:n.push({type:B.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case B.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case B.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case B.ARC:throw new Error("Unsupported command: A (arc)");case B.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:B.CLOSE_PATH}),n}function P(){return I((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t))}function C(){let t=NaN,e=NaN,r=NaN,n=NaN;return I((i,s,o)=>(i.type&B.SMOOTH_CURVE_TO&&(i.type=B.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?o:e,i.x1=i.relative?s-t:2*s-t,i.y1=i.relative?o-e:2*o-e),i.type&B.CURVE_TO?(t=i.relative?s+i.x2:i.x2,e=i.relative?o+i.y2:i.y2):(t=NaN,e=NaN),i.type&B.SMOOTH_QUAD_TO&&(i.type=B.QUAD_TO,r=isNaN(r)?s:r,n=isNaN(n)?o:n,i.x1=i.relative?s-r:2*s-r,i.y1=i.relative?o-n:2*o-n),i.type&B.QUAD_TO?(r=i.relative?s+i.x1:i.x1,n=i.relative?o+i.y1:i.y1):(r=NaN,n=NaN),i))}function j(){let t=NaN,e=NaN;return I((r,n,i)=>{if(r.type&B.SMOOTH_QUAD_TO&&(r.type=B.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?i:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?i-e:2*i-e),r.type&B.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const s=r.x1,o=r.y1;r.type=B.CURVE_TO,r.x1=((r.relative?0:n)+2*s)/3,r.y1=((r.relative?0:i)+2*o)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*o)/3}else t=NaN,e=NaN;return r})}function I(t){let e=0,r=0,n=NaN,i=NaN;return function(s){if(isNaN(n)&&!(s.type&B.MOVE_TO))throw new Error("path must start with moveto");const o=t(s,e,r,n,i);return s.type&B.CLOSE_PATH&&(e=n,r=i),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&B.MOVE_TO&&(n=e,i=r),o}}function L(t,e,r,n,i,s){return v(t,e,r,n,i,s),I((o,a,u,c)=>{const h=o.x1,l=o.x2,d=o.relative&&!isNaN(c),f=void 0!==o.x?o.x:d?0:a,m=void 0!==o.y?o.y:d?0:u;function p(t){return t*t}o.type&B.HORIZ_LINE_TO&&0!==e&&(o.type=B.LINE_TO,o.y=o.relative?0:u),o.type&B.VERT_LINE_TO&&0!==r&&(o.type=B.LINE_TO,o.x=o.relative?0:a),void 0!==o.x&&(o.x=o.x*t+m*r+(d?0:i)),void 0!==o.y&&(o.y=f*e+o.y*n+(d?0:s)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*r+(d?0:i)),void 0!==o.y1&&(o.y1=h*e+o.y1*n+(d?0:s)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*r+(d?0:i)),void 0!==o.y2&&(o.y2=l*e+o.y2*n+(d?0:s));const y=t*n-e*r;if(void 0!==o.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===y)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=B.LINE_TO;else{const i=o.xRot*Math.PI/180,s=Math.sin(i),a=Math.cos(i),u=1/p(o.rX),c=1/p(o.rY),h=p(a)*u+p(s)*c,l=2*s*a*(u-c),d=p(s)*u+p(a)*c,f=h*n*n-l*e*n+d*e*e,m=l*(t*n+e*r)-2*(h*r*n+d*t*e),g=h*r*r-l*t*r+d*t*t,b=(Math.atan2(m,f-g)+Math.PI)%Math.PI/2,v=Math.sin(b),w=Math.cos(b);o.rX=Math.abs(y)/Math.sqrt(f*p(w)+m*v*w+g*p(v)),o.rY=Math.abs(y)/Math.sqrt(f*p(v)-m*v*w+g*p(w)),o.xRot=180*b/Math.PI}return void 0!==o.sweepFlag&&0>y&&(o.sweepFlag=+!o.sweepFlag),o})}const D={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return v(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:P,TO_REL:function(){return I((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,n=!0){return I((i,s,o,a,u)=>{if(isNaN(a)&&!(i.type&B.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&B.HORIZ_LINE_TO&&(i.type=B.LINE_TO,i.y=i.relative?0:o),r&&i.type&B.VERT_LINE_TO&&(i.type=B.LINE_TO,i.x=i.relative?0:s),t&&i.type&B.CLOSE_PATH&&(i.type=B.LINE_TO,i.x=i.relative?a-s:a,i.y=i.relative?u-o:u),i.type&B.ARC&&(0===i.rX||0===i.rY)&&(i.type=B.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&B.QUAD_TO&&T([s,o],i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],i.relative?[s+i.x,o+i.y]:[i.x,i.y])&&(i.type=B.LINE_TO,delete i.x1,delete i.y1),n&&i.type&B.CURVE_TO){const t=[s,o],e=i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],r=i.relative?[s+i.x2,o+i.y2]:[i.x2,i.y2],n=i.relative?[s+i.x,o+i.y]:[i.x,i.y];T(t,e,n)&&T(t,r,n)&&(i.type=B.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:C,QT_TO_C:j,INFO:I,SANITIZE:function(t=0){v(t);let e=NaN,r=NaN,n=NaN,i=NaN;return I((s,o,a,u,c)=>{const h=Math.abs;let l=!1,d=0,f=0;if(s.type&B.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:o-e,f=isNaN(r)?0:a-r),s.type&(B.CURVE_TO|B.SMOOTH_CURVE_TO)?(e=s.relative?o+s.x2:s.x2,r=s.relative?a+s.y2:s.y2):(e=NaN,r=NaN),s.type&B.SMOOTH_QUAD_TO?(n=isNaN(n)?o:2*o-n,i=isNaN(i)?a:2*a-i):s.type&B.QUAD_TO?(n=s.relative?o+s.x1:s.x1,i=s.relative?a+s.y1:s.y2):(n=NaN,i=NaN),s.type&B.LINE_COMMANDS||s.type&B.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&B.CURVE_TO||s.type&B.SMOOTH_CURVE_TO||s.type&B.QUAD_TO||s.type&B.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-o,r=void 0===s.y?0:s.relative?s.y:s.y-a;d=isNaN(n)?void 0===s.x1?d:s.relative?s.x:s.x1-o:n-o,f=isNaN(i)?void 0===s.y1?f:s.relative?s.y:s.y1-a:i-a;const u=void 0===s.x2?0:s.relative?s.x:s.x2-o,c=void 0===s.y2?0:s.relative?s.y:s.y2-a;h(e)<=t&&h(r)<=t&&h(d)<=t&&h(f)<=t&&h(u)<=t&&h(c)<=t&&(l=!0)}return s.type&B.CLOSE_PATH&&h(o-u)<=t&&h(a-c)<=t&&(l=!0),l?[]:s})},MATRIX:L,ROTATE:function(t,e=0,r=0){v(t,e,r);const n=Math.sin(t),i=Math.cos(t);return L(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},TRANSLATE:function(t,e=0){return v(t,e),L(1,0,0,1,t,e)},SCALE:function(t,e=t){return v(t,e),L(t,0,0,e,0,0)},SKEW_X:function(t){return v(t),L(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return v(t),L(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return v(t),L(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return v(t),L(1,0,0,-1,0,t)},A_TO_C:function(){return I((t,e,r)=>B.ARC===t.type?function(t,e,r){t.cX||x(t,e,r);const n=t.xRot/180*w;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:B.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const i=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-i,o=Math.ceil(s/90),a=new Array(o);let u=e,c=r;const h=(e,r)=>{const[i,s]=b([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+s]};for(let e=0;e<o;e++){const r=S(t.phi1,t.phi2,e/o),n=S(t.phi1,t.phi2,(e+1)/o),i=n-r,s=4/3*Math.tan(i*O/4),l=Math.cos(r*O)-s*Math.sin(r*O),d=Math.sin(r*O)+s*Math.cos(r*O),f=Math.cos(n*O),m=Math.sin(n*O),p=f+s*m,y=m-s*f,g=h(l,d),b=h(p,y),v=h(f,m),w={relative:t.relative,type:B.CURVE_TO,x:v[0],y:v[1],x1:g[0],y1:g[1],x2:b[0],y2:b[1]};t.relative&&(w.x1-=u,w.y1-=c,w.x2-=u,w.y2-=c,w.x-=u,w.y-=c),u=v[0],c=v[1],a[e]=w}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return I((t,e,r)=>(t.relative&&(e=0,r=0),B.ARC===t.type&&x(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=P(),e=j(),r=C(),n=I((i,s,o)=>{const a=r(e(t((t=>({...t}))(i))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(a.type&B.DRAWING_COMMANDS&&(u(s),c(o)),a.type&B.HORIZ_LINE_TO&&u(a.x),a.type&B.VERT_LINE_TO&&c(a.y),a.type&B.LINE_TO&&(u(a.x),c(a.y)),a.type&B.CURVE_TO){u(a.x),c(a.y);const t=_(s,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(M(s,a.x1,a.x2,a.x,e));const e=_(o,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(M(o,a.y1,a.y2,a.y,t))}if(a.type&B.ARC){u(a.x),c(a.y),x(a,s,o);const t=a.xRot/180*Math.PI,e=Math.cos(t)*a.rX,r=Math.sin(t)*a.rX,n=-Math.sin(t)*a.rY,i=Math.cos(t)*a.rY,[h,l]=a.phi1<a.phi2?[a.phi1,a.phi2]:-180>a.phi2?[a.phi2+360,a.phi1+360]:[a.phi2,a.phi1],d=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<h?r+360:r},f=N(n,-e,0).map(d);for(const t of f)t>h&&t<l&&u(E(a.cX,e,n,t));const m=N(i,-r,0).map(d);for(const t of m)t>h&&t<l&&c(E(a.cY,r,i,t))}return i});return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=D.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const s of t){const t=r(s);t.type===B.MOVE_TO&&i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(D.INFO((t,e,r)=>{const n="relative"in t&&t.relative;return["x"in t?t.x+(n?e:0):e,"y"in t?t.y+(n?r:0):r]}));let n=r[0];e.push(t[0]);for(let i=1;i<t.length;i++){const s=t[i],o=t[i+1];if(i<t.length-1&&o&&s.type&B.LINE_COMMANDS&&o.type&B.LINE_COMMANDS){const t=r[i+1];if(T(n,r[i],t)){"relative"in o&&o.relative&&("x"in o&&(o.x=t[0]-n[0]),"y"in o&&(o.y=t[1]-n[1]));continue}}e.push(s),n=r[i]}return e}};class R{round(t){return this.transform(D.ROUND(t))}toAbs(){return this.transform(D.TO_ABS())}toRel(){return this.transform(D.TO_REL())}normalizeHVZ(t,e,r){return this.transform(D.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(D.NORMALIZE_ST())}qtToC(){return this.transform(D.QT_TO_C())}aToC(){return this.transform(D.A_TO_C())}sanitize(t){return this.transform(D.SANITIZE(t))}translate(t,e){return this.transform(D.TRANSLATE(t,e))}scale(t,e){return this.transform(D.SCALE(t,e))}rotate(t,e,r){return this.transform(D.ROTATE(t,e,r))}matrix(t,e,r,n,i,s){return this.transform(D.MATRIX(t,e,r,n,i,s))}skewX(t){return this.transform(D.SKEW_X(t))}skewY(t){return this.transform(D.SKEW_Y(t))}xSymmetry(t){return this.transform(D.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(D.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(D.ANNOTATE_ARCS())}}const V=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,F=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class k extends R{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let n=0;n<t.length;n++){const i=t[n],s=!(this.curCommandType!==B.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=F(i)&&("0"===this.curNumber&&"0"===i||s);if(!F(i)||o)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${n}`);if(this.curCommandType===B.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${n}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${n}"`);this.curArgs.push(t),this.curArgs.length===U[this.curCommandType]&&(B.HORIZ_LINE_TO===this.curCommandType?r({type:B.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):B.VERT_LINE_TO===this.curCommandType?r({type:B.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===B.MOVE_TO||this.curCommandType===B.LINE_TO||this.curCommandType===B.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),B.MOVE_TO===this.curCommandType&&(this.curCommandType=B.LINE_TO)):this.curCommandType===B.CURVE_TO?r({type:B.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===B.SMOOTH_CURVE_TO?r({type:B.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.QUAD_TO?r({type:B.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.ARC&&r({type:B.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!V(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(o)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${n}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${i}" at index ${n}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=B.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=B.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=B.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=B.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=B.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=B.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=B.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=B.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=B.ARC,this.curCommandRelative="a"===i}else e.push({type:B.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const n=Object.getPrototypeOf(this).parse.call(this,e);for(const e of n){const n=t(e);Array.isArray(n)?r.push(...n):r.push(n)}return r}}})}}class B extends R{commands;constructor(t){super(),this.commands="string"==typeof t?B.parse(t):t}encode(){return B.encode(this.commands)}getBounds(){const t=D.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const n=t(r);Array.isArray(n)?e.push(...n):e.push(n)}return this.commands=e,this}reverse(t=!0){return this.commands=D.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=D.REMOVE_COLLINEAR(this.commands),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const n=t[r];if(n.type===B.CLOSE_PATH)e+="z";else if(n.type===B.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===B.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===B.MOVE_TO)e+=(n.relative?"m":"M")+n.x+g+n.y;else if(n.type===B.LINE_TO)e+=(n.relative?"l":"L")+n.x+g+n.y;else if(n.type===B.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+g+n.y1+g+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+g+n.y1+g+n.x+g+n.y;else if(n.type===B.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+g+n.y;else{if(n.type!==B.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+g+n.rY+g+n.xRot+g+ +n.lArcFlag+g+ +n.sweepFlag+g+n.x+g+n.y}}return e}(t)}static parse(t){const e=new k,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=B.LINE_TO|B.HORIZ_LINE_TO|B.VERT_LINE_TO;static DRAWING_COMMANDS=B.HORIZ_LINE_TO|B.VERT_LINE_TO|B.LINE_TO|B.CURVE_TO|B.SMOOTH_CURVE_TO|B.QUAD_TO|B.SMOOTH_QUAD_TO|B.ARC}const U={[B.MOVE_TO]:2,[B.LINE_TO]:2,[B.HORIZ_LINE_TO]:1,[B.VERT_LINE_TO]:1,[B.CLOSE_PATH]:0,[B.QUAD_TO]:4,[B.SMOOTH_QUAD_TO]:2,[B.CURVE_TO]:6,[B.SMOOTH_CURVE_TO]:4,[B.ARC]:7};class X{constructor(t){this.domNode=t}shift(t,e){var r;let n=null!==(r=this.domNode.getAttribute("d"))&&void 0!==r?r:"";this.domNode.setAttribute("d",new B(n).translate(t,e).encode())}closestPoint(t){let e=this.domNode.getTotalLength(),r=[];for(let n=0;n<=16;n++){let i=n/16*e;r.push([i,(0,y.distance)(t,this.domNode.getPointAtLength(i))])}r.sort((t,e)=>t[1]-e[1]);let n=r[0],i=n[0]-e/16,s=n[0]+e/16;i=Math.max(0,i),s=Math.min(e,s);for(let e=0;e<20;e++){let e=(s-i)/3;(0,y.distance)(t,this.domNode.getPointAtLength(i))<(0,y.distance)(t,this.domNode.getPointAtLength(s))?s-=e:i+=e}let o=(i+s)/2,a=this.domNode.getPointAtLength(o);return{x:a.x,y:a.y,length:o}}}class Y{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class z{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class H{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}function G(e,r){let{x:n,y:i}=r,s=e.tagName;if(!$.has(s))switch(s){case"g":Array.from(e.children).forEach(t=>G(t,r));break;case"svg":new t(e).shift(n,i);break;case"text":new o(e).shift(n,i);break;case"line":new a(e).shift(n,i);break;case"circle":new u(e).shift(n,i);break;case"ellipse":new c(e).shift(n,i);break;case"rect":new h(e).shift(n,i);break;case"polyline":new m(e).shift(n,i);break;case"polygon":new p(e).shift(n,i);break;case"path":new X(e).shift(n,i);break;case"image":new Y(e).shift(n,i);break;case"use":new z(e).shift(n,i);break;case"foreignObject":new H(e).shift(n,i);break;default:console.error(`Unrecognized SVG element type: "${s}".`)}}const $=new Set(["defs","title","desc","metadata","style","script","linearGradient","radialGradient","stop","clipPath","mask","marker","pattern","symbol","filter"]);var W,q;class J{constructor(t){W.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,W,t)}toArray(){return Array.from(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,W).querySelectorAll("text")).map(t=>({domNode:t}))}}W=new WeakMap;class Q{constructor(t){q.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,q,t)}closestPoint(t){return document.body.contains(Z)||document.body.append(Z),tt.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,q)),new X(tt).closestPoint(t)}}q=new WeakMap;const K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("viewBox","0 0 100 100"),K.setAttribute("width","100"),K.setAttribute("height","100");const Z=document.createElement("div");Z.append(K),Z.style.height="0px",Z.style.position="fixed",document.body.append(Z);const tt=document.createElementNS("http://www.w3.org/2000/svg","path");function et(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}tt.setAttribute("stroke","black"),tt.setAttribute("stroke-width","1"),K.append(tt);const rt=new Uint8Array(16),nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));const it=function(t,e,r){return e||t||!crypto.randomUUID?function(t,e,r){const n=(t=t||{}).random??t.rng?.()??crypto.getRandomValues(rt);if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return(nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]).toLowerCase()}(n)}(t,e,r):crypto.randomUUID()};function st(t){t.id="uuid-"+it()}class ot{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class at{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class ut{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class ct{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function ht(t){let e=t.parentNode;e&&e.appendChild(t)}function lt(t){let e=t.parentNode;e&&e.prepend(t)}var dt,ft=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class mt{constructor(t){dt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,dt,t)}toString(){return ft(this,dt,"f").innerHTML}set(t){ft(this,dt,"f").innerHTML=t}}dt=new WeakMap;var pt,yt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class gt{constructor(t){pt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,pt,t)}toString(){return yt(this,pt,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=yt(this,pt,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...yt(this,pt,"f").attributes].forEach(t=>yt(this,pt,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>yt(this,pt,"f").setAttribute(t.name,t.value)),yt(this,pt,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function bt(t){return t instanceof SVGGraphicsElement}pt=new WeakMap;var vt=r(854);function wt(t){return(0,vt.isArray)(t)&&t.every(bt)}async function xt(t){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),await i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e}})(),n})(),t.exports=e()},725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{CurvedBond:()=>bi.CurvedBond,InvertedStraightBondsHider:()=>Ni,MissingPrimaryBondsAdder:()=>xi,StraightBond:()=>fi});var t=Object.create,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,u=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),c=(t,r)=>{let n={};for(var i in t)e(n,i,{get:t[i],enumerable:!0});return r||e(n,Symbol.toStringTag,{value:"Module"}),n};const h={},l=[];function d(t,e){if(Array.isArray(t))for(const r of t)d(r,e);else if("object"!=typeof t)m(Object.getOwnPropertyNames(e)),h[t]=Object.assign(h[t]||{},e);else for(const e in t)d(e,t[e])}function f(t){return h[t]||{}}function m(t){l.push(...t)}var p=u((t,e)=>{e.exports=function(t){try{return!!t()}catch(t){return!0}}}),y=u((t,e)=>{var r=p();e.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}),g=u((t,e)=>{var r=y(),n=Function.prototype,i=n.call,s=r&&n.bind.bind(i,i);e.exports=r?s:function(t){return function(){return i.apply(t,arguments)}}}),b=u((t,e)=>{var r=g();e.exports=r({}.isPrototypeOf)}),v=u((t,e)=>{var n=function(t){return t&&t.Math===Math&&t};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}),w=u((t,e)=>{var r=y(),n=Function.prototype,i=n.apply,s=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})}),x=u((t,e)=>{var r=g(),n=r({}.toString),i=r("".slice);e.exports=function(t){return i(n(t),8,-1)}}),N=u((t,e)=>{var r=x(),n=g();e.exports=function(t){if("Function"===r(t))return n(t)}}),O=u((t,e)=>{var r="object"==typeof document&&document.all;e.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}}),S=u((t,e)=>{var r=p();e.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),E=u((t,e)=>{var r=y(),n=Function.prototype.call;e.exports=r?n.bind(n):function(){return n.apply(n,arguments)}}),_=u(t=>{var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!e.call({1:2},1);t.f=n?function(t){var e=r(this,t);return!!e&&e.enumerable}:e}),M=u((t,e)=>{e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}}),T=u((t,e)=>{var r=g(),n=p(),i=x(),s=Object,o=r("".split);e.exports=n(function(){return!s("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?o(t,""):s(t)}:s}),A=u((t,e)=>{e.exports=function(t){return null==t}}),P=u((t,e)=>{var r=A(),n=TypeError;e.exports=function(t){if(r(t))throw new n("Can't call method on "+t);return t}}),C=u((t,e)=>{var r=T(),n=P();e.exports=function(t){return r(n(t))}}),j=u((t,e)=>{var r=O();e.exports=function(t){return"object"==typeof t?null!==t:r(t)}}),I=u((t,e)=>{e.exports={}}),L=u((t,e)=>{var r=I(),n=v(),i=O(),s=function(t){return i(t)?t:void 0};e.exports=function(t,e){return arguments.length<2?s(r[t])||s(n[t]):r[t]&&r[t][e]||n[t]&&n[t][e]}}),D=u((t,e)=>{var r=v().navigator,n=r&&r.userAgent;e.exports=n?String(n):""}),R=u((t,e)=>{var r,n,i=v(),s=D(),o=i.process,a=i.Deno,u=o&&o.versions||a&&a.version,c=u&&u.v8;c&&(n=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(n=+r[1]),e.exports=n}),V=u((t,e)=>{var r=R(),n=p(),i=v().String;e.exports=!!Object.getOwnPropertySymbols&&!n(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41})}),F=u((t,e)=>{var r=V();e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),k=u((t,e)=>{var r=L(),n=O(),i=b(),s=F(),o=Object;e.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return n(e)&&i(e.prototype,o(t))}}),B=u((t,e)=>{var r=String;e.exports=function(t){try{return r(t)}catch(t){return"Object"}}}),U=u((t,e)=>{var r=O(),n=B(),i=TypeError;e.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not a function")}}),X=u((t,e)=>{var r=U(),n=A();e.exports=function(t,e){var i=t[e];return n(i)?void 0:r(i)}}),Y=u((t,e)=>{var r=E(),n=O(),i=j(),s=TypeError;e.exports=function(t,e){var o,a;if("string"===e&&n(o=t.toString)&&!i(a=r(o,t)))return a;if(n(o=t.valueOf)&&!i(a=r(o,t)))return a;if("string"!==e&&n(o=t.toString)&&!i(a=r(o,t)))return a;throw new s("Can't convert object to primitive value")}}),z=u((t,e)=>{e.exports=!0}),H=u((t,e)=>{var r=v(),n=Object.defineProperty;e.exports=function(t,e){try{n(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}}),G=u((t,e)=>{var r=z(),n=v(),i=H(),s="__core-js_shared__",o=e.exports=n[s]||i(s,{});(o.versions||(o.versions=[])).push({version:"3.49.0",mode:r?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),$=u((t,e)=>{var r=G();e.exports=function(t,e){return r[t]||(r[t]=e||{})}}),W=u((t,e)=>{var r=P(),n=Object;e.exports=function(t){return n(r(t))}}),q=u((t,e)=>{var r=g(),n=W(),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(t,e){return i(n(t),e)}}),J=u((t,e)=>{var r=g(),n=0,i=Math.random(),s=r(1.1.toString);e.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++n+i,36)}}),Q=u((t,e)=>{var r=v(),n=$(),i=q(),s=J(),o=V(),a=F(),u=r.Symbol,c=n("wks"),h=a?u.for||u:u&&u.withoutSetter||s;e.exports=function(t){return i(c,t)||(c[t]=o&&i(u,t)?u[t]:h("Symbol."+t)),c[t]}}),K=u((t,e)=>{var r=E(),n=j(),i=k(),s=X(),o=Y(),a=Q(),u=TypeError,c=a("toPrimitive");e.exports=function(t,e){if(!n(t)||i(t))return t;var a,h=s(t,c);if(h){if(void 0===e&&(e="default"),a=r(h,t,e),!n(a)||i(a))return a;throw new u("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}}),Z=u((t,e)=>{var r=K(),n=k();e.exports=function(t){var e=r(t,"string");return n(e)?e:e+""}}),tt=u((t,e)=>{var r=v(),n=j(),i=r.document,s=n(i)&&n(i.createElement);e.exports=function(t){return s?i.createElement(t):{}}}),et=u((t,e)=>{var r=S(),n=p(),i=tt();e.exports=!r&&!n(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}),rt=u(t=>{var e=S(),r=E(),n=_(),i=M(),s=C(),o=Z(),a=q(),u=et(),c=Object.getOwnPropertyDescriptor;t.f=e?c:function(t,e){if(t=s(t),e=o(e),u)try{return c(t,e)}catch(t){}if(a(t,e))return i(!r(n.f,t,e),t[e])}}),nt=u((t,e)=>{var r=p(),n=O(),i=/#|\.prototype\./,s=function(t,e){var i=a[o(t)];return i===c||i!==u&&(n(e)?r(e):!!e)},o=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",c=s.POLYFILL="P";e.exports=s}),it=u((t,e)=>{var r=N(),n=U(),i=y(),s=r(r.bind);e.exports=function(t,e){return n(t),void 0===e?t:i?s(t,e):function(){return t.apply(e,arguments)}}}),st=u((t,e)=>{var r=S(),n=p();e.exports=r&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),ot=u((t,e)=>{var r=j(),n=String,i=TypeError;e.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not an object")}}),at=u(t=>{var e=S(),r=et(),n=st(),i=ot(),s=Z(),o=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c="enumerable",h="configurable",l="writable";t.f=e?n?function(t,e,r){if(i(t),e=s(e),i(r),"function"==typeof t&&"prototype"===e&&"value"in r&&l in r&&!r[l]){var n=u(t,e);n&&n[l]&&(t[e]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:c in r?r[c]:n[c],writable:!1})}return a(t,e,r)}:a:function(t,e,n){if(i(t),e=s(e),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new o("Accessors not supported");return"value"in n&&(t[e]=n.value),t}}),ut=u((t,e)=>{var r=S(),n=at(),i=M();e.exports=r?function(t,e,r){return n.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}}),ct=u((t,e)=>{var r=v(),n=w(),i=N(),s=O(),o=rt().f,a=nt(),u=I(),c=it(),h=ut(),l=q();G();var d=function(t){var e=function(r,i,s){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,i)}return new t(r,i,s)}return n(t,this,arguments)};return e.prototype=t.prototype,e};e.exports=function(t,e){var n,f,m,p,y,g,b,v,w,x=t.target,N=t.global,O=t.stat,S=t.proto,E=N?r:O?r[x]:r[x]&&r[x].prototype,_=N?u:u[x]||h(u,x,{})[x],M=_.prototype;for(p in e)f=!(n=a(N?p:x+(O?".":"#")+p,t.forced))&&E&&l(E,p),g=_[p],f&&(b=t.dontCallGetSet?(w=o(E,p))&&w.value:E[p]),y=f&&b?b:e[p],(n||S||typeof g!=typeof y)&&(v=t.bind&&f?c(y,r):t.wrap&&f?d(y):S&&s(y)?i(y):y,(t.sham||y&&y.sham||g&&g.sham)&&h(v,"sham",!0),h(_,p,v),S&&(l(u,m=x+"Prototype")||h(u,m,{}),h(u[m],p,y),t.real&&M&&(n||!M[p])&&h(M,p,y)))}}),ht=u((t,e)=>{var r=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}}),lt=u((t,e)=>{var r=ht();e.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}}),dt=u((t,e)=>{var r=lt(),n=Math.max,i=Math.min;e.exports=function(t,e){var s=r(t);return s<0?n(s+e,0):i(s,e)}}),ft=u((t,e)=>{var r=lt(),n=Math.min;e.exports=function(t){var e=r(t);return e>0?n(e,9007199254740991):0}}),mt=u((t,e)=>{var r=ft();e.exports=function(t){return r(t.length)}}),pt=u((t,e)=>{var r=C(),n=dt(),i=mt(),s=function(t){return function(e,s,o){var a=r(e),u=i(a);if(0===u)return!t&&-1;var c,h=n(o,u);if(t&&s!=s){for(;u>h;)if((c=a[h++])!=c)return!0}else for(;u>h;h++)if((t||h in a)&&a[h]===s)return t||h||0;return!t&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}}),yt=u((t,e)=>{e.exports=function(){}}),gt=u(()=>{var t=ct(),e=pt().includes,r=p(),n=yt(),i=r(function(){return!Array(1).includes()}),s=r(function(){return[,1].includes(void 0,1)});t({target:"Array",proto:!0,forced:i||s},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),n("includes")}),bt=u((t,e)=>{var r=v(),n=I();e.exports=function(t,e){var i=n[t+"Prototype"],s=i&&i[e];if(s)return s;var o=r[t],a=o&&o.prototype;return a&&a[e]}}),vt=u((t,e)=>{gt();var r=bt();e.exports=r("Array","includes")}),wt=u((t,e)=>{var r=j(),n=x(),i=Q()("match");e.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"===n(t))}}),xt=u((t,e)=>{var r=wt(),n=TypeError;e.exports=function(t){if(r(t))throw new n("The method doesn't accept regular expressions");return t}}),Nt=u((t,e)=>{var r={};r[Q()("toStringTag")]="z",e.exports="[object z]"===String(r)}),Ot=u((t,e)=>{var r=Nt(),n=O(),i=x(),s=Q()("toStringTag"),o=Object,a="Arguments"===i(function(){return arguments}());e.exports=r?i:function(t){var e,r,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=o(t),s))?r:a?i(e):"Object"===(u=i(e))&&n(e.callee)?"Arguments":u}}),St=u((t,e)=>{var r=Ot(),n=String;e.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}}),Et=u((t,e)=>{var r=Q()("match");e.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(t){}}return!1}}),_t=u(()=>{var t=ct(),e=g(),r=xt(),n=P(),i=St(),s=Et(),o=e("".indexOf);t({target:"String",proto:!0,forced:!s("includes")},{includes:function(t){return!!~o(i(n(this)),i(r(t)),arguments.length>1?arguments[1]:void 0)}})}),Mt=u((t,e)=>{_t();var r=bt();e.exports=r("String","includes")}),Tt=u((t,e)=>{var r=b(),n=vt(),i=Mt(),s=Array.prototype,o=String.prototype;e.exports=function(t){var e=t.includes;return t===s||r(s,t)&&e===s.includes?n:"string"==typeof t||t===o||r(o,t)&&e===o.includes?i:e}}),At=((r,n,u)=>(u=null!=r?t(o(r)):{},((t,r,n,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(var u,c=s(r),h=0,l=c.length;h<l;h++)u=c[h],a.call(t,u)||void 0===u||e(t,u,{get:(t=>r[t]).bind(null,u),enumerable:!(o=i(r,u))||o.enumerable});return t})(e(u,"default",{value:r,enumerable:!0}),r)))(u((t,e)=>{var r=Tt();e.exports=r})());function Pt(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function Ct(t){return t%360*Math.PI/180}function jt(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})}function It(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Lt(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 Dt(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=(0,At.default)(n).call(n,"left")?a:(0,At.default)(n).call(n,"right")?a+r:a+r/2),o&&(i=(0,At.default)(i).call(i,"top")?u:(0,At.default)(i).call(i,"bottom")?u+t:u+t/2)}return[n,i]}const Rt=new Set(["desc","metadata","title"]),Vt=t=>Rt.has(t.nodeName),Ft="http://www.w3.org/2000/svg",kt="http://www.w3.org/2000/xmlns/",Bt="http://www.w3.org/1999/xlink",Ut={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};var Xt=class{};const Yt={},zt="___SYMBOL___ROOT___";function Ht(t,e=Ft){return Ut.document.createElementNS(e,t)}function Gt(t,e=!1){if(t instanceof Xt)return t;if("object"==typeof t)return qt(t);if(null==t)return new Yt[zt];if("string"==typeof t&&"<"!==t.trim().charAt(0))return qt(Ut.document.querySelector(t));const r=e?Ut.document.createElement("div"):Ht("svg");return r.innerHTML=t.trim(),t=qt(r.firstElementChild),r.removeChild(r.firstElementChild),t}function $t(t,e){return e&&(e instanceof Ut.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:Ht(t)}function Wt(t){if(!t)return null;if(t.instance instanceof Xt)return t.instance;if("#document-fragment"===t.nodeName)return new Yt.Fragment(t);let e=It(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Yt[e]||(e="Dom"),new Yt[e](t)}let qt=Wt;function Jt(t,e=t.name,r=!1){return Yt[e]=t,r&&(Yt[zt]=t),m(Object.getOwnPropertyNames(t.prototype)),t}let Qt=1e3;function Kt(t){return"Svgjs"+It(t)+Qt++}function Zt(t){for(let e=t.children.length-1;e>=0;e--)Zt(t.children[e]);return t.id?(t.id=Kt(t.nodeName),t):t}function te(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 ee(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)}}d("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=Gt(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=Gt(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=Gt(t)).before(this),this},insertAfter:function(t){return(t=Gt(t)).after(this),this}});const re=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,ne=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ie=/rgb\((\d+),(\d+),(\d+)\)/,se=/^(#[^\s]+)$/,oe=/\)\s*,?\s*/,ae=/\s/g,ue=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,ce=/^rgb\(/,he=/^(\s+)?$/,le=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,de=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,fe=/[\s,]+/,me=/[MLHVCSQTAZ]/i;d("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(fe)},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)}});const pe=t=>t.startsWith("--")?t:jt(t);function ye(t){const e=Math.max(0,Math.min(255,Math.round(t))).toString(16);return 1===e.length?"0"+e:e}function ge(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function be(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}d("Dom",{css:function(t,e){const r={};if(0===arguments.length){const t=this.node.style;for(let e=0;e<t.length;e++){const n=t.item(e),i=t.getPropertyValue(n),s=t.getPropertyPriority(n);r[n]=s?`${i} !${s}`:i}return r}if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=pe(e);r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(pe(t));if("object"==typeof t)for(const e in t)this.node.style.setProperty(pe(e),null==t[e]||he.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(pe(t),null==e||he.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),d("Dom",{data:function(t,e,r){if(null==t)return this.data(Pt(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}}),d("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||{}}});var ve=class t{constructor(...t){this.init(...t)}static isColor(e){return e&&(e instanceof t||this.isRgb(e)||this.test(e))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(e="vibrant",r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===e){const e=24*n()+57,r=38*n()+45,i=360*n();return new t(e,r,i,"lch")}if("sine"===e){const e=i(80*s(2*o*(r=r??n())/.5+.01)+150),a=i(50*s(2*o*r/.5+4.6)+200),u=i(100*s(2*o*r/.5+2.3)+150);return new t(e,a,u)}if("pastel"===e){const e=8*n()+86,r=17*n()+9,i=360*n();return new t(e,r,i,"lch")}if("dark"===e){const e=10+10*n(),r=50*n()+86,i=360*n();return new t(e,r,i,"lch")}if("rgb"===e){const e=255*n(),r=255*n(),i=255*n();return new t(e,r,i)}if("lab"===e){const e=100*n(),r=256*n()-128,i=256*n()-128;return new t(e,r,i,"lab")}if("grey"===e){const e=255*n();return new t(e,e,e)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(ue.test(t)||ce.test(t))}cmyk(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),a=Math.min(1-i,1-s,1-o);return 1===a?new t(0,0,0,1,"cmyk"):new t((1-i-a)/(1-a),(1-s-a)/(1-a),(1-o-a)/(1-a),a,"cmyk")}hsl(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),a=Math.max(i,s,o),u=Math.min(i,s,o),c=(a+u)/2,h=a===u,l=a-u;return new t(360*(h?0:a===i?((s-o)/l+(s<o?6:0))/6:a===s?((o-i)/l+2)/6:a===o?((i-s)/l+4)/6:0),100*(h?0:c>.5?l/(2-a-u):l/(a+u)),100*c,"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=ge(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:ge(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:ge(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:ge(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:ge(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:ge(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(ce.test(t)){const e=t.replace(ae,""),[r,n,i]=ie.exec(e).slice(1,4).map(t=>parseInt(t));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!ue.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=ne.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,c="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,c)}lab(){const{x:e,y:r,z:n}=this.xyz();return new t(116*r-16,500*(e-r),200*(r-n),"lab")}lch(){const{l:e,a:r,b:n}=this.lab(),i=Math.sqrt(r**2+n**2);let s=180*Math.atan2(n,r)/Math.PI;return s<0&&(s*=-1,s=360-s),new t(e,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:r,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:t,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=(t+16)/116,a=i/500+o,u=o-s/200,c=16/116,h=.008856,l=7.787;e=.95047*(a**3>h?a**3:(a-c)/l),r=1*(o**3>h?o**3:(o-c)/l),n=1.08883*(u**3>h?u**3:(u-c)/l)}const i=3.2406*e+-1.5372*r+-.4986*n,s=-.9689*e+1.8758*r+.0415*n,o=.0557*e+-.204*r+1.057*n,a=Math.pow,u=.0031308,c=i>u?1.055*a(i,1/2.4)-.055:12.92*i,h=s>u?1.055*a(s,1/2.4)-.055:12.92*s,l=o>u?1.055*a(o,1/2.4)-.055:12.92*o;return new t(255*c,255*h,255*l)}if("hsl"===this.space){let{h:e,s:r,l:n}=this;if(e/=360,r/=100,n/=100,0===r)return n*=255,new t(n,n,n);const i=n<.5?n*(1+r):n+r-n*r,s=2*n-i,o=255*be(s,i,e+1/3),a=255*be(s,i,e),u=255*be(s,i,e-1/3);return new t(o,a,u)}if("cmyk"===this.space){const{c:e,m:r,y:n,k:i}=this,s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,r*(1-i)+i)),a=255*(1-Math.min(1,n*(1-i)+i));return new t(s,o,a)}return this;var e}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(ye);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),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,c=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,h=(.4124*a+.3576*u+.1805*c)/.95047,l=(.2126*a+.7152*u+.0722*c)/1,d=(.0193*a+.1192*u+.9505*c)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=d>.008856?Math.pow(d,1/3):7.787*d+16/116;return new t(f,m,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)))}},we=class t{constructor(...t){this.init(...t)}clone(){return new t(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=r.x??0,this.y=r.y??0,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Ne.isMatrixLike(t)||(t=new Ne(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 xe(t,e,r){return Math.abs(e-t)<(r||1e-6)}var Ne=class t{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,c=t.rotate||t.theta||0,h=new we(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=h.x,d=h.y,f=new we(t.position??t.px??t.positionX??NaN,t.py??t.positionY??NaN),m=f.x,p=f.y,y=new we(t.translate||t.tx||t.translateX,t.ty||t.translateY),g=y.x,b=y.y,v=new we(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:c,rx:v.x,ry:v.y,tx:g,ty:b,ox:l,oy:d,px:m,py:p}}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 t(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,c=u>0?1:-1,h=c*Math.sqrt(r*r+n*n),l=Math.atan2(c*n,c*r),d=(r*i+n*s)/u;return{scaleX:h,scaleY:i*h/(d*r-n)||s*h/(d*n+r),shear:d,rotate:180/Math.PI*l,translateX:o-t+t*r+e*i,translateY:a-e+t*n+e*s,originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const r=new t(e);return xe(this.a,r.a)&&xe(this.b,r.b)&&xe(this.c,r.c)&&xe(this.d,r.d)&&xe(this.e,r.e)&&xe(this.f,r.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(e){const r=t.fromArray([1,0,0,1,0,0]);return e=e instanceof We?e.matrixify():"string"==typeof e?t.fromArray(e.split(fe).map(parseFloat)):Array.isArray(e)?t.fromArray(e):"object"==typeof e&&t.isMatrixLike(e)?e:"object"==typeof e?(new t).transform(e):6===arguments.length?t.fromArray([].slice.call(arguments)):r,this.a=null!=e.a?e.a:r.a,this.b=null!=e.b?e.b:r.b,this.c=null!=e.c?e.c:r.c,this.d=null!=e.d?e.d:r.d,this.e=null!=e.e?e.e:r.e,this.f=null!=e.f?e.f:r.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,c=-r/o,h=t/o,l=-(a*i+c*s),d=-(u*i+h*s);return this.a=a,this.b=u,this.c=c,this.d=h,this.e=l,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(e){const r=e instanceof t?e:new t(e);return t.matrixMultiply(r,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(e){const r=e instanceof t?e:new t(e);return t.matrixMultiply(this,r,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=Ct(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:c,f:h}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=c*n-h*i+r*i-e*n+e,this.f=h*n+c*i-e*i-r*n+r,this}scale(){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:c}=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=c*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(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=Ct(t),e=Ct(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:c,e:h,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+c*i,this.d=c+u*s,this.e=h+l*i-n*i,this.f=l+h*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(e){if(t.isMatrixLike(e))return new t(e).multiplyO(this);const r=t.formatTransforms(e),{x:n,y:i}=new we(r.ox,r.oy).transform(this),s=(new t).translateO(r.rx,r.ry).lmultiplyO(this).translateO(-n,-i).scaleO(r.scaleX,r.scaleY).skewO(r.skewX,r.skewY).shearO(r.shear).rotateO(r.theta).translateO(n,i);if(isFinite(r.px)||isFinite(r.py)){const t=new we(n,i).transform(s),e=isFinite(r.px)?r.px-t.x:0,o=isFinite(r.py)?r.py-t.y:0;s.translateO(e,o)}return s.translateO(r.tx,r.ty),s}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 Oe(){if(!Oe.nodes||Oe.nodes.svg.node.ownerDocument!==Ut.document){const t=Gt().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"),Oe.nodes={svg:t,path:t.path().node}}return Oe.nodes.svg.node.parentNode||Oe.nodes.svg.addTo(Ut.document.body||Ut.document.documentElement),Oe.nodes}function Se(t){return!(t.width||t.height||t.x||t.y)}Jt(Ne,"Matrix");var Ee=class t{constructor(...t){this.init(...t)}addOffset(){return this.x+=Ut.window.pageXOffset,this.y+=Ut.window.pageYOffset,new t(this)}init(t){return t="string"==typeof t?t.split(fe).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 Se(this)}merge(e){const r=Math.min(this.x,e.x),n=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-r,s=Math.max(this.y+this.height,e.y+e.height)-n;return new t(r,n,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof Ne||(e=new Ne(e));let r=1/0,n=-1/0,i=1/0,s=-1/0;return[new we(this.x,this.y),new we(this.x2,this.y),new we(this.x,this.y2),new we(this.x2,this.y2)].forEach(function(t){t=t.transform(e),r=Math.min(r,t.x),n=Math.max(n,t.x),i=Math.min(i,t.y),s=Math.max(s,t.y)}),new t(r,i,n-r,s-i)}};function _e(t,e,r){let n;try{if(n=e(t.node),Se(n)&&(i=t.node)!==Ut.document&&!(Ut.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===Ut.document}).call(Ut.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}d({viewbox:{viewbox(t,e,r,n){return null==t?new Ee(this.attr("viewBox")):this.attr("viewBox",new Ee(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 we(r/2/s+i.x,n/2/o+i.y);const c=new Ee(i).transform(new Ne({scale:u,origin:e}));return this.viewbox(c)}}}),Jt(Ee,"Box");var Me=class extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}};te([Me],{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 Te=["toArray","constructor","each"];function Ae(t){let e=(t+"").trim();const r=e.match(/^url\((.*)\)$/i);if(r){e=r[1].trim();const t=e[0];if('"'===t||"'"===t){if(e[e.length-1]!==t)return null;e=e.slice(1,-1)}}const n=e.match(se);return n?n[1].slice(1):null}function Pe(t,e){const r=`#${Ut.window.CSS.escape(e)}`;return 1===t.nodeType&&t.matches(r)?t:t.querySelector(r)}function Ce(t,e,r=`[${e}]`){const n=t.getAttribute("id"),i=t.getRootNode();if(!n||Pe(i,n)!==t)return new Me;const s=[];1===i.nodeType&&i.matches(r)&&Ae(i.getAttribute(e))===n&&s.push(Wt(i));for(const t of i.querySelectorAll(r))Ae(t.getAttribute(e))===n&&s.push(Wt(t));return new Me(s)}Me.extend=function(t){t=t.reduce((t,e)=>((0,At.default)(Te).call(Te,e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t),{}),te([Me],t)};let je=0;const Ie=new WeakMap,Le=new WeakMap,De=()=>Object.create(null);function Re(t){const e=t.getEventHolder();let r=Ie.get(e);return r||(r=De(),Ie.set(e,r)),r}function Ve(t){return t.getEventTarget()}function Fe(t,e,r,n,i){const s=r.bind(n||t),o=i||!1,a=Gt(t),u=Re(a),c=Ve(a);e=Array.isArray(e)?e:e.split(fe);let h=Le.get(r);h||(h=++je,Le.set(r,h)),e.forEach(function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";u[e]=u[e]||De(),u[e][r]=u[e][r]||De(),u[e][r][h]=u[e][r][h]||[],u[e][r][h].push({listener:s,options:o}),c.addEventListener(e,s,o)})}function ke(t,e,r,n){const i=Gt(t),s=Re(i),o=Ve(i);("function"!=typeof r||(r=Le.get(r)))&&(e=Array.isArray(e)?e:(e||"").split(fe)).forEach(function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,c;if(r){if(s[e]&&s[e][a||"*"]){const t=s[e][a||"*"][r];if(!t)return;t.forEach(function(t){o.removeEventListener(e,t.listener,t.options??n??!1)}),delete s[e][a||"*"][r]}}else if(e&&a){if(s[e]&&s[e][a]){for(c in s[e][a])ke(o,[e,a].join("."),c);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ke(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ke(o,[e,u].join("."));delete s[e]}}else{for(t in s)ke(o,t);!function(t){Ie.delete(t.getEventHolder())}(i)}})}var Be=class extends Xt{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=Ve(t);return e instanceof Ut.window.Event||(e=new Ut.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=Re(this)[t.type];if(!e)return!0;for(const r in e)for(const n in e[r])e[r][n].forEach(function(e){e.listener(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 ke(this,t,e,r),this}on(t,e,r,n){return Fe(this,t,e,r,n),this}removeEventListener(){}};function Ue(){}Jt(Be,"EventTarget");const Xe={"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"};var Ye=class 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(fe).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}},ze=class t{constructor(...t){this.init(...t)}convert(e){return new t(this.value,e)}divide(e){return e=new t(e),new t(this/e,this.unit||e.unit)}init(e,r){return r=Array.isArray(e)?e[1]:r,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=r||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(r=e.match(re))&&(this.value=parseFloat(r[1]),"%"===r[5]?this.value/=100:"s"===r[5]&&(this.value*=1e3),this.unit=r[5]):e instanceof t&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new t(e),new t(this-e,this.unit||e.unit)}plus(e){return e=new t(e),new t(this+e,this.unit||e.unit)}times(e){return e=new t(e),new t(this*e,this.unit||e.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 He=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ge=[];var $e=class t extends Be{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=Gt(t)).removeNamespace&&this.node instanceof Ut.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 Gt(t).put(this,e)}children(){return new Me(Pt(this.node.children,function(t){return Wt(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=Zt(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(e,r){return this.put(new t(Ht(e),r))}first(){return Wt(this.node.firstChild)}get(t){return Wt(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=Kt(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Wt(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=Wt(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Wt(e.node.parentNode));return e}put(t,e){return t=Gt(t),this.add(t,e),t}putIn(t,e){return Gt(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=Gt(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,Ft)}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=e??!0,this.writeDataToDom();let r=this;if(null!=t){if(r=Wt(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=e??!1;const n=Ht("wrapper",r),i=Ut.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)}};te($e,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=le.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))?Xe[t]:le.test(e)?parseFloat(e):e;"number"==typeof(e=Ge.reduce((e,r)=>r(t,e,this),e))?e=new ze(e):He.has(t)&&ve.isColor(e)?e=new ve(e):e.constructor===Array&&(e=new Ye(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 function(t,e){return new Me(Pt((e||Ut.document).querySelectorAll(t),function(t){return Wt(t)}))}(t,this.node)},findOne:function(t){return Wt(this.node.querySelector(t))}}),Jt($e,"Dom");var We=class extends $e{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 ze(t).plus(this.x()))}dy(t=0){return this.y(new ze(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,r=this.root(),n=r&&r.node;e||(t=t&&Gt(t).node);const i=new Me;let s=this;for(;(s=s.parent())&&s.node!==Ut.document&&"#document-fragment"!==s.node.nodeName&&(i.push(s),e||s.node!==t)&&(!e||!s.matches(t));)if(n&&s.node===n)return null;return i}reference(t){if(!(t=this.attr(t)))return null;const e=function(t,e){const r=Ae(e);return r?Pe(t.getRootNode(),r):null}(this.node,t);return e?Gt(e):null}root(){const t=this.parent(Yt[zt]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=Lt(this,t,e);return this.width(new ze(r.width)).height(new ze(r.height))}width(t){return this.attr("width",t)}writeDataToDom(t){return((t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))})(this,this.dom,t),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}};te(We,{bbox:function(){const t=_e(this,t=>t.getBBox(),t=>{try{const e=t.clone().addTo(Oe().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 Ee(t)},rbox:function(t){const e=_e(this,t=>t.getBoundingClientRect(),t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)}),r=new Ee(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 we(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Ne(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 Ne(e)}return new Ne(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new Ne}}}),Jt(We,"Element");const qe={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 ve||ve.isRgb(e)||e instanceof We)this.attr(t,e);else for(r=qe[t].length-1;r>=0;r--)null!=e[qe[t][r]]&&this.attr(qe.prefix(t,qe[t][r]),e[qe[t][r]]);return this},d(["Element","Runner"],e)}),d(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Ne(this):this.attr("transform",new Ne(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)}}),d("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new ze(t)):this.rx(t).ry(e)}}),d("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new we(this.node.getPointAtLength(t))}}),d(["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)}}),d("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},{})),d("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(oe).slice(0,-1).map(function(t){const e=t.trim().split("(");return[e[0].trim(),e[1].split(fe).map(function(t){return parseFloat(t)})]}).reverse().reduce(function(t,e){return"matrix"===e[0]?t.lmultiply(Ne.fromArray(e[1])):t[e[0]].apply(t,e[1])},new Ne)},toParent:function(t,e){if(this===t)return this;if(Vt(this.node))return this.addTo(t,e);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 Ne(this).decompose();return null==t?e:e[t]}Ne.isMatrixLike(t)||(t={...t,origin:Dt(t,this)});const r=new Ne(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});var Je=class t extends We{flatten(){return this.each(function(){if(this instanceof t)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()}};Jt(Je,"Container");var Qe=class extends Je{constructor(t,e=t){super($t("defs",t),e)}flatten(){return this}ungroup(){return this}};Jt(Qe,"Defs");var Ke=class extends We{};Jt(Ke,"Shape");var Ze=c({cx:()=>ir,cy:()=>sr,height:()=>ar,rx:()=>tr,ry:()=>er,width:()=>or,x:()=>rr,y:()=>nr});function tr(t){return this.attr("rx",t)}function er(t){return this.attr("ry",t)}function rr(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function nr(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function ir(t){return this.attr("cx",t)}function sr(t){return this.attr("cy",t)}function or(t){return null==t?2*this.rx():this.rx(new ze(t).divide(2))}function ar(t){return null==t?2*this.ry():this.ry(new ze(t).divide(2))}var ur=class extends Ke{constructor(t,e=t){super($t("ellipse",t),e)}size(t,e){const r=Lt(this,t,e);return this.rx(new ze(r.width).divide(2)).ry(new ze(r.height).divide(2))}};te(ur,Ze),d("Container",{ellipse:ee(function(t=0,e=t){return this.put(new ur).size(t,e).move(0,0)})}),Jt(ur,"Ellipse");var cr=class extends $e{constructor(t=Ut.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 $e(Ht("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}};Jt(cr,"Fragment");var hr=c({from:()=>lr,to:()=>dr});function lr(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new ze(t),fy:new ze(e)}):this.attr({x1:new ze(t),y1:new ze(e)})}function dr(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new ze(t),cy:new ze(e)}):this.attr({x2:new ze(t),y2:new ze(e)})}var fr=class extends Je{constructor(t,e){super($t(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 Ee}targets(){return Ce(this.node,"fill")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};te(fr,hr),d({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:ee(function(t,e){return this.put(new fr(t)).update(e)})}}),Jt(fr,"Gradient");var mr=class extends Je{constructor(t,e=t){super($t("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new Ee}targets(){return Ce(this.node,"fill")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};d({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:ee(function(t,e,r){return this.put(new mr).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})})}}),Jt(mr,"Pattern");var pr,yr=class extends Ke{constructor(t,e=t){super($t("image",t),e)}load(t,e){if(!t)return this;const r=new Ut.window.Image;return Fe(r,"load",function(t){const n=this.parent(mr);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof mr&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)},this),Fe(r,"load error",function(){ke(r)}),this.attr("href",r.src=t,Bt)}};pr=function(t,e,r){return"fill"!==t&&"stroke"!==t||de.test(e)&&(e=r.root().defs().image(e)),e instanceof yr&&(e=r.root().defs().pattern(0,0,t=>{t.add(e)})),e},Ge.push(pr),d({Container:{image:ee(function(t,e){return this.put(new yr).size(0,0).load(t,e)})}}),Jt(yr,"Image");var gr=class extends Ye{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 Ee(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(fe).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){Ne.isMatrixLike(t)||(t=new Ne(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}},br=c({MorphArray:()=>vr,height:()=>Or,width:()=>Nr,x:()=>wr,y:()=>xr});const vr=gr;function wr(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function xr(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Nr(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function Or(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}var Sr=class extends Ke{constructor(t,e=t){super($t("line",t),e)}array(){return new gr([[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 gr(t).toLine(),this.attr(t))}size(t,e){const r=Lt(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}};te(Sr,br),d({Container:{line:ee(function(...t){return Sr.prototype.plot.apply(this.put(new Sr),null!=t[0]?t:[0,0,0,0])})}}),Jt(Sr,"Line");var Er=class extends Je{constructor(t,e=t){super($t("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 _r(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}d({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:ee(function(t,e,r){return this.put(new Er).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 Er?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),Jt(Er,"Marker");const Mr={"-":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}}};var Tr=class{done(){return!1}},Ar=class extends Tr{constructor(t=">"){super(),this.ease=Mr[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}},Pr=class extends Tr{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}};function Cr(){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}te(class extends Pr{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:_r("_duration",Cr),overshoot:_r("_overshoot",Cr)}),te(class extends Pr{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:_r("_windup"),p:_r("P"),i:_r("I"),d:_r("D")});const jr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ir={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]]}},Lr="mlhvqtcsaz".split("");for(let t=0,e=Lr.length;t<e;++t)Ir[Lr[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 Ir[t](e,r,n)}}(Lr[t].toUpperCase());function Dr(t){return t.segment.length&&t.segment.length-1===jr[t.segment[0].toUpperCase()]}function Rr(t,e){t.inNumber&&Vr(t,!1);const r=me.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase();t.segment=["m"===r?e===r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function Vr(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,Dr(t)&&Fr(t)}function Fr(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){return Ir[t.segment[0]](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function kr(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 Br(t){return"E"===t.lastToken.toUpperCase()}const Ur=new Set([" ",",","\t","\n","\r","\f"]);var Xr=class extends Ye{bbox(){return Oe().path.setAttribute("d",this.toString()),new Ee(Oe.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 we,p:new we};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!Rr(i,n))if("."!==n)if(isNaN(parseInt(n)))if(Ur.has(n))i.inNumber&&Vr(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(me.test(n)){if(i.inNumber)Vr(i,!1);else{if(!Dr(i))throw new Error("parser Error");Fr(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Br(i)){Vr(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||kr(i)){i.inNumber=!0,i.number=n,Vr(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){Vr(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&Vr(i,!1),i.inSegment&&Dr(i)&&Fr(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 Yr=t=>{const e=typeof t;return"number"===e?ze:"string"===e?ve.isColor(t)?ve:fe.test(t)?me.test(t)?Xr:Ye:re.test(t)?ze:Hr:qr.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Ye:"object"===e?Wr:Hr};var zr=class{constructor(t){this._stepper=t||new Ar("-"),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(Yr(t));let e=new this._type(t);return this._type===ve&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Wr&&(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}},Hr=class{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}},Gr=class t{constructor(...t){this.init(...t)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,t.defaults,e),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}};Gr.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const $r=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;var Wr=class{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]===ve&&t[r+7]!==e[r+7]){const e=t[r+7],n=new ve(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=Yr(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort($r),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();t[r]=new n(e.splice(0,i))}return t}};const qr=[Hr,Gr,Wr];var Jr=class extends Ke{constructor(t,e=t){super($t("path",t),e)}array(){return this._array||(this._array=new Xr(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 Xr(t))}size(t,e){const r=Lt(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)}};Jr.prototype.MorphArray=Xr,d({Container:{path:ee(function(t){return this.put(new Jr).plot(t||new Xr)})}}),Jt(Jr,"Path");var Qr=c({array:()=>Kr,clear:()=>Zr,move:()=>tn,plot:()=>en,size:()=>rn});function Kr(){return this._array||(this._array=new gr(this.attr("points")))}function Zr(){return delete this._array,this}function tn(t,e){return this.attr("points",this.array().move(t,e))}function en(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new gr(t))}function rn(t,e){const r=Lt(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}var nn=class extends Ke{constructor(t,e=t){super($t("polygon",t),e)}};d({Container:{polygon:ee(function(t){return this.put(new nn).plot(t||new gr)})}}),te(nn,br),te(nn,Qr),Jt(nn,"Polygon");var sn=class extends Ke{constructor(t,e=t){super($t("polyline",t),e)}};d({Container:{polyline:ee(function(t){return this.put(new sn).plot(t||new gr)})}}),te(sn,br),te(sn,Qr),Jt(sn,"Polyline");var on=class extends Ke{constructor(t,e=t){super($t("rect",t),e)}};te(on,{rx:tr,ry:er}),d({Container:{rect:ee(function(t,e){return this.put(new on).size(t,e)})}}),Jt(on,"Rect");var an=class{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 un={nextDraw:null,frames:new an,timeouts:new an,immediates:new an,timer:()=>Ut.window.performance||Ut.window.Date,frame(t){const e=un.frames.push({run:t});return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),e},timeout(t,e){e=e||0;const r=un.timer().now()+e,n=un.timeouts.push({run:t,time:r});return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),n},immediate(t){const e=un.immediates.push(t);return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),e},cancelFrame(t){null!=t&&un.frames.remove(t)},clearTimeout(t){null!=t&&un.timeouts.remove(t)},cancelImmediate(t){null!=t&&un.immediates.remove(t)},_draw(t){try{let e=null;const r=un.timeouts.last();for(;(e=un.timeouts.shift())&&(t>=e.time?e.run():un.timeouts.push(e),e!==r););let n=null;const i=un.frames.last();for(;n!==i&&(n=un.frames.shift());)n.run(t);let s=null;for(;s=un.immediates.shift();)s()}finally{const t=un.timeouts.first()||un.frames.first()||un.immediates.first();un.nextDraw=t?Ut.window.requestAnimationFrame(un._draw):null}}},cn=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},hn=function(){const t=Ut.window;return(t.performance||t.Date).now()};var ln=class extends Be{constructor(t=hn){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){this._finishing=!0;try{this.time(this.getEndTimeOfTimeline()+1)}finally{this._finishing=!1}return 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(cn);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),t._retired=!1;const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,t._runnerInfo=o,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),t._runnerInfo=null,t._retired=!0),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return un.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=un.frame(this._step)),this)}_stepFn(t=!1){const e=this._generation,r=this._timeSource();let n=r-this._lastSourceTime;t&&(n=0);const i=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=r,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);const s=this._runners.slice();for(let t=s.length;t--;){const e=s[t];if(e.runner._runnerInfo!==e)continue;const r=e.runner;this._time-e.start<0&&r.reset(!0)}let o=!1;for(const t of this._runners.slice()){if(t.runner._runnerInfo!==t)continue;const e=t.runner;let r=i;const n=this._time-t.start;if(n<0){o=!0;continue}if(0===n){e.reset(),o=!0;continue}if(n<r&&(r=n),!e.active())continue;const s=(this._finishing&&e._isDeclarative?e.finish():e.step(r)).done;e._runnerInfo===t&&(s?!0!==t.persist&&e.duration()-e.time()+this._time+t.persist<=this._time&&e.unschedule():o=!0)}return e!==this._generation||(o||(o=this._runners.some(({start:t,runner:e})=>t>=this._time||e.active()&&!e.done)),o&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished"))),this}terminate(){un.cancelFrame(this._nextFrame),this._generation=(this._generation||0)+1,this._startTime=0,this._speed=1,this._persist=0;for(const{runner:t}of this._runners||[])t._retired=!0,t._runnerInfo=null;this._nextFrame=null,this._paused=!0,this._finishing=!1,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)}};d({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new ln,this._timeline):(this._timeline=t,this)}}});var dn=class t extends Be{constructor(e){super(),this.id=t.id++,e="function"==typeof(e=e??400)?new Pr(e):e,this._element=null,this._timeline=null,this._runnerInfo=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof Pr,this._stepper=this._isDeclarative?e:new Ar,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Ne,this._isAbsoluteTransform=!1,this._hasTransform=!1,this._transformInitialised=!1,this._transformActive=!1,this._retired=!1,this._reverse=!1,this._swing=!1,this._wait=0,this._times=1,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 Tr||(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){return this.transforms.lmultiplyO(t),this._transformInitialised=!0,this._transformActive=!0,this}after(t){return this.on("finished",t)}animate(e,r,n){const i=t.sanitise(e,r,n),s=new t(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new Ne,this}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 Ar(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){if(!this._isDeclarative)return this.time(this.duration());const t=this._time;return this.step(1/0),this._time=t,this}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()),c=s&&u%2==0;return a=u+(c&&!o||o&&c?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._isDeclarative&&(this.done=!1),this._queue.push({initialiser:t||Ue,runner:e||Ue,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(t=!1){if(this._reseted){const e=!t&&this._hasTransform&&0!==this.position();return e&&!this._transformInitialised?(this.step(0),this._reseted=!0,this):(e!==this._transformActive&&(this._transformActive=e,this._element&&this._element._addRunner(this)),this)}return this._reseted||(this.time(0),this._reseted=!0),t&&this._transformActive&&(this._transformActive=!1,this._element&&this._element._addRunner(this)),this}reverse(t){return this._reverse=t??!this._reverse,this}schedule(t,e,r){if(t instanceof ln||(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;const e=this.done;t=t??16,this._time+=t;const r=this.position(),n=this._lastPosition!==r&&this._time>=0;this._lastPosition=r;const i=this.duration(),s=this._lastTime<=0&&this._time>0;this._lastTime=this._time,s&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&this._time>=i,this._reseted=!1;const a=this._hasTransform&&(this._time>0||0!==r);this._transformActive=a;let u=!1;return(n||o)&&(this._initialise(n),this.transforms=new Ne,u=this._run(o?t:r),this._transformActive=a,this.fire("step",this)),this.done=this.done||u&&o,this.done&&!e&&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];if(this._isDeclarative&&n.finished&&!n.isTransform)continue;const 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,this._isDeclarative&&(this.done=!1);const n=this.timeline();return n&&n.play(),!0}return!1}};dn.id=0;var fn=class{constructor(t=new Ne,e=-1,r=!0,n=!1){this.transforms=t,this.id=e,this.done=r,this._isAbsoluteTransform=n,this._transformActive=!0,this._retired=!0}};te([dn,fn],{mergeWith(t){return new fn(this._isAbsoluteTransform?this.transforms:t.transforms.lmultiply(this.transforms),t.id,!0,t._isAbsoluteTransform||this._isAbsoluteTransform)}});const mn=(t,e)=>t.lmultiplyO(e),pn=t=>t.transforms,yn=t=>t._transformActive;function gn(t){const e=t.filter(yn);let r=0;for(let t=0;t<e.length;++t)e[t]._isAbsoluteTransform&&(r=t);return e.slice(r)}function bn(){const t=gn(this._transformationRunners.runners).map(pn).reduce(mn,new Ne);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}var vn=class{constructor(){this.runners=[]}add(t){var e;if(!(0,At.default)(e=this.runners).call(e,t))return this.runners.push(t),this}edit(t,e){const r=this.runners.findIndex(e=>e.id===t);return r>=0&&this.runners.splice(r,1,e),this}getByID(t){return this.runners.find(e=>e.id===t)}length(){return this.runners.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._retired&&t._retired){this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}else t=r}return this}remove(t){const e=this.runners.findIndex(e=>e.id===t);return e>=0&&this.runners.splice(e,1),this}};d({Element:{animate(t,e,r){const n=dn.sanitise(t,e,r),i=this.timeline();return new dn(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_currentTransform(t){const e=this._transformationRunners.runners,r=e.indexOf(t);return gn(e.slice(0,r+1)).map(pn).reduce(mn,new Ne)},_addRunner(t){1===this._transformationRunners.length()&&-1===this._transformationRunners.runners[0].id&&(this._transformationRunners.runners[0].transforms=new Ne(this)),this._transformationRunners.add(t),un.cancelImmediate(this._frameId),this._frameId=un.immediate(bn.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new vn).add(new fn(new Ne(this))))}}}),te(dn,{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});const n=e,i=this._history[t];if(i&&!i.caller.initialised&&i.caller.retarget)return i.caller.retarget.call(this,n),this;if(this._tryRetarget(t,n))return this;let s=new zr(this._stepper).to(n),o=Object.keys(n);return this.queue(function(){s=s.from(this.element()[t](o))},function(e){return this.element()[t](s.at(e).valueOf()),s.done()},function(e){const r=(n=Object.keys(e),i=o,n.filter(t=>!(0,At.default)(i).call(i,t)));var n,i;if(r.length&&null!=s.from()){const e=this.element()[t](r),n=new Wr(s.from()).valueOf();Object.assign(n,e),s.from(n)}const a=new Wr(s.to()).valueOf();Object.assign(a,e),s.to(a),o=Object.keys(a)}),this._rememberMorpher(t,s),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new zr(this._stepper).to(new ze(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._hasTransform=!0,this._isAbsoluteTransform=this._isAbsoluteTransform||!e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Ne.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new zr(this._stepper).type(r?Gr:Ne),s=r?new zr(this._stepper).type(Ne):i;let o,a,u,c,h;return this.queue(function(){a=a||this.element(),o=o||Dt(t,a),h=new Ne(e?void 0:a),a._addRunner(this)},function(l){e||this.clearTransform();const{x:d,y:f}=new we(o).transform(a._currentTransform(this)),m={...t,origin:[d,f]};!0===m.relative&&delete m.relative;let p=new Ne(m),y=this._isDeclarative&&u?u:h,g=i;if(r){const t=p.decompose(d,f),e=y.decompose(d,f);if(new Gr(t).toArray().concat(new Gr(e).toArray()).every(Number.isFinite)){p=t,y=e;const r=p.rotate,n=y.rotate,i=[r-360,r,r+360],s=i.map(t=>Math.abs(t-n)),o=Math.min(...s),a=s.indexOf(o);p.rotate=i[a]}else g=s}e&&g===i&&(n||(p.rotate=t.rotate||0),this._isDeclarative&&c&&(y.rotate=c)),g.from(y),g.to(p);const b=g.at(l);return c=b.rotate,u=new Ne(b),this.addTransform(u),a._addRunner(this),g.done()},function(e){o=Dt(e,a),t={...e}},!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 ze(e),this._tryRetarget(t,e))return this;const r=new zr(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 ze(t))}),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new zr(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 ze(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){const r=Lt(this._element,t,e);return this.width(r.width).height(r.height)},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 zr(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 Ee(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)}}),te(dn,{rx:tr,ry:er,from:lr,to:dr}),Jt(dn,"Runner");var wn=class extends Je{constructor(t,e=t){super($t("svg",t),e),this.namespace()}defs(){return this.isRoot()?Wt(this.node.querySelector("defs"))||this.put(new Qe):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof Ut.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:Ft,version:"1.1"}).attr("xmlns:xlink",Bt,kt):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,kt).attr("xmlns:svgjs",null,kt)}root(){return this.isRoot()?this:super.root()}};d({Container:{nested:ee(function(){return this.put(new wn)})}}),Jt(wn,"Svg",!0);var xn=class extends Je{constructor(t,e=t){super($t("symbol",t),e)}};d({Container:{symbol:ee(function(){return this.put(new xn)})}}),Jt(xn,"Symbol");var Nn=c({amove:()=>In,ax:()=>Cn,ay:()=>jn,build:()=>Ln,center:()=>Pn,cx:()=>Tn,cy:()=>An,length:()=>Sn,move:()=>Mn,plain:()=>On,x:()=>En,y:()=>_n});function On(t){return!1===this._build&&this.clear(),this.node.appendChild(Ut.document.createTextNode(t)),this}function Sn(){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 _n(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function Mn(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function Tn(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function An(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function Pn(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function Cn(t){return this.attr("x",t)}function jn(t){return this.attr("y",t)}function In(t,e){return this.ax(t).ay(e)}function Ln(t){return this._build=!!t,this}var Dn=class extends Ke{constructor(t,e=t){super($t("text",t),e),this.dom.leading=this.dom.leading??new ze(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new ze(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){if(Vt(this.node))return;const i=Ut.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new ze(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 ze(t.leading||1.3),this}writeDataToDom(){return super.writeDataToDom({leading:1.3})}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||Vt(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===Wt(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);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()}};te(Dn,Nn),d({Container:{text:ee(function(t=""){return this.put(new Dn).text(t)}),plain:ee(function(t=""){return this.put(new Dn).plain(t)})}}),Jt(Dn,"Text");var Rn=class extends Ke{constructor(t,e=t){super($t("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 Dn))return this;const e=t.index(this),r=Ut.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new ze(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)}};te(Rn,Nn),d({Tspan:{tspan:ee(function(t=""){const e=new Rn;return this._build||this.clear(),this.put(e).text(t)})},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Jt(Rn,"Tspan");var Vn=class extends Ke{constructor(t,e=t){super($t("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 ze(t).divide(2))}};te(Vn,{x:rr,y:nr,cx:ir,cy:sr,width:or,height:ar}),d({Container:{circle:ee(function(t=0){return this.put(new Vn).size(t).move(0,0)})}}),Jt(Vn,"Circle");var Fn=class extends Je{constructor(t,e=t){super($t("clipPath",t),e)}remove(){return this.targets().forEach(function(t){t.unclip()}),super.remove()}targets(){return Ce(this.node,"clip-path")}};d({Container:{clip:ee(function(){return this.defs().put(new Fn)})},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Fn?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Jt(Fn,"ClipPath");var kn=class extends We{constructor(t,e=t){super($t("foreignObject",t),e)}};d({Container:{foreignObject:ee(function(t,e){return this.put(new kn).size(t,e)})}}),Jt(kn,"ForeignObject");var Bn=c({dmove:()=>Un,dx:()=>Xn,dy:()=>Yn,height:()=>zn,move:()=>Hn,size:()=>Gn,width:()=>$n,x:()=>Wn,y:()=>qn});function Un(t,e){return this.children().forEach(r=>{let n;try{n=r.node instanceof Ut.window.SVGSVGElement?new Ee(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new Ne(r),s=i.translate(t,e).transform(i.inverse()),o=new we(n.x,n.y).transform(s);r.dmove(o.x-n.x,o.y-n.y)}),this}function Xn(t){return this.dmove(t,0)}function Yn(t){return this.dmove(0,t)}function zn(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function Hn(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function Gn(t,e,r=this.bbox()){const n=Lt(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(t=>{const e=new we(r).transform(new Ne(t).inverse());t.scale(i,s,e.x,e.y)}),this}function $n(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function Wn(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function qn(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}var Jn=class extends Je{constructor(t,e=t){super($t("g",t),e)}};te(Jn,Bn),d({Container:{group:ee(function(){return this.put(new Jn)})}}),Jt(Jn,"G");var Qn=class extends Je{constructor(t,e=t){super($t("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,Bt)}};te(Qn,Bn),d({Container:{link:ee(function(t){return this.put(new Qn).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 Qn,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}}}),Jt(Qn,"A");var Kn=class extends Je{constructor(t,e=t){super($t("mask",t),e)}remove(){return this.targets().forEach(function(t){t.unmask()}),super.remove()}targets(){return Ce(this.node,"mask")}};d({Container:{mask:ee(function(){return this.defs().put(new Kn)})},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Kn?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Jt(Kn,"Mask");var Zn=class extends We{constructor(t,e=t){super($t("stop",t),e)}update(t){return("number"==typeof t||t instanceof ze)&&(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 ze(t.offset)),this}};d({Gradient:{stop:function(t,e,r){return this.put(new Zn).update(t,e,r)}}}),Jt(Zn,"Stop");var ti=class extends We{constructor(t,e=t){super($t("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+=jt(t)+":"+e[t]+";";return r+="}",r}(t,e))}};d("Dom",{style(t,e){return this.put(new ti).rule(t,e)},fontface(t,e,r){return this.put(new ti).font(t,e,r)}}),Jt(ti,"Style");var ei=class extends Dn{constructor(t,e=t){super($t("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")}};d({Container:{textPath:ee(function(t,e){return t instanceof Dn||(t=this.text(t)),t.path(e)})},Text:{path:ee(function(t,e=!0){const r=new ei;let n;if(t instanceof Jr||(t=this.defs().path(t)),r.attr("href","#"+t,Bt),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)}),textPath(){return this.findOne("textPath")}},Path:{text:ee(function(t){return t instanceof Dn||(t=(new Dn).addTo(this.parent()).text(t)),t.path(this)}),targets(){return Ce(this.node,"href","textPath")}}}),ei.prototype.MorphArray=Xr,Jt(ei,"TextPath");var ri=class extends Ke{constructor(t,e=t){super($t("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,Bt)}};d({Container:{use:ee(function(t,e){return this.put(new ri).use(t,e)})}}),Jt(ri,"Use"),te([wn,xn,yr,mr,Er],f("viewbox")),te([Sr,sn,nn,Jr],f("marker")),te(Dn,f("Text")),te(Jr,f("Path")),te(Qe,f("Defs")),te([Dn,Rn],f("Tspan")),te([on,ur,fr,dn],f("radius")),te(Be,f("EventTarget")),te($e,f("Dom")),te(We,f("Element")),te(Ke,f("Shape")),te([Je,cr],f("Container")),te(fr,f("Gradient")),te(dn,f("Runner")),Me.extend([...new Set(l)]),function(t=[]){qr.push(...[].concat(t))}([ze,ve,Ee,Ne,Ye,gr,Xr,we]),te(qr,{to(t){return(new zr).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 ni,ii,si,oi,ai=r(726),ui=r(725),ci=r(854),hi=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const li=["basePadding1","basePadding2"],di={basePadding1:"setBasePadding1",basePadding2:"setBasePadding2"};class fi{static between(t,e){let r=(new Sr).node,n=new fi(r,t,e);return n.assignUUID(),n.set(fi.defaultValues),n.reposition(),n}constructor(t,e,r){ni.add(this),this.line=t,this.base1=e,this.base2=r,ii.set(this,{change:[]}),si.set(this,new MutationObserver(()=>hi(this,ni,"m",oi).call(this,"change"))),this.domNode.dataset.basePadding1||(this.domNode.dataset.basePadding1=`${(0,ui.distance)(this.point1,this.base1.centerPoint)}`),this.domNode.dataset.basePadding2||(this.domNode.dataset.basePadding2=`${(0,ui.distance)(this.point2,this.base2.centerPoint)}`),e.centerPoint.addEventListener("move",()=>this.reposition()),r.centerPoint.addEventListener("move",()=>this.reposition()),hi(this,si,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get basePair(){return[this.base1,this.base2]}get domNode(){return this.line}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){if((0,ci.isNonNullObject)(t))try{new Sr(this.domNode).attr(t)}catch{}}get id(){return this.domNode.id}assignUUID(){(0,ai.assignUUID)(this.domNode)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}isIn(t){return t.contains(this.domNode)&&t!==this.domNode}hasParent(){return!!this.domNode.parentNode}getTotalLength(){return this.domNode.getTotalLength()}get length(){return this.getTotalLength()}getPointAtLength(t){t<0?t=0:t>this.length&&(t=this.length);let e=this.domNode.getPointAtLength(t);return{x:e.x,y:e.y,direction:this.direction}}atLength(t){return this.getPointAtLength(t)}get point1(){return{x:this.domNode.x1.baseVal.value,y:this.domNode.y1.baseVal.value}}get point2(){return{x:this.domNode.x2.baseVal.value,y:this.domNode.y2.baseVal.value}}get direction(){return(0,ui.direction)(this.point1,this.point2)}get basePadding1(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.basePadding1)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set basePadding1(t){this.domNode.dataset.basePadding1=`${t}`,this.reposition()}setBasePadding1(t){(0,ci.isFiniteNumber)(t)&&(this.basePadding1=Math.max(0,t))}get basePadding2(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.basePadding2)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set basePadding2(t){this.domNode.dataset.basePadding2=`${t}`,this.reposition()}setBasePadding2(t){(0,ci.isFiniteNumber)(t)&&(this.basePadding2=Math.max(0,t))}isInverted(){return this.basePadding1+this.basePadding2>(0,ui.distance)(this.base1.centerPoint,this.base2.centerPoint)}set(t){try{this.setAttributes(t.attributes)}catch{}li.forEach(e=>{try{this[di[e]](t[e])}catch{}})}reposition(){let t=this.base1.centerPoint,e=this.base2.centerPoint,r=(0,ui.direction)(t,e);this.setAttribute("x1",`${t.x+this.basePadding1*Math.cos(r)}`),this.setAttribute("y1",`${t.y+this.basePadding1*Math.sin(r)}`),this.setAttribute("x2",""+(e.x-this.basePadding2*Math.cos(r))),this.setAttribute("y2",""+(e.y-this.basePadding2*Math.sin(r)))}addEventListener(t,e){hi(this,ii,"f")[t].push(e)}removeEventListener(t,e){hi(this,ii,"f")[t]=hi(this,ii,"f")[t].filter(t=>t!==e)}serialized(){let t=this.id;if(!t)throw new Error("Straight bond ID is falsy.");let e=this.base1.id;if(!e)throw new Error("Base 1 ID is falsy.");let r=this.base2.id;if(!r)throw new Error("Base 2 ID is falsy.");return{id:t,baseID1:e,baseID2:r}}static deserialized(t,e){var r,n,i;if(!(0,ci.isNonNullObject)(t))throw new Error("Saved straight bond must be an object.");let s=null!==(r=t.id)&&void 0!==r?r:t.lineId;if(!s)throw new Error("Straight bond ID is missing.");let o=e.domNode.querySelector("#"+s);if(!o)throw new Error("Unable to find straight bond DOM node.");if(!(o instanceof SVGLineElement))throw new Error("Straight bond DOM node must be an SVG line element.");let a=null!==(n=t.baseID1)&&void 0!==n?n:t.baseId1,u=null!==(i=t.baseID2)&&void 0!==i?i:t.baseId2;if(!a)throw new Error("Missing base 1 ID.");if(!u)throw new Error("Missing base 2 ID.");let c=[...e.bases].find(t=>t.id===a),h=[...e.bases].find(t=>t.id===u);if(!c)throw new Error("Unable to find base 1.");if(!h)throw new Error("Unable to find base 2.");let l=new fi(o,c,h);return(0,ci.isNumber)(t.basePadding1)&&(l.basePadding1=t.basePadding1),(0,ci.isNumber)(t.basePadding2)&&(l.basePadding2=t.basePadding2),l}static recreate(t,e){return fi.deserialized(t,e)}}ii=new WeakMap,si=new WeakMap,ni=new WeakSet,oi=function(t){hi(this,ii,"f")[t].forEach(t=>t())},fi.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6};var mi,pi,yi,gi,bi=r(801),vi=r(127),wi=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class xi{constructor(t){mi.add(this),pi.set(this,void 0),yi.set(this,new MutationObserver(()=>wi(this,mi,"m",gi).call(this))),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,pi,t),wi(this,yi,"f").observe(t.domNode,{childList:!0,subtree:!0})}}pi=new WeakMap,yi=new WeakMap,mi=new WeakSet,gi=function(){let t=[...wi(this,pi,"f").bases],e=new Map;t.forEach(t=>e.set(t,new Set)),[...wi(this,pi,"f").primaryBonds].forEach(t=>{var r,n;null===(r=e.get(t.base1))||void 0===r||r.add(t.base2),null===(n=e.get(t.base2))||void 0===n||n.add(t.base1)}),(0,vi.consecutivePairs)(t).forEach(([t,r])=>{var n;(null===(n=e.get(t))||void 0===n?void 0:n.has(r))||wi(this,pi,"f").addPrimaryBond(t,r)})};class Ni{constructor(t,e){this.targetStraightBonds=t,new MutationObserver(t=>{let e=new Set([...this.targetStraightBonds].map(t=>t.domNode));!t.some(t=>e.has(t.target))||this.updateOpacities()}).observe(e,{attributes:!0,attributeFilter:["x1","y1","x2","y2"],subtree:!0})}updateOpacities(){[...this.targetStraightBonds].forEach(t=>{let e=t.isInverted()?"0":"1";t.setAttribute("opacity",e)})}}})(),n})(),t.exports=e()},742(t){var e;e=()=>(()=>{var t={645(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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 matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}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)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get centerX(){return this.minX+this.width/2}get centerY(){return this.minY+this.height/2}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(...r){let n=(0,t.max)([this.width,this.height]),i="number"==typeof r[0]?r[0]:r[0].factor*n,s="number"==typeof r[1]?r[1]:i;return new e(this.x-i,this.y-s,this.width+2*i,this.height+2*s)}peripheralPoint(t){let e=this.width/2,r=this.height/2,n=Math.pow(Math.pow(e,2)+Math.pow(r,2),.5),i=this.centerX+n*Math.cos(t),s=this.centerY+n*Math.sin(t),o=n;return Math.abs(this.centerX-i)>e&&(o=Math.abs(e/Math.cos(t)),o=Number.isFinite(o)?o:r),Math.abs(this.centerY-s)>r&&(o=Math.abs(r/Math.sin(t)),o=Number.isFinite(o)?o:e),{x:this.centerX+o*Math.cos(t),y:this.centerY+o*Math.sin(t)}}}})(),n})(),t.exports=e()},731(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,{CenterPoint:()=>c});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver(()=>u(this,r,"m",o).call(this,"move")),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter(t=>t!==e)}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach(t=>t())},e})(),t.exports=e()},726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>s,CoordinateSystem:()=>b,HorizontalClientScaling:()=>w,InnerXML:()=>_,OuterXML:()=>A,Path:()=>i,Scaling:()=>v,VerticalClientScaling:()=>x,assignUUID:()=>g,bringToFront:()=>N,drawOnCanvas:()=>L,isSVGGraphicsElement:()=>P,isSVGGraphicsElementsArray:()=>j,sendToBack:()=>O,setAttributes:()=>c});var t,e=r(725);class i{constructor(t){this.domNode=t}closestPoint(t,r){var n;let i=this.domNode.getPointAtLength(0),s={x:i.x,y:i.y,length:0},o=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;if(o<=0)throw new Error(`Precision must be positive: ${o}.`);let a=this.domNode.getTotalLength();for(let r=o;r<=a;r+=o){let n=this.domNode.getPointAtLength(r);(0,e.distance)(t,n)<(0,e.distance)(t,s)&&(s={x:n.x,y:n.y,length:r})}return s}}class s{constructor(e){t.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}closestPoint(e,r){var n;let s=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;return document.body.contains(a)||document.body.append(a),u.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,t)),new i(u).closestPoint(e,{precision:s})}}t=new WeakMap;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox","0 0 100 100"),o.setAttribute("width","100"),o.setAttribute("height","100");const a=document.createElement("div");a.append(o),a.style.height="0px",a.style.position="fixed",document.body.append(a);const u=document.createElementNS("http://www.w3.org/2000/svg","path");function c(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}u.setAttribute("stroke","black"),u.setAttribute("stroke-width","1"),o.append(u);const h={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var l,d=new Uint8Array(16);function f(){if(!l&&!(l="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(d)}for(var m=[],p=0;p<256;++p)m.push((p+256).toString(16).slice(1));const y=function(t,e,r){if(h.randomUUID&&!e&&!t)return h.randomUUID();var n=(t=t||{}).random||(t.rng||f)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return function(t,e=0){return(m[t[e+0]]+m[t[e+1]]+m[t[e+2]]+m[t[e+3]]+"-"+m[t[e+4]]+m[t[e+5]]+"-"+m[t[e+6]]+m[t[e+7]]+"-"+m[t[e+8]]+m[t[e+9]]+"-"+m[t[e+10]]+m[t[e+11]]+m[t[e+12]]+m[t[e+13]]+m[t[e+14]]+m[t[e+15]]).toLowerCase()}(n)};function g(t){t.id="uuid-"+y()}class b{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class v{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class w{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class x{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function N(t){let e=t.parentNode;e&&e.appendChild(t)}function O(t){let e=t.parentNode;e&&e.prepend(t)}var S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){S.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,S,t)}toString(){return E(this,S,"f").innerHTML}set(t){E(this,S,"f").innerHTML=t}}S=new WeakMap;var M,T=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class A{constructor(t){M.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,M,t)}toString(){return T(this,M,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=T(this,M,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...T(this,M,"f").attributes].forEach(t=>T(this,M,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>T(this,M,"f").setAttribute(t.name,t.value)),T(this,M,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function P(t){return t instanceof SVGGraphicsElement}M=new WeakMap;var C=r(854);function j(t){return(0,C.isArray)(t)&&t.every(P)}var I=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(t){try{u(n.next(t))}catch(t){s(t)}}function a(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,a)}u((n=n.apply(t,e||[])).next())})};function L(t){return I(this,void 0,void 0,function*(){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),yield i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e})}})(),n})(),t.exports=e()},725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()},277(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,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}}return e})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Numbering:()=>E,NumberingLine:()=>F});var t,e=r(726),i=r(731),s=r(277),o=r(725),a=r(854),u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(e){if(t.set(this,void 0),!(0,a.isNonNullObject)(e))throw new Error("Saved numberings must be non-null objects.");!function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}get id(){if((0,a.isString)(u(this,t,"f").id))return u(this,t,"f").id;if((0,a.isString)(u(this,t,"f").textId))return u(this,t,"f").textId;throw new Error("Unable to find the ID of the saved numbering.")}get ownerID(){if((0,a.isString)(u(this,t,"f").ownerID))return u(this,t,"f").ownerID;throw new Error("Unable to find the owner ID of the saved numbering.")}get displacement(){return u(this,t,"f").displacement}}t=new WeakMap;var h,l,d,f,m,p,y,g,b,v,w,x,N,O=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},S=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};class E{static numbering(t,r){let n=document.createElementNS("http://www.w3.org/2000/svg","text");(0,e.assignUUID)(n),n.textContent=`${r}`;let i=new E(n,t);return i.setAttributes(E.defaultValues.attributes),i.displacement.magnitude=0,i}constructor(t,e){h.add(this),this.domNode=t,this.owner=e,l.set(this,{change:[]}),d.set(this,void 0),this.centerPoint=new i.CenterPoint(t),t.dataset.displacement||(t.dataset.displacement=JSON.stringify((0,o.displacement)(e.centerPoint,this.centerPoint))),e.centerPoint.addEventListener("move",()=>O(this,h,"m",f).call(this)),S(this,d,new MutationObserver(()=>O(this,h,"m",N).call(this,"change")),"f"),O(this,d,"f").observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}get id(){return this.domNode.id}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach(([t,e])=>this.setAttribute(t,e))}removeAttribute(t){this.domNode.removeAttribute(t)}get textContent(){return this.domNode.textContent}set textContent(t){this.domNode.textContent=t}get number(){return Number.parseFloat(this.textContent)}set number(t){this.textContent=`${t}`}get displacement(){const t=()=>O(this,h,"a",m),e=t=>{S(this,h,t,"a",p)},r=()=>O(this,h,"a",y),n=t=>{S(this,h,t,"a",g)},i=()=>O(this,h,"a",b),s=t=>{S(this,h,t,"a",v)},o=()=>O(this,h,"a",w),a=t=>{S(this,h,t,"a",x)};return{get x(){return t()},set x(t){e(t)},get y(){return r()},set y(t){n(t)},get magnitude(){return i()},set magnitude(t){s(t)},get direction(){return o()},set direction(t){a(t)}}}addEventListener(t,e){O(this,l,"f")[t].push(e)}removeEventListener(t,e){O(this,l,"f")[t]=O(this,l,"f")[t].filter(t=>t!==e)}serialized(){return{id:this.id,ownerID:this.owner.id}}static deserialized(t,e){let r=new c(t),n=e.domNode.querySelector("#"+r.id);if(!n)throw new Error("Numbering DOM node not found.");if(!(n instanceof SVGTextElement))throw new Error("Numbering DOM node must be an SVG text element.");let i=e.bases.find(t=>t.id===r.ownerID);if(!i)throw new Error("Unable to find numbering owner.");let s=new E(n,i);return(0,o.isPoint)(r.displacement)&&(s.displacement.x=r.displacement.x,s.displacement.y=r.displacement.y),s}static recreate(t,e){return E.deserialized(t,e)}}l=new WeakMap,d=new WeakMap,h=new WeakSet,f=function(){this.centerPoint.x=this.owner.centerPoint.x+O(this,h,"a",m),this.centerPoint.y=this.owner.centerPoint.y+O(this,h,"a",y)},m=function(){if(!this.domNode.dataset.displacement)return 0;let t;try{t=JSON.parse(this.domNode.dataset.displacement)}catch(t){return 0}return(0,o.isFinitePoint)(t)?t.x:0},p=function(t){this.domNode.dataset.displacement=JSON.stringify({x:t,y:O(this,h,"a",y)}),O(this,h,"m",f).call(this)},y=function(){if(!this.domNode.dataset.displacement)return 0;let t;try{t=JSON.parse(this.domNode.dataset.displacement)}catch(t){return 0}return(0,o.isFinitePoint)(t)?t.y:0},g=function(t){this.domNode.dataset.displacement=JSON.stringify({x:O(this,h,"a",m),y:t}),O(this,h,"m",f).call(this)},b=function(){return s.Vector.matching({x:O(this,h,"a",m),y:O(this,h,"a",y)}).magnitude},v=function(t){let e=s.Vector.matching({x:O(this,h,"a",m),y:O(this,h,"a",y)});e.magnitude=t,this.domNode.dataset.displacement=JSON.stringify({x:e.x,y:e.y}),O(this,h,"m",f).call(this)},w=function(){return s.Vector.matching({x:O(this,h,"a",m),y:O(this,h,"a",y)}).direction},x=function(t){let e=s.Vector.matching({x:O(this,h,"a",m),y:O(this,h,"a",y)});e.direction=t,this.domNode.dataset.displacement=JSON.stringify({x:e.x,y:e.y}),O(this,h,"m",f).call(this)},N=function(t){O(this,l,"f")[t].forEach(t=>t())},E.defaultValues={attributes:{"font-family":"Arial","font-size":"8","font-weight":"400",fill:"#808080"}};var _,M=r(645),T=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class A{constructor(t){if(_.set(this,void 0),!(0,a.isNonNullObject)(t))throw new Error("Saved numbering lines must be non-null objects.");!function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,_,t)}get id(){if((0,a.isString)(T(this,_,"f").id))return T(this,_,"f").id;if((0,a.isString)(T(this,_,"f").lineId))return T(this,_,"f").lineId;throw new Error("Unable to find saved numbering line ID.")}get ownerID(){if((0,a.isString)(T(this,_,"f").ownerID))return T(this,_,"f").ownerID;if((0,a.isString)(T(this,_,"f").textId))return T(this,_,"f").textId;throw new Error("Unable to find saved numbering line owner ID.")}get basePadding(){return T(this,_,"f").basePadding}get textPadding(){return void 0!==T(this,_,"f").numberingPadding?T(this,_,"f").numberingPadding:T(this,_,"f").textPadding}}_=new WeakMap;var P,C,j,I,L,D,R=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},V=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};class F{static connecting(t){let r=document.createElementNS("http://www.w3.org/2000/svg","line");(0,e.assignUUID)(r),r.setAttribute("x1",`${t.owner.centerPoint.x}`),r.setAttribute("y1",`${t.owner.centerPoint.y}`),r.setAttribute("x2",`${t.centerPoint.x}`),r.setAttribute("y2",`${t.centerPoint.y}`);let n=new F(r,t);return n.set(F.defaultValues),n}static unpadded(t){let e=F.connecting(t);return e.basePadding=0,e.textPadding=0,e}constructor(t,e){P.add(this),this.domNode=t,this.owner=e,t.dataset.basePadding||(t.dataset.basePadding=`${(0,o.distance)(e.owner.centerPoint,this.point1)}`);let r=M.Box.matching(e.domNode.getBBox());t.dataset.textPadding||(t.dataset.textPadding=`${(0,o.distance)(this.point2,r.peripheralPoint(e.displacement.direction+Math.PI))}`),e.centerPoint.addEventListener("move",()=>R(this,P,"m",D).call(this)),e.owner.centerPoint.addEventListener("move",()=>R(this,P,"m",D).call(this))}get id(){return this.domNode.id}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach(([t,e])=>this.setAttribute(t,e))}removeAttribute(t){this.domNode.removeAttribute(t)}get x1(){return this.domNode.x1.baseVal.value}get y1(){return this.domNode.y1.baseVal.value}get point1(){return{x:this.x1,y:this.y1}}get x2(){return this.domNode.x2.baseVal.value}get y2(){return this.domNode.y2.baseVal.value}get point2(){return{x:this.x2,y:this.y2}}get length(){return(0,o.distance)(this.point1,this.point2)}set length(t){let e=M.Box.matching(this.owner.domNode.getBBox());this.owner.displacement.magnitude=this.basePadding+t+this.textPadding+(0,o.distance)(this.owner.centerPoint,e.peripheralPoint(this.owner.displacement.direction+Math.PI))}get direction(){return(0,o.direction)(this.point1,this.point2)}set direction(t){let e=this.length;this.owner.displacement.direction=t,this.length=e}get basePadding(){return R(this,P,"a",C)}set basePadding(t){V(this,P,t,"a",j)}get textPadding(){return R(this,P,"a",I)}set textPadding(t){V(this,P,t,"a",L)}set(t){!t.attributes||this.setAttributes(t.attributes),!(0,a.isNumber)(t.basePadding)||(this.basePadding=t.basePadding),!(0,a.isNumber)(t.textPadding)||(this.textPadding=t.textPadding)}serialized(){return{id:this.id,ownerID:this.owner.id}}static deserialized(t,e){let r=new A(t),n=e.domNode.querySelector("#"+r.id);if(!n)throw new Error("Numbering line DOM node not found.");if(!(n instanceof SVGLineElement))throw new Error("Numbering line DOM node must be an SVG line element.");let i=e.numberings.find(t=>t.id===r.ownerID);if(!i)throw new Error("Numbering line owner not found.");let s=new F(n,i);return(0,a.isNumber)(r.basePadding)&&(s.basePadding=r.basePadding),(0,a.isNumber)(r.textPadding)&&(s.textPadding=r.textPadding),s}static recreate(t,e){return F.deserialized(t,e)}}P=new WeakSet,C=function(){if(!this.domNode.dataset.basePadding)return 0;let t=Number.parseFloat(this.domNode.dataset.basePadding);return Number.isFinite(t)?t:0},j=function(t){this.domNode.dataset.basePadding=`${t}`,R(this,P,"m",D).call(this)},I=function(){if(!this.domNode.dataset.textPadding)return 0;let t=Number.parseFloat(this.domNode.dataset.textPadding);return Number.isFinite(t)?t:0},L=function(t){this.domNode.dataset.textPadding=`${t}`,R(this,P,"m",D).call(this)},D=function(){let t=this.owner.displacement.direction;this.domNode.setAttribute("x1",`${this.owner.owner.centerPoint.x+R(this,P,"a",C)*Math.cos(t)}`),this.domNode.setAttribute("y1",`${this.owner.owner.centerPoint.y+R(this,P,"a",C)*Math.sin(t)}`);let e=M.Box.matching(this.owner.domNode.getBBox()).peripheralPoint(t+Math.PI);this.domNode.setAttribute("x2",`${e.x+R(this,P,"a",I)*Math.cos(t+Math.PI)}`),this.domNode.setAttribute("y2",`${e.y+R(this,P,"a",I)*Math.sin(t+Math.PI)}`)},F.defaultValues={attributes:{stroke:"#808080","stroke-width":"1","stroke-opacity":"1"},basePadding:5,textPadding:1}})(),n})(),t.exports=e()},775(t){var e;e=()=>(()=>{var t={726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>s,CoordinateSystem:()=>b,HorizontalClientScaling:()=>w,InnerXML:()=>_,OuterXML:()=>A,Path:()=>i,Scaling:()=>v,VerticalClientScaling:()=>x,assignUUID:()=>g,bringToFront:()=>N,drawOnCanvas:()=>L,isSVGGraphicsElement:()=>P,isSVGGraphicsElementsArray:()=>j,sendToBack:()=>O,setAttributes:()=>c});var t,e=r(725);class i{constructor(t){this.domNode=t}closestPoint(t,r){var n;let i=this.domNode.getPointAtLength(0),s={x:i.x,y:i.y,length:0},o=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;if(o<=0)throw new Error(`Precision must be positive: ${o}.`);let a=this.domNode.getTotalLength();for(let r=o;r<=a;r+=o){let n=this.domNode.getPointAtLength(r);(0,e.distance)(t,n)<(0,e.distance)(t,s)&&(s={x:n.x,y:n.y,length:r})}return s}}class s{constructor(e){t.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}closestPoint(e,r){var n;let s=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;return document.body.contains(a)||document.body.append(a),u.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,t)),new i(u).closestPoint(e,{precision:s})}}t=new WeakMap;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox","0 0 100 100"),o.setAttribute("width","100"),o.setAttribute("height","100");const a=document.createElement("div");a.append(o),a.style.height="0px",a.style.position="fixed",document.body.append(a);const u=document.createElementNS("http://www.w3.org/2000/svg","path");function c(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}u.setAttribute("stroke","black"),u.setAttribute("stroke-width","1"),o.append(u);const h={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var l,d=new Uint8Array(16);function f(){if(!l&&!(l="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(d)}for(var m=[],p=0;p<256;++p)m.push((p+256).toString(16).slice(1));const y=function(t,e,r){if(h.randomUUID&&!e&&!t)return h.randomUUID();var n=(t=t||{}).random||(t.rng||f)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return function(t,e=0){return(m[t[e+0]]+m[t[e+1]]+m[t[e+2]]+m[t[e+3]]+"-"+m[t[e+4]]+m[t[e+5]]+"-"+m[t[e+6]]+m[t[e+7]]+"-"+m[t[e+8]]+m[t[e+9]]+"-"+m[t[e+10]]+m[t[e+11]]+m[t[e+12]]+m[t[e+13]]+m[t[e+14]]+m[t[e+15]]).toLowerCase()}(n)};function g(t){t.id="uuid-"+y()}class b{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class v{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class w{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class x{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function N(t){let e=t.parentNode;e&&e.appendChild(t)}function O(t){let e=t.parentNode;e&&e.prepend(t)}var S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){S.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,S,t)}toString(){return E(this,S,"f").innerHTML}set(t){E(this,S,"f").innerHTML=t}}S=new WeakMap;var M,T=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class A{constructor(t){M.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,M,t)}toString(){return T(this,M,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=T(this,M,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...T(this,M,"f").attributes].forEach(t=>T(this,M,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>T(this,M,"f").setAttribute(t.name,t.value)),T(this,M,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function P(t){return t instanceof SVGGraphicsElement}M=new WeakMap;var C=r(854);function j(t){return(0,C.isArray)(t)&&t.every(P)}var I=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(t){try{u(n.next(t))}catch(t){s(t)}}function a(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,a)}u((n=n.apply(t,e||[])).next())})};function L(t){return I(this,void 0,void 0,function*(){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),yield i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e})}})(),n})(),t.exports=e()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseOutline:()=>i});var t=r(726),e=r(854);class i{static outlining(e){let r=document.createElementNS("http://www.w3.org/2000/svg","circle");(0,t.assignUUID)(r),r.setAttribute("cx",`${e.centerPoint.x}`),r.setAttribute("cy",`${e.centerPoint.y}`);let n=new i(r,e);return n.set(i.defaultValues.circle),n}static deserialized(t,r){var n;if(!(0,e.isNonNullObject)(t))throw new Error("Saved base outline must be an object.");let s=null!==(n=t.id)&&void 0!==n?n:t.circleId;if(!s)throw new Error("Base outline ID is missing.");if(!(0,e.isString)(s))throw new Error("Base outline ID must be a string.");let o=r.domNode.querySelector("#"+s);if(!o)throw new Error("Unable to find base outline DOM node.");if(!(o instanceof SVGCircleElement))throw new Error("Base outline DOM node must be an SVG circle element.");let a=t.ownerID;if(!a)throw new Error("Missing base outline owner ID.");if(!(0,e.isString)(a))throw new Error("Base outline owner ID must be a string.");let u=[...r.bases].find(t=>t.id===a);if(!u)throw new Error("Unable to find base outline owner.");return new i(o,u)}static recreate(t,e){return i.deserialized(t,e)}constructor(t,e){this.domNode=t,this.owner=e,e.centerPoint.addEventListener("move",()=>{t.setAttribute("cx",`${e.centerPoint.x}`),t.setAttribute("cy",`${e.centerPoint.y}`)})}serialized(){let t=this.id;if(!t)throw new Error("Base outline ID is falsy.");let e=this.owner.id;if(!e)throw new Error("Base outline owner ID is falsy.");return{id:t,ownerID:e}}get id(){return this.domNode.id}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(e){(0,t.setAttributes)(this.domNode,e)}set(t){t.attributes&&this.setAttributes(t.attributes)}}i.defaultValues={circle:{attributes:{r:"5.5",stroke:"#000000","stroke-width":"0","stroke-opacity":"1",fill:"#00ffff","fill-opacity":"1"}}}})(),n})(),t.exports=e()},358(t){var e;e=()=>(()=>{var t={731(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,{CenterPoint:()=>c});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver(()=>u(this,r,"m",o).call(this,"move")),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter(t=>t!==e)}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach(t=>t())},e})(),t.exports=e()},726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>s,CoordinateSystem:()=>b,HorizontalClientScaling:()=>w,InnerXML:()=>_,OuterXML:()=>A,Path:()=>i,Scaling:()=>v,VerticalClientScaling:()=>x,assignUUID:()=>g,bringToFront:()=>N,drawOnCanvas:()=>L,isSVGGraphicsElement:()=>P,isSVGGraphicsElementsArray:()=>j,sendToBack:()=>O,setAttributes:()=>c});var t,e=r(725);class i{constructor(t){this.domNode=t}closestPoint(t,r){var n;let i=this.domNode.getPointAtLength(0),s={x:i.x,y:i.y,length:0},o=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;if(o<=0)throw new Error(`Precision must be positive: ${o}.`);let a=this.domNode.getTotalLength();for(let r=o;r<=a;r+=o){let n=this.domNode.getPointAtLength(r);(0,e.distance)(t,n)<(0,e.distance)(t,s)&&(s={x:n.x,y:n.y,length:r})}return s}}class s{constructor(e){t.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}closestPoint(e,r){var n;let s=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;return document.body.contains(a)||document.body.append(a),u.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,t)),new i(u).closestPoint(e,{precision:s})}}t=new WeakMap;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox","0 0 100 100"),o.setAttribute("width","100"),o.setAttribute("height","100");const a=document.createElement("div");a.append(o),a.style.height="0px",a.style.position="fixed",document.body.append(a);const u=document.createElementNS("http://www.w3.org/2000/svg","path");function c(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}u.setAttribute("stroke","black"),u.setAttribute("stroke-width","1"),o.append(u);const h={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var l,d=new Uint8Array(16);function f(){if(!l&&!(l="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(d)}for(var m=[],p=0;p<256;++p)m.push((p+256).toString(16).slice(1));const y=function(t,e,r){if(h.randomUUID&&!e&&!t)return h.randomUUID();var n=(t=t||{}).random||(t.rng||f)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return function(t,e=0){return(m[t[e+0]]+m[t[e+1]]+m[t[e+2]]+m[t[e+3]]+"-"+m[t[e+4]]+m[t[e+5]]+"-"+m[t[e+6]]+m[t[e+7]]+"-"+m[t[e+8]]+m[t[e+9]]+"-"+m[t[e+10]]+m[t[e+11]]+m[t[e+12]]+m[t[e+13]]+m[t[e+14]]+m[t[e+15]]).toLowerCase()}(n)};function g(t){t.id="uuid-"+y()}class b{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class v{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class w{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class x{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function N(t){let e=t.parentNode;e&&e.appendChild(t)}function O(t){let e=t.parentNode;e&&e.prepend(t)}var S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){S.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,S,t)}toString(){return E(this,S,"f").innerHTML}set(t){E(this,S,"f").innerHTML=t}}S=new WeakMap;var M,T=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class A{constructor(t){M.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,M,t)}toString(){return T(this,M,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=T(this,M,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...T(this,M,"f").attributes].forEach(t=>T(this,M,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>T(this,M,"f").setAttribute(t.name,t.value)),T(this,M,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function P(t){return t instanceof SVGGraphicsElement}M=new WeakMap;var C=r(854);function j(t){return(0,C.isArray)(t)&&t.every(P)}var I=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(t){try{u(n.next(t))}catch(t){s(t)}}function a(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,a)}u((n=n.apply(t,e||[])).next())})};function L(t){return I(this,void 0,void 0,function*(){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),yield i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e})}})(),n})(),t.exports=e()},986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){var e=0;return t.forEach(function(t){return e+=t}),e}function i(t){return n(t)/t.length}function s(t){t.sort(function(t,e){return t-e})}t.r(e),t.d(e,{areWithin:()=>m,average:()=>i,clamp:()=>f,degrees:()=>b,distance:()=>r,flipAway:()=>x,isBetween:()=>l,isBetweenExclusive:()=>d,isBetweenInclusive:()=>l,max:()=>h,mean:()=>i,median:()=>u,min:()=>c,normalizeAngle:()=>w,radians:()=>v,round:()=>g,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>p,sortedNumbers:()=>a,sortedNumbersAscending:()=>a,sortedNumbersDescending:()=>y,sum:()=>n});var o=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 a(t){var e=o([],t,!0);return s(e),e}function u(t){if(0==t.length)return NaN;var e=a(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,n=r-1;return i([e[r],e[n]])}function c(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,r){return t>=e&&t<=r}function d(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function m(t,e,r){return Math.abs(t-e)<=r}function p(t){s(t),t.reverse()}function y(t){var e=a(t);return e.reverse(),e}function g(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function b(t){return t*(180/Math.PI)}function v(t){return t*(Math.PI/180)}function w(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function x(t,e){var r=(e=w(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{BasePair:()=>fi,Nucleobase:()=>di,seqSorted:()=>mi});var t=Object.create,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,u=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),c=(t,r)=>{let n={};for(var i in t)e(n,i,{get:t[i],enumerable:!0});return r||e(n,Symbol.toStringTag,{value:"Module"}),n};const h={},l=[];function d(t,e){if(Array.isArray(t))for(const r of t)d(r,e);else if("object"!=typeof t)m(Object.getOwnPropertyNames(e)),h[t]=Object.assign(h[t]||{},e);else for(const e in t)d(e,t[e])}function f(t){return h[t]||{}}function m(t){l.push(...t)}var p=u((t,e)=>{e.exports=function(t){try{return!!t()}catch(t){return!0}}}),y=u((t,e)=>{var r=p();e.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}),g=u((t,e)=>{var r=y(),n=Function.prototype,i=n.call,s=r&&n.bind.bind(i,i);e.exports=r?s:function(t){return function(){return i.apply(t,arguments)}}}),b=u((t,e)=>{var r=g();e.exports=r({}.isPrototypeOf)}),v=u((t,e)=>{var n=function(t){return t&&t.Math===Math&&t};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}),w=u((t,e)=>{var r=y(),n=Function.prototype,i=n.apply,s=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})}),x=u((t,e)=>{var r=g(),n=r({}.toString),i=r("".slice);e.exports=function(t){return i(n(t),8,-1)}}),N=u((t,e)=>{var r=x(),n=g();e.exports=function(t){if("Function"===r(t))return n(t)}}),O=u((t,e)=>{var r="object"==typeof document&&document.all;e.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}}),S=u((t,e)=>{var r=p();e.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),E=u((t,e)=>{var r=y(),n=Function.prototype.call;e.exports=r?n.bind(n):function(){return n.apply(n,arguments)}}),_=u(t=>{var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!e.call({1:2},1);t.f=n?function(t){var e=r(this,t);return!!e&&e.enumerable}:e}),M=u((t,e)=>{e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}}),T=u((t,e)=>{var r=g(),n=p(),i=x(),s=Object,o=r("".split);e.exports=n(function(){return!s("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?o(t,""):s(t)}:s}),A=u((t,e)=>{e.exports=function(t){return null==t}}),P=u((t,e)=>{var r=A(),n=TypeError;e.exports=function(t){if(r(t))throw new n("Can't call method on "+t);return t}}),C=u((t,e)=>{var r=T(),n=P();e.exports=function(t){return r(n(t))}}),j=u((t,e)=>{var r=O();e.exports=function(t){return"object"==typeof t?null!==t:r(t)}}),I=u((t,e)=>{e.exports={}}),L=u((t,e)=>{var r=I(),n=v(),i=O(),s=function(t){return i(t)?t:void 0};e.exports=function(t,e){return arguments.length<2?s(r[t])||s(n[t]):r[t]&&r[t][e]||n[t]&&n[t][e]}}),D=u((t,e)=>{var r=v().navigator,n=r&&r.userAgent;e.exports=n?String(n):""}),R=u((t,e)=>{var r,n,i=v(),s=D(),o=i.process,a=i.Deno,u=o&&o.versions||a&&a.version,c=u&&u.v8;c&&(n=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(n=+r[1]),e.exports=n}),V=u((t,e)=>{var r=R(),n=p(),i=v().String;e.exports=!!Object.getOwnPropertySymbols&&!n(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41})}),F=u((t,e)=>{var r=V();e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),k=u((t,e)=>{var r=L(),n=O(),i=b(),s=F(),o=Object;e.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return n(e)&&i(e.prototype,o(t))}}),B=u((t,e)=>{var r=String;e.exports=function(t){try{return r(t)}catch(t){return"Object"}}}),U=u((t,e)=>{var r=O(),n=B(),i=TypeError;e.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not a function")}}),X=u((t,e)=>{var r=U(),n=A();e.exports=function(t,e){var i=t[e];return n(i)?void 0:r(i)}}),Y=u((t,e)=>{var r=E(),n=O(),i=j(),s=TypeError;e.exports=function(t,e){var o,a;if("string"===e&&n(o=t.toString)&&!i(a=r(o,t)))return a;if(n(o=t.valueOf)&&!i(a=r(o,t)))return a;if("string"!==e&&n(o=t.toString)&&!i(a=r(o,t)))return a;throw new s("Can't convert object to primitive value")}}),z=u((t,e)=>{e.exports=!0}),H=u((t,e)=>{var r=v(),n=Object.defineProperty;e.exports=function(t,e){try{n(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}}),G=u((t,e)=>{var r=z(),n=v(),i=H(),s="__core-js_shared__",o=e.exports=n[s]||i(s,{});(o.versions||(o.versions=[])).push({version:"3.49.0",mode:r?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),$=u((t,e)=>{var r=G();e.exports=function(t,e){return r[t]||(r[t]=e||{})}}),W=u((t,e)=>{var r=P(),n=Object;e.exports=function(t){return n(r(t))}}),q=u((t,e)=>{var r=g(),n=W(),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(t,e){return i(n(t),e)}}),J=u((t,e)=>{var r=g(),n=0,i=Math.random(),s=r(1.1.toString);e.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++n+i,36)}}),Q=u((t,e)=>{var r=v(),n=$(),i=q(),s=J(),o=V(),a=F(),u=r.Symbol,c=n("wks"),h=a?u.for||u:u&&u.withoutSetter||s;e.exports=function(t){return i(c,t)||(c[t]=o&&i(u,t)?u[t]:h("Symbol."+t)),c[t]}}),K=u((t,e)=>{var r=E(),n=j(),i=k(),s=X(),o=Y(),a=Q(),u=TypeError,c=a("toPrimitive");e.exports=function(t,e){if(!n(t)||i(t))return t;var a,h=s(t,c);if(h){if(void 0===e&&(e="default"),a=r(h,t,e),!n(a)||i(a))return a;throw new u("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}}),Z=u((t,e)=>{var r=K(),n=k();e.exports=function(t){var e=r(t,"string");return n(e)?e:e+""}}),tt=u((t,e)=>{var r=v(),n=j(),i=r.document,s=n(i)&&n(i.createElement);e.exports=function(t){return s?i.createElement(t):{}}}),et=u((t,e)=>{var r=S(),n=p(),i=tt();e.exports=!r&&!n(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}),rt=u(t=>{var e=S(),r=E(),n=_(),i=M(),s=C(),o=Z(),a=q(),u=et(),c=Object.getOwnPropertyDescriptor;t.f=e?c:function(t,e){if(t=s(t),e=o(e),u)try{return c(t,e)}catch(t){}if(a(t,e))return i(!r(n.f,t,e),t[e])}}),nt=u((t,e)=>{var r=p(),n=O(),i=/#|\.prototype\./,s=function(t,e){var i=a[o(t)];return i===c||i!==u&&(n(e)?r(e):!!e)},o=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",c=s.POLYFILL="P";e.exports=s}),it=u((t,e)=>{var r=N(),n=U(),i=y(),s=r(r.bind);e.exports=function(t,e){return n(t),void 0===e?t:i?s(t,e):function(){return t.apply(e,arguments)}}}),st=u((t,e)=>{var r=S(),n=p();e.exports=r&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),ot=u((t,e)=>{var r=j(),n=String,i=TypeError;e.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not an object")}}),at=u(t=>{var e=S(),r=et(),n=st(),i=ot(),s=Z(),o=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c="enumerable",h="configurable",l="writable";t.f=e?n?function(t,e,r){if(i(t),e=s(e),i(r),"function"==typeof t&&"prototype"===e&&"value"in r&&l in r&&!r[l]){var n=u(t,e);n&&n[l]&&(t[e]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:c in r?r[c]:n[c],writable:!1})}return a(t,e,r)}:a:function(t,e,n){if(i(t),e=s(e),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new o("Accessors not supported");return"value"in n&&(t[e]=n.value),t}}),ut=u((t,e)=>{var r=S(),n=at(),i=M();e.exports=r?function(t,e,r){return n.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}}),ct=u((t,e)=>{var r=v(),n=w(),i=N(),s=O(),o=rt().f,a=nt(),u=I(),c=it(),h=ut(),l=q();G();var d=function(t){var e=function(r,i,s){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,i)}return new t(r,i,s)}return n(t,this,arguments)};return e.prototype=t.prototype,e};e.exports=function(t,e){var n,f,m,p,y,g,b,v,w,x=t.target,N=t.global,O=t.stat,S=t.proto,E=N?r:O?r[x]:r[x]&&r[x].prototype,_=N?u:u[x]||h(u,x,{})[x],M=_.prototype;for(p in e)f=!(n=a(N?p:x+(O?".":"#")+p,t.forced))&&E&&l(E,p),g=_[p],f&&(b=t.dontCallGetSet?(w=o(E,p))&&w.value:E[p]),y=f&&b?b:e[p],(n||S||typeof g!=typeof y)&&(v=t.bind&&f?c(y,r):t.wrap&&f?d(y):S&&s(y)?i(y):y,(t.sham||y&&y.sham||g&&g.sham)&&h(v,"sham",!0),h(_,p,v),S&&(l(u,m=x+"Prototype")||h(u,m,{}),h(u[m],p,y),t.real&&M&&(n||!M[p])&&h(M,p,y)))}}),ht=u((t,e)=>{var r=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}}),lt=u((t,e)=>{var r=ht();e.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}}),dt=u((t,e)=>{var r=lt(),n=Math.max,i=Math.min;e.exports=function(t,e){var s=r(t);return s<0?n(s+e,0):i(s,e)}}),ft=u((t,e)=>{var r=lt(),n=Math.min;e.exports=function(t){var e=r(t);return e>0?n(e,9007199254740991):0}}),mt=u((t,e)=>{var r=ft();e.exports=function(t){return r(t.length)}}),pt=u((t,e)=>{var r=C(),n=dt(),i=mt(),s=function(t){return function(e,s,o){var a=r(e),u=i(a);if(0===u)return!t&&-1;var c,h=n(o,u);if(t&&s!=s){for(;u>h;)if((c=a[h++])!=c)return!0}else for(;u>h;h++)if((t||h in a)&&a[h]===s)return t||h||0;return!t&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}}),yt=u((t,e)=>{e.exports=function(){}}),gt=u(()=>{var t=ct(),e=pt().includes,r=p(),n=yt(),i=r(function(){return!Array(1).includes()}),s=r(function(){return[,1].includes(void 0,1)});t({target:"Array",proto:!0,forced:i||s},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),n("includes")}),bt=u((t,e)=>{var r=v(),n=I();e.exports=function(t,e){var i=n[t+"Prototype"],s=i&&i[e];if(s)return s;var o=r[t],a=o&&o.prototype;return a&&a[e]}}),vt=u((t,e)=>{gt();var r=bt();e.exports=r("Array","includes")}),wt=u((t,e)=>{var r=j(),n=x(),i=Q()("match");e.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"===n(t))}}),xt=u((t,e)=>{var r=wt(),n=TypeError;e.exports=function(t){if(r(t))throw new n("The method doesn't accept regular expressions");return t}}),Nt=u((t,e)=>{var r={};r[Q()("toStringTag")]="z",e.exports="[object z]"===String(r)}),Ot=u((t,e)=>{var r=Nt(),n=O(),i=x(),s=Q()("toStringTag"),o=Object,a="Arguments"===i(function(){return arguments}());e.exports=r?i:function(t){var e,r,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=o(t),s))?r:a?i(e):"Object"===(u=i(e))&&n(e.callee)?"Arguments":u}}),St=u((t,e)=>{var r=Ot(),n=String;e.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}}),Et=u((t,e)=>{var r=Q()("match");e.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(t){}}return!1}}),_t=u(()=>{var t=ct(),e=g(),r=xt(),n=P(),i=St(),s=Et(),o=e("".indexOf);t({target:"String",proto:!0,forced:!s("includes")},{includes:function(t){return!!~o(i(n(this)),i(r(t)),arguments.length>1?arguments[1]:void 0)}})}),Mt=u((t,e)=>{_t();var r=bt();e.exports=r("String","includes")}),Tt=u((t,e)=>{var r=b(),n=vt(),i=Mt(),s=Array.prototype,o=String.prototype;e.exports=function(t){var e=t.includes;return t===s||r(s,t)&&e===s.includes?n:"string"==typeof t||t===o||r(o,t)&&e===o.includes?i:e}}),At=((r,n,u)=>(u=null!=r?t(o(r)):{},((t,r,n,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(var u,c=s(r),h=0,l=c.length;h<l;h++)u=c[h],a.call(t,u)||void 0===u||e(t,u,{get:(t=>r[t]).bind(null,u),enumerable:!(o=i(r,u))||o.enumerable});return t})(e(u,"default",{value:r,enumerable:!0}),r)))(u((t,e)=>{var r=Tt();e.exports=r})());function Pt(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function Ct(t){return t%360*Math.PI/180}function jt(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})}function It(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Lt(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 Dt(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=(0,At.default)(n).call(n,"left")?a:(0,At.default)(n).call(n,"right")?a+r:a+r/2),o&&(i=(0,At.default)(i).call(i,"top")?u:(0,At.default)(i).call(i,"bottom")?u+t:u+t/2)}return[n,i]}const Rt=new Set(["desc","metadata","title"]),Vt=t=>Rt.has(t.nodeName),Ft="http://www.w3.org/2000/svg",kt="http://www.w3.org/2000/xmlns/",Bt="http://www.w3.org/1999/xlink",Ut={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};var Xt=class{};const Yt={},zt="___SYMBOL___ROOT___";function Ht(t,e=Ft){return Ut.document.createElementNS(e,t)}function Gt(t,e=!1){if(t instanceof Xt)return t;if("object"==typeof t)return qt(t);if(null==t)return new Yt[zt];if("string"==typeof t&&"<"!==t.trim().charAt(0))return qt(Ut.document.querySelector(t));const r=e?Ut.document.createElement("div"):Ht("svg");return r.innerHTML=t.trim(),t=qt(r.firstElementChild),r.removeChild(r.firstElementChild),t}function $t(t,e){return e&&(e instanceof Ut.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:Ht(t)}function Wt(t){if(!t)return null;if(t.instance instanceof Xt)return t.instance;if("#document-fragment"===t.nodeName)return new Yt.Fragment(t);let e=It(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Yt[e]||(e="Dom"),new Yt[e](t)}let qt=Wt;function Jt(t,e=t.name,r=!1){return Yt[e]=t,r&&(Yt[zt]=t),m(Object.getOwnPropertyNames(t.prototype)),t}let Qt=1e3;function Kt(t){return"Svgjs"+It(t)+Qt++}function Zt(t){for(let e=t.children.length-1;e>=0;e--)Zt(t.children[e]);return t.id?(t.id=Kt(t.nodeName),t):t}function te(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 ee(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)}}d("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=Gt(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=Gt(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=Gt(t)).before(this),this},insertAfter:function(t){return(t=Gt(t)).after(this),this}});const re=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,ne=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ie=/rgb\((\d+),(\d+),(\d+)\)/,se=/^(#[^\s]+)$/,oe=/\)\s*,?\s*/,ae=/\s/g,ue=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,ce=/^rgb\(/,he=/^(\s+)?$/,le=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,de=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,fe=/[\s,]+/,me=/[MLHVCSQTAZ]/i;d("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(fe)},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)}});const pe=t=>t.startsWith("--")?t:jt(t);function ye(t){const e=Math.max(0,Math.min(255,Math.round(t))).toString(16);return 1===e.length?"0"+e:e}function ge(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function be(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}d("Dom",{css:function(t,e){const r={};if(0===arguments.length){const t=this.node.style;for(let e=0;e<t.length;e++){const n=t.item(e),i=t.getPropertyValue(n),s=t.getPropertyPriority(n);r[n]=s?`${i} !${s}`:i}return r}if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=pe(e);r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(pe(t));if("object"==typeof t)for(const e in t)this.node.style.setProperty(pe(e),null==t[e]||he.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(pe(t),null==e||he.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),d("Dom",{data:function(t,e,r){if(null==t)return this.data(Pt(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}}),d("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||{}}});var ve=class t{constructor(...t){this.init(...t)}static isColor(e){return e&&(e instanceof t||this.isRgb(e)||this.test(e))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(e="vibrant",r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===e){const e=24*n()+57,r=38*n()+45,i=360*n();return new t(e,r,i,"lch")}if("sine"===e){const e=i(80*s(2*o*(r=r??n())/.5+.01)+150),a=i(50*s(2*o*r/.5+4.6)+200),u=i(100*s(2*o*r/.5+2.3)+150);return new t(e,a,u)}if("pastel"===e){const e=8*n()+86,r=17*n()+9,i=360*n();return new t(e,r,i,"lch")}if("dark"===e){const e=10+10*n(),r=50*n()+86,i=360*n();return new t(e,r,i,"lch")}if("rgb"===e){const e=255*n(),r=255*n(),i=255*n();return new t(e,r,i)}if("lab"===e){const e=100*n(),r=256*n()-128,i=256*n()-128;return new t(e,r,i,"lab")}if("grey"===e){const e=255*n();return new t(e,e,e)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(ue.test(t)||ce.test(t))}cmyk(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),a=Math.min(1-i,1-s,1-o);return 1===a?new t(0,0,0,1,"cmyk"):new t((1-i-a)/(1-a),(1-s-a)/(1-a),(1-o-a)/(1-a),a,"cmyk")}hsl(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),a=Math.max(i,s,o),u=Math.min(i,s,o),c=(a+u)/2,h=a===u,l=a-u;return new t(360*(h?0:a===i?((s-o)/l+(s<o?6:0))/6:a===s?((o-i)/l+2)/6:a===o?((i-s)/l+4)/6:0),100*(h?0:c>.5?l/(2-a-u):l/(a+u)),100*c,"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=ge(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:ge(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:ge(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:ge(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:ge(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:ge(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(ce.test(t)){const e=t.replace(ae,""),[r,n,i]=ie.exec(e).slice(1,4).map(t=>parseInt(t));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!ue.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=ne.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,c="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,c)}lab(){const{x:e,y:r,z:n}=this.xyz();return new t(116*r-16,500*(e-r),200*(r-n),"lab")}lch(){const{l:e,a:r,b:n}=this.lab(),i=Math.sqrt(r**2+n**2);let s=180*Math.atan2(n,r)/Math.PI;return s<0&&(s*=-1,s=360-s),new t(e,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:r,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:t,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=(t+16)/116,a=i/500+o,u=o-s/200,c=16/116,h=.008856,l=7.787;e=.95047*(a**3>h?a**3:(a-c)/l),r=1*(o**3>h?o**3:(o-c)/l),n=1.08883*(u**3>h?u**3:(u-c)/l)}const i=3.2406*e+-1.5372*r+-.4986*n,s=-.9689*e+1.8758*r+.0415*n,o=.0557*e+-.204*r+1.057*n,a=Math.pow,u=.0031308,c=i>u?1.055*a(i,1/2.4)-.055:12.92*i,h=s>u?1.055*a(s,1/2.4)-.055:12.92*s,l=o>u?1.055*a(o,1/2.4)-.055:12.92*o;return new t(255*c,255*h,255*l)}if("hsl"===this.space){let{h:e,s:r,l:n}=this;if(e/=360,r/=100,n/=100,0===r)return n*=255,new t(n,n,n);const i=n<.5?n*(1+r):n+r-n*r,s=2*n-i,o=255*be(s,i,e+1/3),a=255*be(s,i,e),u=255*be(s,i,e-1/3);return new t(o,a,u)}if("cmyk"===this.space){const{c:e,m:r,y:n,k:i}=this,s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,r*(1-i)+i)),a=255*(1-Math.min(1,n*(1-i)+i));return new t(s,o,a)}return this;var e}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(ye);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),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,c=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,h=(.4124*a+.3576*u+.1805*c)/.95047,l=(.2126*a+.7152*u+.0722*c)/1,d=(.0193*a+.1192*u+.9505*c)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=d>.008856?Math.pow(d,1/3):7.787*d+16/116;return new t(f,m,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)))}},we=class t{constructor(...t){this.init(...t)}clone(){return new t(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=r.x??0,this.y=r.y??0,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Ne.isMatrixLike(t)||(t=new Ne(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 xe(t,e,r){return Math.abs(e-t)<(r||1e-6)}var Ne=class t{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,c=t.rotate||t.theta||0,h=new we(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=h.x,d=h.y,f=new we(t.position??t.px??t.positionX??NaN,t.py??t.positionY??NaN),m=f.x,p=f.y,y=new we(t.translate||t.tx||t.translateX,t.ty||t.translateY),g=y.x,b=y.y,v=new we(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:c,rx:v.x,ry:v.y,tx:g,ty:b,ox:l,oy:d,px:m,py:p}}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 t(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,c=u>0?1:-1,h=c*Math.sqrt(r*r+n*n),l=Math.atan2(c*n,c*r),d=(r*i+n*s)/u;return{scaleX:h,scaleY:i*h/(d*r-n)||s*h/(d*n+r),shear:d,rotate:180/Math.PI*l,translateX:o-t+t*r+e*i,translateY:a-e+t*n+e*s,originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const r=new t(e);return xe(this.a,r.a)&&xe(this.b,r.b)&&xe(this.c,r.c)&&xe(this.d,r.d)&&xe(this.e,r.e)&&xe(this.f,r.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(e){const r=t.fromArray([1,0,0,1,0,0]);return e=e instanceof We?e.matrixify():"string"==typeof e?t.fromArray(e.split(fe).map(parseFloat)):Array.isArray(e)?t.fromArray(e):"object"==typeof e&&t.isMatrixLike(e)?e:"object"==typeof e?(new t).transform(e):6===arguments.length?t.fromArray([].slice.call(arguments)):r,this.a=null!=e.a?e.a:r.a,this.b=null!=e.b?e.b:r.b,this.c=null!=e.c?e.c:r.c,this.d=null!=e.d?e.d:r.d,this.e=null!=e.e?e.e:r.e,this.f=null!=e.f?e.f:r.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,c=-r/o,h=t/o,l=-(a*i+c*s),d=-(u*i+h*s);return this.a=a,this.b=u,this.c=c,this.d=h,this.e=l,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(e){const r=e instanceof t?e:new t(e);return t.matrixMultiply(r,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(e){const r=e instanceof t?e:new t(e);return t.matrixMultiply(this,r,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=Ct(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:c,f:h}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=c*n-h*i+r*i-e*n+e,this.f=h*n+c*i-e*i-r*n+r,this}scale(){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:c}=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=c*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(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=Ct(t),e=Ct(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:c,e:h,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+c*i,this.d=c+u*s,this.e=h+l*i-n*i,this.f=l+h*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(e){if(t.isMatrixLike(e))return new t(e).multiplyO(this);const r=t.formatTransforms(e),{x:n,y:i}=new we(r.ox,r.oy).transform(this),s=(new t).translateO(r.rx,r.ry).lmultiplyO(this).translateO(-n,-i).scaleO(r.scaleX,r.scaleY).skewO(r.skewX,r.skewY).shearO(r.shear).rotateO(r.theta).translateO(n,i);if(isFinite(r.px)||isFinite(r.py)){const t=new we(n,i).transform(s),e=isFinite(r.px)?r.px-t.x:0,o=isFinite(r.py)?r.py-t.y:0;s.translateO(e,o)}return s.translateO(r.tx,r.ty),s}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 Oe(){if(!Oe.nodes||Oe.nodes.svg.node.ownerDocument!==Ut.document){const t=Gt().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"),Oe.nodes={svg:t,path:t.path().node}}return Oe.nodes.svg.node.parentNode||Oe.nodes.svg.addTo(Ut.document.body||Ut.document.documentElement),Oe.nodes}function Se(t){return!(t.width||t.height||t.x||t.y)}Jt(Ne,"Matrix");var Ee=class t{constructor(...t){this.init(...t)}addOffset(){return this.x+=Ut.window.pageXOffset,this.y+=Ut.window.pageYOffset,new t(this)}init(t){return t="string"==typeof t?t.split(fe).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 Se(this)}merge(e){const r=Math.min(this.x,e.x),n=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-r,s=Math.max(this.y+this.height,e.y+e.height)-n;return new t(r,n,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof Ne||(e=new Ne(e));let r=1/0,n=-1/0,i=1/0,s=-1/0;return[new we(this.x,this.y),new we(this.x2,this.y),new we(this.x,this.y2),new we(this.x2,this.y2)].forEach(function(t){t=t.transform(e),r=Math.min(r,t.x),n=Math.max(n,t.x),i=Math.min(i,t.y),s=Math.max(s,t.y)}),new t(r,i,n-r,s-i)}};function _e(t,e,r){let n;try{if(n=e(t.node),Se(n)&&(i=t.node)!==Ut.document&&!(Ut.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===Ut.document}).call(Ut.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}d({viewbox:{viewbox(t,e,r,n){return null==t?new Ee(this.attr("viewBox")):this.attr("viewBox",new Ee(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 we(r/2/s+i.x,n/2/o+i.y);const c=new Ee(i).transform(new Ne({scale:u,origin:e}));return this.viewbox(c)}}}),Jt(Ee,"Box");var Me=class extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}};te([Me],{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 Te=["toArray","constructor","each"];function Ae(t){let e=(t+"").trim();const r=e.match(/^url\((.*)\)$/i);if(r){e=r[1].trim();const t=e[0];if('"'===t||"'"===t){if(e[e.length-1]!==t)return null;e=e.slice(1,-1)}}const n=e.match(se);return n?n[1].slice(1):null}function Pe(t,e){const r=`#${Ut.window.CSS.escape(e)}`;return 1===t.nodeType&&t.matches(r)?t:t.querySelector(r)}function Ce(t,e,r=`[${e}]`){const n=t.getAttribute("id"),i=t.getRootNode();if(!n||Pe(i,n)!==t)return new Me;const s=[];1===i.nodeType&&i.matches(r)&&Ae(i.getAttribute(e))===n&&s.push(Wt(i));for(const t of i.querySelectorAll(r))Ae(t.getAttribute(e))===n&&s.push(Wt(t));return new Me(s)}Me.extend=function(t){t=t.reduce((t,e)=>((0,At.default)(Te).call(Te,e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t),{}),te([Me],t)};let je=0;const Ie=new WeakMap,Le=new WeakMap,De=()=>Object.create(null);function Re(t){const e=t.getEventHolder();let r=Ie.get(e);return r||(r=De(),Ie.set(e,r)),r}function Ve(t){return t.getEventTarget()}function Fe(t,e,r,n,i){const s=r.bind(n||t),o=i||!1,a=Gt(t),u=Re(a),c=Ve(a);e=Array.isArray(e)?e:e.split(fe);let h=Le.get(r);h||(h=++je,Le.set(r,h)),e.forEach(function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";u[e]=u[e]||De(),u[e][r]=u[e][r]||De(),u[e][r][h]=u[e][r][h]||[],u[e][r][h].push({listener:s,options:o}),c.addEventListener(e,s,o)})}function ke(t,e,r,n){const i=Gt(t),s=Re(i),o=Ve(i);("function"!=typeof r||(r=Le.get(r)))&&(e=Array.isArray(e)?e:(e||"").split(fe)).forEach(function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,c;if(r){if(s[e]&&s[e][a||"*"]){const t=s[e][a||"*"][r];if(!t)return;t.forEach(function(t){o.removeEventListener(e,t.listener,t.options??n??!1)}),delete s[e][a||"*"][r]}}else if(e&&a){if(s[e]&&s[e][a]){for(c in s[e][a])ke(o,[e,a].join("."),c);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ke(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ke(o,[e,u].join("."));delete s[e]}}else{for(t in s)ke(o,t);!function(t){Ie.delete(t.getEventHolder())}(i)}})}var Be=class extends Xt{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=Ve(t);return e instanceof Ut.window.Event||(e=new Ut.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=Re(this)[t.type];if(!e)return!0;for(const r in e)for(const n in e[r])e[r][n].forEach(function(e){e.listener(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 ke(this,t,e,r),this}on(t,e,r,n){return Fe(this,t,e,r,n),this}removeEventListener(){}};function Ue(){}Jt(Be,"EventTarget");const Xe={"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"};var Ye=class 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(fe).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}},ze=class t{constructor(...t){this.init(...t)}convert(e){return new t(this.value,e)}divide(e){return e=new t(e),new t(this/e,this.unit||e.unit)}init(e,r){return r=Array.isArray(e)?e[1]:r,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=r||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(r=e.match(re))&&(this.value=parseFloat(r[1]),"%"===r[5]?this.value/=100:"s"===r[5]&&(this.value*=1e3),this.unit=r[5]):e instanceof t&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new t(e),new t(this-e,this.unit||e.unit)}plus(e){return e=new t(e),new t(this+e,this.unit||e.unit)}times(e){return e=new t(e),new t(this*e,this.unit||e.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 He=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ge=[];var $e=class t extends Be{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=Gt(t)).removeNamespace&&this.node instanceof Ut.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 Gt(t).put(this,e)}children(){return new Me(Pt(this.node.children,function(t){return Wt(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=Zt(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(e,r){return this.put(new t(Ht(e),r))}first(){return Wt(this.node.firstChild)}get(t){return Wt(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=Kt(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Wt(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=Wt(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Wt(e.node.parentNode));return e}put(t,e){return t=Gt(t),this.add(t,e),t}putIn(t,e){return Gt(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=Gt(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,Ft)}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=e??!0,this.writeDataToDom();let r=this;if(null!=t){if(r=Wt(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=e??!1;const n=Ht("wrapper",r),i=Ut.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)}};te($e,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=le.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))?Xe[t]:le.test(e)?parseFloat(e):e;"number"==typeof(e=Ge.reduce((e,r)=>r(t,e,this),e))?e=new ze(e):He.has(t)&&ve.isColor(e)?e=new ve(e):e.constructor===Array&&(e=new Ye(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 function(t,e){return new Me(Pt((e||Ut.document).querySelectorAll(t),function(t){return Wt(t)}))}(t,this.node)},findOne:function(t){return Wt(this.node.querySelector(t))}}),Jt($e,"Dom");var We=class extends $e{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 ze(t).plus(this.x()))}dy(t=0){return this.y(new ze(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,r=this.root(),n=r&&r.node;e||(t=t&&Gt(t).node);const i=new Me;let s=this;for(;(s=s.parent())&&s.node!==Ut.document&&"#document-fragment"!==s.node.nodeName&&(i.push(s),e||s.node!==t)&&(!e||!s.matches(t));)if(n&&s.node===n)return null;return i}reference(t){if(!(t=this.attr(t)))return null;const e=function(t,e){const r=Ae(e);return r?Pe(t.getRootNode(),r):null}(this.node,t);return e?Gt(e):null}root(){const t=this.parent(Yt[zt]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=Lt(this,t,e);return this.width(new ze(r.width)).height(new ze(r.height))}width(t){return this.attr("width",t)}writeDataToDom(t){return((t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))})(this,this.dom,t),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}};te(We,{bbox:function(){const t=_e(this,t=>t.getBBox(),t=>{try{const e=t.clone().addTo(Oe().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 Ee(t)},rbox:function(t){const e=_e(this,t=>t.getBoundingClientRect(),t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)}),r=new Ee(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 we(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Ne(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 Ne(e)}return new Ne(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new Ne}}}),Jt(We,"Element");const qe={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 ve||ve.isRgb(e)||e instanceof We)this.attr(t,e);else for(r=qe[t].length-1;r>=0;r--)null!=e[qe[t][r]]&&this.attr(qe.prefix(t,qe[t][r]),e[qe[t][r]]);return this},d(["Element","Runner"],e)}),d(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Ne(this):this.attr("transform",new Ne(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)}}),d("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new ze(t)):this.rx(t).ry(e)}}),d("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new we(this.node.getPointAtLength(t))}}),d(["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)}}),d("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},{})),d("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(oe).slice(0,-1).map(function(t){const e=t.trim().split("(");return[e[0].trim(),e[1].split(fe).map(function(t){return parseFloat(t)})]}).reverse().reduce(function(t,e){return"matrix"===e[0]?t.lmultiply(Ne.fromArray(e[1])):t[e[0]].apply(t,e[1])},new Ne)},toParent:function(t,e){if(this===t)return this;if(Vt(this.node))return this.addTo(t,e);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 Ne(this).decompose();return null==t?e:e[t]}Ne.isMatrixLike(t)||(t={...t,origin:Dt(t,this)});const r=new Ne(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});var Je=class t extends We{flatten(){return this.each(function(){if(this instanceof t)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()}};Jt(Je,"Container");var Qe=class extends Je{constructor(t,e=t){super($t("defs",t),e)}flatten(){return this}ungroup(){return this}};Jt(Qe,"Defs");var Ke=class extends We{};Jt(Ke,"Shape");var Ze=c({cx:()=>ir,cy:()=>sr,height:()=>ar,rx:()=>tr,ry:()=>er,width:()=>or,x:()=>rr,y:()=>nr});function tr(t){return this.attr("rx",t)}function er(t){return this.attr("ry",t)}function rr(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function nr(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function ir(t){return this.attr("cx",t)}function sr(t){return this.attr("cy",t)}function or(t){return null==t?2*this.rx():this.rx(new ze(t).divide(2))}function ar(t){return null==t?2*this.ry():this.ry(new ze(t).divide(2))}var ur=class extends Ke{constructor(t,e=t){super($t("ellipse",t),e)}size(t,e){const r=Lt(this,t,e);return this.rx(new ze(r.width).divide(2)).ry(new ze(r.height).divide(2))}};te(ur,Ze),d("Container",{ellipse:ee(function(t=0,e=t){return this.put(new ur).size(t,e).move(0,0)})}),Jt(ur,"Ellipse");var cr=class extends $e{constructor(t=Ut.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 $e(Ht("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}};Jt(cr,"Fragment");var hr=c({from:()=>lr,to:()=>dr});function lr(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new ze(t),fy:new ze(e)}):this.attr({x1:new ze(t),y1:new ze(e)})}function dr(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new ze(t),cy:new ze(e)}):this.attr({x2:new ze(t),y2:new ze(e)})}var fr=class extends Je{constructor(t,e){super($t(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 Ee}targets(){return Ce(this.node,"fill")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};te(fr,hr),d({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:ee(function(t,e){return this.put(new fr(t)).update(e)})}}),Jt(fr,"Gradient");var mr=class extends Je{constructor(t,e=t){super($t("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new Ee}targets(){return Ce(this.node,"fill")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};d({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:ee(function(t,e,r){return this.put(new mr).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})})}}),Jt(mr,"Pattern");var pr,yr=class extends Ke{constructor(t,e=t){super($t("image",t),e)}load(t,e){if(!t)return this;const r=new Ut.window.Image;return Fe(r,"load",function(t){const n=this.parent(mr);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof mr&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)},this),Fe(r,"load error",function(){ke(r)}),this.attr("href",r.src=t,Bt)}};pr=function(t,e,r){return"fill"!==t&&"stroke"!==t||de.test(e)&&(e=r.root().defs().image(e)),e instanceof yr&&(e=r.root().defs().pattern(0,0,t=>{t.add(e)})),e},Ge.push(pr),d({Container:{image:ee(function(t,e){return this.put(new yr).size(0,0).load(t,e)})}}),Jt(yr,"Image");var gr=class extends Ye{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 Ee(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(fe).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){Ne.isMatrixLike(t)||(t=new Ne(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}},br=c({MorphArray:()=>vr,height:()=>Or,width:()=>Nr,x:()=>wr,y:()=>xr});const vr=gr;function wr(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function xr(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Nr(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function Or(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}var Sr=class extends Ke{constructor(t,e=t){super($t("line",t),e)}array(){return new gr([[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 gr(t).toLine(),this.attr(t))}size(t,e){const r=Lt(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}};te(Sr,br),d({Container:{line:ee(function(...t){return Sr.prototype.plot.apply(this.put(new Sr),null!=t[0]?t:[0,0,0,0])})}}),Jt(Sr,"Line");var Er=class extends Je{constructor(t,e=t){super($t("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 _r(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}d({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:ee(function(t,e,r){return this.put(new Er).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 Er?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),Jt(Er,"Marker");const Mr={"-":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}}};var Tr=class{done(){return!1}},Ar=class extends Tr{constructor(t=">"){super(),this.ease=Mr[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}},Pr=class extends Tr{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}};function Cr(){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}te(class extends Pr{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:_r("_duration",Cr),overshoot:_r("_overshoot",Cr)}),te(class extends Pr{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:_r("_windup"),p:_r("P"),i:_r("I"),d:_r("D")});const jr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ir={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]]}},Lr="mlhvqtcsaz".split("");for(let t=0,e=Lr.length;t<e;++t)Ir[Lr[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 Ir[t](e,r,n)}}(Lr[t].toUpperCase());function Dr(t){return t.segment.length&&t.segment.length-1===jr[t.segment[0].toUpperCase()]}function Rr(t,e){t.inNumber&&Vr(t,!1);const r=me.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase();t.segment=["m"===r?e===r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function Vr(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,Dr(t)&&Fr(t)}function Fr(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){return Ir[t.segment[0]](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function kr(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 Br(t){return"E"===t.lastToken.toUpperCase()}const Ur=new Set([" ",",","\t","\n","\r","\f"]);var Xr=class extends Ye{bbox(){return Oe().path.setAttribute("d",this.toString()),new Ee(Oe.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 we,p:new we};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!Rr(i,n))if("."!==n)if(isNaN(parseInt(n)))if(Ur.has(n))i.inNumber&&Vr(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(me.test(n)){if(i.inNumber)Vr(i,!1);else{if(!Dr(i))throw new Error("parser Error");Fr(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Br(i)){Vr(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||kr(i)){i.inNumber=!0,i.number=n,Vr(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){Vr(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&Vr(i,!1),i.inSegment&&Dr(i)&&Fr(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 Yr=t=>{const e=typeof t;return"number"===e?ze:"string"===e?ve.isColor(t)?ve:fe.test(t)?me.test(t)?Xr:Ye:re.test(t)?ze:Hr:qr.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Ye:"object"===e?Wr:Hr};var zr=class{constructor(t){this._stepper=t||new Ar("-"),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(Yr(t));let e=new this._type(t);return this._type===ve&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Wr&&(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}},Hr=class{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}},Gr=class t{constructor(...t){this.init(...t)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,t.defaults,e),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}};Gr.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const $r=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;var Wr=class{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]===ve&&t[r+7]!==e[r+7]){const e=t[r+7],n=new ve(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=Yr(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort($r),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();t[r]=new n(e.splice(0,i))}return t}};const qr=[Hr,Gr,Wr];var Jr=class extends Ke{constructor(t,e=t){super($t("path",t),e)}array(){return this._array||(this._array=new Xr(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 Xr(t))}size(t,e){const r=Lt(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)}};Jr.prototype.MorphArray=Xr,d({Container:{path:ee(function(t){return this.put(new Jr).plot(t||new Xr)})}}),Jt(Jr,"Path");var Qr=c({array:()=>Kr,clear:()=>Zr,move:()=>tn,plot:()=>en,size:()=>rn});function Kr(){return this._array||(this._array=new gr(this.attr("points")))}function Zr(){return delete this._array,this}function tn(t,e){return this.attr("points",this.array().move(t,e))}function en(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new gr(t))}function rn(t,e){const r=Lt(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}var nn=class extends Ke{constructor(t,e=t){super($t("polygon",t),e)}};d({Container:{polygon:ee(function(t){return this.put(new nn).plot(t||new gr)})}}),te(nn,br),te(nn,Qr),Jt(nn,"Polygon");var sn=class extends Ke{constructor(t,e=t){super($t("polyline",t),e)}};d({Container:{polyline:ee(function(t){return this.put(new sn).plot(t||new gr)})}}),te(sn,br),te(sn,Qr),Jt(sn,"Polyline");var on=class extends Ke{constructor(t,e=t){super($t("rect",t),e)}};te(on,{rx:tr,ry:er}),d({Container:{rect:ee(function(t,e){return this.put(new on).size(t,e)})}}),Jt(on,"Rect");var an=class{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 un={nextDraw:null,frames:new an,timeouts:new an,immediates:new an,timer:()=>Ut.window.performance||Ut.window.Date,frame(t){const e=un.frames.push({run:t});return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),e},timeout(t,e){e=e||0;const r=un.timer().now()+e,n=un.timeouts.push({run:t,time:r});return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),n},immediate(t){const e=un.immediates.push(t);return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),e},cancelFrame(t){null!=t&&un.frames.remove(t)},clearTimeout(t){null!=t&&un.timeouts.remove(t)},cancelImmediate(t){null!=t&&un.immediates.remove(t)},_draw(t){try{let e=null;const r=un.timeouts.last();for(;(e=un.timeouts.shift())&&(t>=e.time?e.run():un.timeouts.push(e),e!==r););let n=null;const i=un.frames.last();for(;n!==i&&(n=un.frames.shift());)n.run(t);let s=null;for(;s=un.immediates.shift();)s()}finally{const t=un.timeouts.first()||un.frames.first()||un.immediates.first();un.nextDraw=t?Ut.window.requestAnimationFrame(un._draw):null}}},cn=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},hn=function(){const t=Ut.window;return(t.performance||t.Date).now()};var ln=class extends Be{constructor(t=hn){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){this._finishing=!0;try{this.time(this.getEndTimeOfTimeline()+1)}finally{this._finishing=!1}return 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(cn);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),t._retired=!1;const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,t._runnerInfo=o,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),t._runnerInfo=null,t._retired=!0),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return un.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=un.frame(this._step)),this)}_stepFn(t=!1){const e=this._generation,r=this._timeSource();let n=r-this._lastSourceTime;t&&(n=0);const i=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=r,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);const s=this._runners.slice();for(let t=s.length;t--;){const e=s[t];if(e.runner._runnerInfo!==e)continue;const r=e.runner;this._time-e.start<0&&r.reset(!0)}let o=!1;for(const t of this._runners.slice()){if(t.runner._runnerInfo!==t)continue;const e=t.runner;let r=i;const n=this._time-t.start;if(n<0){o=!0;continue}if(0===n){e.reset(),o=!0;continue}if(n<r&&(r=n),!e.active())continue;const s=(this._finishing&&e._isDeclarative?e.finish():e.step(r)).done;e._runnerInfo===t&&(s?!0!==t.persist&&e.duration()-e.time()+this._time+t.persist<=this._time&&e.unschedule():o=!0)}return e!==this._generation||(o||(o=this._runners.some(({start:t,runner:e})=>t>=this._time||e.active()&&!e.done)),o&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished"))),this}terminate(){un.cancelFrame(this._nextFrame),this._generation=(this._generation||0)+1,this._startTime=0,this._speed=1,this._persist=0;for(const{runner:t}of this._runners||[])t._retired=!0,t._runnerInfo=null;this._nextFrame=null,this._paused=!0,this._finishing=!1,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)}};d({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new ln,this._timeline):(this._timeline=t,this)}}});var dn=class t extends Be{constructor(e){super(),this.id=t.id++,e="function"==typeof(e=e??400)?new Pr(e):e,this._element=null,this._timeline=null,this._runnerInfo=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof Pr,this._stepper=this._isDeclarative?e:new Ar,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Ne,this._isAbsoluteTransform=!1,this._hasTransform=!1,this._transformInitialised=!1,this._transformActive=!1,this._retired=!1,this._reverse=!1,this._swing=!1,this._wait=0,this._times=1,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 Tr||(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){return this.transforms.lmultiplyO(t),this._transformInitialised=!0,this._transformActive=!0,this}after(t){return this.on("finished",t)}animate(e,r,n){const i=t.sanitise(e,r,n),s=new t(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new Ne,this}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 Ar(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){if(!this._isDeclarative)return this.time(this.duration());const t=this._time;return this.step(1/0),this._time=t,this}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()),c=s&&u%2==0;return a=u+(c&&!o||o&&c?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._isDeclarative&&(this.done=!1),this._queue.push({initialiser:t||Ue,runner:e||Ue,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(t=!1){if(this._reseted){const e=!t&&this._hasTransform&&0!==this.position();return e&&!this._transformInitialised?(this.step(0),this._reseted=!0,this):(e!==this._transformActive&&(this._transformActive=e,this._element&&this._element._addRunner(this)),this)}return this._reseted||(this.time(0),this._reseted=!0),t&&this._transformActive&&(this._transformActive=!1,this._element&&this._element._addRunner(this)),this}reverse(t){return this._reverse=t??!this._reverse,this}schedule(t,e,r){if(t instanceof ln||(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;const e=this.done;t=t??16,this._time+=t;const r=this.position(),n=this._lastPosition!==r&&this._time>=0;this._lastPosition=r;const i=this.duration(),s=this._lastTime<=0&&this._time>0;this._lastTime=this._time,s&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&this._time>=i,this._reseted=!1;const a=this._hasTransform&&(this._time>0||0!==r);this._transformActive=a;let u=!1;return(n||o)&&(this._initialise(n),this.transforms=new Ne,u=this._run(o?t:r),this._transformActive=a,this.fire("step",this)),this.done=this.done||u&&o,this.done&&!e&&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];if(this._isDeclarative&&n.finished&&!n.isTransform)continue;const 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,this._isDeclarative&&(this.done=!1);const n=this.timeline();return n&&n.play(),!0}return!1}};dn.id=0;var fn=class{constructor(t=new Ne,e=-1,r=!0,n=!1){this.transforms=t,this.id=e,this.done=r,this._isAbsoluteTransform=n,this._transformActive=!0,this._retired=!0}};te([dn,fn],{mergeWith(t){return new fn(this._isAbsoluteTransform?this.transforms:t.transforms.lmultiply(this.transforms),t.id,!0,t._isAbsoluteTransform||this._isAbsoluteTransform)}});const mn=(t,e)=>t.lmultiplyO(e),pn=t=>t.transforms,yn=t=>t._transformActive;function gn(t){const e=t.filter(yn);let r=0;for(let t=0;t<e.length;++t)e[t]._isAbsoluteTransform&&(r=t);return e.slice(r)}function bn(){const t=gn(this._transformationRunners.runners).map(pn).reduce(mn,new Ne);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}var vn=class{constructor(){this.runners=[]}add(t){var e;if(!(0,At.default)(e=this.runners).call(e,t))return this.runners.push(t),this}edit(t,e){const r=this.runners.findIndex(e=>e.id===t);return r>=0&&this.runners.splice(r,1,e),this}getByID(t){return this.runners.find(e=>e.id===t)}length(){return this.runners.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._retired&&t._retired){this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}else t=r}return this}remove(t){const e=this.runners.findIndex(e=>e.id===t);return e>=0&&this.runners.splice(e,1),this}};d({Element:{animate(t,e,r){const n=dn.sanitise(t,e,r),i=this.timeline();return new dn(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_currentTransform(t){const e=this._transformationRunners.runners,r=e.indexOf(t);return gn(e.slice(0,r+1)).map(pn).reduce(mn,new Ne)},_addRunner(t){1===this._transformationRunners.length()&&-1===this._transformationRunners.runners[0].id&&(this._transformationRunners.runners[0].transforms=new Ne(this)),this._transformationRunners.add(t),un.cancelImmediate(this._frameId),this._frameId=un.immediate(bn.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new vn).add(new fn(new Ne(this))))}}}),te(dn,{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});const n=e,i=this._history[t];if(i&&!i.caller.initialised&&i.caller.retarget)return i.caller.retarget.call(this,n),this;if(this._tryRetarget(t,n))return this;let s=new zr(this._stepper).to(n),o=Object.keys(n);return this.queue(function(){s=s.from(this.element()[t](o))},function(e){return this.element()[t](s.at(e).valueOf()),s.done()},function(e){const r=(n=Object.keys(e),i=o,n.filter(t=>!(0,At.default)(i).call(i,t)));var n,i;if(r.length&&null!=s.from()){const e=this.element()[t](r),n=new Wr(s.from()).valueOf();Object.assign(n,e),s.from(n)}const a=new Wr(s.to()).valueOf();Object.assign(a,e),s.to(a),o=Object.keys(a)}),this._rememberMorpher(t,s),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new zr(this._stepper).to(new ze(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._hasTransform=!0,this._isAbsoluteTransform=this._isAbsoluteTransform||!e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Ne.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new zr(this._stepper).type(r?Gr:Ne),s=r?new zr(this._stepper).type(Ne):i;let o,a,u,c,h;return this.queue(function(){a=a||this.element(),o=o||Dt(t,a),h=new Ne(e?void 0:a),a._addRunner(this)},function(l){e||this.clearTransform();const{x:d,y:f}=new we(o).transform(a._currentTransform(this)),m={...t,origin:[d,f]};!0===m.relative&&delete m.relative;let p=new Ne(m),y=this._isDeclarative&&u?u:h,g=i;if(r){const t=p.decompose(d,f),e=y.decompose(d,f);if(new Gr(t).toArray().concat(new Gr(e).toArray()).every(Number.isFinite)){p=t,y=e;const r=p.rotate,n=y.rotate,i=[r-360,r,r+360],s=i.map(t=>Math.abs(t-n)),o=Math.min(...s),a=s.indexOf(o);p.rotate=i[a]}else g=s}e&&g===i&&(n||(p.rotate=t.rotate||0),this._isDeclarative&&c&&(y.rotate=c)),g.from(y),g.to(p);const b=g.at(l);return c=b.rotate,u=new Ne(b),this.addTransform(u),a._addRunner(this),g.done()},function(e){o=Dt(e,a),t={...e}},!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 ze(e),this._tryRetarget(t,e))return this;const r=new zr(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 ze(t))}),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new zr(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 ze(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){const r=Lt(this._element,t,e);return this.width(r.width).height(r.height)},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 zr(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 Ee(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)}}),te(dn,{rx:tr,ry:er,from:lr,to:dr}),Jt(dn,"Runner");var wn=class extends Je{constructor(t,e=t){super($t("svg",t),e),this.namespace()}defs(){return this.isRoot()?Wt(this.node.querySelector("defs"))||this.put(new Qe):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof Ut.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:Ft,version:"1.1"}).attr("xmlns:xlink",Bt,kt):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,kt).attr("xmlns:svgjs",null,kt)}root(){return this.isRoot()?this:super.root()}};d({Container:{nested:ee(function(){return this.put(new wn)})}}),Jt(wn,"Svg",!0);var xn=class extends Je{constructor(t,e=t){super($t("symbol",t),e)}};d({Container:{symbol:ee(function(){return this.put(new xn)})}}),Jt(xn,"Symbol");var Nn=c({amove:()=>In,ax:()=>Cn,ay:()=>jn,build:()=>Ln,center:()=>Pn,cx:()=>Tn,cy:()=>An,length:()=>Sn,move:()=>Mn,plain:()=>On,x:()=>En,y:()=>_n});function On(t){return!1===this._build&&this.clear(),this.node.appendChild(Ut.document.createTextNode(t)),this}function Sn(){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 _n(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function Mn(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function Tn(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function An(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function Pn(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function Cn(t){return this.attr("x",t)}function jn(t){return this.attr("y",t)}function In(t,e){return this.ax(t).ay(e)}function Ln(t){return this._build=!!t,this}var Dn=class extends Ke{constructor(t,e=t){super($t("text",t),e),this.dom.leading=this.dom.leading??new ze(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new ze(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){if(Vt(this.node))return;const i=Ut.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new ze(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 ze(t.leading||1.3),this}writeDataToDom(){return super.writeDataToDom({leading:1.3})}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||Vt(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===Wt(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);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()}};te(Dn,Nn),d({Container:{text:ee(function(t=""){return this.put(new Dn).text(t)}),plain:ee(function(t=""){return this.put(new Dn).plain(t)})}}),Jt(Dn,"Text");var Rn=class extends Ke{constructor(t,e=t){super($t("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 Dn))return this;const e=t.index(this),r=Ut.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new ze(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)}};te(Rn,Nn),d({Tspan:{tspan:ee(function(t=""){const e=new Rn;return this._build||this.clear(),this.put(e).text(t)})},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Jt(Rn,"Tspan");var Vn=class extends Ke{constructor(t,e=t){super($t("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 ze(t).divide(2))}};te(Vn,{x:rr,y:nr,cx:ir,cy:sr,width:or,height:ar}),d({Container:{circle:ee(function(t=0){return this.put(new Vn).size(t).move(0,0)})}}),Jt(Vn,"Circle");var Fn=class extends Je{constructor(t,e=t){super($t("clipPath",t),e)}remove(){return this.targets().forEach(function(t){t.unclip()}),super.remove()}targets(){return Ce(this.node,"clip-path")}};d({Container:{clip:ee(function(){return this.defs().put(new Fn)})},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Fn?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Jt(Fn,"ClipPath");var kn=class extends We{constructor(t,e=t){super($t("foreignObject",t),e)}};d({Container:{foreignObject:ee(function(t,e){return this.put(new kn).size(t,e)})}}),Jt(kn,"ForeignObject");var Bn=c({dmove:()=>Un,dx:()=>Xn,dy:()=>Yn,height:()=>zn,move:()=>Hn,size:()=>Gn,width:()=>$n,x:()=>Wn,y:()=>qn});function Un(t,e){return this.children().forEach(r=>{let n;try{n=r.node instanceof Ut.window.SVGSVGElement?new Ee(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new Ne(r),s=i.translate(t,e).transform(i.inverse()),o=new we(n.x,n.y).transform(s);r.dmove(o.x-n.x,o.y-n.y)}),this}function Xn(t){return this.dmove(t,0)}function Yn(t){return this.dmove(0,t)}function zn(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function Hn(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function Gn(t,e,r=this.bbox()){const n=Lt(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(t=>{const e=new we(r).transform(new Ne(t).inverse());t.scale(i,s,e.x,e.y)}),this}function $n(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function Wn(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function qn(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}var Jn=class extends Je{constructor(t,e=t){super($t("g",t),e)}};te(Jn,Bn),d({Container:{group:ee(function(){return this.put(new Jn)})}}),Jt(Jn,"G");var Qn=class extends Je{constructor(t,e=t){super($t("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,Bt)}};te(Qn,Bn),d({Container:{link:ee(function(t){return this.put(new Qn).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 Qn,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}}}),Jt(Qn,"A");var Kn=class extends Je{constructor(t,e=t){super($t("mask",t),e)}remove(){return this.targets().forEach(function(t){t.unmask()}),super.remove()}targets(){return Ce(this.node,"mask")}};d({Container:{mask:ee(function(){return this.defs().put(new Kn)})},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Kn?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Jt(Kn,"Mask");var Zn=class extends We{constructor(t,e=t){super($t("stop",t),e)}update(t){return("number"==typeof t||t instanceof ze)&&(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 ze(t.offset)),this}};d({Gradient:{stop:function(t,e,r){return this.put(new Zn).update(t,e,r)}}}),Jt(Zn,"Stop");var ti=class extends We{constructor(t,e=t){super($t("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+=jt(t)+":"+e[t]+";";return r+="}",r}(t,e))}};d("Dom",{style(t,e){return this.put(new ti).rule(t,e)},fontface(t,e,r){return this.put(new ti).font(t,e,r)}}),Jt(ti,"Style");var ei=class extends Dn{constructor(t,e=t){super($t("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")}};d({Container:{textPath:ee(function(t,e){return t instanceof Dn||(t=this.text(t)),t.path(e)})},Text:{path:ee(function(t,e=!0){const r=new ei;let n;if(t instanceof Jr||(t=this.defs().path(t)),r.attr("href","#"+t,Bt),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)}),textPath(){return this.findOne("textPath")}},Path:{text:ee(function(t){return t instanceof Dn||(t=(new Dn).addTo(this.parent()).text(t)),t.path(this)}),targets(){return Ce(this.node,"href","textPath")}}}),ei.prototype.MorphArray=Xr,Jt(ei,"TextPath");var ri=class extends Ke{constructor(t,e=t){super($t("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,Bt)}};d({Container:{use:ee(function(t,e){return this.put(new ri).use(t,e)})}}),Jt(ri,"Use"),te([wn,xn,yr,mr,Er],f("viewbox")),te([Sr,sn,nn,Jr],f("marker")),te(Dn,f("Text")),te(Jr,f("Path")),te(Qe,f("Defs")),te([Dn,Rn],f("Tspan")),te([on,ur,fr,dn],f("radius")),te(Be,f("EventTarget")),te($e,f("Dom")),te(We,f("Element")),te(Ke,f("Shape")),te([Je,cr],f("Container")),te(fr,f("Gradient")),te(dn,f("Runner")),Me.extend([...new Set(l)]),function(t=[]){qr.push(...[].concat(t))}([ze,ve,Ee,Ne,Ye,gr,Xr,we]),te(qr,{to(t){return(new zr).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 ni,ii,si,oi,ai=r(726),ui=r(854),ci=r(731),hi=r(986),li=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class di{static create(t){let e=document.createElementNS("http://www.w3.org/2000/svg","text");e.textContent=t;let r=new di(e);return r.assignUUID(),r.setAttributes(di.defaultAttributes),r}static deserialized(t,e){var r;if(!(0,ui.isNonNullObject)(t))throw new Error("Saved base must be an object.");let n=null!==(r=t.id)&&void 0!==r?r:t.textId;if(!n)throw new Error("Missing base ID.");if(!(0,ui.isString)(n))throw new Error("Base IDs must be strings.");let i=e.domNode.querySelector("#"+n);if(!i)throw new Error("Unable to find nucleobase DOM node.");if(!(i instanceof SVGTextElement))throw new Error("Nucleobase DOM node must be an SVG text element.");return new di(i)}static recreate(t,e){return di.deserialized(t,e)}constructor(t){ni.add(this),this.domNode=t,ii.set(this,void 0),si.set(this,{change:[]}),this.centerPoint=new ci.CenterPoint(t),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,ii,new MutationObserver(()=>li(this,ni,"m",oi).call(this,"change"))),li(this,ii,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}serialized(){if(!this.id)throw new Error("Nucleobase ID is falsy.");return{id:this.id}}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}isIn(t){return t.contains(this.domNode)&&t!==this.domNode}hasParent(){return!!this.domNode.parentNode}bringToFront(){(0,ai.bringToFront)(this.domNode)}sendToBack(){(0,ai.sendToBack)(this.domNode)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){try{new Dn(this.domNode).attr(t)}catch(t){}}get id(){return this.domNode.id}assignUUID(){(0,ai.assignUUID)(this.domNode)}get textContent(){return this.domNode.textContent}set textContent(t){this.domNode.textContent=t}isA(){var t;return"A"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isU(){var t;return"U"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isT(){var t;return"T"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isG(){var t;return"G"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isC(){var t;return"C"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}get bbox(){return this.domNode.getBBox()}getCenterPoint(){return this.centerPoint}setCenterPoint(t){this.centerPoint.x=t.x,this.centerPoint.y=t.y}maintainingCenterPoint(t){let{x:e,y:r}=this.centerPoint;t(),this.centerPoint.x=e,this.centerPoint.y=r}get boundingClientRect(){return this.domNode.getBoundingClientRect()}get clientCenterPoint(){let t=this.domNode.getBoundingClientRect();return{x:(0,hi.mean)([t.left,t.right]),y:(0,hi.mean)([t.top,t.bottom])}}getClientCenterPoint(){return this.clientCenterPoint}addEventListener(t,e){li(this,si,"f")[t].push(e)}removeEventListener(t,e){li(this,si,"f")[t]=li(this,si,"f")[t].filter(t=>t!==e)}}ii=new WeakMap,si=new WeakMap,ni=new WeakSet,oi=function(t){li(this,si,"f")[t].forEach(t=>t())},di.defaultAttributes={"font-family":"Arial","font-size":"9","font-weight":"700"},di.defaultAttributeNames=["font-family","font-size","font-weight"];class fi{constructor(t,e){this.base1=t,this.base2=e}[Symbol.iterator](){return[this.base1,this.base2].values()}isAU(){return this.base1.isA()&&this.base2.isU()||this.base1.isU()&&this.base2.isA()}isAT(){return this.base1.isA()&&this.base2.isT()||this.base1.isT()&&this.base2.isA()}isGC(){return this.base1.isG()&&this.base2.isC()||this.base1.isC()&&this.base2.isG()}isGU(){return this.base1.isG()&&this.base2.isU()||this.base1.isU()&&this.base2.isG()}isGT(){return this.base1.isG()&&this.base2.isT()||this.base1.isT()&&this.base2.isG()}}function mi(t,e){let r=new Map;e.forEach((t,e)=>r.set(t,e));let n=[...t];return n.sort((t,e)=>{var n,i;return(null!==(n=r.get(t))&&void 0!==n?n:-1)-(null!==(i=r.get(e))&&void 0!==i?i:-1)}),n}})(),n})(),t.exports=e()},976(t){var e;e=()=>(()=>{var t={645(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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 matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}static bounding(r){let n=[...r];if(0==n.length)throw new Error("An empty collection of boxes doesn't have a bounding box.");let i=n.map(t=>e.matching(t)),s=(0,t.min)(i.map(t=>t.left)),o=(0,t.min)(i.map(t=>t.top)),a=(0,t.max)(i.map(t=>t.right))-s,u=(0,t.max)(i.map(t=>t.bottom))-o;return new e(s,o,a,u)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get centerX(){return this.minX+this.width/2}get centerY(){return this.minY+this.height/2}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}bounds(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){let r="number"==typeof t[0]?t[0]:"factor"in t[0]?t[0].factor*this.width:t[0].percentage/100*this.width,n="number"==typeof t[0]&&"number"==typeof t[1]?t[1]:"number"==typeof t[0]?t[0]:"factor"in t[0]?t[0].factor*this.height:t[0].percentage/100*this.height;return new e(this.x-r,this.y-n,this.width+2*r,this.height+2*n)}get periphery(){return{atAngle:t=>{let e=this.width/2,r=this.height/2,n=Math.pow(Math.pow(e,2)+Math.pow(r,2),.5),i=this.centerX+n*Math.cos(t),s=this.centerY+n*Math.sin(t),o=n;return Math.abs(this.centerX-i)>e&&(o=Math.abs(e/Math.cos(t)),o=Number.isFinite(o)?o:r),Math.abs(this.centerY-s)>r&&(o=Math.abs(r/Math.sin(t)),o=Number.isFinite(o)?o:e),{x:this.centerX+o*Math.cos(t),y:this.centerY+o*Math.sin(t)}}}}}})(),n})(),t.exports=e()},153(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){var e=0;return t.forEach(function(t){return e+=t}),e}function i(t){return n(t)/t.length}function s(t){t.sort(function(t,e){return t-e})}t.r(e),t.d(e,{areWithin:()=>m,average:()=>i,clamp:()=>f,degrees:()=>b,distance:()=>r,flipAway:()=>x,isBetween:()=>l,isBetweenExclusive:()=>d,isBetweenInclusive:()=>l,max:()=>h,mean:()=>i,median:()=>u,min:()=>c,normalizeAngle:()=>w,radians:()=>v,round:()=>g,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>p,sortedNumbers:()=>a,sortedNumbersAscending:()=>a,sortedNumbersDescending:()=>y,sum:()=>n});var o=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 a(t){var e=o([],t,!0);return s(e),e}function u(t){if(0==t.length)return NaN;var e=a(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,n=r-1;return i([e[r],e[n]])}function c(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,r){return t>=e&&t<=r}function d(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function m(t,e,r){return Math.abs(t-e)<=r}function p(t){s(t),t.reverse()}function y(t){var e=a(t);return e.reverse(),e}function g(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function b(t){return t*(180/Math.PI)}function v(t){return t*(Math.PI/180)}function w(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function x(t,e){var r=(e=w(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{StrungElement:()=>d});var t=r(725),e=r(986);const i=r=>({closestLength(n){let i=0,s=r.length;for(let o=0;o<15;o++)(0,t.distance)(n,r.atLength(i))<(0,t.distance)(n,r.atLength(s))?s=(0,e.average)([i,s]):i=(0,e.average)([i,s]);return(0,e.average)([i,s])}});var s,o,a,u,c,h,l=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class d{constructor(t,e){s.add(this),this.owner=e,o.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,o,t),t.domNode.dataset.lineX||l(this,s,"m",a).call(this),t.domNode.dataset.displacementMagnitude&&t.domNode.dataset.displacementDirection||l(this,s,"m",u).call(this),e.addEventListener("change",()=>l(this,s,"m",h).call(this))}get domNode(){return l(this,o,"f").domNode}get rotation(){let t;return t=l(this,o,"f").domNode.dataset.rotation?Number.parseFloat(l(this,o,"f").domNode.dataset.rotation):0,Number.isFinite(t)||(t=0),t}set rotation(t){Number.isFinite(t)?(l(this,o,"f").domNode.dataset.rotation=`${t}`,l(this,s,"m",h).call(this)):console.error(`The specified rotation is nonfinite: ${t}.`)}get lineX(){let t;return t=l(this,o,"f").domNode.dataset.lineX?Number.parseFloat(l(this,o,"f").domNode.dataset.lineX):0,Number.isFinite(t)||(t=0),t}set lineX(t){Number.isFinite(t)?(t<-this.owner.length/2?t=-this.owner.length/2:t>this.owner.length/2&&(t=this.owner.length/2),l(this,o,"f").domNode.dataset.lineX=`${t}`,l(this,s,"m",h).call(this)):console.error(`The specified line X coordinate is nonfinite: ${t}.`)}get displacementMagnitude(){let t;return t=l(this,o,"f").domNode.dataset.displacementMagnitude?Number.parseFloat(l(this,o,"f").domNode.dataset.displacementMagnitude):0,Number.isFinite(t)||(t=0),t}set displacementMagnitude(t){Number.isFinite(t)?(l(this,o,"f").domNode.dataset.displacementMagnitude=`${t}`,l(this,s,"m",h).call(this)):console.error(`The specified displacement magnitude is nonfinite: ${t}.`)}get displacementDirection(){let t;return t=l(this,o,"f").domNode.dataset.displacementDirection?Number.parseFloat(l(this,o,"f").domNode.dataset.displacementDirection):0,Number.isFinite(t)||(t=0),t}set displacementDirection(t){Number.isFinite(t)?(l(this,o,"f").domNode.dataset.displacementDirection=`${t}`,l(this,s,"m",h).call(this)):console.error(`The specified displacement direction is nonfinite: ${t}.`)}get displacementX(){return this.displacementMagnitude*Math.cos(this.displacementDirection)}set displacementX(t){if(!Number.isFinite(t))return void console.error(`The specified displacement X component is nonfinite: ${t}.`);let e=this.displacementY;this.displacementMagnitude=Math.pow(Math.pow(t,2)+Math.pow(e,2),.5),this.displacementDirection=Math.atan2(e,t)}get displacementY(){return this.displacementMagnitude*Math.sin(this.displacementDirection)}set displacementY(t){if(!Number.isFinite(t))return void console.error(`The specified displacement Y component is nonfinite: ${t}.`);let e=this.displacementX;this.displacementMagnitude=Math.pow(Math.pow(e,2)+Math.pow(t,2),.5),this.displacementDirection=Math.atan2(t,e)}drag(t,e,r){var n;if(!Number.isFinite(t))return void console.error(`The specified drag X value is nonfinite: ${t}.`);if(!Number.isFinite(e))return void console.error(`The specified drag Y value is nonfinite: ${e}.`);if(null===(n=null==r?void 0:r.dragGroup)||void 0===n?void 0:n.has(this.owner))return;let i=Math.pow(Math.pow(t,2)+Math.pow(e,2),.5),o=Math.atan2(e,t),a=l(this,s,"a",c);this.displacementX+=i*Math.cos(o-a.direction),this.displacementY+=i*Math.sin(o-a.direction)}}o=new WeakMap,s=new WeakSet,a=function(){let t={x:l(this,o,"f").centerX,y:l(this,o,"f").centerY},e=this.owner.length/2;l(this,o,"f").domNode.dataset.lineX=""+(i(this.owner).closestLength(t)-e)},u=function(){let e=l(this,s,"a",c),r={x:l(this,o,"f").centerX,y:l(this,o,"f").centerY};l(this,o,"f").domNode.dataset.displacementMagnitude=`${(0,t.distance)(e,r)}`,l(this,o,"f").domNode.dataset.displacementDirection=""+((0,t.direction)(e,r)-e.direction)},c=function(){let t=this.owner.length/2;return this.owner.atLength(t+this.lineX)},h=function(){let t=l(this,s,"a",c);l(this,o,"f").centerX=t.x+this.displacementMagnitude*Math.cos(this.displacementDirection+t.direction),l(this,o,"f").centerY=t.y+this.displacementMagnitude*Math.sin(this.displacementDirection+t.direction),"direction"in l(this,o,"f")&&(l(this,o,"f").direction=t.direction+this.rotation)}})(),n})(),t.exports=e()},731(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,{CenterPoint:()=>c});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver(()=>u(this,r,"m",o).call(this,"move")),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter(t=>t!==e)}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach(t=>t())},e})(),t.exports=e()},456(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()},277(t){var e;e=()=>(()=>{var t={854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),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,{Vector:()=>e,isFiniteVectorLike:()=>s,isVectorLike:()=>i});var t=r(854);class e{static matching(t){let r="x"in t?t.x:t.magnitude*Math.cos(t.direction),n="y"in t?t.y:t.magnitude*Math.sin(t.direction);return new e(r,n)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}isFinite(){return(0,t.isFiniteNumber)(this.x)&&(0,t.isFiniteNumber)(this.y)}}function i(e){return!(!(0,t.isNonNullObject)(e)||!((0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)||(0,t.isNumber)(e.magnitude)&&(0,t.isNumber)(e.direction)))}function s(t){return!!i(t)&&e.matching(t).isFinite()}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{FinitePoint:()=>s,Point:()=>i,RelativePoint:()=>d,midpoint:()=>m});var t=r(277),e=r(854);class i{static matching(t){return new i(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}set(t){(0,e.isNumber)(null==t?void 0:t.x)&&(this.x=t.x),(0,e.isNumber)(null==t?void 0:t.y)&&(this.y=t.y)}drag(t,e){this.displace({x:t,y:e})}displace(e){let r=t.Vector.matching(e);this.x+=r.x,this.y+=r.y}displaced(t){let e=i.matching(this);return e.displace(t),e}displacementTo(e){return new t.Vector(e.x-this.x,e.y-this.y)}displacementFrom(e){return new t.Vector(this.x-e.x,this.y-e.y)}distanceTo(t){return this.displacementTo(t).magnitude}distanceFrom(t){return this.distanceTo(t)}directionTo(t){return this.displacementTo(t).direction}directionFrom(t){return this.displacementFrom(t).direction}deepCopy(){return new i(this.x,this.y)}}class s extends i{static matching(t){let e=i.matching(t);return new s(e.x,e.y)}constructor(t,r){if(super(t,r),!(0,e.isFiniteNumber)(t)||!(0,e.isFiniteNumber)(r))throw new Error(`Finite points must have finite number coordinates: (${t}, ${r}).`)}set(...t){let e=new i(0,0);e.set(...t),s.matching(e),super.set(...t)}}var o,a,u,c,h,l=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class d{constructor(e){o.add(this),a.set(this,void 0),u.set(this,new t.Vector(0,0)),c.set(this,{move:[]}),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,a,e),e.addEventListener("move",()=>l(this,o,"m",h).call(this,"move"))}get x(){return l(this,a,"f").x+l(this,u,"f").x}set x(t){l(this,u,"f").x=t-l(this,a,"f").x,l(this,o,"m",h).call(this,"move")}get y(){return l(this,a,"f").y+l(this,u,"f").y}set y(t){l(this,u,"f").y=t-l(this,a,"f").y,l(this,o,"m",h).call(this,"move")}addEventListener(t,e){l(this,c,"f")[t].push(e)}removeEventListener(t,e){l(this,c,"f")[t]=l(this,c,"f")[t].filter(t=>t!==e)}}a=new WeakMap,u=new WeakMap,c=new WeakMap,o=new WeakSet,h=function(t){l(this,c,"f")[t].forEach(t=>t())};var f=r(986);function m(t,e){return new i((0,f.average)([t.x,e.x]),(0,f.average)([t.y,e.y]))}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Circle:()=>d,Rectangle:()=>w,StrungCircle:()=>L,StrungElement:()=>U,StrungRectangle:()=>V,StrungText:()=>C,StrungTriangle:()=>B,Text:()=>l,Triangle:()=>M});const t={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let e;const i=new Uint8Array(16),s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).slice(1));function o(t,r,n){const o=(t=t||{}).random??t.rng?.()??function(){if(!e){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");e=crypto.getRandomValues.bind(crypto)}return e(i)}();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,r){if((n=n||0)<0||n+16>r.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let t=0;t<16;++t)r[n+t]=o[t];return r}return function(t,e=0){return(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase()}(o)}const a=function(e,r,n){return!t.randomUUID||r||e?o(e,r,n):t.randomUUID()};var u=r(645),c=r(731),h=r(854);class l{static create(t){let e=document.createElementNS("http://www.w3.org/2000/svg","text");return e.id="id-"+a(),e.textContent=null!=t?t:"",e.setAttribute("font-family","Arial"),e.setAttribute("font-size","9"),e.setAttribute("font-weight","700"),e.setAttribute("font-style","normal"),e.setAttribute("fill","black"),e.setAttribute("fill-opacity","1"),new l(e)}constructor(t){this.domNode=t}get id(){return this.domNode.id}get bbox(){return u.Box.matching(this.domNode.getBBox())}get centerX(){return this.bbox.centerX}set centerX(t){new c.CenterPoint(this.domNode).x=t}get centerY(){return this.bbox.centerY}set centerY(t){new c.CenterPoint(this.domNode).y=t}drag(t,e){this.centerX+=t,this.centerY+=e}serialized(){if(!this.id)throw new Error("Text element ID is falsy.");return{id:this.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved text element is not an object: ${t}.`);if(!t.id)throw new Error("Saved text element ID is falsy.");if(!(0,h.isString)(t.id))throw new Error(`Saved text element ID is not a string: ${t.id}.`);let r=e.domNode.querySelector("#"+t.id);if(!r)throw new Error("Unable to find text element DOM node in parent drawing by ID.");if(!(r instanceof SVGTextElement))throw new Error(`Text element DOM node is not an SVG text element: ${r}.`);return new l(r)}}class d{static create(){let t=document.createElementNS("http://www.w3.org/2000/svg","circle");return t.id="id-"+a(),t.setAttribute("r","6"),t.setAttribute("stroke","black"),t.setAttribute("stroke-width","1"),t.setAttribute("stroke-opacity","1"),t.setAttribute("stroke-dasharray",""),t.setAttribute("stroke-linecap",""),t.setAttribute("fill","white"),t.setAttribute("fill-opacity","1"),new d(t)}constructor(t){this.domNode=t}get id(){return this.domNode.id}get centerX(){return this.domNode.cx.baseVal.value}set centerX(t){this.domNode.setAttribute("cx",`${t}`)}get centerY(){return this.domNode.cy.baseVal.value}set centerY(t){this.domNode.setAttribute("cy",`${t}`)}drag(t,e){this.centerX+=t,this.centerY+=e}serialized(){if(!this.id)throw new Error("Circle ID is falsy.");return{id:this.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved circle must be an object: ${t}.`);if(!t.id)throw new Error("Saved circle ID is falsy.");if(!(0,h.isString)(t.id))throw new Error(`Saved circle ID must be a string: ${t.id}.`);let r=e.domNode.querySelector("#"+t.id);if(!r)throw new Error("Unable to find circle element DOM node by ID.");if(!(r instanceof SVGCircleElement))throw new Error(`Circle element DOM node is not an SVG circle element: ${r}.`);return new d(r)}}var f=r(456);class m{constructor(){this.centerX=0,this.centerY=0,this.direction=-Math.PI/2,this.width=0,this.height=0,this.cornerRadius=0}static matching(t){let e=new m;return e.centerX=t.centerX,e.centerY=t.centerY,e.direction=t.direction,e.width=t.width,e.height=t.height,e.cornerRadius=t.cornerRadius,e}toString(){let t=new f.Point(this.centerX,this.centerY);t.displace({magnitude:this.height/2,direction:this.direction}),t.displace({magnitude:this.width/2-this.cornerRadius,direction:this.direction+Math.PI/2});let e=`M ${t.x} ${t.y}`;return t.displace({magnitude:Math.SQRT2*this.cornerRadius,direction:this.direction+3*Math.PI/4}),e+=` A ${this.cornerRadius} ${this.cornerRadius} 90 0 1 ${t.x} ${t.y}`,t.displace({magnitude:this.height-2*this.cornerRadius,direction:this.direction+Math.PI}),e+=` L ${t.x} ${t.y}`,t.displace({magnitude:Math.SQRT2*this.cornerRadius,direction:this.direction+5*Math.PI/4}),e+=` A ${this.cornerRadius} ${this.cornerRadius} 90 0 1 ${t.x} ${t.y}`,t.displace({magnitude:this.width-2*this.cornerRadius,direction:this.direction+3*Math.PI/2}),e+=` L ${t.x} ${t.y}`,t.displace({magnitude:Math.SQRT2*this.cornerRadius,direction:this.direction+7*Math.PI/4}),e+=` A ${this.cornerRadius} ${this.cornerRadius} 90 0 1 ${t.x} ${t.y}`,t.displace({magnitude:this.height-2*this.cornerRadius,direction:this.direction}),e+=` L ${t.x} ${t.y}`,t.displace({magnitude:Math.SQRT2*this.cornerRadius,direction:this.direction+9*Math.PI/4}),e+=` A ${this.cornerRadius} ${this.cornerRadius} 90 0 1 ${t.x} ${t.y}`,e+=" Z",e}}var p,y,g,b,v=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{static create(){let t=document.createElementNS("http://www.w3.org/2000/svg","path");t.id="id-"+a();let e=new w(t);return e.centerX=0,e.centerY=0,e.direction=-Math.PI/2,e.width=5.5,e.height=5.5,e.cornerRadius=0,e.domNode.setAttribute("stroke","black"),e.domNode.setAttribute("stroke-width","1"),e.domNode.setAttribute("stroke-opacity","1"),e.domNode.setAttribute("stroke-linejoin",""),e.domNode.setAttribute("stroke-dasharray",""),e.domNode.setAttribute("stroke-linecap",""),e.domNode.setAttribute("fill","white"),e.domNode.setAttribute("fill-opacity","1"),e}constructor(t){p.add(this),this.domNode=t,t.dataset.centerX||v(this,p,"m",y).call(this),t.dataset.centerY||v(this,p,"m",g).call(this)}get id(){return this.domNode.id}get centerX(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.centerX)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set centerX(t){Number.isFinite(t)?(this.domNode.dataset.centerX=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified center X coordinate is nonfinite: ${t}.`)}get centerY(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.centerY)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set centerY(t){Number.isFinite(t)?(this.domNode.dataset.centerY=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified center Y coordinate is nonfinite: ${t}.`)}drag(t,e){this.centerX+=t,this.centerY+=e}get direction(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.direction)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set direction(t){Number.isFinite(t)?(this.domNode.dataset.direction=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified direction angle is nonfinite: ${t}.`)}get width(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.width)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set width(t){Number.isFinite(t)?(this.domNode.dataset.width=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified width is nonfinite: ${t}.`)}get height(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.height)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set height(t){Number.isFinite(t)?(this.domNode.dataset.height=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified height is nonfinite: ${t}.`)}get cornerRadius(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.cornerRadius)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set cornerRadius(t){Number.isFinite(t)?(this.domNode.dataset.cornerRadius=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified corner radius is nonfinite: ${t}.`)}get bbox(){return u.Box.matching(this.domNode.getBBox())}serialized(){if(!this.id)throw new Error("Rectangle ID is falsy.");return{id:this.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved rectangle is not an object: ${t}.`);if(!t.id)throw new Error("Saved rectangle ID is falsy.");if(!(0,h.isString)(t.id))throw new Error(`Saved rectangle ID is not a string: ${t.id}.`);let r=e.domNode.querySelector("#"+t.id);if(!r)throw new Error("Unable to find saved rectangle DOM node in parent drawing by ID.");if(!(r instanceof SVGPathElement))throw new Error(`DOM node found for saved rectangle is not an SVG path element: ${r}.`);let n=new w(r);return(0,h.isFiniteNumber)(t.width)&&(n.domNode.dataset.width=`${t.width}`),(0,h.isFiniteNumber)(t.height)&&(n.domNode.dataset.height=`${t.height}`),(0,h.isFiniteNumber)(t.borderRadius)&&(n.domNode.dataset.cornerRadius=`${t.borderRadius}`),n}}p=new WeakSet,y=function(){let t=u.Box.matching(this.domNode.getBBox());this.domNode.dataset.centerX=`${t.centerX}`},g=function(){let t=u.Box.matching(this.domNode.getBBox());this.domNode.dataset.centerY=`${t.centerY}`},b=function(){let t=new m;t.centerX=this.centerX,t.centerY=this.centerY,t.direction=this.direction,t.width=this.width,t.height=this.height,t.cornerRadius=this.cornerRadius,this.domNode.setAttribute("d",t.toString())};class x{constructor(){this.centerX=0,this.centerY=0,this.direction=-Math.PI/2,this.width=0,this.height=0,this.tailsHeight=0}static matching(t){let e=new x;return e.centerX=t.centerX,e.centerY=t.centerY,e.direction=t.direction,e.width=t.width,e.height=t.height,e.tailsHeight=t.tailsHeight,e}toString(){let t=new f.Point(this.centerX,this.centerY),e=t.displaced({magnitude:this.height/2,direction:this.direction}),r=t.displaced({magnitude:this.width/2,direction:this.direction-Math.PI/2}).displaced({magnitude:this.height/2,direction:this.direction+Math.PI}),n=t.displaced({magnitude:this.width/2,direction:this.direction+Math.PI/2}).displaced({magnitude:this.height/2,direction:this.direction+Math.PI}),i=t.displaced({magnitude:this.height/2-this.tailsHeight,direction:this.direction+Math.PI});return`M ${e.x} ${e.y} L ${n.x} ${n.y} L ${i.x} ${i.y} L ${r.x} ${r.y} Z`}}var N,O,S,E,_=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class M{static create(){let t=document.createElementNS("http://www.w3.org/2000/svg","path");t.id="id-"+a();let e=new M(t);return e.centerX=0,e.centerY=0,e.direction=-Math.PI/2,e.width=6.5,e.height=6.5,e.tailsHeight=0,e.domNode.setAttribute("stroke","black"),e.domNode.setAttribute("stroke-width","1"),e.domNode.setAttribute("stroke-opacity","1"),e.domNode.setAttribute("stroke-linejoin",""),e.domNode.setAttribute("stroke-dasharray",""),e.domNode.setAttribute("stroke-linecap",""),e.domNode.setAttribute("fill","white"),e.domNode.setAttribute("fill-opacity","1"),e}constructor(t){N.add(this),this.domNode=t,t.dataset.centerX||_(this,N,"m",O).call(this),t.dataset.centerY||_(this,N,"m",S).call(this)}get id(){return this.domNode.id}get centerX(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.centerX)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set centerX(t){Number.isFinite(t)?(this.domNode.dataset.centerX=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified center X coordinate is nonfinite: ${t}.`)}get centerY(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.centerY)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set centerY(t){Number.isFinite(t)?(this.domNode.dataset.centerY=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified center Y coordinate is nonfinite: ${t}.`)}drag(t,e){this.centerX+=t,this.centerY+=e}get direction(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.direction)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set direction(t){Number.isFinite(t)?(this.domNode.dataset.direction=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified direction angle is nonfinite: ${t}.`)}get width(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.width)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set width(t){Number.isFinite(t)?(this.domNode.dataset.width=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified width is nonfinite: ${t}.`)}get height(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.height)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set height(t){Number.isFinite(t)?(this.domNode.dataset.height=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified height is nonfinite: ${t}.`)}get tailsHeight(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.tailsHeight)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set tailsHeight(t){Number.isFinite(t)?(this.domNode.dataset.tailsHeight=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified tails height is nonfinite: ${t}.`)}get bbox(){return u.Box.matching(this.domNode.getBBox())}serialized(){if(!this.id)throw new Error("Triangle ID is falsy.");return{id:this.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved triangle is not an object: ${t}.`);if(!t.id)throw new Error("Saved triangle ID is falsy.");if(!(0,h.isString)(t.id))throw new Error(`Saved triangle ID is not a string: ${t.id}.`);let r=e.domNode.querySelector("#"+t.id);if(!r)throw new Error("Unable to find saved triangle DOM node in parent drawing by ID.");if(!(r instanceof SVGPathElement))throw new Error(`DOM node found for saved triangle is not an SVG path element: ${r}.`);let n=new M(r);return(0,h.isFiniteNumber)(t.width)&&(n.domNode.dataset.width=`${t.width}`),(0,h.isFiniteNumber)(t.height)&&(n.domNode.dataset.height=`${t.height}`),(0,h.isFiniteNumber)(t.tailsHeight)&&(n.domNode.dataset.tailsHeight=`${t.tailsHeight}`),n}}N=new WeakSet,O=function(){let t=u.Box.matching(this.domNode.getBBox());this.domNode.dataset.centerX=`${t.centerX}`},S=function(){let t=u.Box.matching(this.domNode.getBBox());this.domNode.dataset.centerY=`${t.centerY}`},E=function(){let t=new x;t.centerX=this.centerX,t.centerY=this.centerY,t.direction=this.direction,t.width=this.width,t.height=this.height,t.tailsHeight=this.tailsHeight,this.domNode.setAttribute("d",t.toString())};var T,A=r(153),P=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class C extends A.StrungElement{static on(t){let e=l.create();e.domNode.textContent="Text",e.domNode.setAttribute("font-size","7");let r=new C(e,t);return r.lineX=0,r.displacementMagnitude=0,r}constructor(t,e){super(t,e),T.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,T,t)}get textContent(){return this.domNode.textContent}serialized(){return{text:P(this,T,"f").serialized(),ownerID:this.owner.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung text isn't an object: ${t}.`);let r=l.recreate(t.text,e);if(!(0,h.isString)(t.ownerID))throw new Error(`Saved strung text owner ID isn't a string: ${t.ownerID}.`);if(!t.ownerID)throw new Error("Saved strung text owner ID is an empty string.");let n=e.bonds.find(e=>e.id==t.ownerID);if(!n)throw new Error(`Saved strung text owner wasn't found in the parent drawing: ${t}.`);return new C(r,n)}}T=new WeakMap;var j,I=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class L extends A.StrungElement{static on(t){let e=d.create();e.domNode.setAttribute("r","3");let r=new L(e,t);return r.lineX=0,r.displacementMagnitude=0,r}constructor(t,e){super(t,e),j.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,j,t)}serialized(){return{circle:I(this,j,"f").serialized(),ownerID:this.owner.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung circle isn't an object: ${t}.`);let r=d.recreate(t.circle,e);if(!(0,h.isString)(t.ownerID))throw new Error(`Saved strung circle owner ID isn't a string: ${t.ownerID}.`);if(!t.ownerID)throw new Error("Saved strung circle owner ID is an empty string.");let n=e.bonds.find(e=>e.id===t.ownerID);if(!n)throw new Error(`Saved strung circle owner wasn't found in the parent drawing: ${t}.`);return new L(r,n)}}j=new WeakMap;var D,R=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class V extends A.StrungElement{static on(t){let e=w.create(),r=new V(e,t);return r.lineX=0,r.displacementMagnitude=0,r}constructor(t,e){super(t,e),D.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,D,t)}get width(){return R(this,D,"f").width}set width(t){R(this,D,"f").width=t}get height(){return R(this,D,"f").height}set height(t){R(this,D,"f").height=t}get cornerRadius(){return R(this,D,"f").cornerRadius}set cornerRadius(t){R(this,D,"f").cornerRadius=t}serialized(){return{rectangle:R(this,D,"f").serialized(),ownerID:this.owner.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung rectangle isn't an object: ${t}.`);let r=w.recreate(t.rectangle,e);if(!(0,h.isString)(t.ownerID))throw new Error(`Saved strung rectangle owner ID isn't a string: ${t.ownerID}.`);if(!t.ownerID)throw new Error("Saved strung rectangle owner ID is an empty string.");let n=e.bonds.find(e=>e.id===t.ownerID);if(!n)throw new Error(`Saved strung rectangle owner wasn't found in the parent drawing: ${t}.`);return(0,h.isFiniteNumber)(t.rotation)&&(r.domNode.dataset.rotation=`${t.rotation}`),new V(r,n)}}D=new WeakMap;var F,k=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class B extends A.StrungElement{static on(t){let e=M.create(),r=new B(e,t);return r.lineX=0,r.displacementMagnitude=0,r}constructor(t,e){super(t,e),F.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,F,t)}get width(){return k(this,F,"f").width}set width(t){k(this,F,"f").width=t}get height(){return k(this,F,"f").height}set height(t){k(this,F,"f").height=t}get tailsHeight(){return k(this,F,"f").tailsHeight}set tailsHeight(t){k(this,F,"f").tailsHeight=t}serialized(){return{triangle:k(this,F,"f").serialized(),ownerID:this.owner.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung triangle isn't an object: ${t}.`);let r=M.recreate(t.triangle,e);if(!(0,h.isString)(t.ownerID))throw new Error(`Saved strung triangle owner ID isn't a string: ${t.ownerID}.`);if(!t.ownerID)throw new Error("Saved strung triangle owner ID is an empty string.");let n=e.bonds.find(e=>e.id===t.ownerID);if(!n)throw new Error(`Saved strung triangle owner wasn't found in the parent drawing: ${t}.`);return(0,h.isFiniteNumber)(t.rotation)&&(r.domNode.dataset.rotation=`${t.rotation}`),new B(r,n)}}F=new WeakMap;const U={recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung element isn't an object: ${t}.`);if("text"in t)return C.recreate(t,e);if("circle"in t)return L.recreate(t,e);if("rectangle"in t)return V.recreate(t,e);if("triangle"in t)return B.recreate(t,e);throw new Error(`Saved strung element doesn't have a recognized element type: ${t}.`)}}})(),n})(),t.exports=e()},726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>Q,Circle:()=>u,CoordinateSystem:()=>ot,Ellipse:()=>c,ForeignObject:()=>H,HorizontalClientScaling:()=>ut,Image:()=>Y,InnerXML:()=>mt,Line:()=>a,OuterXML:()=>gt,Path:()=>X,Polygon:()=>p,Polyline:()=>m,Rect:()=>h,SVG:()=>t,Scaling:()=>at,Text:()=>o,Texts:()=>J,Use:()=>z,VerticalClientScaling:()=>ct,assignUUID:()=>st,bringToFront:()=>ht,drawOnCanvas:()=>xt,isSVGGraphicsElement:()=>bt,isSVGGraphicsElementsArray:()=>wt,sendToBack:()=>lt,setAttributes:()=>et,shift:()=>G});class t{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var e,i=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class s{constructor(t){e.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,e,t)}isEmpty(){return 0==i(this,e,"f").numberOfItems}shift(t){for(let r=0;r<i(this,e,"f").numberOfItems;r++)i(this,e,"f").getItem(r).value+=t}}e=new WeakMap;class o{constructor(t){this.domNode=t}shift(t,e){let r=new s(this.domNode.x.baseVal),n=new s(this.domNode.y.baseVal);r.shift(t),n.shift(e),r.isEmpty()&&this.domNode.setAttribute("x",`${t}`),n.isEmpty()&&this.domNode.setAttribute("y",`${e}`),this.domNode.querySelectorAll("tspan").forEach(r=>{new s(r.x.baseVal).shift(t),new s(r.y.baseVal).shift(e)})}}class a{constructor(t){this.domNode=t}shift(t,e){this.domNode.x1.baseVal.value+=t,this.domNode.y1.baseVal.value+=e,this.domNode.x2.baseVal.value+=t,this.domNode.y2.baseVal.value+=e}}class u{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class c{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class h{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var l,d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(t){l.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,l,t)}shift(t,e){for(let r=0;r<d(this,l,"f").numberOfItems;r++){let n=d(this,l,"f").getItem(r);n.x+=t,n.y+=e}}}l=new WeakMap;class m{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}class p{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}var y=r(725);const g=" ";function b([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function v(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const w=Math.PI;function x(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:n,rY:i}=t;const{x:s,y:o}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+o)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*w,[u,c]=b([(e-s)/2,(r-o)/2],-a),h=Math.pow(u,2)/Math.pow(n,2)+Math.pow(c,2)/Math.pow(i,2);1<h&&(n*=Math.sqrt(h),i*=Math.sqrt(h)),t.rX=n,t.rY=i;const l=Math.pow(n,2)*Math.pow(c,2)+Math.pow(i,2)*Math.pow(u,2),d=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-l)/l)),f=n*c/i*d,m=-i*u/n*d,p=b([f,m],a);t.cX=p[0]+(e+s)/2,t.cY=p[1]+(r+o)/2,t.phi1=Math.atan2((c-m)/i,(u-f)/n),t.phi2=Math.atan2((-c-m)/i,(-u-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*w),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*w),t.phi1*=180/w,t.phi2*=180/w}function N(t,e,r){v(t,e,r);const n=t*t+e*e-r*r;if(0>n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}const O=Math.PI/180;function S(t,e,r){return(1-r)*t+r*e}function E(t,e,r,n){return t+Math.cos(n/180*w)*e+Math.sin(n/180*w)*r}function _(t,e,r,n){const i=1e-6,s=e-t,o=r-e,a=3*s+3*(n-r)-6*o,u=6*(o-s),c=3*s;return Math.abs(a)<i?Math.abs(u)<i?[]:[-c/u]:function(t,e,r=1e-6){const n=t*t/4-e;if(n<-r)return[];if(n<=r)return[-t/2];const i=Math.sqrt(n);return[-t/2-i,-t/2+i]}(u/a,c/a,i)}function M(t,e,r,n,i){const s=1-i;return t*(s*s*s)+e*(3*s*s*i)+r*(3*s*i*i)+n*(i*i*i)}function T(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],s=r[0]-t[0],o=r[1]-t[1],a=n*o-i*s;if(!(Math.abs(a)<1e-10))return!1;const u=n*s+i*o,c=s*s+o*o;return 0<=u&&u<=c&&n*n+i*i<=c}function A(t){const e=t[t.length-1]?.type===B.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:B.MOVE_TO,relative:!1,x:t[r].x,y:t[r].y}];for(let e=r;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case B.HORIZ_LINE_TO:n.push({type:B.HORIZ_LINE_TO,relative:!1,x:i.x});break;case B.VERT_LINE_TO:n.push({type:B.VERT_LINE_TO,relative:!1,y:i.y});break;case B.LINE_TO:case B.MOVE_TO:n.push({type:B.LINE_TO,relative:!1,x:i.x,y:i.y});break;case B.CURVE_TO:n.push({type:B.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case B.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case B.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case B.ARC:throw new Error("Unsupported command: A (arc)");case B.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:B.CLOSE_PATH}),n}function P(){return I((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t))}function C(){let t=NaN,e=NaN,r=NaN,n=NaN;return I((i,s,o)=>(i.type&B.SMOOTH_CURVE_TO&&(i.type=B.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?o:e,i.x1=i.relative?s-t:2*s-t,i.y1=i.relative?o-e:2*o-e),i.type&B.CURVE_TO?(t=i.relative?s+i.x2:i.x2,e=i.relative?o+i.y2:i.y2):(t=NaN,e=NaN),i.type&B.SMOOTH_QUAD_TO&&(i.type=B.QUAD_TO,r=isNaN(r)?s:r,n=isNaN(n)?o:n,i.x1=i.relative?s-r:2*s-r,i.y1=i.relative?o-n:2*o-n),i.type&B.QUAD_TO?(r=i.relative?s+i.x1:i.x1,n=i.relative?o+i.y1:i.y1):(r=NaN,n=NaN),i))}function j(){let t=NaN,e=NaN;return I((r,n,i)=>{if(r.type&B.SMOOTH_QUAD_TO&&(r.type=B.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?i:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?i-e:2*i-e),r.type&B.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const s=r.x1,o=r.y1;r.type=B.CURVE_TO,r.x1=((r.relative?0:n)+2*s)/3,r.y1=((r.relative?0:i)+2*o)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*o)/3}else t=NaN,e=NaN;return r})}function I(t){let e=0,r=0,n=NaN,i=NaN;return function(s){if(isNaN(n)&&!(s.type&B.MOVE_TO))throw new Error("path must start with moveto");const o=t(s,e,r,n,i);return s.type&B.CLOSE_PATH&&(e=n,r=i),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&B.MOVE_TO&&(n=e,i=r),o}}function L(t,e,r,n,i,s){return v(t,e,r,n,i,s),I((o,a,u,c)=>{const h=o.x1,l=o.x2,d=o.relative&&!isNaN(c),f=void 0!==o.x?o.x:d?0:a,m=void 0!==o.y?o.y:d?0:u;function p(t){return t*t}o.type&B.HORIZ_LINE_TO&&0!==e&&(o.type=B.LINE_TO,o.y=o.relative?0:u),o.type&B.VERT_LINE_TO&&0!==r&&(o.type=B.LINE_TO,o.x=o.relative?0:a),void 0!==o.x&&(o.x=o.x*t+m*r+(d?0:i)),void 0!==o.y&&(o.y=f*e+o.y*n+(d?0:s)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*r+(d?0:i)),void 0!==o.y1&&(o.y1=h*e+o.y1*n+(d?0:s)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*r+(d?0:i)),void 0!==o.y2&&(o.y2=l*e+o.y2*n+(d?0:s));const y=t*n-e*r;if(void 0!==o.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===y)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=B.LINE_TO;else{const i=o.xRot*Math.PI/180,s=Math.sin(i),a=Math.cos(i),u=1/p(o.rX),c=1/p(o.rY),h=p(a)*u+p(s)*c,l=2*s*a*(u-c),d=p(s)*u+p(a)*c,f=h*n*n-l*e*n+d*e*e,m=l*(t*n+e*r)-2*(h*r*n+d*t*e),g=h*r*r-l*t*r+d*t*t,b=(Math.atan2(m,f-g)+Math.PI)%Math.PI/2,v=Math.sin(b),w=Math.cos(b);o.rX=Math.abs(y)/Math.sqrt(f*p(w)+m*v*w+g*p(v)),o.rY=Math.abs(y)/Math.sqrt(f*p(v)-m*v*w+g*p(w)),o.xRot=180*b/Math.PI}return void 0!==o.sweepFlag&&0>y&&(o.sweepFlag=+!o.sweepFlag),o})}const D={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return v(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:P,TO_REL:function(){return I((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,n=!0){return I((i,s,o,a,u)=>{if(isNaN(a)&&!(i.type&B.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&B.HORIZ_LINE_TO&&(i.type=B.LINE_TO,i.y=i.relative?0:o),r&&i.type&B.VERT_LINE_TO&&(i.type=B.LINE_TO,i.x=i.relative?0:s),t&&i.type&B.CLOSE_PATH&&(i.type=B.LINE_TO,i.x=i.relative?a-s:a,i.y=i.relative?u-o:u),i.type&B.ARC&&(0===i.rX||0===i.rY)&&(i.type=B.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&B.QUAD_TO&&T([s,o],i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],i.relative?[s+i.x,o+i.y]:[i.x,i.y])&&(i.type=B.LINE_TO,delete i.x1,delete i.y1),n&&i.type&B.CURVE_TO){const t=[s,o],e=i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],r=i.relative?[s+i.x2,o+i.y2]:[i.x2,i.y2],n=i.relative?[s+i.x,o+i.y]:[i.x,i.y];T(t,e,n)&&T(t,r,n)&&(i.type=B.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:C,QT_TO_C:j,INFO:I,SANITIZE:function(t=0){v(t);let e=NaN,r=NaN,n=NaN,i=NaN;return I((s,o,a,u,c)=>{const h=Math.abs;let l=!1,d=0,f=0;if(s.type&B.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:o-e,f=isNaN(r)?0:a-r),s.type&(B.CURVE_TO|B.SMOOTH_CURVE_TO)?(e=s.relative?o+s.x2:s.x2,r=s.relative?a+s.y2:s.y2):(e=NaN,r=NaN),s.type&B.SMOOTH_QUAD_TO?(n=isNaN(n)?o:2*o-n,i=isNaN(i)?a:2*a-i):s.type&B.QUAD_TO?(n=s.relative?o+s.x1:s.x1,i=s.relative?a+s.y1:s.y2):(n=NaN,i=NaN),s.type&B.LINE_COMMANDS||s.type&B.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&B.CURVE_TO||s.type&B.SMOOTH_CURVE_TO||s.type&B.QUAD_TO||s.type&B.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-o,r=void 0===s.y?0:s.relative?s.y:s.y-a;d=isNaN(n)?void 0===s.x1?d:s.relative?s.x:s.x1-o:n-o,f=isNaN(i)?void 0===s.y1?f:s.relative?s.y:s.y1-a:i-a;const u=void 0===s.x2?0:s.relative?s.x:s.x2-o,c=void 0===s.y2?0:s.relative?s.y:s.y2-a;h(e)<=t&&h(r)<=t&&h(d)<=t&&h(f)<=t&&h(u)<=t&&h(c)<=t&&(l=!0)}return s.type&B.CLOSE_PATH&&h(o-u)<=t&&h(a-c)<=t&&(l=!0),l?[]:s})},MATRIX:L,ROTATE:function(t,e=0,r=0){v(t,e,r);const n=Math.sin(t),i=Math.cos(t);return L(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},TRANSLATE:function(t,e=0){return v(t,e),L(1,0,0,1,t,e)},SCALE:function(t,e=t){return v(t,e),L(t,0,0,e,0,0)},SKEW_X:function(t){return v(t),L(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return v(t),L(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return v(t),L(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return v(t),L(1,0,0,-1,0,t)},A_TO_C:function(){return I((t,e,r)=>B.ARC===t.type?function(t,e,r){t.cX||x(t,e,r);const n=t.xRot/180*w;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:B.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const i=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-i,o=Math.ceil(s/90),a=new Array(o);let u=e,c=r;const h=(e,r)=>{const[i,s]=b([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+s]};for(let e=0;e<o;e++){const r=S(t.phi1,t.phi2,e/o),n=S(t.phi1,t.phi2,(e+1)/o),i=n-r,s=4/3*Math.tan(i*O/4),l=Math.cos(r*O)-s*Math.sin(r*O),d=Math.sin(r*O)+s*Math.cos(r*O),f=Math.cos(n*O),m=Math.sin(n*O),p=f+s*m,y=m-s*f,g=h(l,d),b=h(p,y),v=h(f,m),w={relative:t.relative,type:B.CURVE_TO,x:v[0],y:v[1],x1:g[0],y1:g[1],x2:b[0],y2:b[1]};t.relative&&(w.x1-=u,w.y1-=c,w.x2-=u,w.y2-=c,w.x-=u,w.y-=c),u=v[0],c=v[1],a[e]=w}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return I((t,e,r)=>(t.relative&&(e=0,r=0),B.ARC===t.type&&x(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=P(),e=j(),r=C(),n=I((i,s,o)=>{const a=r(e(t((t=>({...t}))(i))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(a.type&B.DRAWING_COMMANDS&&(u(s),c(o)),a.type&B.HORIZ_LINE_TO&&u(a.x),a.type&B.VERT_LINE_TO&&c(a.y),a.type&B.LINE_TO&&(u(a.x),c(a.y)),a.type&B.CURVE_TO){u(a.x),c(a.y);const t=_(s,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(M(s,a.x1,a.x2,a.x,e));const e=_(o,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(M(o,a.y1,a.y2,a.y,t))}if(a.type&B.ARC){u(a.x),c(a.y),x(a,s,o);const t=a.xRot/180*Math.PI,e=Math.cos(t)*a.rX,r=Math.sin(t)*a.rX,n=-Math.sin(t)*a.rY,i=Math.cos(t)*a.rY,[h,l]=a.phi1<a.phi2?[a.phi1,a.phi2]:-180>a.phi2?[a.phi2+360,a.phi1+360]:[a.phi2,a.phi1],d=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<h?r+360:r},f=N(n,-e,0).map(d);for(const t of f)t>h&&t<l&&u(E(a.cX,e,n,t));const m=N(i,-r,0).map(d);for(const t of m)t>h&&t<l&&c(E(a.cY,r,i,t))}return i});return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=D.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const s of t){const t=r(s);t.type===B.MOVE_TO&&i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(D.INFO((t,e,r)=>{const n="relative"in t&&t.relative;return["x"in t?t.x+(n?e:0):e,"y"in t?t.y+(n?r:0):r]}));let n=r[0];e.push(t[0]);for(let i=1;i<t.length;i++){const s=t[i],o=t[i+1];if(i<t.length-1&&o&&s.type&B.LINE_COMMANDS&&o.type&B.LINE_COMMANDS){const t=r[i+1];if(T(n,r[i],t)){"relative"in o&&o.relative&&("x"in o&&(o.x=t[0]-n[0]),"y"in o&&(o.y=t[1]-n[1]));continue}}e.push(s),n=r[i]}return e}};class R{round(t){return this.transform(D.ROUND(t))}toAbs(){return this.transform(D.TO_ABS())}toRel(){return this.transform(D.TO_REL())}normalizeHVZ(t,e,r){return this.transform(D.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(D.NORMALIZE_ST())}qtToC(){return this.transform(D.QT_TO_C())}aToC(){return this.transform(D.A_TO_C())}sanitize(t){return this.transform(D.SANITIZE(t))}translate(t,e){return this.transform(D.TRANSLATE(t,e))}scale(t,e){return this.transform(D.SCALE(t,e))}rotate(t,e,r){return this.transform(D.ROTATE(t,e,r))}matrix(t,e,r,n,i,s){return this.transform(D.MATRIX(t,e,r,n,i,s))}skewX(t){return this.transform(D.SKEW_X(t))}skewY(t){return this.transform(D.SKEW_Y(t))}xSymmetry(t){return this.transform(D.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(D.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(D.ANNOTATE_ARCS())}}const V=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,F=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class k extends R{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let n=0;n<t.length;n++){const i=t[n],s=!(this.curCommandType!==B.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=F(i)&&("0"===this.curNumber&&"0"===i||s);if(!F(i)||o)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${n}`);if(this.curCommandType===B.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${n}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${n}"`);this.curArgs.push(t),this.curArgs.length===U[this.curCommandType]&&(B.HORIZ_LINE_TO===this.curCommandType?r({type:B.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):B.VERT_LINE_TO===this.curCommandType?r({type:B.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===B.MOVE_TO||this.curCommandType===B.LINE_TO||this.curCommandType===B.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),B.MOVE_TO===this.curCommandType&&(this.curCommandType=B.LINE_TO)):this.curCommandType===B.CURVE_TO?r({type:B.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===B.SMOOTH_CURVE_TO?r({type:B.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.QUAD_TO?r({type:B.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.ARC&&r({type:B.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!V(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(o)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${n}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${i}" at index ${n}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=B.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=B.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=B.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=B.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=B.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=B.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=B.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=B.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=B.ARC,this.curCommandRelative="a"===i}else e.push({type:B.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const n=Object.getPrototypeOf(this).parse.call(this,e);for(const e of n){const n=t(e);Array.isArray(n)?r.push(...n):r.push(n)}return r}}})}}class B extends R{commands;constructor(t){super(),this.commands="string"==typeof t?B.parse(t):t}encode(){return B.encode(this.commands)}getBounds(){const t=D.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const n=t(r);Array.isArray(n)?e.push(...n):e.push(n)}return this.commands=e,this}reverse(t=!0){return this.commands=D.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=D.REMOVE_COLLINEAR(this.commands),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const n=t[r];if(n.type===B.CLOSE_PATH)e+="z";else if(n.type===B.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===B.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===B.MOVE_TO)e+=(n.relative?"m":"M")+n.x+g+n.y;else if(n.type===B.LINE_TO)e+=(n.relative?"l":"L")+n.x+g+n.y;else if(n.type===B.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+g+n.y1+g+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+g+n.y1+g+n.x+g+n.y;else if(n.type===B.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+g+n.y;else{if(n.type!==B.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+g+n.rY+g+n.xRot+g+ +n.lArcFlag+g+ +n.sweepFlag+g+n.x+g+n.y}}return e}(t)}static parse(t){const e=new k,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=B.LINE_TO|B.HORIZ_LINE_TO|B.VERT_LINE_TO;static DRAWING_COMMANDS=B.HORIZ_LINE_TO|B.VERT_LINE_TO|B.LINE_TO|B.CURVE_TO|B.SMOOTH_CURVE_TO|B.QUAD_TO|B.SMOOTH_QUAD_TO|B.ARC}const U={[B.MOVE_TO]:2,[B.LINE_TO]:2,[B.HORIZ_LINE_TO]:1,[B.VERT_LINE_TO]:1,[B.CLOSE_PATH]:0,[B.QUAD_TO]:4,[B.SMOOTH_QUAD_TO]:2,[B.CURVE_TO]:6,[B.SMOOTH_CURVE_TO]:4,[B.ARC]:7};class X{constructor(t){this.domNode=t}shift(t,e){var r;let n=null!==(r=this.domNode.getAttribute("d"))&&void 0!==r?r:"";this.domNode.setAttribute("d",new B(n).translate(t,e).encode())}closestPoint(t){let e=this.domNode.getTotalLength(),r=[];for(let n=0;n<=16;n++){let i=n/16*e;r.push([i,(0,y.distance)(t,this.domNode.getPointAtLength(i))])}r.sort((t,e)=>t[1]-e[1]);let n=r[0],i=n[0]-e/16,s=n[0]+e/16;i=Math.max(0,i),s=Math.min(e,s);for(let e=0;e<20;e++){let e=(s-i)/3;(0,y.distance)(t,this.domNode.getPointAtLength(i))<(0,y.distance)(t,this.domNode.getPointAtLength(s))?s-=e:i+=e}let o=(i+s)/2,a=this.domNode.getPointAtLength(o);return{x:a.x,y:a.y,length:o}}}class Y{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class z{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class H{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}function G(e,r){let{x:n,y:i}=r,s=e.tagName;if(!$.has(s))switch(s){case"g":Array.from(e.children).forEach(t=>G(t,r));break;case"svg":new t(e).shift(n,i);break;case"text":new o(e).shift(n,i);break;case"line":new a(e).shift(n,i);break;case"circle":new u(e).shift(n,i);break;case"ellipse":new c(e).shift(n,i);break;case"rect":new h(e).shift(n,i);break;case"polyline":new m(e).shift(n,i);break;case"polygon":new p(e).shift(n,i);break;case"path":new X(e).shift(n,i);break;case"image":new Y(e).shift(n,i);break;case"use":new z(e).shift(n,i);break;case"foreignObject":new H(e).shift(n,i);break;default:console.error(`Unrecognized SVG element type: "${s}".`)}}const $=new Set(["defs","title","desc","metadata","style","script","linearGradient","radialGradient","stop","clipPath","mask","marker","pattern","symbol","filter"]);var W,q;class J{constructor(t){W.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,W,t)}toArray(){return Array.from(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,W).querySelectorAll("text")).map(t=>({domNode:t}))}}W=new WeakMap;class Q{constructor(t){q.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,q,t)}closestPoint(t){return document.body.contains(Z)||document.body.append(Z),tt.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,q)),new X(tt).closestPoint(t)}}q=new WeakMap;const K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("viewBox","0 0 100 100"),K.setAttribute("width","100"),K.setAttribute("height","100");const Z=document.createElement("div");Z.append(K),Z.style.height="0px",Z.style.position="fixed",document.body.append(Z);const tt=document.createElementNS("http://www.w3.org/2000/svg","path");function et(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}tt.setAttribute("stroke","black"),tt.setAttribute("stroke-width","1"),K.append(tt);const rt=new Uint8Array(16),nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));const it=function(t,e,r){return e||t||!crypto.randomUUID?function(t,e,r){const n=(t=t||{}).random??t.rng?.()??crypto.getRandomValues(rt);if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return(nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]).toLowerCase()}(n)}(t,e,r):crypto.randomUUID()};function st(t){t.id="uuid-"+it()}class ot{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class at{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class ut{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class ct{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function ht(t){let e=t.parentNode;e&&e.appendChild(t)}function lt(t){let e=t.parentNode;e&&e.prepend(t)}var dt,ft=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class mt{constructor(t){dt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,dt,t)}toString(){return ft(this,dt,"f").innerHTML}set(t){ft(this,dt,"f").innerHTML=t}}dt=new WeakMap;var pt,yt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class gt{constructor(t){pt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,pt,t)}toString(){return yt(this,pt,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=yt(this,pt,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...yt(this,pt,"f").attributes].forEach(t=>yt(this,pt,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>yt(this,pt,"f").setAttribute(t.name,t.value)),yt(this,pt,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function bt(t){return t instanceof SVGGraphicsElement}pt=new WeakMap;var vt=r(854);function wt(t){return(0,vt.isArray)(t)&&t.every(bt)}async function xt(t){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),await i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e}})(),n})(),t.exports=e()},534(t){var e;e=()=>(()=>{var t={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})()},127:function(t){var e;e=()=>(()=>{var t={369:function(t){var e;e=()=>(()=>{var t={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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),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:()=>y,flipAway:()=>v,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function v(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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:()=>y,Stems:()=>p,areConflicting:()=>c,areCrossing:()=>d,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,basePairs:()=>v,deepCopy:()=>i,knotless:()=>f,mountainPlotTraversal:()=>g,parseDotBracket:()=>b,radializable:()=>m,sorted:()=>o});var t=r(854),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))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map(function(t){return e([],t,!0)})}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort(function(t,e){return t[0]-e[0]}),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every(function(t){return r[t]==n[t]})}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function c(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function h(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach(function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function l(t){var e=h(t),r=[],n=!1;return e.forEach(function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function d(t,e){return!l([t,e])}function f(t){var e=[],r=i(t);r.sort(function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])});var n=[];return r.forEach(function(t){var r=[t[0]-1,t[1]-1],i=(0,s.min)(r),o=(0,s.max)(r);if(!n[i]&&!n[o]){e.push(t);for(var a=i;a<=o;a++)n[a]=!0}}),e}function m(t){var e=i(t);e.sort(function(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-n)-Math.abs(i-s)});var r=[],n=[];return e.forEach(function(t){var e=t[0],i=t[1];e==i||null!=n[e-1]||null!=n[i-1]||(r.push([e,i]),n[e-1]=i,n[i-1]=e)}),f(r)}var p=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=o(t),r=[],n=[];return e.forEach(function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r},t}(),y=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(p.bind.apply(p,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(s.min),t.map(s.max)]});t.forEach(s.sortNumbers),t.sort(function(t,e){return(0,s.min)(t)-(0,s.min)(e)});for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=h(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach(function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))}),s}function b(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 o(n)}function v(t,e){return e.forEach(function(e){e.forEach(function(e){if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(function(e){return[t[e[0]-1],t[e[1]-1]]})}})(),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:()=>y,flipAway:()=>v,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function v(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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";function t(t,e){return t[0]===e[0]&&t[1]===e[1]||t[0]===e[1]&&t[1]===e[0]}function e(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>s,LastPairedBase:()=>a,LeadingDanglingBases:()=>u,Linkers:()=>d,PositionPairs:()=>i,Stems:()=>l,TrailingDanglingBases:()=>c,antiParallelPairs:()=>b,areEqual:()=>t,consecutivePairs:()=>y,knotless:()=>f,missing:()=>v,other:()=>e,parallelPairs:()=>g,parseDotBracket:()=>p,radializable:()=>m});class i{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 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(),n=t.findIndex(t=>r.includes(t));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var o=r(986);class a{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,o.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,o.max)(r)]}}class u{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(0,r)}}class c{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 a(...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 h=r(369);class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Stems(t,e).get().map(e=>e.map(e=>[t[e[0]-1],t[e[1]-1]]))}}class d{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Linkers(t,e).get().map(e=>e.map(e=>t[e-1]))}}function f(...t){let[e,r]=t,n=new i(...t).get();(0,h.areKnotless)(n)||(n=(0,h.knotless)(n));let s=n.map(t=>[e[t[0]-1],e[t[1]-1]]);return[[...e],s]}function m(...t){let[e,r]=t,n=new i(...t).get();return[[...e],(0,h.radializable)(n).map(([t,r])=>[e[t-1],e[r-1]])]}function p(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,h.parseDotBracket)(e)].map(e=>{let r=e[0],n=e[1];return[t[r-1],t[n-1]]})}function y(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}function g(t){let e=[],r=Math.floor(t.length/2)-1,n=Math.ceil(t.length/2);for(let i=0;i<=r;i++){let r=t[i],s=t[n+i];e.push([r,s])}return e}function b(t){let e=[];for(let r=0;r<Math.floor(t.length/2);r++){let n=t[r],i=t[t.length-r-1];e.push([n,i])}return e}function v(e,r){return r.filter(r=>!e.find(e=>t(r,e))).map(t=>[...t])}})(),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,c=Math.PI*a/2,h=Math.abs(i-c)<.001;this.wrappedCircularSegment=u||h?new e(r):i<c?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()},369:function(t){var e;e=()=>(()=>{var t={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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),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:()=>y,flipAway:()=>v,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function v(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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:()=>y,Stems:()=>p,areConflicting:()=>c,areCrossing:()=>d,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,basePairs:()=>v,deepCopy:()=>i,knotless:()=>f,mountainPlotTraversal:()=>g,parseDotBracket:()=>b,radializable:()=>m,sorted:()=>o});var t=r(854),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))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map(function(t){return e([],t,!0)})}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort(function(t,e){return t[0]-e[0]}),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every(function(t){return r[t]==n[t]})}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function c(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function h(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach(function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function l(t){var e=h(t),r=[],n=!1;return e.forEach(function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function d(t,e){return!l([t,e])}function f(t){var e=[],r=i(t);r.sort(function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])});var n=[];return r.forEach(function(t){var r=[t[0]-1,t[1]-1],i=(0,s.min)(r),o=(0,s.max)(r);if(!n[i]&&!n[o]){e.push(t);for(var a=i;a<=o;a++)n[a]=!0}}),e}function m(t){var e=i(t);e.sort(function(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-n)-Math.abs(i-s)});var r=[],n=[];return e.forEach(function(t){var e=t[0],i=t[1];e==i||null!=n[e-1]||null!=n[i-1]||(r.push([e,i]),n[e-1]=i,n[i-1]=e)}),f(r)}var p=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=o(t),r=[],n=[];return e.forEach(function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r},t}(),y=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(p.bind.apply(p,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(s.min),t.map(s.max)]});t.forEach(s.sortNumbers),t.sort(function(t,e){return(0,s.min)(t)-(0,s.min)(e)});for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=h(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach(function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))}),s}function b(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 o(n)}function v(t,e){return e.forEach(function(e){e.forEach(function(e){if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(function(e){return[t[e[0]-1],t[e[1]-1]]})}})(),n})(),t.exports=e()},456:function(t){var e;e=()=>(()=>{var t={277: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,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}get direction(){return Math.atan2(this.y,this.x)}}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,{Point:()=>e,RelativePoint:()=>h});var t=r(277);class e{static matching(t){return new e(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}displacementTo(e){return new t.Vector(e.x-this.x,e.y-this.y)}displacementFrom(e){return new t.Vector(this.x-e.x,this.y-e.y)}distanceTo(t){return this.displacementTo(t).magnitude}distanceFrom(t){return this.distanceTo(t)}directionTo(t){return this.displacementTo(t).direction}directionFrom(t){return this.displacementFrom(t).direction}}var i,s,o,a,u,c=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class h{constructor(e){i.add(this),s.set(this,void 0),o.set(this,new t.Vector(0,0)),a.set(this,{move:[]}),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,s,e),e.addEventListener("move",()=>c(this,i,"m",u).call(this,"move"))}get x(){return c(this,s,"f").x+c(this,o,"f").x}set x(t){c(this,o,"f").x=t-c(this,s,"f").x,c(this,i,"m",u).call(this,"move")}get y(){return c(this,s,"f").y+c(this,o,"f").y}set y(t){c(this,o,"f").y=t-c(this,s,"f").y,c(this,i,"m",u).call(this,"move")}addEventListener(t,e){c(this,a,"f")[t].push(e)}removeEventListener(t,e){c(this,a,"f")[t]=c(this,a,"f")[t].filter(t=>t!==e)}}s=new WeakMap,o=new WeakMap,a=new WeakMap,i=new WeakSet,u=function(t){c(this,a,"f")[t].forEach(t=>t())}})(),n})(),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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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,{Centroid:()=>s,Direction:()=>f,MaxCenterX:()=>u,MaxCenterY:()=>h,MinCenterX:()=>a,MinCenterY:()=>c,NucleobaseMock:()=>t,arrange:()=>T,circularize:()=>S,flipSelfX:()=>y,flipSelfY:()=>g,flipX:()=>m,flipY:()=>p,linearize:()=>x,outwardNormal:()=>w,rotate:()=>d,round:()=>_,shift:()=>e,stemmify:()=>O,straighten:()=>N,tangent:()=>b,untangle:()=>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 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 c{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 h{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(t.length<2)return;let r=t[0],n=t[t.length-1],s=(0,i.midpoint)(r.getCenterPoint(),n.getCenterPoint());t.forEach(t=>{let r=t.getCenterPoint(),n=(0,i.distance)(s,r),o=(0,l.direction)((0,i.displacement)(s,r));o+=e,t.setCenterPoint({x:s.x+n*Math.cos(o),y:s.y+n*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 m(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 p(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 y(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),m(t),d(t,a),e(t,(0,i.displacement)(r.getCenterPoint(),o))}function g(t){let e=new s(t),{x:r,y:n}=e.get(),i=r,o=n,a=new f(t).get();d(t,-a),p(t),d(t,a),e.set({x:i,y:o})}function b(t,e){let r=e.indexOf(t);if(-1==r)throw new Error("The target base is not present in the parent sequence.");let n=r-1,i=r+2;return n=Math.max(n,0),new f(e.slice(n,i)).get()}var v=r(127);function w(t,...e){var r;let n=e[0],s=null!==(r=e[1])&&void 0!==r?r:[],a=b(t,n)-Math.PI/2,u=n.indexOf(t);if(u<0)throw new Error("The target base is not present in the provided structure.");if(n.length>1&&u<n.length-1){let e=n[u+1];a=(0,o.flipAway)(a,(0,i.direction)(t.getCenterPoint(),e.getCenterPoint()))}let c=s.find(e=>e.includes(t));return c&&(a=(0,o.flipAway)(a,(0,i.direction)(t.getCenterPoint(),(0,v.other)(t,c).getCenterPoint()))),a}function x(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(),c={x:a,y:u};t.forEach((t,e)=>{t.setCenterPoint({x:e*r,y:0})}),n.set(i),o.set(c)}function N(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),c=a*Math.sin(o),{x:h,y:d}=n[0];t.forEach(t=>{t.setCenterPoint({x:h,y:d}),h+=u,d+=c})}function O(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),c=t.slice(a),h=new s(t),{x:l,y:m}=h.get(),p={x:l,y:m},y=new f(t).get();x(u,{spacing:o}),x(c,{spacing:o}),new f(u).set(-Math.PI/2),new f(c).set(Math.PI/2);let g=t[0],b=t[t.length-1];e(u,(0,i.displacement)(g.getCenterPoint(),{x:0,y:0})),e(c,(0,i.displacement)(b.getCenterPoint(),{x:n,y:0})),d(t,y),h.set(p)}function S(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,c=a,h=new f(t).get(),l=r*(t.length-1);l+=n,Math.abs(l)<1e-5&&(l=1e-5);let m=l/(2*Math.PI),p=Math.PI/2+2*Math.PI*(.5*n/l);t.forEach((t,e)=>{let n=p+2*Math.PI*(e*r)/l;t.setCenterPoint({x:m*Math.cos(n),y:m*Math.sin(n)})}),d(t,h),i.set({x:u,y:c})}var E=r(173);function _(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]),c=n*(t.length-1);if(c-u<.001)return void N(t);if(u<.001){let{x:r,y:o}=s.getCenterPoint();return S(t,{spacing:n,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:r,y:o}))}let h=new E.CircularSegment(a,{arcLength:c}),d=h.parentCircleCenterPoint,f=h.parentCircleRadius,m=(0,l.direction)((0,i.displacement)(d,s.getCenterPoint())),p=h.arcAngle/(t.length-1);t.forEach(t=>{t.setCenterPoint({x:d.x+f*Math.cos(m),y:d.y+f*Math.sin(m)}),m+=p})}var M=r(369);function T(t,r,n){var a,u,c;let{spacing:h}=n,l=null!==(a=n.basePairSpacing)&&void 0!==a?a:h,d=null!==(u=n.hairpinLoopSpacing)&&void 0!==u?u:h,m=null!==(c=n.terminiGap)&&void 0!==c?c:h,{x:p,y}=new s(t).get(),g={x:p,y},b=new f(t).get();[,r]=(0,v.radializable)(t,r);let w=new v.PositionPairs(t,r).get(),x=(0,M.mountainPlotTraversal)(t,w),N=t.filter((t,e)=>0==x[e]);S(N,{spacing:h,terminiGap:m});let E=new v.Stems(t,r).get(),T=new Set(N),A=E.filter(t=>T.has(t[0][0])),P=r=>{let n=r[0],{x:a,y:u}=new s(n).get(),c={x:a,y:u},m=new f(r[0]).get(),p=[...r.map(t=>t[0]),...r.map(t=>t[1]).reverse()];O(p,{basePairLength:h,basePairSpacing:l}),new f(p).set(m),e(p,(0,i.displacement)(new s(n).get(),c));let y=r[r.length-1],g=y.map(e=>t.indexOf(e)),b=t.filter((t,e)=>(0,o.isBetweenExclusive)(e,(0,o.min)(g),(0,o.max)(g))&&x[e]==x[(0,o.min)(g)]+1),v=new Set(b),w=E.filter(t=>v.has(t[0][0]));_([y[0],...b,y[1]],{spacing:w.length>0?h:d}),w.forEach(t=>P(t))};A.forEach(t=>P(t)),new f(t).set(b),new s(t).set(g)}var A,P,C,j,I,L=r(456),D=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},R=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function V(e,r,n){var i;let a,{spacing:u}=n,c=null!==(i=n.hairpinLoopSpacing)&&void 0!==i?i:u;if(0==e.length)return;if(0==r.length)return void function(t,e){let{spacing:r}=e,n=L.Point.matching(new s(t).get());S(t,{spacing:r,terminiGap:2*r}),new f(t).set(Math.PI/2),new s(t).set(n)}(e,n);[a,r]=(0,v.radializable)(e,r);let h=[...e],l=L.Point.matching(new s(h).get());e=[...e,new t({centerPoint:{x:0,y:0}})];let m=new k(e,r),p=m.loops;p.sort((t,e)=>U(t,m)-U(e,m));let y=p[0],g=(0,o.max)(y.linkers.map(t=>t.length)),b=y.linkers.flatMap(e=>[X(e),...Array.from({length:g-2}).map(()=>new t({centerPoint:{x:0,y:0}})),Y(e)]);if(S(b,{spacing:u,terminiGap:u}),d(b,-new f(b).get()),new s(b).set(l),y.linkers.forEach(t=>_(t,{spacing:u})),y.emanatingStems.forEach(t=>F(t.bottomBasePair,m,n)),"outerStem"in y){let t=[y.outerStem.topBasePair[1],y.outerStem.topBasePair[0]],i=[...e.slice(m.indexOf(t[0])),...e.slice(0,m.indexOf(t[1])+1)],s=new Set(i);F(t,new k(i,r.filter(t=>t.every(t=>s.has(t)))),n)}"isHairpinLoop"in y&&y.isHairpinLoop()&&_(y.bases,{spacing:c})}function F(r,n,s){var a,u;let{spacing:c}=s,h=null!==(a=s.basePairSpacing)&&void 0!==a?a:c,l=null!==(u=s.hairpinLoopSpacing)&&void 0!==u?u:c,d=n.stems.find(t=>t.bottomBasePair[0]===r[0]);if(!d)throw new Error("Closing stem not found.");let f=L.Point.matching(r[0].getCenterPoint());O(d.bases,{basePairSpacing:h,basePairLength:c}),e(d.bases,(0,i.displacement)(r[0].getCenterPoint(),f));let m=n.loop(d.topBasePair);m.innerStems.length>0?function(r,n,s){let{spacing:a}=s,u=[n.indexOf(r[0]),n.indexOf(r[1])],c=n.loop(r).innerStems.flatMap(t=>t.bottomBasePair.map(t=>n.indexOf(t))),h=(0,o.min)(c),l=(0,o.max)(c),d=n.sequence.filter((t,e)=>e>=h&&e<=l&&n.mountainPlotTraversal[e]==n.mountainPlotTraversal[h]&&[e-1,e,e+1].some(t=>c.includes(t))),f=(0,o.max)([d.length-2,h-(0,o.min)(u)-1,(0,o.max)(u)-l-1]);f=(0,o.max)([f,0]);let m=Array.from({length:f}).map(()=>new t({centerPoint:{x:0,y:0}})),p=m.map(()=>new t({centerPoint:{x:0,y:0}})),y=L.Point.matching(r[0].getCenterPoint());S([r[0],...m,...d,...p,r[1]],{spacing:a,terminiGap:a}),e([...r,...d],(0,i.displacement)(r[0].getCenterPoint(),y)),_(n.sequence.slice(u[0],h+1),{spacing:a}),_(n.sequence.slice(l,u[1]+1),{spacing:a})}(d.topBasePair,n,s):_(m.bases,{spacing:l}),m.innerStems.forEach(t=>F(t.bottomBasePair,n,s)),(0,v.consecutivePairs)(m.innerStems).map(([t,e])=>[t.bottomBasePair[1],...n.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]).filter(t=>t.length>=5).forEach(t=>{let r=t.slice(1,-1),n=L.Point.matching(r[0].getCenterPoint()),s=(0,i.distance)(X(r).getCenterPoint(),Y(r).getCenterPoint());O(r,{basePairLength:s,basePairSpacing:h}),_(r.length%2==0?function(t){if(t.length<4)throw new Error("The array has less than four items.");if(t.length%2!=0)throw new Error("The array has an odd number of items.");return t.slice(Math.floor(t.length/2)-2,Math.floor(t.length/2)+2)}(r):function(t){if(t.length<3)throw new Error("The array has less than three items.");if(t.length%2==0)throw new Error("The array has an even number of items.");let e=Math.floor(t.length/2);return t.slice(e-1,e+2)}(r),{spacing:r.length>=5?h:s}),e(r,(0,i.displacement)(r[0].getCenterPoint(),n))})}class k{constructor(t,e){this.sequence=t,this.basePairs=e,A.set(this,void 0),P.set(this,void 0),C.set(this,void 0),j.set(this,void 0),D(this,A,new Map,"f"),this.sequence.forEach((t,e)=>R(this,A,"f").set(t,e)),D(this,P,new Map,"f"),this.sequence.forEach((t,e)=>R(this,P,"f").set(t,e+1)),D(this,C,new Map,"f"),this.basePairs.forEach(t=>R(this,C,"f").set(t[0],t[1])),this.basePairs.forEach(t=>R(this,C,"f").set(t[1],t[0])),D(this,j,this.basePairs.map(t=>[this.positionOf(t[0]),this.positionOf(t[1])]),"f"),this.mountainPlotTraversal=(0,M.mountainPlotTraversal)(this.sequence,R(this,j,"f")),this.stems=new v.Stems(this.sequence,this.basePairs).get().map(t=>new B(t))}indexOf(t){let e=R(this,A,"f").get(t);if("number"!=typeof e)throw new Error("Base not found.");return e}positionOf(t){let e=R(this,P,"f").get(t);if("number"!=typeof e)throw new Error("Base not found.");return e}spannedBases(t){let e=this.indexOf(t[0]),r=this.indexOf(t[1]);return this.sequence.slice((0,o.min)([e,r])+1,(0,o.max)([e,r]))}numSpannedBases(t){return this.spannedBases(t).length}joinedBases(t){let e=this.indexOf(t[0]),r=this.indexOf(t[1]);return[...this.sequence.slice(0,(0,o.min)([e,r])+1),...this.sequence.slice((0,o.max)([e,r]))]}numJoinedBases(t){return this.joinedBases(t).length}interveningBases(t,e){let r=this.indexOf(t),n=this.indexOf(e);return this.sequence.slice((0,o.min)([r,n])+1,(0,o.max)([r,n]))}get loops(){return[this.outermostLoop,...this.stems.map(t=>this.loop(t.topBasePair))]}loop(t){let e=[this.indexOf(t[0]),this.indexOf(t[1])],r=this.mountainPlotTraversal[e[0]]+1,n=this.spannedBases(t).filter(t=>this.mountainPlotTraversal[this.indexOf(t)]==r),i=new Set(n),s=[t[0],...n,t[1]],o=this.stems.filter(t=>i.has(t.bottomBasePair[0])),a=o,u=this.stems.find(e=>t.includes(e.topBasePair[0]));if(!u)throw new Error("Outer stem not found.");let c=(0,v.consecutivePairs)(o).map(([t,e])=>[t.bottomBasePair[1],...this.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]);return o.length>0&&(c.unshift([t[0],...this.interveningBases(t[0],X(o).bottomBasePair[0]),X(o).bottomBasePair[0]]),c.push([Y(o).bottomBasePair[1],...this.interveningBases(Y(o).bottomBasePair[1],t[1]),t[1]])),{bases:s,closingBasePair:t,outerStem:u,innerStems:o,emanatingStems:a,linkers:c,isHairpinLoop:()=>0==a.length}}get outermostLoop(){let t=this.stems.filter(t=>0==this.mountainPlotTraversal[this.indexOf(t.bottomBasePair[0])]),e=t,r=(0,v.consecutivePairs)(e).map(([t,e])=>[t.bottomBasePair[1],...this.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]);return e.length>0&&r.push([...this.sequence.slice(this.indexOf(Y(e).bottomBasePair[1])),...this.sequence.slice(0,this.indexOf(X(e).bottomBasePair[0])+1)]),{stems:e,emanatingStems:t,linkers:r}}}A=new WeakMap,P=new WeakMap,C=new WeakMap,j=new WeakMap;class B{constructor(t){if(I.set(this,void 0),0==t.length)throw new Error("A stem must have at least one base-pair.");D(this,I,t,"f")}get bottomBasePair(){return X(R(this,I,"f"))}get topBasePair(){return Y(R(this,I,"f"))}get side5(){return R(this,I,"f").map(t=>t[0])}get side3(){let t=R(this,I,"f").map(t=>t[1]);return t.reverse(),t}get bases(){return[...this.side5,...this.side3]}}function U(t,e){let r=(0,o.max)(t.emanatingStems.map(t=>e.numSpannedBases(t.bottomBasePair)));return"closingBasePair"in t&&(r=(0,o.max)([r,e.numJoinedBases(t.closingBasePair)-2])),r}function X(t){if(0==t.length)throw new Error("The array is empty.");return t[0]}function Y(t){if(0==t.length)throw new Error("The array is empty.");return t[t.length-1]}I=new WeakMap})(),n})(),t.exports=e()},986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},369(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>p,Stems:()=>m,areConflicting:()=>u,areCrossing:()=>l,areEqual:()=>o,areKnotless:()=>h,areStacked:()=>a,basePairs:()=>w,deepCopy:()=>e,knotless:()=>d,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,radializable:()=>f,sorted:()=>s});var t=r(854);function e(e){return(0,t.isNumbersArray)(e)?[...e]:e.map(t=>[...t])}var i=r(986);function s(t){let r=e(t);return r.forEach(i.sortNumbers),r.sort((t,e)=>t[0]-e[0]),r}function o(t,r){let n=e(t),s=e(r);return(0,i.sortNumbers)(n),(0,i.sortNumbers)(s),[0,1].every(t=>n[t]==s[t])}function a(t,e){let r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function u(t,e){return(0,i.min)(t)==(0,i.min)(e)&&(0,i.max)(t)!=(0,i.max)(e)||(0,i.min)(t)!=(0,i.min)(e)&&(0,i.max)(t)==(0,i.max)(e)}function c(t){if(0==t.length)return[];let e=[];for(let r=0;r<(0,i.max)(t.flat());r++)e.push(void 0);return t.forEach(t=>{e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function h(t){let e=c(t),r=[],n=!1;return e.forEach((t,e)=>{let i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function l(t,e){return!h([t,e])}function d(t){let r=[],n=e(t);n.sort((t,e)=>Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1]));let s=[];return n.forEach(t=>{let e=[t[0]-1,t[1]-1],n=(0,i.min)(e),o=(0,i.max)(e);if(!s[n]&&!s[o]){r.push(t);for(let t=n;t<=o;t++)s[t]=!0}}),r}function f(t){let r=e(t);r.sort(([t,e],[r,n])=>Math.abs(t-e)-Math.abs(r-n));let n=[],i=[];return r.forEach(([t,e])=>{t==e||null!=i[t-1]||null!=i[e-1]||(n.push([t,e]),i[t-1]=e,i[e-1]=t)}),d(n)}class m{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[1];if(0==t.length)return[];let e=s(t),r=[],n=[];return e.forEach(t=>{let e=0==n.length?null:n[n.length-1];!e||a(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r}}class p{constructor(...t){this.targetStructure=t}get(){let t=new m(...this.targetStructure).get().flatMap(t=>[t.map(i.min),t.map(i.max)]);t.forEach(i.sortNumbers),t.sort((t,e)=>(0,i.min)(t)-(0,i.min)(e));let e=[],r=t.shift(),n=t.shift();for(;r&&n;){let s=[],o=(0,i.max)(r),a=(0,i.min)(n);for(let t=o;t<=a;t++)s.push(t);e.push(s),r=n,n=t.shift()}return e}}function y(...t){let e=t[0],r=t[1],n=c(r);if(!h(r))throw new Error("Pseudoknot(s) encountered.");let i=[],s=0;return e.forEach((t,e)=>{let r=e+1,o=n[e];null==o?i.push(s):r<o?(i.push(s),s++):(r==o||s--,i.push(s))}),i}var g=r(106);function b(t){t=(0,g.removeWhitespace)(t);let e={"()":[],"[]":[],"{}":[],"<>":[]};v.forEach(r=>{let[n,i]=r.split(""),o=[...t].map(t=>t===n?"(":t===i?")":".").join("");e[r]=function(t){let e=[],r=[];if([...t].forEach((t,n)=>{let i=n+1;if("."==t);else if("("==t)r.push(i);else if(")"==t){let t=r.pop();if("number"!=typeof t)throw new Error(`Unmatched downstream partner in dot-bracket notation at position: ${i}.`);e.push([t,i])}}),r.length>0)throw new Error(`Unmatched upstream partner in dot-bracket notation at position: ${r.pop()}.`);return s(e)}(o)});let r=()=>s(v.flatMap(t=>e[t]));return{[Symbol.iterator]:()=>r()[Symbol.iterator](),toArray:r,...e}}const v=["()","[]","{}","<>"];function w(t,e){return e.forEach(e=>{e.forEach(e=>{if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(e=>[t[e[0]-1],t[e[1]-1]])}})(),n})(),t.exports=e()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.code=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&this.code===t.code&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{constructor(){this.eventListeners={change:[]},this.underlyingSet=new Set}[Symbol.iterator](){return this.underlyingSet.values()}get size(){return this.underlyingSet.size}has(t){return this.includes(t)}includes(t){return this.underlyingSet.has(t)}include(t){return this.includes(t)}add(...t){this.addAll(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")))}remove(...t){this.removeAll(t)}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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperties(t,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseOutline:()=>O.BaseOutline,CTDrawer:()=>mt,CurvedBond:()=>_.CurvedBond,DotBracketDrawer:()=>ht,Drawing:()=>et,Nucleobase:()=>o.Nucleobase,Numbering:()=>d.Numbering,NumberingLine:()=>d.NumberingLine,SchemaDrawer:()=>xt,StraightBond:()=>_.StraightBond,StrungCircle:()=>L.StrungCircle,StrungElement:()=>L.StrungElement,StrungRectangle:()=>L.StrungRectangle,StrungText:()=>L.StrungText,StrungTriangle:()=>L.StrungTriangle});const t=new Uint8Array(16),e=[];for(let t=0;t<256;++t)e.push((t+256).toString(16).slice(1));const i=function(r,n,i){return n||r||!crypto.randomUUID?function(r,n,i){const s=(r=r||{}).random??r.rng?.()??crypto.getRandomValues(t);if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,n){if((i=i||0)<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let t=0;t<16;++t)n[i+t]=s[t];return n}return function(t,r=0){return(e[t[r+0]]+e[t[r+1]]+e[t[r+2]]+e[t[r+3]]+"-"+e[t[r+4]]+e[t[r+5]]+"-"+e[t[r+6]]+e[t[r+7]]+"-"+e[t[r+8]]+e[t[r+9]]+"-"+e[t[r+10]]+e[t[r+11]]+e[t[r+12]]+e[t[r+13]]+e[t[r+14]]+e[t[r+15]]).toLowerCase()}(s)}(r,n,i):crypto.randomUUID()};var s=r(726),o=r(358);class a{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=>this.svgDoc.contains(t.domNode)))}).observe(t,{childList:!0,subtree:!0})}}class u{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new a(t,e)}get bases(){return this.elementsDrawing.elements}set bases(t){this.elementsDrawing.elements=t}append(t){t.appendTo(this.svgDoc),this.bases.push(t)}add(t){let e=o.Nucleobase.create(t);return this.append(e),e}}var c,h,l=r(534),d=r(742),f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t){this.domNode=t,c.set(this,void 0),h.set(this,void 0),f(this,c,new a(t,[]),"f"),f(this,h,new MutationObserver(()=>{this.elements.forEach(t=>{this.domNode.contains(t.owner.domNode)||t.domNode.remove()})}),"f"),m(this,h,"f").observe(t,{childList:!0,subtree:!0})}get elements(){return m(this,c,"f").elements}set elements(t){m(this,c,"f").elements=t}}c=new WeakMap,h=new WeakMap;var y,g,b=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},v=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){this.domNode=t,y.set(this,void 0),b(this,y,new p(t),"f")}get numberings(){return v(this,y,"f").elements}set numberings(t){v(this,y,"f").elements=t}number(t,e){let r=d.Numbering.numbering(t,e);return this.domNode.insertBefore(r.domNode,t.domNode),v(this,y,"f").elements.push(r),r}}y=new WeakMap;class x{constructor(t){this.domNode=t,g.set(this,void 0),b(this,g,new p(t),"f")}get numberingLines(){return v(this,g,"f").elements}set numberingLines(t){v(this,g,"f").elements=t}connect(t){let e=d.NumberingLine.connecting(t);return this.domNode.insertBefore(e.domNode,t.domNode),v(this,g,"f").elements.push(e),e}}g=new WeakMap;var N,O=r(775),S=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class E{constructor(t){this.domNode=t,N.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,N,new p(t),"f")}get baseOutlines(){return S(this,N,"f").elements}set baseOutlines(t){S(this,N,"f").elements=t}append(t){this.domNode.append(t.domNode),this.baseOutlines.push(t)}outline(t){let e=O.BaseOutline.outlining(t);return e.setAttribute("r",""+.54*t.domNode.getBBox().height),t.domNode.insertAdjacentElement("beforebegin",e.domNode),this.baseOutlines.push(e),e}}N=new WeakMap;var _=r(282);class M{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new a(t,e),new MutationObserver(()=>{this.bonds.forEach(t=>{this.svgDoc.contains(t.base1.domNode)&&this.svgDoc.contains(t.base2.domNode)||t.remove()})}).observe(t,{childList:!0,subtree:!0})}get bonds(){return this.elementsDrawing.elements}set bonds(t){this.elementsDrawing.elements=t}}class T{constructor(t,e){this.svgDoc=t,this.defaultValues={attributes:{stroke:"#808080","stroke-width":"1"},basePadding1:6,basePadding2:6},this.bondsDrawing=new M(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=_.StraightBond.between(t,e);return this.append(r),r.set(this.defaultValues),r}}class A{constructor(t,e){this.svgDoc=t,this.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},this.bondsDrawing=new M(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=_.StraightBond.between(t,e);return this.append(r),r.set(this.defaultValues),r}}var P,C=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class j{constructor(t){this.domNode=t,P.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,P,new M(t,[]),"f")}get tertiaryBonds(){return C(this,P,"f").bonds}set tertiaryBonds(t){C(this,P,"f").bonds=t}addTertiaryBond(t,e){let r=_.CurvedBond.between(t,e);return this.domNode.append(r.domNode),this.tertiaryBonds.push(r),r}}P=new WeakMap;var I,L=r(976),D=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class R{constructor(t){I.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,I,new p(t),"f")}get domNode(){return D(this,I,"f").domNode}get strungElements(){return D(this,I,"f").elements}set strungElements(t){D(this,I,"f").elements=t}add(t,e){let r;if("text"==(t=(t=t.trim()).toLowerCase()))r=L.StrungText.on(e);else if("circle"==t)r=L.StrungCircle.on(e);else if("rectangle"==t)r=L.StrungRectangle.on(e);else{if("triangle"!=t)throw new Error(`Unrecognized strung element type: ${t}.`);r=L.StrungTriangle.on(e)}return this.domNode.append(r.domNode),r.lineX+=1,r.lineX-=1,D(this,I,"f").elements.push(r),r}}I=new WeakMap;var V,F,k,B=r(854),U=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},X=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class Y{constructor(t){if(V.set(this,void 0),!(0,B.isNonNullObject)(t))throw new Error("Saved drawings must be non-null objects.");U(this,V,t,"f")}get outerXML(){if((0,B.isString)(X(this,V,"f").outerXML))return X(this,V,"f").outerXML;if((0,B.isString)(X(this,V,"f").svg))return X(this,V,"f").svg;throw new Error("Unable to find the outer XML of the saved drawing.")}get bases(){if((0,B.isArray)(X(this,V,"f").bases)){if(!X(this,V,"f").bases.every(B.isNonNullObject))throw new Error("Saved bases must be non-null objects.");return X(this,V,"f").bases}if((0,B.isArray)(X(this,V,"f").sequences)){if(!X(this,V,"f").sequences.every(B.isNonNullObject))throw new Error("Saved sequences must be non-null objects.");let t=X(this,V,"f").sequences.flatMap(t=>t.bases);if(!t.every(B.isNonNullObject))throw new Error("Saved bases must be non-null objects.");return t}return[]}get outlines(){if((0,B.isArray)(X(this,V,"f").outlines))return X(this,V,"f").outlines;if((0,B.isArray)(X(this,V,"f").baseOutlines))return X(this,V,"f").baseOutlines;try{let t=this.bases;if(t.some(t=>t.outline))return t.filter(t=>t.outline).map(t=>{if(!(0,B.isNonNullObject)(t.outline))throw new Error("Saved outlines must be non-null objects.");return{...t.outline,ownerID:t.textId}})}catch{}return[]}get numberings(){if((0,B.isArray)(X(this,V,"f").numberings))return X(this,V,"f").numberings;if((0,B.isArray)(X(this,V,"f").baseNumberings))return X(this,V,"f").baseNumberings;try{let t=this.bases;if(t.some(t=>t.numbering))return t.filter(t=>t.numbering).map(t=>{if(!(0,B.isNonNullObject)(t.numbering))throw new Error("Saved numberings must be non-null objects.");return{...t.numbering,ownerID:t.textId}})}catch{}return[]}get numberingLines(){if((0,B.isArray)(X(this,V,"f").numberingLines))return X(this,V,"f").numberingLines;if((0,B.isArray)(X(this,V,"f").baseNumberingLines))return X(this,V,"f").baseNumberingLines;try{let t=this.bases;if(t.some(t=>t.numbering))return t.filter(t=>t.numbering).map(t=>t.numbering)}catch{}return[]}get primaryBonds(){return(0,B.isArray)(X(this,V,"f").primaryBonds)?X(this,V,"f").primaryBonds:[]}get secondaryBonds(){return(0,B.isArray)(X(this,V,"f").secondaryBonds)?X(this,V,"f").secondaryBonds:[]}get tertiaryBonds(){return(0,B.isArray)(X(this,V,"f").tertiaryBonds)?X(this,V,"f").tertiaryBonds:[]}get strungElements(){return(0,B.isArray)(X(this,V,"f").strungElements)?X(this,V,"f").strungElements:[...this.primaryBonds,...this.secondaryBonds,...this.tertiaryBonds].flatMap(t=>(0,B.isNonNullObject)(t)&&(0,B.isArray)(t.strungElements)?t.strungElements.flatMap(e=>{try{return new z(e,t).modernized()}catch{return[]}}):[])}}V=new WeakMap;class z{constructor(t,e){if(F.set(this,void 0),k.set(this,void 0),!(0,B.isNonNullObject)(t))throw new Error(`Saved strung element isn't a non-null object: ${t}.`);if(U(this,F,t,"f"),!(0,B.isNonNullObject)(e))throw new Error(`Saved strung element owner isn't a non-null object: ${e}.`);U(this,k,e,"f")}modernized(){var t,e,r;let n="StrungText"==X(this,F,"f").type?"text":"StrungCircle"==X(this,F,"f").type?"circle":"StrungRectangle"==X(this,F,"f").type?"rectangle":"StrungTriangle"==X(this,F,"f").type?"triangle":void 0;if(!n)throw new Error(`Unrecognized strung element type: ${X(this,F,"f").type}.`);return{[n]:{...X(this,F,"f"),id:null!==(e=null!==(t=X(this,F,"f").textId)&&void 0!==t?t:X(this,F,"f").circleId)&&void 0!==e?e:X(this,F,"f").pathId},ownerID:null!==(r=X(this,k,"f").lineId)&&void 0!==r?r:X(this,k,"f").pathId}}}F=new WeakMap,k=new WeakMap;var H,G,$,W,q,J,Q,K=r(645),Z=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},tt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class et{constructor(){H.add(this),this.Nucleobase=o.Nucleobase,this.Numbering=d.Numbering,G.set(this,void 0),this.NumberingLine=d.NumberingLine,$.set(this,void 0),this.BaseOutline=O.BaseOutline,W.set(this,void 0),this.StraightBond=_.StraightBond,this.CurvedBond=_.CurvedBond,q.set(this,void 0),this.StrungElement=L.StrungElement,J.set(this,void 0),this.domNode=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.domNode.setAttribute("viewBox",`0 0 ${rt} ${nt}`),this.domNode.setAttribute("width",`${rt}`),this.domNode.setAttribute("height",`${nt}`),this.basesDrawing=new u(this.domNode,[]),Z(this,G,new w(this.domNode),"f"),Z(this,$,new x(this.domNode),"f"),Z(this,W,new E(this.domNode),"f"),this.primaryBondsDrawing=new T(this.domNode,[]),this.secondaryBondsDrawing=new A(this.domNode,[]),Z(this,q,new j(this.domNode),"f"),Z(this,J,new R(this.domNode),"f")}get outerXML(){return this.domNode.outerHTML}set outerXML(t){new s.OuterXML(this.domNode).set(t)}get innerXML(){return this.domNode.innerHTML}set innerXML(t){new s.InnerXML(this.domNode).set(t)}get name(){return this.domNode.dataset.name}set name(t){void 0===t?this.domNode.removeAttribute("data-name"):this.domNode.setAttribute("data-name",t)}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 s.HorizontalClientScaling(this.domNode).get()}get verticalClientScaling(){return new s.VerticalClientScaling(this.domNode).get()}isEmpty(){return 0==this.domNode.childNodes.length}get bases(){const t=()=>this.basesDrawing.bases;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set bases(t){this.basesDrawing.bases=st(t)?t:[...t]}appendBase(t){this.basesDrawing.append(t)}addBase(t){return this.basesDrawing.add(t)}number(t,e){let r=tt(this,G,"f").number(t,e),n=tt(this,$,"f").connect(r);return r.displacement.magnitude=10,n.direction=(0,l.outwardNormal)(t,...tt(this,H,"a",Q)),n.length=1.15*r.domNode.getBBox().height,[r,n]}get numberings(){const t=()=>tt(this,G,"f").numberings;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set numberings(t){tt(this,G,"f").numberings=st(t)?t:[...t]}get numberingLines(){const t=()=>tt(this,$,"f").numberingLines;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set numberingLines(t){tt(this,$,"f").numberingLines=st(t)?t:[...t]}connect(t){return tt(this,$,"f").connect(t)}get baseOutlines(){const t=()=>tt(this,W,"f").baseOutlines;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set baseOutlines(t){tt(this,W,"f").baseOutlines=st(t)?t:[...t]}get outlines(){return this.baseOutlines}outlineBase(t){return tt(this,W,"f").outline(t)}outline(t){return this.outlineBase(t)}appendBaseOutline(t){tt(this,W,"f").append(t)}get bonds(){return{find:t=>{var e,r;return null!==(r=null!==(e=this.primaryBondsDrawing.primaryBonds.find(t))&&void 0!==e?e:this.secondaryBondsDrawing.secondaryBonds.find(t))&&void 0!==r?r:tt(this,q,"f").tertiaryBonds.find(t)}}}get primaryBonds(){const t=()=>this.primaryBondsDrawing.primaryBonds;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set primaryBonds(t){this.primaryBondsDrawing.primaryBonds=st(t)?t:[...t]}appendPrimaryBond(t){this.primaryBondsDrawing.append(t)}addPrimaryBond(t,e){return this.primaryBondsDrawing.add(t,e)}get secondaryBonds(){const t=()=>this.secondaryBondsDrawing.secondaryBonds;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set secondaryBonds(t){this.secondaryBondsDrawing.secondaryBonds=st(t)?t:[...t]}appendSecondaryBond(t){this.secondaryBondsDrawing.append(t)}addSecondaryBond(t,e){return this.secondaryBondsDrawing.add(t,e)}get tertiaryBonds(){const t=()=>tt(this,q,"f").tertiaryBonds;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set tertiaryBonds(t){tt(this,q,"f").tertiaryBonds=st(t)?t:[...t]}addTertiaryBond(t,e){return tt(this,q,"f").addTertiaryBond(t,e)}get strungElements(){return{[Symbol.iterator]:()=>tt(this,J,"f").strungElements[Symbol.iterator](),toArray:()=>tt(this,J,"f").strungElements}}set strungElements(t){tt(this,J,"f").strungElements=st(t)?t:[...t]}addStrungElement(t,e){return tt(this,J,"f").add(t,e)}rotate(t,e){let r=new Set(t);for(let t of this.numberings)if(r.has(t.owner)){let r=d.NumberingLine.unpadded(t);this.domNode.append(r.domNode),r.direction+=e,r.domNode.remove()}(0,l.rotate)(t,e)}get defaultValues(){let t=this.primaryBondsDrawing,e=this.secondaryBondsDrawing;return{get primaryBonds(){return t.defaultValues},set primaryBonds(e){t.defaultValues=e},get secondaryBonds(){return e.defaultValues},set secondaryBonds(t){e.defaultValues=t}}}get contentBBox(){return K.Box.matching(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})}reset(){this.domNode.innerHTML="",this.basesDrawing.bases=[],tt(this,W,"f").baseOutlines=[],this.primaryBondsDrawing.primaryBonds=[],this.secondaryBondsDrawing.secondaryBonds=[],tt(this,q,"f").tertiaryBonds=[],[...this.domNode.attributes].forEach(t=>this.domNode.removeAttribute(t.name)),this.domNode.setAttribute("viewBox",`0 0 ${rt} ${nt}`),this.domNode.setAttribute("width",`${rt}`),this.domNode.setAttribute("height",`${nt}`)}serialized(){return{outerXML:this.outerXML,bases:this.bases.toArray().map(t=>t.serialized()),numberings:this.numberings.toArray().map(t=>t.serialized()),numberingLines:this.numberingLines.toArray().map(t=>t.serialized()),baseOutlines:this.baseOutlines.toArray().map(t=>t.serialized()),primaryBonds:this.primaryBonds.toArray().map(t=>t.serialized()),secondaryBonds:this.secondaryBonds.toArray().map(t=>t.serialized()),tertiaryBonds:this.tertiaryBonds.toArray().map(t=>t.serialized()),strungElements:this.strungElements.toArray().map(t=>t.serialized())}}static deserialized(t){let e=new Y(t),r=new et,n=document.createElement("div");n.append(r.domNode),n.style.width="0px",n.style.height="0px",document.body.append(n),r.outerXML=e.outerXML;let i=r.domNode;r.bases=e.bases.map(t=>o.Nucleobase.deserialized(t,r));let a=[...r.bases];r.numberings=e.numberings.map(t=>d.Numbering.deserialized(t,{domNode:i,bases:a}));let u=[...r.numberings];r.numberingLines=e.numberingLines.map(t=>d.NumberingLine.deserialized(t,{domNode:i,numberings:u})),r.baseOutlines=e.outlines.map(t=>O.BaseOutline.deserialized(t,r)),r.primaryBonds=e.primaryBonds.map(t=>_.StraightBond.deserialized(t,r)),r.secondaryBonds=e.secondaryBonds.map(t=>_.StraightBond.deserialized(t,r)),r.tertiaryBonds=e.tertiaryBonds.map(t=>_.CurvedBond.recreate(t,r)),r.strungElements=e.strungElements.map(t=>L.StrungElement.recreate(t,r));let c=new s.Texts(r.domNode);return function(t){return(0,B.isNonNullObject)(t)&&"svg"in t}(t)&&c.toArray().filter(t=>1==t.domNode.childNodes.length&&t.domNode.childNodes[0]instanceof SVGTSpanElement).forEach(t=>new it(t.domNode).flatten()),r.domNode.remove(),n.remove(),r}restore(t){let e=et.deserialized(t),r=[...e.bases],n=[...e.numberings],i=[...e.numberingLines],s=[...e.baseOutlines],o=[...e.primaryBonds],a=[...e.secondaryBonds],u=[...e.tertiaryBonds],c=[...e.strungElements];this.reset(),[...this.domNode.attributes].forEach(t=>this.domNode.removeAttribute(t.name)),[...e.domNode.attributes].forEach(t=>this.domNode.setAttribute(t.name,t.value)),[...e.domNode.childNodes].forEach(t=>this.domNode.appendChild(t)),this.bases=r,this.numberings=n,this.numberingLines=i,this.baseOutlines=s,this.primaryBonds=o,this.secondaryBonds=a,this.tertiaryBonds=u,this.strungElements=c}refreshIDs(){[this.domNode,...this.domNode.querySelectorAll("*")].filter(t=>t.hasAttribute("id")).forEach(t=>t.setAttribute("id","id-"+i()))}}G=new WeakMap,$=new WeakMap,W=new WeakMap,q=new WeakMap,J=new WeakMap,H=new WeakSet,Q=function(){return[[...this.bases],this.secondaryBondsDrawing.secondaryBonds.map(t=>t.basePair)]};const rt=250,nt=250;class it{constructor(t){this.domNode=t}flatten(){var t=this.domNode.childNodes[0];t instanceof SVGTSpanElement&&["x","y","dx","dy"].forEach(e=>{let r=t instanceof SVGTSpanElement?t.getAttribute(e):void 0;r&&this.domNode.setAttribute(e,r)}),this.domNode.innerHTML=this.domNode.textContent}}function st(t){return(0,B.isArray)(t)}var ot=r(369),at=r(127),ut=r(986),ct=r(106);class ht{constructor(t){this.targetDrawing=t}draw(t,e){let r=[...t].map(t=>this.targetDrawing.addBase(t));(0,at.consecutivePairs)(r).forEach(t=>this.targetDrawing.addPrimaryBond(...t));let n=(0,ot.parseDotBracket)(e),i=(0,ot.basePairs)(r,n["()"]);i.forEach(t=>this.targetDrawing.addSecondaryBond(...t));let s=(0,ot.basePairs)(r,n.toArray());r.forEach(t=>t.bringToFront());let o=1.87*(0,ut.mean)(r.map(t=>t.bbox.height));if(i.length>0?(0,l.untangle)(r,i,{spacing:o,basePairSpacing:o/2,hairpinLoopSpacing:o/2}):((0,l.linearize)(r,{spacing:o/2}),new l.Direction(r).set(0)),(0,at.missing)(i,s).forEach(t=>this.targetDrawing.addTertiaryBond(...t)),r.length>10){this.targetDrawing.number((0,ct.first)(r),1),this.targetDrawing.number((0,ct.last)(r),r.length);let t=20;r.slice(0,-3).forEach((e,r)=>{let n=r+1;n%t!=0||this.targetDrawing.number(e,n)})}return r.forEach(t=>t.bringToFront()),{bases:r}}}var lt,dt=r(297),ft=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class mt{constructor(t){lt.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,lt,t,"f")}draw(t){let e=(0,dt.parseCT)(t),r=[...e.sequence].map(t=>ft(this,lt,"f").addBase(t));(0,at.consecutivePairs)(r).forEach(t=>ft(this,lt,"f").addPrimaryBond(...t));let n=(0,ot.basePairs)(r,e.positionPairs),[i,s]=(0,at.knotless)(r,n),o=(0,at.missing)(s,n);s.forEach(t=>ft(this,lt,"f").addSecondaryBond(...t)),r.forEach(t=>t.bringToFront());let a=1.87*(0,ut.mean)(r.map(t=>t.bbox.height));if(s.length>0?(0,l.untangle)(r,s,{spacing:a,basePairSpacing:a/2,hairpinLoopSpacing:a/2}):((0,l.linearize)(r,{spacing:a/2}),new l.Direction(r).set(0)),o.forEach(t=>ft(this,lt,"f").addTertiaryBond(...t)),r.length>10){ft(this,lt,"f").number((0,ct.first)(r),1+e.numberingOffset),ft(this,lt,"f").number((0,ct.last)(r),r.length+e.numberingOffset);let t=20;r.slice(0,-3).forEach((r,n)=>{let i=n+1;i%t!=0||ft(this,lt,"f").number(r,i+e.numberingOffset)})}return{bases:r}}}lt=new WeakMap;var pt,yt,gt,bt,vt,wt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class xt{constructor(t){pt.add(this),yt.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,yt,t,"f")}draw(t){var e;(t={...t,classes:[...Nt,...null!==(e=t.classes)&&void 0!==e?e:[]]}).rnaComplexes.forEach(e=>{e.rnaMolecules.forEach(e=>{let r=e.sequence.map(e=>wt(this,pt,"m",gt).call(this,e,t)),n=(0,ut.mean)(r.map(t=>t.bbox.height));wt(this,yt,"f").defaultValues.primaryBonds.attributes["stroke-width"]=""+.125*n,wt(this,yt,"f").defaultValues.primaryBonds.basePadding1=.75*n,wt(this,yt,"f").defaultValues.primaryBonds.basePadding2=.75*n,(0,at.consecutivePairs)(r).forEach(t=>wt(this,yt,"f").addPrimaryBond(...t)),wt(this,yt,"f").defaultValues.secondaryBonds.attributes["stroke-width"]=""+.15*n,wt(this,yt,"f").defaultValues.secondaryBonds.basePadding1=.6*n,wt(this,yt,"f").defaultValues.secondaryBonds.basePadding2=.6*n,new Set(e.basePairs.map(t=>JSON.stringify(t))).forEach(e=>wt(this,pt,"m",bt).call(this,JSON.parse(e),r,t)),d.Numbering.defaultValues.attributes["font-family"]="Helvetica",d.Numbering.defaultValues.attributes["font-size"]=""+.97*n,d.Numbering.defaultValues.attributes["font-weight"]="700",d.Numbering.defaultValues.attributes.fill="#cccccc",d.NumberingLine.defaultValues.attributes.stroke="#cccccc",d.NumberingLine.defaultValues.attributes["stroke-width"]=""+.125*n,d.NumberingLine.defaultValues.basePadding=.75*n,d.NumberingLine.defaultValues.textPadding=.25*n,(0,B.isArray)(e.labels)&&new Set(e.labels.map(t=>JSON.stringify(t))).forEach(t=>wt(this,pt,"m",vt).call(this,JSON.parse(t),r))})})}}yt=new WeakMap,pt=new WeakSet,gt=function(t,e){var r,n;let i=wt(this,yt,"f").addBase(t.residueName),s=null===(r=e.classes)||void 0===r?void 0:r.find(t=>"font"==t.name);return!s||i.setAttributes({...s,name:void 0}),null===(n=t.classes)||void 0===n||n.forEach(t=>{var r;(null!==(r=e.classes)&&void 0!==r?r:[]).filter(e=>e.name==t).forEach(t=>i.setAttributes({...t,name:void 0}))}),i.centerPoint.x=t.x,i.centerPoint.y=t.y,i},bt=function(t,e,r){var n;let i=e[t.residueIndex1],s=e[t.residueIndex2],o=wt(this,yt,"f").addSecondaryBond(i,s);return null===(n=t.classes)||void 0===n||n.forEach(t=>{var e;(null!==(e=r.classes)&&void 0!==e?e:[]).filter(e=>e.name==t).forEach(t=>o.setAttributes({...t,name:void 0}))}),o},vt=function(t,e){if(!(0,B.isNonNullObject)(t))return void console.error(`Label schema is not an object: ${t}.`);if("number"!=typeof t.residueIndex)return void console.error(`Label residue index is not a number: ${t.residueIndex}.`);if(t.residueIndex<0)return void console.error(`Label residue index is negative: ${t.residueIndex}.`);if(t.residueIndex>=e.length)return void console.error(`Label residue index is out-of-bounds: ${t.residueIndex}.`);if(!Number.isInteger(t.residueIndex))return void console.error(`Label residue index is not an integer: ${t.residueIndex}.`);let r=e[t.residueIndex],n=t.residueIndex+1,i=t.labelContent;(0,B.isNonNullObject)(i)||console.error(`Label content schema is not an object: ${i}.`);let s=(0,B.isNonNullObject)(i)&&!(0,B.isNullish)(i.label)&&""!==i.label?`${i.label}`:`${n}`,[o,a]=wt(this,yt,"f").number(r,n),u=o.displacement.direction;o.textContent=s,a.length=1.03*r.domNode.getBBox().height,a.direction=u};const Nt=[{name:"text-black",fill:"#000000"},{name:"text-green",fill:"#00ff00"},{name:"text-red",fill:"#ff00ff"},{name:"text-blue",fill:"#0000ff"}]})(),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.draw=e():t.draw=e()}(this,()=>(()=>{var t={127(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},369(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>p,Stems:()=>m,areConflicting:()=>u,areCrossing:()=>l,areEqual:()=>o,areKnotless:()=>h,areStacked:()=>a,basePairs:()=>w,deepCopy:()=>e,knotless:()=>d,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,radializable:()=>f,sorted:()=>s});var t=r(854);function e(e){return(0,t.isNumbersArray)(e)?[...e]:e.map(t=>[...t])}var i=r(986);function s(t){let r=e(t);return r.forEach(i.sortNumbers),r.sort((t,e)=>t[0]-e[0]),r}function o(t,r){let n=e(t),s=e(r);return(0,i.sortNumbers)(n),(0,i.sortNumbers)(s),[0,1].every(t=>n[t]==s[t])}function a(t,e){let r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function u(t,e){return(0,i.min)(t)==(0,i.min)(e)&&(0,i.max)(t)!=(0,i.max)(e)||(0,i.min)(t)!=(0,i.min)(e)&&(0,i.max)(t)==(0,i.max)(e)}function c(t){if(0==t.length)return[];let e=[];for(let r=0;r<(0,i.max)(t.flat());r++)e.push(void 0);return t.forEach(t=>{e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function h(t){let e=c(t),r=[],n=!1;return e.forEach((t,e)=>{let i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function l(t,e){return!h([t,e])}function d(t){let r=[],n=e(t);n.sort((t,e)=>Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1]));let s=[];return n.forEach(t=>{let e=[t[0]-1,t[1]-1],n=(0,i.min)(e),o=(0,i.max)(e);if(!s[n]&&!s[o]){r.push(t);for(let t=n;t<=o;t++)s[t]=!0}}),r}function f(t){let r=e(t);r.sort(([t,e],[r,n])=>Math.abs(t-e)-Math.abs(r-n));let n=[],i=[];return r.forEach(([t,e])=>{t==e||null!=i[t-1]||null!=i[e-1]||(n.push([t,e]),i[t-1]=e,i[e-1]=t)}),d(n)}class m{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[1];if(0==t.length)return[];let e=s(t),r=[],n=[];return e.forEach(t=>{let e=0==n.length?null:n[n.length-1];!e||a(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r}}class p{constructor(...t){this.targetStructure=t}get(){let t=new m(...this.targetStructure).get().flatMap(t=>[t.map(i.min),t.map(i.max)]);t.forEach(i.sortNumbers),t.sort((t,e)=>(0,i.min)(t)-(0,i.min)(e));let e=[],r=t.shift(),n=t.shift();for(;r&&n;){let s=[],o=(0,i.max)(r),a=(0,i.min)(n);for(let t=o;t<=a;t++)s.push(t);e.push(s),r=n,n=t.shift()}return e}}function y(...t){let e=t[0],r=t[1],n=c(r);if(!h(r))throw new Error("Pseudoknot(s) encountered.");let i=[],s=0;return e.forEach((t,e)=>{let r=e+1,o=n[e];null==o?i.push(s):r<o?(i.push(s),s++):(r==o||s--,i.push(s))}),i}var g=r(106);function b(t){t=(0,g.removeWhitespace)(t);let e={"()":[],"[]":[],"{}":[],"<>":[]};v.forEach(r=>{let[n,i]=r.split(""),o=[...t].map(t=>t===n?"(":t===i?")":".").join("");e[r]=function(t){let e=[],r=[];if([...t].forEach((t,n)=>{let i=n+1;if("."==t);else if("("==t)r.push(i);else if(")"==t){let t=r.pop();if("number"!=typeof t)throw new Error(`Unmatched downstream partner in dot-bracket notation at position: ${i}.`);e.push([t,i])}}),r.length>0)throw new Error(`Unmatched upstream partner in dot-bracket notation at position: ${r.pop()}.`);return s(e)}(o)});let r=()=>s(v.flatMap(t=>e[t]));return{[Symbol.iterator]:()=>r()[Symbol.iterator](),toArray:r,...e}}const v=["()","[]","{}","<>"];function w(t,e){return e.forEach(e=>{e.forEach(e=>{if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(e=>[t[e[0]-1],t[e[1]-1]])}})(),n})(),t.exports=e()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t,e){return t[0]===e[0]&&t[1]===e[1]||t[0]===e[1]&&t[1]===e[0]}function e(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>s,LastPairedBase:()=>a,LeadingDanglingBases:()=>u,Linkers:()=>d,PositionPairs:()=>i,Stems:()=>l,TrailingDanglingBases:()=>c,antiParallelPairs:()=>w,areEqual:()=>t,consecutivePairs:()=>b,knotless:()=>f,missing:()=>x,mountainPlotTraversal:()=>p,other:()=>e,parallelPairs:()=>v,parseDotBracket:()=>y,radializable:()=>m});class i{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 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(),n=t.findIndex(t=>r.includes(t));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var o=r(986);class a{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,o.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,o.max)(r)]}}class u{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(0,r)}}class c{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 a(...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 h=r(369);class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Stems(t,e).get().map(e=>e.map(e=>[t[e[0]-1],t[e[1]-1]]))}}class d{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Linkers(t,e).get().map(e=>e.map(e=>t[e-1]))}}function f(...t){let[e,r]=t,n=new i(...t).get();(0,h.areKnotless)(n)||(n=(0,h.knotless)(n));let s=n.map(t=>[e[t[0]-1],e[t[1]-1]]);return[[...e],s]}function m(...t){let[e,r]=t,n=new i(...t).get();return[[...e],(0,h.radializable)(n).map(([t,r])=>[e[t-1],e[r-1]])]}function p(...t){let[e,r]=t,n=new i(...t).get();return(0,h.mountainPlotTraversal)(e,n)}function y(t,e){let r=(0,h.parseDotBracket)(e),n=()=>(0,h.basePairs)(t,r.toArray());return{[Symbol.iterator]:()=>n()[Symbol.iterator](),toArray:n,"()":(0,h.basePairs)(t,r["()"]),"[]":(0,h.basePairs)(t,r["[]"]),"{}":(0,h.basePairs)(t,r["{}"]),"<>":(0,h.basePairs)(t,r["<>"])}}var g=r(106);function b(t){return(0,g.consecutivePairs)(t)}function v(t){let e=[],r=Math.floor(t.length/2)-1,n=Math.ceil(t.length/2);for(let i=0;i<=r;i++){let r=t[i],s=t[n+i];e.push([r,s])}return e}function w(t){let e=[];for(let r=0;r<Math.floor(t.length/2);r++){let n=t[r],i=t[t.length-r-1];e.push([n,i])}return e}function x(e,r){return r.filter(r=>!e.find(e=>t(r,e))).map(t=>[...t])}})(),n})(),t.exports=e()},645(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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 matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}static bounding(r){let n=[...r];if(0==n.length)throw new Error("An empty collection of boxes doesn't have a bounding box.");let i=n.map(t=>e.matching(t)),s=(0,t.min)(i.map(t=>t.left)),o=(0,t.min)(i.map(t=>t.top)),a=(0,t.max)(i.map(t=>t.right))-s,u=(0,t.max)(i.map(t=>t.bottom))-o;return new e(s,o,a,u)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get centerX(){return this.minX+this.width/2}get centerY(){return this.minY+this.height/2}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}bounds(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){let r="number"==typeof t[0]?t[0]:"factor"in t[0]?t[0].factor*this.width:t[0].percentage/100*this.width,n="number"==typeof t[0]&&"number"==typeof t[1]?t[1]:"number"==typeof t[0]?t[0]:"factor"in t[0]?t[0].factor*this.height:t[0].percentage/100*this.height;return new e(this.x-r,this.y-n,this.width+2*r,this.height+2*n)}get periphery(){return{atAngle:t=>{let e=this.width/2,r=this.height/2,n=Math.pow(Math.pow(e,2)+Math.pow(r,2),.5),i=this.centerX+n*Math.cos(t),s=this.centerY+n*Math.sin(t),o=n;return Math.abs(this.centerX-i)>e&&(o=Math.abs(e/Math.cos(t)),o=Number.isFinite(o)?o:r),Math.abs(this.centerY-s)>r&&(o=Math.abs(r/Math.sin(t)),o=Number.isFinite(o)?o:e),{x:this.centerX+o*Math.cos(t),y:this.centerY+o*Math.sin(t)}}}}}})(),n})(),t.exports=e()},297(t){var e;e=()=>(()=>{var t={106(t){var e;e=()=>(()=>{var t={992: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,{KeyBinding:()=>m});var r,n,i,s,o,a,u,c,h,l,d=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},f=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class m{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),d(this,n,e,"f"),d(this,i,t=>f(this,r,"m",l).call(this,t),"f"),d(this,s,a,"f")}get owner(){return f(this,o,"f")}set owner(t){var e;null===(e=f(this,o,"f"))||void 0===e||e.removeEventListener("keydown",f(this,i,"f")),null==t||t.addEventListener("keydown",f(this,i,"f"),{passive:!1}),d(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=f(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=f(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=f(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=f(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&t.key.toUpperCase()===this.key.toUpperCase()&&t.altKey===f(this,r,"a",a)&&t.ctrlKey===f(this,r,"a",u)&&t.metaKey===f(this,r,"a",c)&&t.shiftKey===f(this,r,"a",h)&&(t.preventDefault(),f(this,n,"f").call(this))},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";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.split(/\r\n|\r|\n/)}function a(t){try{return JSON.stringify(t),!0}catch(t){return!1}}function u(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function c(t){return t===document.activeElement}function h(t){return!!document.activeElement&&t.contains(document.activeElement)}r.r(n),r.d(n,{DownloadableFile:()=>g,EventfulSet:()=>b,FiniteStack:()=>S,KeyBinding:()=>l.KeyBinding,containsFocus:()=>h,detectMacOS:()=>f,detectWindows:()=>d,first:()=>t,hasFocus:()=>c,isJSONSerializable:()=>a,isURL:()=>E,last:()=>e,middleFour:()=>s,middleThree:()=>i,shuffled:()=>u,splitLines:()=>o});var l=r(992);function d(){return-1!==navigator.userAgent.indexOf("Windows")}function f(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var m,p=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},y=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class g{constructor(t,e,r){m.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",p(this,m,null==r?void 0:r.type,"f")}get type(){return null!=y(this,m,"f")?y(this,m,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){p(this,m,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}m=new WeakMap;class b{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)}}var v,w,x,N,O=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class S{constructor(t){v.add(this),this.maxSize=t,w.set(this,[]),x.set(this,{change:[]})}get size(){return O(this,w,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,w),O(this,v,"m",N).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return O(this,w,"f")[O(this,w,"f").length-1]}push(t){O(this,w,"f").push(t),this.size>this.maxSize&&O(this,w,"f").shift(),O(this,v,"m",N).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=O(this,w,"f").pop();return O(this,v,"m",N).call(this,"change"),t}addEventListener(t,e){O(this,x,"f")[t].push(e)}removeEventListener(t,e){O(this,x,"f")[t]=O(this,x,"f")[t].filter(t=>t!==e)}}function E(t){try{return new URL(t),!0}catch(t){return!1}}w=new WeakMap,x=new WeakMap,v=new WeakSet,N=function(t){O(this,x,"f")[t].forEach(t=>t())}})(),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,{isCT:()=>d,parseCT:()=>e});var t=r(106);function e(e){let r=function(t){let e=t.findIndex(t=>!i(t)&&!s(t));if(e<0)throw new Error("Unable to find the start of the structure.");let r=[...t].reverse().findIndex(t=>!i(t)&&!s(t));if(r<0)throw new Error("Unable to find the end of the structure.");return r=t.length-r-1,t.slice(e,r+1)}((0,t.splitLines)(e));return{description:o(r),sequence:a(r),positionPairs:u(r),numberingOffset:c(r)}}function i(t){return 0==t.trim().length}function s(t){return"#"==t.trim().charAt(0)}function o(t){if(0==t.length)return;let e=t[0],r=h(e);if(r.length<2)return;let n=r[0];return e.slice(e.indexOf(n)+n.length).trim()}function a(t){return t.slice(1).map(t=>{let e=h(t);if(e.length<2)throw new Error("Line is missing a character.");return e[1]}).join("")}function u(t){let e=t.slice(1),r=[];return e.forEach((t,e)=>{let n=e+1,i=h(t);if(i.length>=5){let t=Number.parseFloat(i[4]);if(Number.isNaN(t))throw new Error("Partner positions must be numbers.");if(!Number.isInteger(t))throw new Error("Partner positions must be integers.");0!=t&&n<=t&&r.push([n,t])}}),r}function c(t){if(t.length<2)return 0;let e=h(t[1]);if(e.length<6)return 0;let r=Number.parseFloat(e[5]);return Number.isNaN(r)?0:Number.isInteger(r)?r-1:0}function h(t){return function(t){return t.split(/\s/)}(t).filter(l)}function l(t){return t.length>0}function d(r){let n;try{n=e(r)}catch(t){return!1}if(0==n.sequence.length)return!1;let i=(0,t.splitLines)(r);if(i=i.filter(e=>!function(t){return 0==t.length}(e)&&!function(t){return 0==t.trim().length}(e)&&!function(e){return!((0,t.splitLines)(e).length>1)&&"#"==e.trim().charAt(0)}(e)),0==i.length)return!1;let s=(0,t.first)(i),o=Number.parseFloat(s.trim().split(/\s+/)[0]);if(!Number.isInteger(o))return!1;let a=i.slice(1);return 0!=a.length&&a.every(t=>{let e=t.trim().split(/\s+/);if(e.length<5)return!1;let r=Number.parseFloat(e[4]);return Number.isInteger(r)})}})(),n})(),t.exports=e()},282(t){var e;e=()=>(()=>{var t={127(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},369(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>p,Stems:()=>m,areConflicting:()=>u,areCrossing:()=>l,areEqual:()=>o,areKnotless:()=>h,areStacked:()=>a,basePairs:()=>w,deepCopy:()=>e,knotless:()=>d,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,radializable:()=>f,sorted:()=>s});var t=r(854);function e(e){return(0,t.isNumbersArray)(e)?[...e]:e.map(t=>[...t])}var i=r(986);function s(t){let r=e(t);return r.forEach(i.sortNumbers),r.sort((t,e)=>t[0]-e[0]),r}function o(t,r){let n=e(t),s=e(r);return(0,i.sortNumbers)(n),(0,i.sortNumbers)(s),[0,1].every(t=>n[t]==s[t])}function a(t,e){let r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function u(t,e){return(0,i.min)(t)==(0,i.min)(e)&&(0,i.max)(t)!=(0,i.max)(e)||(0,i.min)(t)!=(0,i.min)(e)&&(0,i.max)(t)==(0,i.max)(e)}function c(t){if(0==t.length)return[];let e=[];for(let r=0;r<(0,i.max)(t.flat());r++)e.push(void 0);return t.forEach(t=>{e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function h(t){let e=c(t),r=[],n=!1;return e.forEach((t,e)=>{let i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function l(t,e){return!h([t,e])}function d(t){let r=[],n=e(t);n.sort((t,e)=>Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1]));let s=[];return n.forEach(t=>{let e=[t[0]-1,t[1]-1],n=(0,i.min)(e),o=(0,i.max)(e);if(!s[n]&&!s[o]){r.push(t);for(let t=n;t<=o;t++)s[t]=!0}}),r}function f(t){let r=e(t);r.sort(([t,e],[r,n])=>Math.abs(t-e)-Math.abs(r-n));let n=[],i=[];return r.forEach(([t,e])=>{t==e||null!=i[t-1]||null!=i[e-1]||(n.push([t,e]),i[t-1]=e,i[e-1]=t)}),d(n)}class m{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[1];if(0==t.length)return[];let e=s(t),r=[],n=[];return e.forEach(t=>{let e=0==n.length?null:n[n.length-1];!e||a(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r}}class p{constructor(...t){this.targetStructure=t}get(){let t=new m(...this.targetStructure).get().flatMap(t=>[t.map(i.min),t.map(i.max)]);t.forEach(i.sortNumbers),t.sort((t,e)=>(0,i.min)(t)-(0,i.min)(e));let e=[],r=t.shift(),n=t.shift();for(;r&&n;){let s=[],o=(0,i.max)(r),a=(0,i.min)(n);for(let t=o;t<=a;t++)s.push(t);e.push(s),r=n,n=t.shift()}return e}}function y(...t){let e=t[0],r=t[1],n=c(r);if(!h(r))throw new Error("Pseudoknot(s) encountered.");let i=[],s=0;return e.forEach((t,e)=>{let r=e+1,o=n[e];null==o?i.push(s):r<o?(i.push(s),s++):(r==o||s--,i.push(s))}),i}var g=r(106);function b(t){t=(0,g.removeWhitespace)(t);let e={"()":[],"[]":[],"{}":[],"<>":[]};v.forEach(r=>{let[n,i]=r.split(""),o=[...t].map(t=>t===n?"(":t===i?")":".").join("");e[r]=function(t){let e=[],r=[];if([...t].forEach((t,n)=>{let i=n+1;if("."==t);else if("("==t)r.push(i);else if(")"==t){let t=r.pop();if("number"!=typeof t)throw new Error(`Unmatched downstream partner in dot-bracket notation at position: ${i}.`);e.push([t,i])}}),r.length>0)throw new Error(`Unmatched upstream partner in dot-bracket notation at position: ${r.pop()}.`);return s(e)}(o)});let r=()=>s(v.flatMap(t=>e[t]));return{[Symbol.iterator]:()=>r()[Symbol.iterator](),toArray:r,...e}}const v=["()","[]","{}","<>"];function w(t,e){return e.forEach(e=>{e.forEach(e=>{if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(e=>[t[e[0]-1],t[e[1]-1]])}})(),n})(),t.exports=e()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t,e){return t[0]===e[0]&&t[1]===e[1]||t[0]===e[1]&&t[1]===e[0]}function e(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>s,LastPairedBase:()=>a,LeadingDanglingBases:()=>u,Linkers:()=>d,PositionPairs:()=>i,Stems:()=>l,TrailingDanglingBases:()=>c,antiParallelPairs:()=>w,areEqual:()=>t,consecutivePairs:()=>b,knotless:()=>f,missing:()=>x,mountainPlotTraversal:()=>p,other:()=>e,parallelPairs:()=>v,parseDotBracket:()=>y,radializable:()=>m});class i{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 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(),n=t.findIndex(t=>r.includes(t));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var o=r(986);class a{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,o.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,o.max)(r)]}}class u{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(0,r)}}class c{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 a(...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 h=r(369);class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Stems(t,e).get().map(e=>e.map(e=>[t[e[0]-1],t[e[1]-1]]))}}class d{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Linkers(t,e).get().map(e=>e.map(e=>t[e-1]))}}function f(...t){let[e,r]=t,n=new i(...t).get();(0,h.areKnotless)(n)||(n=(0,h.knotless)(n));let s=n.map(t=>[e[t[0]-1],e[t[1]-1]]);return[[...e],s]}function m(...t){let[e,r]=t,n=new i(...t).get();return[[...e],(0,h.radializable)(n).map(([t,r])=>[e[t-1],e[r-1]])]}function p(...t){let[e,r]=t,n=new i(...t).get();return(0,h.mountainPlotTraversal)(e,n)}function y(t,e){let r=(0,h.parseDotBracket)(e),n=()=>(0,h.basePairs)(t,r.toArray());return{[Symbol.iterator]:()=>n()[Symbol.iterator](),toArray:n,"()":(0,h.basePairs)(t,r["()"]),"[]":(0,h.basePairs)(t,r["[]"]),"{}":(0,h.basePairs)(t,r["{}"]),"<>":(0,h.basePairs)(t,r["<>"])}}var g=r(106);function b(t){return(0,g.consecutivePairs)(t)}function v(t){let e=[],r=Math.floor(t.length/2)-1,n=Math.ceil(t.length/2);for(let i=0;i<=r;i++){let r=t[i],s=t[n+i];e.push([r,s])}return e}function w(t){let e=[];for(let r=0;r<Math.floor(t.length/2);r++){let n=t[r],i=t[t.length-r-1];e.push([n,i])}return e}function x(e,r){return r.filter(r=>!e.find(e=>t(r,e))).map(t=>[...t])}})(),n})(),t.exports=e()},801(t){var e;e=()=>(()=>{var t={726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>Q,Circle:()=>u,CoordinateSystem:()=>ot,Ellipse:()=>c,ForeignObject:()=>H,HorizontalClientScaling:()=>ut,Image:()=>Y,InnerXML:()=>mt,Line:()=>a,OuterXML:()=>gt,Path:()=>X,Polygon:()=>p,Polyline:()=>m,Rect:()=>h,SVG:()=>t,Scaling:()=>at,Text:()=>o,Texts:()=>J,Use:()=>z,VerticalClientScaling:()=>ct,assignUUID:()=>st,bringToFront:()=>ht,drawOnCanvas:()=>xt,isSVGGraphicsElement:()=>bt,isSVGGraphicsElementsArray:()=>wt,sendToBack:()=>lt,setAttributes:()=>et,shift:()=>G});class t{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var e,i=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class s{constructor(t){e.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,e,t)}isEmpty(){return 0==i(this,e,"f").numberOfItems}shift(t){for(let r=0;r<i(this,e,"f").numberOfItems;r++)i(this,e,"f").getItem(r).value+=t}}e=new WeakMap;class o{constructor(t){this.domNode=t}shift(t,e){let r=new s(this.domNode.x.baseVal),n=new s(this.domNode.y.baseVal);r.shift(t),n.shift(e),r.isEmpty()&&this.domNode.setAttribute("x",`${t}`),n.isEmpty()&&this.domNode.setAttribute("y",`${e}`),this.domNode.querySelectorAll("tspan").forEach(r=>{new s(r.x.baseVal).shift(t),new s(r.y.baseVal).shift(e)})}}class a{constructor(t){this.domNode=t}shift(t,e){this.domNode.x1.baseVal.value+=t,this.domNode.y1.baseVal.value+=e,this.domNode.x2.baseVal.value+=t,this.domNode.y2.baseVal.value+=e}}class u{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class c{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class h{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var l,d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(t){l.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,l,t)}shift(t,e){for(let r=0;r<d(this,l,"f").numberOfItems;r++){let n=d(this,l,"f").getItem(r);n.x+=t,n.y+=e}}}l=new WeakMap;class m{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}class p{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}var y=r(725);const g=" ";function b([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function v(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const w=Math.PI;function x(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:n,rY:i}=t;const{x:s,y:o}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+o)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*w,[u,c]=b([(e-s)/2,(r-o)/2],-a),h=Math.pow(u,2)/Math.pow(n,2)+Math.pow(c,2)/Math.pow(i,2);1<h&&(n*=Math.sqrt(h),i*=Math.sqrt(h)),t.rX=n,t.rY=i;const l=Math.pow(n,2)*Math.pow(c,2)+Math.pow(i,2)*Math.pow(u,2),d=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-l)/l)),f=n*c/i*d,m=-i*u/n*d,p=b([f,m],a);t.cX=p[0]+(e+s)/2,t.cY=p[1]+(r+o)/2,t.phi1=Math.atan2((c-m)/i,(u-f)/n),t.phi2=Math.atan2((-c-m)/i,(-u-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*w),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*w),t.phi1*=180/w,t.phi2*=180/w}function N(t,e,r){v(t,e,r);const n=t*t+e*e-r*r;if(0>n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}const O=Math.PI/180;function S(t,e,r){return(1-r)*t+r*e}function E(t,e,r,n){return t+Math.cos(n/180*w)*e+Math.sin(n/180*w)*r}function _(t,e,r,n){const i=1e-6,s=e-t,o=r-e,a=3*s+3*(n-r)-6*o,u=6*(o-s),c=3*s;return Math.abs(a)<i?Math.abs(u)<i?[]:[-c/u]:function(t,e,r=1e-6){const n=t*t/4-e;if(n<-r)return[];if(n<=r)return[-t/2];const i=Math.sqrt(n);return[-t/2-i,-t/2+i]}(u/a,c/a,i)}function M(t,e,r,n,i){const s=1-i;return t*(s*s*s)+e*(3*s*s*i)+r*(3*s*i*i)+n*(i*i*i)}function T(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],s=r[0]-t[0],o=r[1]-t[1],a=n*o-i*s;if(!(Math.abs(a)<1e-10))return!1;const u=n*s+i*o,c=s*s+o*o;return 0<=u&&u<=c&&n*n+i*i<=c}function A(t){const e=t[t.length-1]?.type===B.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:B.MOVE_TO,relative:!1,x:t[r].x,y:t[r].y}];for(let e=r;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case B.HORIZ_LINE_TO:n.push({type:B.HORIZ_LINE_TO,relative:!1,x:i.x});break;case B.VERT_LINE_TO:n.push({type:B.VERT_LINE_TO,relative:!1,y:i.y});break;case B.LINE_TO:case B.MOVE_TO:n.push({type:B.LINE_TO,relative:!1,x:i.x,y:i.y});break;case B.CURVE_TO:n.push({type:B.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case B.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case B.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case B.ARC:throw new Error("Unsupported command: A (arc)");case B.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:B.CLOSE_PATH}),n}function P(){return I((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t))}function C(){let t=NaN,e=NaN,r=NaN,n=NaN;return I((i,s,o)=>(i.type&B.SMOOTH_CURVE_TO&&(i.type=B.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?o:e,i.x1=i.relative?s-t:2*s-t,i.y1=i.relative?o-e:2*o-e),i.type&B.CURVE_TO?(t=i.relative?s+i.x2:i.x2,e=i.relative?o+i.y2:i.y2):(t=NaN,e=NaN),i.type&B.SMOOTH_QUAD_TO&&(i.type=B.QUAD_TO,r=isNaN(r)?s:r,n=isNaN(n)?o:n,i.x1=i.relative?s-r:2*s-r,i.y1=i.relative?o-n:2*o-n),i.type&B.QUAD_TO?(r=i.relative?s+i.x1:i.x1,n=i.relative?o+i.y1:i.y1):(r=NaN,n=NaN),i))}function j(){let t=NaN,e=NaN;return I((r,n,i)=>{if(r.type&B.SMOOTH_QUAD_TO&&(r.type=B.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?i:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?i-e:2*i-e),r.type&B.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const s=r.x1,o=r.y1;r.type=B.CURVE_TO,r.x1=((r.relative?0:n)+2*s)/3,r.y1=((r.relative?0:i)+2*o)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*o)/3}else t=NaN,e=NaN;return r})}function I(t){let e=0,r=0,n=NaN,i=NaN;return function(s){if(isNaN(n)&&!(s.type&B.MOVE_TO))throw new Error("path must start with moveto");const o=t(s,e,r,n,i);return s.type&B.CLOSE_PATH&&(e=n,r=i),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&B.MOVE_TO&&(n=e,i=r),o}}function L(t,e,r,n,i,s){return v(t,e,r,n,i,s),I((o,a,u,c)=>{const h=o.x1,l=o.x2,d=o.relative&&!isNaN(c),f=void 0!==o.x?o.x:d?0:a,m=void 0!==o.y?o.y:d?0:u;function p(t){return t*t}o.type&B.HORIZ_LINE_TO&&0!==e&&(o.type=B.LINE_TO,o.y=o.relative?0:u),o.type&B.VERT_LINE_TO&&0!==r&&(o.type=B.LINE_TO,o.x=o.relative?0:a),void 0!==o.x&&(o.x=o.x*t+m*r+(d?0:i)),void 0!==o.y&&(o.y=f*e+o.y*n+(d?0:s)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*r+(d?0:i)),void 0!==o.y1&&(o.y1=h*e+o.y1*n+(d?0:s)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*r+(d?0:i)),void 0!==o.y2&&(o.y2=l*e+o.y2*n+(d?0:s));const y=t*n-e*r;if(void 0!==o.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===y)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=B.LINE_TO;else{const i=o.xRot*Math.PI/180,s=Math.sin(i),a=Math.cos(i),u=1/p(o.rX),c=1/p(o.rY),h=p(a)*u+p(s)*c,l=2*s*a*(u-c),d=p(s)*u+p(a)*c,f=h*n*n-l*e*n+d*e*e,m=l*(t*n+e*r)-2*(h*r*n+d*t*e),g=h*r*r-l*t*r+d*t*t,b=(Math.atan2(m,f-g)+Math.PI)%Math.PI/2,v=Math.sin(b),w=Math.cos(b);o.rX=Math.abs(y)/Math.sqrt(f*p(w)+m*v*w+g*p(v)),o.rY=Math.abs(y)/Math.sqrt(f*p(v)-m*v*w+g*p(w)),o.xRot=180*b/Math.PI}return void 0!==o.sweepFlag&&0>y&&(o.sweepFlag=+!o.sweepFlag),o})}const D={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return v(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:P,TO_REL:function(){return I((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,n=!0){return I((i,s,o,a,u)=>{if(isNaN(a)&&!(i.type&B.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&B.HORIZ_LINE_TO&&(i.type=B.LINE_TO,i.y=i.relative?0:o),r&&i.type&B.VERT_LINE_TO&&(i.type=B.LINE_TO,i.x=i.relative?0:s),t&&i.type&B.CLOSE_PATH&&(i.type=B.LINE_TO,i.x=i.relative?a-s:a,i.y=i.relative?u-o:u),i.type&B.ARC&&(0===i.rX||0===i.rY)&&(i.type=B.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&B.QUAD_TO&&T([s,o],i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],i.relative?[s+i.x,o+i.y]:[i.x,i.y])&&(i.type=B.LINE_TO,delete i.x1,delete i.y1),n&&i.type&B.CURVE_TO){const t=[s,o],e=i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],r=i.relative?[s+i.x2,o+i.y2]:[i.x2,i.y2],n=i.relative?[s+i.x,o+i.y]:[i.x,i.y];T(t,e,n)&&T(t,r,n)&&(i.type=B.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:C,QT_TO_C:j,INFO:I,SANITIZE:function(t=0){v(t);let e=NaN,r=NaN,n=NaN,i=NaN;return I((s,o,a,u,c)=>{const h=Math.abs;let l=!1,d=0,f=0;if(s.type&B.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:o-e,f=isNaN(r)?0:a-r),s.type&(B.CURVE_TO|B.SMOOTH_CURVE_TO)?(e=s.relative?o+s.x2:s.x2,r=s.relative?a+s.y2:s.y2):(e=NaN,r=NaN),s.type&B.SMOOTH_QUAD_TO?(n=isNaN(n)?o:2*o-n,i=isNaN(i)?a:2*a-i):s.type&B.QUAD_TO?(n=s.relative?o+s.x1:s.x1,i=s.relative?a+s.y1:s.y2):(n=NaN,i=NaN),s.type&B.LINE_COMMANDS||s.type&B.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&B.CURVE_TO||s.type&B.SMOOTH_CURVE_TO||s.type&B.QUAD_TO||s.type&B.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-o,r=void 0===s.y?0:s.relative?s.y:s.y-a;d=isNaN(n)?void 0===s.x1?d:s.relative?s.x:s.x1-o:n-o,f=isNaN(i)?void 0===s.y1?f:s.relative?s.y:s.y1-a:i-a;const u=void 0===s.x2?0:s.relative?s.x:s.x2-o,c=void 0===s.y2?0:s.relative?s.y:s.y2-a;h(e)<=t&&h(r)<=t&&h(d)<=t&&h(f)<=t&&h(u)<=t&&h(c)<=t&&(l=!0)}return s.type&B.CLOSE_PATH&&h(o-u)<=t&&h(a-c)<=t&&(l=!0),l?[]:s})},MATRIX:L,ROTATE:function(t,e=0,r=0){v(t,e,r);const n=Math.sin(t),i=Math.cos(t);return L(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},TRANSLATE:function(t,e=0){return v(t,e),L(1,0,0,1,t,e)},SCALE:function(t,e=t){return v(t,e),L(t,0,0,e,0,0)},SKEW_X:function(t){return v(t),L(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return v(t),L(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return v(t),L(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return v(t),L(1,0,0,-1,0,t)},A_TO_C:function(){return I((t,e,r)=>B.ARC===t.type?function(t,e,r){t.cX||x(t,e,r);const n=t.xRot/180*w;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:B.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const i=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-i,o=Math.ceil(s/90),a=new Array(o);let u=e,c=r;const h=(e,r)=>{const[i,s]=b([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+s]};for(let e=0;e<o;e++){const r=S(t.phi1,t.phi2,e/o),n=S(t.phi1,t.phi2,(e+1)/o),i=n-r,s=4/3*Math.tan(i*O/4),l=Math.cos(r*O)-s*Math.sin(r*O),d=Math.sin(r*O)+s*Math.cos(r*O),f=Math.cos(n*O),m=Math.sin(n*O),p=f+s*m,y=m-s*f,g=h(l,d),b=h(p,y),v=h(f,m),w={relative:t.relative,type:B.CURVE_TO,x:v[0],y:v[1],x1:g[0],y1:g[1],x2:b[0],y2:b[1]};t.relative&&(w.x1-=u,w.y1-=c,w.x2-=u,w.y2-=c,w.x-=u,w.y-=c),u=v[0],c=v[1],a[e]=w}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return I((t,e,r)=>(t.relative&&(e=0,r=0),B.ARC===t.type&&x(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=P(),e=j(),r=C(),n=I((i,s,o)=>{const a=r(e(t((t=>({...t}))(i))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(a.type&B.DRAWING_COMMANDS&&(u(s),c(o)),a.type&B.HORIZ_LINE_TO&&u(a.x),a.type&B.VERT_LINE_TO&&c(a.y),a.type&B.LINE_TO&&(u(a.x),c(a.y)),a.type&B.CURVE_TO){u(a.x),c(a.y);const t=_(s,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(M(s,a.x1,a.x2,a.x,e));const e=_(o,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(M(o,a.y1,a.y2,a.y,t))}if(a.type&B.ARC){u(a.x),c(a.y),x(a,s,o);const t=a.xRot/180*Math.PI,e=Math.cos(t)*a.rX,r=Math.sin(t)*a.rX,n=-Math.sin(t)*a.rY,i=Math.cos(t)*a.rY,[h,l]=a.phi1<a.phi2?[a.phi1,a.phi2]:-180>a.phi2?[a.phi2+360,a.phi1+360]:[a.phi2,a.phi1],d=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<h?r+360:r},f=N(n,-e,0).map(d);for(const t of f)t>h&&t<l&&u(E(a.cX,e,n,t));const m=N(i,-r,0).map(d);for(const t of m)t>h&&t<l&&c(E(a.cY,r,i,t))}return i});return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=D.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const s of t){const t=r(s);t.type===B.MOVE_TO&&i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(D.INFO((t,e,r)=>{const n="relative"in t&&t.relative;return["x"in t?t.x+(n?e:0):e,"y"in t?t.y+(n?r:0):r]}));let n=r[0];e.push(t[0]);for(let i=1;i<t.length;i++){const s=t[i],o=t[i+1];if(i<t.length-1&&o&&s.type&B.LINE_COMMANDS&&o.type&B.LINE_COMMANDS){const t=r[i+1];if(T(n,r[i],t)){"relative"in o&&o.relative&&("x"in o&&(o.x=t[0]-n[0]),"y"in o&&(o.y=t[1]-n[1]));continue}}e.push(s),n=r[i]}return e}};class R{round(t){return this.transform(D.ROUND(t))}toAbs(){return this.transform(D.TO_ABS())}toRel(){return this.transform(D.TO_REL())}normalizeHVZ(t,e,r){return this.transform(D.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(D.NORMALIZE_ST())}qtToC(){return this.transform(D.QT_TO_C())}aToC(){return this.transform(D.A_TO_C())}sanitize(t){return this.transform(D.SANITIZE(t))}translate(t,e){return this.transform(D.TRANSLATE(t,e))}scale(t,e){return this.transform(D.SCALE(t,e))}rotate(t,e,r){return this.transform(D.ROTATE(t,e,r))}matrix(t,e,r,n,i,s){return this.transform(D.MATRIX(t,e,r,n,i,s))}skewX(t){return this.transform(D.SKEW_X(t))}skewY(t){return this.transform(D.SKEW_Y(t))}xSymmetry(t){return this.transform(D.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(D.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(D.ANNOTATE_ARCS())}}const V=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,F=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class k extends R{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let n=0;n<t.length;n++){const i=t[n],s=!(this.curCommandType!==B.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=F(i)&&("0"===this.curNumber&&"0"===i||s);if(!F(i)||o)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${n}`);if(this.curCommandType===B.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${n}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${n}"`);this.curArgs.push(t),this.curArgs.length===U[this.curCommandType]&&(B.HORIZ_LINE_TO===this.curCommandType?r({type:B.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):B.VERT_LINE_TO===this.curCommandType?r({type:B.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===B.MOVE_TO||this.curCommandType===B.LINE_TO||this.curCommandType===B.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),B.MOVE_TO===this.curCommandType&&(this.curCommandType=B.LINE_TO)):this.curCommandType===B.CURVE_TO?r({type:B.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===B.SMOOTH_CURVE_TO?r({type:B.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.QUAD_TO?r({type:B.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.ARC&&r({type:B.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!V(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(o)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${n}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${i}" at index ${n}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=B.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=B.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=B.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=B.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=B.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=B.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=B.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=B.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=B.ARC,this.curCommandRelative="a"===i}else e.push({type:B.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const n=Object.getPrototypeOf(this).parse.call(this,e);for(const e of n){const n=t(e);Array.isArray(n)?r.push(...n):r.push(n)}return r}}})}}class B extends R{commands;constructor(t){super(),this.commands="string"==typeof t?B.parse(t):t}encode(){return B.encode(this.commands)}getBounds(){const t=D.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const n=t(r);Array.isArray(n)?e.push(...n):e.push(n)}return this.commands=e,this}reverse(t=!0){return this.commands=D.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=D.REMOVE_COLLINEAR(this.commands),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const n=t[r];if(n.type===B.CLOSE_PATH)e+="z";else if(n.type===B.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===B.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===B.MOVE_TO)e+=(n.relative?"m":"M")+n.x+g+n.y;else if(n.type===B.LINE_TO)e+=(n.relative?"l":"L")+n.x+g+n.y;else if(n.type===B.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+g+n.y1+g+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+g+n.y1+g+n.x+g+n.y;else if(n.type===B.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+g+n.y;else{if(n.type!==B.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+g+n.rY+g+n.xRot+g+ +n.lArcFlag+g+ +n.sweepFlag+g+n.x+g+n.y}}return e}(t)}static parse(t){const e=new k,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=B.LINE_TO|B.HORIZ_LINE_TO|B.VERT_LINE_TO;static DRAWING_COMMANDS=B.HORIZ_LINE_TO|B.VERT_LINE_TO|B.LINE_TO|B.CURVE_TO|B.SMOOTH_CURVE_TO|B.QUAD_TO|B.SMOOTH_QUAD_TO|B.ARC}const U={[B.MOVE_TO]:2,[B.LINE_TO]:2,[B.HORIZ_LINE_TO]:1,[B.VERT_LINE_TO]:1,[B.CLOSE_PATH]:0,[B.QUAD_TO]:4,[B.SMOOTH_QUAD_TO]:2,[B.CURVE_TO]:6,[B.SMOOTH_CURVE_TO]:4,[B.ARC]:7};class X{constructor(t){this.domNode=t}shift(t,e){var r;let n=null!==(r=this.domNode.getAttribute("d"))&&void 0!==r?r:"";this.domNode.setAttribute("d",new B(n).translate(t,e).encode())}closestPoint(t){let e=this.domNode.getTotalLength(),r=[];for(let n=0;n<=16;n++){let i=n/16*e;r.push([i,(0,y.distance)(t,this.domNode.getPointAtLength(i))])}r.sort((t,e)=>t[1]-e[1]);let n=r[0],i=n[0]-e/16,s=n[0]+e/16;i=Math.max(0,i),s=Math.min(e,s);for(let e=0;e<20;e++){let e=(s-i)/3;(0,y.distance)(t,this.domNode.getPointAtLength(i))<(0,y.distance)(t,this.domNode.getPointAtLength(s))?s-=e:i+=e}let o=(i+s)/2,a=this.domNode.getPointAtLength(o);return{x:a.x,y:a.y,length:o}}}class Y{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class z{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class H{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}function G(e,r){let{x:n,y:i}=r,s=e.tagName;if(!$.has(s))switch(s){case"g":Array.from(e.children).forEach(t=>G(t,r));break;case"svg":new t(e).shift(n,i);break;case"text":new o(e).shift(n,i);break;case"line":new a(e).shift(n,i);break;case"circle":new u(e).shift(n,i);break;case"ellipse":new c(e).shift(n,i);break;case"rect":new h(e).shift(n,i);break;case"polyline":new m(e).shift(n,i);break;case"polygon":new p(e).shift(n,i);break;case"path":new X(e).shift(n,i);break;case"image":new Y(e).shift(n,i);break;case"use":new z(e).shift(n,i);break;case"foreignObject":new H(e).shift(n,i);break;default:console.error(`Unrecognized SVG element type: "${s}".`)}}const $=new Set(["defs","title","desc","metadata","style","script","linearGradient","radialGradient","stop","clipPath","mask","marker","pattern","symbol","filter"]);var W,q;class J{constructor(t){W.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,W,t)}toArray(){return Array.from(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,W).querySelectorAll("text")).map(t=>({domNode:t}))}}W=new WeakMap;class Q{constructor(t){q.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,q,t)}closestPoint(t){return document.body.contains(Z)||document.body.append(Z),tt.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,q)),new X(tt).closestPoint(t)}}q=new WeakMap;const K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("viewBox","0 0 100 100"),K.setAttribute("width","100"),K.setAttribute("height","100");const Z=document.createElement("div");Z.append(K),Z.style.height="0px",Z.style.position="fixed",document.body.append(Z);const tt=document.createElementNS("http://www.w3.org/2000/svg","path");function et(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}tt.setAttribute("stroke","black"),tt.setAttribute("stroke-width","1"),K.append(tt);const rt=new Uint8Array(16),nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));const it=function(t,e,r){return e||t||!crypto.randomUUID?function(t,e,r){const n=(t=t||{}).random??t.rng?.()??crypto.getRandomValues(rt);if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return(nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]).toLowerCase()}(n)}(t,e,r):crypto.randomUUID()};function st(t){t.id="uuid-"+it()}class ot{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class at{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class ut{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class ct{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function ht(t){let e=t.parentNode;e&&e.appendChild(t)}function lt(t){let e=t.parentNode;e&&e.prepend(t)}var dt,ft=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class mt{constructor(t){dt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,dt,t)}toString(){return ft(this,dt,"f").innerHTML}set(t){ft(this,dt,"f").innerHTML=t}}dt=new WeakMap;var pt,yt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class gt{constructor(t){pt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,pt,t)}toString(){return yt(this,pt,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=yt(this,pt,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...yt(this,pt,"f").attributes].forEach(t=>yt(this,pt,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>yt(this,pt,"f").setAttribute(t.name,t.value)),yt(this,pt,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function bt(t){return t instanceof SVGGraphicsElement}pt=new WeakMap;var vt=r(854);function wt(t){return(0,vt.isArray)(t)&&t.every(bt)}async function xt(t){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),await i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e}})(),n})(),t.exports=e()},986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){var e=0;return t.forEach(function(t){return e+=t}),e}function i(t){return n(t)/t.length}function s(t){t.sort(function(t,e){return t-e})}t.r(e),t.d(e,{areWithin:()=>m,average:()=>i,clamp:()=>f,degrees:()=>b,distance:()=>r,flipAway:()=>x,isBetween:()=>l,isBetweenExclusive:()=>d,isBetweenInclusive:()=>l,max:()=>h,mean:()=>i,median:()=>u,min:()=>c,normalizeAngle:()=>w,radians:()=>v,round:()=>g,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>p,sortedNumbers:()=>a,sortedNumbersAscending:()=>a,sortedNumbersDescending:()=>y,sum:()=>n});var o=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 a(t){var e=o([],t,!0);return s(e),e}function u(t){if(0==t.length)return NaN;var e=a(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,n=r-1;return i([e[r],e[n]])}function c(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,r){return t>=e&&t<=r}function d(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function m(t,e,r){return Math.abs(t-e)<=r}function p(t){s(t),t.reverse()}function y(t){var e=a(t);return e.reverse(),e}function g(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function b(t){return t*(180/Math.PI)}function v(t){return t*(Math.PI/180)}function w(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function x(t,e){var r=(e=w(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},456(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()},277(t){var e;e=()=>(()=>{var t={854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),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,{Vector:()=>e,isFiniteVectorLike:()=>s,isVectorLike:()=>i});var t=r(854);class e{static matching(t){let r="x"in t?t.x:t.magnitude*Math.cos(t.direction),n="y"in t?t.y:t.magnitude*Math.sin(t.direction);return new e(r,n)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}isFinite(){return(0,t.isFiniteNumber)(this.x)&&(0,t.isFiniteNumber)(this.y)}}function i(e){return!(!(0,t.isNonNullObject)(e)||!((0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)||(0,t.isNumber)(e.magnitude)&&(0,t.isNumber)(e.direction)))}function s(t){return!!i(t)&&e.matching(t).isFinite()}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{FinitePoint:()=>s,Point:()=>i,RelativePoint:()=>d,midpoint:()=>m});var t=r(277),e=r(854);class i{static matching(t){return new i(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}set(t){(0,e.isNumber)(null==t?void 0:t.x)&&(this.x=t.x),(0,e.isNumber)(null==t?void 0:t.y)&&(this.y=t.y)}drag(t,e){this.displace({x:t,y:e})}displace(e){let r=t.Vector.matching(e);this.x+=r.x,this.y+=r.y}displaced(t){let e=i.matching(this);return e.displace(t),e}displacementTo(e){return new t.Vector(e.x-this.x,e.y-this.y)}displacementFrom(e){return new t.Vector(this.x-e.x,this.y-e.y)}distanceTo(t){return this.displacementTo(t).magnitude}distanceFrom(t){return this.distanceTo(t)}directionTo(t){return this.displacementTo(t).direction}directionFrom(t){return this.displacementFrom(t).direction}deepCopy(){return new i(this.x,this.y)}}class s extends i{static matching(t){let e=i.matching(t);return new s(e.x,e.y)}constructor(t,r){if(super(t,r),!(0,e.isFiniteNumber)(t)||!(0,e.isFiniteNumber)(r))throw new Error(`Finite points must have finite number coordinates: (${t}, ${r}).`)}set(...t){let e=new i(0,0);e.set(...t),s.matching(e),super.set(...t)}}var o,a,u,c,h,l=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class d{constructor(e){o.add(this),a.set(this,void 0),u.set(this,new t.Vector(0,0)),c.set(this,{move:[]}),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,a,e),e.addEventListener("move",()=>l(this,o,"m",h).call(this,"move"))}get x(){return l(this,a,"f").x+l(this,u,"f").x}set x(t){l(this,u,"f").x=t-l(this,a,"f").x,l(this,o,"m",h).call(this,"move")}get y(){return l(this,a,"f").y+l(this,u,"f").y}set y(t){l(this,u,"f").y=t-l(this,a,"f").y,l(this,o,"m",h).call(this,"move")}addEventListener(t,e){l(this,c,"f")[t].push(e)}removeEventListener(t,e){l(this,c,"f")[t]=l(this,c,"f")[t].filter(t=>t!==e)}}a=new WeakMap,u=new WeakMap,c=new WeakMap,o=new WeakSet,h=function(t){l(this,c,"f")[t].forEach(t=>t())};var f=r(986);function m(t,e){return new i((0,f.average)([t.x,e.x]),(0,f.average)([t.y,e.y]))}})(),n})(),t.exports=e()},725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()},277(t){var e;e=()=>(()=>{var t={854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),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,{Vector:()=>e,isFiniteVectorLike:()=>s,isVectorLike:()=>i});var t=r(854);class e{static matching(t){let r="x"in t?t.x:t.magnitude*Math.cos(t.direction),n="y"in t?t.y:t.magnitude*Math.sin(t.direction);return new e(r,n)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}isFinite(){return(0,t.isFiniteNumber)(this.x)&&(0,t.isFiniteNumber)(this.y)}}function i(e){return!(!(0,t.isNonNullObject)(e)||!((0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)||(0,t.isNumber)(e.magnitude)&&(0,t.isNumber)(e.direction)))}function s(t){return!!i(t)&&e.matching(t).isFinite()}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{CurvedBond:()=>lt});var t=r(726);const e={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let i;const s=new Uint8Array(16),o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));function a(t,e,r){const n=(t=t||{}).random??t.rng?.()??function(){if(!i){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");i=crypto.getRandomValues.bind(crypto)}return i(s)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[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]]).toLowerCase()}(n)}const u=" ";function c([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function h(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const l=Math.PI;function d(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:n,rY:i}=t;const{x:s,y:o}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+o)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*l,[u,h]=c([(e-s)/2,(r-o)/2],-a),d=Math.pow(u,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(i,2);1<d&&(n*=Math.sqrt(d),i*=Math.sqrt(d)),t.rX=n,t.rY=i;const f=Math.pow(n,2)*Math.pow(h,2)+Math.pow(i,2)*Math.pow(u,2),m=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-f)/f)),p=n*h/i*m,y=-i*u/n*m,g=c([p,y],a);t.cX=g[0]+(e+s)/2,t.cY=g[1]+(r+o)/2,t.phi1=Math.atan2((h-y)/i,(u-p)/n),t.phi2=Math.atan2((-h-y)/i,(-u-p)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*l),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*l),t.phi1*=180/l,t.phi2*=180/l}function f(t,e,r){h(t,e,r);const n=t*t+e*e-r*r;if(0>n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}const m=Math.PI/180;function p(t,e,r){return(1-r)*t+r*e}function y(t,e,r,n){return t+Math.cos(n/180*l)*e+Math.sin(n/180*l)*r}function g(t,e,r,n){const i=1e-6,s=e-t,o=r-e,a=3*s+3*(n-r)-6*o,u=6*(o-s),c=3*s;return Math.abs(a)<i?Math.abs(u)<i?[]:[-c/u]:function(t,e,r=1e-6){const n=t*t/4-e;if(n<-r)return[];if(n<=r)return[-t/2];const i=Math.sqrt(n);return[-t/2-i,-t/2+i]}(u/a,c/a,i)}function b(t,e,r,n,i){const s=1-i;return t*(s*s*s)+e*(3*s*s*i)+r*(3*s*i*i)+n*(i*i*i)}function v(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],s=r[0]-t[0],o=r[1]-t[1],a=n*o-i*s;if(!(Math.abs(a)<1e-10))return!1;const u=n*s+i*o,c=s*s+o*o;return 0<=u&&u<=c&&n*n+i*i<=c}function w(t){const e=t[t.length-1]?.type===C.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:C.MOVE_TO,relative:!1,x:t[r].x,y:t[r].y}];for(let e=r;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case C.HORIZ_LINE_TO:n.push({type:C.HORIZ_LINE_TO,relative:!1,x:i.x});break;case C.VERT_LINE_TO:n.push({type:C.VERT_LINE_TO,relative:!1,y:i.y});break;case C.LINE_TO:case C.MOVE_TO:n.push({type:C.LINE_TO,relative:!1,x:i.x,y:i.y});break;case C.CURVE_TO:n.push({type:C.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case C.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case C.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case C.ARC:throw new Error("Unsupported command: A (arc)");case C.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:C.CLOSE_PATH}),n}function x(){return S((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t))}function N(){let t=NaN,e=NaN,r=NaN,n=NaN;return S((i,s,o)=>(i.type&C.SMOOTH_CURVE_TO&&(i.type=C.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?o:e,i.x1=i.relative?s-t:2*s-t,i.y1=i.relative?o-e:2*o-e),i.type&C.CURVE_TO?(t=i.relative?s+i.x2:i.x2,e=i.relative?o+i.y2:i.y2):(t=NaN,e=NaN),i.type&C.SMOOTH_QUAD_TO&&(i.type=C.QUAD_TO,r=isNaN(r)?s:r,n=isNaN(n)?o:n,i.x1=i.relative?s-r:2*s-r,i.y1=i.relative?o-n:2*o-n),i.type&C.QUAD_TO?(r=i.relative?s+i.x1:i.x1,n=i.relative?o+i.y1:i.y1):(r=NaN,n=NaN),i))}function O(){let t=NaN,e=NaN;return S((r,n,i)=>{if(r.type&C.SMOOTH_QUAD_TO&&(r.type=C.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?i:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?i-e:2*i-e),r.type&C.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const s=r.x1,o=r.y1;r.type=C.CURVE_TO,r.x1=((r.relative?0:n)+2*s)/3,r.y1=((r.relative?0:i)+2*o)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*o)/3}else t=NaN,e=NaN;return r})}function S(t){let e=0,r=0,n=NaN,i=NaN;return function(s){if(isNaN(n)&&!(s.type&C.MOVE_TO))throw new Error("path must start with moveto");const o=t(s,e,r,n,i);return s.type&C.CLOSE_PATH&&(e=n,r=i),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&C.MOVE_TO&&(n=e,i=r),o}}function E(t,e,r,n,i,s){return h(t,e,r,n,i,s),S((o,a,u,c)=>{const h=o.x1,l=o.x2,d=o.relative&&!isNaN(c),f=void 0!==o.x?o.x:d?0:a,m=void 0!==o.y?o.y:d?0:u;function p(t){return t*t}o.type&C.HORIZ_LINE_TO&&0!==e&&(o.type=C.LINE_TO,o.y=o.relative?0:u),o.type&C.VERT_LINE_TO&&0!==r&&(o.type=C.LINE_TO,o.x=o.relative?0:a),void 0!==o.x&&(o.x=o.x*t+m*r+(d?0:i)),void 0!==o.y&&(o.y=f*e+o.y*n+(d?0:s)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*r+(d?0:i)),void 0!==o.y1&&(o.y1=h*e+o.y1*n+(d?0:s)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*r+(d?0:i)),void 0!==o.y2&&(o.y2=l*e+o.y2*n+(d?0:s));const y=t*n-e*r;if(void 0!==o.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===y)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=C.LINE_TO;else{const i=o.xRot*Math.PI/180,s=Math.sin(i),a=Math.cos(i),u=1/p(o.rX),c=1/p(o.rY),h=p(a)*u+p(s)*c,l=2*s*a*(u-c),d=p(s)*u+p(a)*c,f=h*n*n-l*e*n+d*e*e,m=l*(t*n+e*r)-2*(h*r*n+d*t*e),g=h*r*r-l*t*r+d*t*t,b=(Math.atan2(m,f-g)+Math.PI)%Math.PI/2,v=Math.sin(b),w=Math.cos(b);o.rX=Math.abs(y)/Math.sqrt(f*p(w)+m*v*w+g*p(v)),o.rY=Math.abs(y)/Math.sqrt(f*p(v)-m*v*w+g*p(w)),o.xRot=180*b/Math.PI}return void 0!==o.sweepFlag&&0>y&&(o.sweepFlag=+!o.sweepFlag),o})}const _={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return h(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:x,TO_REL:function(){return S((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,n=!0){return S((i,s,o,a,u)=>{if(isNaN(a)&&!(i.type&C.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&C.HORIZ_LINE_TO&&(i.type=C.LINE_TO,i.y=i.relative?0:o),r&&i.type&C.VERT_LINE_TO&&(i.type=C.LINE_TO,i.x=i.relative?0:s),t&&i.type&C.CLOSE_PATH&&(i.type=C.LINE_TO,i.x=i.relative?a-s:a,i.y=i.relative?u-o:u),i.type&C.ARC&&(0===i.rX||0===i.rY)&&(i.type=C.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&C.QUAD_TO&&v([s,o],i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],i.relative?[s+i.x,o+i.y]:[i.x,i.y])&&(i.type=C.LINE_TO,delete i.x1,delete i.y1),n&&i.type&C.CURVE_TO){const t=[s,o],e=i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],r=i.relative?[s+i.x2,o+i.y2]:[i.x2,i.y2],n=i.relative?[s+i.x,o+i.y]:[i.x,i.y];v(t,e,n)&&v(t,r,n)&&(i.type=C.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:N,QT_TO_C:O,INFO:S,SANITIZE:function(t=0){h(t);let e=NaN,r=NaN,n=NaN,i=NaN;return S((s,o,a,u,c)=>{const h=Math.abs;let l=!1,d=0,f=0;if(s.type&C.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:o-e,f=isNaN(r)?0:a-r),s.type&(C.CURVE_TO|C.SMOOTH_CURVE_TO)?(e=s.relative?o+s.x2:s.x2,r=s.relative?a+s.y2:s.y2):(e=NaN,r=NaN),s.type&C.SMOOTH_QUAD_TO?(n=isNaN(n)?o:2*o-n,i=isNaN(i)?a:2*a-i):s.type&C.QUAD_TO?(n=s.relative?o+s.x1:s.x1,i=s.relative?a+s.y1:s.y2):(n=NaN,i=NaN),s.type&C.LINE_COMMANDS||s.type&C.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&C.CURVE_TO||s.type&C.SMOOTH_CURVE_TO||s.type&C.QUAD_TO||s.type&C.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-o,r=void 0===s.y?0:s.relative?s.y:s.y-a;d=isNaN(n)?void 0===s.x1?d:s.relative?s.x:s.x1-o:n-o,f=isNaN(i)?void 0===s.y1?f:s.relative?s.y:s.y1-a:i-a;const u=void 0===s.x2?0:s.relative?s.x:s.x2-o,c=void 0===s.y2?0:s.relative?s.y:s.y2-a;h(e)<=t&&h(r)<=t&&h(d)<=t&&h(f)<=t&&h(u)<=t&&h(c)<=t&&(l=!0)}return s.type&C.CLOSE_PATH&&h(o-u)<=t&&h(a-c)<=t&&(l=!0),l?[]:s})},MATRIX:E,ROTATE:function(t,e=0,r=0){h(t,e,r);const n=Math.sin(t),i=Math.cos(t);return E(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},TRANSLATE:function(t,e=0){return h(t,e),E(1,0,0,1,t,e)},SCALE:function(t,e=t){return h(t,e),E(t,0,0,e,0,0)},SKEW_X:function(t){return h(t),E(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return h(t),E(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return h(t),E(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return h(t),E(1,0,0,-1,0,t)},A_TO_C:function(){return S((t,e,r)=>C.ARC===t.type?function(t,e,r){t.cX||d(t,e,r);const n=t.xRot/180*l;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:C.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const i=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-i,o=Math.ceil(s/90),a=new Array(o);let u=e,h=r;const f=(e,r)=>{const[i,s]=c([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+s]};for(let e=0;e<o;e++){const r=p(t.phi1,t.phi2,e/o),n=p(t.phi1,t.phi2,(e+1)/o),i=n-r,s=4/3*Math.tan(i*m/4),c=Math.cos(r*m)-s*Math.sin(r*m),l=Math.sin(r*m)+s*Math.cos(r*m),d=Math.cos(n*m),y=Math.sin(n*m),g=d+s*y,b=y-s*d,v=f(c,l),w=f(g,b),x=f(d,y),N={relative:t.relative,type:C.CURVE_TO,x:x[0],y:x[1],x1:v[0],y1:v[1],x2:w[0],y2:w[1]};t.relative&&(N.x1-=u,N.y1-=h,N.x2-=u,N.y2-=h,N.x-=u,N.y-=h),u=x[0],h=x[1],a[e]=N}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return S((t,e,r)=>(t.relative&&(e=0,r=0),C.ARC===t.type&&d(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=x(),e=O(),r=N(),n=S((i,s,o)=>{const a=r(e(t((t=>({...t}))(i))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(a.type&C.DRAWING_COMMANDS&&(u(s),c(o)),a.type&C.HORIZ_LINE_TO&&u(a.x),a.type&C.VERT_LINE_TO&&c(a.y),a.type&C.LINE_TO&&(u(a.x),c(a.y)),a.type&C.CURVE_TO){u(a.x),c(a.y);const t=g(s,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(b(s,a.x1,a.x2,a.x,e));const e=g(o,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(b(o,a.y1,a.y2,a.y,t))}if(a.type&C.ARC){u(a.x),c(a.y),d(a,s,o);const t=a.xRot/180*Math.PI,e=Math.cos(t)*a.rX,r=Math.sin(t)*a.rX,n=-Math.sin(t)*a.rY,i=Math.cos(t)*a.rY,[h,l]=a.phi1<a.phi2?[a.phi1,a.phi2]:-180>a.phi2?[a.phi2+360,a.phi1+360]:[a.phi2,a.phi1],m=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<h?r+360:r},p=f(n,-e,0).map(m);for(const t of p)t>h&&t<l&&u(y(a.cX,e,n,t));const g=f(i,-r,0).map(m);for(const t of g)t>h&&t<l&&c(y(a.cY,r,i,t))}return i});return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=_.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const s of t){const t=r(s);t.type===C.MOVE_TO&&i.length>0&&(e?n.push(...w(i)):n.unshift(...w(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...w(i)):n.unshift(...w(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(_.INFO((t,e,r)=>{const n="relative"in t&&t.relative;return["x"in t?t.x+(n?e:0):e,"y"in t?t.y+(n?r:0):r]}));let n=r[0];e.push(t[0]);for(let i=1;i<t.length;i++){const s=t[i],o=t[i+1];if(i<t.length-1&&o&&s.type&C.LINE_COMMANDS&&o.type&C.LINE_COMMANDS){const t=r[i+1];if(v(n,r[i],t)){"relative"in o&&o.relative&&("x"in o&&(o.x=t[0]-n[0]),"y"in o&&(o.y=t[1]-n[1]));continue}}e.push(s),n=r[i]}return e}};class M{round(t){return this.transform(_.ROUND(t))}toAbs(){return this.transform(_.TO_ABS())}toRel(){return this.transform(_.TO_REL())}normalizeHVZ(t,e,r){return this.transform(_.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(_.NORMALIZE_ST())}qtToC(){return this.transform(_.QT_TO_C())}aToC(){return this.transform(_.A_TO_C())}sanitize(t){return this.transform(_.SANITIZE(t))}translate(t,e){return this.transform(_.TRANSLATE(t,e))}scale(t,e){return this.transform(_.SCALE(t,e))}rotate(t,e,r){return this.transform(_.ROTATE(t,e,r))}matrix(t,e,r,n,i,s){return this.transform(_.MATRIX(t,e,r,n,i,s))}skewX(t){return this.transform(_.SKEW_X(t))}skewY(t){return this.transform(_.SKEW_Y(t))}xSymmetry(t){return this.transform(_.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(_.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(_.ANNOTATE_ARCS())}}const T=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,A=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class P extends M{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let n=0;n<t.length;n++){const i=t[n],s=!(this.curCommandType!==C.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=A(i)&&("0"===this.curNumber&&"0"===i||s);if(!A(i)||o)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${n}`);if(this.curCommandType===C.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${n}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${n}"`);this.curArgs.push(t),this.curArgs.length===j[this.curCommandType]&&(C.HORIZ_LINE_TO===this.curCommandType?r({type:C.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):C.VERT_LINE_TO===this.curCommandType?r({type:C.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===C.MOVE_TO||this.curCommandType===C.LINE_TO||this.curCommandType===C.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),C.MOVE_TO===this.curCommandType&&(this.curCommandType=C.LINE_TO)):this.curCommandType===C.CURVE_TO?r({type:C.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===C.SMOOTH_CURVE_TO?r({type:C.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.QUAD_TO?r({type:C.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===C.ARC&&r({type:C.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!T(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(o)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${n}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${i}" at index ${n}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=C.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=C.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=C.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=C.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=C.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=C.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=C.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=C.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=C.ARC,this.curCommandRelative="a"===i}else e.push({type:C.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const n=Object.getPrototypeOf(this).parse.call(this,e);for(const e of n){const n=t(e);Array.isArray(n)?r.push(...n):r.push(n)}return r}}})}}class C extends M{commands;constructor(t){super(),this.commands="string"==typeof t?C.parse(t):t}encode(){return C.encode(this.commands)}getBounds(){const t=_.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const n=t(r);Array.isArray(n)?e.push(...n):e.push(n)}return this.commands=e,this}reverse(t=!0){return this.commands=_.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=_.REMOVE_COLLINEAR(this.commands),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const n=t[r];if(n.type===C.CLOSE_PATH)e+="z";else if(n.type===C.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===C.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===C.MOVE_TO)e+=(n.relative?"m":"M")+n.x+u+n.y;else if(n.type===C.LINE_TO)e+=(n.relative?"l":"L")+n.x+u+n.y;else if(n.type===C.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+u+n.y1+u+n.x2+u+n.y2+u+n.x+u+n.y;else if(n.type===C.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+u+n.y2+u+n.x+u+n.y;else if(n.type===C.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+u+n.y1+u+n.x+u+n.y;else if(n.type===C.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+u+n.y;else{if(n.type!==C.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+u+n.rY+u+n.xRot+u+ +n.lArcFlag+u+ +n.sweepFlag+u+n.x+u+n.y}}return e}(t)}static parse(t){const e=new P,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=C.LINE_TO|C.HORIZ_LINE_TO|C.VERT_LINE_TO;static DRAWING_COMMANDS=C.HORIZ_LINE_TO|C.VERT_LINE_TO|C.LINE_TO|C.CURVE_TO|C.SMOOTH_CURVE_TO|C.QUAD_TO|C.SMOOTH_QUAD_TO|C.ARC}const j={[C.MOVE_TO]:2,[C.LINE_TO]:2,[C.HORIZ_LINE_TO]:1,[C.VERT_LINE_TO]:1,[C.CLOSE_PATH]:0,[C.QUAD_TO]:4,[C.SMOOTH_QUAD_TO]:2,[C.CURVE_TO]:6,[C.SMOOTH_CURVE_TO]:4,[C.ARC]:7};var I=r(456);class L{static matching(t){if(t.type!==C.MOVE_TO)throw new Error('SVG path definition command is not of type "M".');if(t.relative)throw new Error("The input SVG path definition command is a relative command.");let e=new I.FinitePoint(t.x,t.y);return new L(e)}constructor(t){this.startPoint=t}get endPoint(){return this.startPoint}toString(){return`M ${this.startPoint.x} ${this.startPoint.y}`}}class D extends I.FinitePoint{drag(t,e){t*=2,e*=2,super.drag(t,e)}}class R{static matching(t){if(t.type!==C.LINE_TO&&t.type!==C.QUAD_TO&&t.type!==C.CURVE_TO)throw new Error('Trailing segments can only be created for "L", "Q" and "C" SVG path definition commands.');if(t.relative)throw new Error("The input SVG path definition command is a relative command.");var e=[];t.type!==C.QUAD_TO&&t.type!==C.CURVE_TO||e.push(new D(t.x1,t.y1)),t.type===C.CURVE_TO&&e.push(new D(t.x2,t.y2));var r=new I.FinitePoint(t.x,t.y);return new R(e,r)}constructor(t,e){this.controlPoints=t,this.endPoint=e}toString(){if(this.controlPoints.length>2)throw new Error(`There can only be at most 2 control points: ${this.controlPoints.length} control points.`);return(0==this.controlPoints.length?"L":1==this.controlPoints.length?"Q":"C")+" "+this.controlPoints.map(t=>`${t.x} ${t.y}`).join(" ")+" "+`${this.endPoint.x} ${this.endPoint.y}`}}var V,F=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class k{constructor(t,e){this.startPoint=t,V.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,V,e)}get controlPoints(){return F(this,V,"f").controlPoints}get endPoint(){return F(this,V,"f").endPoint}closestPoint(e){return new t.AbstractPath(`M ${this.startPoint.x} ${this.startPoint.y} ${F(this,V,"f").toString()}`).closestPoint(e)}}V=new WeakMap;var B,U=r(725),X=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class Y{constructor(t){B.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,B,t)}closest(t){if(0==X(this,B,"f").length)throw new Error("This points collection is empty.");let e=[...X(this,B,"f")];return e.sort((e,r)=>(0,U.distance)(e,t)-(0,U.distance)(r,t)),e[0]}}B=new WeakMap;var z,H,G=r(106),$=r(854),W=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class q{static matching(t){let e=J.create();if(!(0,$.isString)(t))return e;try{let e=new C(t);e=e.toAbs();let r=L.matching(e.commands[0]),n=[R.matching(e.commands[1]),...e.commands.slice(2).map(t=>R.matching(t))];return new q(r,n)}catch{return e}}constructor(t,e){z.add(this),this.moveToSegment=t,this.trailingSegments=e}get segments(){return[this.moveToSegment,this.trailingSegments[0],...this.trailingSegments.slice(1)]}get definingPoints(){return{toArray:()=>[this.startPoint,...this.trailingSegments.flatMap(t=>[...t.controlPoints,t.endPoint])],anchored:()=>[this.startPoint.deepCopy(),...W(this,z,"a",H).flatMap(t=>[...t.controlPoints.map(e=>t.closestPoint(e)),t.endPoint.deepCopy()])]}}get startPoint(){return this.moveToSegment.startPoint}get interveningPoints(){return[...this.trailingSegments.slice(0,-1).flatMap(t=>[...t.controlPoints,t.endPoint]),...(0,G.last)(this.trailingSegments).controlPoints]}get controlPoints(){return this.trailingSegments.flatMap(t=>t.controlPoints)}get endPoint(){if(0==this.trailingSegments.length)throw new Error("This SVG path definition has no trailing segments.");return(0,G.last)(this.trailingSegments).endPoint}toString(){return this.segments.map(t=>t.toString()).join(" ")}drag(t,e,r){let n=new Y(this.definingPoints.toArray()).closest(r.dragPoint);this.controlPoints.includes(n)&&(t*=2,e*=2),n.displace({x:t,y:e})}}z=new WeakSet,H=function(){return[new k(this.startPoint,this.trailingSegments[0]),...(0,G.consecutivePairs)(this.trailingSegments).map(([t,e])=>new k(t.endPoint,e))]};const J={create:()=>{let t=new C("M 0 0 Q 0 0 0 0");if(t.commands.length<2)throw new Error("Unable to create default SVG path definition.");let e=L.matching(t.commands[0]),r=[R.matching(t.commands[1])];return new q(e,r)}};var Q=r(277);class K{static from(t){let e,r=new K(0,0);if(!(0,$.isString)(t))return r;try{e=JSON.parse(t)}catch{return r}return(0,Q.isVectorLike)(e)?K.matching(e):r}static matching(t){let e=Q.Vector.matching(t);return new K(e.magnitude,e.direction)}constructor(t,e){this.magnitude=t,this.direction=e}toJSON(){return JSON.stringify({magnitude:this.magnitude,direction:this.direction})}}var Z,tt,et,rt,nt,it,st,ot,at,ut,ct=r(986),ht=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class lt{static between(t,r){let n=t.domNode.getBBox().height,i=r.domNode.getBBox().height,s=document.createElementNS("http://www.w3.org/2000/svg","path");s.id="id-"+(e.randomUUID?e.randomUUID():a(void 0,void 0,void 0)),s.setAttribute("stroke","red"),s.setAttribute("stroke-width",""+.122*(0,ct.mean)([n,i])),s.setAttribute("stroke-opacity","1"),s.setAttribute("stroke-dasharray","3 1.5"),s.setAttribute("stroke-linecap",""),s.setAttribute("stroke-linejoin",""),s.setAttribute("fill","none");let o=(0,I.midpoint)(t.centerPoint,r.centerPoint);s.setAttribute("d",`M ${t.centerPoint.x} ${t.centerPoint.y} Q ${o.x} ${o.y} ${r.centerPoint.x} ${r.centerPoint.y}`);let u=new lt(s,t,r);u.basePadding1.magnitude=.591*n,u.basePadding2.magnitude=.591*i,u.basePadding1.direction=-Math.PI/8,u.basePadding2.direction=Math.PI/8;let c=q.matching(u.domNode.getAttribute("d"));return o=(0,I.midpoint)(c.startPoint,c.endPoint),c.trailingSegments[0].controlPoints[0]=I.FinitePoint.matching(o.displaced({magnitude:.2*(0,U.distance)(c.startPoint,c.endPoint),direction:(0,U.direction)(c.startPoint,c.endPoint)-Math.PI/2})),u.domNode.setAttribute("d",c.toString()),u}constructor(t,e,r){Z.add(this),this.domNode=t,this.base1=e,this.base2=r,tt.set(this,void 0),et.set(this,{change:[]}),t.dataset.basePadding1||t.dataset.basePadding2||ht(this,Z,"m",it).call(this),e.addEventListener("change",()=>ht(this,Z,"m",nt).call(this)),r.addEventListener("change",()=>ht(this,Z,"m",nt).call(this)),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,tt,new MutationObserver(()=>ht(this,Z,"m",rt).call(this,"change"))),ht(this,tt,"f").observe(t,{attributes:!0,subtree:!0})}get id(){return this.domNode.id}binds(t){return t===this.base1||t===this.base2}get basePadding1(){let t=()=>K.from(this.domNode.dataset.basePadding1),e=(t,e)=>{let r=new K(t,e);this.domNode.dataset.basePadding1=r.toJSON(),ht(this,Z,"m",nt).call(this)},r=()=>t().magnitude,n=()=>t().direction;return{get magnitude(){return r()},set magnitude(t){(t=>{e(t,n())})(t)},get direction(){return n()},set direction(t){(t=>{e(r(),t)})(t)}}}get basePadding2(){let t=()=>K.from(this.domNode.dataset.basePadding2),e=(t,e)=>{let r=new K(t,e);this.domNode.dataset.basePadding2=r.toJSON(),ht(this,Z,"m",nt).call(this)},r=()=>t().magnitude,n=()=>t().direction;return{get magnitude(){return r()},set magnitude(t){(t=>{e(t,n())})(t)},get direction(){return n()},set direction(t){(t=>{e(r(),t)})(t)}}}get length(){return this.domNode.getTotalLength()}atLength(t){let e=(t=(t=t<0?0:t)>this.length?this.length:t)-.005,r=t+.005;e=(0,ct.max)([e,0]),r=(0,ct.min)([r,this.length]);let n=I.Point.matching(this.domNode.getPointAtLength(e)),i=I.Point.matching(this.domNode.getPointAtLength(r)),s=(0,I.midpoint)(n,i),o=n.directionTo(i);return o=Number.isFinite(o)?o:0,{x:s.x,y:s.y,direction:o}}closestPoint(e){return new t.Path(this.domNode).closestPoint(e)}get definingPoints(){let t=q.matching(this.domNode.getAttribute("d"));return{toArray:()=>t.definingPoints.toArray(),closest:e=>new Y(t.definingPoints.toArray()).closest(e),anchored:()=>({closest:t=>{let e=q.matching(this.domNode.getAttribute("d")).definingPoints.anchored(),r=[...e].sort((e,r)=>(0,U.distance)(e,t)-(0,U.distance)(r,t)),n=e.indexOf(r[0]);return{drag:(t,e)=>{let r=q.matching(this.domNode.getAttribute("d")),i=r.definingPoints.toArray()[n];if(!i)throw new Error("The reference to the closest defining point was lost.");i.drag(t,e),this.domNode.setAttribute("d",r.toString()),ht(this,Z,"m",it).call(this)}}}})}}drag(t,e,r){var n;let i=null==r?void 0:r.dragGroup;if((null==i?void 0:i.has(this.base1.domNode))||(null==i?void 0:i.has(this.base2.domNode)))return;let s=null!==(n=null==r?void 0:r.dragPoint)&&void 0!==n?n:this.domNode.getPointAtLength(this.domNode.getTotalLength()/2),o=q.matching(this.domNode.getAttribute("d"));o.drag(t,e,{dragPoint:s}),this.domNode.setAttribute("d",o.toString()),ht(this,Z,"m",it).call(this)}addEventListener(t,e){ht(this,et,"f")[t].push(e)}removeEventListener(t,e){ht(this,et,"f")[t]=ht(this,et,"f")[t].filter(t=>t!==e)}remove(){this.domNode.remove()}serialized(){return{id:this.id,baseID1:this.base1.id,baseID2:this.base2.id}}static recreate(t,e){var r,n,i;if(!(0,$.isNonNullObject)(t))throw new Error(`Saved curved bond isn't an object: ${t}.`);let s=null!==(r=t.id)&&void 0!==r?r:t.pathId;if(!(0,$.isString)(s))throw new Error(`Saved curved bond ID isn't a string: ${s}.`);let o=null!==(n=t.baseID1)&&void 0!==n?n:t.baseId1,a=null!==(i=t.baseID2)&&void 0!==i?i:t.baseId2;if(!(0,$.isString)(o))throw new Error(`Saved curved bond base 1 ID isn't a string: ${o}.`);if(!(0,$.isString)(a))throw new Error(`Saved curved bond base 2 ID isn't a string: ${a}.`);let u=e.domNode.querySelector("#"+s);if(!u)throw new Error("Unable to find saved curved bond DOM node in parent drawing by ID.");if(!(u instanceof SVGPathElement))throw new Error(`Saved curved bond DOM node isn't an SVG path element: ${u}.`);let c=[...e.bases],h=c.find(t=>t.id===o),l=c.find(t=>t.id===a);if(!h)throw new Error("Unable to find base 1 in parent drawing.");if(!l)throw new Error("Unable to find base 2 in parent drawing.");return new lt(u,h,l)}}tt=new WeakMap,et=new WeakMap,Z=new WeakSet,rt=function(t){for(let e of ht(this,et,"f")[t])e()},nt=function(){let t=K.from(this.domNode.dataset.basePadding1),e=K.from(this.domNode.dataset.basePadding2);t=ht(this,Z,"m",st).call(this,t),e=ht(this,Z,"m",ot).call(this,e);let r=q.matching(this.domNode.getAttribute("d")),n=(0,I.midpoint)(r.startPoint,r.endPoint),i=r.interveningPoints.map(t=>[t,n.displacementTo(t)]);i.forEach(([t,e])=>e.direction-=(0,U.direction)(r.startPoint,r.endPoint)),r.startPoint.set(I.Point.matching(this.base1.centerPoint).displaced(t)),r.endPoint.set(I.Point.matching(this.base2.centerPoint).displaced(e)),n=(0,I.midpoint)(r.startPoint,r.endPoint),i.forEach(([t,e])=>e.direction+=(0,U.direction)(r.startPoint,r.endPoint)),i.forEach(([t,e])=>t.set(n.displaced(e))),this.domNode.setAttribute("d",r.toString())},it=function(){let t=q.matching(this.domNode.getAttribute("d")),e=K.matching(I.Point.matching(this.base1.centerPoint).displacementTo(t.startPoint)),r=K.matching(I.Point.matching(this.base2.centerPoint).displacementTo(t.endPoint));e=ht(this,Z,"m",at).call(this,e),r=ht(this,Z,"m",ut).call(this,r),this.domNode.dataset.basePadding1=e.toJSON(),this.domNode.dataset.basePadding2=r.toJSON()},st=function(t){let e=K.matching(t);return e.direction+=(0,U.direction)(this.base1.centerPoint,this.base2.centerPoint),e},ot=function(t){let e=K.matching(t);return e.direction+=(0,U.direction)(this.base2.centerPoint,this.base1.centerPoint),e},at=function(t){let e=K.matching(t);return e.direction-=(0,U.direction)(this.base1.centerPoint,this.base2.centerPoint),e},ut=function(t){let e=K.matching(t);return e.direction-=(0,U.direction)(this.base2.centerPoint,this.base1.centerPoint),e}})(),n})(),t.exports=e()},726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>Q,Circle:()=>u,CoordinateSystem:()=>ot,Ellipse:()=>c,ForeignObject:()=>H,HorizontalClientScaling:()=>ut,Image:()=>Y,InnerXML:()=>mt,Line:()=>a,OuterXML:()=>gt,Path:()=>X,Polygon:()=>p,Polyline:()=>m,Rect:()=>h,SVG:()=>t,Scaling:()=>at,Text:()=>o,Texts:()=>J,Use:()=>z,VerticalClientScaling:()=>ct,assignUUID:()=>st,bringToFront:()=>ht,drawOnCanvas:()=>xt,isSVGGraphicsElement:()=>bt,isSVGGraphicsElementsArray:()=>wt,sendToBack:()=>lt,setAttributes:()=>et,shift:()=>G});class t{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var e,i=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class s{constructor(t){e.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,e,t)}isEmpty(){return 0==i(this,e,"f").numberOfItems}shift(t){for(let r=0;r<i(this,e,"f").numberOfItems;r++)i(this,e,"f").getItem(r).value+=t}}e=new WeakMap;class o{constructor(t){this.domNode=t}shift(t,e){let r=new s(this.domNode.x.baseVal),n=new s(this.domNode.y.baseVal);r.shift(t),n.shift(e),r.isEmpty()&&this.domNode.setAttribute("x",`${t}`),n.isEmpty()&&this.domNode.setAttribute("y",`${e}`),this.domNode.querySelectorAll("tspan").forEach(r=>{new s(r.x.baseVal).shift(t),new s(r.y.baseVal).shift(e)})}}class a{constructor(t){this.domNode=t}shift(t,e){this.domNode.x1.baseVal.value+=t,this.domNode.y1.baseVal.value+=e,this.domNode.x2.baseVal.value+=t,this.domNode.y2.baseVal.value+=e}}class u{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class c{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class h{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var l,d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(t){l.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,l,t)}shift(t,e){for(let r=0;r<d(this,l,"f").numberOfItems;r++){let n=d(this,l,"f").getItem(r);n.x+=t,n.y+=e}}}l=new WeakMap;class m{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}class p{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}var y=r(725);const g=" ";function b([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function v(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const w=Math.PI;function x(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:n,rY:i}=t;const{x:s,y:o}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+o)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*w,[u,c]=b([(e-s)/2,(r-o)/2],-a),h=Math.pow(u,2)/Math.pow(n,2)+Math.pow(c,2)/Math.pow(i,2);1<h&&(n*=Math.sqrt(h),i*=Math.sqrt(h)),t.rX=n,t.rY=i;const l=Math.pow(n,2)*Math.pow(c,2)+Math.pow(i,2)*Math.pow(u,2),d=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-l)/l)),f=n*c/i*d,m=-i*u/n*d,p=b([f,m],a);t.cX=p[0]+(e+s)/2,t.cY=p[1]+(r+o)/2,t.phi1=Math.atan2((c-m)/i,(u-f)/n),t.phi2=Math.atan2((-c-m)/i,(-u-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*w),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*w),t.phi1*=180/w,t.phi2*=180/w}function N(t,e,r){v(t,e,r);const n=t*t+e*e-r*r;if(0>n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}const O=Math.PI/180;function S(t,e,r){return(1-r)*t+r*e}function E(t,e,r,n){return t+Math.cos(n/180*w)*e+Math.sin(n/180*w)*r}function _(t,e,r,n){const i=1e-6,s=e-t,o=r-e,a=3*s+3*(n-r)-6*o,u=6*(o-s),c=3*s;return Math.abs(a)<i?Math.abs(u)<i?[]:[-c/u]:function(t,e,r=1e-6){const n=t*t/4-e;if(n<-r)return[];if(n<=r)return[-t/2];const i=Math.sqrt(n);return[-t/2-i,-t/2+i]}(u/a,c/a,i)}function M(t,e,r,n,i){const s=1-i;return t*(s*s*s)+e*(3*s*s*i)+r*(3*s*i*i)+n*(i*i*i)}function T(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],s=r[0]-t[0],o=r[1]-t[1],a=n*o-i*s;if(!(Math.abs(a)<1e-10))return!1;const u=n*s+i*o,c=s*s+o*o;return 0<=u&&u<=c&&n*n+i*i<=c}function A(t){const e=t[t.length-1]?.type===B.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:B.MOVE_TO,relative:!1,x:t[r].x,y:t[r].y}];for(let e=r;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case B.HORIZ_LINE_TO:n.push({type:B.HORIZ_LINE_TO,relative:!1,x:i.x});break;case B.VERT_LINE_TO:n.push({type:B.VERT_LINE_TO,relative:!1,y:i.y});break;case B.LINE_TO:case B.MOVE_TO:n.push({type:B.LINE_TO,relative:!1,x:i.x,y:i.y});break;case B.CURVE_TO:n.push({type:B.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case B.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case B.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case B.ARC:throw new Error("Unsupported command: A (arc)");case B.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:B.CLOSE_PATH}),n}function P(){return I((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t))}function C(){let t=NaN,e=NaN,r=NaN,n=NaN;return I((i,s,o)=>(i.type&B.SMOOTH_CURVE_TO&&(i.type=B.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?o:e,i.x1=i.relative?s-t:2*s-t,i.y1=i.relative?o-e:2*o-e),i.type&B.CURVE_TO?(t=i.relative?s+i.x2:i.x2,e=i.relative?o+i.y2:i.y2):(t=NaN,e=NaN),i.type&B.SMOOTH_QUAD_TO&&(i.type=B.QUAD_TO,r=isNaN(r)?s:r,n=isNaN(n)?o:n,i.x1=i.relative?s-r:2*s-r,i.y1=i.relative?o-n:2*o-n),i.type&B.QUAD_TO?(r=i.relative?s+i.x1:i.x1,n=i.relative?o+i.y1:i.y1):(r=NaN,n=NaN),i))}function j(){let t=NaN,e=NaN;return I((r,n,i)=>{if(r.type&B.SMOOTH_QUAD_TO&&(r.type=B.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?i:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?i-e:2*i-e),r.type&B.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const s=r.x1,o=r.y1;r.type=B.CURVE_TO,r.x1=((r.relative?0:n)+2*s)/3,r.y1=((r.relative?0:i)+2*o)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*o)/3}else t=NaN,e=NaN;return r})}function I(t){let e=0,r=0,n=NaN,i=NaN;return function(s){if(isNaN(n)&&!(s.type&B.MOVE_TO))throw new Error("path must start with moveto");const o=t(s,e,r,n,i);return s.type&B.CLOSE_PATH&&(e=n,r=i),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&B.MOVE_TO&&(n=e,i=r),o}}function L(t,e,r,n,i,s){return v(t,e,r,n,i,s),I((o,a,u,c)=>{const h=o.x1,l=o.x2,d=o.relative&&!isNaN(c),f=void 0!==o.x?o.x:d?0:a,m=void 0!==o.y?o.y:d?0:u;function p(t){return t*t}o.type&B.HORIZ_LINE_TO&&0!==e&&(o.type=B.LINE_TO,o.y=o.relative?0:u),o.type&B.VERT_LINE_TO&&0!==r&&(o.type=B.LINE_TO,o.x=o.relative?0:a),void 0!==o.x&&(o.x=o.x*t+m*r+(d?0:i)),void 0!==o.y&&(o.y=f*e+o.y*n+(d?0:s)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*r+(d?0:i)),void 0!==o.y1&&(o.y1=h*e+o.y1*n+(d?0:s)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*r+(d?0:i)),void 0!==o.y2&&(o.y2=l*e+o.y2*n+(d?0:s));const y=t*n-e*r;if(void 0!==o.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===y)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=B.LINE_TO;else{const i=o.xRot*Math.PI/180,s=Math.sin(i),a=Math.cos(i),u=1/p(o.rX),c=1/p(o.rY),h=p(a)*u+p(s)*c,l=2*s*a*(u-c),d=p(s)*u+p(a)*c,f=h*n*n-l*e*n+d*e*e,m=l*(t*n+e*r)-2*(h*r*n+d*t*e),g=h*r*r-l*t*r+d*t*t,b=(Math.atan2(m,f-g)+Math.PI)%Math.PI/2,v=Math.sin(b),w=Math.cos(b);o.rX=Math.abs(y)/Math.sqrt(f*p(w)+m*v*w+g*p(v)),o.rY=Math.abs(y)/Math.sqrt(f*p(v)-m*v*w+g*p(w)),o.xRot=180*b/Math.PI}return void 0!==o.sweepFlag&&0>y&&(o.sweepFlag=+!o.sweepFlag),o})}const D={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return v(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:P,TO_REL:function(){return I((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,n=!0){return I((i,s,o,a,u)=>{if(isNaN(a)&&!(i.type&B.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&B.HORIZ_LINE_TO&&(i.type=B.LINE_TO,i.y=i.relative?0:o),r&&i.type&B.VERT_LINE_TO&&(i.type=B.LINE_TO,i.x=i.relative?0:s),t&&i.type&B.CLOSE_PATH&&(i.type=B.LINE_TO,i.x=i.relative?a-s:a,i.y=i.relative?u-o:u),i.type&B.ARC&&(0===i.rX||0===i.rY)&&(i.type=B.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&B.QUAD_TO&&T([s,o],i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],i.relative?[s+i.x,o+i.y]:[i.x,i.y])&&(i.type=B.LINE_TO,delete i.x1,delete i.y1),n&&i.type&B.CURVE_TO){const t=[s,o],e=i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],r=i.relative?[s+i.x2,o+i.y2]:[i.x2,i.y2],n=i.relative?[s+i.x,o+i.y]:[i.x,i.y];T(t,e,n)&&T(t,r,n)&&(i.type=B.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:C,QT_TO_C:j,INFO:I,SANITIZE:function(t=0){v(t);let e=NaN,r=NaN,n=NaN,i=NaN;return I((s,o,a,u,c)=>{const h=Math.abs;let l=!1,d=0,f=0;if(s.type&B.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:o-e,f=isNaN(r)?0:a-r),s.type&(B.CURVE_TO|B.SMOOTH_CURVE_TO)?(e=s.relative?o+s.x2:s.x2,r=s.relative?a+s.y2:s.y2):(e=NaN,r=NaN),s.type&B.SMOOTH_QUAD_TO?(n=isNaN(n)?o:2*o-n,i=isNaN(i)?a:2*a-i):s.type&B.QUAD_TO?(n=s.relative?o+s.x1:s.x1,i=s.relative?a+s.y1:s.y2):(n=NaN,i=NaN),s.type&B.LINE_COMMANDS||s.type&B.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&B.CURVE_TO||s.type&B.SMOOTH_CURVE_TO||s.type&B.QUAD_TO||s.type&B.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-o,r=void 0===s.y?0:s.relative?s.y:s.y-a;d=isNaN(n)?void 0===s.x1?d:s.relative?s.x:s.x1-o:n-o,f=isNaN(i)?void 0===s.y1?f:s.relative?s.y:s.y1-a:i-a;const u=void 0===s.x2?0:s.relative?s.x:s.x2-o,c=void 0===s.y2?0:s.relative?s.y:s.y2-a;h(e)<=t&&h(r)<=t&&h(d)<=t&&h(f)<=t&&h(u)<=t&&h(c)<=t&&(l=!0)}return s.type&B.CLOSE_PATH&&h(o-u)<=t&&h(a-c)<=t&&(l=!0),l?[]:s})},MATRIX:L,ROTATE:function(t,e=0,r=0){v(t,e,r);const n=Math.sin(t),i=Math.cos(t);return L(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},TRANSLATE:function(t,e=0){return v(t,e),L(1,0,0,1,t,e)},SCALE:function(t,e=t){return v(t,e),L(t,0,0,e,0,0)},SKEW_X:function(t){return v(t),L(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return v(t),L(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return v(t),L(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return v(t),L(1,0,0,-1,0,t)},A_TO_C:function(){return I((t,e,r)=>B.ARC===t.type?function(t,e,r){t.cX||x(t,e,r);const n=t.xRot/180*w;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:B.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const i=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-i,o=Math.ceil(s/90),a=new Array(o);let u=e,c=r;const h=(e,r)=>{const[i,s]=b([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+s]};for(let e=0;e<o;e++){const r=S(t.phi1,t.phi2,e/o),n=S(t.phi1,t.phi2,(e+1)/o),i=n-r,s=4/3*Math.tan(i*O/4),l=Math.cos(r*O)-s*Math.sin(r*O),d=Math.sin(r*O)+s*Math.cos(r*O),f=Math.cos(n*O),m=Math.sin(n*O),p=f+s*m,y=m-s*f,g=h(l,d),b=h(p,y),v=h(f,m),w={relative:t.relative,type:B.CURVE_TO,x:v[0],y:v[1],x1:g[0],y1:g[1],x2:b[0],y2:b[1]};t.relative&&(w.x1-=u,w.y1-=c,w.x2-=u,w.y2-=c,w.x-=u,w.y-=c),u=v[0],c=v[1],a[e]=w}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return I((t,e,r)=>(t.relative&&(e=0,r=0),B.ARC===t.type&&x(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=P(),e=j(),r=C(),n=I((i,s,o)=>{const a=r(e(t((t=>({...t}))(i))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(a.type&B.DRAWING_COMMANDS&&(u(s),c(o)),a.type&B.HORIZ_LINE_TO&&u(a.x),a.type&B.VERT_LINE_TO&&c(a.y),a.type&B.LINE_TO&&(u(a.x),c(a.y)),a.type&B.CURVE_TO){u(a.x),c(a.y);const t=_(s,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(M(s,a.x1,a.x2,a.x,e));const e=_(o,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(M(o,a.y1,a.y2,a.y,t))}if(a.type&B.ARC){u(a.x),c(a.y),x(a,s,o);const t=a.xRot/180*Math.PI,e=Math.cos(t)*a.rX,r=Math.sin(t)*a.rX,n=-Math.sin(t)*a.rY,i=Math.cos(t)*a.rY,[h,l]=a.phi1<a.phi2?[a.phi1,a.phi2]:-180>a.phi2?[a.phi2+360,a.phi1+360]:[a.phi2,a.phi1],d=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<h?r+360:r},f=N(n,-e,0).map(d);for(const t of f)t>h&&t<l&&u(E(a.cX,e,n,t));const m=N(i,-r,0).map(d);for(const t of m)t>h&&t<l&&c(E(a.cY,r,i,t))}return i});return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=D.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const s of t){const t=r(s);t.type===B.MOVE_TO&&i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(D.INFO((t,e,r)=>{const n="relative"in t&&t.relative;return["x"in t?t.x+(n?e:0):e,"y"in t?t.y+(n?r:0):r]}));let n=r[0];e.push(t[0]);for(let i=1;i<t.length;i++){const s=t[i],o=t[i+1];if(i<t.length-1&&o&&s.type&B.LINE_COMMANDS&&o.type&B.LINE_COMMANDS){const t=r[i+1];if(T(n,r[i],t)){"relative"in o&&o.relative&&("x"in o&&(o.x=t[0]-n[0]),"y"in o&&(o.y=t[1]-n[1]));continue}}e.push(s),n=r[i]}return e}};class R{round(t){return this.transform(D.ROUND(t))}toAbs(){return this.transform(D.TO_ABS())}toRel(){return this.transform(D.TO_REL())}normalizeHVZ(t,e,r){return this.transform(D.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(D.NORMALIZE_ST())}qtToC(){return this.transform(D.QT_TO_C())}aToC(){return this.transform(D.A_TO_C())}sanitize(t){return this.transform(D.SANITIZE(t))}translate(t,e){return this.transform(D.TRANSLATE(t,e))}scale(t,e){return this.transform(D.SCALE(t,e))}rotate(t,e,r){return this.transform(D.ROTATE(t,e,r))}matrix(t,e,r,n,i,s){return this.transform(D.MATRIX(t,e,r,n,i,s))}skewX(t){return this.transform(D.SKEW_X(t))}skewY(t){return this.transform(D.SKEW_Y(t))}xSymmetry(t){return this.transform(D.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(D.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(D.ANNOTATE_ARCS())}}const V=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,F=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class k extends R{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let n=0;n<t.length;n++){const i=t[n],s=!(this.curCommandType!==B.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=F(i)&&("0"===this.curNumber&&"0"===i||s);if(!F(i)||o)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${n}`);if(this.curCommandType===B.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${n}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${n}"`);this.curArgs.push(t),this.curArgs.length===U[this.curCommandType]&&(B.HORIZ_LINE_TO===this.curCommandType?r({type:B.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):B.VERT_LINE_TO===this.curCommandType?r({type:B.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===B.MOVE_TO||this.curCommandType===B.LINE_TO||this.curCommandType===B.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),B.MOVE_TO===this.curCommandType&&(this.curCommandType=B.LINE_TO)):this.curCommandType===B.CURVE_TO?r({type:B.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===B.SMOOTH_CURVE_TO?r({type:B.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.QUAD_TO?r({type:B.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.ARC&&r({type:B.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!V(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(o)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${n}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${i}" at index ${n}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=B.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=B.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=B.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=B.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=B.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=B.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=B.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=B.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=B.ARC,this.curCommandRelative="a"===i}else e.push({type:B.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const n=Object.getPrototypeOf(this).parse.call(this,e);for(const e of n){const n=t(e);Array.isArray(n)?r.push(...n):r.push(n)}return r}}})}}class B extends R{commands;constructor(t){super(),this.commands="string"==typeof t?B.parse(t):t}encode(){return B.encode(this.commands)}getBounds(){const t=D.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const n=t(r);Array.isArray(n)?e.push(...n):e.push(n)}return this.commands=e,this}reverse(t=!0){return this.commands=D.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=D.REMOVE_COLLINEAR(this.commands),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const n=t[r];if(n.type===B.CLOSE_PATH)e+="z";else if(n.type===B.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===B.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===B.MOVE_TO)e+=(n.relative?"m":"M")+n.x+g+n.y;else if(n.type===B.LINE_TO)e+=(n.relative?"l":"L")+n.x+g+n.y;else if(n.type===B.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+g+n.y1+g+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+g+n.y1+g+n.x+g+n.y;else if(n.type===B.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+g+n.y;else{if(n.type!==B.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+g+n.rY+g+n.xRot+g+ +n.lArcFlag+g+ +n.sweepFlag+g+n.x+g+n.y}}return e}(t)}static parse(t){const e=new k,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=B.LINE_TO|B.HORIZ_LINE_TO|B.VERT_LINE_TO;static DRAWING_COMMANDS=B.HORIZ_LINE_TO|B.VERT_LINE_TO|B.LINE_TO|B.CURVE_TO|B.SMOOTH_CURVE_TO|B.QUAD_TO|B.SMOOTH_QUAD_TO|B.ARC}const U={[B.MOVE_TO]:2,[B.LINE_TO]:2,[B.HORIZ_LINE_TO]:1,[B.VERT_LINE_TO]:1,[B.CLOSE_PATH]:0,[B.QUAD_TO]:4,[B.SMOOTH_QUAD_TO]:2,[B.CURVE_TO]:6,[B.SMOOTH_CURVE_TO]:4,[B.ARC]:7};class X{constructor(t){this.domNode=t}shift(t,e){var r;let n=null!==(r=this.domNode.getAttribute("d"))&&void 0!==r?r:"";this.domNode.setAttribute("d",new B(n).translate(t,e).encode())}closestPoint(t){let e=this.domNode.getTotalLength(),r=[];for(let n=0;n<=16;n++){let i=n/16*e;r.push([i,(0,y.distance)(t,this.domNode.getPointAtLength(i))])}r.sort((t,e)=>t[1]-e[1]);let n=r[0],i=n[0]-e/16,s=n[0]+e/16;i=Math.max(0,i),s=Math.min(e,s);for(let e=0;e<20;e++){let e=(s-i)/3;(0,y.distance)(t,this.domNode.getPointAtLength(i))<(0,y.distance)(t,this.domNode.getPointAtLength(s))?s-=e:i+=e}let o=(i+s)/2,a=this.domNode.getPointAtLength(o);return{x:a.x,y:a.y,length:o}}}class Y{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class z{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class H{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}function G(e,r){let{x:n,y:i}=r,s=e.tagName;if(!$.has(s))switch(s){case"g":Array.from(e.children).forEach(t=>G(t,r));break;case"svg":new t(e).shift(n,i);break;case"text":new o(e).shift(n,i);break;case"line":new a(e).shift(n,i);break;case"circle":new u(e).shift(n,i);break;case"ellipse":new c(e).shift(n,i);break;case"rect":new h(e).shift(n,i);break;case"polyline":new m(e).shift(n,i);break;case"polygon":new p(e).shift(n,i);break;case"path":new X(e).shift(n,i);break;case"image":new Y(e).shift(n,i);break;case"use":new z(e).shift(n,i);break;case"foreignObject":new H(e).shift(n,i);break;default:console.error(`Unrecognized SVG element type: "${s}".`)}}const $=new Set(["defs","title","desc","metadata","style","script","linearGradient","radialGradient","stop","clipPath","mask","marker","pattern","symbol","filter"]);var W,q;class J{constructor(t){W.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,W,t)}toArray(){return Array.from(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,W).querySelectorAll("text")).map(t=>({domNode:t}))}}W=new WeakMap;class Q{constructor(t){q.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,q,t)}closestPoint(t){return document.body.contains(Z)||document.body.append(Z),tt.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,q)),new X(tt).closestPoint(t)}}q=new WeakMap;const K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("viewBox","0 0 100 100"),K.setAttribute("width","100"),K.setAttribute("height","100");const Z=document.createElement("div");Z.append(K),Z.style.height="0px",Z.style.position="fixed",document.body.append(Z);const tt=document.createElementNS("http://www.w3.org/2000/svg","path");function et(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}tt.setAttribute("stroke","black"),tt.setAttribute("stroke-width","1"),K.append(tt);const rt=new Uint8Array(16),nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));const it=function(t,e,r){return e||t||!crypto.randomUUID?function(t,e,r){const n=(t=t||{}).random??t.rng?.()??crypto.getRandomValues(rt);if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return(nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]).toLowerCase()}(n)}(t,e,r):crypto.randomUUID()};function st(t){t.id="uuid-"+it()}class ot{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class at{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class ut{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class ct{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function ht(t){let e=t.parentNode;e&&e.appendChild(t)}function lt(t){let e=t.parentNode;e&&e.prepend(t)}var dt,ft=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class mt{constructor(t){dt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,dt,t)}toString(){return ft(this,dt,"f").innerHTML}set(t){ft(this,dt,"f").innerHTML=t}}dt=new WeakMap;var pt,yt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class gt{constructor(t){pt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,pt,t)}toString(){return yt(this,pt,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=yt(this,pt,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...yt(this,pt,"f").attributes].forEach(t=>yt(this,pt,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>yt(this,pt,"f").setAttribute(t.name,t.value)),yt(this,pt,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function bt(t){return t instanceof SVGGraphicsElement}pt=new WeakMap;var vt=r(854);function wt(t){return(0,vt.isArray)(t)&&t.every(bt)}async function xt(t){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),await i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e}})(),n})(),t.exports=e()},725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{CurvedBond:()=>bi.CurvedBond,InvertedStraightBondsHider:()=>Ni,MissingPrimaryBondsAdder:()=>xi,StraightBond:()=>fi});var t=Object.create,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,u=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),c=(t,r)=>{let n={};for(var i in t)e(n,i,{get:t[i],enumerable:!0});return r||e(n,Symbol.toStringTag,{value:"Module"}),n};const h={},l=[];function d(t,e){if(Array.isArray(t))for(const r of t)d(r,e);else if("object"!=typeof t)m(Object.getOwnPropertyNames(e)),h[t]=Object.assign(h[t]||{},e);else for(const e in t)d(e,t[e])}function f(t){return h[t]||{}}function m(t){l.push(...t)}var p=u((t,e)=>{e.exports=function(t){try{return!!t()}catch(t){return!0}}}),y=u((t,e)=>{var r=p();e.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}),g=u((t,e)=>{var r=y(),n=Function.prototype,i=n.call,s=r&&n.bind.bind(i,i);e.exports=r?s:function(t){return function(){return i.apply(t,arguments)}}}),b=u((t,e)=>{var r=g();e.exports=r({}.isPrototypeOf)}),v=u((t,e)=>{var n=function(t){return t&&t.Math===Math&&t};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}),w=u((t,e)=>{var r=y(),n=Function.prototype,i=n.apply,s=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})}),x=u((t,e)=>{var r=g(),n=r({}.toString),i=r("".slice);e.exports=function(t){return i(n(t),8,-1)}}),N=u((t,e)=>{var r=x(),n=g();e.exports=function(t){if("Function"===r(t))return n(t)}}),O=u((t,e)=>{var r="object"==typeof document&&document.all;e.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}}),S=u((t,e)=>{var r=p();e.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),E=u((t,e)=>{var r=y(),n=Function.prototype.call;e.exports=r?n.bind(n):function(){return n.apply(n,arguments)}}),_=u(t=>{var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!e.call({1:2},1);t.f=n?function(t){var e=r(this,t);return!!e&&e.enumerable}:e}),M=u((t,e)=>{e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}}),T=u((t,e)=>{var r=g(),n=p(),i=x(),s=Object,o=r("".split);e.exports=n(function(){return!s("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?o(t,""):s(t)}:s}),A=u((t,e)=>{e.exports=function(t){return null==t}}),P=u((t,e)=>{var r=A(),n=TypeError;e.exports=function(t){if(r(t))throw new n("Can't call method on "+t);return t}}),C=u((t,e)=>{var r=T(),n=P();e.exports=function(t){return r(n(t))}}),j=u((t,e)=>{var r=O();e.exports=function(t){return"object"==typeof t?null!==t:r(t)}}),I=u((t,e)=>{e.exports={}}),L=u((t,e)=>{var r=I(),n=v(),i=O(),s=function(t){return i(t)?t:void 0};e.exports=function(t,e){return arguments.length<2?s(r[t])||s(n[t]):r[t]&&r[t][e]||n[t]&&n[t][e]}}),D=u((t,e)=>{var r=v().navigator,n=r&&r.userAgent;e.exports=n?String(n):""}),R=u((t,e)=>{var r,n,i=v(),s=D(),o=i.process,a=i.Deno,u=o&&o.versions||a&&a.version,c=u&&u.v8;c&&(n=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(n=+r[1]),e.exports=n}),V=u((t,e)=>{var r=R(),n=p(),i=v().String;e.exports=!!Object.getOwnPropertySymbols&&!n(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41})}),F=u((t,e)=>{var r=V();e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),k=u((t,e)=>{var r=L(),n=O(),i=b(),s=F(),o=Object;e.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return n(e)&&i(e.prototype,o(t))}}),B=u((t,e)=>{var r=String;e.exports=function(t){try{return r(t)}catch(t){return"Object"}}}),U=u((t,e)=>{var r=O(),n=B(),i=TypeError;e.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not a function")}}),X=u((t,e)=>{var r=U(),n=A();e.exports=function(t,e){var i=t[e];return n(i)?void 0:r(i)}}),Y=u((t,e)=>{var r=E(),n=O(),i=j(),s=TypeError;e.exports=function(t,e){var o,a;if("string"===e&&n(o=t.toString)&&!i(a=r(o,t)))return a;if(n(o=t.valueOf)&&!i(a=r(o,t)))return a;if("string"!==e&&n(o=t.toString)&&!i(a=r(o,t)))return a;throw new s("Can't convert object to primitive value")}}),z=u((t,e)=>{e.exports=!0}),H=u((t,e)=>{var r=v(),n=Object.defineProperty;e.exports=function(t,e){try{n(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}}),G=u((t,e)=>{var r=z(),n=v(),i=H(),s="__core-js_shared__",o=e.exports=n[s]||i(s,{});(o.versions||(o.versions=[])).push({version:"3.49.0",mode:r?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),$=u((t,e)=>{var r=G();e.exports=function(t,e){return r[t]||(r[t]=e||{})}}),W=u((t,e)=>{var r=P(),n=Object;e.exports=function(t){return n(r(t))}}),q=u((t,e)=>{var r=g(),n=W(),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(t,e){return i(n(t),e)}}),J=u((t,e)=>{var r=g(),n=0,i=Math.random(),s=r(1.1.toString);e.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++n+i,36)}}),Q=u((t,e)=>{var r=v(),n=$(),i=q(),s=J(),o=V(),a=F(),u=r.Symbol,c=n("wks"),h=a?u.for||u:u&&u.withoutSetter||s;e.exports=function(t){return i(c,t)||(c[t]=o&&i(u,t)?u[t]:h("Symbol."+t)),c[t]}}),K=u((t,e)=>{var r=E(),n=j(),i=k(),s=X(),o=Y(),a=Q(),u=TypeError,c=a("toPrimitive");e.exports=function(t,e){if(!n(t)||i(t))return t;var a,h=s(t,c);if(h){if(void 0===e&&(e="default"),a=r(h,t,e),!n(a)||i(a))return a;throw new u("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}}),Z=u((t,e)=>{var r=K(),n=k();e.exports=function(t){var e=r(t,"string");return n(e)?e:e+""}}),tt=u((t,e)=>{var r=v(),n=j(),i=r.document,s=n(i)&&n(i.createElement);e.exports=function(t){return s?i.createElement(t):{}}}),et=u((t,e)=>{var r=S(),n=p(),i=tt();e.exports=!r&&!n(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}),rt=u(t=>{var e=S(),r=E(),n=_(),i=M(),s=C(),o=Z(),a=q(),u=et(),c=Object.getOwnPropertyDescriptor;t.f=e?c:function(t,e){if(t=s(t),e=o(e),u)try{return c(t,e)}catch(t){}if(a(t,e))return i(!r(n.f,t,e),t[e])}}),nt=u((t,e)=>{var r=p(),n=O(),i=/#|\.prototype\./,s=function(t,e){var i=a[o(t)];return i===c||i!==u&&(n(e)?r(e):!!e)},o=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",c=s.POLYFILL="P";e.exports=s}),it=u((t,e)=>{var r=N(),n=U(),i=y(),s=r(r.bind);e.exports=function(t,e){return n(t),void 0===e?t:i?s(t,e):function(){return t.apply(e,arguments)}}}),st=u((t,e)=>{var r=S(),n=p();e.exports=r&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),ot=u((t,e)=>{var r=j(),n=String,i=TypeError;e.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not an object")}}),at=u(t=>{var e=S(),r=et(),n=st(),i=ot(),s=Z(),o=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c="enumerable",h="configurable",l="writable";t.f=e?n?function(t,e,r){if(i(t),e=s(e),i(r),"function"==typeof t&&"prototype"===e&&"value"in r&&l in r&&!r[l]){var n=u(t,e);n&&n[l]&&(t[e]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:c in r?r[c]:n[c],writable:!1})}return a(t,e,r)}:a:function(t,e,n){if(i(t),e=s(e),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new o("Accessors not supported");return"value"in n&&(t[e]=n.value),t}}),ut=u((t,e)=>{var r=S(),n=at(),i=M();e.exports=r?function(t,e,r){return n.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}}),ct=u((t,e)=>{var r=v(),n=w(),i=N(),s=O(),o=rt().f,a=nt(),u=I(),c=it(),h=ut(),l=q();G();var d=function(t){var e=function(r,i,s){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,i)}return new t(r,i,s)}return n(t,this,arguments)};return e.prototype=t.prototype,e};e.exports=function(t,e){var n,f,m,p,y,g,b,v,w,x=t.target,N=t.global,O=t.stat,S=t.proto,E=N?r:O?r[x]:r[x]&&r[x].prototype,_=N?u:u[x]||h(u,x,{})[x],M=_.prototype;for(p in e)f=!(n=a(N?p:x+(O?".":"#")+p,t.forced))&&E&&l(E,p),g=_[p],f&&(b=t.dontCallGetSet?(w=o(E,p))&&w.value:E[p]),y=f&&b?b:e[p],(n||S||typeof g!=typeof y)&&(v=t.bind&&f?c(y,r):t.wrap&&f?d(y):S&&s(y)?i(y):y,(t.sham||y&&y.sham||g&&g.sham)&&h(v,"sham",!0),h(_,p,v),S&&(l(u,m=x+"Prototype")||h(u,m,{}),h(u[m],p,y),t.real&&M&&(n||!M[p])&&h(M,p,y)))}}),ht=u((t,e)=>{var r=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}}),lt=u((t,e)=>{var r=ht();e.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}}),dt=u((t,e)=>{var r=lt(),n=Math.max,i=Math.min;e.exports=function(t,e){var s=r(t);return s<0?n(s+e,0):i(s,e)}}),ft=u((t,e)=>{var r=lt(),n=Math.min;e.exports=function(t){var e=r(t);return e>0?n(e,9007199254740991):0}}),mt=u((t,e)=>{var r=ft();e.exports=function(t){return r(t.length)}}),pt=u((t,e)=>{var r=C(),n=dt(),i=mt(),s=function(t){return function(e,s,o){var a=r(e),u=i(a);if(0===u)return!t&&-1;var c,h=n(o,u);if(t&&s!=s){for(;u>h;)if((c=a[h++])!=c)return!0}else for(;u>h;h++)if((t||h in a)&&a[h]===s)return t||h||0;return!t&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}}),yt=u((t,e)=>{e.exports=function(){}}),gt=u(()=>{var t=ct(),e=pt().includes,r=p(),n=yt(),i=r(function(){return!Array(1).includes()}),s=r(function(){return[,1].includes(void 0,1)});t({target:"Array",proto:!0,forced:i||s},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),n("includes")}),bt=u((t,e)=>{var r=v(),n=I();e.exports=function(t,e){var i=n[t+"Prototype"],s=i&&i[e];if(s)return s;var o=r[t],a=o&&o.prototype;return a&&a[e]}}),vt=u((t,e)=>{gt();var r=bt();e.exports=r("Array","includes")}),wt=u((t,e)=>{var r=j(),n=x(),i=Q()("match");e.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"===n(t))}}),xt=u((t,e)=>{var r=wt(),n=TypeError;e.exports=function(t){if(r(t))throw new n("The method doesn't accept regular expressions");return t}}),Nt=u((t,e)=>{var r={};r[Q()("toStringTag")]="z",e.exports="[object z]"===String(r)}),Ot=u((t,e)=>{var r=Nt(),n=O(),i=x(),s=Q()("toStringTag"),o=Object,a="Arguments"===i(function(){return arguments}());e.exports=r?i:function(t){var e,r,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=o(t),s))?r:a?i(e):"Object"===(u=i(e))&&n(e.callee)?"Arguments":u}}),St=u((t,e)=>{var r=Ot(),n=String;e.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}}),Et=u((t,e)=>{var r=Q()("match");e.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(t){}}return!1}}),_t=u(()=>{var t=ct(),e=g(),r=xt(),n=P(),i=St(),s=Et(),o=e("".indexOf);t({target:"String",proto:!0,forced:!s("includes")},{includes:function(t){return!!~o(i(n(this)),i(r(t)),arguments.length>1?arguments[1]:void 0)}})}),Mt=u((t,e)=>{_t();var r=bt();e.exports=r("String","includes")}),Tt=u((t,e)=>{var r=b(),n=vt(),i=Mt(),s=Array.prototype,o=String.prototype;e.exports=function(t){var e=t.includes;return t===s||r(s,t)&&e===s.includes?n:"string"==typeof t||t===o||r(o,t)&&e===o.includes?i:e}}),At=((r,n,u)=>(u=null!=r?t(o(r)):{},((t,r,n,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(var u,c=s(r),h=0,l=c.length;h<l;h++)u=c[h],a.call(t,u)||void 0===u||e(t,u,{get:(t=>r[t]).bind(null,u),enumerable:!(o=i(r,u))||o.enumerable});return t})(e(u,"default",{value:r,enumerable:!0}),r)))(u((t,e)=>{var r=Tt();e.exports=r})());function Pt(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function Ct(t){return t%360*Math.PI/180}function jt(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})}function It(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Lt(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 Dt(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=(0,At.default)(n).call(n,"left")?a:(0,At.default)(n).call(n,"right")?a+r:a+r/2),o&&(i=(0,At.default)(i).call(i,"top")?u:(0,At.default)(i).call(i,"bottom")?u+t:u+t/2)}return[n,i]}const Rt=new Set(["desc","metadata","title"]),Vt=t=>Rt.has(t.nodeName),Ft="http://www.w3.org/2000/svg",kt="http://www.w3.org/2000/xmlns/",Bt="http://www.w3.org/1999/xlink",Ut={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};var Xt=class{};const Yt={},zt="___SYMBOL___ROOT___";function Ht(t,e=Ft){return Ut.document.createElementNS(e,t)}function Gt(t,e=!1){if(t instanceof Xt)return t;if("object"==typeof t)return qt(t);if(null==t)return new Yt[zt];if("string"==typeof t&&"<"!==t.trim().charAt(0))return qt(Ut.document.querySelector(t));const r=e?Ut.document.createElement("div"):Ht("svg");return r.innerHTML=t.trim(),t=qt(r.firstElementChild),r.removeChild(r.firstElementChild),t}function $t(t,e){return e&&(e instanceof Ut.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:Ht(t)}function Wt(t){if(!t)return null;if(t.instance instanceof Xt)return t.instance;if("#document-fragment"===t.nodeName)return new Yt.Fragment(t);let e=It(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Yt[e]||(e="Dom"),new Yt[e](t)}let qt=Wt;function Jt(t,e=t.name,r=!1){return Yt[e]=t,r&&(Yt[zt]=t),m(Object.getOwnPropertyNames(t.prototype)),t}let Qt=1e3;function Kt(t){return"Svgjs"+It(t)+Qt++}function Zt(t){for(let e=t.children.length-1;e>=0;e--)Zt(t.children[e]);return t.id?(t.id=Kt(t.nodeName),t):t}function te(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 ee(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)}}d("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=Gt(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=Gt(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=Gt(t)).before(this),this},insertAfter:function(t){return(t=Gt(t)).after(this),this}});const re=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,ne=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ie=/rgb\((\d+),(\d+),(\d+)\)/,se=/^(#[^\s]+)$/,oe=/\)\s*,?\s*/,ae=/\s/g,ue=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,ce=/^rgb\(/,he=/^(\s+)?$/,le=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,de=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,fe=/[\s,]+/,me=/[MLHVCSQTAZ]/i;d("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(fe)},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)}});const pe=t=>t.startsWith("--")?t:jt(t);function ye(t){const e=Math.max(0,Math.min(255,Math.round(t))).toString(16);return 1===e.length?"0"+e:e}function ge(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function be(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}d("Dom",{css:function(t,e){const r={};if(0===arguments.length){const t=this.node.style;for(let e=0;e<t.length;e++){const n=t.item(e),i=t.getPropertyValue(n),s=t.getPropertyPriority(n);r[n]=s?`${i} !${s}`:i}return r}if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=pe(e);r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(pe(t));if("object"==typeof t)for(const e in t)this.node.style.setProperty(pe(e),null==t[e]||he.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(pe(t),null==e||he.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),d("Dom",{data:function(t,e,r){if(null==t)return this.data(Pt(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}}),d("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||{}}});var ve=class t{constructor(...t){this.init(...t)}static isColor(e){return e&&(e instanceof t||this.isRgb(e)||this.test(e))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(e="vibrant",r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===e){const e=24*n()+57,r=38*n()+45,i=360*n();return new t(e,r,i,"lch")}if("sine"===e){const e=i(80*s(2*o*(r=r??n())/.5+.01)+150),a=i(50*s(2*o*r/.5+4.6)+200),u=i(100*s(2*o*r/.5+2.3)+150);return new t(e,a,u)}if("pastel"===e){const e=8*n()+86,r=17*n()+9,i=360*n();return new t(e,r,i,"lch")}if("dark"===e){const e=10+10*n(),r=50*n()+86,i=360*n();return new t(e,r,i,"lch")}if("rgb"===e){const e=255*n(),r=255*n(),i=255*n();return new t(e,r,i)}if("lab"===e){const e=100*n(),r=256*n()-128,i=256*n()-128;return new t(e,r,i,"lab")}if("grey"===e){const e=255*n();return new t(e,e,e)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(ue.test(t)||ce.test(t))}cmyk(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),a=Math.min(1-i,1-s,1-o);return 1===a?new t(0,0,0,1,"cmyk"):new t((1-i-a)/(1-a),(1-s-a)/(1-a),(1-o-a)/(1-a),a,"cmyk")}hsl(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),a=Math.max(i,s,o),u=Math.min(i,s,o),c=(a+u)/2,h=a===u,l=a-u;return new t(360*(h?0:a===i?((s-o)/l+(s<o?6:0))/6:a===s?((o-i)/l+2)/6:a===o?((i-s)/l+4)/6:0),100*(h?0:c>.5?l/(2-a-u):l/(a+u)),100*c,"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=ge(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:ge(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:ge(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:ge(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:ge(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:ge(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(ce.test(t)){const e=t.replace(ae,""),[r,n,i]=ie.exec(e).slice(1,4).map(t=>parseInt(t));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!ue.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=ne.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,c="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,c)}lab(){const{x:e,y:r,z:n}=this.xyz();return new t(116*r-16,500*(e-r),200*(r-n),"lab")}lch(){const{l:e,a:r,b:n}=this.lab(),i=Math.sqrt(r**2+n**2);let s=180*Math.atan2(n,r)/Math.PI;return s<0&&(s*=-1,s=360-s),new t(e,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:r,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:t,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=(t+16)/116,a=i/500+o,u=o-s/200,c=16/116,h=.008856,l=7.787;e=.95047*(a**3>h?a**3:(a-c)/l),r=1*(o**3>h?o**3:(o-c)/l),n=1.08883*(u**3>h?u**3:(u-c)/l)}const i=3.2406*e+-1.5372*r+-.4986*n,s=-.9689*e+1.8758*r+.0415*n,o=.0557*e+-.204*r+1.057*n,a=Math.pow,u=.0031308,c=i>u?1.055*a(i,1/2.4)-.055:12.92*i,h=s>u?1.055*a(s,1/2.4)-.055:12.92*s,l=o>u?1.055*a(o,1/2.4)-.055:12.92*o;return new t(255*c,255*h,255*l)}if("hsl"===this.space){let{h:e,s:r,l:n}=this;if(e/=360,r/=100,n/=100,0===r)return n*=255,new t(n,n,n);const i=n<.5?n*(1+r):n+r-n*r,s=2*n-i,o=255*be(s,i,e+1/3),a=255*be(s,i,e),u=255*be(s,i,e-1/3);return new t(o,a,u)}if("cmyk"===this.space){const{c:e,m:r,y:n,k:i}=this,s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,r*(1-i)+i)),a=255*(1-Math.min(1,n*(1-i)+i));return new t(s,o,a)}return this;var e}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(ye);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),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,c=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,h=(.4124*a+.3576*u+.1805*c)/.95047,l=(.2126*a+.7152*u+.0722*c)/1,d=(.0193*a+.1192*u+.9505*c)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=d>.008856?Math.pow(d,1/3):7.787*d+16/116;return new t(f,m,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)))}},we=class t{constructor(...t){this.init(...t)}clone(){return new t(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=r.x??0,this.y=r.y??0,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Ne.isMatrixLike(t)||(t=new Ne(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 xe(t,e,r){return Math.abs(e-t)<(r||1e-6)}var Ne=class t{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,c=t.rotate||t.theta||0,h=new we(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=h.x,d=h.y,f=new we(t.position??t.px??t.positionX??NaN,t.py??t.positionY??NaN),m=f.x,p=f.y,y=new we(t.translate||t.tx||t.translateX,t.ty||t.translateY),g=y.x,b=y.y,v=new we(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:c,rx:v.x,ry:v.y,tx:g,ty:b,ox:l,oy:d,px:m,py:p}}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 t(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,c=u>0?1:-1,h=c*Math.sqrt(r*r+n*n),l=Math.atan2(c*n,c*r),d=(r*i+n*s)/u;return{scaleX:h,scaleY:i*h/(d*r-n)||s*h/(d*n+r),shear:d,rotate:180/Math.PI*l,translateX:o-t+t*r+e*i,translateY:a-e+t*n+e*s,originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const r=new t(e);return xe(this.a,r.a)&&xe(this.b,r.b)&&xe(this.c,r.c)&&xe(this.d,r.d)&&xe(this.e,r.e)&&xe(this.f,r.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(e){const r=t.fromArray([1,0,0,1,0,0]);return e=e instanceof We?e.matrixify():"string"==typeof e?t.fromArray(e.split(fe).map(parseFloat)):Array.isArray(e)?t.fromArray(e):"object"==typeof e&&t.isMatrixLike(e)?e:"object"==typeof e?(new t).transform(e):6===arguments.length?t.fromArray([].slice.call(arguments)):r,this.a=null!=e.a?e.a:r.a,this.b=null!=e.b?e.b:r.b,this.c=null!=e.c?e.c:r.c,this.d=null!=e.d?e.d:r.d,this.e=null!=e.e?e.e:r.e,this.f=null!=e.f?e.f:r.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,c=-r/o,h=t/o,l=-(a*i+c*s),d=-(u*i+h*s);return this.a=a,this.b=u,this.c=c,this.d=h,this.e=l,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(e){const r=e instanceof t?e:new t(e);return t.matrixMultiply(r,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(e){const r=e instanceof t?e:new t(e);return t.matrixMultiply(this,r,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=Ct(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:c,f:h}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=c*n-h*i+r*i-e*n+e,this.f=h*n+c*i-e*i-r*n+r,this}scale(){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:c}=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=c*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(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=Ct(t),e=Ct(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:c,e:h,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+c*i,this.d=c+u*s,this.e=h+l*i-n*i,this.f=l+h*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(e){if(t.isMatrixLike(e))return new t(e).multiplyO(this);const r=t.formatTransforms(e),{x:n,y:i}=new we(r.ox,r.oy).transform(this),s=(new t).translateO(r.rx,r.ry).lmultiplyO(this).translateO(-n,-i).scaleO(r.scaleX,r.scaleY).skewO(r.skewX,r.skewY).shearO(r.shear).rotateO(r.theta).translateO(n,i);if(isFinite(r.px)||isFinite(r.py)){const t=new we(n,i).transform(s),e=isFinite(r.px)?r.px-t.x:0,o=isFinite(r.py)?r.py-t.y:0;s.translateO(e,o)}return s.translateO(r.tx,r.ty),s}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 Oe(){if(!Oe.nodes||Oe.nodes.svg.node.ownerDocument!==Ut.document){const t=Gt().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"),Oe.nodes={svg:t,path:t.path().node}}return Oe.nodes.svg.node.parentNode||Oe.nodes.svg.addTo(Ut.document.body||Ut.document.documentElement),Oe.nodes}function Se(t){return!(t.width||t.height||t.x||t.y)}Jt(Ne,"Matrix");var Ee=class t{constructor(...t){this.init(...t)}addOffset(){return this.x+=Ut.window.pageXOffset,this.y+=Ut.window.pageYOffset,new t(this)}init(t){return t="string"==typeof t?t.split(fe).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 Se(this)}merge(e){const r=Math.min(this.x,e.x),n=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-r,s=Math.max(this.y+this.height,e.y+e.height)-n;return new t(r,n,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof Ne||(e=new Ne(e));let r=1/0,n=-1/0,i=1/0,s=-1/0;return[new we(this.x,this.y),new we(this.x2,this.y),new we(this.x,this.y2),new we(this.x2,this.y2)].forEach(function(t){t=t.transform(e),r=Math.min(r,t.x),n=Math.max(n,t.x),i=Math.min(i,t.y),s=Math.max(s,t.y)}),new t(r,i,n-r,s-i)}};function _e(t,e,r){let n;try{if(n=e(t.node),Se(n)&&(i=t.node)!==Ut.document&&!(Ut.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===Ut.document}).call(Ut.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}d({viewbox:{viewbox(t,e,r,n){return null==t?new Ee(this.attr("viewBox")):this.attr("viewBox",new Ee(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 we(r/2/s+i.x,n/2/o+i.y);const c=new Ee(i).transform(new Ne({scale:u,origin:e}));return this.viewbox(c)}}}),Jt(Ee,"Box");var Me=class extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}};te([Me],{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 Te=["toArray","constructor","each"];function Ae(t){let e=(t+"").trim();const r=e.match(/^url\((.*)\)$/i);if(r){e=r[1].trim();const t=e[0];if('"'===t||"'"===t){if(e[e.length-1]!==t)return null;e=e.slice(1,-1)}}const n=e.match(se);return n?n[1].slice(1):null}function Pe(t,e){const r=`#${Ut.window.CSS.escape(e)}`;return 1===t.nodeType&&t.matches(r)?t:t.querySelector(r)}function Ce(t,e,r=`[${e}]`){const n=t.getAttribute("id"),i=t.getRootNode();if(!n||Pe(i,n)!==t)return new Me;const s=[];1===i.nodeType&&i.matches(r)&&Ae(i.getAttribute(e))===n&&s.push(Wt(i));for(const t of i.querySelectorAll(r))Ae(t.getAttribute(e))===n&&s.push(Wt(t));return new Me(s)}Me.extend=function(t){t=t.reduce((t,e)=>((0,At.default)(Te).call(Te,e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t),{}),te([Me],t)};let je=0;const Ie=new WeakMap,Le=new WeakMap,De=()=>Object.create(null);function Re(t){const e=t.getEventHolder();let r=Ie.get(e);return r||(r=De(),Ie.set(e,r)),r}function Ve(t){return t.getEventTarget()}function Fe(t,e,r,n,i){const s=r.bind(n||t),o=i||!1,a=Gt(t),u=Re(a),c=Ve(a);e=Array.isArray(e)?e:e.split(fe);let h=Le.get(r);h||(h=++je,Le.set(r,h)),e.forEach(function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";u[e]=u[e]||De(),u[e][r]=u[e][r]||De(),u[e][r][h]=u[e][r][h]||[],u[e][r][h].push({listener:s,options:o}),c.addEventListener(e,s,o)})}function ke(t,e,r,n){const i=Gt(t),s=Re(i),o=Ve(i);("function"!=typeof r||(r=Le.get(r)))&&(e=Array.isArray(e)?e:(e||"").split(fe)).forEach(function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,c;if(r){if(s[e]&&s[e][a||"*"]){const t=s[e][a||"*"][r];if(!t)return;t.forEach(function(t){o.removeEventListener(e,t.listener,t.options??n??!1)}),delete s[e][a||"*"][r]}}else if(e&&a){if(s[e]&&s[e][a]){for(c in s[e][a])ke(o,[e,a].join("."),c);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ke(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ke(o,[e,u].join("."));delete s[e]}}else{for(t in s)ke(o,t);!function(t){Ie.delete(t.getEventHolder())}(i)}})}var Be=class extends Xt{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=Ve(t);return e instanceof Ut.window.Event||(e=new Ut.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=Re(this)[t.type];if(!e)return!0;for(const r in e)for(const n in e[r])e[r][n].forEach(function(e){e.listener(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 ke(this,t,e,r),this}on(t,e,r,n){return Fe(this,t,e,r,n),this}removeEventListener(){}};function Ue(){}Jt(Be,"EventTarget");const Xe={"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"};var Ye=class 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(fe).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}},ze=class t{constructor(...t){this.init(...t)}convert(e){return new t(this.value,e)}divide(e){return e=new t(e),new t(this/e,this.unit||e.unit)}init(e,r){return r=Array.isArray(e)?e[1]:r,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=r||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(r=e.match(re))&&(this.value=parseFloat(r[1]),"%"===r[5]?this.value/=100:"s"===r[5]&&(this.value*=1e3),this.unit=r[5]):e instanceof t&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new t(e),new t(this-e,this.unit||e.unit)}plus(e){return e=new t(e),new t(this+e,this.unit||e.unit)}times(e){return e=new t(e),new t(this*e,this.unit||e.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 He=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ge=[];var $e=class t extends Be{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=Gt(t)).removeNamespace&&this.node instanceof Ut.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 Gt(t).put(this,e)}children(){return new Me(Pt(this.node.children,function(t){return Wt(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=Zt(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(e,r){return this.put(new t(Ht(e),r))}first(){return Wt(this.node.firstChild)}get(t){return Wt(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=Kt(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Wt(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=Wt(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Wt(e.node.parentNode));return e}put(t,e){return t=Gt(t),this.add(t,e),t}putIn(t,e){return Gt(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=Gt(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,Ft)}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=e??!0,this.writeDataToDom();let r=this;if(null!=t){if(r=Wt(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=e??!1;const n=Ht("wrapper",r),i=Ut.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)}};te($e,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=le.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))?Xe[t]:le.test(e)?parseFloat(e):e;"number"==typeof(e=Ge.reduce((e,r)=>r(t,e,this),e))?e=new ze(e):He.has(t)&&ve.isColor(e)?e=new ve(e):e.constructor===Array&&(e=new Ye(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 function(t,e){return new Me(Pt((e||Ut.document).querySelectorAll(t),function(t){return Wt(t)}))}(t,this.node)},findOne:function(t){return Wt(this.node.querySelector(t))}}),Jt($e,"Dom");var We=class extends $e{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 ze(t).plus(this.x()))}dy(t=0){return this.y(new ze(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,r=this.root(),n=r&&r.node;e||(t=t&&Gt(t).node);const i=new Me;let s=this;for(;(s=s.parent())&&s.node!==Ut.document&&"#document-fragment"!==s.node.nodeName&&(i.push(s),e||s.node!==t)&&(!e||!s.matches(t));)if(n&&s.node===n)return null;return i}reference(t){if(!(t=this.attr(t)))return null;const e=function(t,e){const r=Ae(e);return r?Pe(t.getRootNode(),r):null}(this.node,t);return e?Gt(e):null}root(){const t=this.parent(Yt[zt]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=Lt(this,t,e);return this.width(new ze(r.width)).height(new ze(r.height))}width(t){return this.attr("width",t)}writeDataToDom(t){return((t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))})(this,this.dom,t),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}};te(We,{bbox:function(){const t=_e(this,t=>t.getBBox(),t=>{try{const e=t.clone().addTo(Oe().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 Ee(t)},rbox:function(t){const e=_e(this,t=>t.getBoundingClientRect(),t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)}),r=new Ee(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 we(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Ne(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 Ne(e)}return new Ne(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new Ne}}}),Jt(We,"Element");const qe={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 ve||ve.isRgb(e)||e instanceof We)this.attr(t,e);else for(r=qe[t].length-1;r>=0;r--)null!=e[qe[t][r]]&&this.attr(qe.prefix(t,qe[t][r]),e[qe[t][r]]);return this},d(["Element","Runner"],e)}),d(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Ne(this):this.attr("transform",new Ne(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)}}),d("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new ze(t)):this.rx(t).ry(e)}}),d("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new we(this.node.getPointAtLength(t))}}),d(["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)}}),d("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},{})),d("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(oe).slice(0,-1).map(function(t){const e=t.trim().split("(");return[e[0].trim(),e[1].split(fe).map(function(t){return parseFloat(t)})]}).reverse().reduce(function(t,e){return"matrix"===e[0]?t.lmultiply(Ne.fromArray(e[1])):t[e[0]].apply(t,e[1])},new Ne)},toParent:function(t,e){if(this===t)return this;if(Vt(this.node))return this.addTo(t,e);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 Ne(this).decompose();return null==t?e:e[t]}Ne.isMatrixLike(t)||(t={...t,origin:Dt(t,this)});const r=new Ne(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});var Je=class t extends We{flatten(){return this.each(function(){if(this instanceof t)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()}};Jt(Je,"Container");var Qe=class extends Je{constructor(t,e=t){super($t("defs",t),e)}flatten(){return this}ungroup(){return this}};Jt(Qe,"Defs");var Ke=class extends We{};Jt(Ke,"Shape");var Ze=c({cx:()=>ir,cy:()=>sr,height:()=>ar,rx:()=>tr,ry:()=>er,width:()=>or,x:()=>rr,y:()=>nr});function tr(t){return this.attr("rx",t)}function er(t){return this.attr("ry",t)}function rr(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function nr(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function ir(t){return this.attr("cx",t)}function sr(t){return this.attr("cy",t)}function or(t){return null==t?2*this.rx():this.rx(new ze(t).divide(2))}function ar(t){return null==t?2*this.ry():this.ry(new ze(t).divide(2))}var ur=class extends Ke{constructor(t,e=t){super($t("ellipse",t),e)}size(t,e){const r=Lt(this,t,e);return this.rx(new ze(r.width).divide(2)).ry(new ze(r.height).divide(2))}};te(ur,Ze),d("Container",{ellipse:ee(function(t=0,e=t){return this.put(new ur).size(t,e).move(0,0)})}),Jt(ur,"Ellipse");var cr=class extends $e{constructor(t=Ut.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 $e(Ht("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}};Jt(cr,"Fragment");var hr=c({from:()=>lr,to:()=>dr});function lr(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new ze(t),fy:new ze(e)}):this.attr({x1:new ze(t),y1:new ze(e)})}function dr(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new ze(t),cy:new ze(e)}):this.attr({x2:new ze(t),y2:new ze(e)})}var fr=class extends Je{constructor(t,e){super($t(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 Ee}targets(){return Ce(this.node,"fill")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};te(fr,hr),d({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:ee(function(t,e){return this.put(new fr(t)).update(e)})}}),Jt(fr,"Gradient");var mr=class extends Je{constructor(t,e=t){super($t("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new Ee}targets(){return Ce(this.node,"fill")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};d({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:ee(function(t,e,r){return this.put(new mr).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})})}}),Jt(mr,"Pattern");var pr,yr=class extends Ke{constructor(t,e=t){super($t("image",t),e)}load(t,e){if(!t)return this;const r=new Ut.window.Image;return Fe(r,"load",function(t){const n=this.parent(mr);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof mr&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)},this),Fe(r,"load error",function(){ke(r)}),this.attr("href",r.src=t,Bt)}};pr=function(t,e,r){return"fill"!==t&&"stroke"!==t||de.test(e)&&(e=r.root().defs().image(e)),e instanceof yr&&(e=r.root().defs().pattern(0,0,t=>{t.add(e)})),e},Ge.push(pr),d({Container:{image:ee(function(t,e){return this.put(new yr).size(0,0).load(t,e)})}}),Jt(yr,"Image");var gr=class extends Ye{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 Ee(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(fe).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){Ne.isMatrixLike(t)||(t=new Ne(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}},br=c({MorphArray:()=>vr,height:()=>Or,width:()=>Nr,x:()=>wr,y:()=>xr});const vr=gr;function wr(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function xr(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Nr(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function Or(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}var Sr=class extends Ke{constructor(t,e=t){super($t("line",t),e)}array(){return new gr([[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 gr(t).toLine(),this.attr(t))}size(t,e){const r=Lt(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}};te(Sr,br),d({Container:{line:ee(function(...t){return Sr.prototype.plot.apply(this.put(new Sr),null!=t[0]?t:[0,0,0,0])})}}),Jt(Sr,"Line");var Er=class extends Je{constructor(t,e=t){super($t("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 _r(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}d({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:ee(function(t,e,r){return this.put(new Er).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 Er?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),Jt(Er,"Marker");const Mr={"-":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}}};var Tr=class{done(){return!1}},Ar=class extends Tr{constructor(t=">"){super(),this.ease=Mr[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}},Pr=class extends Tr{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}};function Cr(){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}te(class extends Pr{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:_r("_duration",Cr),overshoot:_r("_overshoot",Cr)}),te(class extends Pr{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:_r("_windup"),p:_r("P"),i:_r("I"),d:_r("D")});const jr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ir={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]]}},Lr="mlhvqtcsaz".split("");for(let t=0,e=Lr.length;t<e;++t)Ir[Lr[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 Ir[t](e,r,n)}}(Lr[t].toUpperCase());function Dr(t){return t.segment.length&&t.segment.length-1===jr[t.segment[0].toUpperCase()]}function Rr(t,e){t.inNumber&&Vr(t,!1);const r=me.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase();t.segment=["m"===r?e===r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function Vr(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,Dr(t)&&Fr(t)}function Fr(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){return Ir[t.segment[0]](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function kr(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 Br(t){return"E"===t.lastToken.toUpperCase()}const Ur=new Set([" ",",","\t","\n","\r","\f"]);var Xr=class extends Ye{bbox(){return Oe().path.setAttribute("d",this.toString()),new Ee(Oe.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 we,p:new we};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!Rr(i,n))if("."!==n)if(isNaN(parseInt(n)))if(Ur.has(n))i.inNumber&&Vr(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(me.test(n)){if(i.inNumber)Vr(i,!1);else{if(!Dr(i))throw new Error("parser Error");Fr(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Br(i)){Vr(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||kr(i)){i.inNumber=!0,i.number=n,Vr(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){Vr(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&Vr(i,!1),i.inSegment&&Dr(i)&&Fr(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 Yr=t=>{const e=typeof t;return"number"===e?ze:"string"===e?ve.isColor(t)?ve:fe.test(t)?me.test(t)?Xr:Ye:re.test(t)?ze:Hr:qr.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Ye:"object"===e?Wr:Hr};var zr=class{constructor(t){this._stepper=t||new Ar("-"),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(Yr(t));let e=new this._type(t);return this._type===ve&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Wr&&(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}},Hr=class{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}},Gr=class t{constructor(...t){this.init(...t)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,t.defaults,e),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}};Gr.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const $r=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;var Wr=class{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]===ve&&t[r+7]!==e[r+7]){const e=t[r+7],n=new ve(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=Yr(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort($r),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();t[r]=new n(e.splice(0,i))}return t}};const qr=[Hr,Gr,Wr];var Jr=class extends Ke{constructor(t,e=t){super($t("path",t),e)}array(){return this._array||(this._array=new Xr(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 Xr(t))}size(t,e){const r=Lt(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)}};Jr.prototype.MorphArray=Xr,d({Container:{path:ee(function(t){return this.put(new Jr).plot(t||new Xr)})}}),Jt(Jr,"Path");var Qr=c({array:()=>Kr,clear:()=>Zr,move:()=>tn,plot:()=>en,size:()=>rn});function Kr(){return this._array||(this._array=new gr(this.attr("points")))}function Zr(){return delete this._array,this}function tn(t,e){return this.attr("points",this.array().move(t,e))}function en(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new gr(t))}function rn(t,e){const r=Lt(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}var nn=class extends Ke{constructor(t,e=t){super($t("polygon",t),e)}};d({Container:{polygon:ee(function(t){return this.put(new nn).plot(t||new gr)})}}),te(nn,br),te(nn,Qr),Jt(nn,"Polygon");var sn=class extends Ke{constructor(t,e=t){super($t("polyline",t),e)}};d({Container:{polyline:ee(function(t){return this.put(new sn).plot(t||new gr)})}}),te(sn,br),te(sn,Qr),Jt(sn,"Polyline");var on=class extends Ke{constructor(t,e=t){super($t("rect",t),e)}};te(on,{rx:tr,ry:er}),d({Container:{rect:ee(function(t,e){return this.put(new on).size(t,e)})}}),Jt(on,"Rect");var an=class{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 un={nextDraw:null,frames:new an,timeouts:new an,immediates:new an,timer:()=>Ut.window.performance||Ut.window.Date,frame(t){const e=un.frames.push({run:t});return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),e},timeout(t,e){e=e||0;const r=un.timer().now()+e,n=un.timeouts.push({run:t,time:r});return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),n},immediate(t){const e=un.immediates.push(t);return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),e},cancelFrame(t){null!=t&&un.frames.remove(t)},clearTimeout(t){null!=t&&un.timeouts.remove(t)},cancelImmediate(t){null!=t&&un.immediates.remove(t)},_draw(t){try{let e=null;const r=un.timeouts.last();for(;(e=un.timeouts.shift())&&(t>=e.time?e.run():un.timeouts.push(e),e!==r););let n=null;const i=un.frames.last();for(;n!==i&&(n=un.frames.shift());)n.run(t);let s=null;for(;s=un.immediates.shift();)s()}finally{const t=un.timeouts.first()||un.frames.first()||un.immediates.first();un.nextDraw=t?Ut.window.requestAnimationFrame(un._draw):null}}},cn=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},hn=function(){const t=Ut.window;return(t.performance||t.Date).now()};var ln=class extends Be{constructor(t=hn){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){this._finishing=!0;try{this.time(this.getEndTimeOfTimeline()+1)}finally{this._finishing=!1}return 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(cn);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),t._retired=!1;const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,t._runnerInfo=o,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),t._runnerInfo=null,t._retired=!0),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return un.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=un.frame(this._step)),this)}_stepFn(t=!1){const e=this._generation,r=this._timeSource();let n=r-this._lastSourceTime;t&&(n=0);const i=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=r,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);const s=this._runners.slice();for(let t=s.length;t--;){const e=s[t];if(e.runner._runnerInfo!==e)continue;const r=e.runner;this._time-e.start<0&&r.reset(!0)}let o=!1;for(const t of this._runners.slice()){if(t.runner._runnerInfo!==t)continue;const e=t.runner;let r=i;const n=this._time-t.start;if(n<0){o=!0;continue}if(0===n){e.reset(),o=!0;continue}if(n<r&&(r=n),!e.active())continue;const s=(this._finishing&&e._isDeclarative?e.finish():e.step(r)).done;e._runnerInfo===t&&(s?!0!==t.persist&&e.duration()-e.time()+this._time+t.persist<=this._time&&e.unschedule():o=!0)}return e!==this._generation||(o||(o=this._runners.some(({start:t,runner:e})=>t>=this._time||e.active()&&!e.done)),o&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished"))),this}terminate(){un.cancelFrame(this._nextFrame),this._generation=(this._generation||0)+1,this._startTime=0,this._speed=1,this._persist=0;for(const{runner:t}of this._runners||[])t._retired=!0,t._runnerInfo=null;this._nextFrame=null,this._paused=!0,this._finishing=!1,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)}};d({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new ln,this._timeline):(this._timeline=t,this)}}});var dn=class t extends Be{constructor(e){super(),this.id=t.id++,e="function"==typeof(e=e??400)?new Pr(e):e,this._element=null,this._timeline=null,this._runnerInfo=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof Pr,this._stepper=this._isDeclarative?e:new Ar,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Ne,this._isAbsoluteTransform=!1,this._hasTransform=!1,this._transformInitialised=!1,this._transformActive=!1,this._retired=!1,this._reverse=!1,this._swing=!1,this._wait=0,this._times=1,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 Tr||(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){return this.transforms.lmultiplyO(t),this._transformInitialised=!0,this._transformActive=!0,this}after(t){return this.on("finished",t)}animate(e,r,n){const i=t.sanitise(e,r,n),s=new t(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new Ne,this}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 Ar(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){if(!this._isDeclarative)return this.time(this.duration());const t=this._time;return this.step(1/0),this._time=t,this}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()),c=s&&u%2==0;return a=u+(c&&!o||o&&c?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._isDeclarative&&(this.done=!1),this._queue.push({initialiser:t||Ue,runner:e||Ue,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(t=!1){if(this._reseted){const e=!t&&this._hasTransform&&0!==this.position();return e&&!this._transformInitialised?(this.step(0),this._reseted=!0,this):(e!==this._transformActive&&(this._transformActive=e,this._element&&this._element._addRunner(this)),this)}return this._reseted||(this.time(0),this._reseted=!0),t&&this._transformActive&&(this._transformActive=!1,this._element&&this._element._addRunner(this)),this}reverse(t){return this._reverse=t??!this._reverse,this}schedule(t,e,r){if(t instanceof ln||(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;const e=this.done;t=t??16,this._time+=t;const r=this.position(),n=this._lastPosition!==r&&this._time>=0;this._lastPosition=r;const i=this.duration(),s=this._lastTime<=0&&this._time>0;this._lastTime=this._time,s&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&this._time>=i,this._reseted=!1;const a=this._hasTransform&&(this._time>0||0!==r);this._transformActive=a;let u=!1;return(n||o)&&(this._initialise(n),this.transforms=new Ne,u=this._run(o?t:r),this._transformActive=a,this.fire("step",this)),this.done=this.done||u&&o,this.done&&!e&&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];if(this._isDeclarative&&n.finished&&!n.isTransform)continue;const 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,this._isDeclarative&&(this.done=!1);const n=this.timeline();return n&&n.play(),!0}return!1}};dn.id=0;var fn=class{constructor(t=new Ne,e=-1,r=!0,n=!1){this.transforms=t,this.id=e,this.done=r,this._isAbsoluteTransform=n,this._transformActive=!0,this._retired=!0}};te([dn,fn],{mergeWith(t){return new fn(this._isAbsoluteTransform?this.transforms:t.transforms.lmultiply(this.transforms),t.id,!0,t._isAbsoluteTransform||this._isAbsoluteTransform)}});const mn=(t,e)=>t.lmultiplyO(e),pn=t=>t.transforms,yn=t=>t._transformActive;function gn(t){const e=t.filter(yn);let r=0;for(let t=0;t<e.length;++t)e[t]._isAbsoluteTransform&&(r=t);return e.slice(r)}function bn(){const t=gn(this._transformationRunners.runners).map(pn).reduce(mn,new Ne);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}var vn=class{constructor(){this.runners=[]}add(t){var e;if(!(0,At.default)(e=this.runners).call(e,t))return this.runners.push(t),this}edit(t,e){const r=this.runners.findIndex(e=>e.id===t);return r>=0&&this.runners.splice(r,1,e),this}getByID(t){return this.runners.find(e=>e.id===t)}length(){return this.runners.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._retired&&t._retired){this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}else t=r}return this}remove(t){const e=this.runners.findIndex(e=>e.id===t);return e>=0&&this.runners.splice(e,1),this}};d({Element:{animate(t,e,r){const n=dn.sanitise(t,e,r),i=this.timeline();return new dn(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_currentTransform(t){const e=this._transformationRunners.runners,r=e.indexOf(t);return gn(e.slice(0,r+1)).map(pn).reduce(mn,new Ne)},_addRunner(t){1===this._transformationRunners.length()&&-1===this._transformationRunners.runners[0].id&&(this._transformationRunners.runners[0].transforms=new Ne(this)),this._transformationRunners.add(t),un.cancelImmediate(this._frameId),this._frameId=un.immediate(bn.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new vn).add(new fn(new Ne(this))))}}}),te(dn,{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});const n=e,i=this._history[t];if(i&&!i.caller.initialised&&i.caller.retarget)return i.caller.retarget.call(this,n),this;if(this._tryRetarget(t,n))return this;let s=new zr(this._stepper).to(n),o=Object.keys(n);return this.queue(function(){s=s.from(this.element()[t](o))},function(e){return this.element()[t](s.at(e).valueOf()),s.done()},function(e){const r=(n=Object.keys(e),i=o,n.filter(t=>!(0,At.default)(i).call(i,t)));var n,i;if(r.length&&null!=s.from()){const e=this.element()[t](r),n=new Wr(s.from()).valueOf();Object.assign(n,e),s.from(n)}const a=new Wr(s.to()).valueOf();Object.assign(a,e),s.to(a),o=Object.keys(a)}),this._rememberMorpher(t,s),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new zr(this._stepper).to(new ze(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._hasTransform=!0,this._isAbsoluteTransform=this._isAbsoluteTransform||!e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Ne.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new zr(this._stepper).type(r?Gr:Ne),s=r?new zr(this._stepper).type(Ne):i;let o,a,u,c,h;return this.queue(function(){a=a||this.element(),o=o||Dt(t,a),h=new Ne(e?void 0:a),a._addRunner(this)},function(l){e||this.clearTransform();const{x:d,y:f}=new we(o).transform(a._currentTransform(this)),m={...t,origin:[d,f]};!0===m.relative&&delete m.relative;let p=new Ne(m),y=this._isDeclarative&&u?u:h,g=i;if(r){const t=p.decompose(d,f),e=y.decompose(d,f);if(new Gr(t).toArray().concat(new Gr(e).toArray()).every(Number.isFinite)){p=t,y=e;const r=p.rotate,n=y.rotate,i=[r-360,r,r+360],s=i.map(t=>Math.abs(t-n)),o=Math.min(...s),a=s.indexOf(o);p.rotate=i[a]}else g=s}e&&g===i&&(n||(p.rotate=t.rotate||0),this._isDeclarative&&c&&(y.rotate=c)),g.from(y),g.to(p);const b=g.at(l);return c=b.rotate,u=new Ne(b),this.addTransform(u),a._addRunner(this),g.done()},function(e){o=Dt(e,a),t={...e}},!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 ze(e),this._tryRetarget(t,e))return this;const r=new zr(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 ze(t))}),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new zr(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 ze(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){const r=Lt(this._element,t,e);return this.width(r.width).height(r.height)},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 zr(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 Ee(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)}}),te(dn,{rx:tr,ry:er,from:lr,to:dr}),Jt(dn,"Runner");var wn=class extends Je{constructor(t,e=t){super($t("svg",t),e),this.namespace()}defs(){return this.isRoot()?Wt(this.node.querySelector("defs"))||this.put(new Qe):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof Ut.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:Ft,version:"1.1"}).attr("xmlns:xlink",Bt,kt):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,kt).attr("xmlns:svgjs",null,kt)}root(){return this.isRoot()?this:super.root()}};d({Container:{nested:ee(function(){return this.put(new wn)})}}),Jt(wn,"Svg",!0);var xn=class extends Je{constructor(t,e=t){super($t("symbol",t),e)}};d({Container:{symbol:ee(function(){return this.put(new xn)})}}),Jt(xn,"Symbol");var Nn=c({amove:()=>In,ax:()=>Cn,ay:()=>jn,build:()=>Ln,center:()=>Pn,cx:()=>Tn,cy:()=>An,length:()=>Sn,move:()=>Mn,plain:()=>On,x:()=>En,y:()=>_n});function On(t){return!1===this._build&&this.clear(),this.node.appendChild(Ut.document.createTextNode(t)),this}function Sn(){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 _n(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function Mn(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function Tn(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function An(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function Pn(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function Cn(t){return this.attr("x",t)}function jn(t){return this.attr("y",t)}function In(t,e){return this.ax(t).ay(e)}function Ln(t){return this._build=!!t,this}var Dn=class extends Ke{constructor(t,e=t){super($t("text",t),e),this.dom.leading=this.dom.leading??new ze(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new ze(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){if(Vt(this.node))return;const i=Ut.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new ze(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 ze(t.leading||1.3),this}writeDataToDom(){return super.writeDataToDom({leading:1.3})}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||Vt(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===Wt(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);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()}};te(Dn,Nn),d({Container:{text:ee(function(t=""){return this.put(new Dn).text(t)}),plain:ee(function(t=""){return this.put(new Dn).plain(t)})}}),Jt(Dn,"Text");var Rn=class extends Ke{constructor(t,e=t){super($t("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 Dn))return this;const e=t.index(this),r=Ut.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new ze(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)}};te(Rn,Nn),d({Tspan:{tspan:ee(function(t=""){const e=new Rn;return this._build||this.clear(),this.put(e).text(t)})},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Jt(Rn,"Tspan");var Vn=class extends Ke{constructor(t,e=t){super($t("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 ze(t).divide(2))}};te(Vn,{x:rr,y:nr,cx:ir,cy:sr,width:or,height:ar}),d({Container:{circle:ee(function(t=0){return this.put(new Vn).size(t).move(0,0)})}}),Jt(Vn,"Circle");var Fn=class extends Je{constructor(t,e=t){super($t("clipPath",t),e)}remove(){return this.targets().forEach(function(t){t.unclip()}),super.remove()}targets(){return Ce(this.node,"clip-path")}};d({Container:{clip:ee(function(){return this.defs().put(new Fn)})},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Fn?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Jt(Fn,"ClipPath");var kn=class extends We{constructor(t,e=t){super($t("foreignObject",t),e)}};d({Container:{foreignObject:ee(function(t,e){return this.put(new kn).size(t,e)})}}),Jt(kn,"ForeignObject");var Bn=c({dmove:()=>Un,dx:()=>Xn,dy:()=>Yn,height:()=>zn,move:()=>Hn,size:()=>Gn,width:()=>$n,x:()=>Wn,y:()=>qn});function Un(t,e){return this.children().forEach(r=>{let n;try{n=r.node instanceof Ut.window.SVGSVGElement?new Ee(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new Ne(r),s=i.translate(t,e).transform(i.inverse()),o=new we(n.x,n.y).transform(s);r.dmove(o.x-n.x,o.y-n.y)}),this}function Xn(t){return this.dmove(t,0)}function Yn(t){return this.dmove(0,t)}function zn(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function Hn(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function Gn(t,e,r=this.bbox()){const n=Lt(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(t=>{const e=new we(r).transform(new Ne(t).inverse());t.scale(i,s,e.x,e.y)}),this}function $n(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function Wn(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function qn(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}var Jn=class extends Je{constructor(t,e=t){super($t("g",t),e)}};te(Jn,Bn),d({Container:{group:ee(function(){return this.put(new Jn)})}}),Jt(Jn,"G");var Qn=class extends Je{constructor(t,e=t){super($t("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,Bt)}};te(Qn,Bn),d({Container:{link:ee(function(t){return this.put(new Qn).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 Qn,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}}}),Jt(Qn,"A");var Kn=class extends Je{constructor(t,e=t){super($t("mask",t),e)}remove(){return this.targets().forEach(function(t){t.unmask()}),super.remove()}targets(){return Ce(this.node,"mask")}};d({Container:{mask:ee(function(){return this.defs().put(new Kn)})},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Kn?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Jt(Kn,"Mask");var Zn=class extends We{constructor(t,e=t){super($t("stop",t),e)}update(t){return("number"==typeof t||t instanceof ze)&&(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 ze(t.offset)),this}};d({Gradient:{stop:function(t,e,r){return this.put(new Zn).update(t,e,r)}}}),Jt(Zn,"Stop");var ti=class extends We{constructor(t,e=t){super($t("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+=jt(t)+":"+e[t]+";";return r+="}",r}(t,e))}};d("Dom",{style(t,e){return this.put(new ti).rule(t,e)},fontface(t,e,r){return this.put(new ti).font(t,e,r)}}),Jt(ti,"Style");var ei=class extends Dn{constructor(t,e=t){super($t("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")}};d({Container:{textPath:ee(function(t,e){return t instanceof Dn||(t=this.text(t)),t.path(e)})},Text:{path:ee(function(t,e=!0){const r=new ei;let n;if(t instanceof Jr||(t=this.defs().path(t)),r.attr("href","#"+t,Bt),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)}),textPath(){return this.findOne("textPath")}},Path:{text:ee(function(t){return t instanceof Dn||(t=(new Dn).addTo(this.parent()).text(t)),t.path(this)}),targets(){return Ce(this.node,"href","textPath")}}}),ei.prototype.MorphArray=Xr,Jt(ei,"TextPath");var ri=class extends Ke{constructor(t,e=t){super($t("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,Bt)}};d({Container:{use:ee(function(t,e){return this.put(new ri).use(t,e)})}}),Jt(ri,"Use"),te([wn,xn,yr,mr,Er],f("viewbox")),te([Sr,sn,nn,Jr],f("marker")),te(Dn,f("Text")),te(Jr,f("Path")),te(Qe,f("Defs")),te([Dn,Rn],f("Tspan")),te([on,ur,fr,dn],f("radius")),te(Be,f("EventTarget")),te($e,f("Dom")),te(We,f("Element")),te(Ke,f("Shape")),te([Je,cr],f("Container")),te(fr,f("Gradient")),te(dn,f("Runner")),Me.extend([...new Set(l)]),function(t=[]){qr.push(...[].concat(t))}([ze,ve,Ee,Ne,Ye,gr,Xr,we]),te(qr,{to(t){return(new zr).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 ni,ii,si,oi,ai=r(726),ui=r(725),ci=r(854),hi=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const li=["basePadding1","basePadding2"],di={basePadding1:"setBasePadding1",basePadding2:"setBasePadding2"};class fi{static between(t,e){let r=(new Sr).node,n=new fi(r,t,e);return n.assignUUID(),n.set(fi.defaultValues),n.reposition(),n}constructor(t,e,r){ni.add(this),this.line=t,this.base1=e,this.base2=r,ii.set(this,{change:[]}),si.set(this,new MutationObserver(()=>hi(this,ni,"m",oi).call(this,"change"))),this.domNode.dataset.basePadding1||(this.domNode.dataset.basePadding1=`${(0,ui.distance)(this.point1,this.base1.centerPoint)}`),this.domNode.dataset.basePadding2||(this.domNode.dataset.basePadding2=`${(0,ui.distance)(this.point2,this.base2.centerPoint)}`),e.centerPoint.addEventListener("move",()=>this.reposition()),r.centerPoint.addEventListener("move",()=>this.reposition()),hi(this,si,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get basePair(){return[this.base1,this.base2]}get domNode(){return this.line}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){if((0,ci.isNonNullObject)(t))try{new Sr(this.domNode).attr(t)}catch{}}get id(){return this.domNode.id}assignUUID(){(0,ai.assignUUID)(this.domNode)}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}isIn(t){return t.contains(this.domNode)&&t!==this.domNode}hasParent(){return!!this.domNode.parentNode}getTotalLength(){return this.domNode.getTotalLength()}get length(){return this.getTotalLength()}getPointAtLength(t){t<0?t=0:t>this.length&&(t=this.length);let e=this.domNode.getPointAtLength(t);return{x:e.x,y:e.y,direction:this.direction}}atLength(t){return this.getPointAtLength(t)}get point1(){return{x:this.domNode.x1.baseVal.value,y:this.domNode.y1.baseVal.value}}get point2(){return{x:this.domNode.x2.baseVal.value,y:this.domNode.y2.baseVal.value}}get direction(){return(0,ui.direction)(this.point1,this.point2)}get basePadding1(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.basePadding1)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set basePadding1(t){this.domNode.dataset.basePadding1=`${t}`,this.reposition()}setBasePadding1(t){(0,ci.isFiniteNumber)(t)&&(this.basePadding1=Math.max(0,t))}get basePadding2(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.basePadding2)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set basePadding2(t){this.domNode.dataset.basePadding2=`${t}`,this.reposition()}setBasePadding2(t){(0,ci.isFiniteNumber)(t)&&(this.basePadding2=Math.max(0,t))}isInverted(){return this.basePadding1+this.basePadding2>(0,ui.distance)(this.base1.centerPoint,this.base2.centerPoint)}set(t){try{this.setAttributes(t.attributes)}catch{}li.forEach(e=>{try{this[di[e]](t[e])}catch{}})}reposition(){let t=this.base1.centerPoint,e=this.base2.centerPoint,r=(0,ui.direction)(t,e);this.setAttribute("x1",`${t.x+this.basePadding1*Math.cos(r)}`),this.setAttribute("y1",`${t.y+this.basePadding1*Math.sin(r)}`),this.setAttribute("x2",""+(e.x-this.basePadding2*Math.cos(r))),this.setAttribute("y2",""+(e.y-this.basePadding2*Math.sin(r)))}addEventListener(t,e){hi(this,ii,"f")[t].push(e)}removeEventListener(t,e){hi(this,ii,"f")[t]=hi(this,ii,"f")[t].filter(t=>t!==e)}serialized(){let t=this.id;if(!t)throw new Error("Straight bond ID is falsy.");let e=this.base1.id;if(!e)throw new Error("Base 1 ID is falsy.");let r=this.base2.id;if(!r)throw new Error("Base 2 ID is falsy.");return{id:t,baseID1:e,baseID2:r}}static deserialized(t,e){var r,n,i;if(!(0,ci.isNonNullObject)(t))throw new Error("Saved straight bond must be an object.");let s=null!==(r=t.id)&&void 0!==r?r:t.lineId;if(!s)throw new Error("Straight bond ID is missing.");let o=e.domNode.querySelector("#"+s);if(!o)throw new Error("Unable to find straight bond DOM node.");if(!(o instanceof SVGLineElement))throw new Error("Straight bond DOM node must be an SVG line element.");let a=null!==(n=t.baseID1)&&void 0!==n?n:t.baseId1,u=null!==(i=t.baseID2)&&void 0!==i?i:t.baseId2;if(!a)throw new Error("Missing base 1 ID.");if(!u)throw new Error("Missing base 2 ID.");let c=[...e.bases].find(t=>t.id===a),h=[...e.bases].find(t=>t.id===u);if(!c)throw new Error("Unable to find base 1.");if(!h)throw new Error("Unable to find base 2.");let l=new fi(o,c,h);return(0,ci.isNumber)(t.basePadding1)&&(l.basePadding1=t.basePadding1),(0,ci.isNumber)(t.basePadding2)&&(l.basePadding2=t.basePadding2),l}static recreate(t,e){return fi.deserialized(t,e)}}ii=new WeakMap,si=new WeakMap,ni=new WeakSet,oi=function(t){hi(this,ii,"f")[t].forEach(t=>t())},fi.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6};var mi,pi,yi,gi,bi=r(801),vi=r(127),wi=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class xi{constructor(t){mi.add(this),pi.set(this,void 0),yi.set(this,new MutationObserver(()=>wi(this,mi,"m",gi).call(this))),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,pi,t),wi(this,yi,"f").observe(t.domNode,{childList:!0,subtree:!0})}}pi=new WeakMap,yi=new WeakMap,mi=new WeakSet,gi=function(){let t=[...wi(this,pi,"f").bases],e=new Map;t.forEach(t=>e.set(t,new Set)),[...wi(this,pi,"f").primaryBonds].forEach(t=>{var r,n;null===(r=e.get(t.base1))||void 0===r||r.add(t.base2),null===(n=e.get(t.base2))||void 0===n||n.add(t.base1)}),(0,vi.consecutivePairs)(t).forEach(([t,r])=>{var n;(null===(n=e.get(t))||void 0===n?void 0:n.has(r))||wi(this,pi,"f").addPrimaryBond(t,r)})};class Ni{constructor(t,e){this.targetStraightBonds=t,new MutationObserver(t=>{let e=new Set([...this.targetStraightBonds].map(t=>t.domNode));!t.some(t=>e.has(t.target))||this.updateOpacities()}).observe(e,{attributes:!0,attributeFilter:["x1","y1","x2","y2"],subtree:!0})}updateOpacities(){[...this.targetStraightBonds].forEach(t=>{let e=t.isInverted()?"0":"1";t.setAttribute("opacity",e)})}}})(),n})(),t.exports=e()},742(t){var e;e=()=>(()=>{var t={645(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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 matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}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)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get centerX(){return this.minX+this.width/2}get centerY(){return this.minY+this.height/2}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(...r){let n=(0,t.max)([this.width,this.height]),i="number"==typeof r[0]?r[0]:r[0].factor*n,s="number"==typeof r[1]?r[1]:i;return new e(this.x-i,this.y-s,this.width+2*i,this.height+2*s)}peripheralPoint(t){let e=this.width/2,r=this.height/2,n=Math.pow(Math.pow(e,2)+Math.pow(r,2),.5),i=this.centerX+n*Math.cos(t),s=this.centerY+n*Math.sin(t),o=n;return Math.abs(this.centerX-i)>e&&(o=Math.abs(e/Math.cos(t)),o=Number.isFinite(o)?o:r),Math.abs(this.centerY-s)>r&&(o=Math.abs(r/Math.sin(t)),o=Number.isFinite(o)?o:e),{x:this.centerX+o*Math.cos(t),y:this.centerY+o*Math.sin(t)}}}})(),n})(),t.exports=e()},731(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,{CenterPoint:()=>c});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver(()=>u(this,r,"m",o).call(this,"move")),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter(t=>t!==e)}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach(t=>t())},e})(),t.exports=e()},726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>s,CoordinateSystem:()=>b,HorizontalClientScaling:()=>w,InnerXML:()=>_,OuterXML:()=>A,Path:()=>i,Scaling:()=>v,VerticalClientScaling:()=>x,assignUUID:()=>g,bringToFront:()=>N,drawOnCanvas:()=>L,isSVGGraphicsElement:()=>P,isSVGGraphicsElementsArray:()=>j,sendToBack:()=>O,setAttributes:()=>c});var t,e=r(725);class i{constructor(t){this.domNode=t}closestPoint(t,r){var n;let i=this.domNode.getPointAtLength(0),s={x:i.x,y:i.y,length:0},o=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;if(o<=0)throw new Error(`Precision must be positive: ${o}.`);let a=this.domNode.getTotalLength();for(let r=o;r<=a;r+=o){let n=this.domNode.getPointAtLength(r);(0,e.distance)(t,n)<(0,e.distance)(t,s)&&(s={x:n.x,y:n.y,length:r})}return s}}class s{constructor(e){t.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}closestPoint(e,r){var n;let s=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;return document.body.contains(a)||document.body.append(a),u.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,t)),new i(u).closestPoint(e,{precision:s})}}t=new WeakMap;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox","0 0 100 100"),o.setAttribute("width","100"),o.setAttribute("height","100");const a=document.createElement("div");a.append(o),a.style.height="0px",a.style.position="fixed",document.body.append(a);const u=document.createElementNS("http://www.w3.org/2000/svg","path");function c(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}u.setAttribute("stroke","black"),u.setAttribute("stroke-width","1"),o.append(u);const h={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var l,d=new Uint8Array(16);function f(){if(!l&&!(l="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(d)}for(var m=[],p=0;p<256;++p)m.push((p+256).toString(16).slice(1));const y=function(t,e,r){if(h.randomUUID&&!e&&!t)return h.randomUUID();var n=(t=t||{}).random||(t.rng||f)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return function(t,e=0){return(m[t[e+0]]+m[t[e+1]]+m[t[e+2]]+m[t[e+3]]+"-"+m[t[e+4]]+m[t[e+5]]+"-"+m[t[e+6]]+m[t[e+7]]+"-"+m[t[e+8]]+m[t[e+9]]+"-"+m[t[e+10]]+m[t[e+11]]+m[t[e+12]]+m[t[e+13]]+m[t[e+14]]+m[t[e+15]]).toLowerCase()}(n)};function g(t){t.id="uuid-"+y()}class b{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class v{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class w{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class x{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function N(t){let e=t.parentNode;e&&e.appendChild(t)}function O(t){let e=t.parentNode;e&&e.prepend(t)}var S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){S.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,S,t)}toString(){return E(this,S,"f").innerHTML}set(t){E(this,S,"f").innerHTML=t}}S=new WeakMap;var M,T=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class A{constructor(t){M.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,M,t)}toString(){return T(this,M,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=T(this,M,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...T(this,M,"f").attributes].forEach(t=>T(this,M,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>T(this,M,"f").setAttribute(t.name,t.value)),T(this,M,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function P(t){return t instanceof SVGGraphicsElement}M=new WeakMap;var C=r(854);function j(t){return(0,C.isArray)(t)&&t.every(P)}var I=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(t){try{u(n.next(t))}catch(t){s(t)}}function a(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,a)}u((n=n.apply(t,e||[])).next())})};function L(t){return I(this,void 0,void 0,function*(){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),yield i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e})}})(),n})(),t.exports=e()},725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()},277(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,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}}return e})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Numbering:()=>E,NumberingLine:()=>F});var t,e=r(726),i=r(731),s=r(277),o=r(725),a=r(854),u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(e){if(t.set(this,void 0),!(0,a.isNonNullObject)(e))throw new Error("Saved numberings must be non-null objects.");!function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}get id(){if((0,a.isString)(u(this,t,"f").id))return u(this,t,"f").id;if((0,a.isString)(u(this,t,"f").textId))return u(this,t,"f").textId;throw new Error("Unable to find the ID of the saved numbering.")}get ownerID(){if((0,a.isString)(u(this,t,"f").ownerID))return u(this,t,"f").ownerID;throw new Error("Unable to find the owner ID of the saved numbering.")}get displacement(){return u(this,t,"f").displacement}}t=new WeakMap;var h,l,d,f,m,p,y,g,b,v,w,x,N,O=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},S=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};class E{static numbering(t,r){let n=document.createElementNS("http://www.w3.org/2000/svg","text");(0,e.assignUUID)(n),n.textContent=`${r}`;let i=new E(n,t);return i.setAttributes(E.defaultValues.attributes),i.displacement.magnitude=0,i}constructor(t,e){h.add(this),this.domNode=t,this.owner=e,l.set(this,{change:[]}),d.set(this,void 0),this.centerPoint=new i.CenterPoint(t),t.dataset.displacement||(t.dataset.displacement=JSON.stringify((0,o.displacement)(e.centerPoint,this.centerPoint))),e.centerPoint.addEventListener("move",()=>O(this,h,"m",f).call(this)),S(this,d,new MutationObserver(()=>O(this,h,"m",N).call(this,"change")),"f"),O(this,d,"f").observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}get id(){return this.domNode.id}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach(([t,e])=>this.setAttribute(t,e))}removeAttribute(t){this.domNode.removeAttribute(t)}get textContent(){return this.domNode.textContent}set textContent(t){this.domNode.textContent=t}get number(){return Number.parseFloat(this.textContent)}set number(t){this.textContent=`${t}`}get displacement(){const t=()=>O(this,h,"a",m),e=t=>{S(this,h,t,"a",p)},r=()=>O(this,h,"a",y),n=t=>{S(this,h,t,"a",g)},i=()=>O(this,h,"a",b),s=t=>{S(this,h,t,"a",v)},o=()=>O(this,h,"a",w),a=t=>{S(this,h,t,"a",x)};return{get x(){return t()},set x(t){e(t)},get y(){return r()},set y(t){n(t)},get magnitude(){return i()},set magnitude(t){s(t)},get direction(){return o()},set direction(t){a(t)}}}addEventListener(t,e){O(this,l,"f")[t].push(e)}removeEventListener(t,e){O(this,l,"f")[t]=O(this,l,"f")[t].filter(t=>t!==e)}serialized(){return{id:this.id,ownerID:this.owner.id}}static deserialized(t,e){let r=new c(t),n=e.domNode.querySelector("#"+r.id);if(!n)throw new Error("Numbering DOM node not found.");if(!(n instanceof SVGTextElement))throw new Error("Numbering DOM node must be an SVG text element.");let i=e.bases.find(t=>t.id===r.ownerID);if(!i)throw new Error("Unable to find numbering owner.");let s=new E(n,i);return(0,o.isPoint)(r.displacement)&&(s.displacement.x=r.displacement.x,s.displacement.y=r.displacement.y),s}static recreate(t,e){return E.deserialized(t,e)}}l=new WeakMap,d=new WeakMap,h=new WeakSet,f=function(){this.centerPoint.x=this.owner.centerPoint.x+O(this,h,"a",m),this.centerPoint.y=this.owner.centerPoint.y+O(this,h,"a",y)},m=function(){if(!this.domNode.dataset.displacement)return 0;let t;try{t=JSON.parse(this.domNode.dataset.displacement)}catch(t){return 0}return(0,o.isFinitePoint)(t)?t.x:0},p=function(t){this.domNode.dataset.displacement=JSON.stringify({x:t,y:O(this,h,"a",y)}),O(this,h,"m",f).call(this)},y=function(){if(!this.domNode.dataset.displacement)return 0;let t;try{t=JSON.parse(this.domNode.dataset.displacement)}catch(t){return 0}return(0,o.isFinitePoint)(t)?t.y:0},g=function(t){this.domNode.dataset.displacement=JSON.stringify({x:O(this,h,"a",m),y:t}),O(this,h,"m",f).call(this)},b=function(){return s.Vector.matching({x:O(this,h,"a",m),y:O(this,h,"a",y)}).magnitude},v=function(t){let e=s.Vector.matching({x:O(this,h,"a",m),y:O(this,h,"a",y)});e.magnitude=t,this.domNode.dataset.displacement=JSON.stringify({x:e.x,y:e.y}),O(this,h,"m",f).call(this)},w=function(){return s.Vector.matching({x:O(this,h,"a",m),y:O(this,h,"a",y)}).direction},x=function(t){let e=s.Vector.matching({x:O(this,h,"a",m),y:O(this,h,"a",y)});e.direction=t,this.domNode.dataset.displacement=JSON.stringify({x:e.x,y:e.y}),O(this,h,"m",f).call(this)},N=function(t){O(this,l,"f")[t].forEach(t=>t())},E.defaultValues={attributes:{"font-family":"Arial","font-size":"8","font-weight":"400",fill:"#808080"}};var _,M=r(645),T=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class A{constructor(t){if(_.set(this,void 0),!(0,a.isNonNullObject)(t))throw new Error("Saved numbering lines must be non-null objects.");!function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,_,t)}get id(){if((0,a.isString)(T(this,_,"f").id))return T(this,_,"f").id;if((0,a.isString)(T(this,_,"f").lineId))return T(this,_,"f").lineId;throw new Error("Unable to find saved numbering line ID.")}get ownerID(){if((0,a.isString)(T(this,_,"f").ownerID))return T(this,_,"f").ownerID;if((0,a.isString)(T(this,_,"f").textId))return T(this,_,"f").textId;throw new Error("Unable to find saved numbering line owner ID.")}get basePadding(){return T(this,_,"f").basePadding}get textPadding(){return void 0!==T(this,_,"f").numberingPadding?T(this,_,"f").numberingPadding:T(this,_,"f").textPadding}}_=new WeakMap;var P,C,j,I,L,D,R=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},V=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};class F{static connecting(t){let r=document.createElementNS("http://www.w3.org/2000/svg","line");(0,e.assignUUID)(r),r.setAttribute("x1",`${t.owner.centerPoint.x}`),r.setAttribute("y1",`${t.owner.centerPoint.y}`),r.setAttribute("x2",`${t.centerPoint.x}`),r.setAttribute("y2",`${t.centerPoint.y}`);let n=new F(r,t);return n.set(F.defaultValues),n}static unpadded(t){let e=F.connecting(t);return e.basePadding=0,e.textPadding=0,e}constructor(t,e){P.add(this),this.domNode=t,this.owner=e,t.dataset.basePadding||(t.dataset.basePadding=`${(0,o.distance)(e.owner.centerPoint,this.point1)}`);let r=M.Box.matching(e.domNode.getBBox());t.dataset.textPadding||(t.dataset.textPadding=`${(0,o.distance)(this.point2,r.peripheralPoint(e.displacement.direction+Math.PI))}`),e.centerPoint.addEventListener("move",()=>R(this,P,"m",D).call(this)),e.owner.centerPoint.addEventListener("move",()=>R(this,P,"m",D).call(this))}get id(){return this.domNode.id}hasAttribute(t){return this.domNode.hasAttribute(t)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){Object.entries(t).forEach(([t,e])=>this.setAttribute(t,e))}removeAttribute(t){this.domNode.removeAttribute(t)}get x1(){return this.domNode.x1.baseVal.value}get y1(){return this.domNode.y1.baseVal.value}get point1(){return{x:this.x1,y:this.y1}}get x2(){return this.domNode.x2.baseVal.value}get y2(){return this.domNode.y2.baseVal.value}get point2(){return{x:this.x2,y:this.y2}}get length(){return(0,o.distance)(this.point1,this.point2)}set length(t){let e=M.Box.matching(this.owner.domNode.getBBox());this.owner.displacement.magnitude=this.basePadding+t+this.textPadding+(0,o.distance)(this.owner.centerPoint,e.peripheralPoint(this.owner.displacement.direction+Math.PI))}get direction(){return(0,o.direction)(this.point1,this.point2)}set direction(t){let e=this.length;this.owner.displacement.direction=t,this.length=e}get basePadding(){return R(this,P,"a",C)}set basePadding(t){V(this,P,t,"a",j)}get textPadding(){return R(this,P,"a",I)}set textPadding(t){V(this,P,t,"a",L)}set(t){!t.attributes||this.setAttributes(t.attributes),!(0,a.isNumber)(t.basePadding)||(this.basePadding=t.basePadding),!(0,a.isNumber)(t.textPadding)||(this.textPadding=t.textPadding)}serialized(){return{id:this.id,ownerID:this.owner.id}}static deserialized(t,e){let r=new A(t),n=e.domNode.querySelector("#"+r.id);if(!n)throw new Error("Numbering line DOM node not found.");if(!(n instanceof SVGLineElement))throw new Error("Numbering line DOM node must be an SVG line element.");let i=e.numberings.find(t=>t.id===r.ownerID);if(!i)throw new Error("Numbering line owner not found.");let s=new F(n,i);return(0,a.isNumber)(r.basePadding)&&(s.basePadding=r.basePadding),(0,a.isNumber)(r.textPadding)&&(s.textPadding=r.textPadding),s}static recreate(t,e){return F.deserialized(t,e)}}P=new WeakSet,C=function(){if(!this.domNode.dataset.basePadding)return 0;let t=Number.parseFloat(this.domNode.dataset.basePadding);return Number.isFinite(t)?t:0},j=function(t){this.domNode.dataset.basePadding=`${t}`,R(this,P,"m",D).call(this)},I=function(){if(!this.domNode.dataset.textPadding)return 0;let t=Number.parseFloat(this.domNode.dataset.textPadding);return Number.isFinite(t)?t:0},L=function(t){this.domNode.dataset.textPadding=`${t}`,R(this,P,"m",D).call(this)},D=function(){let t=this.owner.displacement.direction;this.domNode.setAttribute("x1",`${this.owner.owner.centerPoint.x+R(this,P,"a",C)*Math.cos(t)}`),this.domNode.setAttribute("y1",`${this.owner.owner.centerPoint.y+R(this,P,"a",C)*Math.sin(t)}`);let e=M.Box.matching(this.owner.domNode.getBBox()).peripheralPoint(t+Math.PI);this.domNode.setAttribute("x2",`${e.x+R(this,P,"a",I)*Math.cos(t+Math.PI)}`),this.domNode.setAttribute("y2",`${e.y+R(this,P,"a",I)*Math.sin(t+Math.PI)}`)},F.defaultValues={attributes:{stroke:"#808080","stroke-width":"1","stroke-opacity":"1"},basePadding:5,textPadding:1}})(),n})(),t.exports=e()},775(t){var e;e=()=>(()=>{var t={726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>s,CoordinateSystem:()=>b,HorizontalClientScaling:()=>w,InnerXML:()=>_,OuterXML:()=>A,Path:()=>i,Scaling:()=>v,VerticalClientScaling:()=>x,assignUUID:()=>g,bringToFront:()=>N,drawOnCanvas:()=>L,isSVGGraphicsElement:()=>P,isSVGGraphicsElementsArray:()=>j,sendToBack:()=>O,setAttributes:()=>c});var t,e=r(725);class i{constructor(t){this.domNode=t}closestPoint(t,r){var n;let i=this.domNode.getPointAtLength(0),s={x:i.x,y:i.y,length:0},o=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;if(o<=0)throw new Error(`Precision must be positive: ${o}.`);let a=this.domNode.getTotalLength();for(let r=o;r<=a;r+=o){let n=this.domNode.getPointAtLength(r);(0,e.distance)(t,n)<(0,e.distance)(t,s)&&(s={x:n.x,y:n.y,length:r})}return s}}class s{constructor(e){t.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}closestPoint(e,r){var n;let s=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;return document.body.contains(a)||document.body.append(a),u.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,t)),new i(u).closestPoint(e,{precision:s})}}t=new WeakMap;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox","0 0 100 100"),o.setAttribute("width","100"),o.setAttribute("height","100");const a=document.createElement("div");a.append(o),a.style.height="0px",a.style.position="fixed",document.body.append(a);const u=document.createElementNS("http://www.w3.org/2000/svg","path");function c(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}u.setAttribute("stroke","black"),u.setAttribute("stroke-width","1"),o.append(u);const h={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var l,d=new Uint8Array(16);function f(){if(!l&&!(l="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(d)}for(var m=[],p=0;p<256;++p)m.push((p+256).toString(16).slice(1));const y=function(t,e,r){if(h.randomUUID&&!e&&!t)return h.randomUUID();var n=(t=t||{}).random||(t.rng||f)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return function(t,e=0){return(m[t[e+0]]+m[t[e+1]]+m[t[e+2]]+m[t[e+3]]+"-"+m[t[e+4]]+m[t[e+5]]+"-"+m[t[e+6]]+m[t[e+7]]+"-"+m[t[e+8]]+m[t[e+9]]+"-"+m[t[e+10]]+m[t[e+11]]+m[t[e+12]]+m[t[e+13]]+m[t[e+14]]+m[t[e+15]]).toLowerCase()}(n)};function g(t){t.id="uuid-"+y()}class b{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class v{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class w{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class x{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function N(t){let e=t.parentNode;e&&e.appendChild(t)}function O(t){let e=t.parentNode;e&&e.prepend(t)}var S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){S.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,S,t)}toString(){return E(this,S,"f").innerHTML}set(t){E(this,S,"f").innerHTML=t}}S=new WeakMap;var M,T=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class A{constructor(t){M.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,M,t)}toString(){return T(this,M,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=T(this,M,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...T(this,M,"f").attributes].forEach(t=>T(this,M,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>T(this,M,"f").setAttribute(t.name,t.value)),T(this,M,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function P(t){return t instanceof SVGGraphicsElement}M=new WeakMap;var C=r(854);function j(t){return(0,C.isArray)(t)&&t.every(P)}var I=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(t){try{u(n.next(t))}catch(t){s(t)}}function a(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,a)}u((n=n.apply(t,e||[])).next())})};function L(t){return I(this,void 0,void 0,function*(){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),yield i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e})}})(),n})(),t.exports=e()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseOutline:()=>i});var t=r(726),e=r(854);class i{static outlining(e){let r=document.createElementNS("http://www.w3.org/2000/svg","circle");(0,t.assignUUID)(r),r.setAttribute("cx",`${e.centerPoint.x}`),r.setAttribute("cy",`${e.centerPoint.y}`);let n=new i(r,e);return n.set(i.defaultValues.circle),n}static deserialized(t,r){var n;if(!(0,e.isNonNullObject)(t))throw new Error("Saved base outline must be an object.");let s=null!==(n=t.id)&&void 0!==n?n:t.circleId;if(!s)throw new Error("Base outline ID is missing.");if(!(0,e.isString)(s))throw new Error("Base outline ID must be a string.");let o=r.domNode.querySelector("#"+s);if(!o)throw new Error("Unable to find base outline DOM node.");if(!(o instanceof SVGCircleElement))throw new Error("Base outline DOM node must be an SVG circle element.");let a=t.ownerID;if(!a)throw new Error("Missing base outline owner ID.");if(!(0,e.isString)(a))throw new Error("Base outline owner ID must be a string.");let u=[...r.bases].find(t=>t.id===a);if(!u)throw new Error("Unable to find base outline owner.");return new i(o,u)}static recreate(t,e){return i.deserialized(t,e)}constructor(t,e){this.domNode=t,this.owner=e,e.centerPoint.addEventListener("move",()=>{t.setAttribute("cx",`${e.centerPoint.x}`),t.setAttribute("cy",`${e.centerPoint.y}`)})}serialized(){let t=this.id;if(!t)throw new Error("Base outline ID is falsy.");let e=this.owner.id;if(!e)throw new Error("Base outline owner ID is falsy.");return{id:t,ownerID:e}}get id(){return this.domNode.id}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(e){(0,t.setAttributes)(this.domNode,e)}set(t){t.attributes&&this.setAttributes(t.attributes)}}i.defaultValues={circle:{attributes:{r:"5.5",stroke:"#000000","stroke-width":"0","stroke-opacity":"1",fill:"#00ffff","fill-opacity":"1"}}}})(),n})(),t.exports=e()},358(t){var e;e=()=>(()=>{var t={731(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,{CenterPoint:()=>c});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver(()=>u(this,r,"m",o).call(this,"move")),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter(t=>t!==e)}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach(t=>t())},e})(),t.exports=e()},726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>s,CoordinateSystem:()=>b,HorizontalClientScaling:()=>w,InnerXML:()=>_,OuterXML:()=>A,Path:()=>i,Scaling:()=>v,VerticalClientScaling:()=>x,assignUUID:()=>g,bringToFront:()=>N,drawOnCanvas:()=>L,isSVGGraphicsElement:()=>P,isSVGGraphicsElementsArray:()=>j,sendToBack:()=>O,setAttributes:()=>c});var t,e=r(725);class i{constructor(t){this.domNode=t}closestPoint(t,r){var n;let i=this.domNode.getPointAtLength(0),s={x:i.x,y:i.y,length:0},o=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;if(o<=0)throw new Error(`Precision must be positive: ${o}.`);let a=this.domNode.getTotalLength();for(let r=o;r<=a;r+=o){let n=this.domNode.getPointAtLength(r);(0,e.distance)(t,n)<(0,e.distance)(t,s)&&(s={x:n.x,y:n.y,length:r})}return s}}class s{constructor(e){t.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,t,e)}closestPoint(e,r){var n;let s=null!==(n=null==r?void 0:r.precision)&&void 0!==n?n:5;return document.body.contains(a)||document.body.append(a),u.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,t)),new i(u).closestPoint(e,{precision:s})}}t=new WeakMap;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox","0 0 100 100"),o.setAttribute("width","100"),o.setAttribute("height","100");const a=document.createElement("div");a.append(o),a.style.height="0px",a.style.position="fixed",document.body.append(a);const u=document.createElementNS("http://www.w3.org/2000/svg","path");function c(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}u.setAttribute("stroke","black"),u.setAttribute("stroke-width","1"),o.append(u);const h={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var l,d=new Uint8Array(16);function f(){if(!l&&!(l="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(d)}for(var m=[],p=0;p<256;++p)m.push((p+256).toString(16).slice(1));const y=function(t,e,r){if(h.randomUUID&&!e&&!t)return h.randomUUID();var n=(t=t||{}).random||(t.rng||f)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return function(t,e=0){return(m[t[e+0]]+m[t[e+1]]+m[t[e+2]]+m[t[e+3]]+"-"+m[t[e+4]]+m[t[e+5]]+"-"+m[t[e+6]]+m[t[e+7]]+"-"+m[t[e+8]]+m[t[e+9]]+"-"+m[t[e+10]]+m[t[e+11]]+m[t[e+12]]+m[t[e+13]]+m[t[e+14]]+m[t[e+15]]).toLowerCase()}(n)};function g(t){t.id="uuid-"+y()}class b{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class v{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class w{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class x{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function N(t){let e=t.parentNode;e&&e.appendChild(t)}function O(t){let e=t.parentNode;e&&e.prepend(t)}var S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){S.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,S,t)}toString(){return E(this,S,"f").innerHTML}set(t){E(this,S,"f").innerHTML=t}}S=new WeakMap;var M,T=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class A{constructor(t){M.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,M,t)}toString(){return T(this,M,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=T(this,M,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...T(this,M,"f").attributes].forEach(t=>T(this,M,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>T(this,M,"f").setAttribute(t.name,t.value)),T(this,M,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function P(t){return t instanceof SVGGraphicsElement}M=new WeakMap;var C=r(854);function j(t){return(0,C.isArray)(t)&&t.every(P)}var I=function(t,e,r,n){return new(r||(r=Promise))(function(i,s){function o(t){try{u(n.next(t))}catch(t){s(t)}}function a(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,a)}u((n=n.apply(t,e||[])).next())})};function L(t){return I(this,void 0,void 0,function*(){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),yield i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e})}})(),n})(),t.exports=e()},986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){var e=0;return t.forEach(function(t){return e+=t}),e}function i(t){return n(t)/t.length}function s(t){t.sort(function(t,e){return t-e})}t.r(e),t.d(e,{areWithin:()=>m,average:()=>i,clamp:()=>f,degrees:()=>b,distance:()=>r,flipAway:()=>x,isBetween:()=>l,isBetweenExclusive:()=>d,isBetweenInclusive:()=>l,max:()=>h,mean:()=>i,median:()=>u,min:()=>c,normalizeAngle:()=>w,radians:()=>v,round:()=>g,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>p,sortedNumbers:()=>a,sortedNumbersAscending:()=>a,sortedNumbersDescending:()=>y,sum:()=>n});var o=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 a(t){var e=o([],t,!0);return s(e),e}function u(t){if(0==t.length)return NaN;var e=a(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,n=r-1;return i([e[r],e[n]])}function c(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,r){return t>=e&&t<=r}function d(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function m(t,e,r){return Math.abs(t-e)<=r}function p(t){s(t),t.reverse()}function y(t){var e=a(t);return e.reverse(),e}function g(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function b(t){return t*(180/Math.PI)}function v(t){return t*(Math.PI/180)}function w(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function x(t,e){var r=(e=w(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{BasePair:()=>fi,Nucleobase:()=>di,seqSorted:()=>mi});var t=Object.create,e=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,u=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),c=(t,r)=>{let n={};for(var i in t)e(n,i,{get:t[i],enumerable:!0});return r||e(n,Symbol.toStringTag,{value:"Module"}),n};const h={},l=[];function d(t,e){if(Array.isArray(t))for(const r of t)d(r,e);else if("object"!=typeof t)m(Object.getOwnPropertyNames(e)),h[t]=Object.assign(h[t]||{},e);else for(const e in t)d(e,t[e])}function f(t){return h[t]||{}}function m(t){l.push(...t)}var p=u((t,e)=>{e.exports=function(t){try{return!!t()}catch(t){return!0}}}),y=u((t,e)=>{var r=p();e.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}),g=u((t,e)=>{var r=y(),n=Function.prototype,i=n.call,s=r&&n.bind.bind(i,i);e.exports=r?s:function(t){return function(){return i.apply(t,arguments)}}}),b=u((t,e)=>{var r=g();e.exports=r({}.isPrototypeOf)}),v=u((t,e)=>{var n=function(t){return t&&t.Math===Math&&t};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}),w=u((t,e)=>{var r=y(),n=Function.prototype,i=n.apply,s=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})}),x=u((t,e)=>{var r=g(),n=r({}.toString),i=r("".slice);e.exports=function(t){return i(n(t),8,-1)}}),N=u((t,e)=>{var r=x(),n=g();e.exports=function(t){if("Function"===r(t))return n(t)}}),O=u((t,e)=>{var r="object"==typeof document&&document.all;e.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}}),S=u((t,e)=>{var r=p();e.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),E=u((t,e)=>{var r=y(),n=Function.prototype.call;e.exports=r?n.bind(n):function(){return n.apply(n,arguments)}}),_=u(t=>{var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!e.call({1:2},1);t.f=n?function(t){var e=r(this,t);return!!e&&e.enumerable}:e}),M=u((t,e)=>{e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}}),T=u((t,e)=>{var r=g(),n=p(),i=x(),s=Object,o=r("".split);e.exports=n(function(){return!s("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?o(t,""):s(t)}:s}),A=u((t,e)=>{e.exports=function(t){return null==t}}),P=u((t,e)=>{var r=A(),n=TypeError;e.exports=function(t){if(r(t))throw new n("Can't call method on "+t);return t}}),C=u((t,e)=>{var r=T(),n=P();e.exports=function(t){return r(n(t))}}),j=u((t,e)=>{var r=O();e.exports=function(t){return"object"==typeof t?null!==t:r(t)}}),I=u((t,e)=>{e.exports={}}),L=u((t,e)=>{var r=I(),n=v(),i=O(),s=function(t){return i(t)?t:void 0};e.exports=function(t,e){return arguments.length<2?s(r[t])||s(n[t]):r[t]&&r[t][e]||n[t]&&n[t][e]}}),D=u((t,e)=>{var r=v().navigator,n=r&&r.userAgent;e.exports=n?String(n):""}),R=u((t,e)=>{var r,n,i=v(),s=D(),o=i.process,a=i.Deno,u=o&&o.versions||a&&a.version,c=u&&u.v8;c&&(n=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(n=+r[1]),e.exports=n}),V=u((t,e)=>{var r=R(),n=p(),i=v().String;e.exports=!!Object.getOwnPropertySymbols&&!n(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41})}),F=u((t,e)=>{var r=V();e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),k=u((t,e)=>{var r=L(),n=O(),i=b(),s=F(),o=Object;e.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return n(e)&&i(e.prototype,o(t))}}),B=u((t,e)=>{var r=String;e.exports=function(t){try{return r(t)}catch(t){return"Object"}}}),U=u((t,e)=>{var r=O(),n=B(),i=TypeError;e.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not a function")}}),X=u((t,e)=>{var r=U(),n=A();e.exports=function(t,e){var i=t[e];return n(i)?void 0:r(i)}}),Y=u((t,e)=>{var r=E(),n=O(),i=j(),s=TypeError;e.exports=function(t,e){var o,a;if("string"===e&&n(o=t.toString)&&!i(a=r(o,t)))return a;if(n(o=t.valueOf)&&!i(a=r(o,t)))return a;if("string"!==e&&n(o=t.toString)&&!i(a=r(o,t)))return a;throw new s("Can't convert object to primitive value")}}),z=u((t,e)=>{e.exports=!0}),H=u((t,e)=>{var r=v(),n=Object.defineProperty;e.exports=function(t,e){try{n(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}}),G=u((t,e)=>{var r=z(),n=v(),i=H(),s="__core-js_shared__",o=e.exports=n[s]||i(s,{});(o.versions||(o.versions=[])).push({version:"3.49.0",mode:r?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),$=u((t,e)=>{var r=G();e.exports=function(t,e){return r[t]||(r[t]=e||{})}}),W=u((t,e)=>{var r=P(),n=Object;e.exports=function(t){return n(r(t))}}),q=u((t,e)=>{var r=g(),n=W(),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(t,e){return i(n(t),e)}}),J=u((t,e)=>{var r=g(),n=0,i=Math.random(),s=r(1.1.toString);e.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++n+i,36)}}),Q=u((t,e)=>{var r=v(),n=$(),i=q(),s=J(),o=V(),a=F(),u=r.Symbol,c=n("wks"),h=a?u.for||u:u&&u.withoutSetter||s;e.exports=function(t){return i(c,t)||(c[t]=o&&i(u,t)?u[t]:h("Symbol."+t)),c[t]}}),K=u((t,e)=>{var r=E(),n=j(),i=k(),s=X(),o=Y(),a=Q(),u=TypeError,c=a("toPrimitive");e.exports=function(t,e){if(!n(t)||i(t))return t;var a,h=s(t,c);if(h){if(void 0===e&&(e="default"),a=r(h,t,e),!n(a)||i(a))return a;throw new u("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}}),Z=u((t,e)=>{var r=K(),n=k();e.exports=function(t){var e=r(t,"string");return n(e)?e:e+""}}),tt=u((t,e)=>{var r=v(),n=j(),i=r.document,s=n(i)&&n(i.createElement);e.exports=function(t){return s?i.createElement(t):{}}}),et=u((t,e)=>{var r=S(),n=p(),i=tt();e.exports=!r&&!n(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}),rt=u(t=>{var e=S(),r=E(),n=_(),i=M(),s=C(),o=Z(),a=q(),u=et(),c=Object.getOwnPropertyDescriptor;t.f=e?c:function(t,e){if(t=s(t),e=o(e),u)try{return c(t,e)}catch(t){}if(a(t,e))return i(!r(n.f,t,e),t[e])}}),nt=u((t,e)=>{var r=p(),n=O(),i=/#|\.prototype\./,s=function(t,e){var i=a[o(t)];return i===c||i!==u&&(n(e)?r(e):!!e)},o=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",c=s.POLYFILL="P";e.exports=s}),it=u((t,e)=>{var r=N(),n=U(),i=y(),s=r(r.bind);e.exports=function(t,e){return n(t),void 0===e?t:i?s(t,e):function(){return t.apply(e,arguments)}}}),st=u((t,e)=>{var r=S(),n=p();e.exports=r&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),ot=u((t,e)=>{var r=j(),n=String,i=TypeError;e.exports=function(t){if(r(t))return t;throw new i(n(t)+" is not an object")}}),at=u(t=>{var e=S(),r=et(),n=st(),i=ot(),s=Z(),o=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c="enumerable",h="configurable",l="writable";t.f=e?n?function(t,e,r){if(i(t),e=s(e),i(r),"function"==typeof t&&"prototype"===e&&"value"in r&&l in r&&!r[l]){var n=u(t,e);n&&n[l]&&(t[e]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:c in r?r[c]:n[c],writable:!1})}return a(t,e,r)}:a:function(t,e,n){if(i(t),e=s(e),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new o("Accessors not supported");return"value"in n&&(t[e]=n.value),t}}),ut=u((t,e)=>{var r=S(),n=at(),i=M();e.exports=r?function(t,e,r){return n.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}}),ct=u((t,e)=>{var r=v(),n=w(),i=N(),s=O(),o=rt().f,a=nt(),u=I(),c=it(),h=ut(),l=q();G();var d=function(t){var e=function(r,i,s){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,i)}return new t(r,i,s)}return n(t,this,arguments)};return e.prototype=t.prototype,e};e.exports=function(t,e){var n,f,m,p,y,g,b,v,w,x=t.target,N=t.global,O=t.stat,S=t.proto,E=N?r:O?r[x]:r[x]&&r[x].prototype,_=N?u:u[x]||h(u,x,{})[x],M=_.prototype;for(p in e)f=!(n=a(N?p:x+(O?".":"#")+p,t.forced))&&E&&l(E,p),g=_[p],f&&(b=t.dontCallGetSet?(w=o(E,p))&&w.value:E[p]),y=f&&b?b:e[p],(n||S||typeof g!=typeof y)&&(v=t.bind&&f?c(y,r):t.wrap&&f?d(y):S&&s(y)?i(y):y,(t.sham||y&&y.sham||g&&g.sham)&&h(v,"sham",!0),h(_,p,v),S&&(l(u,m=x+"Prototype")||h(u,m,{}),h(u[m],p,y),t.real&&M&&(n||!M[p])&&h(M,p,y)))}}),ht=u((t,e)=>{var r=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}}),lt=u((t,e)=>{var r=ht();e.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}}),dt=u((t,e)=>{var r=lt(),n=Math.max,i=Math.min;e.exports=function(t,e){var s=r(t);return s<0?n(s+e,0):i(s,e)}}),ft=u((t,e)=>{var r=lt(),n=Math.min;e.exports=function(t){var e=r(t);return e>0?n(e,9007199254740991):0}}),mt=u((t,e)=>{var r=ft();e.exports=function(t){return r(t.length)}}),pt=u((t,e)=>{var r=C(),n=dt(),i=mt(),s=function(t){return function(e,s,o){var a=r(e),u=i(a);if(0===u)return!t&&-1;var c,h=n(o,u);if(t&&s!=s){for(;u>h;)if((c=a[h++])!=c)return!0}else for(;u>h;h++)if((t||h in a)&&a[h]===s)return t||h||0;return!t&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}}),yt=u((t,e)=>{e.exports=function(){}}),gt=u(()=>{var t=ct(),e=pt().includes,r=p(),n=yt(),i=r(function(){return!Array(1).includes()}),s=r(function(){return[,1].includes(void 0,1)});t({target:"Array",proto:!0,forced:i||s},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),n("includes")}),bt=u((t,e)=>{var r=v(),n=I();e.exports=function(t,e){var i=n[t+"Prototype"],s=i&&i[e];if(s)return s;var o=r[t],a=o&&o.prototype;return a&&a[e]}}),vt=u((t,e)=>{gt();var r=bt();e.exports=r("Array","includes")}),wt=u((t,e)=>{var r=j(),n=x(),i=Q()("match");e.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"===n(t))}}),xt=u((t,e)=>{var r=wt(),n=TypeError;e.exports=function(t){if(r(t))throw new n("The method doesn't accept regular expressions");return t}}),Nt=u((t,e)=>{var r={};r[Q()("toStringTag")]="z",e.exports="[object z]"===String(r)}),Ot=u((t,e)=>{var r=Nt(),n=O(),i=x(),s=Q()("toStringTag"),o=Object,a="Arguments"===i(function(){return arguments}());e.exports=r?i:function(t){var e,r,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=o(t),s))?r:a?i(e):"Object"===(u=i(e))&&n(e.callee)?"Arguments":u}}),St=u((t,e)=>{var r=Ot(),n=String;e.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}}),Et=u((t,e)=>{var r=Q()("match");e.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(t){}}return!1}}),_t=u(()=>{var t=ct(),e=g(),r=xt(),n=P(),i=St(),s=Et(),o=e("".indexOf);t({target:"String",proto:!0,forced:!s("includes")},{includes:function(t){return!!~o(i(n(this)),i(r(t)),arguments.length>1?arguments[1]:void 0)}})}),Mt=u((t,e)=>{_t();var r=bt();e.exports=r("String","includes")}),Tt=u((t,e)=>{var r=b(),n=vt(),i=Mt(),s=Array.prototype,o=String.prototype;e.exports=function(t){var e=t.includes;return t===s||r(s,t)&&e===s.includes?n:"string"==typeof t||t===o||r(o,t)&&e===o.includes?i:e}}),At=((r,n,u)=>(u=null!=r?t(o(r)):{},((t,r,n,o)=>{if(r&&"object"==typeof r||"function"==typeof r)for(var u,c=s(r),h=0,l=c.length;h<l;h++)u=c[h],a.call(t,u)||void 0===u||e(t,u,{get:(t=>r[t]).bind(null,u),enumerable:!(o=i(r,u))||o.enumerable});return t})(e(u,"default",{value:r,enumerable:!0}),r)))(u((t,e)=>{var r=Tt();e.exports=r})());function Pt(t,e){let r;const n=t.length,i=[];for(r=0;r<n;r++)i.push(e(t[r]));return i}function Ct(t){return t%360*Math.PI/180}function jt(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})}function It(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Lt(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 Dt(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=(0,At.default)(n).call(n,"left")?a:(0,At.default)(n).call(n,"right")?a+r:a+r/2),o&&(i=(0,At.default)(i).call(i,"top")?u:(0,At.default)(i).call(i,"bottom")?u+t:u+t/2)}return[n,i]}const Rt=new Set(["desc","metadata","title"]),Vt=t=>Rt.has(t.nodeName),Ft="http://www.w3.org/2000/svg",kt="http://www.w3.org/2000/xmlns/",Bt="http://www.w3.org/1999/xlink",Ut={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};var Xt=class{};const Yt={},zt="___SYMBOL___ROOT___";function Ht(t,e=Ft){return Ut.document.createElementNS(e,t)}function Gt(t,e=!1){if(t instanceof Xt)return t;if("object"==typeof t)return qt(t);if(null==t)return new Yt[zt];if("string"==typeof t&&"<"!==t.trim().charAt(0))return qt(Ut.document.querySelector(t));const r=e?Ut.document.createElement("div"):Ht("svg");return r.innerHTML=t.trim(),t=qt(r.firstElementChild),r.removeChild(r.firstElementChild),t}function $t(t,e){return e&&(e instanceof Ut.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:Ht(t)}function Wt(t){if(!t)return null;if(t.instance instanceof Xt)return t.instance;if("#document-fragment"===t.nodeName)return new Yt.Fragment(t);let e=It(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Yt[e]||(e="Dom"),new Yt[e](t)}let qt=Wt;function Jt(t,e=t.name,r=!1){return Yt[e]=t,r&&(Yt[zt]=t),m(Object.getOwnPropertyNames(t.prototype)),t}let Qt=1e3;function Kt(t){return"Svgjs"+It(t)+Qt++}function Zt(t){for(let e=t.children.length-1;e>=0;e--)Zt(t.children[e]);return t.id?(t.id=Kt(t.nodeName),t):t}function te(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 ee(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)}}d("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=Gt(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=Gt(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=Gt(t)).before(this),this},insertAfter:function(t){return(t=Gt(t)).after(this),this}});const re=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,ne=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ie=/rgb\((\d+),(\d+),(\d+)\)/,se=/^(#[^\s]+)$/,oe=/\)\s*,?\s*/,ae=/\s/g,ue=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,ce=/^rgb\(/,he=/^(\s+)?$/,le=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,de=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,fe=/[\s,]+/,me=/[MLHVCSQTAZ]/i;d("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(fe)},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)}});const pe=t=>t.startsWith("--")?t:jt(t);function ye(t){const e=Math.max(0,Math.min(255,Math.round(t))).toString(16);return 1===e.length?"0"+e:e}function ge(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function be(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}d("Dom",{css:function(t,e){const r={};if(0===arguments.length){const t=this.node.style;for(let e=0;e<t.length;e++){const n=t.item(e),i=t.getPropertyValue(n),s=t.getPropertyPriority(n);r[n]=s?`${i} !${s}`:i}return r}if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=pe(e);r[e]=this.node.style.getPropertyValue(t)}return r}if("string"==typeof t)return this.node.style.getPropertyValue(pe(t));if("object"==typeof t)for(const e in t)this.node.style.setProperty(pe(e),null==t[e]||he.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(pe(t),null==e||he.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),d("Dom",{data:function(t,e,r){if(null==t)return this.data(Pt(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}}),d("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||{}}});var ve=class t{constructor(...t){this.init(...t)}static isColor(e){return e&&(e instanceof t||this.isRgb(e)||this.test(e))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(e="vibrant",r){const{random:n,round:i,sin:s,PI:o}=Math;if("vibrant"===e){const e=24*n()+57,r=38*n()+45,i=360*n();return new t(e,r,i,"lch")}if("sine"===e){const e=i(80*s(2*o*(r=r??n())/.5+.01)+150),a=i(50*s(2*o*r/.5+4.6)+200),u=i(100*s(2*o*r/.5+2.3)+150);return new t(e,a,u)}if("pastel"===e){const e=8*n()+86,r=17*n()+9,i=360*n();return new t(e,r,i,"lch")}if("dark"===e){const e=10+10*n(),r=50*n()+86,i=360*n();return new t(e,r,i,"lch")}if("rgb"===e){const e=255*n(),r=255*n(),i=255*n();return new t(e,r,i)}if("lab"===e){const e=100*n(),r=256*n()-128,i=256*n()-128;return new t(e,r,i,"lab")}if("grey"===e){const e=255*n();return new t(e,e,e)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(ue.test(t)||ce.test(t))}cmyk(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),a=Math.min(1-i,1-s,1-o);return 1===a?new t(0,0,0,1,"cmyk"):new t((1-i-a)/(1-a),(1-s-a)/(1-a),(1-o-a)/(1-a),a,"cmyk")}hsl(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),a=Math.max(i,s,o),u=Math.min(i,s,o),c=(a+u)/2,h=a===u,l=a-u;return new t(360*(h?0:a===i?((s-o)/l+(s<o?6:0))/6:a===s?((o-i)/l+2)/6:a===o?((i-s)/l+4)/6:0),100*(h?0:c>.5?l/(2-a-u):l/(a+u)),100*c,"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=ge(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:ge(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:ge(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:ge(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:ge(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:ge(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(ce.test(t)){const e=t.replace(ae,""),[r,n,i]=ie.exec(e).slice(1,4).map(t=>parseInt(t));Object.assign(this,{_a:r,_b:n,_c:i,_d:0,space:"rgb"})}else{if(!ue.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,n,i]=ne.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,c="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,c)}lab(){const{x:e,y:r,z:n}=this.xyz();return new t(116*r-16,500*(e-r),200*(r-n),"lab")}lch(){const{l:e,a:r,b:n}=this.lab(),i=Math.sqrt(r**2+n**2);let s=180*Math.atan2(n,r)/Math.PI;return s<0&&(s*=-1,s=360-s),new t(e,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:r,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:t,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=(t+16)/116,a=i/500+o,u=o-s/200,c=16/116,h=.008856,l=7.787;e=.95047*(a**3>h?a**3:(a-c)/l),r=1*(o**3>h?o**3:(o-c)/l),n=1.08883*(u**3>h?u**3:(u-c)/l)}const i=3.2406*e+-1.5372*r+-.4986*n,s=-.9689*e+1.8758*r+.0415*n,o=.0557*e+-.204*r+1.057*n,a=Math.pow,u=.0031308,c=i>u?1.055*a(i,1/2.4)-.055:12.92*i,h=s>u?1.055*a(s,1/2.4)-.055:12.92*s,l=o>u?1.055*a(o,1/2.4)-.055:12.92*o;return new t(255*c,255*h,255*l)}if("hsl"===this.space){let{h:e,s:r,l:n}=this;if(e/=360,r/=100,n/=100,0===r)return n*=255,new t(n,n,n);const i=n<.5?n*(1+r):n+r-n*r,s=2*n-i,o=255*be(s,i,e+1/3),a=255*be(s,i,e),u=255*be(s,i,e-1/3);return new t(o,a,u)}if("cmyk"===this.space){const{c:e,m:r,y:n,k:i}=this,s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,r*(1-i)+i)),a=255*(1-Math.min(1,n*(1-i)+i));return new t(s,o,a)}return this;var e}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(ye);return`#${t}${e}${r}`}toRgb(){const[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:r,_c:n}=this.rgb(),[i,s,o]=[e,r,n].map(t=>t/255),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,c=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,h=(.4124*a+.3576*u+.1805*c)/.95047,l=(.2126*a+.7152*u+.0722*c)/1,d=(.0193*a+.1192*u+.9505*c)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,m=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=d>.008856?Math.pow(d,1/3):7.787*d+16/116;return new t(f,m,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)))}},we=class t{constructor(...t){this.init(...t)}clone(){return new t(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=r.x??0,this.y=r.y??0,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Ne.isMatrixLike(t)||(t=new Ne(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 xe(t,e,r){return Math.abs(e-t)<(r||1e-6)}var Ne=class t{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,c=t.rotate||t.theta||0,h=new we(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),l=h.x,d=h.y,f=new we(t.position??t.px??t.positionX??NaN,t.py??t.positionY??NaN),m=f.x,p=f.y,y=new we(t.translate||t.tx||t.translateX,t.ty||t.translateY),g=y.x,b=y.y,v=new we(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:a,skewX:i,skewY:s,shear:u,theta:c,rx:v.x,ry:v.y,tx:g,ty:b,ox:l,oy:d,px:m,py:p}}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 t(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,c=u>0?1:-1,h=c*Math.sqrt(r*r+n*n),l=Math.atan2(c*n,c*r),d=(r*i+n*s)/u;return{scaleX:h,scaleY:i*h/(d*r-n)||s*h/(d*n+r),shear:d,rotate:180/Math.PI*l,translateX:o-t+t*r+e*i,translateY:a-e+t*n+e*s,originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const r=new t(e);return xe(this.a,r.a)&&xe(this.b,r.b)&&xe(this.c,r.c)&&xe(this.d,r.d)&&xe(this.e,r.e)&&xe(this.f,r.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(e){const r=t.fromArray([1,0,0,1,0,0]);return e=e instanceof We?e.matrixify():"string"==typeof e?t.fromArray(e.split(fe).map(parseFloat)):Array.isArray(e)?t.fromArray(e):"object"==typeof e&&t.isMatrixLike(e)?e:"object"==typeof e?(new t).transform(e):6===arguments.length?t.fromArray([].slice.call(arguments)):r,this.a=null!=e.a?e.a:r.a,this.b=null!=e.b?e.b:r.b,this.c=null!=e.c?e.c:r.c,this.d=null!=e.d?e.d:r.d,this.e=null!=e.e?e.e:r.e,this.f=null!=e.f?e.f:r.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,c=-r/o,h=t/o,l=-(a*i+c*s),d=-(u*i+h*s);return this.a=a,this.b=u,this.c=c,this.d=h,this.e=l,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(e){const r=e instanceof t?e:new t(e);return t.matrixMultiply(r,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(e){const r=e instanceof t?e:new t(e);return t.matrixMultiply(this,r,this)}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=Ct(t);const n=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:a,d:u,e:c,f:h}=this;return this.a=s*n-o*i,this.b=o*n+s*i,this.c=a*n-u*i,this.d=u*n+a*i,this.e=c*n-h*i+r*i-e*n+e,this.f=h*n+c*i-e*i-r*n+r,this}scale(){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:c}=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=c*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(){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,n=0){3===arguments.length&&(n=r,r=e,e=t),t=Ct(t),e=Ct(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:a,c:u,d:c,e:h,f:l}=this;return this.a=o+a*i,this.b=a+o*s,this.c=u+c*i,this.d=c+u*s,this.e=h+l*i-n*i,this.f=l+h*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(e){if(t.isMatrixLike(e))return new t(e).multiplyO(this);const r=t.formatTransforms(e),{x:n,y:i}=new we(r.ox,r.oy).transform(this),s=(new t).translateO(r.rx,r.ry).lmultiplyO(this).translateO(-n,-i).scaleO(r.scaleX,r.scaleY).skewO(r.skewX,r.skewY).shearO(r.shear).rotateO(r.theta).translateO(n,i);if(isFinite(r.px)||isFinite(r.py)){const t=new we(n,i).transform(s),e=isFinite(r.px)?r.px-t.x:0,o=isFinite(r.py)?r.py-t.y:0;s.translateO(e,o)}return s.translateO(r.tx,r.ty),s}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 Oe(){if(!Oe.nodes||Oe.nodes.svg.node.ownerDocument!==Ut.document){const t=Gt().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"),Oe.nodes={svg:t,path:t.path().node}}return Oe.nodes.svg.node.parentNode||Oe.nodes.svg.addTo(Ut.document.body||Ut.document.documentElement),Oe.nodes}function Se(t){return!(t.width||t.height||t.x||t.y)}Jt(Ne,"Matrix");var Ee=class t{constructor(...t){this.init(...t)}addOffset(){return this.x+=Ut.window.pageXOffset,this.y+=Ut.window.pageYOffset,new t(this)}init(t){return t="string"==typeof t?t.split(fe).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 Se(this)}merge(e){const r=Math.min(this.x,e.x),n=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-r,s=Math.max(this.y+this.height,e.y+e.height)-n;return new t(r,n,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof Ne||(e=new Ne(e));let r=1/0,n=-1/0,i=1/0,s=-1/0;return[new we(this.x,this.y),new we(this.x2,this.y),new we(this.x,this.y2),new we(this.x2,this.y2)].forEach(function(t){t=t.transform(e),r=Math.min(r,t.x),n=Math.max(n,t.x),i=Math.min(i,t.y),s=Math.max(s,t.y)}),new t(r,i,n-r,s-i)}};function _e(t,e,r){let n;try{if(n=e(t.node),Se(n)&&(i=t.node)!==Ut.document&&!(Ut.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===Ut.document}).call(Ut.document.documentElement,i))throw new Error("Element not in the dom")}catch(e){n=r(t)}var i;return n}d({viewbox:{viewbox(t,e,r,n){return null==t?new Ee(this.attr("viewBox")):this.attr("viewBox",new Ee(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 we(r/2/s+i.x,n/2/o+i.y);const c=new Ee(i).transform(new Ne({scale:u,origin:e}));return this.viewbox(c)}}}),Jt(Ee,"Box");var Me=class extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}};te([Me],{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 Te=["toArray","constructor","each"];function Ae(t){let e=(t+"").trim();const r=e.match(/^url\((.*)\)$/i);if(r){e=r[1].trim();const t=e[0];if('"'===t||"'"===t){if(e[e.length-1]!==t)return null;e=e.slice(1,-1)}}const n=e.match(se);return n?n[1].slice(1):null}function Pe(t,e){const r=`#${Ut.window.CSS.escape(e)}`;return 1===t.nodeType&&t.matches(r)?t:t.querySelector(r)}function Ce(t,e,r=`[${e}]`){const n=t.getAttribute("id"),i=t.getRootNode();if(!n||Pe(i,n)!==t)return new Me;const s=[];1===i.nodeType&&i.matches(r)&&Ae(i.getAttribute(e))===n&&s.push(Wt(i));for(const t of i.querySelectorAll(r))Ae(t.getAttribute(e))===n&&s.push(Wt(t));return new Me(s)}Me.extend=function(t){t=t.reduce((t,e)=>((0,At.default)(Te).call(Te,e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t),{}),te([Me],t)};let je=0;const Ie=new WeakMap,Le=new WeakMap,De=()=>Object.create(null);function Re(t){const e=t.getEventHolder();let r=Ie.get(e);return r||(r=De(),Ie.set(e,r)),r}function Ve(t){return t.getEventTarget()}function Fe(t,e,r,n,i){const s=r.bind(n||t),o=i||!1,a=Gt(t),u=Re(a),c=Ve(a);e=Array.isArray(e)?e:e.split(fe);let h=Le.get(r);h||(h=++je,Le.set(r,h)),e.forEach(function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";u[e]=u[e]||De(),u[e][r]=u[e][r]||De(),u[e][r][h]=u[e][r][h]||[],u[e][r][h].push({listener:s,options:o}),c.addEventListener(e,s,o)})}function ke(t,e,r,n){const i=Gt(t),s=Re(i),o=Ve(i);("function"!=typeof r||(r=Le.get(r)))&&(e=Array.isArray(e)?e:(e||"").split(fe)).forEach(function(t){const e=t&&t.split(".")[0],a=t&&t.split(".")[1];let u,c;if(r){if(s[e]&&s[e][a||"*"]){const t=s[e][a||"*"][r];if(!t)return;t.forEach(function(t){o.removeEventListener(e,t.listener,t.options??n??!1)}),delete s[e][a||"*"][r]}}else if(e&&a){if(s[e]&&s[e][a]){for(c in s[e][a])ke(o,[e,a].join("."),c);delete s[e][a]}}else if(a)for(t in s)for(u in s[t])a===u&&ke(o,[t,a].join("."));else if(e){if(s[e]){for(u in s[e])ke(o,[e,u].join("."));delete s[e]}}else{for(t in s)ke(o,t);!function(t){Ie.delete(t.getEventHolder())}(i)}})}var Be=class extends Xt{addEventListener(){}dispatch(t,e,r){return function(t,e,r,n){const i=Ve(t);return e instanceof Ut.window.Event||(e=new Ut.window.CustomEvent(e,{detail:r,cancelable:!0,...n})),i.dispatchEvent(e),e}(this,t,e,r)}dispatchEvent(t){const e=Re(this)[t.type];if(!e)return!0;for(const r in e)for(const n in e[r])e[r][n].forEach(function(e){e.listener(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 ke(this,t,e,r),this}on(t,e,r,n){return Fe(this,t,e,r,n),this}removeEventListener(){}};function Ue(){}Jt(Be,"EventTarget");const Xe={"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"};var Ye=class 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(fe).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}},ze=class t{constructor(...t){this.init(...t)}convert(e){return new t(this.value,e)}divide(e){return e=new t(e),new t(this/e,this.unit||e.unit)}init(e,r){return r=Array.isArray(e)?e[1]:r,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=r||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(r=e.match(re))&&(this.value=parseFloat(r[1]),"%"===r[5]?this.value/=100:"s"===r[5]&&(this.value*=1e3),this.unit=r[5]):e instanceof t&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new t(e),new t(this-e,this.unit||e.unit)}plus(e){return e=new t(e),new t(this+e,this.unit||e.unit)}times(e){return e=new t(e),new t(this*e,this.unit||e.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 He=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ge=[];var $e=class t extends Be{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=Gt(t)).removeNamespace&&this.node instanceof Ut.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 Gt(t).put(this,e)}children(){return new Me(Pt(this.node.children,function(t){return Wt(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=Zt(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(e,r){return this.put(new t(Ht(e),r))}first(){return Wt(this.node.firstChild)}get(t){return Wt(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=Kt(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Wt(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=Wt(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Wt(e.node.parentNode));return e}put(t,e){return t=Gt(t),this.add(t,e),t}putIn(t,e){return Gt(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=Gt(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,Ft)}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=e??!0,this.writeDataToDom();let r=this;if(null!=t){if(r=Wt(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=e??!1;const n=Ht("wrapper",r),i=Ut.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)}};te($e,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(const r of e)t[r.nodeName]=le.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))?Xe[t]:le.test(e)?parseFloat(e):e;"number"==typeof(e=Ge.reduce((e,r)=>r(t,e,this),e))?e=new ze(e):He.has(t)&&ve.isColor(e)?e=new ve(e):e.constructor===Array&&(e=new Ye(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 function(t,e){return new Me(Pt((e||Ut.document).querySelectorAll(t),function(t){return Wt(t)}))}(t,this.node)},findOne:function(t){return Wt(this.node.querySelector(t))}}),Jt($e,"Dom");var We=class extends $e{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 ze(t).plus(this.x()))}dy(t=0){return this.y(new ze(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,r=this.root(),n=r&&r.node;e||(t=t&&Gt(t).node);const i=new Me;let s=this;for(;(s=s.parent())&&s.node!==Ut.document&&"#document-fragment"!==s.node.nodeName&&(i.push(s),e||s.node!==t)&&(!e||!s.matches(t));)if(n&&s.node===n)return null;return i}reference(t){if(!(t=this.attr(t)))return null;const e=function(t,e){const r=Ae(e);return r?Pe(t.getRootNode(),r):null}(this.node,t);return e?Gt(e):null}root(){const t=this.parent(Yt[zt]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const r=Lt(this,t,e);return this.width(new ze(r.width)).height(new ze(r.height))}width(t){return this.attr("width",t)}writeDataToDom(t){return((t,e,r={})=>{const n={...e};for(const t in n)n[t].valueOf()===r[t]&&delete n[t];Object.keys(n).length?t.node.setAttribute("data-svgjs",JSON.stringify(n)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))})(this,this.dom,t),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}};te(We,{bbox:function(){const t=_e(this,t=>t.getBBox(),t=>{try{const e=t.clone().addTo(Oe().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 Ee(t)},rbox:function(t){const e=_e(this,t=>t.getBoundingClientRect(),t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)}),r=new Ee(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 we(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Ne(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 Ne(e)}return new Ne(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new Ne}}}),Jt(We,"Element");const qe={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 ve||ve.isRgb(e)||e instanceof We)this.attr(t,e);else for(r=qe[t].length-1;r>=0;r--)null!=e[qe[t][r]]&&this.attr(qe.prefix(t,qe[t][r]),e[qe[t][r]]);return this},d(["Element","Runner"],e)}),d(["Element","Runner"],{matrix:function(t,e,r,n,i,s){return null==t?new Ne(this):this.attr("transform",new Ne(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)}}),d("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new ze(t)):this.rx(t).ry(e)}}),d("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new we(this.node.getPointAtLength(t))}}),d(["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)}}),d("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},{})),d("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(oe).slice(0,-1).map(function(t){const e=t.trim().split("(");return[e[0].trim(),e[1].split(fe).map(function(t){return parseFloat(t)})]}).reverse().reduce(function(t,e){return"matrix"===e[0]?t.lmultiply(Ne.fromArray(e[1])):t[e[0]].apply(t,e[1])},new Ne)},toParent:function(t,e){if(this===t)return this;if(Vt(this.node))return this.addTo(t,e);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 Ne(this).decompose();return null==t?e:e[t]}Ne.isMatrixLike(t)||(t={...t,origin:Dt(t,this)});const r=new Ne(!0===e?this:e||!1).transform(t);return this.attr("transform",r)}});var Je=class t extends We{flatten(){return this.each(function(){if(this instanceof t)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()}};Jt(Je,"Container");var Qe=class extends Je{constructor(t,e=t){super($t("defs",t),e)}flatten(){return this}ungroup(){return this}};Jt(Qe,"Defs");var Ke=class extends We{};Jt(Ke,"Shape");var Ze=c({cx:()=>ir,cy:()=>sr,height:()=>ar,rx:()=>tr,ry:()=>er,width:()=>or,x:()=>rr,y:()=>nr});function tr(t){return this.attr("rx",t)}function er(t){return this.attr("ry",t)}function rr(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function nr(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function ir(t){return this.attr("cx",t)}function sr(t){return this.attr("cy",t)}function or(t){return null==t?2*this.rx():this.rx(new ze(t).divide(2))}function ar(t){return null==t?2*this.ry():this.ry(new ze(t).divide(2))}var ur=class extends Ke{constructor(t,e=t){super($t("ellipse",t),e)}size(t,e){const r=Lt(this,t,e);return this.rx(new ze(r.width).divide(2)).ry(new ze(r.height).divide(2))}};te(ur,Ze),d("Container",{ellipse:ee(function(t=0,e=t){return this.put(new ur).size(t,e).move(0,0)})}),Jt(ur,"Ellipse");var cr=class extends $e{constructor(t=Ut.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 $e(Ht("wrapper",r));return t.add(this.node.cloneNode(!0)),t.xml(!1,r)}return super.xml(t,!1,r)}};Jt(cr,"Fragment");var hr=c({from:()=>lr,to:()=>dr});function lr(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new ze(t),fy:new ze(e)}):this.attr({x1:new ze(t),y1:new ze(e)})}function dr(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new ze(t),cy:new ze(e)}):this.attr({x2:new ze(t),y2:new ze(e)})}var fr=class extends Je{constructor(t,e){super($t(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 Ee}targets(){return Ce(this.node,"fill")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};te(fr,hr),d({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:ee(function(t,e){return this.put(new fr(t)).update(e)})}}),Jt(fr,"Gradient");var mr=class extends Je{constructor(t,e=t){super($t("pattern",t),e)}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}bbox(){return new Ee}targets(){return Ce(this.node,"fill")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};d({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:ee(function(t,e,r){return this.put(new mr).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})})}}),Jt(mr,"Pattern");var pr,yr=class extends Ke{constructor(t,e=t){super($t("image",t),e)}load(t,e){if(!t)return this;const r=new Ut.window.Image;return Fe(r,"load",function(t){const n=this.parent(mr);0===this.width()&&0===this.height()&&this.size(r.width,r.height),n instanceof mr&&0===n.width()&&0===n.height()&&n.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)},this),Fe(r,"load error",function(){ke(r)}),this.attr("href",r.src=t,Bt)}};pr=function(t,e,r){return"fill"!==t&&"stroke"!==t||de.test(e)&&(e=r.root().defs().image(e)),e instanceof yr&&(e=r.root().defs().pattern(0,0,t=>{t.add(e)})),e},Ge.push(pr),d({Container:{image:ee(function(t,e){return this.put(new yr).size(0,0).load(t,e)})}}),Jt(yr,"Image");var gr=class extends Ye{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 Ee(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(fe).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){Ne.isMatrixLike(t)||(t=new Ne(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}},br=c({MorphArray:()=>vr,height:()=>Or,width:()=>Nr,x:()=>wr,y:()=>xr});const vr=gr;function wr(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function xr(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function Nr(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function Or(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}var Sr=class extends Ke{constructor(t,e=t){super($t("line",t),e)}array(){return new gr([[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 gr(t).toLine(),this.attr(t))}size(t,e){const r=Lt(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}};te(Sr,br),d({Container:{line:ee(function(...t){return Sr.prototype.plot.apply(this.put(new Sr),null!=t[0]?t:[0,0,0,0])})}}),Jt(Sr,"Line");var Er=class extends Je{constructor(t,e=t){super($t("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 _r(t,e){return function(r){return null==r?this[t]:(this[t]=r,e&&e.call(this),this)}}d({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:ee(function(t,e,r){return this.put(new Er).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 Er?arguments[1]:this.defs().marker(e,r,n),this.attr(i,t)}}}),Jt(Er,"Marker");const Mr={"-":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}}};var Tr=class{done(){return!1}},Ar=class extends Tr{constructor(t=">"){super(),this.ease=Mr[t]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}},Pr=class extends Tr{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,r,n){return this.stepper(t,e,r,n)}};function Cr(){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}te(class extends Pr{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:_r("_duration",Cr),overshoot:_r("_overshoot",Cr)}),te(class extends Pr{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:_r("_windup"),p:_r("P"),i:_r("I"),d:_r("D")});const jr={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ir={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]]}},Lr="mlhvqtcsaz".split("");for(let t=0,e=Lr.length;t<e;++t)Ir[Lr[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 Ir[t](e,r,n)}}(Lr[t].toUpperCase());function Dr(t){return t.segment.length&&t.segment.length-1===jr[t.segment[0].toUpperCase()]}function Rr(t,e){t.inNumber&&Vr(t,!1);const r=me.test(e);if(r)t.segment=[e];else{const e=t.lastCommand,r=e.toLowerCase();t.segment=["m"===r?e===r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],r}function Vr(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,Dr(t)&&Fr(t)}function Fr(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){return Ir[t.segment[0]](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function kr(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 Br(t){return"E"===t.lastToken.toUpperCase()}const Ur=new Set([" ",",","\t","\n","\r","\f"]);var Xr=class extends Ye{bbox(){return Oe().path.setAttribute("d",this.toString()),new Ee(Oe.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 we,p:new we};for(;i.lastToken=n,n=t.charAt(r++);)if(i.inSegment||!Rr(i,n))if("."!==n)if(isNaN(parseInt(n)))if(Ur.has(n))i.inNumber&&Vr(i,!1);else if("-"!==n&&"+"!==n)if("E"!==n.toUpperCase()){if(me.test(n)){if(i.inNumber)Vr(i,!1);else{if(!Dr(i))throw new Error("parser Error");Fr(i)}--r}}else i.number+=n,i.hasExponent=!0;else{if(i.inNumber&&!Br(i)){Vr(i,!1),--r;continue}i.number+=n,i.inNumber=!0}else{if("0"===i.number||kr(i)){i.inNumber=!0,i.number=n,Vr(i,!0);continue}i.inNumber=!0,i.number+=n}else{if(i.pointSeen||i.hasExponent){Vr(i,!1),--r;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=n}return i.inNumber&&Vr(i,!1),i.inSegment&&Dr(i)&&Fr(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 Yr=t=>{const e=typeof t;return"number"===e?ze:"string"===e?ve.isColor(t)?ve:fe.test(t)?me.test(t)?Xr:Ye:re.test(t)?ze:Hr:qr.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Ye:"object"===e?Wr:Hr};var zr=class{constructor(t){this._stepper=t||new Ar("-"),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(Yr(t));let e=new this._type(t);return this._type===ve&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Wr&&(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}},Hr=class{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}},Gr=class t{constructor(...t){this.init(...t)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,t.defaults,e),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}};Gr.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const $r=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;var Wr=class{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]===ve&&t[r+7]!==e[r+7]){const e=t[r+7],n=new ve(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=Yr(t[r]),i=new n(t[r]).toArray();e.push([r,n,i.length,...i])}return e.sort($r),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();t[r]=new n(e.splice(0,i))}return t}};const qr=[Hr,Gr,Wr];var Jr=class extends Ke{constructor(t,e=t){super($t("path",t),e)}array(){return this._array||(this._array=new Xr(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 Xr(t))}size(t,e){const r=Lt(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)}};Jr.prototype.MorphArray=Xr,d({Container:{path:ee(function(t){return this.put(new Jr).plot(t||new Xr)})}}),Jt(Jr,"Path");var Qr=c({array:()=>Kr,clear:()=>Zr,move:()=>tn,plot:()=>en,size:()=>rn});function Kr(){return this._array||(this._array=new gr(this.attr("points")))}function Zr(){return delete this._array,this}function tn(t,e){return this.attr("points",this.array().move(t,e))}function en(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new gr(t))}function rn(t,e){const r=Lt(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}var nn=class extends Ke{constructor(t,e=t){super($t("polygon",t),e)}};d({Container:{polygon:ee(function(t){return this.put(new nn).plot(t||new gr)})}}),te(nn,br),te(nn,Qr),Jt(nn,"Polygon");var sn=class extends Ke{constructor(t,e=t){super($t("polyline",t),e)}};d({Container:{polyline:ee(function(t){return this.put(new sn).plot(t||new gr)})}}),te(sn,br),te(sn,Qr),Jt(sn,"Polyline");var on=class extends Ke{constructor(t,e=t){super($t("rect",t),e)}};te(on,{rx:tr,ry:er}),d({Container:{rect:ee(function(t,e){return this.put(new on).size(t,e)})}}),Jt(on,"Rect");var an=class{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 un={nextDraw:null,frames:new an,timeouts:new an,immediates:new an,timer:()=>Ut.window.performance||Ut.window.Date,frame(t){const e=un.frames.push({run:t});return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),e},timeout(t,e){e=e||0;const r=un.timer().now()+e,n=un.timeouts.push({run:t,time:r});return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),n},immediate(t){const e=un.immediates.push(t);return null===un.nextDraw&&(un.nextDraw=Ut.window.requestAnimationFrame(un._draw)),e},cancelFrame(t){null!=t&&un.frames.remove(t)},clearTimeout(t){null!=t&&un.timeouts.remove(t)},cancelImmediate(t){null!=t&&un.immediates.remove(t)},_draw(t){try{let e=null;const r=un.timeouts.last();for(;(e=un.timeouts.shift())&&(t>=e.time?e.run():un.timeouts.push(e),e!==r););let n=null;const i=un.frames.last();for(;n!==i&&(n=un.frames.shift());)n.run(t);let s=null;for(;s=un.immediates.shift();)s()}finally{const t=un.timeouts.first()||un.frames.first()||un.immediates.first();un.nextDraw=t?Ut.window.requestAnimationFrame(un._draw):null}}},cn=function(t){const e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}},hn=function(){const t=Ut.window;return(t.performance||t.Date).now()};var ln=class extends Be{constructor(t=hn){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){this._finishing=!0;try{this.time(this.getEndTimeOfTimeline()+1)}finally{this._finishing=!1}return 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(cn);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),t._retired=!1;const s=t.persist(),o={persist:null===s?this._persist:s,start:n+e,runner:t};return this._lastRunnerId=t.id,t._runnerInfo=o,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),t._runnerInfo=null,t._retired=!0),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return un.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=un.frame(this._step)),this)}_stepFn(t=!1){const e=this._generation,r=this._timeSource();let n=r-this._lastSourceTime;t&&(n=0);const i=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=r,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);const s=this._runners.slice();for(let t=s.length;t--;){const e=s[t];if(e.runner._runnerInfo!==e)continue;const r=e.runner;this._time-e.start<0&&r.reset(!0)}let o=!1;for(const t of this._runners.slice()){if(t.runner._runnerInfo!==t)continue;const e=t.runner;let r=i;const n=this._time-t.start;if(n<0){o=!0;continue}if(0===n){e.reset(),o=!0;continue}if(n<r&&(r=n),!e.active())continue;const s=(this._finishing&&e._isDeclarative?e.finish():e.step(r)).done;e._runnerInfo===t&&(s?!0!==t.persist&&e.duration()-e.time()+this._time+t.persist<=this._time&&e.unschedule():o=!0)}return e!==this._generation||(o||(o=this._runners.some(({start:t,runner:e})=>t>=this._time||e.active()&&!e.done)),o&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished"))),this}terminate(){un.cancelFrame(this._nextFrame),this._generation=(this._generation||0)+1,this._startTime=0,this._speed=1,this._persist=0;for(const{runner:t}of this._runners||[])t._retired=!0,t._runnerInfo=null;this._nextFrame=null,this._paused=!0,this._finishing=!1,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)}};d({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new ln,this._timeline):(this._timeline=t,this)}}});var dn=class t extends Be{constructor(e){super(),this.id=t.id++,e="function"==typeof(e=e??400)?new Pr(e):e,this._element=null,this._timeline=null,this._runnerInfo=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof Pr,this._stepper=this._isDeclarative?e:new Ar,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Ne,this._isAbsoluteTransform=!1,this._hasTransform=!1,this._transformInitialised=!1,this._transformActive=!1,this._retired=!1,this._reverse=!1,this._swing=!1,this._wait=0,this._times=1,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 Tr||(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){return this.transforms.lmultiplyO(t),this._transformInitialised=!0,this._transformActive=!0,this}after(t){return this.on("finished",t)}animate(e,r,n){const i=t.sanitise(e,r,n),s=new t(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new Ne,this}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 Ar(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){if(!this._isDeclarative)return this.time(this.duration());const t=this._time;return this.step(1/0),this._time=t,this}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()),c=s&&u%2==0;return a=u+(c&&!o||o&&c?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._isDeclarative&&(this.done=!1),this._queue.push({initialiser:t||Ue,runner:e||Ue,retarget:r,isTransform:n,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(t=!1){if(this._reseted){const e=!t&&this._hasTransform&&0!==this.position();return e&&!this._transformInitialised?(this.step(0),this._reseted=!0,this):(e!==this._transformActive&&(this._transformActive=e,this._element&&this._element._addRunner(this)),this)}return this._reseted||(this.time(0),this._reseted=!0),t&&this._transformActive&&(this._transformActive=!1,this._element&&this._element._addRunner(this)),this}reverse(t){return this._reverse=t??!this._reverse,this}schedule(t,e,r){if(t instanceof ln||(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;const e=this.done;t=t??16,this._time+=t;const r=this.position(),n=this._lastPosition!==r&&this._time>=0;this._lastPosition=r;const i=this.duration(),s=this._lastTime<=0&&this._time>0;this._lastTime=this._time,s&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&this._time>=i,this._reseted=!1;const a=this._hasTransform&&(this._time>0||0!==r);this._transformActive=a;let u=!1;return(n||o)&&(this._initialise(n),this.transforms=new Ne,u=this._run(o?t:r),this._transformActive=a,this.fire("step",this)),this.done=this.done||u&&o,this.done&&!e&&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];if(this._isDeclarative&&n.finished&&!n.isTransform)continue;const 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,this._isDeclarative&&(this.done=!1);const n=this.timeline();return n&&n.play(),!0}return!1}};dn.id=0;var fn=class{constructor(t=new Ne,e=-1,r=!0,n=!1){this.transforms=t,this.id=e,this.done=r,this._isAbsoluteTransform=n,this._transformActive=!0,this._retired=!0}};te([dn,fn],{mergeWith(t){return new fn(this._isAbsoluteTransform?this.transforms:t.transforms.lmultiply(this.transforms),t.id,!0,t._isAbsoluteTransform||this._isAbsoluteTransform)}});const mn=(t,e)=>t.lmultiplyO(e),pn=t=>t.transforms,yn=t=>t._transformActive;function gn(t){const e=t.filter(yn);let r=0;for(let t=0;t<e.length;++t)e[t]._isAbsoluteTransform&&(r=t);return e.slice(r)}function bn(){const t=gn(this._transformationRunners.runners).map(pn).reduce(mn,new Ne);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}var vn=class{constructor(){this.runners=[]}add(t){var e;if(!(0,At.default)(e=this.runners).call(e,t))return this.runners.push(t),this}edit(t,e){const r=this.runners.findIndex(e=>e.id===t);return r>=0&&this.runners.splice(r,1,e),this}getByID(t){return this.runners.find(e=>e.id===t)}length(){return this.runners.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._retired&&t._retired){this.remove(r.id);const n=r.mergeWith(t);this.edit(t.id,n),t=n,--e}else t=r}return this}remove(t){const e=this.runners.findIndex(e=>e.id===t);return e>=0&&this.runners.splice(e,1),this}};d({Element:{animate(t,e,r){const n=dn.sanitise(t,e,r),i=this.timeline();return new dn(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay,n.when)},delay(t,e){return this.animate(0,t,e)},_currentTransform(t){const e=this._transformationRunners.runners,r=e.indexOf(t);return gn(e.slice(0,r+1)).map(pn).reduce(mn,new Ne)},_addRunner(t){1===this._transformationRunners.length()&&-1===this._transformationRunners.runners[0].id&&(this._transformationRunners.runners[0].transforms=new Ne(this)),this._transformationRunners.add(t),un.cancelImmediate(this._frameId),this._frameId=un.immediate(bn.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new vn).add(new fn(new Ne(this))))}}}),te(dn,{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});const n=e,i=this._history[t];if(i&&!i.caller.initialised&&i.caller.retarget)return i.caller.retarget.call(this,n),this;if(this._tryRetarget(t,n))return this;let s=new zr(this._stepper).to(n),o=Object.keys(n);return this.queue(function(){s=s.from(this.element()[t](o))},function(e){return this.element()[t](s.at(e).valueOf()),s.done()},function(e){const r=(n=Object.keys(e),i=o,n.filter(t=>!(0,At.default)(i).call(i,t)));var n,i;if(r.length&&null!=s.from()){const e=this.element()[t](r),n=new Wr(s.from()).valueOf();Object.assign(n,e),s.from(n)}const a=new Wr(s.to()).valueOf();Object.assign(a,e),s.to(a),o=Object.keys(a)}),this._rememberMorpher(t,s),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let r=new zr(this._stepper).to(new ze(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._hasTransform=!0,this._isAbsoluteTransform=this._isAbsoluteTransform||!e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const n=Ne.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!n;const i=new zr(this._stepper).type(r?Gr:Ne),s=r?new zr(this._stepper).type(Ne):i;let o,a,u,c,h;return this.queue(function(){a=a||this.element(),o=o||Dt(t,a),h=new Ne(e?void 0:a),a._addRunner(this)},function(l){e||this.clearTransform();const{x:d,y:f}=new we(o).transform(a._currentTransform(this)),m={...t,origin:[d,f]};!0===m.relative&&delete m.relative;let p=new Ne(m),y=this._isDeclarative&&u?u:h,g=i;if(r){const t=p.decompose(d,f),e=y.decompose(d,f);if(new Gr(t).toArray().concat(new Gr(e).toArray()).every(Number.isFinite)){p=t,y=e;const r=p.rotate,n=y.rotate,i=[r-360,r,r+360],s=i.map(t=>Math.abs(t-n)),o=Math.min(...s),a=s.indexOf(o);p.rotate=i[a]}else g=s}e&&g===i&&(n||(p.rotate=t.rotate||0),this._isDeclarative&&c&&(y.rotate=c)),g.from(y),g.to(p);const b=g.at(l);return c=b.rotate,u=new Ne(b),this.addTransform(u),a._addRunner(this),g.done()},function(e){o=Dt(e,a),t={...e}},!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 ze(e),this._tryRetarget(t,e))return this;const r=new zr(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 ze(t))}),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const r=new zr(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 ze(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){const r=Lt(this._element,t,e);return this.width(r.width).height(r.height)},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 zr(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 Ee(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)}}),te(dn,{rx:tr,ry:er,from:lr,to:dr}),Jt(dn,"Runner");var wn=class extends Je{constructor(t,e=t){super($t("svg",t),e),this.namespace()}defs(){return this.isRoot()?Wt(this.node.querySelector("defs"))||this.put(new Qe):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof Ut.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:Ft,version:"1.1"}).attr("xmlns:xlink",Bt,kt):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,kt).attr("xmlns:svgjs",null,kt)}root(){return this.isRoot()?this:super.root()}};d({Container:{nested:ee(function(){return this.put(new wn)})}}),Jt(wn,"Svg",!0);var xn=class extends Je{constructor(t,e=t){super($t("symbol",t),e)}};d({Container:{symbol:ee(function(){return this.put(new xn)})}}),Jt(xn,"Symbol");var Nn=c({amove:()=>In,ax:()=>Cn,ay:()=>jn,build:()=>Ln,center:()=>Pn,cx:()=>Tn,cy:()=>An,length:()=>Sn,move:()=>Mn,plain:()=>On,x:()=>En,y:()=>_n});function On(t){return!1===this._build&&this.clear(),this.node.appendChild(Ut.document.createTextNode(t)),this}function Sn(){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 _n(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}function Mn(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}function Tn(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}function An(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}function Pn(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}function Cn(t){return this.attr("x",t)}function jn(t){return this.attr("y",t)}function In(t,e){return this.ax(t).ay(e)}function Ln(t){return this._build=!!t,this}var Dn=class extends Ke{constructor(t,e=t){super($t("text",t),e),this.dom.leading=this.dom.leading??new ze(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new ze(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){if(Vt(this.node))return;const i=Ut.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=r*new ze(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 ze(t.leading||1.3),this}writeDataToDom(){return super.writeDataToDom({leading:1.3})}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||Vt(e[n])?0===n&&(r=n+1):(n!==r&&3!==e[n].nodeType&&!0===Wt(e[n]).dom.newLined&&(t+="\n"),t+=e[n].textContent);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()}};te(Dn,Nn),d({Container:{text:ee(function(t=""){return this.put(new Dn).text(t)}),plain:ee(function(t=""){return this.put(new Dn).plain(t)})}}),Jt(Dn,"Text");var Rn=class extends Ke{constructor(t,e=t){super($t("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 Dn))return this;const e=t.index(this),r=Ut.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new ze(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)}};te(Rn,Nn),d({Tspan:{tspan:ee(function(t=""){const e=new Rn;return this._build||this.clear(),this.put(e).text(t)})},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Jt(Rn,"Tspan");var Vn=class extends Ke{constructor(t,e=t){super($t("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 ze(t).divide(2))}};te(Vn,{x:rr,y:nr,cx:ir,cy:sr,width:or,height:ar}),d({Container:{circle:ee(function(t=0){return this.put(new Vn).size(t).move(0,0)})}}),Jt(Vn,"Circle");var Fn=class extends Je{constructor(t,e=t){super($t("clipPath",t),e)}remove(){return this.targets().forEach(function(t){t.unclip()}),super.remove()}targets(){return Ce(this.node,"clip-path")}};d({Container:{clip:ee(function(){return this.defs().put(new Fn)})},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Fn?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Jt(Fn,"ClipPath");var kn=class extends We{constructor(t,e=t){super($t("foreignObject",t),e)}};d({Container:{foreignObject:ee(function(t,e){return this.put(new kn).size(t,e)})}}),Jt(kn,"ForeignObject");var Bn=c({dmove:()=>Un,dx:()=>Xn,dy:()=>Yn,height:()=>zn,move:()=>Hn,size:()=>Gn,width:()=>$n,x:()=>Wn,y:()=>qn});function Un(t,e){return this.children().forEach(r=>{let n;try{n=r.node instanceof Ut.window.SVGSVGElement?new Ee(r.attr(["x","y","width","height"])):r.bbox()}catch(t){return}const i=new Ne(r),s=i.translate(t,e).transform(i.inverse()),o=new we(n.x,n.y).transform(s);r.dmove(o.x-n.x,o.y-n.y)}),this}function Xn(t){return this.dmove(t,0)}function Yn(t){return this.dmove(0,t)}function zn(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}function Hn(t=0,e=0,r=this.bbox()){const n=t-r.x,i=e-r.y;return this.dmove(n,i)}function Gn(t,e,r=this.bbox()){const n=Lt(this,t,e,r),i=n.width/r.width,s=n.height/r.height;return this.children().forEach(t=>{const e=new we(r).transform(new Ne(t).inverse());t.scale(i,s,e.x,e.y)}),this}function $n(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}function Wn(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}function qn(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}var Jn=class extends Je{constructor(t,e=t){super($t("g",t),e)}};te(Jn,Bn),d({Container:{group:ee(function(){return this.put(new Jn)})}}),Jt(Jn,"G");var Qn=class extends Je{constructor(t,e=t){super($t("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,Bt)}};te(Qn,Bn),d({Container:{link:ee(function(t){return this.put(new Qn).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 Qn,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}}}),Jt(Qn,"A");var Kn=class extends Je{constructor(t,e=t){super($t("mask",t),e)}remove(){return this.targets().forEach(function(t){t.unmask()}),super.remove()}targets(){return Ce(this.node,"mask")}};d({Container:{mask:ee(function(){return this.defs().put(new Kn)})},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Kn?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Jt(Kn,"Mask");var Zn=class extends We{constructor(t,e=t){super($t("stop",t),e)}update(t){return("number"==typeof t||t instanceof ze)&&(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 ze(t.offset)),this}};d({Gradient:{stop:function(t,e,r){return this.put(new Zn).update(t,e,r)}}}),Jt(Zn,"Stop");var ti=class extends We{constructor(t,e=t){super($t("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+=jt(t)+":"+e[t]+";";return r+="}",r}(t,e))}};d("Dom",{style(t,e){return this.put(new ti).rule(t,e)},fontface(t,e,r){return this.put(new ti).font(t,e,r)}}),Jt(ti,"Style");var ei=class extends Dn{constructor(t,e=t){super($t("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")}};d({Container:{textPath:ee(function(t,e){return t instanceof Dn||(t=this.text(t)),t.path(e)})},Text:{path:ee(function(t,e=!0){const r=new ei;let n;if(t instanceof Jr||(t=this.defs().path(t)),r.attr("href","#"+t,Bt),e)for(;n=this.node.firstChild;)r.node.appendChild(n);return this.put(r)}),textPath(){return this.findOne("textPath")}},Path:{text:ee(function(t){return t instanceof Dn||(t=(new Dn).addTo(this.parent()).text(t)),t.path(this)}),targets(){return Ce(this.node,"href","textPath")}}}),ei.prototype.MorphArray=Xr,Jt(ei,"TextPath");var ri=class extends Ke{constructor(t,e=t){super($t("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,Bt)}};d({Container:{use:ee(function(t,e){return this.put(new ri).use(t,e)})}}),Jt(ri,"Use"),te([wn,xn,yr,mr,Er],f("viewbox")),te([Sr,sn,nn,Jr],f("marker")),te(Dn,f("Text")),te(Jr,f("Path")),te(Qe,f("Defs")),te([Dn,Rn],f("Tspan")),te([on,ur,fr,dn],f("radius")),te(Be,f("EventTarget")),te($e,f("Dom")),te(We,f("Element")),te(Ke,f("Shape")),te([Je,cr],f("Container")),te(fr,f("Gradient")),te(dn,f("Runner")),Me.extend([...new Set(l)]),function(t=[]){qr.push(...[].concat(t))}([ze,ve,Ee,Ne,Ye,gr,Xr,we]),te(qr,{to(t){return(new zr).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 ni,ii,si,oi,ai=r(726),ui=r(854),ci=r(731),hi=r(986),li=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class di{static create(t){let e=document.createElementNS("http://www.w3.org/2000/svg","text");e.textContent=t;let r=new di(e);return r.assignUUID(),r.setAttributes(di.defaultAttributes),r}static deserialized(t,e){var r;if(!(0,ui.isNonNullObject)(t))throw new Error("Saved base must be an object.");let n=null!==(r=t.id)&&void 0!==r?r:t.textId;if(!n)throw new Error("Missing base ID.");if(!(0,ui.isString)(n))throw new Error("Base IDs must be strings.");let i=e.domNode.querySelector("#"+n);if(!i)throw new Error("Unable to find nucleobase DOM node.");if(!(i instanceof SVGTextElement))throw new Error("Nucleobase DOM node must be an SVG text element.");return new di(i)}static recreate(t,e){return di.deserialized(t,e)}constructor(t){ni.add(this),this.domNode=t,ii.set(this,void 0),si.set(this,{change:[]}),this.centerPoint=new ci.CenterPoint(t),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,ii,new MutationObserver(()=>li(this,ni,"m",oi).call(this,"change"))),li(this,ii,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}serialized(){if(!this.id)throw new Error("Nucleobase ID is falsy.");return{id:this.id}}appendTo(t){t.appendChild(this.domNode)}remove(){this.domNode.remove()}isIn(t){return t.contains(this.domNode)&&t!==this.domNode}hasParent(){return!!this.domNode.parentNode}bringToFront(){(0,ai.bringToFront)(this.domNode)}sendToBack(){(0,ai.sendToBack)(this.domNode)}getAttribute(t){return this.domNode.getAttribute(t)}setAttribute(t,e){this.domNode.setAttribute(t,e)}setAttributes(t){try{new Dn(this.domNode).attr(t)}catch(t){}}get id(){return this.domNode.id}assignUUID(){(0,ai.assignUUID)(this.domNode)}get textContent(){return this.domNode.textContent}set textContent(t){this.domNode.textContent=t}isA(){var t;return"A"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isU(){var t;return"U"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isT(){var t;return"T"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isG(){var t;return"G"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}isC(){var t;return"C"===(null===(t=this.textContent)||void 0===t?void 0:t.toUpperCase())}get bbox(){return this.domNode.getBBox()}getCenterPoint(){return this.centerPoint}setCenterPoint(t){this.centerPoint.x=t.x,this.centerPoint.y=t.y}maintainingCenterPoint(t){let{x:e,y:r}=this.centerPoint;t(),this.centerPoint.x=e,this.centerPoint.y=r}get boundingClientRect(){return this.domNode.getBoundingClientRect()}get clientCenterPoint(){let t=this.domNode.getBoundingClientRect();return{x:(0,hi.mean)([t.left,t.right]),y:(0,hi.mean)([t.top,t.bottom])}}getClientCenterPoint(){return this.clientCenterPoint}addEventListener(t,e){li(this,si,"f")[t].push(e)}removeEventListener(t,e){li(this,si,"f")[t]=li(this,si,"f")[t].filter(t=>t!==e)}}ii=new WeakMap,si=new WeakMap,ni=new WeakSet,oi=function(t){li(this,si,"f")[t].forEach(t=>t())},di.defaultAttributes={"font-family":"Arial","font-size":"9","font-weight":"700"},di.defaultAttributeNames=["font-family","font-size","font-weight"];class fi{constructor(t,e){this.base1=t,this.base2=e}[Symbol.iterator](){return[this.base1,this.base2].values()}isAU(){return this.base1.isA()&&this.base2.isU()||this.base1.isU()&&this.base2.isA()}isAT(){return this.base1.isA()&&this.base2.isT()||this.base1.isT()&&this.base2.isA()}isGC(){return this.base1.isG()&&this.base2.isC()||this.base1.isC()&&this.base2.isG()}isGU(){return this.base1.isG()&&this.base2.isU()||this.base1.isU()&&this.base2.isG()}isGT(){return this.base1.isG()&&this.base2.isT()||this.base1.isT()&&this.base2.isG()}}function mi(t,e){let r=new Map;e.forEach((t,e)=>r.set(t,e));let n=[...t];return n.sort((t,e)=>{var n,i;return(null!==(n=r.get(t))&&void 0!==n?n:-1)-(null!==(i=r.get(e))&&void 0!==i?i:-1)}),n}})(),n})(),t.exports=e()},976(t){var e;e=()=>(()=>{var t={645(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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 matching(t){let{x:r,y:n,width:i,height:s}=t;return new e(r,n,i,s)}static bounding(r){let n=[...r];if(0==n.length)throw new Error("An empty collection of boxes doesn't have a bounding box.");let i=n.map(t=>e.matching(t)),s=(0,t.min)(i.map(t=>t.left)),o=(0,t.min)(i.map(t=>t.top)),a=(0,t.max)(i.map(t=>t.right))-s,u=(0,t.max)(i.map(t=>t.bottom))-o;return new e(s,o,a,u)}constructor(t,e,r,n){this.x=t,this.y=e,this.width=r,this.height=n}get centerX(){return this.minX+this.width/2}get centerY(){return this.minY+this.height/2}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}bounds(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){let r="number"==typeof t[0]?t[0]:"factor"in t[0]?t[0].factor*this.width:t[0].percentage/100*this.width,n="number"==typeof t[0]&&"number"==typeof t[1]?t[1]:"number"==typeof t[0]?t[0]:"factor"in t[0]?t[0].factor*this.height:t[0].percentage/100*this.height;return new e(this.x-r,this.y-n,this.width+2*r,this.height+2*n)}get periphery(){return{atAngle:t=>{let e=this.width/2,r=this.height/2,n=Math.pow(Math.pow(e,2)+Math.pow(r,2),.5),i=this.centerX+n*Math.cos(t),s=this.centerY+n*Math.sin(t),o=n;return Math.abs(this.centerX-i)>e&&(o=Math.abs(e/Math.cos(t)),o=Number.isFinite(o)?o:r),Math.abs(this.centerY-s)>r&&(o=Math.abs(r/Math.sin(t)),o=Number.isFinite(o)?o:e),{x:this.centerX+o*Math.cos(t),y:this.centerY+o*Math.sin(t)}}}}}})(),n})(),t.exports=e()},153(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){var e=0;return t.forEach(function(t){return e+=t}),e}function i(t){return n(t)/t.length}function s(t){t.sort(function(t,e){return t-e})}t.r(e),t.d(e,{areWithin:()=>m,average:()=>i,clamp:()=>f,degrees:()=>b,distance:()=>r,flipAway:()=>x,isBetween:()=>l,isBetweenExclusive:()=>d,isBetweenInclusive:()=>l,max:()=>h,mean:()=>i,median:()=>u,min:()=>c,normalizeAngle:()=>w,radians:()=>v,round:()=>g,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>p,sortedNumbers:()=>a,sortedNumbersAscending:()=>a,sortedNumbersDescending:()=>y,sum:()=>n});var o=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 a(t){var e=o([],t,!0);return s(e),e}function u(t){if(0==t.length)return NaN;var e=a(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];var r=e.length/2,n=r-1;return i([e[r],e[n]])}function c(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,r){return t>=e&&t<=r}function d(t,e,r){return t>e&&t<r}function f(t,e,r){return t<e?e:t>r?r:t}function m(t,e,r){return Math.abs(t-e)<=r}function p(t){s(t),t.reverse()}function y(t){var e=a(t);return e.reverse(),e}function g(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function b(t){return t*(180/Math.PI)}function v(t){return t*(Math.PI/180)}function w(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function x(t,e){var r=(e=w(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperties(t,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{StrungElement:()=>d});var t=r(725),e=r(986);const i=r=>({closestLength(n){let i=0,s=r.length;for(let o=0;o<15;o++)(0,t.distance)(n,r.atLength(i))<(0,t.distance)(n,r.atLength(s))?s=(0,e.average)([i,s]):i=(0,e.average)([i,s]);return(0,e.average)([i,s])}});var s,o,a,u,c,h,l=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class d{constructor(t,e){s.add(this),this.owner=e,o.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,o,t),t.domNode.dataset.lineX||l(this,s,"m",a).call(this),t.domNode.dataset.displacementMagnitude&&t.domNode.dataset.displacementDirection||l(this,s,"m",u).call(this),e.addEventListener("change",()=>l(this,s,"m",h).call(this))}get domNode(){return l(this,o,"f").domNode}get rotation(){let t;return t=l(this,o,"f").domNode.dataset.rotation?Number.parseFloat(l(this,o,"f").domNode.dataset.rotation):0,Number.isFinite(t)||(t=0),t}set rotation(t){Number.isFinite(t)?(l(this,o,"f").domNode.dataset.rotation=`${t}`,l(this,s,"m",h).call(this)):console.error(`The specified rotation is nonfinite: ${t}.`)}get lineX(){let t;return t=l(this,o,"f").domNode.dataset.lineX?Number.parseFloat(l(this,o,"f").domNode.dataset.lineX):0,Number.isFinite(t)||(t=0),t}set lineX(t){Number.isFinite(t)?(t<-this.owner.length/2?t=-this.owner.length/2:t>this.owner.length/2&&(t=this.owner.length/2),l(this,o,"f").domNode.dataset.lineX=`${t}`,l(this,s,"m",h).call(this)):console.error(`The specified line X coordinate is nonfinite: ${t}.`)}get displacementMagnitude(){let t;return t=l(this,o,"f").domNode.dataset.displacementMagnitude?Number.parseFloat(l(this,o,"f").domNode.dataset.displacementMagnitude):0,Number.isFinite(t)||(t=0),t}set displacementMagnitude(t){Number.isFinite(t)?(l(this,o,"f").domNode.dataset.displacementMagnitude=`${t}`,l(this,s,"m",h).call(this)):console.error(`The specified displacement magnitude is nonfinite: ${t}.`)}get displacementDirection(){let t;return t=l(this,o,"f").domNode.dataset.displacementDirection?Number.parseFloat(l(this,o,"f").domNode.dataset.displacementDirection):0,Number.isFinite(t)||(t=0),t}set displacementDirection(t){Number.isFinite(t)?(l(this,o,"f").domNode.dataset.displacementDirection=`${t}`,l(this,s,"m",h).call(this)):console.error(`The specified displacement direction is nonfinite: ${t}.`)}get displacementX(){return this.displacementMagnitude*Math.cos(this.displacementDirection)}set displacementX(t){if(!Number.isFinite(t))return void console.error(`The specified displacement X component is nonfinite: ${t}.`);let e=this.displacementY;this.displacementMagnitude=Math.pow(Math.pow(t,2)+Math.pow(e,2),.5),this.displacementDirection=Math.atan2(e,t)}get displacementY(){return this.displacementMagnitude*Math.sin(this.displacementDirection)}set displacementY(t){if(!Number.isFinite(t))return void console.error(`The specified displacement Y component is nonfinite: ${t}.`);let e=this.displacementX;this.displacementMagnitude=Math.pow(Math.pow(e,2)+Math.pow(t,2),.5),this.displacementDirection=Math.atan2(t,e)}reanchor(){let t={x:l(this,o,"f").centerX,y:l(this,o,"f").centerY};l(this,o,"f").domNode.dataset.lineX=""+(i(this.owner).closestLength(t)-this.owner.length/2),l(this,o,"f").domNode.dataset.displacementMagnitude="0",l(this,s,"m",h).call(this)}drag(t,e,r){var n;if(!Number.isFinite(t))return void console.error(`The specified drag X value is nonfinite: ${t}.`);if(!Number.isFinite(e))return void console.error(`The specified drag Y value is nonfinite: ${e}.`);if(null===(n=null==r?void 0:r.dragGroup)||void 0===n?void 0:n.has(this.owner))return;let i=Math.pow(Math.pow(t,2)+Math.pow(e,2),.5),o=Math.atan2(e,t),a=l(this,s,"a",c);this.displacementX+=i*Math.cos(o-a.direction),this.displacementY+=i*Math.sin(o-a.direction)}}o=new WeakMap,s=new WeakSet,a=function(){let t={x:l(this,o,"f").centerX,y:l(this,o,"f").centerY},e=this.owner.length/2;l(this,o,"f").domNode.dataset.lineX=""+(i(this.owner).closestLength(t)-e)},u=function(){let e=l(this,s,"a",c),r={x:l(this,o,"f").centerX,y:l(this,o,"f").centerY};l(this,o,"f").domNode.dataset.displacementMagnitude=`${(0,t.distance)(e,r)}`,l(this,o,"f").domNode.dataset.displacementDirection=""+((0,t.direction)(e,r)-e.direction)},c=function(){let t=this.owner.length/2;return this.owner.atLength(t+this.lineX)},h=function(){let t=l(this,s,"a",c);l(this,o,"f").centerX=t.x+this.displacementMagnitude*Math.cos(this.displacementDirection+t.direction),l(this,o,"f").centerY=t.y+this.displacementMagnitude*Math.sin(this.displacementDirection+t.direction),"direction"in l(this,o,"f")&&(l(this,o,"f").direction=t.direction+this.rotation)}})(),n})(),t.exports=e()},731(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,{CenterPoint:()=>c});var r,n,i,s,o,a=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},u=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class c{constructor(t){r.add(this),n.set(this,void 0),i.set(this,{move:[]}),s.set(this,void 0),a(this,n,t,"f"),a(this,s,new MutationObserver(()=>u(this,r,"m",o).call(this,"move")),"f"),u(this,s,"f").observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}get x(){let t=u(this,n,"f").getBBox();return t.x+t.width/2}set x(t){let e=this.x,r=[...u(this,n,"f").x.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("x",r.join(", "))}get y(){let t=u(this,n,"f").getBBox();return t.y+t.height/2}set y(t){let e=this.y,r=[...u(this,n,"f").y.baseVal].map(t=>t.value);0!=r.length||r.push(0),r=r.map(r=>r+(t-e)),u(this,n,"f").setAttribute("y",r.join(", "))}addEventListener(t,e){u(this,i,"f")[t].push(e)}removeEventListener(t,e){u(this,i,"f")[t]=u(this,i,"f")[t].filter(t=>t!==e)}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakSet,o=function(t){u(this,i,"f")[t].forEach(t=>t())},e})(),t.exports=e()},456(t){var e;e=()=>(()=>{var t={986(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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return e})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()},277(t){var e;e=()=>(()=>{var t={854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),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,{Vector:()=>e,isFiniteVectorLike:()=>s,isVectorLike:()=>i});var t=r(854);class e{static matching(t){let r="x"in t?t.x:t.magnitude*Math.cos(t.direction),n="y"in t?t.y:t.magnitude*Math.sin(t.direction);return new e(r,n)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}set magnitude(t){let e=this.direction;this.x=t*Math.cos(e),this.y=t*Math.sin(e)}get direction(){return Math.atan2(this.y,this.x)}set direction(t){let e=this.magnitude;this.x=e*Math.cos(t),this.y=e*Math.sin(t)}isFinite(){return(0,t.isFiniteNumber)(this.x)&&(0,t.isFiniteNumber)(this.y)}}function i(e){return!(!(0,t.isNonNullObject)(e)||!((0,t.isNumber)(e.x)&&(0,t.isNumber)(e.y)||(0,t.isNumber)(e.magnitude)&&(0,t.isNumber)(e.direction)))}function s(t){return!!i(t)&&e.matching(t).isFinite()}})(),n})(),t.exports=e()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{FinitePoint:()=>s,Point:()=>i,RelativePoint:()=>d,midpoint:()=>m});var t=r(277),e=r(854);class i{static matching(t){return new i(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}set(t){(0,e.isNumber)(null==t?void 0:t.x)&&(this.x=t.x),(0,e.isNumber)(null==t?void 0:t.y)&&(this.y=t.y)}drag(t,e){this.displace({x:t,y:e})}displace(e){let r=t.Vector.matching(e);this.x+=r.x,this.y+=r.y}displaced(t){let e=i.matching(this);return e.displace(t),e}displacementTo(e){return new t.Vector(e.x-this.x,e.y-this.y)}displacementFrom(e){return new t.Vector(this.x-e.x,this.y-e.y)}distanceTo(t){return this.displacementTo(t).magnitude}distanceFrom(t){return this.distanceTo(t)}directionTo(t){return this.displacementTo(t).direction}directionFrom(t){return this.displacementFrom(t).direction}deepCopy(){return new i(this.x,this.y)}}class s extends i{static matching(t){let e=i.matching(t);return new s(e.x,e.y)}constructor(t,r){if(super(t,r),!(0,e.isFiniteNumber)(t)||!(0,e.isFiniteNumber)(r))throw new Error(`Finite points must have finite number coordinates: (${t}, ${r}).`)}set(...t){let e=new i(0,0);e.set(...t),s.matching(e),super.set(...t)}}var o,a,u,c,h,l=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class d{constructor(e){o.add(this),a.set(this,void 0),u.set(this,new t.Vector(0,0)),c.set(this,{move:[]}),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,a,e),e.addEventListener("move",()=>l(this,o,"m",h).call(this,"move"))}get x(){return l(this,a,"f").x+l(this,u,"f").x}set x(t){l(this,u,"f").x=t-l(this,a,"f").x,l(this,o,"m",h).call(this,"move")}get y(){return l(this,a,"f").y+l(this,u,"f").y}set y(t){l(this,u,"f").y=t-l(this,a,"f").y,l(this,o,"m",h).call(this,"move")}addEventListener(t,e){l(this,c,"f")[t].push(e)}removeEventListener(t,e){l(this,c,"f")[t]=l(this,c,"f")[t].filter(t=>t!==e)}}a=new WeakMap,u=new WeakMap,c=new WeakMap,o=new WeakSet,h=function(t){l(this,c,"f")[t].forEach(t=>t())};var f=r(986);function m(t,e){return new i((0,f.average)([t.x,e.x]),(0,f.average)([t.y,e.y]))}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperties(t,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Circle:()=>d,Rectangle:()=>w,StrungCircle:()=>L,StrungElement:()=>U,StrungRectangle:()=>V,StrungText:()=>C,StrungTriangle:()=>B,Text:()=>l,Triangle:()=>M});const t={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let e;const i=new Uint8Array(16),s=[];for(let t=0;t<256;++t)s.push((t+256).toString(16).slice(1));function o(t,r,n){const o=(t=t||{}).random??t.rng?.()??function(){if(!e){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");e=crypto.getRandomValues.bind(crypto)}return e(i)}();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,r){if((n=n||0)<0||n+16>r.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let t=0;t<16;++t)r[n+t]=o[t];return r}return function(t,e=0){return(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase()}(o)}const a=function(e,r,n){return!t.randomUUID||r||e?o(e,r,n):t.randomUUID()};var u=r(645),c=r(731),h=r(854);class l{static create(t){let e=document.createElementNS("http://www.w3.org/2000/svg","text");return e.id="id-"+a(),e.textContent=null!=t?t:"",e.setAttribute("font-family","Arial"),e.setAttribute("font-size","9"),e.setAttribute("font-weight","700"),e.setAttribute("font-style","normal"),e.setAttribute("fill","black"),e.setAttribute("fill-opacity","1"),new l(e)}constructor(t){this.domNode=t}get id(){return this.domNode.id}get bbox(){return u.Box.matching(this.domNode.getBBox())}get centerX(){return this.bbox.centerX}set centerX(t){new c.CenterPoint(this.domNode).x=t}get centerY(){return this.bbox.centerY}set centerY(t){new c.CenterPoint(this.domNode).y=t}drag(t,e){this.centerX+=t,this.centerY+=e}serialized(){if(!this.id)throw new Error("Text element ID is falsy.");return{id:this.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved text element is not an object: ${t}.`);if(!t.id)throw new Error("Saved text element ID is falsy.");if(!(0,h.isString)(t.id))throw new Error(`Saved text element ID is not a string: ${t.id}.`);let r=e.domNode.querySelector("#"+t.id);if(!r)throw new Error("Unable to find text element DOM node in parent drawing by ID.");if(!(r instanceof SVGTextElement))throw new Error(`Text element DOM node is not an SVG text element: ${r}.`);return new l(r)}}class d{static create(){let t=document.createElementNS("http://www.w3.org/2000/svg","circle");return t.id="id-"+a(),t.setAttribute("r","6"),t.setAttribute("stroke","black"),t.setAttribute("stroke-width","1"),t.setAttribute("stroke-opacity","1"),t.setAttribute("stroke-dasharray",""),t.setAttribute("stroke-linecap",""),t.setAttribute("fill","white"),t.setAttribute("fill-opacity","1"),new d(t)}constructor(t){this.domNode=t}get id(){return this.domNode.id}get centerX(){return this.domNode.cx.baseVal.value}set centerX(t){this.domNode.setAttribute("cx",`${t}`)}get centerY(){return this.domNode.cy.baseVal.value}set centerY(t){this.domNode.setAttribute("cy",`${t}`)}drag(t,e){this.centerX+=t,this.centerY+=e}serialized(){if(!this.id)throw new Error("Circle ID is falsy.");return{id:this.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved circle must be an object: ${t}.`);if(!t.id)throw new Error("Saved circle ID is falsy.");if(!(0,h.isString)(t.id))throw new Error(`Saved circle ID must be a string: ${t.id}.`);let r=e.domNode.querySelector("#"+t.id);if(!r)throw new Error("Unable to find circle element DOM node by ID.");if(!(r instanceof SVGCircleElement))throw new Error(`Circle element DOM node is not an SVG circle element: ${r}.`);return new d(r)}}var f=r(456);class m{constructor(){this.centerX=0,this.centerY=0,this.direction=-Math.PI/2,this.width=0,this.height=0,this.cornerRadius=0}static matching(t){let e=new m;return e.centerX=t.centerX,e.centerY=t.centerY,e.direction=t.direction,e.width=t.width,e.height=t.height,e.cornerRadius=t.cornerRadius,e}toString(){let t=new f.Point(this.centerX,this.centerY);t.displace({magnitude:this.height/2,direction:this.direction}),t.displace({magnitude:this.width/2-this.cornerRadius,direction:this.direction+Math.PI/2});let e=`M ${t.x} ${t.y}`;return t.displace({magnitude:Math.SQRT2*this.cornerRadius,direction:this.direction+3*Math.PI/4}),e+=` A ${this.cornerRadius} ${this.cornerRadius} 90 0 1 ${t.x} ${t.y}`,t.displace({magnitude:this.height-2*this.cornerRadius,direction:this.direction+Math.PI}),e+=` L ${t.x} ${t.y}`,t.displace({magnitude:Math.SQRT2*this.cornerRadius,direction:this.direction+5*Math.PI/4}),e+=` A ${this.cornerRadius} ${this.cornerRadius} 90 0 1 ${t.x} ${t.y}`,t.displace({magnitude:this.width-2*this.cornerRadius,direction:this.direction+3*Math.PI/2}),e+=` L ${t.x} ${t.y}`,t.displace({magnitude:Math.SQRT2*this.cornerRadius,direction:this.direction+7*Math.PI/4}),e+=` A ${this.cornerRadius} ${this.cornerRadius} 90 0 1 ${t.x} ${t.y}`,t.displace({magnitude:this.height-2*this.cornerRadius,direction:this.direction}),e+=` L ${t.x} ${t.y}`,t.displace({magnitude:Math.SQRT2*this.cornerRadius,direction:this.direction+9*Math.PI/4}),e+=` A ${this.cornerRadius} ${this.cornerRadius} 90 0 1 ${t.x} ${t.y}`,e+=" Z",e}}var p,y,g,b,v=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{static create(){let t=document.createElementNS("http://www.w3.org/2000/svg","path");t.id="id-"+a();let e=new w(t);return e.centerX=0,e.centerY=0,e.direction=-Math.PI/2,e.width=5.5,e.height=5.5,e.cornerRadius=0,e.domNode.setAttribute("stroke","black"),e.domNode.setAttribute("stroke-width","1"),e.domNode.setAttribute("stroke-opacity","1"),e.domNode.setAttribute("stroke-linejoin",""),e.domNode.setAttribute("stroke-dasharray",""),e.domNode.setAttribute("stroke-linecap",""),e.domNode.setAttribute("fill","white"),e.domNode.setAttribute("fill-opacity","1"),e}constructor(t){p.add(this),this.domNode=t,t.dataset.centerX||v(this,p,"m",y).call(this),t.dataset.centerY||v(this,p,"m",g).call(this)}get id(){return this.domNode.id}get centerX(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.centerX)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set centerX(t){Number.isFinite(t)?(this.domNode.dataset.centerX=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified center X coordinate is nonfinite: ${t}.`)}get centerY(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.centerY)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set centerY(t){Number.isFinite(t)?(this.domNode.dataset.centerY=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified center Y coordinate is nonfinite: ${t}.`)}drag(t,e){this.centerX+=t,this.centerY+=e}get direction(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.direction)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set direction(t){Number.isFinite(t)?(this.domNode.dataset.direction=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified direction angle is nonfinite: ${t}.`)}get width(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.width)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set width(t){Number.isFinite(t)?(this.domNode.dataset.width=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified width is nonfinite: ${t}.`)}get height(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.height)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set height(t){Number.isFinite(t)?(this.domNode.dataset.height=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified height is nonfinite: ${t}.`)}get cornerRadius(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.cornerRadius)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set cornerRadius(t){Number.isFinite(t)?(this.domNode.dataset.cornerRadius=`${t}`,v(this,p,"m",b).call(this)):console.error(`The specified corner radius is nonfinite: ${t}.`)}get bbox(){return u.Box.matching(this.domNode.getBBox())}serialized(){if(!this.id)throw new Error("Rectangle ID is falsy.");return{id:this.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved rectangle is not an object: ${t}.`);if(!t.id)throw new Error("Saved rectangle ID is falsy.");if(!(0,h.isString)(t.id))throw new Error(`Saved rectangle ID is not a string: ${t.id}.`);let r=e.domNode.querySelector("#"+t.id);if(!r)throw new Error("Unable to find saved rectangle DOM node in parent drawing by ID.");if(!(r instanceof SVGPathElement))throw new Error(`DOM node found for saved rectangle is not an SVG path element: ${r}.`);let n=new w(r);return(0,h.isFiniteNumber)(t.width)&&(n.domNode.dataset.width=`${t.width}`),(0,h.isFiniteNumber)(t.height)&&(n.domNode.dataset.height=`${t.height}`),(0,h.isFiniteNumber)(t.borderRadius)&&(n.domNode.dataset.cornerRadius=`${t.borderRadius}`),n}}p=new WeakSet,y=function(){let t=u.Box.matching(this.domNode.getBBox());this.domNode.dataset.centerX=`${t.centerX}`},g=function(){let t=u.Box.matching(this.domNode.getBBox());this.domNode.dataset.centerY=`${t.centerY}`},b=function(){let t=new m;t.centerX=this.centerX,t.centerY=this.centerY,t.direction=this.direction,t.width=this.width,t.height=this.height,t.cornerRadius=this.cornerRadius,this.domNode.setAttribute("d",t.toString())};class x{constructor(){this.centerX=0,this.centerY=0,this.direction=-Math.PI/2,this.width=0,this.height=0,this.tailsHeight=0}static matching(t){let e=new x;return e.centerX=t.centerX,e.centerY=t.centerY,e.direction=t.direction,e.width=t.width,e.height=t.height,e.tailsHeight=t.tailsHeight,e}toString(){let t=new f.Point(this.centerX,this.centerY),e=t.displaced({magnitude:this.height/2,direction:this.direction}),r=t.displaced({magnitude:this.width/2,direction:this.direction-Math.PI/2}).displaced({magnitude:this.height/2,direction:this.direction+Math.PI}),n=t.displaced({magnitude:this.width/2,direction:this.direction+Math.PI/2}).displaced({magnitude:this.height/2,direction:this.direction+Math.PI}),i=t.displaced({magnitude:this.height/2-this.tailsHeight,direction:this.direction+Math.PI});return`M ${e.x} ${e.y} L ${n.x} ${n.y} L ${i.x} ${i.y} L ${r.x} ${r.y} Z`}}var N,O,S,E,_=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class M{static create(){let t=document.createElementNS("http://www.w3.org/2000/svg","path");t.id="id-"+a();let e=new M(t);return e.centerX=0,e.centerY=0,e.direction=-Math.PI/2,e.width=6.5,e.height=6.5,e.tailsHeight=0,e.domNode.setAttribute("stroke","black"),e.domNode.setAttribute("stroke-width","1"),e.domNode.setAttribute("stroke-opacity","1"),e.domNode.setAttribute("stroke-linejoin",""),e.domNode.setAttribute("stroke-dasharray",""),e.domNode.setAttribute("stroke-linecap",""),e.domNode.setAttribute("fill","white"),e.domNode.setAttribute("fill-opacity","1"),e}constructor(t){N.add(this),this.domNode=t,t.dataset.centerX||_(this,N,"m",O).call(this),t.dataset.centerY||_(this,N,"m",S).call(this)}get id(){return this.domNode.id}get centerX(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.centerX)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set centerX(t){Number.isFinite(t)?(this.domNode.dataset.centerX=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified center X coordinate is nonfinite: ${t}.`)}get centerY(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.centerY)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set centerY(t){Number.isFinite(t)?(this.domNode.dataset.centerY=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified center Y coordinate is nonfinite: ${t}.`)}drag(t,e){this.centerX+=t,this.centerY+=e}get direction(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.direction)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set direction(t){Number.isFinite(t)?(this.domNode.dataset.direction=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified direction angle is nonfinite: ${t}.`)}get width(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.width)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set width(t){Number.isFinite(t)?(this.domNode.dataset.width=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified width is nonfinite: ${t}.`)}get height(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.height)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set height(t){Number.isFinite(t)?(this.domNode.dataset.height=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified height is nonfinite: ${t}.`)}get tailsHeight(){var t;let e=Number.parseFloat(null!==(t=this.domNode.dataset.tailsHeight)&&void 0!==t?t:"");return Number.isFinite(e)?e:0}set tailsHeight(t){Number.isFinite(t)?(this.domNode.dataset.tailsHeight=`${t}`,_(this,N,"m",E).call(this)):console.error(`The specified tails height is nonfinite: ${t}.`)}get bbox(){return u.Box.matching(this.domNode.getBBox())}serialized(){if(!this.id)throw new Error("Triangle ID is falsy.");return{id:this.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved triangle is not an object: ${t}.`);if(!t.id)throw new Error("Saved triangle ID is falsy.");if(!(0,h.isString)(t.id))throw new Error(`Saved triangle ID is not a string: ${t.id}.`);let r=e.domNode.querySelector("#"+t.id);if(!r)throw new Error("Unable to find saved triangle DOM node in parent drawing by ID.");if(!(r instanceof SVGPathElement))throw new Error(`DOM node found for saved triangle is not an SVG path element: ${r}.`);let n=new M(r);return(0,h.isFiniteNumber)(t.width)&&(n.domNode.dataset.width=`${t.width}`),(0,h.isFiniteNumber)(t.height)&&(n.domNode.dataset.height=`${t.height}`),(0,h.isFiniteNumber)(t.tailsHeight)&&(n.domNode.dataset.tailsHeight=`${t.tailsHeight}`),n}}N=new WeakSet,O=function(){let t=u.Box.matching(this.domNode.getBBox());this.domNode.dataset.centerX=`${t.centerX}`},S=function(){let t=u.Box.matching(this.domNode.getBBox());this.domNode.dataset.centerY=`${t.centerY}`},E=function(){let t=new x;t.centerX=this.centerX,t.centerY=this.centerY,t.direction=this.direction,t.width=this.width,t.height=this.height,t.tailsHeight=this.tailsHeight,this.domNode.setAttribute("d",t.toString())};var T,A=r(153),P=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class C extends A.StrungElement{static on(t){let e=l.create();e.domNode.textContent="Text",e.domNode.setAttribute("font-size","7");let r=new C(e,t);return r.lineX=0,r.displacementMagnitude=0,r}constructor(t,e){super(t,e),T.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,T,t)}get textContent(){return this.domNode.textContent}serialized(){return{text:P(this,T,"f").serialized(),ownerID:this.owner.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung text isn't an object: ${t}.`);let r=l.recreate(t.text,e);if(!(0,h.isString)(t.ownerID))throw new Error(`Saved strung text owner ID isn't a string: ${t.ownerID}.`);if(!t.ownerID)throw new Error("Saved strung text owner ID is an empty string.");let n=e.bonds.find(e=>e.id==t.ownerID);if(!n)throw new Error(`Saved strung text owner wasn't found in the parent drawing: ${t}.`);return new C(r,n)}}T=new WeakMap;var j,I=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class L extends A.StrungElement{static on(t){let e=d.create();e.domNode.setAttribute("r","3");let r=new L(e,t);return r.lineX=0,r.displacementMagnitude=0,r}constructor(t,e){super(t,e),j.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,j,t)}serialized(){return{circle:I(this,j,"f").serialized(),ownerID:this.owner.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung circle isn't an object: ${t}.`);let r=d.recreate(t.circle,e);if(!(0,h.isString)(t.ownerID))throw new Error(`Saved strung circle owner ID isn't a string: ${t.ownerID}.`);if(!t.ownerID)throw new Error("Saved strung circle owner ID is an empty string.");let n=e.bonds.find(e=>e.id===t.ownerID);if(!n)throw new Error(`Saved strung circle owner wasn't found in the parent drawing: ${t}.`);return new L(r,n)}}j=new WeakMap;var D,R=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class V extends A.StrungElement{static on(t){let e=w.create(),r=new V(e,t);return r.lineX=0,r.displacementMagnitude=0,r}constructor(t,e){super(t,e),D.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,D,t)}get width(){return R(this,D,"f").width}set width(t){R(this,D,"f").width=t}get height(){return R(this,D,"f").height}set height(t){R(this,D,"f").height=t}get cornerRadius(){return R(this,D,"f").cornerRadius}set cornerRadius(t){R(this,D,"f").cornerRadius=t}serialized(){return{rectangle:R(this,D,"f").serialized(),ownerID:this.owner.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung rectangle isn't an object: ${t}.`);let r=w.recreate(t.rectangle,e);if(!(0,h.isString)(t.ownerID))throw new Error(`Saved strung rectangle owner ID isn't a string: ${t.ownerID}.`);if(!t.ownerID)throw new Error("Saved strung rectangle owner ID is an empty string.");let n=e.bonds.find(e=>e.id===t.ownerID);if(!n)throw new Error(`Saved strung rectangle owner wasn't found in the parent drawing: ${t}.`);return(0,h.isFiniteNumber)(t.rotation)&&(r.domNode.dataset.rotation=`${t.rotation}`),new V(r,n)}}D=new WeakMap;var F,k=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class B extends A.StrungElement{static on(t){let e=M.create(),r=new B(e,t);return r.lineX=0,r.displacementMagnitude=0,r}constructor(t,e){super(t,e),F.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,F,t)}get width(){return k(this,F,"f").width}set width(t){k(this,F,"f").width=t}get height(){return k(this,F,"f").height}set height(t){k(this,F,"f").height=t}get tailsHeight(){return k(this,F,"f").tailsHeight}set tailsHeight(t){k(this,F,"f").tailsHeight=t}serialized(){return{triangle:k(this,F,"f").serialized(),ownerID:this.owner.id}}static recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung triangle isn't an object: ${t}.`);let r=M.recreate(t.triangle,e);if(!(0,h.isString)(t.ownerID))throw new Error(`Saved strung triangle owner ID isn't a string: ${t.ownerID}.`);if(!t.ownerID)throw new Error("Saved strung triangle owner ID is an empty string.");let n=e.bonds.find(e=>e.id===t.ownerID);if(!n)throw new Error(`Saved strung triangle owner wasn't found in the parent drawing: ${t}.`);return(0,h.isFiniteNumber)(t.rotation)&&(r.domNode.dataset.rotation=`${t.rotation}`),new B(r,n)}}F=new WeakMap;const U={recreate(t,e){if(!(0,h.isNonNullObject)(t))throw new Error(`Saved strung element isn't an object: ${t}.`);if("text"in t)return C.recreate(t,e);if("circle"in t)return L.recreate(t,e);if("rectangle"in t)return V.recreate(t,e);if("triangle"in t)return B.recreate(t,e);throw new Error(`Saved strung element doesn't have a recognized element type: ${t}.`)}}})(),n})(),t.exports=e()},726(t){var e;e=()=>(()=>{var t={725(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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{AbstractPath:()=>Q,Circle:()=>u,CoordinateSystem:()=>ot,Ellipse:()=>c,ForeignObject:()=>H,HorizontalClientScaling:()=>ut,Image:()=>Y,InnerXML:()=>mt,Line:()=>a,OuterXML:()=>gt,Path:()=>X,Polygon:()=>p,Polyline:()=>m,Rect:()=>h,SVG:()=>t,Scaling:()=>at,Text:()=>o,Texts:()=>J,Use:()=>z,VerticalClientScaling:()=>ct,assignUUID:()=>st,bringToFront:()=>ht,drawOnCanvas:()=>xt,isSVGGraphicsElement:()=>bt,isSVGGraphicsElementsArray:()=>wt,sendToBack:()=>lt,setAttributes:()=>et,shift:()=>G});class t{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var e,i=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class s{constructor(t){e.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,e,t)}isEmpty(){return 0==i(this,e,"f").numberOfItems}shift(t){for(let r=0;r<i(this,e,"f").numberOfItems;r++)i(this,e,"f").getItem(r).value+=t}}e=new WeakMap;class o{constructor(t){this.domNode=t}shift(t,e){let r=new s(this.domNode.x.baseVal),n=new s(this.domNode.y.baseVal);r.shift(t),n.shift(e),r.isEmpty()&&this.domNode.setAttribute("x",`${t}`),n.isEmpty()&&this.domNode.setAttribute("y",`${e}`),this.domNode.querySelectorAll("tspan").forEach(r=>{new s(r.x.baseVal).shift(t),new s(r.y.baseVal).shift(e)})}}class a{constructor(t){this.domNode=t}shift(t,e){this.domNode.x1.baseVal.value+=t,this.domNode.y1.baseVal.value+=e,this.domNode.x2.baseVal.value+=t,this.domNode.y2.baseVal.value+=e}}class u{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class c{constructor(t){this.domNode=t}shift(t,e){this.domNode.cx.baseVal.value+=t,this.domNode.cy.baseVal.value+=e}}class h{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}var l,d=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(t){l.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,l,t)}shift(t,e){for(let r=0;r<d(this,l,"f").numberOfItems;r++){let n=d(this,l,"f").getItem(r);n.x+=t,n.y+=e}}}l=new WeakMap;class m{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}class p{constructor(t){this.domNode=t}shift(t,e){new f(this.domNode.points).shift(t,e)}}var y=r(725);const g=" ";function b([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function v(...t){for(let e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof t[e]} == typeof ${t[e]}`);return!0}const w=Math.PI;function x(t,e,r){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;let{rX:n,rY:i}=t;const{x:s,y:o}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+s)/2,t.cY=(r+o)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*w,[u,c]=b([(e-s)/2,(r-o)/2],-a),h=Math.pow(u,2)/Math.pow(n,2)+Math.pow(c,2)/Math.pow(i,2);1<h&&(n*=Math.sqrt(h),i*=Math.sqrt(h)),t.rX=n,t.rY=i;const l=Math.pow(n,2)*Math.pow(c,2)+Math.pow(i,2)*Math.pow(u,2),d=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-l)/l)),f=n*c/i*d,m=-i*u/n*d,p=b([f,m],a);t.cX=p[0]+(e+s)/2,t.cY=p[1]+(r+o)/2,t.phi1=Math.atan2((c-m)/i,(u-f)/n),t.phi2=Math.atan2((-c-m)/i,(-u-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*w),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*w),t.phi1*=180/w,t.phi2*=180/w}function N(t,e,r){v(t,e,r);const n=t*t+e*e-r*r;if(0>n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];const i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}const O=Math.PI/180;function S(t,e,r){return(1-r)*t+r*e}function E(t,e,r,n){return t+Math.cos(n/180*w)*e+Math.sin(n/180*w)*r}function _(t,e,r,n){const i=1e-6,s=e-t,o=r-e,a=3*s+3*(n-r)-6*o,u=6*(o-s),c=3*s;return Math.abs(a)<i?Math.abs(u)<i?[]:[-c/u]:function(t,e,r=1e-6){const n=t*t/4-e;if(n<-r)return[];if(n<=r)return[-t/2];const i=Math.sqrt(n);return[-t/2-i,-t/2+i]}(u/a,c/a,i)}function M(t,e,r,n,i){const s=1-i;return t*(s*s*s)+e*(3*s*s*i)+r*(3*s*i*i)+n*(i*i*i)}function T(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],s=r[0]-t[0],o=r[1]-t[1],a=n*o-i*s;if(!(Math.abs(a)<1e-10))return!1;const u=n*s+i*o,c=s*s+o*o;return 0<=u&&u<=c&&n*n+i*i<=c}function A(t){const e=t[t.length-1]?.type===B.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:B.MOVE_TO,relative:!1,x:t[r].x,y:t[r].y}];for(let e=r;e>0;e--){const r=t[e],i=t[e-1];if(r.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(r.type){case B.HORIZ_LINE_TO:n.push({type:B.HORIZ_LINE_TO,relative:!1,x:i.x});break;case B.VERT_LINE_TO:n.push({type:B.VERT_LINE_TO,relative:!1,y:i.y});break;case B.LINE_TO:case B.MOVE_TO:n.push({type:B.LINE_TO,relative:!1,x:i.x,y:i.y});break;case B.CURVE_TO:n.push({type:B.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case B.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case B.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case B.ARC:throw new Error("Unsupported command: A (arc)");case B.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:B.CLOSE_PATH}),n}function P(){return I((t,e,r)=>(t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=r),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=r),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=r),t.relative=!1),t))}function C(){let t=NaN,e=NaN,r=NaN,n=NaN;return I((i,s,o)=>(i.type&B.SMOOTH_CURVE_TO&&(i.type=B.CURVE_TO,t=isNaN(t)?s:t,e=isNaN(e)?o:e,i.x1=i.relative?s-t:2*s-t,i.y1=i.relative?o-e:2*o-e),i.type&B.CURVE_TO?(t=i.relative?s+i.x2:i.x2,e=i.relative?o+i.y2:i.y2):(t=NaN,e=NaN),i.type&B.SMOOTH_QUAD_TO&&(i.type=B.QUAD_TO,r=isNaN(r)?s:r,n=isNaN(n)?o:n,i.x1=i.relative?s-r:2*s-r,i.y1=i.relative?o-n:2*o-n),i.type&B.QUAD_TO?(r=i.relative?s+i.x1:i.x1,n=i.relative?o+i.y1:i.y1):(r=NaN,n=NaN),i))}function j(){let t=NaN,e=NaN;return I((r,n,i)=>{if(r.type&B.SMOOTH_QUAD_TO&&(r.type=B.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?i:e,r.x1=r.relative?n-t:2*n-t,r.y1=r.relative?i-e:2*i-e),r.type&B.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const s=r.x1,o=r.y1;r.type=B.CURVE_TO,r.x1=((r.relative?0:n)+2*s)/3,r.y1=((r.relative?0:i)+2*o)/3,r.x2=(r.x+2*s)/3,r.y2=(r.y+2*o)/3}else t=NaN,e=NaN;return r})}function I(t){let e=0,r=0,n=NaN,i=NaN;return function(s){if(isNaN(n)&&!(s.type&B.MOVE_TO))throw new Error("path must start with moveto");const o=t(s,e,r,n,i);return s.type&B.CLOSE_PATH&&(e=n,r=i),"x"in s&&void 0!==s.x&&(e=s.relative?e+s.x:s.x),"y"in s&&void 0!==s.y&&(r=s.relative?r+s.y:s.y),s.type&B.MOVE_TO&&(n=e,i=r),o}}function L(t,e,r,n,i,s){return v(t,e,r,n,i,s),I((o,a,u,c)=>{const h=o.x1,l=o.x2,d=o.relative&&!isNaN(c),f=void 0!==o.x?o.x:d?0:a,m=void 0!==o.y?o.y:d?0:u;function p(t){return t*t}o.type&B.HORIZ_LINE_TO&&0!==e&&(o.type=B.LINE_TO,o.y=o.relative?0:u),o.type&B.VERT_LINE_TO&&0!==r&&(o.type=B.LINE_TO,o.x=o.relative?0:a),void 0!==o.x&&(o.x=o.x*t+m*r+(d?0:i)),void 0!==o.y&&(o.y=f*e+o.y*n+(d?0:s)),void 0!==o.x1&&(o.x1=o.x1*t+o.y1*r+(d?0:i)),void 0!==o.y1&&(o.y1=h*e+o.y1*n+(d?0:s)),void 0!==o.x2&&(o.x2=o.x2*t+o.y2*r+(d?0:i)),void 0!==o.y2&&(o.y2=l*e+o.y2*n+(d?0:s));const y=t*n-e*r;if(void 0!==o.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===y)delete o.rX,delete o.rY,delete o.xRot,delete o.lArcFlag,delete o.sweepFlag,o.type=B.LINE_TO;else{const i=o.xRot*Math.PI/180,s=Math.sin(i),a=Math.cos(i),u=1/p(o.rX),c=1/p(o.rY),h=p(a)*u+p(s)*c,l=2*s*a*(u-c),d=p(s)*u+p(a)*c,f=h*n*n-l*e*n+d*e*e,m=l*(t*n+e*r)-2*(h*r*n+d*t*e),g=h*r*r-l*t*r+d*t*t,b=(Math.atan2(m,f-g)+Math.PI)%Math.PI/2,v=Math.sin(b),w=Math.cos(b);o.rX=Math.abs(y)/Math.sqrt(f*p(w)+m*v*w+g*p(v)),o.rY=Math.abs(y)/Math.sqrt(f*p(v)-m*v*w+g*p(w)),o.xRot=180*b/Math.PI}return void 0!==o.sweepFlag&&0>y&&(o.sweepFlag=+!o.sweepFlag),o})}const D={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return v(t),function(t){return"x1"in t&&void 0!==t.x1&&(t.x1=e(t.x1)),"y1"in t&&void 0!==t.y1&&(t.y1=e(t.y1)),"x2"in t&&void 0!==t.x2&&(t.x2=e(t.x2)),"y2"in t&&void 0!==t.y2&&(t.y2=e(t.y2)),"x"in t&&void 0!==t.x&&(t.x=e(t.x)),"y"in t&&void 0!==t.y&&(t.y=e(t.y)),"rX"in t&&void 0!==t.rX&&(t.rX=e(t.rX)),"rY"in t&&void 0!==t.rY&&(t.rY=e(t.rY)),t}},TO_ABS:P,TO_REL:function(){return I((t,e,r)=>(t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t))},NORMALIZE_HVZ:function(t=!0,e=!0,r=!0,n=!0){return I((i,s,o,a,u)=>{if(isNaN(a)&&!(i.type&B.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&B.HORIZ_LINE_TO&&(i.type=B.LINE_TO,i.y=i.relative?0:o),r&&i.type&B.VERT_LINE_TO&&(i.type=B.LINE_TO,i.x=i.relative?0:s),t&&i.type&B.CLOSE_PATH&&(i.type=B.LINE_TO,i.x=i.relative?a-s:a,i.y=i.relative?u-o:u),i.type&B.ARC&&(0===i.rX||0===i.rY)&&(i.type=B.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&B.QUAD_TO&&T([s,o],i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],i.relative?[s+i.x,o+i.y]:[i.x,i.y])&&(i.type=B.LINE_TO,delete i.x1,delete i.y1),n&&i.type&B.CURVE_TO){const t=[s,o],e=i.relative?[s+i.x1,o+i.y1]:[i.x1,i.y1],r=i.relative?[s+i.x2,o+i.y2]:[i.x2,i.y2],n=i.relative?[s+i.x,o+i.y]:[i.x,i.y];T(t,e,n)&&T(t,r,n)&&(i.type=B.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:C,QT_TO_C:j,INFO:I,SANITIZE:function(t=0){v(t);let e=NaN,r=NaN,n=NaN,i=NaN;return I((s,o,a,u,c)=>{const h=Math.abs;let l=!1,d=0,f=0;if(s.type&B.SMOOTH_CURVE_TO&&(d=isNaN(e)?0:o-e,f=isNaN(r)?0:a-r),s.type&(B.CURVE_TO|B.SMOOTH_CURVE_TO)?(e=s.relative?o+s.x2:s.x2,r=s.relative?a+s.y2:s.y2):(e=NaN,r=NaN),s.type&B.SMOOTH_QUAD_TO?(n=isNaN(n)?o:2*o-n,i=isNaN(i)?a:2*a-i):s.type&B.QUAD_TO?(n=s.relative?o+s.x1:s.x1,i=s.relative?a+s.y1:s.y2):(n=NaN,i=NaN),s.type&B.LINE_COMMANDS||s.type&B.ARC&&(0===s.rX||0===s.rY||!s.lArcFlag)||s.type&B.CURVE_TO||s.type&B.SMOOTH_CURVE_TO||s.type&B.QUAD_TO||s.type&B.SMOOTH_QUAD_TO){const e=void 0===s.x?0:s.relative?s.x:s.x-o,r=void 0===s.y?0:s.relative?s.y:s.y-a;d=isNaN(n)?void 0===s.x1?d:s.relative?s.x:s.x1-o:n-o,f=isNaN(i)?void 0===s.y1?f:s.relative?s.y:s.y1-a:i-a;const u=void 0===s.x2?0:s.relative?s.x:s.x2-o,c=void 0===s.y2?0:s.relative?s.y:s.y2-a;h(e)<=t&&h(r)<=t&&h(d)<=t&&h(f)<=t&&h(u)<=t&&h(c)<=t&&(l=!0)}return s.type&B.CLOSE_PATH&&h(o-u)<=t&&h(a-c)<=t&&(l=!0),l?[]:s})},MATRIX:L,ROTATE:function(t,e=0,r=0){v(t,e,r);const n=Math.sin(t),i=Math.cos(t);return L(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},TRANSLATE:function(t,e=0){return v(t,e),L(1,0,0,1,t,e)},SCALE:function(t,e=t){return v(t,e),L(t,0,0,e,0,0)},SKEW_X:function(t){return v(t),L(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return v(t),L(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return v(t),L(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return v(t),L(1,0,0,-1,0,t)},A_TO_C:function(){return I((t,e,r)=>B.ARC===t.type?function(t,e,r){t.cX||x(t,e,r);const n=t.xRot/180*w;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:B.CURVE_TO,x1:e+(t.x-e)/3,y1:r+(t.y-r)/3,x2:e+2*(t.x-e)/3,y2:r+2*(t.y-r)/3,x:t.x,y:t.y}];const i=Math.min(t.phi1,t.phi2),s=Math.max(t.phi1,t.phi2)-i,o=Math.ceil(s/90),a=new Array(o);let u=e,c=r;const h=(e,r)=>{const[i,s]=b([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+s]};for(let e=0;e<o;e++){const r=S(t.phi1,t.phi2,e/o),n=S(t.phi1,t.phi2,(e+1)/o),i=n-r,s=4/3*Math.tan(i*O/4),l=Math.cos(r*O)-s*Math.sin(r*O),d=Math.sin(r*O)+s*Math.cos(r*O),f=Math.cos(n*O),m=Math.sin(n*O),p=f+s*m,y=m-s*f,g=h(l,d),b=h(p,y),v=h(f,m),w={relative:t.relative,type:B.CURVE_TO,x:v[0],y:v[1],x1:g[0],y1:g[1],x2:b[0],y2:b[1]};t.relative&&(w.x1-=u,w.y1-=c,w.x2-=u,w.y2-=c,w.x-=u,w.y-=c),u=v[0],c=v[1],a[e]=w}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return I((t,e,r)=>(t.relative&&(e=0,r=0),B.ARC===t.type&&x(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=P(),e=j(),r=C(),n=I((i,s,o)=>{const a=r(e(t((t=>({...t}))(i))));function u(t){t>n.maxX&&(n.maxX=t),t<n.minX&&(n.minX=t)}function c(t){t>n.maxY&&(n.maxY=t),t<n.minY&&(n.minY=t)}if(a.type&B.DRAWING_COMMANDS&&(u(s),c(o)),a.type&B.HORIZ_LINE_TO&&u(a.x),a.type&B.VERT_LINE_TO&&c(a.y),a.type&B.LINE_TO&&(u(a.x),c(a.y)),a.type&B.CURVE_TO){u(a.x),c(a.y);const t=_(s,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(M(s,a.x1,a.x2,a.x,e));const e=_(o,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(M(o,a.y1,a.y2,a.y,t))}if(a.type&B.ARC){u(a.x),c(a.y),x(a,s,o);const t=a.xRot/180*Math.PI,e=Math.cos(t)*a.rX,r=Math.sin(t)*a.rX,n=-Math.sin(t)*a.rY,i=Math.cos(t)*a.rY,[h,l]=a.phi1<a.phi2?[a.phi1,a.phi2]:-180>a.phi2?[a.phi2+360,a.phi1+360]:[a.phi2,a.phi1],d=([t,e])=>{const r=180*Math.atan2(e,t)/Math.PI;return r<h?r+360:r},f=N(n,-e,0).map(d);for(const t of f)t>h&&t<l&&u(E(a.cX,e,n,t));const m=N(i,-r,0).map(d);for(const t of m)t>h&&t<l&&c(E(a.cY,r,i,t))}return i});return n.minX=1/0,n.maxX=-1/0,n.minY=1/0,n.maxY=-1/0,n},REVERSE_PATH:function(t,e=!0){if(t.length<2)return t;const r=D.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const s of t){const t=r(s);t.type===B.MOVE_TO&&i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...A(i)):n.unshift(...A(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(D.INFO((t,e,r)=>{const n="relative"in t&&t.relative;return["x"in t?t.x+(n?e:0):e,"y"in t?t.y+(n?r:0):r]}));let n=r[0];e.push(t[0]);for(let i=1;i<t.length;i++){const s=t[i],o=t[i+1];if(i<t.length-1&&o&&s.type&B.LINE_COMMANDS&&o.type&B.LINE_COMMANDS){const t=r[i+1];if(T(n,r[i],t)){"relative"in o&&o.relative&&("x"in o&&(o.x=t[0]-n[0]),"y"in o&&(o.y=t[1]-n[1]));continue}}e.push(s),n=r[i]}return e}};class R{round(t){return this.transform(D.ROUND(t))}toAbs(){return this.transform(D.TO_ABS())}toRel(){return this.transform(D.TO_REL())}normalizeHVZ(t,e,r){return this.transform(D.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(D.NORMALIZE_ST())}qtToC(){return this.transform(D.QT_TO_C())}aToC(){return this.transform(D.A_TO_C())}sanitize(t){return this.transform(D.SANITIZE(t))}translate(t,e){return this.transform(D.TRANSLATE(t,e))}scale(t,e){return this.transform(D.SCALE(t,e))}rotate(t,e,r){return this.transform(D.ROTATE(t,e,r))}matrix(t,e,r,n,i,s){return this.transform(D.MATRIX(t,e,r,n,i,s))}skewX(t){return this.transform(D.SKEW_X(t))}skewY(t){return this.transform(D.SKEW_Y(t))}xSymmetry(t){return this.transform(D.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(D.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(D.ANNOTATE_ARCS())}}const V=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,F=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class k extends R{curNumber="";curCommandType=-1;curCommandRelative=!1;canParseCommandOrComma=!0;curNumberHasExp=!1;curNumberHasExpDigits=!1;curNumberHasDecimal=!1;curArgs=[];finish(t=[]){if(this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,e=[]){const r=t=>{e.push(t),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let n=0;n<t.length;n++){const i=t[n],s=!(this.curCommandType!==B.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=F(i)&&("0"===this.curNumber&&"0"===i||s);if(!F(i)||o)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){const t=Number(this.curNumber);if(isNaN(t))throw new SyntaxError(`Invalid number ending at ${n}`);if(this.curCommandType===B.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>t)throw new SyntaxError(`Expected positive number, got "${t}" at index "${n}"`)}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${n}"`);this.curArgs.push(t),this.curArgs.length===U[this.curCommandType]&&(B.HORIZ_LINE_TO===this.curCommandType?r({type:B.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):B.VERT_LINE_TO===this.curCommandType?r({type:B.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===B.MOVE_TO||this.curCommandType===B.LINE_TO||this.curCommandType===B.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),B.MOVE_TO===this.curCommandType&&(this.curCommandType=B.LINE_TO)):this.curCommandType===B.CURVE_TO?r({type:B.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===B.SMOOTH_CURVE_TO?r({type:B.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.QUAD_TO?r({type:B.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===B.ARC&&r({type:B.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!V(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(o)this.curNumber=i,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError(`Unterminated command at index ${n}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${i}" at index ${n}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,"z"!==i&&"Z"!==i)if("h"===i||"H"===i)this.curCommandType=B.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=B.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=B.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=B.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=B.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=B.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=B.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=B.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=B.ARC,this.curCommandRelative="a"===i}else e.push({type:B.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=i,this.curNumberHasDecimal="."===i}else this.curNumber+=i,this.curNumberHasDecimal=!0;else this.curNumber+=i;else this.curNumber+=i,this.curNumberHasExp=!0;else this.curNumber+=i,this.curNumberHasExpDigits=this.curNumberHasExp}return e}transform(t){return Object.create(this,{parse:{value(e,r=[]){const n=Object.getPrototypeOf(this).parse.call(this,e);for(const e of n){const n=t(e);Array.isArray(n)?r.push(...n):r.push(n)}return r}}})}}class B extends R{commands;constructor(t){super(),this.commands="string"==typeof t?B.parse(t):t}encode(){return B.encode(this.commands)}getBounds(){const t=D.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const e=[];for(const r of this.commands){const n=t(r);Array.isArray(n)?e.push(...n):e.push(n)}return this.commands=e,this}reverse(t=!0){return this.commands=D.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=D.REMOVE_COLLINEAR(this.commands),this}static encode(t){return function(t){let e="";Array.isArray(t)||(t=[t]);for(let r=0;r<t.length;r++){const n=t[r];if(n.type===B.CLOSE_PATH)e+="z";else if(n.type===B.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===B.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===B.MOVE_TO)e+=(n.relative?"m":"M")+n.x+g+n.y;else if(n.type===B.LINE_TO)e+=(n.relative?"l":"L")+n.x+g+n.y;else if(n.type===B.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+g+n.y1+g+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+g+n.y2+g+n.x+g+n.y;else if(n.type===B.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+g+n.y1+g+n.x+g+n.y;else if(n.type===B.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+g+n.y;else{if(n.type!==B.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+g+n.rY+g+n.xRot+g+ +n.lArcFlag+g+ +n.sweepFlag+g+n.x+g+n.y}}return e}(t)}static parse(t){const e=new k,r=[];return e.parse(t,r),e.finish(r),r}static CLOSE_PATH=1;static MOVE_TO=2;static HORIZ_LINE_TO=4;static VERT_LINE_TO=8;static LINE_TO=16;static CURVE_TO=32;static SMOOTH_CURVE_TO=64;static QUAD_TO=128;static SMOOTH_QUAD_TO=256;static ARC=512;static LINE_COMMANDS=B.LINE_TO|B.HORIZ_LINE_TO|B.VERT_LINE_TO;static DRAWING_COMMANDS=B.HORIZ_LINE_TO|B.VERT_LINE_TO|B.LINE_TO|B.CURVE_TO|B.SMOOTH_CURVE_TO|B.QUAD_TO|B.SMOOTH_QUAD_TO|B.ARC}const U={[B.MOVE_TO]:2,[B.LINE_TO]:2,[B.HORIZ_LINE_TO]:1,[B.VERT_LINE_TO]:1,[B.CLOSE_PATH]:0,[B.QUAD_TO]:4,[B.SMOOTH_QUAD_TO]:2,[B.CURVE_TO]:6,[B.SMOOTH_CURVE_TO]:4,[B.ARC]:7};class X{constructor(t){this.domNode=t}shift(t,e){var r;let n=null!==(r=this.domNode.getAttribute("d"))&&void 0!==r?r:"";this.domNode.setAttribute("d",new B(n).translate(t,e).encode())}closestPoint(t){let e=this.domNode.getTotalLength(),r=[];for(let n=0;n<=16;n++){let i=n/16*e;r.push([i,(0,y.distance)(t,this.domNode.getPointAtLength(i))])}r.sort((t,e)=>t[1]-e[1]);let n=r[0],i=n[0]-e/16,s=n[0]+e/16;i=Math.max(0,i),s=Math.min(e,s);for(let e=0;e<20;e++){let e=(s-i)/3;(0,y.distance)(t,this.domNode.getPointAtLength(i))<(0,y.distance)(t,this.domNode.getPointAtLength(s))?s-=e:i+=e}let o=(i+s)/2,a=this.domNode.getPointAtLength(o);return{x:a.x,y:a.y,length:o}}}class Y{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class z{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}class H{constructor(t){this.domNode=t}shift(t,e){this.domNode.x.baseVal.value+=t,this.domNode.y.baseVal.value+=e}}function G(e,r){let{x:n,y:i}=r,s=e.tagName;if(!$.has(s))switch(s){case"g":Array.from(e.children).forEach(t=>G(t,r));break;case"svg":new t(e).shift(n,i);break;case"text":new o(e).shift(n,i);break;case"line":new a(e).shift(n,i);break;case"circle":new u(e).shift(n,i);break;case"ellipse":new c(e).shift(n,i);break;case"rect":new h(e).shift(n,i);break;case"polyline":new m(e).shift(n,i);break;case"polygon":new p(e).shift(n,i);break;case"path":new X(e).shift(n,i);break;case"image":new Y(e).shift(n,i);break;case"use":new z(e).shift(n,i);break;case"foreignObject":new H(e).shift(n,i);break;default:console.error(`Unrecognized SVG element type: "${s}".`)}}const $=new Set(["defs","title","desc","metadata","style","script","linearGradient","radialGradient","stop","clipPath","mask","marker","pattern","symbol","filter"]);var W,q;class J{constructor(t){W.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,W,t)}toArray(){return Array.from(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,W).querySelectorAll("text")).map(t=>({domNode:t}))}}W=new WeakMap;class Q{constructor(t){q.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,q,t)}closestPoint(t){return document.body.contains(Z)||document.body.append(Z),tt.setAttribute("d",function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}(this,q)),new X(tt).closestPoint(t)}}q=new WeakMap;const K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("viewBox","0 0 100 100"),K.setAttribute("width","100"),K.setAttribute("height","100");const Z=document.createElement("div");Z.append(K),Z.style.height="0px",Z.style.position="fixed",document.body.append(Z);const tt=document.createElementNS("http://www.w3.org/2000/svg","path");function et(t,e){for(let[r,n]of Object.entries(e))t.setAttribute(r,n)}tt.setAttribute("stroke","black"),tt.setAttribute("stroke-width","1"),K.append(tt);const rt=new Uint8Array(16),nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));const it=function(t,e,r){return e||t||!crypto.randomUUID?function(t,e,r){const n=(t=t||{}).random??t.rng?.()??crypto.getRandomValues(rt);if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return(nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]).toLowerCase()}(n)}(t,e,r):crypto.randomUUID()};function st(t){t.id="uuid-"+it()}class ot{constructor(t){this.targetSVGDoc=t}get width(){return this.targetSVGDoc.viewBox.baseVal.width}get height(){return this.targetSVGDoc.viewBox.baseVal.height}get minX(){return this.targetSVGDoc.viewBox.baseVal.x}get maxX(){return this.minX+this.width}get minY(){return this.targetSVGDoc.viewBox.baseVal.y}get maxY(){return this.minY+this.height}get horizontalScaling(){return this.targetSVGDoc.width.baseVal.value/this.width}get verticalScaling(){return this.targetSVGDoc.height.baseVal.value/this.height}setScaling(t){this.targetSVGDoc.setAttribute("width",""+t*this.width),this.targetSVGDoc.setAttribute("height",""+t*this.height)}get clientWidth(){return this.targetSVGDoc.getBoundingClientRect().width}get clientHeight(){return this.targetSVGDoc.getBoundingClientRect().height}get horizontalClientScaling(){return this.clientWidth/this.width}get verticalClientScaling(){return this.clientHeight/this.height}get minClientX(){return this.targetSVGDoc.getBoundingClientRect().x}get minClientY(){return this.targetSVGDoc.getBoundingClientRect().y}fromClientX(t){return this.minX+(t-this.minClientX)/this.horizontalClientScaling}fromClientY(t){return this.minY+(t-this.minClientY)/this.verticalClientScaling}fromClientCoordinates(t,e){return[this.fromClientX(t),this.fromClientY(e)]}fromClientPoint(t){return{x:this.fromClientX(t.x),y:this.fromClientY(t.y)}}toClientX(t){return this.minClientX+this.horizontalClientScaling*(t-this.minX)}toClientY(t){return this.minClientY+this.verticalClientScaling*(t-this.minY)}toClientCoordinates(t,e){return[this.toClientX(t),this.toClientY(e)]}toClientPoint(t){return{x:this.toClientX(t.x),y:this.toClientY(t.y)}}}class at{constructor(t){this.targetSVGDoc=t}set(t){let e=this.targetSVGDoc.viewBox.baseVal;this.targetSVGDoc.setAttribute("width",t*e.width+"px"),this.targetSVGDoc.setAttribute("height",t*e.height+"px")}}class ut{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.width/e.width}}class ct{constructor(t){this.targetSVGDoc=t}get(){let t=this.targetSVGDoc.getBoundingClientRect(),e=this.targetSVGDoc.viewBox.baseVal;return t.height/e.height}}function ht(t){let e=t.parentNode;e&&e.appendChild(t)}function lt(t){let e=t.parentNode;e&&e.prepend(t)}var dt,ft=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class mt{constructor(t){dt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,dt,t)}toString(){return ft(this,dt,"f").innerHTML}set(t){ft(this,dt,"f").innerHTML=t}}dt=new WeakMap;var pt,yt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class gt{constructor(t){pt.set(this,void 0),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,pt,t)}toString(){return yt(this,pt,"f").outerHTML}set(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.style.height="0px",document.body.append(e),e.innerHTML=t,!e.firstElementChild)throw new Error("Outer XML must encode an SVG element.");if(e.childNodes.length>1)throw new Error("Outer XML cannot encode multiple DOM nodes.");if(e.firstElementChild.tagName.toLowerCase()!=yt(this,pt,"f").tagName.toLowerCase())throw new Error("Outer XML must specify an SVG element with the same tag name as the target SVG element.");[...yt(this,pt,"f").attributes].forEach(t=>yt(this,pt,"f").removeAttribute(t.name)),[...e.firstElementChild.attributes].forEach(t=>yt(this,pt,"f").setAttribute(t.name,t.value)),yt(this,pt,"f").innerHTML=e.firstElementChild.innerHTML,e.remove()}}function bt(t){return t instanceof SVGGraphicsElement}pt=new WeakMap;var vt=r(854);function wt(t){return(0,vt.isArray)(t)&&t.every(bt)}async function xt(t){let e=document.createElement("canvas");e.style.position="fixed",e.style.display="none",e.style.pointerEvents="none",document.body.append(e),e.width=t.width.baseVal.value,e.height=t.height.baseVal.value;let r=e.getContext("2d");if(!r)throw new Error("Unable to get canvas context.");let n=(new XMLSerializer).serializeToString(t),i=new Image;return i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(n),await i.decode(),r.drawImage(i,0,0,t.width.baseVal.value,t.height.baseVal.value),e.remove(),e.style.position="",e.style.display="",e.style.pointerEvents="",e}})(),n})(),t.exports=e()},534(t){var e;e=()=>(()=>{var t={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})()},127:function(t){var e;e=()=>(()=>{var t={369:function(t){var e;e=()=>(()=>{var t={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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),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:()=>y,flipAway:()=>v,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function v(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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:()=>y,Stems:()=>p,areConflicting:()=>c,areCrossing:()=>d,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,basePairs:()=>v,deepCopy:()=>i,knotless:()=>f,mountainPlotTraversal:()=>g,parseDotBracket:()=>b,radializable:()=>m,sorted:()=>o});var t=r(854),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))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map(function(t){return e([],t,!0)})}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort(function(t,e){return t[0]-e[0]}),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every(function(t){return r[t]==n[t]})}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function c(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function h(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach(function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function l(t){var e=h(t),r=[],n=!1;return e.forEach(function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function d(t,e){return!l([t,e])}function f(t){var e=[],r=i(t);r.sort(function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])});var n=[];return r.forEach(function(t){var r=[t[0]-1,t[1]-1],i=(0,s.min)(r),o=(0,s.max)(r);if(!n[i]&&!n[o]){e.push(t);for(var a=i;a<=o;a++)n[a]=!0}}),e}function m(t){var e=i(t);e.sort(function(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-n)-Math.abs(i-s)});var r=[],n=[];return e.forEach(function(t){var e=t[0],i=t[1];e==i||null!=n[e-1]||null!=n[i-1]||(r.push([e,i]),n[e-1]=i,n[i-1]=e)}),f(r)}var p=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=o(t),r=[],n=[];return e.forEach(function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r},t}(),y=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(p.bind.apply(p,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(s.min),t.map(s.max)]});t.forEach(s.sortNumbers),t.sort(function(t,e){return(0,s.min)(t)-(0,s.min)(e)});for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=h(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach(function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))}),s}function b(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 o(n)}function v(t,e){return e.forEach(function(e){e.forEach(function(e){if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(function(e){return[t[e[0]-1],t[e[1]-1]]})}})(),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:()=>y,flipAway:()=>v,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function v(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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";function t(t,e){return t[0]===e[0]&&t[1]===e[1]||t[0]===e[1]&&t[1]===e[0]}function e(t,e){if(!e.includes(t))throw new Error("The given base is not present in the provided base-pair.");return t===e[0]?e[1]:e[0]}r.r(n),r.d(n,{FirstPairedBase:()=>s,LastPairedBase:()=>a,LeadingDanglingBases:()=>u,Linkers:()=>d,PositionPairs:()=>i,Stems:()=>l,TrailingDanglingBases:()=>c,antiParallelPairs:()=>b,areEqual:()=>t,consecutivePairs:()=>y,knotless:()=>f,missing:()=>v,other:()=>e,parallelPairs:()=>g,parseDotBracket:()=>p,radializable:()=>m});class i{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 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(),n=t.findIndex(t=>r.includes(t));if(n<0)throw new Error("No paired bases present in sequence.");return t[n]}}var o=r(986);class a{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,o.max)(r)<0)throw new Error("No paired bases present in sequence.");return t[(0,o.max)(r)]}}class u{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(0,r)}}class c{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 a(...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 h=r(369);class l{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Stems(t,e).get().map(e=>e.map(e=>[t[e[0]-1],t[e[1]-1]]))}}class d{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[0],e=new i(...this.targetStructure).get();return new h.Linkers(t,e).get().map(e=>e.map(e=>t[e-1]))}}function f(...t){let[e,r]=t,n=new i(...t).get();(0,h.areKnotless)(n)||(n=(0,h.knotless)(n));let s=n.map(t=>[e[t[0]-1],e[t[1]-1]]);return[[...e],s]}function m(...t){let[e,r]=t,n=new i(...t).get();return[[...e],(0,h.radializable)(n).map(([t,r])=>[e[t-1],e[r-1]])]}function p(t,e){if(e.length>t.length)throw new Error("Dot-bracket notation is longer than the sequence.");return[...(0,h.parseDotBracket)(e)].map(e=>{let r=e[0],n=e[1];return[t[r-1],t[n-1]]})}function y(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}function g(t){let e=[],r=Math.floor(t.length/2)-1,n=Math.ceil(t.length/2);for(let i=0;i<=r;i++){let r=t[i],s=t[n+i];e.push([r,s])}return e}function b(t){let e=[];for(let r=0;r<Math.floor(t.length/2);r++){let n=t[r],i=t[t.length-r-1];e.push([n,i])}return e}function v(e,r){return r.filter(r=>!e.find(e=>t(r,e))).map(t=>[...t])}})(),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,c=Math.PI*a/2,h=Math.abs(i-c)<.001;this.wrappedCircularSegment=u||h?new e(r):i<c?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()},369:function(t){var e;e=()=>(()=>{var t={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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}function l(t){return h(t)&&0==t.length}function d(t){return h(t)&&t.length>0}function f(t){return h(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return h(t)&&t.every(n)}function y(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function b(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>d,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>b,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>y,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>s,isString:()=>a,isStringsArray:()=>g}),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:()=>y,flipAway:()=>v,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>g,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}function b(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function v(t,e){var r=(e=b(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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:()=>y,Stems:()=>p,areConflicting:()=>c,areCrossing:()=>d,areEqual:()=>a,areKnotless:()=>l,areStacked:()=>u,basePairs:()=>v,deepCopy:()=>i,knotless:()=>f,mountainPlotTraversal:()=>g,parseDotBracket:()=>b,radializable:()=>m,sorted:()=>o});var t=r(854),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))};function i(r){return(0,t.isNumbersArray)(r)?e([],r,!0):r.map(function(t){return e([],t,!0)})}var s=r(986);function o(t){var e=i(t);return e.forEach(s.sortNumbers),e.sort(function(t,e){return t[0]-e[0]}),e}function a(t,e){var r=i(t),n=i(e);return(0,s.sortNumbers)(r),(0,s.sortNumbers)(n),[0,1].every(function(t){return r[t]==n[t]})}function u(t,e){var r=o([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function c(t,e){return(0,s.min)(t)==(0,s.min)(e)&&(0,s.max)(t)!=(0,s.max)(e)||(0,s.min)(t)!=(0,s.min)(e)&&(0,s.max)(t)==(0,s.max)(e)}function h(t){if(0==t.length)return[];for(var e=[],r=0;r<(0,s.max)(t.flat());r++)e.push(void 0);return t.forEach(function(t){e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function l(t){var e=h(t),r=[],n=!1;return e.forEach(function(t,e){var i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function d(t,e){return!l([t,e])}function f(t){var e=[],r=i(t);r.sort(function(t,e){return Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1])});var n=[];return r.forEach(function(t){var r=[t[0]-1,t[1]-1],i=(0,s.min)(r),o=(0,s.max)(r);if(!n[i]&&!n[o]){e.push(t);for(var a=i;a<=o;a++)n[a]=!0}}),e}function m(t){var e=i(t);e.sort(function(t,e){var r=t[0],n=t[1],i=e[0],s=e[1];return Math.abs(r-n)-Math.abs(i-s)});var r=[],n=[];return e.forEach(function(t){var e=t[0],i=t[1];e==i||null!=n[e-1]||null!=n[i-1]||(r.push([e,i]),n[e-1]=i,n[i-1]=e)}),f(r)}var p=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=o(t),r=[],n=[];return e.forEach(function(t){var e=0==n.length?null:n[n.length-1];!e||u(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r},t}(),y=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(p.bind.apply(p,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(s.min),t.map(s.max)]});t.forEach(s.sortNumbers),t.sort(function(t,e){return(0,s.min)(t)-(0,s.min)(e)});for(var e=[],r=t.shift(),n=t.shift();r&&n;){for(var i=[],o=(0,s.max)(r),a=(0,s.min)(n),u=o;u<=a;u++)i.push(u);e.push(i),r=n,n=t.shift()}return e},t}();function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=t[1],i=h(n);if(!l(n))throw new Error("Pseudoknot(s) encountered.");var s=[],o=0;return r.forEach(function(t,e){var r=e+1,n=i[e];null==n?s.push(o):r<n?(s.push(o),o++):(r==n||o--,s.push(o))}),s}function b(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 o(n)}function v(t,e){return e.forEach(function(e){e.forEach(function(e){if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(function(e){return[t[e[0]-1],t[e[1]-1]]})}})(),n})(),t.exports=e()},456:function(t){var e;e=()=>(()=>{var t={277: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,{Vector:()=>r});class r{static matching(t){return new r(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}get magnitude(){return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2))}get direction(){return Math.atan2(this.y,this.x)}}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,{Point:()=>e,RelativePoint:()=>h});var t=r(277);class e{static matching(t){return new e(t.x,t.y)}constructor(t,e){this.x=t,this.y=e}[Symbol.iterator](){return[this.x,this.y].values()}displacementTo(e){return new t.Vector(e.x-this.x,e.y-this.y)}displacementFrom(e){return new t.Vector(this.x-e.x,this.y-e.y)}distanceTo(t){return this.displacementTo(t).magnitude}distanceFrom(t){return this.distanceTo(t)}directionTo(t){return this.displacementTo(t).direction}directionFrom(t){return this.displacementFrom(t).direction}}var i,s,o,a,u,c=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class h{constructor(e){i.add(this),s.set(this,void 0),o.set(this,new t.Vector(0,0)),a.set(this,{move:[]}),function(t,e,r){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,r)}(this,s,e),e.addEventListener("move",()=>c(this,i,"m",u).call(this,"move"))}get x(){return c(this,s,"f").x+c(this,o,"f").x}set x(t){c(this,o,"f").x=t-c(this,s,"f").x,c(this,i,"m",u).call(this,"move")}get y(){return c(this,s,"f").y+c(this,o,"f").y}set y(t){c(this,o,"f").y=t-c(this,s,"f").y,c(this,i,"m",u).call(this,"move")}addEventListener(t,e){c(this,a,"f")[t].push(e)}removeEventListener(t,e){c(this,a,"f")[t]=c(this,a,"f")[t].filter(t=>t!==e)}}s=new WeakMap,o=new WeakMap,a=new WeakMap,i=new WeakSet,u=function(t){c(this,a,"f")[t].forEach(t=>t())}})(),n})(),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:()=>p,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,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 c(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 h(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 m(t){var e=o(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function y(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 c(t){return"object"==typeof t&&null!==t}function h(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>h,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>c,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:()=>c,displacement:()=>u,distance:()=>o,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>m});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 c(t,e){return{x:t.x+e.x,y:t.y+e.y}}var h=r(30);function l(t,e){return(0,h.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 m(t,e){return f([t,e])}})(),n})()},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,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,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 c(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 h(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 m(t){i(t),t.reverse()}function p(t){var e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e){void 0===e&&(e=-Math.PI);var r=t-e;return e+((r%=2*Math.PI)>=0?r:r+2*Math.PI)}function w(t,e){var r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}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,{Centroid:()=>s,Direction:()=>f,MaxCenterX:()=>u,MaxCenterY:()=>h,MinCenterX:()=>a,MinCenterY:()=>c,NucleobaseMock:()=>t,arrange:()=>T,circularize:()=>S,flipSelfX:()=>y,flipSelfY:()=>g,flipX:()=>m,flipY:()=>p,linearize:()=>x,outwardNormal:()=>w,rotate:()=>d,round:()=>_,shift:()=>e,stemmify:()=>O,straighten:()=>N,tangent:()=>b,untangle:()=>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 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 c{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 h{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(t.length<2)return;let r=t[0],n=t[t.length-1],s=(0,i.midpoint)(r.getCenterPoint(),n.getCenterPoint());t.forEach(t=>{let r=t.getCenterPoint(),n=(0,i.distance)(s,r),o=(0,l.direction)((0,i.displacement)(s,r));o+=e,t.setCenterPoint({x:s.x+n*Math.cos(o),y:s.y+n*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 m(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 p(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 y(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),m(t),d(t,a),e(t,(0,i.displacement)(r.getCenterPoint(),o))}function g(t){let e=new s(t),{x:r,y:n}=e.get(),i=r,o=n,a=new f(t).get();d(t,-a),p(t),d(t,a),e.set({x:i,y:o})}function b(t,e){let r=e.indexOf(t);if(-1==r)throw new Error("The target base is not present in the parent sequence.");let n=r-1,i=r+2;return n=Math.max(n,0),new f(e.slice(n,i)).get()}var v=r(127);function w(t,...e){var r;let n=e[0],s=null!==(r=e[1])&&void 0!==r?r:[],a=b(t,n)-Math.PI/2,u=n.indexOf(t);if(u<0)throw new Error("The target base is not present in the provided structure.");if(n.length>1&&u<n.length-1){let e=n[u+1];a=(0,o.flipAway)(a,(0,i.direction)(t.getCenterPoint(),e.getCenterPoint()))}let c=s.find(e=>e.includes(t));return c&&(a=(0,o.flipAway)(a,(0,i.direction)(t.getCenterPoint(),(0,v.other)(t,c).getCenterPoint()))),a}function x(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(),c={x:a,y:u};t.forEach((t,e)=>{t.setCenterPoint({x:e*r,y:0})}),n.set(i),o.set(c)}function N(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),c=a*Math.sin(o),{x:h,y:d}=n[0];t.forEach(t=>{t.setCenterPoint({x:h,y:d}),h+=u,d+=c})}function O(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),c=t.slice(a),h=new s(t),{x:l,y:m}=h.get(),p={x:l,y:m},y=new f(t).get();x(u,{spacing:o}),x(c,{spacing:o}),new f(u).set(-Math.PI/2),new f(c).set(Math.PI/2);let g=t[0],b=t[t.length-1];e(u,(0,i.displacement)(g.getCenterPoint(),{x:0,y:0})),e(c,(0,i.displacement)(b.getCenterPoint(),{x:n,y:0})),d(t,y),h.set(p)}function S(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,c=a,h=new f(t).get(),l=r*(t.length-1);l+=n,Math.abs(l)<1e-5&&(l=1e-5);let m=l/(2*Math.PI),p=Math.PI/2+2*Math.PI*(.5*n/l);t.forEach((t,e)=>{let n=p+2*Math.PI*(e*r)/l;t.setCenterPoint({x:m*Math.cos(n),y:m*Math.sin(n)})}),d(t,h),i.set({x:u,y:c})}var E=r(173);function _(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]),c=n*(t.length-1);if(c-u<.001)return void N(t);if(u<.001){let{x:r,y:o}=s.getCenterPoint();return S(t,{spacing:n,terminiGap:u}),void e(t,(0,i.displacement)(s.getCenterPoint(),{x:r,y:o}))}let h=new E.CircularSegment(a,{arcLength:c}),d=h.parentCircleCenterPoint,f=h.parentCircleRadius,m=(0,l.direction)((0,i.displacement)(d,s.getCenterPoint())),p=h.arcAngle/(t.length-1);t.forEach(t=>{t.setCenterPoint({x:d.x+f*Math.cos(m),y:d.y+f*Math.sin(m)}),m+=p})}var M=r(369);function T(t,r,n){var a,u,c;let{spacing:h}=n,l=null!==(a=n.basePairSpacing)&&void 0!==a?a:h,d=null!==(u=n.hairpinLoopSpacing)&&void 0!==u?u:h,m=null!==(c=n.terminiGap)&&void 0!==c?c:h,{x:p,y}=new s(t).get(),g={x:p,y},b=new f(t).get();[,r]=(0,v.radializable)(t,r);let w=new v.PositionPairs(t,r).get(),x=(0,M.mountainPlotTraversal)(t,w),N=t.filter((t,e)=>0==x[e]);S(N,{spacing:h,terminiGap:m});let E=new v.Stems(t,r).get(),T=new Set(N),A=E.filter(t=>T.has(t[0][0])),P=r=>{let n=r[0],{x:a,y:u}=new s(n).get(),c={x:a,y:u},m=new f(r[0]).get(),p=[...r.map(t=>t[0]),...r.map(t=>t[1]).reverse()];O(p,{basePairLength:h,basePairSpacing:l}),new f(p).set(m),e(p,(0,i.displacement)(new s(n).get(),c));let y=r[r.length-1],g=y.map(e=>t.indexOf(e)),b=t.filter((t,e)=>(0,o.isBetweenExclusive)(e,(0,o.min)(g),(0,o.max)(g))&&x[e]==x[(0,o.min)(g)]+1),v=new Set(b),w=E.filter(t=>v.has(t[0][0]));_([y[0],...b,y[1]],{spacing:w.length>0?h:d}),w.forEach(t=>P(t))};A.forEach(t=>P(t)),new f(t).set(b),new s(t).set(g)}var A,P,C,j,I,L=r(456),D=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},R=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function V(e,r,n){var i;let a,{spacing:u}=n,c=null!==(i=n.hairpinLoopSpacing)&&void 0!==i?i:u;if(0==e.length)return;if(0==r.length)return void function(t,e){let{spacing:r}=e,n=L.Point.matching(new s(t).get());S(t,{spacing:r,terminiGap:2*r}),new f(t).set(Math.PI/2),new s(t).set(n)}(e,n);[a,r]=(0,v.radializable)(e,r);let h=[...e],l=L.Point.matching(new s(h).get());e=[...e,new t({centerPoint:{x:0,y:0}})];let m=new k(e,r),p=m.loops;p.sort((t,e)=>U(t,m)-U(e,m));let y=p[0],g=(0,o.max)(y.linkers.map(t=>t.length)),b=y.linkers.flatMap(e=>[X(e),...Array.from({length:g-2}).map(()=>new t({centerPoint:{x:0,y:0}})),Y(e)]);if(S(b,{spacing:u,terminiGap:u}),d(b,-new f(b).get()),new s(b).set(l),y.linkers.forEach(t=>_(t,{spacing:u})),y.emanatingStems.forEach(t=>F(t.bottomBasePair,m,n)),"outerStem"in y){let t=[y.outerStem.topBasePair[1],y.outerStem.topBasePair[0]],i=[...e.slice(m.indexOf(t[0])),...e.slice(0,m.indexOf(t[1])+1)],s=new Set(i);F(t,new k(i,r.filter(t=>t.every(t=>s.has(t)))),n)}"isHairpinLoop"in y&&y.isHairpinLoop()&&_(y.bases,{spacing:c})}function F(r,n,s){var a,u;let{spacing:c}=s,h=null!==(a=s.basePairSpacing)&&void 0!==a?a:c,l=null!==(u=s.hairpinLoopSpacing)&&void 0!==u?u:c,d=n.stems.find(t=>t.bottomBasePair[0]===r[0]);if(!d)throw new Error("Closing stem not found.");let f=L.Point.matching(r[0].getCenterPoint());O(d.bases,{basePairSpacing:h,basePairLength:c}),e(d.bases,(0,i.displacement)(r[0].getCenterPoint(),f));let m=n.loop(d.topBasePair);m.innerStems.length>0?function(r,n,s){let{spacing:a}=s,u=[n.indexOf(r[0]),n.indexOf(r[1])],c=n.loop(r).innerStems.flatMap(t=>t.bottomBasePair.map(t=>n.indexOf(t))),h=(0,o.min)(c),l=(0,o.max)(c),d=n.sequence.filter((t,e)=>e>=h&&e<=l&&n.mountainPlotTraversal[e]==n.mountainPlotTraversal[h]&&[e-1,e,e+1].some(t=>c.includes(t))),f=(0,o.max)([d.length-2,h-(0,o.min)(u)-1,(0,o.max)(u)-l-1]);f=(0,o.max)([f,0]);let m=Array.from({length:f}).map(()=>new t({centerPoint:{x:0,y:0}})),p=m.map(()=>new t({centerPoint:{x:0,y:0}})),y=L.Point.matching(r[0].getCenterPoint());S([r[0],...m,...d,...p,r[1]],{spacing:a,terminiGap:a}),e([...r,...d],(0,i.displacement)(r[0].getCenterPoint(),y)),_(n.sequence.slice(u[0],h+1),{spacing:a}),_(n.sequence.slice(l,u[1]+1),{spacing:a})}(d.topBasePair,n,s):_(m.bases,{spacing:l}),m.innerStems.forEach(t=>F(t.bottomBasePair,n,s)),(0,v.consecutivePairs)(m.innerStems).map(([t,e])=>[t.bottomBasePair[1],...n.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]).filter(t=>t.length>=5).forEach(t=>{let r=t.slice(1,-1),n=L.Point.matching(r[0].getCenterPoint()),s=(0,i.distance)(X(r).getCenterPoint(),Y(r).getCenterPoint());O(r,{basePairLength:s,basePairSpacing:h}),_(r.length%2==0?function(t){if(t.length<4)throw new Error("The array has less than four items.");if(t.length%2!=0)throw new Error("The array has an odd number of items.");return t.slice(Math.floor(t.length/2)-2,Math.floor(t.length/2)+2)}(r):function(t){if(t.length<3)throw new Error("The array has less than three items.");if(t.length%2==0)throw new Error("The array has an even number of items.");let e=Math.floor(t.length/2);return t.slice(e-1,e+2)}(r),{spacing:r.length>=5?h:s}),e(r,(0,i.displacement)(r[0].getCenterPoint(),n))})}class k{constructor(t,e){this.sequence=t,this.basePairs=e,A.set(this,void 0),P.set(this,void 0),C.set(this,void 0),j.set(this,void 0),D(this,A,new Map,"f"),this.sequence.forEach((t,e)=>R(this,A,"f").set(t,e)),D(this,P,new Map,"f"),this.sequence.forEach((t,e)=>R(this,P,"f").set(t,e+1)),D(this,C,new Map,"f"),this.basePairs.forEach(t=>R(this,C,"f").set(t[0],t[1])),this.basePairs.forEach(t=>R(this,C,"f").set(t[1],t[0])),D(this,j,this.basePairs.map(t=>[this.positionOf(t[0]),this.positionOf(t[1])]),"f"),this.mountainPlotTraversal=(0,M.mountainPlotTraversal)(this.sequence,R(this,j,"f")),this.stems=new v.Stems(this.sequence,this.basePairs).get().map(t=>new B(t))}indexOf(t){let e=R(this,A,"f").get(t);if("number"!=typeof e)throw new Error("Base not found.");return e}positionOf(t){let e=R(this,P,"f").get(t);if("number"!=typeof e)throw new Error("Base not found.");return e}spannedBases(t){let e=this.indexOf(t[0]),r=this.indexOf(t[1]);return this.sequence.slice((0,o.min)([e,r])+1,(0,o.max)([e,r]))}numSpannedBases(t){return this.spannedBases(t).length}joinedBases(t){let e=this.indexOf(t[0]),r=this.indexOf(t[1]);return[...this.sequence.slice(0,(0,o.min)([e,r])+1),...this.sequence.slice((0,o.max)([e,r]))]}numJoinedBases(t){return this.joinedBases(t).length}interveningBases(t,e){let r=this.indexOf(t),n=this.indexOf(e);return this.sequence.slice((0,o.min)([r,n])+1,(0,o.max)([r,n]))}get loops(){return[this.outermostLoop,...this.stems.map(t=>this.loop(t.topBasePair))]}loop(t){let e=[this.indexOf(t[0]),this.indexOf(t[1])],r=this.mountainPlotTraversal[e[0]]+1,n=this.spannedBases(t).filter(t=>this.mountainPlotTraversal[this.indexOf(t)]==r),i=new Set(n),s=[t[0],...n,t[1]],o=this.stems.filter(t=>i.has(t.bottomBasePair[0])),a=o,u=this.stems.find(e=>t.includes(e.topBasePair[0]));if(!u)throw new Error("Outer stem not found.");let c=(0,v.consecutivePairs)(o).map(([t,e])=>[t.bottomBasePair[1],...this.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]);return o.length>0&&(c.unshift([t[0],...this.interveningBases(t[0],X(o).bottomBasePair[0]),X(o).bottomBasePair[0]]),c.push([Y(o).bottomBasePair[1],...this.interveningBases(Y(o).bottomBasePair[1],t[1]),t[1]])),{bases:s,closingBasePair:t,outerStem:u,innerStems:o,emanatingStems:a,linkers:c,isHairpinLoop:()=>0==a.length}}get outermostLoop(){let t=this.stems.filter(t=>0==this.mountainPlotTraversal[this.indexOf(t.bottomBasePair[0])]),e=t,r=(0,v.consecutivePairs)(e).map(([t,e])=>[t.bottomBasePair[1],...this.interveningBases(t.bottomBasePair[1],e.bottomBasePair[0]),e.bottomBasePair[0]]);return e.length>0&&r.push([...this.sequence.slice(this.indexOf(Y(e).bottomBasePair[1])),...this.sequence.slice(0,this.indexOf(X(e).bottomBasePair[0])+1)]),{stems:e,emanatingStems:t,linkers:r}}}A=new WeakMap,P=new WeakMap,C=new WeakMap,j=new WeakMap;class B{constructor(t){if(I.set(this,void 0),0==t.length)throw new Error("A stem must have at least one base-pair.");D(this,I,t,"f")}get bottomBasePair(){return X(R(this,I,"f"))}get topBasePair(){return Y(R(this,I,"f"))}get side5(){return R(this,I,"f").map(t=>t[0])}get side3(){let t=R(this,I,"f").map(t=>t[1]);return t.reverse(),t}get bases(){return[...this.side5,...this.side3]}}function U(t,e){let r=(0,o.max)(t.emanatingStems.map(t=>e.numSpannedBases(t.bottomBasePair)));return"closingBasePair"in t&&(r=(0,o.max)([r,e.numJoinedBases(t.closingBasePair)-2])),r}function X(t){if(0==t.length)throw new Error("The array is empty.");return t[0]}function Y(t){if(0==t.length)throw new Error("The array is empty.");return t[t.length-1]}I=new WeakMap})(),n})(),t.exports=e()},986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},369(t){var e;e=()=>(()=>{var t={986(t){t.exports=(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};function r(t,e){return Math.abs(t-e)}function n(t){let e=0;return t.forEach(t=>e+=t),e}function i(t){return n(t)/t.length}function s(t){t.sort((t,e)=>t-e)}function o(t){let e=[...t];return s(e),e}function a(t){if(0==t.length)return NaN;let e=o(t);if(e.length%2!=0)return e[Math.floor(e.length/2)];let r=e.length/2,n=r-1;return i([e[r],e[n]])}function u(t){if(0==t.length)return 1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.min(e,t)}),e}function c(t){if(0==t.length)return-1/0;let e=t[0];return t.slice(1).forEach(t=>{e=Math.max(e,t)}),e}function h(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 m(t){s(t),t.reverse()}function p(t){let e=o(t);return e.reverse(),e}function y(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function b(t){return t*(Math.PI/180)}function v(t,e=-Math.PI){let r=t-e;return r%=2*Math.PI,r=r>=0?r:r+2*Math.PI,e+r}function w(t,e){let r=(e=v(e,t))-t;return(r<Math.PI/2||r>3*Math.PI/2)&&(t+=Math.PI),t}return t.r(e),t.d(e,{areWithin:()=>f,average:()=>i,clamp:()=>d,degrees:()=>g,distance:()=>r,flipAway:()=>w,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>i,median:()=>a,min:()=>u,normalizeAngle:()=>v,radians:()=>b,round:()=>y,sortNumbers:()=>s,sortNumbersAscending:()=>s,sortNumbersDescending:()=>m,sortedNumbers:()=>o,sortedNumbersAscending:()=>o,sortedNumbersDescending:()=>p,sum:()=>n}),e})()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const t={d:(e,r)=>{if(Array.isArray(r))for(var n=0;n<r.length;){var i=r[n++],s=r[n++];t.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:r[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&`Key${this.key}`.toUpperCase()===t.code.toUpperCase()&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],s=e[n++];r.o(t,i)?0===s&&n++:0===s?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:s})}else for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{Linkers:()=>p,Stems:()=>m,areConflicting:()=>u,areCrossing:()=>l,areEqual:()=>o,areKnotless:()=>h,areStacked:()=>a,basePairs:()=>w,deepCopy:()=>e,knotless:()=>d,mountainPlotTraversal:()=>y,parseDotBracket:()=>b,radializable:()=>f,sorted:()=>s});var t=r(854);function e(e){return(0,t.isNumbersArray)(e)?[...e]:e.map(t=>[...t])}var i=r(986);function s(t){let r=e(t);return r.forEach(i.sortNumbers),r.sort((t,e)=>t[0]-e[0]),r}function o(t,r){let n=e(t),s=e(r);return(0,i.sortNumbers)(n),(0,i.sortNumbers)(s),[0,1].every(t=>n[t]==s[t])}function a(t,e){let r=s([t,e]);return r[0][0]==r[1][0]-1&&r[0][1]==r[1][1]+1}function u(t,e){return(0,i.min)(t)==(0,i.min)(e)&&(0,i.max)(t)!=(0,i.max)(e)||(0,i.min)(t)!=(0,i.min)(e)&&(0,i.max)(t)==(0,i.max)(e)}function c(t){if(0==t.length)return[];let e=[];for(let r=0;r<(0,i.max)(t.flat());r++)e.push(void 0);return t.forEach(t=>{e[t[0]-1]=t[1],e[t[1]-1]=t[0]}),e}function h(t){let e=c(t),r=[],n=!1;return e.forEach((t,e)=>{let i=e+1;null==t||(i<t?r.push(i):i==t||r.pop()!=t&&(n=!0))}),!n}function l(t,e){return!h([t,e])}function d(t){let r=[],n=e(t);n.sort((t,e)=>Math.abs(t[0]-t[1])-Math.abs(e[0]-e[1]));let s=[];return n.forEach(t=>{let e=[t[0]-1,t[1]-1],n=(0,i.min)(e),o=(0,i.max)(e);if(!s[n]&&!s[o]){r.push(t);for(let t=n;t<=o;t++)s[t]=!0}}),r}function f(t){let r=e(t);r.sort(([t,e],[r,n])=>Math.abs(t-e)-Math.abs(r-n));let n=[],i=[];return r.forEach(([t,e])=>{t==e||null!=i[t-1]||null!=i[e-1]||(n.push([t,e]),i[t-1]=e,i[e-1]=t)}),d(n)}class m{constructor(...t){this.targetStructure=t}get(){let t=this.targetStructure[1];if(0==t.length)return[];let e=s(t),r=[],n=[];return e.forEach(t=>{let e=0==n.length?null:n[n.length-1];!e||a(e,t)?n.push(t):(r.push(n),n=[t])}),r.push(n),r}}class p{constructor(...t){this.targetStructure=t}get(){let t=new m(...this.targetStructure).get().flatMap(t=>[t.map(i.min),t.map(i.max)]);t.forEach(i.sortNumbers),t.sort((t,e)=>(0,i.min)(t)-(0,i.min)(e));let e=[],r=t.shift(),n=t.shift();for(;r&&n;){let s=[],o=(0,i.max)(r),a=(0,i.min)(n);for(let t=o;t<=a;t++)s.push(t);e.push(s),r=n,n=t.shift()}return e}}function y(...t){let e=t[0],r=t[1],n=c(r);if(!h(r))throw new Error("Pseudoknot(s) encountered.");let i=[],s=0;return e.forEach((t,e)=>{let r=e+1,o=n[e];null==o?i.push(s):r<o?(i.push(s),s++):(r==o||s--,i.push(s))}),i}var g=r(106);function b(t){t=(0,g.removeWhitespace)(t);let e={"()":[],"[]":[],"{}":[],"<>":[]};v.forEach(r=>{let[n,i]=r.split(""),o=[...t].map(t=>t===n?"(":t===i?")":".").join("");e[r]=function(t){let e=[],r=[];if([...t].forEach((t,n)=>{let i=n+1;if("."==t);else if("("==t)r.push(i);else if(")"==t){let t=r.pop();if("number"!=typeof t)throw new Error(`Unmatched downstream partner in dot-bracket notation at position: ${i}.`);e.push([t,i])}}),r.length>0)throw new Error(`Unmatched upstream partner in dot-bracket notation at position: ${r.pop()}.`);return s(e)}(o)});let r=()=>s(v.flatMap(t=>e[t]));return{[Symbol.iterator]:()=>r()[Symbol.iterator](),toArray:r,...e}}const v=["()","[]","{}","<>"];function w(t,e){return e.forEach(e=>{e.forEach(e=>{if(e<1)throw new Error("Sequence positions must be positive.");if(e>t.length)throw new Error("Position out of sequence range.")})}),e.map(e=>[t[e[0]-1],t[e[1]-1]])}})(),n})(),t.exports=e()},106(t){var e;e=()=>(()=>{var t={992(t){var e;e=()=>(()=>{"use strict";const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}};let e={};t.r(e),t.d(e,{KeyBinding:()=>p});var r,n,i,s,o,a,u,c,h,l,d,f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t,e,a){r.add(this),this.code=t,n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o.set(this,void 0),f(this,n,e,"f"),f(this,i,t=>m(this,r,"m",l).call(this,t),"f"),f(this,s,a,"f")}get owner(){return m(this,o,"f")}set owner(t){var e;null===(e=m(this,o,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),f(this,o,t,"f")}}return n=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,s,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},l=function(t){this.owner&&this.owner===document.activeElement&&this.code===t.code&&t.altKey===m(this,r,"a",a)&&t.ctrlKey===m(this,r,"a",u)&&t.metaKey===m(this,r,"a",c)&&t.shiftKey===m(this,r,"a",h)&&m(this,r,"m",d).call(this,t)},d=function(t){t.preventDefault(),m(this,n,"f").call(this)},e})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};let n={};return(()=>{"use strict";function t(t){if(t.length>0)return t[0];throw new Error("Array is empty.")}function e(t){if(t.length>0)return t[t.length-1];throw new Error("Array is empty.")}function i(t){if(t.length<3)throw new Error("Array has less than 3 items.");if(t.length%2==0)throw new Error("Array has an even number of items.");let e=Math.floor(t.length/2);return[t[e-1],t[e],t[e+1]]}function s(t){if(t.length<4)throw new Error("Array has less than 4 items.");if(t.length%2!=0)throw new Error("Array has an odd number of items.");let e=Math.floor(t.length/2);return[t[e-2],t[e-1],t[e],t[e+1]]}function o(t){return t.length<2?[]:t.slice(0,-1).map((e,r)=>[t[r],t[r+1]])}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>w,FiniteStack:()=>_,KeyBinding:()=>f.KeyBinding,consecutivePairs:()=>o,containsFocus:()=>d,detectMac:()=>p,detectWindows:()=>m,first:()=>t,hasFocus:()=>l,isJSON:()=>a.isJSON,isJSONSerializable:()=>a.isJSONSerializable,isURL:()=>M,last:()=>e,middleFour:()=>s,middleThree:()=>i,removeWhitespace:()=>u,shuffled:()=>h,splitLines:()=>c});var a=r(854);function u(t){return[...t].filter(t=>!(0,a.isWhitespace)(t)).join("")}function c(t){return t.split(/\r\n|\r|\n/)}function h(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function l(t){return t===document.activeElement}function d(t){return!!document.activeElement&&t.contains(document.activeElement)}var f=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function p(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var y,g=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class v{constructor(t,e,r){y.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",g(this,y,null==r?void 0:r.type,"f")}get type(){return null!=b(this,y,"f")?b(this,y,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){g(this,y,t,"f")}download(){let t=new File([this.content],this.name,{type:this.type}),e=URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=t.name,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(e)}}y=new WeakMap;class w{constructor(){this.eventListeners={change:[]},this.underlyingSet=new Set}[Symbol.iterator](){return this.underlyingSet.values()}get size(){return this.underlyingSet.size}has(t){return this.includes(t)}includes(t){return this.underlyingSet.has(t)}include(t){return this.includes(t)}add(...t){this.addAll(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")))}remove(...t){this.removeAll(t)}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)}}var x,N,O,S,E=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class _{constructor(t){x.add(this),this.maxSize=t,N.set(this,[]),O.set(this,{change:[]})}get size(){return E(this,N,"f").length}isEmpty(){return 0==this.size}empty(){0!=this.size&&(function(t,e){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,[])}(this,N),E(this,x,"m",S).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,N,"f")[E(this,N,"f").length-1]}push(t){E(this,N,"f").push(t),this.size>this.maxSize&&E(this,N,"f").shift(),E(this,x,"m",S).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,N,"f").pop();return E(this,x,"m",S).call(this,"change"),t}addEventListener(t,e){E(this,O,"f")[t].push(e)}removeEventListener(t,e){E(this,O,"f")[t]=E(this,O,"f")[t].filter(t=>t!==e)}}function M(t){try{return new URL(t),!0}catch(t){return!1}}N=new WeakMap,O=new WeakMap,x=new WeakSet,S=function(t){E(this,O,"f")[t].forEach(t=>t())}})(),n})(),t.exports=e()},854(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""===t}function c(t){return a(t)&&!u(t)}function h(t){return!!a(t)&&0==t.trim().length}function l(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function d(t){try{return JSON.stringify(t),!0}catch{return!1}}function f(t){return!!t}function m(t){return!t}function p(t){return null==t}function y(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function b(t){return g(t)&&0==t.length}function v(t){return g(t)&&t.length>0}function w(t){return g(t)&&t.every(r)}function x(t){return w(t)&&t.length>0}function N(t){return g(t)&&t.every(n)}function O(t){return g(t)&&t.every(i)}function S(t){return g(t)&&t.every(a)}function E(t){return S(t)&&t.length>0}function _(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>b,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>N,isJSON:()=>l,isJSONSerializable:()=>d,isNonEmptyArray:()=>v,isNonEmptyNumbersArray:()=>x,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>E,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>O,isNonNegativeFiniteNumber:()=>o,isNonNullObject:()=>y,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>w,isPositiveFiniteNumber:()=>s,isSVGGraphicsElement:()=>_,isString:()=>a,isStringsArray:()=>S,isTruthy:()=>f,isWhitespace:()=>h}),e})()}};const e={};function r(n){const i=e[n];if(void 0!==i)return i.exports;const 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=>{Object.defineProperties(t,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})};let n={};return(()=>{"use strict";r.r(n),r.d(n,{BaseOutline:()=>O.BaseOutline,CTDrawer:()=>mt,CurvedBond:()=>_.CurvedBond,DotBracketDrawer:()=>ht,Drawing:()=>et,Nucleobase:()=>o.Nucleobase,Numbering:()=>d.Numbering,NumberingLine:()=>d.NumberingLine,SchemaDrawer:()=>xt,StraightBond:()=>_.StraightBond,StrungCircle:()=>L.StrungCircle,StrungElement:()=>L.StrungElement,StrungRectangle:()=>L.StrungRectangle,StrungText:()=>L.StrungText,StrungTriangle:()=>L.StrungTriangle});const t=new Uint8Array(16),e=[];for(let t=0;t<256;++t)e.push((t+256).toString(16).slice(1));const i=function(r,n,i){return n||r||!crypto.randomUUID?function(r,n,i){const s=(r=r||{}).random??r.rng?.()??crypto.getRandomValues(t);if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,n){if((i=i||0)<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let t=0;t<16;++t)n[i+t]=s[t];return n}return function(t,r=0){return(e[t[r+0]]+e[t[r+1]]+e[t[r+2]]+e[t[r+3]]+"-"+e[t[r+4]]+e[t[r+5]]+"-"+e[t[r+6]]+e[t[r+7]]+"-"+e[t[r+8]]+e[t[r+9]]+"-"+e[t[r+10]]+e[t[r+11]]+e[t[r+12]]+e[t[r+13]]+e[t[r+14]]+e[t[r+15]]).toLowerCase()}(s)}(r,n,i):crypto.randomUUID()};var s=r(726),o=r(358);class a{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=>this.svgDoc.contains(t.domNode)))}).observe(t,{childList:!0,subtree:!0})}}class u{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new a(t,e)}get bases(){return this.elementsDrawing.elements}set bases(t){this.elementsDrawing.elements=t}append(t){t.appendTo(this.svgDoc),this.bases.push(t)}add(t){let e=o.Nucleobase.create(t);return this.append(e),e}}var c,h,l=r(534),d=r(742),f=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},m=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class p{constructor(t){this.domNode=t,c.set(this,void 0),h.set(this,void 0),f(this,c,new a(t,[]),"f"),f(this,h,new MutationObserver(()=>{this.elements.forEach(t=>{this.domNode.contains(t.owner.domNode)||t.domNode.remove()})}),"f"),m(this,h,"f").observe(t,{childList:!0,subtree:!0})}get elements(){return m(this,c,"f").elements}set elements(t){m(this,c,"f").elements=t}}c=new WeakMap,h=new WeakMap;var y,g,b=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},v=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class w{constructor(t){this.domNode=t,y.set(this,void 0),b(this,y,new p(t),"f")}get numberings(){return v(this,y,"f").elements}set numberings(t){v(this,y,"f").elements=t}number(t,e){let r=d.Numbering.numbering(t,e);return this.domNode.insertBefore(r.domNode,t.domNode),v(this,y,"f").elements.push(r),r}}y=new WeakMap;class x{constructor(t){this.domNode=t,g.set(this,void 0),b(this,g,new p(t),"f")}get numberingLines(){return v(this,g,"f").elements}set numberingLines(t){v(this,g,"f").elements=t}connect(t){let e=d.NumberingLine.connecting(t);return this.domNode.insertBefore(e.domNode,t.domNode),v(this,g,"f").elements.push(e),e}}g=new WeakMap;var N,O=r(775),S=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class E{constructor(t){this.domNode=t,N.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,N,new p(t),"f")}get baseOutlines(){return S(this,N,"f").elements}set baseOutlines(t){S(this,N,"f").elements=t}append(t){this.domNode.append(t.domNode),this.baseOutlines.push(t)}outline(t){let e=O.BaseOutline.outlining(t);return e.setAttribute("r",""+.54*t.domNode.getBBox().height),t.domNode.insertAdjacentElement("beforebegin",e.domNode),this.baseOutlines.push(e),e}}N=new WeakMap;var _=r(282);class M{constructor(t,e){this.svgDoc=t,this.elementsDrawing=new a(t,e),new MutationObserver(()=>{this.bonds.forEach(t=>{this.svgDoc.contains(t.base1.domNode)&&this.svgDoc.contains(t.base2.domNode)||t.remove()})}).observe(t,{childList:!0,subtree:!0})}get bonds(){return this.elementsDrawing.elements}set bonds(t){this.elementsDrawing.elements=t}}class T{constructor(t,e){this.svgDoc=t,this.defaultValues={attributes:{stroke:"#808080","stroke-width":"1"},basePadding1:6,basePadding2:6},this.bondsDrawing=new M(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=_.StraightBond.between(t,e);return this.append(r),r.set(this.defaultValues),r}}class A{constructor(t,e){this.svgDoc=t,this.defaultValues={attributes:{stroke:"#000000","stroke-width":"2"},basePadding1:6,basePadding2:6},this.bondsDrawing=new M(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=_.StraightBond.between(t,e);return this.append(r),r.set(this.defaultValues),r}}var P,C=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class j{constructor(t){this.domNode=t,P.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,P,new M(t,[]),"f")}get tertiaryBonds(){return C(this,P,"f").bonds}set tertiaryBonds(t){C(this,P,"f").bonds=t}addTertiaryBond(t,e){let r=_.CurvedBond.between(t,e);return this.domNode.append(r.domNode),this.tertiaryBonds.push(r),r}}P=new WeakMap;var I,L=r(976),D=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class R{constructor(t){I.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,I,new p(t),"f")}get domNode(){return D(this,I,"f").domNode}get strungElements(){return D(this,I,"f").elements}set strungElements(t){D(this,I,"f").elements=t}add(t,e){let r;if("text"==(t=(t=t.trim()).toLowerCase()))r=L.StrungText.on(e);else if("circle"==t)r=L.StrungCircle.on(e);else if("rectangle"==t)r=L.StrungRectangle.on(e);else{if("triangle"!=t)throw new Error(`Unrecognized strung element type: ${t}.`);r=L.StrungTriangle.on(e)}return this.domNode.append(r.domNode),r.lineX+=1,r.lineX-=1,D(this,I,"f").elements.push(r),r}}I=new WeakMap;var V,F,k,B=r(854),U=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},X=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class Y{constructor(t){if(V.set(this,void 0),!(0,B.isNonNullObject)(t))throw new Error("Saved drawings must be non-null objects.");U(this,V,t,"f")}get outerXML(){if((0,B.isString)(X(this,V,"f").outerXML))return X(this,V,"f").outerXML;if((0,B.isString)(X(this,V,"f").svg))return X(this,V,"f").svg;throw new Error("Unable to find the outer XML of the saved drawing.")}get bases(){if((0,B.isArray)(X(this,V,"f").bases)){if(!X(this,V,"f").bases.every(B.isNonNullObject))throw new Error("Saved bases must be non-null objects.");return X(this,V,"f").bases}if((0,B.isArray)(X(this,V,"f").sequences)){if(!X(this,V,"f").sequences.every(B.isNonNullObject))throw new Error("Saved sequences must be non-null objects.");let t=X(this,V,"f").sequences.flatMap(t=>t.bases);if(!t.every(B.isNonNullObject))throw new Error("Saved bases must be non-null objects.");return t}return[]}get outlines(){if((0,B.isArray)(X(this,V,"f").outlines))return X(this,V,"f").outlines;if((0,B.isArray)(X(this,V,"f").baseOutlines))return X(this,V,"f").baseOutlines;try{let t=this.bases;if(t.some(t=>t.outline))return t.filter(t=>t.outline).map(t=>{if(!(0,B.isNonNullObject)(t.outline))throw new Error("Saved outlines must be non-null objects.");return{...t.outline,ownerID:t.textId}})}catch{}return[]}get numberings(){if((0,B.isArray)(X(this,V,"f").numberings))return X(this,V,"f").numberings;if((0,B.isArray)(X(this,V,"f").baseNumberings))return X(this,V,"f").baseNumberings;try{let t=this.bases;if(t.some(t=>t.numbering))return t.filter(t=>t.numbering).map(t=>{if(!(0,B.isNonNullObject)(t.numbering))throw new Error("Saved numberings must be non-null objects.");return{...t.numbering,ownerID:t.textId}})}catch{}return[]}get numberingLines(){if((0,B.isArray)(X(this,V,"f").numberingLines))return X(this,V,"f").numberingLines;if((0,B.isArray)(X(this,V,"f").baseNumberingLines))return X(this,V,"f").baseNumberingLines;try{let t=this.bases;if(t.some(t=>t.numbering))return t.filter(t=>t.numbering).map(t=>t.numbering)}catch{}return[]}get primaryBonds(){return(0,B.isArray)(X(this,V,"f").primaryBonds)?X(this,V,"f").primaryBonds:[]}get secondaryBonds(){return(0,B.isArray)(X(this,V,"f").secondaryBonds)?X(this,V,"f").secondaryBonds:[]}get tertiaryBonds(){return(0,B.isArray)(X(this,V,"f").tertiaryBonds)?X(this,V,"f").tertiaryBonds:[]}get strungElements(){return(0,B.isArray)(X(this,V,"f").strungElements)?X(this,V,"f").strungElements:[...this.primaryBonds,...this.secondaryBonds,...this.tertiaryBonds].flatMap(t=>(0,B.isNonNullObject)(t)&&(0,B.isArray)(t.strungElements)?t.strungElements.flatMap(e=>{try{return new z(e,t).modernized()}catch{return[]}}):[])}}V=new WeakMap;class z{constructor(t,e){if(F.set(this,void 0),k.set(this,void 0),!(0,B.isNonNullObject)(t))throw new Error(`Saved strung element isn't a non-null object: ${t}.`);if(U(this,F,t,"f"),!(0,B.isNonNullObject)(e))throw new Error(`Saved strung element owner isn't a non-null object: ${e}.`);U(this,k,e,"f")}modernized(){var t,e,r;let n="StrungText"==X(this,F,"f").type?"text":"StrungCircle"==X(this,F,"f").type?"circle":"StrungRectangle"==X(this,F,"f").type?"rectangle":"StrungTriangle"==X(this,F,"f").type?"triangle":void 0;if(!n)throw new Error(`Unrecognized strung element type: ${X(this,F,"f").type}.`);return{[n]:{...X(this,F,"f"),id:null!==(e=null!==(t=X(this,F,"f").textId)&&void 0!==t?t:X(this,F,"f").circleId)&&void 0!==e?e:X(this,F,"f").pathId},ownerID:null!==(r=X(this,k,"f").lineId)&&void 0!==r?r:X(this,k,"f").pathId}}}F=new WeakMap,k=new WeakMap;var H,G,$,W,q,J,Q,K=r(645),Z=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},tt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class et{constructor(){H.add(this),this.Nucleobase=o.Nucleobase,this.Numbering=d.Numbering,G.set(this,void 0),this.NumberingLine=d.NumberingLine,$.set(this,void 0),this.BaseOutline=O.BaseOutline,W.set(this,void 0),this.StraightBond=_.StraightBond,this.CurvedBond=_.CurvedBond,q.set(this,void 0),this.StrungElement=L.StrungElement,J.set(this,void 0),this.domNode=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.domNode.setAttribute("viewBox",`0 0 ${rt} ${nt}`),this.domNode.setAttribute("width",`${rt}`),this.domNode.setAttribute("height",`${nt}`),this.basesDrawing=new u(this.domNode,[]),Z(this,G,new w(this.domNode),"f"),Z(this,$,new x(this.domNode),"f"),Z(this,W,new E(this.domNode),"f"),this.primaryBondsDrawing=new T(this.domNode,[]),this.secondaryBondsDrawing=new A(this.domNode,[]),Z(this,q,new j(this.domNode),"f"),Z(this,J,new R(this.domNode),"f")}get outerXML(){return this.domNode.outerHTML}set outerXML(t){new s.OuterXML(this.domNode).set(t)}get innerXML(){return this.domNode.innerHTML}set innerXML(t){new s.InnerXML(this.domNode).set(t)}get name(){return this.domNode.dataset.name}set name(t){void 0===t?this.domNode.removeAttribute("data-name"):this.domNode.setAttribute("data-name",t)}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 s.HorizontalClientScaling(this.domNode).get()}get verticalClientScaling(){return new s.VerticalClientScaling(this.domNode).get()}isEmpty(){return 0==this.domNode.childNodes.length}get bases(){const t=()=>this.basesDrawing.bases;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set bases(t){this.basesDrawing.bases=st(t)?t:[...t]}appendBase(t){this.basesDrawing.append(t)}addBase(t){return this.basesDrawing.add(t)}number(t,e){let r=tt(this,G,"f").number(t,e),n=tt(this,$,"f").connect(r);return r.displacement.magnitude=10,n.direction=(0,l.outwardNormal)(t,...tt(this,H,"a",Q)),n.length=1.15*r.domNode.getBBox().height,[r,n]}get numberings(){const t=()=>tt(this,G,"f").numberings;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set numberings(t){tt(this,G,"f").numberings=st(t)?t:[...t]}get numberingLines(){const t=()=>tt(this,$,"f").numberingLines;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set numberingLines(t){tt(this,$,"f").numberingLines=st(t)?t:[...t]}connect(t){return tt(this,$,"f").connect(t)}get baseOutlines(){const t=()=>tt(this,W,"f").baseOutlines;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set baseOutlines(t){tt(this,W,"f").baseOutlines=st(t)?t:[...t]}get outlines(){return this.baseOutlines}outlineBase(t){return tt(this,W,"f").outline(t)}outline(t){return this.outlineBase(t)}appendBaseOutline(t){tt(this,W,"f").append(t)}get bonds(){return{find:t=>{var e,r;return null!==(r=null!==(e=this.primaryBondsDrawing.primaryBonds.find(t))&&void 0!==e?e:this.secondaryBondsDrawing.secondaryBonds.find(t))&&void 0!==r?r:tt(this,q,"f").tertiaryBonds.find(t)}}}get primaryBonds(){const t=()=>this.primaryBondsDrawing.primaryBonds;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set primaryBonds(t){this.primaryBondsDrawing.primaryBonds=st(t)?t:[...t]}appendPrimaryBond(t){this.primaryBondsDrawing.append(t)}addPrimaryBond(t,e){return this.primaryBondsDrawing.add(t,e)}get secondaryBonds(){const t=()=>this.secondaryBondsDrawing.secondaryBonds;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set secondaryBonds(t){this.secondaryBondsDrawing.secondaryBonds=st(t)?t:[...t]}appendSecondaryBond(t){this.secondaryBondsDrawing.append(t)}addSecondaryBond(t,e){return this.secondaryBondsDrawing.add(t,e)}get tertiaryBonds(){const t=()=>tt(this,q,"f").tertiaryBonds;return{[Symbol.iterator]:()=>t().values(),toArray:t}}set tertiaryBonds(t){tt(this,q,"f").tertiaryBonds=st(t)?t:[...t]}addTertiaryBond(t,e){return tt(this,q,"f").addTertiaryBond(t,e)}get strungElements(){return{[Symbol.iterator]:()=>tt(this,J,"f").strungElements[Symbol.iterator](),toArray:()=>tt(this,J,"f").strungElements}}set strungElements(t){tt(this,J,"f").strungElements=st(t)?t:[...t]}addStrungElement(t,e){return tt(this,J,"f").add(t,e)}rotate(t,e){let r=new Set(t);for(let t of this.numberings)if(r.has(t.owner)){let r=d.NumberingLine.unpadded(t);this.domNode.append(r.domNode),r.direction+=e,r.domNode.remove()}(0,l.rotate)(t,e)}get defaultValues(){let t=this.primaryBondsDrawing,e=this.secondaryBondsDrawing;return{get primaryBonds(){return t.defaultValues},set primaryBonds(e){t.defaultValues=e},get secondaryBonds(){return e.defaultValues},set secondaryBonds(t){e.defaultValues=t}}}get contentBBox(){return K.Box.matching(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})}reset(){this.domNode.innerHTML="",this.basesDrawing.bases=[],tt(this,W,"f").baseOutlines=[],this.primaryBondsDrawing.primaryBonds=[],this.secondaryBondsDrawing.secondaryBonds=[],tt(this,q,"f").tertiaryBonds=[],[...this.domNode.attributes].forEach(t=>this.domNode.removeAttribute(t.name)),this.domNode.setAttribute("viewBox",`0 0 ${rt} ${nt}`),this.domNode.setAttribute("width",`${rt}`),this.domNode.setAttribute("height",`${nt}`)}serialized(){return{outerXML:this.outerXML,bases:this.bases.toArray().map(t=>t.serialized()),numberings:this.numberings.toArray().map(t=>t.serialized()),numberingLines:this.numberingLines.toArray().map(t=>t.serialized()),baseOutlines:this.baseOutlines.toArray().map(t=>t.serialized()),primaryBonds:this.primaryBonds.toArray().map(t=>t.serialized()),secondaryBonds:this.secondaryBonds.toArray().map(t=>t.serialized()),tertiaryBonds:this.tertiaryBonds.toArray().map(t=>t.serialized()),strungElements:this.strungElements.toArray().map(t=>t.serialized())}}static deserialized(t){let e=new Y(t),r=new et,n=document.createElement("div");n.append(r.domNode),n.style.width="0px",n.style.height="0px",document.body.append(n),r.outerXML=e.outerXML;let i=r.domNode;r.bases=e.bases.map(t=>o.Nucleobase.deserialized(t,r));let a=[...r.bases];r.numberings=e.numberings.map(t=>d.Numbering.deserialized(t,{domNode:i,bases:a}));let u=[...r.numberings];r.numberingLines=e.numberingLines.map(t=>d.NumberingLine.deserialized(t,{domNode:i,numberings:u})),r.baseOutlines=e.outlines.map(t=>O.BaseOutline.deserialized(t,r)),r.primaryBonds=e.primaryBonds.map(t=>_.StraightBond.deserialized(t,r)),r.secondaryBonds=e.secondaryBonds.map(t=>_.StraightBond.deserialized(t,r)),r.tertiaryBonds=e.tertiaryBonds.map(t=>_.CurvedBond.recreate(t,r)),r.strungElements=e.strungElements.map(t=>L.StrungElement.recreate(t,r));let c=new s.Texts(r.domNode);return function(t){return(0,B.isNonNullObject)(t)&&"svg"in t}(t)&&c.toArray().filter(t=>1==t.domNode.childNodes.length&&t.domNode.childNodes[0]instanceof SVGTSpanElement).forEach(t=>new it(t.domNode).flatten()),r.domNode.remove(),n.remove(),r}restore(t){let e=et.deserialized(t),r=[...e.bases],n=[...e.numberings],i=[...e.numberingLines],s=[...e.baseOutlines],o=[...e.primaryBonds],a=[...e.secondaryBonds],u=[...e.tertiaryBonds],c=[...e.strungElements];this.reset(),[...this.domNode.attributes].forEach(t=>this.domNode.removeAttribute(t.name)),[...e.domNode.attributes].forEach(t=>this.domNode.setAttribute(t.name,t.value)),[...e.domNode.childNodes].forEach(t=>this.domNode.appendChild(t)),this.bases=r,this.numberings=n,this.numberingLines=i,this.baseOutlines=s,this.primaryBonds=o,this.secondaryBonds=a,this.tertiaryBonds=u,this.strungElements=c}refreshIDs(){[this.domNode,...this.domNode.querySelectorAll("*")].filter(t=>t.hasAttribute("id")).forEach(t=>t.setAttribute("id","id-"+i()))}}G=new WeakMap,$=new WeakMap,W=new WeakMap,q=new WeakMap,J=new WeakMap,H=new WeakSet,Q=function(){return[[...this.bases],this.secondaryBondsDrawing.secondaryBonds.map(t=>t.basePair)]};const rt=250,nt=250;class it{constructor(t){this.domNode=t}flatten(){var t=this.domNode.childNodes[0];t instanceof SVGTSpanElement&&["x","y","dx","dy"].forEach(e=>{let r=t instanceof SVGTSpanElement?t.getAttribute(e):void 0;r&&this.domNode.setAttribute(e,r)}),this.domNode.innerHTML=this.domNode.textContent}}function st(t){return(0,B.isArray)(t)}var ot=r(369),at=r(127),ut=r(986),ct=r(106);class ht{constructor(t){this.targetDrawing=t}draw(t,e){let r=[...t].map(t=>this.targetDrawing.addBase(t));(0,at.consecutivePairs)(r).forEach(t=>this.targetDrawing.addPrimaryBond(...t));let n=(0,ot.parseDotBracket)(e),i=(0,ot.basePairs)(r,n["()"]);i.forEach(t=>this.targetDrawing.addSecondaryBond(...t));let s=(0,ot.basePairs)(r,n.toArray());r.forEach(t=>t.bringToFront());let o=1.87*(0,ut.mean)(r.map(t=>t.bbox.height));if(i.length>0?(0,l.untangle)(r,i,{spacing:o,basePairSpacing:o/2,hairpinLoopSpacing:o/2}):((0,l.linearize)(r,{spacing:o/2}),new l.Direction(r).set(0)),(0,at.missing)(i,s).forEach(t=>this.targetDrawing.addTertiaryBond(...t)),r.length>10){this.targetDrawing.number((0,ct.first)(r),1),this.targetDrawing.number((0,ct.last)(r),r.length);let t=20;r.slice(0,-3).forEach((e,r)=>{let n=r+1;n%t!=0||this.targetDrawing.number(e,n)})}return r.forEach(t=>t.bringToFront()),{bases:r}}}var lt,dt=r(297),ft=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class mt{constructor(t){lt.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,lt,t,"f")}draw(t){let e=(0,dt.parseCT)(t),r=[...e.sequence].map(t=>ft(this,lt,"f").addBase(t));(0,at.consecutivePairs)(r).forEach(t=>ft(this,lt,"f").addPrimaryBond(...t));let n=(0,ot.basePairs)(r,e.positionPairs),[i,s]=(0,at.knotless)(r,n),o=(0,at.missing)(s,n);s.forEach(t=>ft(this,lt,"f").addSecondaryBond(...t)),r.forEach(t=>t.bringToFront());let a=1.87*(0,ut.mean)(r.map(t=>t.bbox.height));if(s.length>0?(0,l.untangle)(r,s,{spacing:a,basePairSpacing:a/2,hairpinLoopSpacing:a/2}):((0,l.linearize)(r,{spacing:a/2}),new l.Direction(r).set(0)),o.forEach(t=>ft(this,lt,"f").addTertiaryBond(...t)),r.length>10){ft(this,lt,"f").number((0,ct.first)(r),1+e.numberingOffset),ft(this,lt,"f").number((0,ct.last)(r),r.length+e.numberingOffset);let t=20;r.slice(0,-3).forEach((r,n)=>{let i=n+1;i%t!=0||ft(this,lt,"f").number(r,i+e.numberingOffset)})}return{bases:r}}}lt=new WeakMap;var pt,yt,gt,bt,vt,wt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class xt{constructor(t){pt.add(this),yt.set(this,void 0),function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?i.call(t,r):i?i.value=r:e.set(t,r)}(this,yt,t,"f")}draw(t){var e;(t={...t,classes:[...Nt,...null!==(e=t.classes)&&void 0!==e?e:[]]}).rnaComplexes.forEach(e=>{e.rnaMolecules.forEach(e=>{let r=e.sequence.map(e=>wt(this,pt,"m",gt).call(this,e,t)),n=(0,ut.mean)(r.map(t=>t.bbox.height));wt(this,yt,"f").defaultValues.primaryBonds.attributes["stroke-width"]=""+.125*n,wt(this,yt,"f").defaultValues.primaryBonds.basePadding1=.75*n,wt(this,yt,"f").defaultValues.primaryBonds.basePadding2=.75*n,(0,at.consecutivePairs)(r).forEach(t=>wt(this,yt,"f").addPrimaryBond(...t)),wt(this,yt,"f").defaultValues.secondaryBonds.attributes["stroke-width"]=""+.15*n,wt(this,yt,"f").defaultValues.secondaryBonds.basePadding1=.6*n,wt(this,yt,"f").defaultValues.secondaryBonds.basePadding2=.6*n,new Set(e.basePairs.map(t=>JSON.stringify(t))).forEach(e=>wt(this,pt,"m",bt).call(this,JSON.parse(e),r,t)),d.Numbering.defaultValues.attributes["font-family"]="Helvetica",d.Numbering.defaultValues.attributes["font-size"]=""+.97*n,d.Numbering.defaultValues.attributes["font-weight"]="700",d.Numbering.defaultValues.attributes.fill="#cccccc",d.NumberingLine.defaultValues.attributes.stroke="#cccccc",d.NumberingLine.defaultValues.attributes["stroke-width"]=""+.125*n,d.NumberingLine.defaultValues.basePadding=.75*n,d.NumberingLine.defaultValues.textPadding=.25*n,(0,B.isArray)(e.labels)&&new Set(e.labels.map(t=>JSON.stringify(t))).forEach(t=>wt(this,pt,"m",vt).call(this,JSON.parse(t),r))})})}}yt=new WeakMap,pt=new WeakSet,gt=function(t,e){var r,n;let i=wt(this,yt,"f").addBase(t.residueName),s=null===(r=e.classes)||void 0===r?void 0:r.find(t=>"font"==t.name);return!s||i.setAttributes({...s,name:void 0}),null===(n=t.classes)||void 0===n||n.forEach(t=>{var r;(null!==(r=e.classes)&&void 0!==r?r:[]).filter(e=>e.name==t).forEach(t=>i.setAttributes({...t,name:void 0}))}),i.centerPoint.x=t.x,i.centerPoint.y=t.y,i},bt=function(t,e,r){var n;let i=e[t.residueIndex1],s=e[t.residueIndex2],o=wt(this,yt,"f").addSecondaryBond(i,s);return null===(n=t.classes)||void 0===n||n.forEach(t=>{var e;(null!==(e=r.classes)&&void 0!==e?e:[]).filter(e=>e.name==t).forEach(t=>o.setAttributes({...t,name:void 0}))}),o},vt=function(t,e){if(!(0,B.isNonNullObject)(t))return void console.error(`Label schema is not an object: ${t}.`);if("number"!=typeof t.residueIndex)return void console.error(`Label residue index is not a number: ${t.residueIndex}.`);if(t.residueIndex<0)return void console.error(`Label residue index is negative: ${t.residueIndex}.`);if(t.residueIndex>=e.length)return void console.error(`Label residue index is out-of-bounds: ${t.residueIndex}.`);if(!Number.isInteger(t.residueIndex))return void console.error(`Label residue index is not an integer: ${t.residueIndex}.`);let r=e[t.residueIndex],n=t.residueIndex+1,i=t.labelContent;(0,B.isNonNullObject)(i)||console.error(`Label content schema is not an object: ${i}.`);let s=(0,B.isNonNullObject)(i)&&!(0,B.isNullish)(i.label)&&""!==i.label?`${i.label}`:`${n}`,[o,a]=wt(this,yt,"f").number(r,n),u=o.displacement.direction;o.textContent=s,a.length=1.03*r.domNode.getBBox().height,a.direction=u};const Nt=[{name:"text-black",fill:"#000000"},{name:"text-green",fill:"#00ff00"},{name:"text-red",fill:"#ff00ff"},{name:"text-blue",fill:"#0000ff"}]})(),n})());
|