@rnacanvas/draw.bonds.curved 2.1.0 → 2.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/README.md CHANGED
@@ -36,3 +36,25 @@ bond.base2 === base2; // true
36
36
  // the `static between()` method automatically assigns a UUID
37
37
  bond.domNode.id.length >= 36; // true
38
38
  ```
39
+
40
+ ### `readonly id`
41
+
42
+ The ID of a curved bond.
43
+
44
+ (Corresponds to the ID attribute of the underlying SVG path element.)
45
+
46
+ As with DOM elements in general,
47
+ the ID of a curved bond shouldn't be changed after it's been set.
48
+
49
+ ```javascript
50
+ var domNode = document.createElementNS('http://www.w3.org/2000/svg', 'path');
51
+
52
+ domNode.id = 'id-12345';
53
+
54
+ var base1 = Nucleobase.create('A');
55
+ var base2 = Nucleobase.create('U');
56
+
57
+ var bond = new CurvedBond(domNode, base1, base2);
58
+
59
+ bond.id; // "id-12345"
60
+ ```
@@ -10,5 +10,19 @@ export declare class CurvedBond {
10
10
  static between(base1: Nucleobase, base2: Nucleobase): CurvedBond;
11
11
  constructor(domNode: SVGPathElement, base1: Nucleobase, base2: Nucleobase);
12
12
  get id(): string;
13
+ /**
14
+ * Note that the direction of base padding 1 is relative to the direction from base 1 to base 2.
15
+ */
16
+ get basePadding1(): {
17
+ magnitude: number;
18
+ direction: number;
19
+ };
20
+ /**
21
+ * Note that the direction of base padding 2 is relative to the direction from base 2 to base 1.
22
+ */
23
+ get basePadding2(): {
24
+ magnitude: number;
25
+ direction: number;
26
+ };
13
27
  }
14
28
  //# sourceMappingURL=CurvedBond.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurvedBond.d.ts","sourceRoot":"","sources":["../src/CurvedBond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAc/C,qBAAa,UAAU;;IA4BT,QAAQ,CAAC,OAAO,EAAE,cAAc;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;IA3BpG;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU;gBAwB3C,OAAO,EAAE,cAAc,EAAW,KAAK,EAAE,UAAU,EAAW,KAAK,EAAE,UAAU;IAEpG,IAAI,EAAE,IAAI,MAAM,CAEf;CAyGF"}
1
+ {"version":3,"file":"CurvedBond.d.ts","sourceRoot":"","sources":["../src/CurvedBond.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAc/C,qBAAa,UAAU;;IA4BT,QAAQ,CAAC,OAAO,EAAE,cAAc;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU;IA3BpG;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU;gBAwB3C,OAAO,EAAE,cAAc,EAAW,KAAK,EAAE,UAAU,EAAW,KAAK,EAAE,UAAU;IAMpG,IAAI,EAAE,IAAI,MAAM,CAEf;IAED;;OAEG;IACH,IAAI,YAAY;;;MA8Bf;IAED;;OAEG;IACH,IAAI,YAAY;;;MA8Bf;CAyGF"}
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.bonds.curved"]=e():t["draw.bonds.curved"]=e()}(this,()=>(()=>{var t={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:()=>y,degrees:()=>v,flipAway:()=>O,isBetween:()=>l,isBetweenExclusive:()=>h,isBetweenInclusive:()=>l,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>N,radians:()=>g,round:()=>d,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>s,sortedNumbersAscending:()=>s,sortedNumbersDescending:()=>p,sum:()=>r});var o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;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 s(t){var e=o([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=s(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 l(t,e,r){return t>=e&&t<=r}function h(t,e,r){return t>e&&t<r}function y(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=s(t);return e.reverse(),e}function d(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function v(t){return t*(180/Math.PI)}function g(t){return t*(Math.PI/180)}function N(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 O(t,e){var r=(e=N(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 o(t){return n(t)&&t>0}function s(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 l(t){return!!a(t)&&0==t.trim().length}function h(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function y(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 d(t){return"object"==typeof t&&null!==t}function v(t){return Array.isArray(t)}function g(t){return v(t)&&0==t.length}function N(t){return v(t)&&t.length>0}function O(t){return v(t)&&t.every(r)}function b(t){return O(t)&&t.length>0}function x(t){return v(t)&&t.every(n)}function T(t){return v(t)&&t.every(i)}function E(t){return v(t)&&t.every(a)}function _(t){return E(t)&&t.length>0}function A(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>v,isEmptyArray:()=>g,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>x,isJSON:()=>h,isJSONSerializable:()=>y,isNonEmptyArray:()=>N,isNonEmptyNumbersArray:()=>b,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>_,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>T,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>d,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>O,isPositiveFiniteNumber:()=>o,isSVGGraphicsElement:()=>A,isString:()=>a,isStringsArray:()=>E,isTruthy:()=>f,isWhitespace:()=>l}),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){let e="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 r(e,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)}}return e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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,{FinitePoint:()=>o,Point:()=>i,RelativePoint:()=>y,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)}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}}class o extends i{static matching(t){let e=i.matching(t);return new o(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),o.matching(e),super.set(...t)}}var s,a,u,c,l,h=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(e){s.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",()=>h(this,s,"m",l).call(this,"move"))}get x(){return h(this,a,"f").x+h(this,u,"f").x}set x(t){h(this,u,"f").x=t-h(this,a,"f").x,h(this,s,"m",l).call(this,"move")}get y(){return h(this,a,"f").y+h(this,u,"f").y}set y(t){h(this,u,"f").y=t-h(this,a,"f").y,h(this,s,"m",l).call(this,"move")}addEventListener(t,e){h(this,c,"f")[t].push(e)}removeEventListener(t,e){h(this,c,"f")[t]=h(this,c,"f")[t].filter(t=>t!==e)}}a=new WeakMap,u=new WeakMap,c=new WeakMap,s=new WeakSet,l=function(t){h(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:()=>y,average:()=>n,degrees:()=>p,isBetweenExclusive:()=>h,isBetweenInclusive:()=>l,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>d,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>f,sortedNumbers:()=>s,sortedNumbersAscending:()=>s,sortedNumbersDescending:()=>m,sum:()=>r});var o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;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 s(t){var e=o([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=s(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 l(t,e,r){return t>=e&&t<=r}function h(t,e,r){return t>e&&t<r}function y(t,e,r){return Math.abs(t-e)<=r}function f(t){i(t),t.reverse()}function m(t){var e=s(t);return e.reverse(),e}function p(t){return t*(180/Math.PI)}function d(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 o(t){return n(t)&&t>0}function s(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 l(t){return Array.isArray(t)}return t.r(e),t.d(e,{isArray:()=>l,isFiniteNumber:()=>n,isNonFiniteNumber:()=>i,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>o,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 o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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:()=>o,direction:()=>h,displaced:()=>c,displacement:()=>u,distance:()=>s,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 o(t){return{x:t.x,y:t.y}}function s(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 s(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 l=r(30);function h(t,e){return(0,l.direction)(u(t,e))}var y=r(986);function f(t){return{x:(0,y.mean)(t.map(function(t){return t.x})),y:(0,y.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";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.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,o,s,a,u,c,l,h,y=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),o.set(this,void 0),s.set(this,void 0),y(this,n,e,"f"),y(this,i,t=>f(this,r,"m",h).call(this,t),"f"),y(this,o,a,"f")}get owner(){return f(this,s,"f")}set owner(t){var e;null===(e=f(this,s,"f"))||void 0===e||e.removeEventListener("keydown",f(this,i,"f")),null==t||t.addEventListener("keydown",f(this,i,"f"),{passive:!1}),y(this,s,t,"f")}}return n=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=f(this,o,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=f(this,o,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=f(this,o,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},l=function(){var t,e;return null!==(e=null===(t=f(this,o,"f"))||void 0===t?void 0:t.shiftKey)&&void 0!==e&&e},h=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",l)&&(t.preventDefault(),f(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 o(t){return n(t)&&t>0}function s(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 l(t){return!!a(t)&&0==t.trim().length}function h(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function y(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 d(t){return"object"==typeof t&&null!==t}function v(t){return Array.isArray(t)}function g(t){return v(t)&&0==t.length}function N(t){return v(t)&&t.length>0}function O(t){return v(t)&&t.every(r)}function b(t){return O(t)&&t.length>0}function x(t){return v(t)&&t.every(n)}function T(t){return v(t)&&t.every(i)}function E(t){return v(t)&&t.every(a)}function _(t){return E(t)&&t.length>0}function A(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>v,isEmptyArray:()=>g,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>x,isJSON:()=>h,isJSONSerializable:()=>y,isNonEmptyArray:()=>N,isNonEmptyNumbersArray:()=>b,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>_,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>T,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>d,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>O,isPositiveFiniteNumber:()=>o,isSVGGraphicsElement:()=>A,isString:()=>a,isStringsArray:()=>E,isTruthy:()=>f,isWhitespace:()=>l}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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 o(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]]}r.r(n),r.d(n,{DownloadableFile:()=>g,EventfulSet:()=>N,FiniteStack:()=>_,KeyBinding:()=>y.KeyBinding,containsFocus:()=>h,detectMac:()=>m,detectWindows:()=>f,first:()=>t,hasFocus:()=>l,isJSON:()=>s.isJSON,isJSONSerializable:()=>s.isJSONSerializable,isURL:()=>A,last:()=>e,middleFour:()=>o,middleThree:()=>i,removeWhitespace:()=>a,shuffled:()=>c,splitLines:()=>u});var s=r(854);function a(t){return[...t].filter(t=>!(0,s.isWhitespace)(t)).join("")}function u(t){return t.split(/\r\n|\r|\n/)}function c(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 h(t){return!!document.activeElement&&t.contains(document.activeElement)}var y=r(992);function f(){return-1!==navigator.userAgent.indexOf("Windows")}function m(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var p,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},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 g{constructor(t,e,r){p.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",d(this,p,null==r?void 0:r.type,"f")}get type(){return null!=v(this,p,"f")?v(this,p,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){d(this,p,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)}}p=new WeakMap;class N{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 O,b,x,T,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){O.add(this),this.maxSize=t,b.set(this,[]),x.set(this,{change:[]})}get size(){return E(this,b,"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,b),E(this,O,"m",T).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,b,"f")[E(this,b,"f").length-1]}push(t){E(this,b,"f").push(t),this.size>this.maxSize&&E(this,b,"f").shift(),E(this,O,"m",T).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,b,"f").pop();return E(this,O,"m",T).call(this,"change"),t}addEventListener(t,e){E(this,x,"f")[t].push(e)}removeEventListener(t,e){E(this,x,"f")[t]=E(this,x,"f")[t].filter(t=>t!==e)}}function A(t){try{return new URL(t),!0}catch(t){return!1}}b=new WeakMap,x=new WeakMap,O=new WeakSet,T=function(t){E(this,x,"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 o(t){return n(t)&&t>0}function s(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 l(t){return Array.isArray(t)}function h(t){return l(t)&&0==t.length}function y(t){return l(t)&&t.length>0}function f(t){return l(t)&&t.every(r)}function m(t){return f(t)&&t.length>0}function p(t){return l(t)&&t.every(n)}function d(t){return l(t)&&t.every(i)}function v(t){return l(t)&&t.every(a)}function g(t){return v(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>l,isEmptyArray:()=>h,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>p,isNonEmptyArray:()=>y,isNonEmptyNumbersArray:()=>m,isNonEmptyStringsArray:()=>g,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>d,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>f,isPositiveFiniteNumber:()=>o,isString:()=>a,isStringsArray:()=>v}),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 o(t){return n(t)&&t>0}function s(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 l(t){return!!a(t)&&0==t.trim().length}function h(t){if(!a(t))return!1;try{return JSON.parse(t),!0}catch{return!1}}function y(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 d(t){return"object"==typeof t&&null!==t}function v(t){return Array.isArray(t)}function g(t){return v(t)&&0==t.length}function N(t){return v(t)&&t.length>0}function O(t){return v(t)&&t.every(r)}function b(t){return O(t)&&t.length>0}function x(t){return v(t)&&t.every(n)}function T(t){return v(t)&&t.every(i)}function E(t){return v(t)&&t.every(a)}function _(t){return E(t)&&t.length>0}function A(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>v,isEmptyArray:()=>g,isEmptyString:()=>u,isFalsy:()=>m,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>x,isJSON:()=>h,isJSONSerializable:()=>y,isNonEmptyArray:()=>N,isNonEmptyNumbersArray:()=>b,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>_,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>T,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>d,isNullish:()=>p,isNumber:()=>r,isNumbersArray:()=>O,isPositiveFiniteNumber:()=>o,isSVGGraphicsElement:()=>A,isString:()=>a,isStringsArray:()=>E,isTruthy:()=>f,isWhitespace:()=>l}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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:()=>o,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 o(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 o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],o=e[n++];r.o(t,i)?0===o&&n++:0===o?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:o})}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,{CurvedBond:()=>F});const t={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let e;const i=new Uint8Array(16),o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));function s(t,r,n){const s=(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(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,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]=s[t];return r}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()}(s)}const a=" ";function u([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function c(...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 h(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:o,y:s}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+o)/2,t.cY=(r+s)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*l,[c,h]=u([(e-o)/2,(r-s)/2],-a),y=Math.pow(c,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(i,2);1<y&&(n*=Math.sqrt(y),i*=Math.sqrt(y)),t.rX=n,t.rY=i;const f=Math.pow(n,2)*Math.pow(h,2)+Math.pow(i,2)*Math.pow(c,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,d=-i*c/n*m,v=u([p,d],a);t.cX=v[0]+(e+o)/2,t.cY=v[1]+(r+s)/2,t.phi1=Math.atan2((h-d)/i,(c-p)/n),t.phi2=Math.atan2((-h-d)/i,(-c-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 y(t,e,r){c(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 f=Math.PI/180;function m(t,e,r){return(1-r)*t+r*e}function p(t,e,r,n){return t+Math.cos(n/180*l)*e+Math.sin(n/180*l)*r}function d(t,e,r,n){const i=1e-6,o=e-t,s=r-e,a=3*o+3*(n-r)-6*s,u=6*(s-o),c=3*o;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 v(t,e,r,n,i){const o=1-i;return t*(o*o*o)+e*(3*o*o*i)+r*(3*o*i*i)+n*(i*i*i)}function g(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],a=n*s-i*o;if(!(Math.abs(a)<1e-10))return!1;const u=n*o+i*s,c=o*o+s*s;return 0<=u&&u<=c&&n*n+i*i<=c}function N(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 O(){return T((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 b(){let t=NaN,e=NaN,r=NaN,n=NaN;return T((i,o,s)=>(i.type&C.SMOOTH_CURVE_TO&&(i.type=C.CURVE_TO,t=isNaN(t)?o:t,e=isNaN(e)?s:e,i.x1=i.relative?o-t:2*o-t,i.y1=i.relative?s-e:2*s-e),i.type&C.CURVE_TO?(t=i.relative?o+i.x2:i.x2,e=i.relative?s+i.y2:i.y2):(t=NaN,e=NaN),i.type&C.SMOOTH_QUAD_TO&&(i.type=C.QUAD_TO,r=isNaN(r)?o:r,n=isNaN(n)?s:n,i.x1=i.relative?o-r:2*o-r,i.y1=i.relative?s-n:2*s-n),i.type&C.QUAD_TO?(r=i.relative?o+i.x1:i.x1,n=i.relative?s+i.y1:i.y1):(r=NaN,n=NaN),i))}function x(){let t=NaN,e=NaN;return T((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 o=r.x1,s=r.y1;r.type=C.CURVE_TO,r.x1=((r.relative?0:n)+2*o)/3,r.y1=((r.relative?0:i)+2*s)/3,r.x2=(r.x+2*o)/3,r.y2=(r.y+2*s)/3}else t=NaN,e=NaN;return r})}function T(t){let e=0,r=0,n=NaN,i=NaN;return function(o){if(isNaN(n)&&!(o.type&C.MOVE_TO))throw new Error("path must start with moveto");const s=t(o,e,r,n,i);return o.type&C.CLOSE_PATH&&(e=n,r=i),"x"in o&&void 0!==o.x&&(e=o.relative?e+o.x:o.x),"y"in o&&void 0!==o.y&&(r=o.relative?r+o.y:o.y),o.type&C.MOVE_TO&&(n=e,i=r),s}}function E(t,e,r,n,i,o){return c(t,e,r,n,i,o),T((s,a,u,c)=>{const l=s.x1,h=s.x2,y=s.relative&&!isNaN(c),f=void 0!==s.x?s.x:y?0:a,m=void 0!==s.y?s.y:y?0:u;function p(t){return t*t}s.type&C.HORIZ_LINE_TO&&0!==e&&(s.type=C.LINE_TO,s.y=s.relative?0:u),s.type&C.VERT_LINE_TO&&0!==r&&(s.type=C.LINE_TO,s.x=s.relative?0:a),void 0!==s.x&&(s.x=s.x*t+m*r+(y?0:i)),void 0!==s.y&&(s.y=f*e+s.y*n+(y?0:o)),void 0!==s.x1&&(s.x1=s.x1*t+s.y1*r+(y?0:i)),void 0!==s.y1&&(s.y1=l*e+s.y1*n+(y?0:o)),void 0!==s.x2&&(s.x2=s.x2*t+s.y2*r+(y?0:i)),void 0!==s.y2&&(s.y2=h*e+s.y2*n+(y?0:o));const d=t*n-e*r;if(void 0!==s.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===d)delete s.rX,delete s.rY,delete s.xRot,delete s.lArcFlag,delete s.sweepFlag,s.type=C.LINE_TO;else{const i=s.xRot*Math.PI/180,o=Math.sin(i),a=Math.cos(i),u=1/p(s.rX),c=1/p(s.rY),l=p(a)*u+p(o)*c,h=2*o*a*(u-c),y=p(o)*u+p(a)*c,f=l*n*n-h*e*n+y*e*e,m=h*(t*n+e*r)-2*(l*r*n+y*t*e),v=l*r*r-h*t*r+y*t*t,g=(Math.atan2(m,f-v)+Math.PI)%Math.PI/2,N=Math.sin(g),O=Math.cos(g);s.rX=Math.abs(d)/Math.sqrt(f*p(O)+m*N*O+v*p(N)),s.rY=Math.abs(d)/Math.sqrt(f*p(N)-m*N*O+v*p(O)),s.xRot=180*g/Math.PI}return void 0!==s.sweepFlag&&0>d&&(s.sweepFlag=+!s.sweepFlag),s})}const _={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return c(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:O,TO_REL:function(){return T((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 T((i,o,s,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:s),r&&i.type&C.VERT_LINE_TO&&(i.type=C.LINE_TO,i.x=i.relative?0:o),t&&i.type&C.CLOSE_PATH&&(i.type=C.LINE_TO,i.x=i.relative?a-o:a,i.y=i.relative?u-s: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&&g([o,s],i.relative?[o+i.x1,s+i.y1]:[i.x1,i.y1],i.relative?[o+i.x,s+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=[o,s],e=i.relative?[o+i.x1,s+i.y1]:[i.x1,i.y1],r=i.relative?[o+i.x2,s+i.y2]:[i.x2,i.y2],n=i.relative?[o+i.x,s+i.y]:[i.x,i.y];g(t,e,n)&&g(t,r,n)&&(i.type=C.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:b,QT_TO_C:x,INFO:T,SANITIZE:function(t=0){c(t);let e=NaN,r=NaN,n=NaN,i=NaN;return T((o,s,a,u,c)=>{const l=Math.abs;let h=!1,y=0,f=0;if(o.type&C.SMOOTH_CURVE_TO&&(y=isNaN(e)?0:s-e,f=isNaN(r)?0:a-r),o.type&(C.CURVE_TO|C.SMOOTH_CURVE_TO)?(e=o.relative?s+o.x2:o.x2,r=o.relative?a+o.y2:o.y2):(e=NaN,r=NaN),o.type&C.SMOOTH_QUAD_TO?(n=isNaN(n)?s:2*s-n,i=isNaN(i)?a:2*a-i):o.type&C.QUAD_TO?(n=o.relative?s+o.x1:o.x1,i=o.relative?a+o.y1:o.y2):(n=NaN,i=NaN),o.type&C.LINE_COMMANDS||o.type&C.ARC&&(0===o.rX||0===o.rY||!o.lArcFlag)||o.type&C.CURVE_TO||o.type&C.SMOOTH_CURVE_TO||o.type&C.QUAD_TO||o.type&C.SMOOTH_QUAD_TO){const e=void 0===o.x?0:o.relative?o.x:o.x-s,r=void 0===o.y?0:o.relative?o.y:o.y-a;y=isNaN(n)?void 0===o.x1?y:o.relative?o.x:o.x1-s:n-s,f=isNaN(i)?void 0===o.y1?f:o.relative?o.y:o.y1-a:i-a;const u=void 0===o.x2?0:o.relative?o.x:o.x2-s,c=void 0===o.y2?0:o.relative?o.y:o.y2-a;l(e)<=t&&l(r)<=t&&l(y)<=t&&l(f)<=t&&l(u)<=t&&l(c)<=t&&(h=!0)}return o.type&C.CLOSE_PATH&&l(s-u)<=t&&l(a-c)<=t&&(h=!0),h?[]:o})},MATRIX:E,ROTATE:function(t,e=0,r=0){c(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 c(t,e),E(1,0,0,1,t,e)},SCALE:function(t,e=t){return c(t,e),E(t,0,0,e,0,0)},SKEW_X:function(t){return c(t),E(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return c(t),E(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return c(t),E(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return c(t),E(1,0,0,-1,0,t)},A_TO_C:function(){return T((t,e,r)=>C.ARC===t.type?function(t,e,r){t.cX||h(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),o=Math.max(t.phi1,t.phi2)-i,s=Math.ceil(o/90),a=new Array(s);let c=e,y=r;const p=(e,r)=>{const[i,o]=u([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+o]};for(let e=0;e<s;e++){const r=m(t.phi1,t.phi2,e/s),n=m(t.phi1,t.phi2,(e+1)/s),i=n-r,o=4/3*Math.tan(i*f/4),u=Math.cos(r*f)-o*Math.sin(r*f),l=Math.sin(r*f)+o*Math.cos(r*f),h=Math.cos(n*f),d=Math.sin(n*f),v=h+o*d,g=d-o*h,N=p(u,l),O=p(v,g),b=p(h,d),x={relative:t.relative,type:C.CURVE_TO,x:b[0],y:b[1],x1:N[0],y1:N[1],x2:O[0],y2:O[1]};t.relative&&(x.x1-=c,x.y1-=y,x.x2-=c,x.y2-=y,x.x-=c,x.y-=y),c=b[0],y=b[1],a[e]=x}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return T((t,e,r)=>(t.relative&&(e=0,r=0),C.ARC===t.type&&h(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=O(),e=x(),r=b(),n=T((i,o,s)=>{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(o),c(s)),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=d(o,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(v(o,a.x1,a.x2,a.x,e));const e=d(s,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(v(s,a.y1,a.y2,a.y,t))}if(a.type&C.ARC){u(a.x),c(a.y),h(a,o,s);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,[l,f]=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<l?r+360:r},d=y(n,-e,0).map(m);for(const t of d)t>l&&t<f&&u(p(a.cX,e,n,t));const v=y(i,-r,0).map(m);for(const t of v)t>l&&t<f&&c(p(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 o of t){const t=r(o);t.type===C.MOVE_TO&&i.length>0&&(e?n.push(...N(i)):n.unshift(...N(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...N(i)):n.unshift(...N(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 o=t[i],s=t[i+1];if(i<t.length-1&&s&&o.type&C.LINE_COMMANDS&&s.type&C.LINE_COMMANDS){const t=r[i+1];if(g(n,r[i],t)){"relative"in s&&s.relative&&("x"in s&&(s.x=t[0]-n[0]),"y"in s&&(s.y=t[1]-n[1]));continue}}e.push(o),n=r[i]}return e}};class A{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,o){return this.transform(_.MATRIX(t,e,r,n,i,o))}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 w=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,M=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class S extends A{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],o=!(this.curCommandType!==C.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),s=M(i)&&("0"===this.curNumber&&"0"===i||o);if(!M(i)||s)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||o){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===R[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(!w(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(s)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 A{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+a+n.y;else if(n.type===C.LINE_TO)e+=(n.relative?"l":"L")+n.x+a+n.y;else if(n.type===C.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+a+n.y1+a+n.x2+a+n.y2+a+n.x+a+n.y;else if(n.type===C.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+a+n.y2+a+n.x+a+n.y;else if(n.type===C.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+a+n.y1+a+n.x+a+n.y;else if(n.type===C.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+a+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+a+n.rY+a+n.xRot+a+ +n.lArcFlag+a+ +n.sweepFlag+a+n.x+a+n.y}}return e}(t)}static parse(t){const e=new S,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 R={[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};r(456);var P=r(725);new WeakMap;r(106);var I=r(854);var L=r(277);class U{static from(t){let e,r=new U(0,0);if(!(0,I.isString)(t))return r;try{JSON.parse(t)}catch{return r}return(0,L.isVectorLike)(e)?U.matching(e):r}static matching(t){let e=L.Vector.matching(t);return new U(e.magnitude,e.direction)}constructor(t,e){this.magnitude=t,this.direction=e}toJSON(){return JSON.stringify({magnitude:this.magnitude,direction:this.direction})}}var j;class F{static between(e,r){let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.id="id-"+(!t.randomUUID||o||i?s(i,o,a):t.randomUUID()),n.setAttribute("stroke","black"),n.setAttribute("stroke-width","1.5"),n.setAttribute("stroke-opacity","1"),n.setAttribute("stroke-dasharray",""),n.setAttribute("stroke-linecap",""),n.setAttribute("stroke-linejoin",""),n.setAttribute("fill","none"),new F(n,e,r);var i,o,a}constructor(t,e,r){j.add(this),this.domNode=t,this.base1=e,this.base2=r}get id(){return this.domNode.id}}j=new WeakSet})(),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.bonds.curved"]=e():t["draw.bonds.curved"]=e()}(this,()=>(()=>{var t={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:()=>m,average:()=>n,clamp:()=>y,degrees:()=>g,flipAway:()=>N,isBetween:()=>h,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,normalizeAngle:()=>b,radians:()=>v,round:()=>p,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>d,sortedNumbers:()=>s,sortedNumbersAscending:()=>s,sortedNumbersDescending:()=>f,sum:()=>r});var o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;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 s(t){var e=o([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=s(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 y(t,e,r){return t<e?e:t>r?r:t}function m(t,e,r){return Math.abs(t-e)<=r}function d(t){i(t),t.reverse()}function f(t){var e=s(t);return e.reverse(),e}function p(t,e){return Number.parseFloat(t.toFixed(null!=e?e:0))}function g(t){return t*(180/Math.PI)}function v(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 N(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})()},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 o(t){return n(t)&&t>0}function s(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 y(t){try{return JSON.stringify(t),!0}catch{return!1}}function m(t){return!!t}function d(t){return!t}function f(t){return null==t}function p(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function v(t){return g(t)&&0==t.length}function b(t){return g(t)&&t.length>0}function N(t){return g(t)&&t.every(r)}function O(t){return N(t)&&t.length>0}function x(t){return g(t)&&t.every(n)}function T(t){return g(t)&&t.every(i)}function E(t){return g(t)&&t.every(a)}function w(t){return E(t)&&t.length>0}function S(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>v,isEmptyString:()=>u,isFalsy:()=>d,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>x,isJSON:()=>l,isJSONSerializable:()=>y,isNonEmptyArray:()=>b,isNonEmptyNumbersArray:()=>O,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>w,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>T,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>p,isNullish:()=>f,isNumber:()=>r,isNumbersArray:()=>N,isPositiveFiniteNumber:()=>o,isSVGGraphicsElement:()=>S,isString:()=>a,isStringsArray:()=>E,isTruthy:()=>m,isWhitespace:()=>h}),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){let e="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 r(e,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)}}return e})(),t.exports=e()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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,{FinitePoint:()=>o,Point:()=>i,RelativePoint:()=>y,midpoint:()=>d});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)}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}}class o extends i{static matching(t){let e=i.matching(t);return new o(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),o.matching(e),super.set(...t)}}var s,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 y{constructor(e){s.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,s,"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,s,"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,s,"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,s=new WeakSet,h=function(t){l(this,c,"f")[t].forEach(t=>t())};var m=r(986);function d(t,e){return new i((0,m.average)([t.x,e.x]),(0,m.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:()=>y,average:()=>n,degrees:()=>f,isBetweenExclusive:()=>l,isBetweenInclusive:()=>h,max:()=>c,mean:()=>n,median:()=>a,min:()=>u,radians:()=>p,sortNumbers:()=>i,sortNumbersAscending:()=>i,sortNumbersDescending:()=>m,sortedNumbers:()=>s,sortedNumbersAscending:()=>s,sortedNumbersDescending:()=>d,sum:()=>r});var o=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;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 s(t){var e=o([],t,!0);return i(e),e}function a(t){if(0==t.length)return NaN;var e=s(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 y(t,e,r){return Math.abs(t-e)<=r}function m(t){i(t),t.reverse()}function d(t){var e=s(t);return e.reverse(),e}function f(t){return t*(180/Math.PI)}function p(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 o(t){return n(t)&&t>0}function s(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:()=>s,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isPositiveFiniteNumber:()=>o,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 o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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:()=>m,deepCopy:()=>o,direction:()=>l,displaced:()=>c,displacement:()=>u,distance:()=>s,isFinitePoint:()=>i,isPoint:()=>e,midpoint:()=>d});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 o(t){return{x:t.x,y:t.y}}function s(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 s(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 y=r(986);function m(t){return{x:(0,y.mean)(t.map(function(t){return t.x})),y:(0,y.mean)(t.map(function(t){return t.y}))}}function d(t,e){return m([t,e])}})(),n})()},106(t){var e;e=()=>(()=>{var t={992(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:()=>d});var r,n,i,o,s,a,u,c,h,l,y=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 d{constructor(t,e,a){r.add(this),this.key=t,n.set(this,void 0),i.set(this,void 0),o.set(this,void 0),s.set(this,void 0),y(this,n,e,"f"),y(this,i,t=>m(this,r,"m",l).call(this,t),"f"),y(this,o,a,"f")}get owner(){return m(this,s,"f")}set owner(t){var e;null===(e=m(this,s,"f"))||void 0===e||e.removeEventListener("keydown",m(this,i,"f")),null==t||t.addEventListener("keydown",m(this,i,"f"),{passive:!1}),y(this,s,t,"f")}}return n=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap,r=new WeakSet,a=function(){var t,e;return null!==(e=null===(t=m(this,o,"f"))||void 0===t?void 0:t.altKey)&&void 0!==e&&e},u=function(){var t,e;return null!==(e=null===(t=m(this,o,"f"))||void 0===t?void 0:t.ctrlKey)&&void 0!==e&&e},c=function(){var t,e;return null!==(e=null===(t=m(this,o,"f"))||void 0===t?void 0:t.metaKey)&&void 0!==e&&e},h=function(){var t,e;return null!==(e=null===(t=m(this,o,"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===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)&&(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 o(t){return n(t)&&t>0}function s(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 y(t){try{return JSON.stringify(t),!0}catch{return!1}}function m(t){return!!t}function d(t){return!t}function f(t){return null==t}function p(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function v(t){return g(t)&&0==t.length}function b(t){return g(t)&&t.length>0}function N(t){return g(t)&&t.every(r)}function O(t){return N(t)&&t.length>0}function x(t){return g(t)&&t.every(n)}function T(t){return g(t)&&t.every(i)}function E(t){return g(t)&&t.every(a)}function w(t){return E(t)&&t.length>0}function S(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>v,isEmptyString:()=>u,isFalsy:()=>d,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>x,isJSON:()=>l,isJSONSerializable:()=>y,isNonEmptyArray:()=>b,isNonEmptyNumbersArray:()=>O,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>w,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>T,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>p,isNullish:()=>f,isNumber:()=>r,isNumbersArray:()=>N,isPositiveFiniteNumber:()=>o,isSVGGraphicsElement:()=>S,isString:()=>a,isStringsArray:()=>E,isTruthy:()=>m,isWhitespace:()=>h}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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 o(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]]}r.r(n),r.d(n,{DownloadableFile:()=>v,EventfulSet:()=>b,FiniteStack:()=>w,KeyBinding:()=>y.KeyBinding,containsFocus:()=>l,detectMac:()=>d,detectWindows:()=>m,first:()=>t,hasFocus:()=>h,isJSON:()=>s.isJSON,isJSONSerializable:()=>s.isJSONSerializable,isURL:()=>S,last:()=>e,middleFour:()=>o,middleThree:()=>i,removeWhitespace:()=>a,shuffled:()=>c,splitLines:()=>u});var s=r(854);function a(t){return[...t].filter(t=>!(0,s.isWhitespace)(t)).join("")}function u(t){return t.split(/\r\n|\r|\n/)}function c(t){return t.map(t=>({v:t,priority:Math.random()})).sort((t,e)=>t.priority-e.priority).map(({v:t})=>t)}function h(t){return t===document.activeElement}function l(t){return!!document.activeElement&&t.contains(document.activeElement)}var y=r(992);function m(){return-1!==navigator.userAgent.indexOf("Windows")}function d(){try{return window.navigator.platform.toLowerCase().includes("mac")}catch(t){return!1}}var f,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},g=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){f.set(this,void 0),this.name=null!=t?t:"Unnamed.txt",this.content=null!=e?e:"",p(this,f,null==r?void 0:r.type,"f")}get type(){return null!=g(this,f,"f")?g(this,f,"f"):this.content instanceof Blob?this.content.type:"text/plain"}set type(t){p(this,f,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)}}f=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 N,O,x,T,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 w{constructor(t){N.add(this),this.maxSize=t,O.set(this,[]),x.set(this,{change:[]})}get size(){return E(this,O,"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,O),E(this,N,"m",T).call(this,"change"))}peek(){if(0==this.size)throw new Error("The stack is empty.");return E(this,O,"f")[E(this,O,"f").length-1]}push(t){E(this,O,"f").push(t),this.size>this.maxSize&&E(this,O,"f").shift(),E(this,N,"m",T).call(this,"change")}pop(){if(0==this.size)throw new Error("The stack is empty.");let t=E(this,O,"f").pop();return E(this,N,"m",T).call(this,"change"),t}addEventListener(t,e){E(this,x,"f")[t].push(e)}removeEventListener(t,e){E(this,x,"f")[t]=E(this,x,"f")[t].filter(t=>t!==e)}}function S(t){try{return new URL(t),!0}catch(t){return!1}}O=new WeakMap,x=new WeakMap,N=new WeakSet,T=function(t){E(this,x,"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 o(t){return n(t)&&t>0}function s(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 y(t){return h(t)&&t.length>0}function m(t){return h(t)&&t.every(r)}function d(t){return m(t)&&t.length>0}function f(t){return h(t)&&t.every(n)}function p(t){return h(t)&&t.every(i)}function g(t){return h(t)&&t.every(a)}function v(t){return g(t)&&t.length>0}return t.r(e),t.d(e,{isArray:()=>h,isEmptyArray:()=>l,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>f,isNonEmptyArray:()=>y,isNonEmptyNumbersArray:()=>d,isNonEmptyStringsArray:()=>v,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>p,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>c,isNullish:()=>u,isNumber:()=>r,isNumbersArray:()=>m,isPositiveFiniteNumber:()=>o,isString:()=>a,isStringsArray:()=>g}),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 o(t){return n(t)&&t>0}function s(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 y(t){try{return JSON.stringify(t),!0}catch{return!1}}function m(t){return!!t}function d(t){return!t}function f(t){return null==t}function p(t){return"object"==typeof t&&null!==t}function g(t){return Array.isArray(t)}function v(t){return g(t)&&0==t.length}function b(t){return g(t)&&t.length>0}function N(t){return g(t)&&t.every(r)}function O(t){return N(t)&&t.length>0}function x(t){return g(t)&&t.every(n)}function T(t){return g(t)&&t.every(i)}function E(t){return g(t)&&t.every(a)}function w(t){return E(t)&&t.length>0}function S(t){return t instanceof SVGGraphicsElement}return t.r(e),t.d(e,{isArray:()=>g,isEmptyArray:()=>v,isEmptyString:()=>u,isFalsy:()=>d,isFiniteNumber:()=>n,isFiniteNumbersArray:()=>x,isJSON:()=>l,isJSONSerializable:()=>y,isNonEmptyArray:()=>b,isNonEmptyNumbersArray:()=>O,isNonEmptyString:()=>c,isNonEmptyStringsArray:()=>w,isNonFiniteNumber:()=>i,isNonFiniteNumbersArray:()=>T,isNonNegativeFiniteNumber:()=>s,isNonNullObject:()=>p,isNullish:()=>f,isNumber:()=>r,isNumbersArray:()=>N,isPositiveFiniteNumber:()=>o,isSVGGraphicsElement:()=>S,isString:()=>a,isStringsArray:()=>E,isTruthy:()=>m,isWhitespace:()=>h}),e})()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.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:()=>o,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 o(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 o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var i=e[n++],o=e[n++];r.o(t,i)?0===o&&n++:0===o?Object.defineProperty(t,i,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,i,{enumerable:!0,get:o})}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,{CurvedBond:()=>G});const t={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let e;const i=new Uint8Array(16),o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));function s(t,r,n){const s=(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(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,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]=s[t];return r}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()}(s)}const a=" ";function u([t,e],r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function c(...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 h=Math.PI;function l(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:o,y:s}=t;if(Math.abs(n)<1e-10||Math.abs(i)<1e-10)return t.rX=0,t.rY=0,t.cX=(e+o)/2,t.cY=(r+s)/2,t.phi1=0,void(t.phi2=0);n=Math.abs(t.rX),i=Math.abs(t.rY);const a=t.xRot/180*h,[c,l]=u([(e-o)/2,(r-s)/2],-a),y=Math.pow(c,2)/Math.pow(n,2)+Math.pow(l,2)/Math.pow(i,2);1<y&&(n*=Math.sqrt(y),i*=Math.sqrt(y)),t.rX=n,t.rY=i;const m=Math.pow(n,2)*Math.pow(l,2)+Math.pow(i,2)*Math.pow(c,2),d=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(i,2)-m)/m)),f=n*l/i*d,p=-i*c/n*d,g=u([f,p],a);t.cX=g[0]+(e+o)/2,t.cY=g[1]+(r+s)/2,t.phi1=Math.atan2((l-p)/i,(c-f)/n),t.phi2=Math.atan2((-l-p)/i,(-c-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*h),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*h),t.phi1*=180/h,t.phi2*=180/h}function y(t,e,r){c(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 d(t,e,r){return(1-r)*t+r*e}function f(t,e,r,n){return t+Math.cos(n/180*h)*e+Math.sin(n/180*h)*r}function p(t,e,r,n){const i=1e-6,o=e-t,s=r-e,a=3*o+3*(n-r)-6*s,u=6*(s-o),c=3*o;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 g(t,e,r,n,i){const o=1-i;return t*(o*o*o)+e*(3*o*o*i)+r*(3*o*i*i)+n*(i*i*i)}function v(t,e,r){const n=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],a=n*s-i*o;if(!(Math.abs(a)<1e-10))return!1;const u=n*o+i*s,c=o*o+s*s;return 0<=u&&u<=c&&n*n+i*i<=c}function b(t){const e=t[t.length-1]?.type===P.CLOSE_PATH,r=e?t.length-2:t.length-1,n=[{type:P.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 P.HORIZ_LINE_TO:n.push({type:P.HORIZ_LINE_TO,relative:!1,x:i.x});break;case P.VERT_LINE_TO:n.push({type:P.VERT_LINE_TO,relative:!1,y:i.y});break;case P.LINE_TO:case P.MOVE_TO:n.push({type:P.LINE_TO,relative:!1,x:i.x,y:i.y});break;case P.CURVE_TO:n.push({type:P.CURVE_TO,relative:!1,x:i.x,y:i.y,x1:r.x2,y1:r.y2,x2:r.x1,y2:r.y1});break;case P.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case P.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case P.ARC:throw new Error("Unsupported command: A (arc)");case P.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&n.push({type:P.CLOSE_PATH}),n}function N(){return T((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 O(){let t=NaN,e=NaN,r=NaN,n=NaN;return T((i,o,s)=>(i.type&P.SMOOTH_CURVE_TO&&(i.type=P.CURVE_TO,t=isNaN(t)?o:t,e=isNaN(e)?s:e,i.x1=i.relative?o-t:2*o-t,i.y1=i.relative?s-e:2*s-e),i.type&P.CURVE_TO?(t=i.relative?o+i.x2:i.x2,e=i.relative?s+i.y2:i.y2):(t=NaN,e=NaN),i.type&P.SMOOTH_QUAD_TO&&(i.type=P.QUAD_TO,r=isNaN(r)?o:r,n=isNaN(n)?s:n,i.x1=i.relative?o-r:2*o-r,i.y1=i.relative?s-n:2*s-n),i.type&P.QUAD_TO?(r=i.relative?o+i.x1:i.x1,n=i.relative?s+i.y1:i.y1):(r=NaN,n=NaN),i))}function x(){let t=NaN,e=NaN;return T((r,n,i)=>{if(r.type&P.SMOOTH_QUAD_TO&&(r.type=P.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&P.QUAD_TO){t=r.relative?n+r.x1:r.x1,e=r.relative?i+r.y1:r.y1;const o=r.x1,s=r.y1;r.type=P.CURVE_TO,r.x1=((r.relative?0:n)+2*o)/3,r.y1=((r.relative?0:i)+2*s)/3,r.x2=(r.x+2*o)/3,r.y2=(r.y+2*s)/3}else t=NaN,e=NaN;return r})}function T(t){let e=0,r=0,n=NaN,i=NaN;return function(o){if(isNaN(n)&&!(o.type&P.MOVE_TO))throw new Error("path must start with moveto");const s=t(o,e,r,n,i);return o.type&P.CLOSE_PATH&&(e=n,r=i),"x"in o&&void 0!==o.x&&(e=o.relative?e+o.x:o.x),"y"in o&&void 0!==o.y&&(r=o.relative?r+o.y:o.y),o.type&P.MOVE_TO&&(n=e,i=r),s}}function E(t,e,r,n,i,o){return c(t,e,r,n,i,o),T((s,a,u,c)=>{const h=s.x1,l=s.x2,y=s.relative&&!isNaN(c),m=void 0!==s.x?s.x:y?0:a,d=void 0!==s.y?s.y:y?0:u;function f(t){return t*t}s.type&P.HORIZ_LINE_TO&&0!==e&&(s.type=P.LINE_TO,s.y=s.relative?0:u),s.type&P.VERT_LINE_TO&&0!==r&&(s.type=P.LINE_TO,s.x=s.relative?0:a),void 0!==s.x&&(s.x=s.x*t+d*r+(y?0:i)),void 0!==s.y&&(s.y=m*e+s.y*n+(y?0:o)),void 0!==s.x1&&(s.x1=s.x1*t+s.y1*r+(y?0:i)),void 0!==s.y1&&(s.y1=h*e+s.y1*n+(y?0:o)),void 0!==s.x2&&(s.x2=s.x2*t+s.y2*r+(y?0:i)),void 0!==s.y2&&(s.y2=l*e+s.y2*n+(y?0:o));const p=t*n-e*r;if(void 0!==s.xRot&&(1!==t||0!==e||0!==r||1!==n))if(0===p)delete s.rX,delete s.rY,delete s.xRot,delete s.lArcFlag,delete s.sweepFlag,s.type=P.LINE_TO;else{const i=s.xRot*Math.PI/180,o=Math.sin(i),a=Math.cos(i),u=1/f(s.rX),c=1/f(s.rY),h=f(a)*u+f(o)*c,l=2*o*a*(u-c),y=f(o)*u+f(a)*c,m=h*n*n-l*e*n+y*e*e,d=l*(t*n+e*r)-2*(h*r*n+y*t*e),g=h*r*r-l*t*r+y*t*t,v=(Math.atan2(d,m-g)+Math.PI)%Math.PI/2,b=Math.sin(v),N=Math.cos(v);s.rX=Math.abs(p)/Math.sqrt(m*f(N)+d*b*N+g*f(b)),s.rY=Math.abs(p)/Math.sqrt(m*f(b)-d*b*N+g*f(N)),s.xRot=180*v/Math.PI}return void 0!==s.sweepFlag&&0>p&&(s.sweepFlag=+!s.sweepFlag),s})}const w={ROUND:function(t=1e13){function e(e){return Math.round(e*t)/t}return c(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:N,TO_REL:function(){return T((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 T((i,o,s,a,u)=>{if(isNaN(a)&&!(i.type&P.MOVE_TO))throw new Error("path must start with moveto");if(e&&i.type&P.HORIZ_LINE_TO&&(i.type=P.LINE_TO,i.y=i.relative?0:s),r&&i.type&P.VERT_LINE_TO&&(i.type=P.LINE_TO,i.x=i.relative?0:o),t&&i.type&P.CLOSE_PATH&&(i.type=P.LINE_TO,i.x=i.relative?a-o:a,i.y=i.relative?u-s:u),i.type&P.ARC&&(0===i.rX||0===i.rY)&&(i.type=P.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),n&&i.type&P.QUAD_TO&&v([o,s],i.relative?[o+i.x1,s+i.y1]:[i.x1,i.y1],i.relative?[o+i.x,s+i.y]:[i.x,i.y])&&(i.type=P.LINE_TO,delete i.x1,delete i.y1),n&&i.type&P.CURVE_TO){const t=[o,s],e=i.relative?[o+i.x1,s+i.y1]:[i.x1,i.y1],r=i.relative?[o+i.x2,s+i.y2]:[i.x2,i.y2],n=i.relative?[o+i.x,s+i.y]:[i.x,i.y];v(t,e,n)&&v(t,r,n)&&(i.type=P.LINE_TO,delete i.x1,delete i.y1,delete i.x2,delete i.y2)}return i})},NORMALIZE_ST:O,QT_TO_C:x,INFO:T,SANITIZE:function(t=0){c(t);let e=NaN,r=NaN,n=NaN,i=NaN;return T((o,s,a,u,c)=>{const h=Math.abs;let l=!1,y=0,m=0;if(o.type&P.SMOOTH_CURVE_TO&&(y=isNaN(e)?0:s-e,m=isNaN(r)?0:a-r),o.type&(P.CURVE_TO|P.SMOOTH_CURVE_TO)?(e=o.relative?s+o.x2:o.x2,r=o.relative?a+o.y2:o.y2):(e=NaN,r=NaN),o.type&P.SMOOTH_QUAD_TO?(n=isNaN(n)?s:2*s-n,i=isNaN(i)?a:2*a-i):o.type&P.QUAD_TO?(n=o.relative?s+o.x1:o.x1,i=o.relative?a+o.y1:o.y2):(n=NaN,i=NaN),o.type&P.LINE_COMMANDS||o.type&P.ARC&&(0===o.rX||0===o.rY||!o.lArcFlag)||o.type&P.CURVE_TO||o.type&P.SMOOTH_CURVE_TO||o.type&P.QUAD_TO||o.type&P.SMOOTH_QUAD_TO){const e=void 0===o.x?0:o.relative?o.x:o.x-s,r=void 0===o.y?0:o.relative?o.y:o.y-a;y=isNaN(n)?void 0===o.x1?y:o.relative?o.x:o.x1-s:n-s,m=isNaN(i)?void 0===o.y1?m:o.relative?o.y:o.y1-a:i-a;const u=void 0===o.x2?0:o.relative?o.x:o.x2-s,c=void 0===o.y2?0:o.relative?o.y:o.y2-a;h(e)<=t&&h(r)<=t&&h(y)<=t&&h(m)<=t&&h(u)<=t&&h(c)<=t&&(l=!0)}return o.type&P.CLOSE_PATH&&h(s-u)<=t&&h(a-c)<=t&&(l=!0),l?[]:o})},MATRIX:E,ROTATE:function(t,e=0,r=0){c(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 c(t,e),E(1,0,0,1,t,e)},SCALE:function(t,e=t){return c(t,e),E(t,0,0,e,0,0)},SKEW_X:function(t){return c(t),E(1,0,Math.tan(t),1,0,0)},SKEW_Y:function(t){return c(t),E(1,Math.tan(t),0,1,0,0)},X_AXIS_SYMMETRY:function(t=0){return c(t),E(-1,0,0,1,t,0)},Y_AXIS_SYMMETRY:function(t=0){return c(t),E(1,0,0,-1,0,t)},A_TO_C:function(){return T((t,e,r)=>P.ARC===t.type?function(t,e,r){t.cX||l(t,e,r);const n=t.xRot/180*h;if(Math.abs(t.rX)<1e-10||Math.abs(t.rY)<1e-10)return[{relative:t.relative,type:P.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),o=Math.max(t.phi1,t.phi2)-i,s=Math.ceil(o/90),a=new Array(s);let c=e,y=r;const f=(e,r)=>{const[i,o]=u([e*t.rX,r*t.rY],n);return[t.cX+i,t.cY+o]};for(let e=0;e<s;e++){const r=d(t.phi1,t.phi2,e/s),n=d(t.phi1,t.phi2,(e+1)/s),i=n-r,o=4/3*Math.tan(i*m/4),u=Math.cos(r*m)-o*Math.sin(r*m),h=Math.sin(r*m)+o*Math.cos(r*m),l=Math.cos(n*m),p=Math.sin(n*m),g=l+o*p,v=p-o*l,b=f(u,h),N=f(g,v),O=f(l,p),x={relative:t.relative,type:P.CURVE_TO,x:O[0],y:O[1],x1:b[0],y1:b[1],x2:N[0],y2:N[1]};t.relative&&(x.x1-=c,x.y1-=y,x.x2-=c,x.y2-=y,x.x-=c,x.y-=y),c=O[0],y=O[1],a[e]=x}return a}(t,t.relative?0:e,t.relative?0:r):t)},ANNOTATE_ARCS:function(){return T((t,e,r)=>(t.relative&&(e=0,r=0),P.ARC===t.type&&l(t,e,r),t))},CLONE:function(){return t=>({...t})},CALCULATE_BOUNDS:function(){const t=N(),e=x(),r=O(),n=T((i,o,s)=>{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&P.DRAWING_COMMANDS&&(u(o),c(s)),a.type&P.HORIZ_LINE_TO&&u(a.x),a.type&P.VERT_LINE_TO&&c(a.y),a.type&P.LINE_TO&&(u(a.x),c(a.y)),a.type&P.CURVE_TO){u(a.x),c(a.y);const t=p(o,a.x1,a.x2,a.x);for(const e of t)0<e&&1>e&&u(g(o,a.x1,a.x2,a.x,e));const e=p(s,a.y1,a.y2,a.y);for(const t of e)0<t&&1>t&&c(g(s,a.y1,a.y2,a.y,t))}if(a.type&P.ARC){u(a.x),c(a.y),l(a,o,s);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,m]=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},p=y(n,-e,0).map(d);for(const t of p)t>h&&t<m&&u(f(a.cX,e,n,t));const g=y(i,-r,0).map(d);for(const t of g)t>h&&t<m&&c(f(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=w.INFO((t,e,r)=>({...t,x:t.x??e,y:t.y??r,relative:t.relative??!1})),n=[];let i=[];for(const o of t){const t=r(o);t.type===P.MOVE_TO&&i.length>0&&(e?n.push(...b(i)):n.unshift(...b(i)),i=[]),i.push(t)}return i.length>0&&(e?n.push(...b(i)):n.unshift(...b(i))),n},REMOVE_COLLINEAR:function(t){if(t.length<=2)return t;const e=[],r=t.map(w.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 o=t[i],s=t[i+1];if(i<t.length-1&&s&&o.type&P.LINE_COMMANDS&&s.type&P.LINE_COMMANDS){const t=r[i+1];if(v(n,r[i],t)){"relative"in s&&s.relative&&("x"in s&&(s.x=t[0]-n[0]),"y"in s&&(s.y=t[1]-n[1]));continue}}e.push(o),n=r[i]}return e}};class S{round(t){return this.transform(w.ROUND(t))}toAbs(){return this.transform(w.TO_ABS())}toRel(){return this.transform(w.TO_REL())}normalizeHVZ(t,e,r){return this.transform(w.NORMALIZE_HVZ(t,e,r))}normalizeST(){return this.transform(w.NORMALIZE_ST())}qtToC(){return this.transform(w.QT_TO_C())}aToC(){return this.transform(w.A_TO_C())}sanitize(t){return this.transform(w.SANITIZE(t))}translate(t,e){return this.transform(w.TRANSLATE(t,e))}scale(t,e){return this.transform(w.SCALE(t,e))}rotate(t,e,r){return this.transform(w.ROTATE(t,e,r))}matrix(t,e,r,n,i,o){return this.transform(w.MATRIX(t,e,r,n,i,o))}skewX(t){return this.transform(w.SKEW_X(t))}skewY(t){return this.transform(w.SKEW_Y(t))}xSymmetry(t){return this.transform(w.X_AXIS_SYMMETRY(t))}ySymmetry(t){return this.transform(w.Y_AXIS_SYMMETRY(t))}annotateArcs(){return this.transform(w.ANNOTATE_ARCS())}}const _=t=>" "===t||"\t"===t||"\r"===t||"\n"===t,A=t=>"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0);class M extends S{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],o=!(this.curCommandType!==P.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),s=A(i)&&("0"===this.curNumber&&"0"===i||o);if(!A(i)||s)if("e"!==i&&"E"!==i)if("-"!==i&&"+"!==i||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==i||this.curNumberHasExp||this.curNumberHasDecimal||o){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===P.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===C[this.curCommandType]&&(P.HORIZ_LINE_TO===this.curCommandType?r({type:P.HORIZ_LINE_TO,relative:this.curCommandRelative,x:t}):P.VERT_LINE_TO===this.curCommandType?r({type:P.VERT_LINE_TO,relative:this.curCommandRelative,y:t}):this.curCommandType===P.MOVE_TO||this.curCommandType===P.LINE_TO||this.curCommandType===P.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),P.MOVE_TO===this.curCommandType&&(this.curCommandType=P.LINE_TO)):this.curCommandType===P.CURVE_TO?r({type:P.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===P.SMOOTH_CURVE_TO?r({type:P.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===P.QUAD_TO?r({type:P.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===P.ARC&&r({type:P.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(!_(i))if(","===i&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==i&&"-"!==i&&"."!==i)if(s)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=P.HORIZ_LINE_TO,this.curCommandRelative="h"===i;else if("v"===i||"V"===i)this.curCommandType=P.VERT_LINE_TO,this.curCommandRelative="v"===i;else if("m"===i||"M"===i)this.curCommandType=P.MOVE_TO,this.curCommandRelative="m"===i;else if("l"===i||"L"===i)this.curCommandType=P.LINE_TO,this.curCommandRelative="l"===i;else if("c"===i||"C"===i)this.curCommandType=P.CURVE_TO,this.curCommandRelative="c"===i;else if("s"===i||"S"===i)this.curCommandType=P.SMOOTH_CURVE_TO,this.curCommandRelative="s"===i;else if("q"===i||"Q"===i)this.curCommandType=P.QUAD_TO,this.curCommandRelative="q"===i;else if("t"===i||"T"===i)this.curCommandType=P.SMOOTH_QUAD_TO,this.curCommandRelative="t"===i;else{if("a"!==i&&"A"!==i)throw new SyntaxError(`Unexpected character "${i}" at index ${n}.`);this.curCommandType=P.ARC,this.curCommandRelative="a"===i}else e.push({type:P.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 P extends S{commands;constructor(t){super(),this.commands="string"==typeof t?P.parse(t):t}encode(){return P.encode(this.commands)}getBounds(){const t=w.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=w.REVERSE_PATH(this.commands,t),this}removeCollinear(){return this.commands=w.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===P.CLOSE_PATH)e+="z";else if(n.type===P.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===P.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===P.MOVE_TO)e+=(n.relative?"m":"M")+n.x+a+n.y;else if(n.type===P.LINE_TO)e+=(n.relative?"l":"L")+n.x+a+n.y;else if(n.type===P.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+a+n.y1+a+n.x2+a+n.y2+a+n.x+a+n.y;else if(n.type===P.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+a+n.y2+a+n.x+a+n.y;else if(n.type===P.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+a+n.y1+a+n.x+a+n.y;else if(n.type===P.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+a+n.y;else{if(n.type!==P.ARC)throw new Error(`Unexpected command type "${n?.type}" at index ${r}.`);e+=(n.relative?"a":"A")+n.rX+a+n.rY+a+n.xRot+a+ +n.lArcFlag+a+ +n.sweepFlag+a+n.x+a+n.y}}return e}(t)}static parse(t){const e=new M,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=P.LINE_TO|P.HORIZ_LINE_TO|P.VERT_LINE_TO;static DRAWING_COMMANDS=P.HORIZ_LINE_TO|P.VERT_LINE_TO|P.LINE_TO|P.CURVE_TO|P.SMOOTH_CURVE_TO|P.QUAD_TO|P.SMOOTH_QUAD_TO|P.ARC}const C={[P.MOVE_TO]:2,[P.LINE_TO]:2,[P.HORIZ_LINE_TO]:1,[P.VERT_LINE_TO]:1,[P.CLOSE_PATH]:0,[P.QUAD_TO]:4,[P.SMOOTH_QUAD_TO]:2,[P.CURVE_TO]:6,[P.SMOOTH_CURVE_TO]:4,[P.ARC]:7};var R=r(456);class L{static matching(t){if(t.type!==P.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 R.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 I{static matching(t){if(t.type!==P.LINE_TO&&t.type!==P.QUAD_TO&&t.type!==P.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!==P.QUAD_TO&&t.type!==P.CURVE_TO||e.push(new R.FinitePoint(t.x1,t.y1)),t.type===P.CURVE_TO&&e.push(new R.FinitePoint(t.x2,t.y2));var r=new R.FinitePoint(t.x,t.y);return new I(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 U,j=r(725),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 F{constructor(t){U.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,U,t,"f")}closest(t){if(0==V(this,U,"f").length)throw new Error("This points collection is empty.");let e=[...V(this,U,"f")];return e.sort((e,r)=>(0,j.distance)(e,t)-(0,j.distance)(r,t)),e[0]}}U=new WeakMap;var H=r(106),D=r(854);class Y{static matching(t){let e=k.create();if(!(0,D.isString)(t))return e;try{let e=new P(t);e=e.toAbs();let r=L.matching(e.commands[0]),n=[I.matching(e.commands[1]),...e.commands.slice(2).map(t=>I.matching(t))];return new Y(r,n)}catch{return e}}constructor(t,e){this.moveToSegment=t,this.trailingSegments=e}get segments(){return[this.moveToSegment,this.trailingSegments[0],...this.trailingSegments.slice(1)]}get definingPoints(){return[this.startPoint,...this.trailingSegments.flatMap(t=>[...t.controlPoints,t.endPoint])]}get startPoint(){return this.moveToSegment.startPoint}get interveningPoints(){return[...this.trailingSegments.slice(0,-1).flatMap(t=>[...t.controlPoints,t.endPoint]),...(0,H.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,H.last)(this.trailingSegments).endPoint}toString(){return this.segments.map(t=>t.toString()).join(" ")}drag(t,e,r){let n=new F(this.definingPoints).closest(r.dragPoint);this.controlPoints.includes(n)&&(t*=2,e*=2),n.displace({x:t,y:e})}}const k={create:()=>{let t=new P("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=[I.matching(t.commands[1])];return new Y(e,r)}};var X=r(277);class Q{static from(t){let e,r=new Q(0,0);if(!(0,D.isString)(t))return r;try{e=JSON.parse(t)}catch{return r}return(0,X.isVectorLike)(e)?Q.matching(e):r}static matching(t){let e=X.Vector.matching(t);return new Q(e.magnitude,e.direction)}constructor(t,e){this.magnitude=t,this.direction=e}toJSON(){return JSON.stringify({magnitude:this.magnitude,direction:this.direction})}}var W,$,z,Z,J=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{static between(e,r){let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.id="id-"+(!t.randomUUID||o||i?s(i,o,a):t.randomUUID()),n.setAttribute("stroke","black"),n.setAttribute("stroke-width","1.5"),n.setAttribute("stroke-opacity","1"),n.setAttribute("stroke-dasharray",""),n.setAttribute("stroke-linecap",""),n.setAttribute("stroke-linejoin",""),n.setAttribute("fill","none"),new G(n,e,r);var i,o,a}constructor(t,e,r){W.add(this),this.domNode=t,this.base1=e,this.base2=r,e.addEventListener("change",()=>J(this,W,"m",$).call(this)),r.addEventListener("change",()=>J(this,W,"m",$).call(this))}get id(){return this.domNode.id}get basePadding1(){let t=()=>Q.from(this.domNode.dataset.basePadding1),e=(t,e)=>{let r=new Q(t,e);this.domNode.dataset.basePadding1=r.toJSON(),J(this,W,"m",$).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=()=>Q.from(this.domNode.dataset.basePadding2),e=(t,e)=>{let r=new Q(t,e);this.domNode.dataset.basePadding2=r.toJSON(),J(this,W,"m",$).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)}}}}W=new WeakSet,$=function(){let t=Q.from(this.domNode.dataset.basePadding1),e=Q.from(this.domNode.dataset.basePadding2);t=J(this,W,"m",z).call(this,t),e=J(this,W,"m",Z).call(this,e);let r=Y.matching(this.domNode.getAttribute("d")),n=(0,R.midpoint)(r.startPoint,r.endPoint),i=r.interveningPoints.map(t=>[R.Point.matching(t),n.displacementTo(t)]);i.forEach(([t,e])=>e.direction-=(0,j.direction)(r.startPoint,r.endPoint)),r.startPoint.set(R.Point.matching(this.base1.centerPoint).displaced(t)),r.endPoint.set(R.Point.matching(this.base2.centerPoint).displaced(e)),n=(0,R.midpoint)(r.startPoint,r.endPoint),i.forEach(([t,e])=>e.direction+=(0,j.direction)(r.startPoint,r.endPoint)),i.forEach(([t,e])=>t.set(n.displaced(e))),this.domNode.setAttribute("d",r.toString())},z=function(t){let e=Q.matching(t);return e.direction+=(0,j.direction)(this.base1.centerPoint,this.base2.centerPoint),e},Z=function(t){let e=Q.matching(t);return e.direction+=(0,j.direction)(this.base2.centerPoint,this.base1.centerPoint),e}})(),n})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rnacanvas/draw.bonds.curved",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Draw curved bonds",
5
5
  "repository": {
6
6
  "type": "git",