flo-mat 4.0.2 → 4.0.3
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/__tests__/specific-cases/specific-cases.spec.ts +6 -0
- package/browser/index.js +4511 -7115
- package/browser/index.min.js +1 -1
- package/node/cp-node/fs/is-on-same-loop.d.ts +3 -0
- package/node/cp-node/fs/is-on-same-loop.js +6 -0
- package/node/cp-node/fs/is-on-same-loop.js.map +1 -0
- package/node/debug/debug.d.ts +10 -15
- package/node/debug/debug.js +35 -46
- package/node/debug/debug.js.map +1 -1
- package/node/find-2-prong/add-1-prong.js +1 -4
- package/node/find-2-prong/add-1-prong.js.map +1 -1
- package/node/find-mat/find-mat.js +1 -2
- package/node/find-mat/find-mat.js.map +1 -1
- package/node/find-mat/get-meta.d.ts +1 -6
- package/node/find-mat/get-meta.js +4 -26
- package/node/find-mat/get-meta.js.map +1 -1
- package/node/index.d.ts +4 -2
- package/node/index.js +3 -1
- package/node/index.js.map +1 -1
- package/node/reconstruct-from-mat/filter-zero-length.d.ts +10 -0
- package/node/reconstruct-from-mat/filter-zero-length.js +14 -0
- package/node/reconstruct-from-mat/filter-zero-length.js.map +1 -0
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.d.ts +7 -0
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.js +38 -0
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.js.map +1 -0
- package/node/reconstruct-from-mat/get-bezier-piece-length.d.ts +3 -0
- package/node/reconstruct-from-mat/get-bezier-piece-length.js +6 -0
- package/node/reconstruct-from-mat/get-bezier-piece-length.js.map +1 -0
- package/node/reconstruct-from-mat/get-boundary.d.ts +7 -0
- package/node/reconstruct-from-mat/get-boundary.js +18 -0
- package/node/reconstruct-from-mat/get-boundary.js.map +1 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.d.ts +4 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js +15 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js.map +1 -0
- package/node/reconstruct-from-mat/get-matching-beziers.d.ts +10 -0
- package/node/reconstruct-from-mat/get-matching-beziers.js +29 -0
- package/node/reconstruct-from-mat/get-matching-beziers.js.map +1 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.d.ts +6 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js +10 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js.map +1 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.d.ts +7 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js +47 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js.map +1 -0
- package/node/reconstruct-from-mat/get-sats2.d.ts +10 -0
- package/node/reconstruct-from-mat/get-sats2.js +16 -0
- package/node/reconstruct-from-mat/get-sats2.js.map +1 -0
- package/node/reconstruct-from-mat/is-fully-terminating.d.ts +3 -0
- package/node/reconstruct-from-mat/is-fully-terminating.js +19 -0
- package/node/reconstruct-from-mat/is-fully-terminating.js.map +1 -0
- package/node/reconstruct-from-mat/matched-beziers.d.ts +10 -0
- package/node/reconstruct-from-mat/matched-beziers.js +2 -0
- package/node/reconstruct-from-mat/matched-beziers.js.map +1 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.d.ts +4 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.js +28 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.js.map +1 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.d.ts +12 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js +46 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js.map +1 -0
- package/node/reconstruct-from-mat/split-tri-path.d.ts +5 -0
- package/node/reconstruct-from-mat/split-tri-path.js +209 -0
- package/node/reconstruct-from-mat/split-tri-path.js.map +1 -0
- package/node/sat/add-debug-info.js +1 -2
- package/node/sat/add-debug-info.js.map +1 -1
- package/node/utils/clip.d.ts +2 -0
- package/node/utils/clip.js +6 -0
- package/node/utils/clip.js.map +1 -0
- package/package.json +2 -2
- package/src/cp-node/fs/is-on-same-loop.ts +15 -0
- package/src/debug/debug.ts +54 -72
- package/src/find-2-prong/add-1-prong.ts +1 -5
- package/src/find-mat/find-mat.ts +1 -2
- package/src/find-mat/get-meta.ts +3 -38
- package/src/index.ts +5 -3
- package/src/reconstruct-from-mat/filter-zero-length.ts +23 -0
- package/src/reconstruct-from-mat/get-all-on-loop-by-loop.ts +52 -0
- package/src/reconstruct-from-mat/get-bezier-piece-length.ts +12 -0
- package/src/reconstruct-from-mat/get-boundary.ts +32 -0
- package/src/reconstruct-from-mat/get-cp-nodess-for-sat.ts +24 -0
- package/src/reconstruct-from-mat/get-matching-beziers.ts +46 -0
- package/src/reconstruct-from-mat/get-mbss-by-loop-per-sat.ts +19 -0
- package/src/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.ts +69 -0
- package/src/reconstruct-from-mat/get-sats2.ts +25 -0
- package/src/reconstruct-from-mat/is-fully-terminating.ts +27 -0
- package/src/reconstruct-from-mat/matched-beziers.ts +14 -0
- package/src/reconstruct-from-mat/reconstruct-from-mat.ts +45 -0
- package/src/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.ts +62 -0
- package/src/reconstruct-from-mat/split-tri-path.ts +280 -0
- package/src/sat/add-debug-info.ts +1 -2
- package/src/utils/clip.ts +13 -0
- package/node/debug/functions/general.d.ts +0 -48
- package/node/debug/functions/general.js +0 -53
- package/node/debug/functions/general.js.map +0 -1
- package/node/point-on-shape/pos-to-human-string.d.ts +0 -8
- package/node/point-on-shape/pos-to-human-string.js +0 -12
- package/node/point-on-shape/pos-to-human-string.js.map +0 -1
- package/src/debug/elem-type-two-prong.ts +0 -8
- package/src/debug/functions/cmp-cp-on-delta.ts +0 -54
- package/src/debug/functions/general.ts +0 -79
- package/src/debug/functions/three-prong.ts +0 -249
- package/src/debug/functions/two-prong.ts +0 -203
- package/src/find-2-prong/add-debug-info.ts +0 -45
package/browser/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t=[],e){const r=[],o={beziers:t,curves:r,idx:e};if(0===t.length)return o;let i,c=0;for(let e=0;e<t.length;e++){if(n(t[e]))continue;const s={loop:o,ps:t[e],prev:i,next:void 0,idx:c};i&&(i.next=s),i=s,r.push(s),c++}const s=r[r.length-1];return r[0].prev=s,s.next=r[0],s.ps[s.ps.length-1]=r[0].ps[0],o}function n(t){return 2===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]:3===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]:t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]&&t[2][1]===t[3][1]&&t[2][1]===t[3][1]}function e(t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];0===e&&n.push("M "+r[0][0].toString()+" "+r[0][1].toString()),4===r.length?n.push("C "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "+r[3][0].toString()+" "+r[3][1].toString()+" "):3===r.length?n.push("Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "):2===r.length&&n.push("L "+r[1][0].toString()+" "+r[1][1].toString()+" ")}return n.push(" z"),n.join("\n")}class r{initialPoint=void 0;p;vals=void 0;prev2ndCubicControlPoint=void 0;prev2ndQuadraticControlPoint=void 0;constructor(){this.p=[0,0]}}function o(t){const n=[t.p,t.initialPoint];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n}function i(t){t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0;const n=(e=t.p,t.vals[0],t.vals[1],t.vals[2],t.vals[3],t.vals[4],[[e,[t.vals[5],t.vals[6]]]]);var e;const r=n[n.length-1];return t.p=r[r.length-1],n}const c={c:function(t){const n=[t.p,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]],[t.vals[4],t.vals[5]]];return t.prev2ndCubicControlPoint=n[2],t.prev2ndQuadraticControlPoint=void 0,n},h:function(t){const n=[t.p,[t.vals[0],t.p[1]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},l:function(t){const n=[t.p,t.vals];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},q:function(t){const n=[t.vals[0],t.vals[1]],e=[t.vals[2],t.vals[3]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},s:function(t){const n=t.prev2ndCubicControlPoint?[t.p[0]-t.prev2ndCubicControlPoint[0]+t.p[0],t.p[1]-t.prev2ndCubicControlPoint[1]+t.p[1]]:t.p,e=[t.p,n,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]]];return t.prev2ndCubicControlPoint=e[2],t.prev2ndQuadraticControlPoint=void 0,e},t:function(t){const n=t.prev2ndQuadraticControlPoint?[t.p[0]-t.prev2ndQuadraticControlPoint[0]+t.p[0],t.p[1]-t.prev2ndQuadraticControlPoint[1]+t.p[1]]:t.p,e=[t.vals[0],t.vals[1]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},v:function(t){const n=[t.p,[t.p[0],t.vals[0]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},z:o};function s(t){let n=0,e=0,r=1,o=0,i=1,c=1;const s=t._currentIndex;t._skipOptionalSpaces();let u=t._currentIndex;u<t._endIndex&&"+"===t._string[u]?(t._currentIndex+=1,u+=1):u<t._endIndex&&"-"===t._string[u]&&(t._currentIndex+=1,u+=1,i=-1);const f=t._string[u];if(u===t._endIndex||(f<"0"||f>"9")&&"."!==f)throw new Error(`The first character of a number must be one of [0-9+-.]. Found '${f}' at index ${u}.`);const l=t._currentIndex;for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)t._currentIndex+=1,u+=1;if(u!==l){let n=u-1,r=1;for(;n>=l;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(u<t._endIndex&&"."===t._string[u]){if(t._currentIndex+=1,u+=1,u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be a least one digit following the .");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)r*=10,o+=Number(t._string.charAt(u))/r,t._currentIndex+=1,u+=1}if(u!==s&&u+1<t._endIndex&&("e"===t._string[u]||"E"===t._string[u])&&"x"!==t._string[u+1]&&"m"!==t._string[u+1]){if(t._currentIndex+=1,u+=1,"+"===t._string[u]?(t._currentIndex+=1,u+=1):"-"===t._string[u]&&(t._currentIndex+=1,u+=1,c=-1),u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be an exponent.");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)n*=10,n+=Number(t._string[u]),t._currentIndex+=1,u+=1}let a=e+o;if(a*=i,n&&(a*=Math.pow(10,c*n)),s===u)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),a}const u={Z:"Z",M:"M",L:"L",C:"C",Q:"Q",A:"A",H:"H",V:"V",S:"S",T:"T",z:"Z",m:"m",l:"l",c:"c",q:"q",a:"a",h:"h",v:"v",s:"s",t:"t"};class f{_string;_currentIndex;_endIndex;_prevCommand;constructor(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._prevCommand=void 0,this._skipOptionalSpaces()}parseSegment(){const t=this._string[this._currentIndex];let n,e=u[t];if(void 0===e){if(void 0===this._prevCommand)throw new Error("Implicit command not allowed for first commands.");if(!("+"===t||"-"===t||"."===t||t>="0"&&t<="9")||"Z"===this._prevCommand)throw new Error("Remaining coordinates not found for implicit command");e="M"===this._prevCommand?"L":"m"===this._prevCommand?"l":this._prevCommand}else this._currentIndex+=1;this._prevCommand=e;const r=e.toUpperCase();if("H"===r||"V"===r?n=[s(this)]:"M"===r||"L"===r||"T"===r?n=[s(this),s(this)]:"S"===r||"Q"===r?n=[s(this),s(this),s(this),s(this)]:"C"===r?n=[s(this),s(this),s(this),s(this),s(this),s(this)]:"A"===r?n=[s(this),s(this),s(this),this._parseArcFlag(),this._parseArcFlag(),s(this),s(this)]:"Z"===r&&(this._skipOptionalSpaces(),n=[]),void 0===n)throw new Error("Unknown command");return{type:e,values:n}}hasMoreData(){return this._currentIndex<this._endIndex}initialCommandIsMoveTo(){if(!this.hasMoreData())return!0;const t=u[this._string[this._currentIndex]];return"M"===t||"m"===t}_isCurrentSpace(){const t=this._string[this._currentIndex];return t<=" "&&(" "===t||"\n"===t||"\t"===t||"\r"===t||"\f"===t)}_skipOptionalSpaces(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex+=1;return this._currentIndex<this._endIndex}_skipOptionalSpacesOrDelimiter(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!==this._string[this._currentIndex])&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","===this._string[this._currentIndex]&&(this._currentIndex+=1,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)}_parseArcFlag(){if(this._currentIndex>=this._endIndex)throw new Error("Unable to parse arc flag");let t;const n=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===n)t=0;else{if("1"!==n)throw new Error("Unable to parse arc flag - arc flag must be 0 or 1");t=1}return this._skipOptionalSpacesOrDelimiter(),t}}function l(t){return function(t){if(0===t.length)return[];if("m"!==t[0].type.toLowerCase())throw new Error("Invalid SVG - every new path must start with an M or m.");const n=new r,e=[];let s,u=[];for(let r=0;r<t.length;r++){const f=t[r],l=f.type.toLowerCase();if(n.vals=f.values,f.type===l)if("v"===l)n.vals[0]+=n.p[1];else if("a"===l)n.vals[5]+=n.p[0],n.vals[6]+=n.p[1];else for(let t=0;t<n.vals.length;t++)n.vals[t]+=n.p[t%2];if("m"!==l){if("a"===l)u.push(...i(n));else{const t=c[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}s=l}else u.length&&("z"!==s&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,s=l}return u.length>0&&("z"!==s&&u.push(o(n)),e.push(u)),e}(function(t){if(!t.length)return[];const n=new f(t),e=[];if(!n.initialCommandIsMoveTo())throw new Error("Path must start with m or M");for(;n.hasMoreData();)e.push(n.parseSegment());return e}(t))}function a(t,n,e="thin10 red nofill",r=0){if(0===n.length)return[];let o=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];if(e.length<=1)continue;const[,r,i,c]=e;o+=2===e.length?`L ${r[0]} ${r[1]} `:3===e.length?`Q ${r[0]} ${r[1]} ${i[0]} ${i[1]} `:`C ${r[0]} ${r[1]} ${i[0]} ${i[1]} ${c[0]} ${c[1]} `}const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d",o),i.setAttributeNS(null,"class",e),t.appendChild(i),[i]}function p(t){const n=t.length,e=Array.from(Array(n),()=>new Array(n).fill(0));for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t[r][o];for(let t=0;t<n;t++)for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][t]+e[t][o]<e[r][o]&&(e[r][o]=e[r][t]+e[t][o]);return e}function h(t){const n=t,e=[];do{e.push(t),t=t.next}while(t!==n);return e}function d(t){return h(t).filter(t=>t.isHoleClosing)}function g(t){const n=t.pointOnShape;return{idx:n.curve.idx,t:n.t,order:n.order,order2:n.order2}}function v(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function m(t,n=!1){const e=t,r=n?[]:[t];let o=t.nextOnCircle;for(;o!==e;)r.push(o),o=o.nextOnCircle;return r}function x(t){return t===t.next.prevOnCircle}function b(t){return m(t).filter(t=>!x(t)).length}function w(t){return m(t.prevOnCircle,!0).every(x)}function _(t){return 0===t.pointOnShape.circle.radius}function M(t){const n=t.pointOnShape,e=n.curve;return{...t,pos:n,p:n.p,t:n.t,isTerminating:x(t),isFullyTerminating:w(t),isSharp:_(t),prongCount:v(t),getRealProngCount:b(t),ordering:g(t),curve:e,loop:e.loop}}function S(t){let n=t;if(x(n))return[n];const e=[];do{e.push(n);const t=n.next.prevOnCircle;n=n=n===t?n.next.next:t}while(n!==t);return e}function N(t,n){const e=h(t),r=new Set;for(t of e)x(t)||r.has(t.next.prevOnCircle)||n(t),r.add(t)}function I(t){const n=[],e=t;let r=e;for(;r!==e.prevOnCircle;)x(r)||n.push(r.next),r=r.nextOnCircle;return n}function y(t,n){n(t);const e=m(t).filter(t=>!x(t)).map(t=>t.next);for(const t of e){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...I(t))}}}const E=["prev","next","prevOnCircle","nextOnCircle","holeCloserTwin"];function O(t){const n=new Map,e=C(t);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of E){const i=t[o];if(void 0===i)continue;let c=n.get(i);c||(c=C(i),n.set(i,c),r.push({cpNode:i,newCpNode:c})),e[o]=c}}return e}function C(t){return{...t,prev:void 0,next:void 0,prevOnCircle:void 0,nextOnCircle:void 0,holeCloserTwin:void 0}}function T(t){const n=t,e=t.next,r=n.pointOnShape,o=e.pointOnShape,i=r.curve,c=o.curve;if(i.loop!==c.loop)return[];const s=[];return c===i?s.push({ps:r.curve.ps,ts:[r.t,o.t]}):(s.push({ps:r.curve.ps,ts:[r.t,1]}),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({ps:o.ps,ts:[0,n]})}while(o!==e)}(s,r.curve,o.curve,o.t)),s}function P(t,n,e){if(4===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,O=e*N,C=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*C+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*C+2*y)+(h*y+u-(O+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*C+2*y)+(g*y+u-(2*O+E))],[v*S+(3*e*(e*w-x)+s),v*C+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[e,[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function A(t){return T(t).map(t=>P(t.ps,t.ts[0],t.ts[1]))}function k(t,n){const{cpTrees:e}=n,r=t.prev,o=t.next;r.next=o,o.prev=r,e.get(t.pointOnShape.curve.loop).remove(t,!1)}function B(t,n){const e=v(t);if(2!==e)throw new Error(`Cannot delete \`CpNode\` on ${e}-prong`);m(t).forEach(t=>k(t,n))}function z(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function F(t,n,e){if(void 0===t.size||void 0===e)return;const r=e[n];if(t.size>r&&void 0!==r)for(const[n]of t){t.delete(n);break}}const Y=[function(t,n){let e,r=!1;return function(){return r||(e=t(),r=!0),e}},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t){return"object"!=typeof t&&"function"!=typeof t||null===t?o:r}const c=function(r){let c;const s=i(r);return s.has(r)?(e&&console.log("cache hit"),c=s.get(r)):(e&&console.log("cache miss"),c=t(r),s.set(r,c),F(o,0,n)),c};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e){const r=i(e);r.set(e,t),F(r,1,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o){const i=("object"==typeof o||"function"==typeof o)&&null!==o;let c="object"!=typeof t&&"function"!=typeof t||null===t?r:e,s=c.get(t);return void 0===s&&(s={weakMap:new WeakMap,map:new Map},c.set(t,s),F(c,0,n)),i?s.weakMap:s.map}function i(e,r){const i=o(e,r);let c;return i.has(r)?c=i.get(r):(c=t(e,r),i.set(r,c),F(i,1,n)),c}return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r){const i=o(e,r);i.set(r,t),F(i,1,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i){const c=("object"==typeof o||"function"==typeof o)&&null!==o,s=("object"==typeof i||"function"==typeof i)&&null!==i;let u="object"!=typeof t&&"function"!=typeof t||null===t?r:e,f=u.get(t);void 0===f&&(f={weakMap:new WeakMap,map:new Map},u.set(t,f),F(u,0,n));const l=c?f.weakMap:f.map;let a=l.get(o);return void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(o,a),F(l,1,n)),s?a.weakMap:a.map}const i=function(e,r,i){const c=o(e,r,i);let s;return c.has(i)?s=c.get(i):(s=t(e,r,i),c.set(i,s),F(c,2,n)),s};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i){const c=o(e,r,i);c.set(i,t),F(c,2,n)},i},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t,e,i,c){const s=("object"==typeof e||"function"==typeof e)&&null!==e,u=("object"==typeof i||"function"==typeof i)&&null!==i,f=("object"==typeof c||"function"==typeof c)&&null!==c;let l="object"!=typeof t&&"function"!=typeof t||null===t?o:r,a=l.get(t);void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(t,a),F(l,0,n));const p=s?a.weakMap:a.map;let h=p.get(e);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(e,h),F(p,1,n));const d=u?h.weakMap:h.map;let g=d.get(i);return void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(i,g),F(d,2,n)),f?g.weakMap:g.map}const c=function(r,o,c,s){const u=i(r,o,c,s);let f;return u.has(s)?(e&&console.log("cache hit"),f=u.get(s)):(e&&console.log("cache miss"),f=t(r,o,c,s),u.set(s,f),F(u,3,n)),f};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,r,o,c){const s=i(e,r,o,c);s.set(c,t),F(s,3,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s){const u=("object"==typeof o||"function"==typeof o)&&null!==o,f=("object"==typeof i||"function"==typeof i)&&null!==i,l=("object"==typeof c||"function"==typeof c)&&null!==c,a=("object"==typeof s||"function"==typeof s)&&null!==s;let p="object"!=typeof t&&"function"!=typeof t||null===t?r:e,h=p.get(t);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(t,h),F(p,0,n));const d=u?h.weakMap:h.map;let g=d.get(o);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(o,g),F(d,1,n));const v=f?g.weakMap:g.map;let m=v.get(i);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(i,m),F(v,2,n));const x=l?m.weakMap:m.map;let b=x.get(c);return void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(c,b),F(x,3,n)),a?b.weakMap:b.map}const i=function(e,r,i,c,s){const u=o(e,r,i,c,s);let f;return u.has(s)?f=u.get(s):(f=t(e,r,i,c,s),u.set(s,f),F(u,4,n)),f};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s){const u=o(e,r,i,c,s);u.set(s,t),F(u,4,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u){const f=("object"==typeof o||"function"==typeof o)&&null!==o,l=("object"==typeof i||"function"==typeof i)&&null!==i,a=("object"==typeof c||"function"==typeof c)&&null!==c,p=("object"==typeof s||"function"==typeof s)&&null!==s,h=("object"==typeof u||"function"==typeof u)&&null!==u;let d="object"!=typeof t&&"function"!=typeof t||null===t?r:e,g=d.get(t);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(t,g),F(d,0,n));const v=f?g.weakMap:g.map;let m=v.get(o);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(o,m),F(v,1,n));const x=l?m.weakMap:m.map;let b=x.get(i);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(i,b),F(x,2,n));const w=a?b.weakMap:b.map;let _=w.get(c);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(c,_),F(w,3,n));const M=p?_.weakMap:_.map;let S=M.get(s);return void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(s,S),F(M,4,n)),h?S.weakMap:S.map}const i=function(e,r,i,c,s,u){const f=o(e,r,i,c,s,u);let l;return f.has(u)?l=f.get(u):(l=t(e,r,i,c,s,u),f.set(u,l),F(f,5,n)),l};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u){const f=o(e,r,i,c,s,u);f.set(u,t),F(f,5,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f){const l=("object"==typeof o||"function"==typeof o)&&null!==o,a=("object"==typeof i||"function"==typeof i)&&null!==i,p=("object"==typeof c||"function"==typeof c)&&null!==c,h=("object"==typeof s||"function"==typeof s)&&null!==s,d=("object"==typeof u||"function"==typeof u)&&null!==u,g=("object"==typeof f||"function"==typeof f)&&null!==f;let v="object"!=typeof t&&"function"!=typeof t||null===t?r:e,m=v.get(t);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(t,m),F(v,0,n));const x=l?m.weakMap:m.map;let b=x.get(o);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(o,b),F(x,1,n));const w=a?b.weakMap:b.map;let _=w.get(i);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(i,_),F(w,2,n));const M=p?_.weakMap:_.map;let S=M.get(c);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(c,S),F(M,3,n));const N=h?S.weakMap:S.map;let I=N.get(s);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(s,I),F(N,4,n));const y=d?I.weakMap:I.map;let E=y.get(u);return void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(u,E),F(y,5,n)),g?E.weakMap:E.map}const i=function(e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);let a;return l.has(f)?a=l.get(f):(a=t(e,r,i,c,s,u,f),l.set(f,a),F(l,6,n)),a};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);l.set(f,t),F(l,6,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f,l){const a=("object"==typeof o||"function"==typeof o)&&null!==o,p=("object"==typeof i||"function"==typeof i)&&null!==i,h=("object"==typeof c||"function"==typeof c)&&null!==c,d=("object"==typeof s||"function"==typeof s)&&null!==s,g=("object"==typeof u||"function"==typeof u)&&null!==u,v=("object"==typeof f||"function"==typeof f)&&null!==f,m=("object"==typeof l||"function"==typeof l)&&null!==l;let x="object"!=typeof t&&"function"!=typeof t||null===t?r:e,b=x.get(t);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(t,b),F(x,0,n));const w=a?b.weakMap:b.map;let _=w.get(o);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(o,_),F(w,1,n));const M=p?_.weakMap:_.map;let S=M.get(i);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(i,S),F(M,2,n));const N=h?S.weakMap:S.map;let I=N.get(c);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(c,I),F(N,3,n));const y=d?I.weakMap:I.map;let E=y.get(s);void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(s,E),F(y,4,n));const O=g?E.weakMap:E.map;let C=O.get(u);void 0===C&&(C={weakMap:new WeakMap,map:new Map},O.set(u,C),F(O,5,n));const T=v?C.weakMap:C.map;let P=T.get(f);return void 0===P&&(P={weakMap:new WeakMap,map:new Map},T.set(f,P),F(T,6,n)),m?P.weakMap:P.map}const i=function(e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);let p;return a.has(l)?p=a.get(l):(p=t(e,r,i,c,s,u,f,l),a.set(l,p),F(a,7,n)),p};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);a.set(l,t),F(a,7,n)},i}];function L(t,n,e=!1){const r=t.length;if(r>8)throw new Error("A maximum of 8 formal parameters are supported");return(0,Y[r])(t,n,e)}function X(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=o-e,a=i-r,p=u-c,h=f-s,d=p*a-h*l;if(0===d)return;const g=((s-r)*l-(c-e)*a)/d;return[c+g*p,s+g*h]}function H(t,n){return[n[0]-t[0],n[1]-t[1]]}function D(t,n){return t[0]*n[0]+t[1]*n[1]}function V(t){return[-t[1],t[0]]}function $(t,n){return t[0]*n[1]-t[1]*n[0]}function q(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function j(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function W(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function Q(t,n,e){function r(e){return[e[0]*n-e[1]*t,e[0]*t+e[1]*n]}return void 0===e?r:r(e)}function R(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function G(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function U(t,n){const[e,r]=G(t);return[R(e,n),R(r,n)]}function Z(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function J(t,n){const e=t.length,r=n.length;let o=0,i=0;const c=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(c.push(t[o]),o++):(c.push(n[i]),i++):i++:o++;for(;o<e;)c.push(t[o]),o++;for(;i<r;)c.push(n[i]),i++;if(0===c.length)return[0];const s=c.length;if(1===s)return c;const u=[],f=c[1],l=c[0];let a=f+l;const p=l-(a-f);0!==p&&u.push(p),i=0;for(let t=2;t<s;t++){const n=c[t],e=a+n,r=e-a,o=a-(e-r)+(n-r);0!==o&&u.push(o),a=e}return 0===a&&0!==u.length||u.push(a),u}const K=134217729;function tt(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const c=K*o,s=c-(c-o),u=o-s,f=K*n,l=f-(f-n),a=n-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=t[o],c=e*n,s=K*e,u=s-(s-e),f=e-u,l=K*n,a=l-(l-n),h=n-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function nt(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const c=K*o,s=c-(c-o),u=o-s,f=K*t,l=f-(f-t),a=t-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=n[o],c=e*t,s=K*e,u=s-(s-e),f=e-u,l=K*t,a=l-(l-t),h=t-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function et(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(e,tt(n,t[r]));return e}function rt(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function ot(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}function it(t,n){return J(t,ot(n))}function ct(t){return t[t.length-1]}const st=Z,ut=nt;function ft(t){if(4===t.length){const[[n,e],[r,o]]=t;return[ut(3,st(r,n)),ut(3,st(o,e))]}if(3===t.length){const[[n,e],[r,o]]=t;return[st(2*r,2*n),st(2*o,2*e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[st(r,n),st(o,e)]}if(1===t.length)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function lt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}function at(t,n){const e=t.length;let r=n;const o=[];for(let n=0;n<e;n++){const e=t[n],i=r+e,c=i-r,s=r-(i-c)+(e-c);0!==s&&o.push(s),r=i}return 0===r&&0!==o.length||o.push(r),o}const pt=lt,ht=nt,dt=at;function gt(t){if(4===t.length){const[[n,e],[r,o],[i,c]]=t;return[ht(6,dt(pt(i,n),-2*r)),ht(6,dt(pt(c,e),-2*o))]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[dt(pt(2*i,2*n),-4*r),dt(pt(2*c,2*e),-4*o)]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3")}const vt=Z,mt=nt,xt=J;function bt(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[mt(6,xt(vt(s,n),mt(3,vt(r,i))))],[mt(6,xt(vt(u,e),mt(3,vt(o,c))))]]}if(t.length<=3)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}const{sign:wt}=Math;function _t(t,n){const[e,r]=ft(t),[o,i]=gt(t),[c,s]=ft(n),[u,f]=gt(n),l=it(et(e,i),et(r,o)),a=it(et(c,f),et(s,u)),p=ct(l),h=ct(a);if(wt(p)!==wt(h))return p-h;const d=J(et(c,c),et(s,s)),g=J(et(e,e),et(r,r)),v=et(d,d),m=et(v,d),x=et(g,g),b=et(x,g);if(0!==p||0!==h){const t=et(l,l),n=et(a,a),e=ct(it(et(t,m),et(n,b)));if(0!==e)return p>0?e:-e}const[[w],[_]]=bt(t),[[M],[S]]=bt(n),N=it(et(e,_),et(r,w)),I=J(et(e,o),et(r,i)),y=it(et(c,S),et(s,M)),E=J(et(c,u),et(s,f)),O=it(et(g,N),tt(et(l,I),3)),C=it(et(d,y),tt(et(a,E),3)),T=ct(O),P=ct(C);if(T!==P)return T-P;if(0===T&&0===P)return 0;const A=et(O,O),k=et(v,m),B=et(C,C),z=et(x,b),F=ct(it(et(A,k),et(B,z)));return T>0?F:-F}function Mt(t,n){return t[0]===n[0]&&t[1]===n[1]}function St(t,n){const{ccw:e,tangentI:r,tangentO:o,dotTangents:i}=function(t,n){const e=t.length;let r=t[e-2],o=n[0],i=n[1];Mt(r,o)&&(r=t[e-3]),Mt(o,i)&&(i=n[2]);const c=function(t,n,e){const r=Z(t[0],e[0]),o=Z(n[1],e[1]),i=Z(t[1],e[1]),c=Z(n[0],e[0]);return rt(J(et(r,o),ot(et(i,c))))}(r,o,i),s=[Z(o[0],r[0]),Z(o[1],r[1])],u=[Z(i[0],o[0]),Z(i[1],o[1])],f=function(t,n){return rt(J(et(t[0],n[0]),et(t[1],n[1])))}(s,u);return 0!==c||f>0?{ccw:c,tangentI:s,tangentO:u,dotTangents:f}:{ccw:_t(t.slice().reverse(),n),tangentI:s,tangentO:u,dotTangents:f}}(t,n),c=e<0,s=e>0,u=[W(r.map(t=>t[1])),W(o.map(t=>t[1]))],f=$(u[0],u[1]);let l,a;return i>0?(l=f<-.0698,a=f>.0698):(l=c,a=s),{tangents:u,isSharp:c,isDull:s,isQuiteSharp:l,isQuiteDull:a}}const Nt=L(function(t){const{t:n,curve:e}=t;return St(1===n?e.ps:e.prev.ps,1===n?e.next.ps:e.ps)});function It(t){return 0===t.t||1===t.t}function yt(t){return!!It(t)&&Nt(t).isSharp}function Et(t){const n=t.pointOnShape.circle.center,e=t,r=t.nextOnCircle,o=e.pointOnShape,i=r.pointOnShape,c=o.p,s=i.p;let u;if(yt(o)){let t,n;0===o.t?(t=o.curve,n=o.curve.prev):1===o.t&&(t=o.curve.next,n=o.curve);const e=W(U(t.ps,0)),r=[-(f=W(U(n.ps,1)))[0],-f[1]],i=D(e,r),c=Math.sqrt((1+i)/2);u=Q(Math.sqrt((1-i)/2),c,r)}else u=c[0]===s[0]&&c[1]===s[1]?H(c,n):V(H(c,s));var f;return[n,j(W(u),n)]}const{abs:Ot}=Math,Ct=1e-4;function Tt(t,n){const e=t.pointOnShape.circle.center,r=Et(t),o=n.pointOnShape.circle.center,i=Et(n.prevOnCircle),c=X(r,i),s=H(e,o);let u;if(c){const t=H(e,c),n=H(o,c);u=D(t,s)<0||D(n,s)>0}else u=!0;if(!u)return[e,c,o];const f=V(s),l=H(r[0],r[1]),a=H(i[0],i[1]),p=Ot($(s,l))/9,h=Ot($(s,a))/9;if(p>.01||h>.01)return[e,o];if(p>Ct||h>Ct){const t=q(e,o,1/3),n=q(e,o,2/3),c=j(f,t),s=[n,j(f,n)];return[e,X(r,[t,c]),X(i,s),o]}return[e,o]}function Pt(t){return Tt(t,t.next)}function At(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function kt(t,n){return m(t).indexOf(n)>=0}function Bt(t){return 1===b(t)&&!t.isHoleClosing}function zt(t){return 2===b(t)}function Ft(t){return m(t).every(x)}function Yt(t){if(Ft(t))return[];for(;x(t);)t=t.nextOnCircle;for(t=t.next;2===b(t);)t=t.next;t=t.prevOnCircle;const n=[];do{n.push(t),t=t.next}while(!w(t)&&2===b(t));return n}function Lt(t){return Yt(t).map(t=>Pt(t))}function Xt(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function Ht(t,n){const[e,r]=t,[[o,i],[c,s]]=n;return Xt([o+e*(c-o),i+e*(s-i)],[o+r*(c-o),i+r*(s-i)])}function Dt(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=Vt[e],[i,c]=n;let s=0;const u=(c-i)/2,f=(c+i)/2;for(let n=0;n<=e-1;n++)s+=r[n]*t(u*o[n]+f);return u*s}L(Pt);const Vt={2:{weights:[1,1],abscissas:[-.5773502691896257,.5773502691896257]},4:{weights:[.6521451548625461,.6521451548625461,.3478548451374538,.3478548451374538],abscissas:[-.3399810435848563,.3399810435848563,-.8611363115940526,.8611363115940526]},8:{weights:[.362683783378362,.362683783378362,.3137066458778873,.3137066458778873,.2223810344533745,.2223810344533745,.1012285362903763,.1012285362903763],abscissas:[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363]},16:{weights:[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685,.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096],abscissas:[-.9894009349916499,-.9445750230732326,-.8656312023878318,-.755404408355003,-.6178762444026438,-.45801677765722737,-.2816035507792589,-.09501250983763744,.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]},64:{weights:[.048690957009139724,.048690957009139724,.04857546744150343,.04857546744150343,.048344762234802954,.048344762234802954,.04799938859645831,.04799938859645831,.04754016571483031,.04754016571483031,.04696818281621002,.04696818281621002,.046284796581314416,.046284796581314416,.04549162792741814,.04549162792741814,.044590558163756566,.044590558163756566,.04358372452932345,.04358372452932345,.04247351512365359,.04247351512365359,.04126256324262353,.04126256324262353,.03995374113272034,.03995374113272034,.038550153178615626,.038550153178615626,.03705512854024005,.03705512854024005,.035472213256882386,.035472213256882386,.033805161837141606,.033805161837141606,.03205792835485155,.03205792835485155,.030234657072402478,.030234657072402478,.028339672614259483,.028339672614259483,.02637746971505466,.02637746971505466,.024352702568710874,.024352702568710874,.022270173808383253,.022270173808383253,.02013482315353021,.02013482315353021,.017951715775697343,.017951715775697343,.015726030476024718,.015726030476024718,.013463047896718643,.013463047896718643,.011168139460131128,.011168139460131128,.008846759826363947,.008846759826363947,.006504457968978363,.006504457968978363,.004147033260562468,.004147033260562468,.001783280721696433,.001783280721696433],abscissas:[-.024350292663424433,.024350292663424433,-.07299312178779904,.07299312178779904,-.12146281929612056,.12146281929612056,-.16964442042399283,.16964442042399283,-.21742364374000708,.21742364374000708,-.2646871622087674,.2646871622087674,-.31132287199021097,.31132287199021097,-.3572201583376681,.3572201583376681,-.4022701579639916,.4022701579639916,-.4463660172534641,.4463660172534641,-.48940314570705296,.48940314570705296,-.5312794640198946,.5312794640198946,-.571895646202634,.571895646202634,-.6111553551723933,.6111553551723933,-.6489654712546573,.6489654712546573,-.6852363130542333,.6852363130542333,-.7198818501716109,.7198818501716109,-.7528199072605319,.7528199072605319,-.7839723589433414,.7839723589433414,-.8132653151227975,.8132653151227975,-.8406292962525803,.8406292962525803,-.8659993981540928,.8659993981540928,-.8893154459951141,.8893154459951141,-.9105221370785028,.9105221370785028,-.9295691721319396,.9295691721319396,-.9464113748584028,.9464113748584028,-.9610087996520538,.9610087996520538,-.973326827789911,.973326827789911,-.983336253884626,.983336253884626,-.9910133714767443,.9910133714767443,-.9963401167719553,.9963401167719553,-.9993050417357722,.9993050417357722]}},{sqrt:$t}=Math;function qt(t){const[n,e]=G(t);return function(t){const r=R(n,t),o=R(e,t);return $t(r*r+o*o)}}const{abs:jt}=Math,Wt=[[0,0],[0,0],[0,0]];function Qt(t,n,e){return 0===n?1===e?{ps:t,_ps:Wt}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=jt(n),v=jt(i),m=jt(s),x=jt(f),b=v+m,w=jt(c),_=jt(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(jt(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=jt(n),x=jt(i),b=jt(s),w=x+b,_=jt(f)+b,M=jt(c),S=jt(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+(jt(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=jt(n),y=jt(e),E=jt(d),O=jt(c),C=jt(u),T=O+C,P=T+jt(l)+C,A=jt(s),k=jt(f),B=A+k,z=B+jt(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*P+(2*I*T+O),p*z+(2*I*B+A)],[E*P+(T*(y+I)+O),E*x+(B*(y+I)+A)],[h*P+(2*y*T+O),h*z+(2*y*B+A)]]}}(t,n,e)}const Rt=134217729;function Gt(t,n){const e=t*n,r=Rt*t,o=r-(r-t),i=t-o,c=Rt*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}function Ut(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r+i,s=c-r,u=e+o,f=u-e,l=r-(c-s)+(i-s)+u,a=c+l,p=e-(u-f)+(o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}function Zt(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r-i,s=c-r,u=e-o,f=u-e,l=r-(c-s)+(-i-s)+u,a=c+l,p=e-(u-f)+(-o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}const{atan2:Jt}=Math,Kt=Gt;function tn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=Zt(Kt(i,e),Kt(o,r))[1],s=Ut(Kt(o,e),Kt(i,r))[1];return Jt(c,s)}const{abs:nn}=Math;function en(t){const n=[];for(let e=0;e<t.length-1;e++){const r=[t[e+1][0]-t[e][0],t[e+1][1]-t[e][1]];0!==(0!==r[0]||r[1])&&n.push(r)}const e=n.length;let r=0;for(let t=0;t<e-1;t++)r+=nn(tn(n[t],n[t+1]));return r}function rn(t,n=.4,e=2**-16){const r=[0],o=[1];for(;;){const i=r[r.length-1],c=o[o.length-1];if(en(P(t,i,c))<=n||c-i<=e){if(r.push(o.pop()),1===c)return r;continue}const s=(i+c)/2;o.push(s)}}const{sqrt:on,log:cn}=Math;function sn(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a]]=n;if(c===u&&u===l&&s===f&&f===a)return 0;const p=Qt(n,o,i).ps,h=rn(p,e);let d=0;for(let t=0;t<h.length-1;t++){const n=h[t],e=h[t+1];d+=Dt(qt(p),[n,e],r)}return d}const{abs:un}=Math,fn=[[0,0],[0,0],[0,0],[0,0]];function ln(t,n,e){return 0===n?1===e?{ps:t,_ps:fn}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=un(n),S=un(c),N=un(u),I=un(l),y=un(p),E=un(s),O=un(f),C=un(a),T=S+M*(S+N),P=N+M*(N+I),A=T+M*(T+P),k=E+M*(E+O),B=O+M*(O+C),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[A,z],[A+M*(A+(P+M*(P+(I+M*(I+y))))),z+M*(z+(B+M*(B+(C+M*(C+un(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),N=_-n*(_-M),I=S-n*(S-N),y=un(n),E=un(c),O=un(u),C=un(l),T=un(p),P=un(s),A=un(f),k=un(a),B=E+y*(E+O),z=O+y*(O+C),F=C+y*(C+T),Y=B+y*(B+z),L=z+y*(z+F),X=P+y*(P+A),H=A+y*(A+k),D=k+y*(k+un(h)),V=X+y*(X+H),$=H+y*(H+D);return{ps:[[b,I],[x,N],[v,M],[p,h]],_ps:[[Y+y*(Y+L),V+y*(V+$)],[L,$],[F,D],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=c[0]-s,_=x+b,M=n*x,S=e*x,N=w-3*b,I=u-l,y=p-l,E=c[1]-u,O=I+y,C=n*I,T=e*I,P=E-3*y,A=d*N+(3*n*(n*_-x)+s),k=m*(n*N+2*_)+(h*_+s-(S+2*M)),B=m*(e*N+2*_)+(g*_+s-(2*S+M)),z=v*N+(3*e*(e*_-x)+s),F=d*P+(3*n*(n*O-I)+u),Y=m*(n*P+2*O)+(h*O+u-(T+2*C)),L=m*(e*P+2*O)+(g*O+u-(2*T+C)),X=v*P+(3*e*(e*O-I)+u),H=un(n),D=un(e),V=un(m),$=un(d),q=un(v),j=un(s),W=un(f),Q=j+W,R=un(a)+W,G=Q+R,U=H*Q,Z=D*Q,J=un(w)+3*R,K=un(u),tt=un(l),nt=K+tt,et=un(p)+tt,rt=nt+et,ot=H*nt,it=D*nt,ct=un(E)+3*et;return{ps:[[A,F],[k,Y],[B,L],[z,X]],_ps:[[$*J+(3*H*(H*G+Q)+j),$*ct+(3*H*(H*rt+nt)+K)],[V*(H*J+2*G)+(h*G+j+(Z+2*U)),V*(H*ct+2*rt)+(h*rt+K+(it+2*ot))],[V*(D*J+2*G)+(g*G+j+(2*Z+U)),V*(D*ct+2*rt)+(g*rt+K+(2*it+ot))],[q*J+(3*D*(D*G+Q)+j),q*ct+(3*D*(D*rt+nt)+K)]]}}(t,n,e)}function an(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a],[p,h]]=n;if(c===u&&u===l&&l===p&&s===f&&f===a&&a===h)return 0;const d=ln(n,o,i).ps,g=rn(d,e);let v=0;for(let t=0;t<g.length-1;t++){const n=g[t],e=g[t+1];v+=Dt(qt(d),[n,e],r)}return v}function pn(t,n=.4,e=16){if(4===t.length)return an([0,1],t,n,e);if(3===t.length)return sn([0,1],t,n,e);if(2===t.length)return Ht([0,1],t);if(1===t.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function hn(t,n,e=!0){const{cpNodes:r,hasHoleCloser:o}=function(t,n,e=!0){if(!e&&t===n)return{cpNodes:[],hasHoleCloser:!1};const r=t,o=[r];let i=t.next,c=r.isHoleClosing;for(;i!==n&&i!==r;)i.isHoleClosing&&(c=!0),o.push(i),i=i.next;return{cpNodes:o,hasHoleCloser:c}}(t,n,e);return{pss:r.flatMap(A),hasHoleCloser:o}}function dn(t){const n=t,e=t.nextOnCircle,r=Xt(n.pointOnShape.p,e.pointOnShape.p),{pss:o,hasHoleCloser:i}=hn(n,e),c=function(t){let n=0;for(let e of t)n+=e;return n}(o.map(t=>pn(t)));return i?1/0:c/r}function gn(t,n){let e=t;const r=[];for(;e!==n;){const t=Tt(e,e.next);r.push(t),e=e.next}return r}function vn(t,n){const e=$(W(U(Pt(t),0)),W(U(Pt(n),0)));return Math.abs(Math.asin(e)*(180/Math.PI))}function mn(t){const n=[];return y(t,t=>{n.push(t)}),n}function xn(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t,0!==e||(e=t.order-n.order,0!==e||(e=t.order2-n.order2))),e}function bn(t,n){return xn(t.pointOnShape,n.pointOnShape)}const wn={getChildren:z,getVertexForwardChildren:I,getAllOnLoop:h,getAllOnCircle:m,isOnSameCircle:kt,isTerminating:x,isFullyTerminating:w,getFirstExit:At,isSharp:_,isOneProng:Bt,getProngCount:v,getRealProngCount:b,cpNodeComparator:bn,enhanceCpNode:M,traverseCp:S,traverseEdges:N,traverseVertices:y,clone:O,getBoundaryBezierPartsToNext:T,getBoundaryBeziersToNext:A,removeVertex:B,getMatCurveToNext:Pt,isTwoProng:zt,getBranch:Yt,getBranchBeziers:Lt,getSalience:dn,getMatCurveBetween:Tt,getEdgeDirection:Et,getBoundaryBeziersBetween:hn,getMatCurvesBetween:gn,getHoleClosers:d,getInitialDegAngleBetweenMatCurves:vn,getAllVertices:mn};function _n(t){return n=>m(n).some(t)}const Mn=_n(function(t){return 2!==b(t)&&!t.isHoleClosing});function Sn(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=-t[e];return n}function Nn(t){return n=>1/t(n.toReversed())}function In(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=Sn(t));const e=[];for(let t=0;t<n;t++)e.push(1);let r=0;for(let o=0;o<=n;o++){if(t[o]>=0)continue;let n=1/0,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const c=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>c&&(n=c),i=!0}i&&r<n&&(r=n)}return r}Nn(In);const yn=(En=In,t=>-En(function(t){const n=t.length-1;if(n<0)return[];const e=t.slice();for(let t=0;t<n+1;t++)t%2==(n-1)%2&&(e[t]=-e[t]);return e}(t)));var En;Nn(yn);const{min:On,max:Cn}=Math,{abs:Tn}=Math;function Pn(t){const n=t.slice(),e=n.length;if(1===e)return n;let r=n[e-1],o=e;for(let t=e-2;t>=0;--t){const e=r,i=n[t];r=e+i;const c=i-(r-e);c&&(n[--o]=r,r=c)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const c=o-(r-e);c&&(n[i++]=c)}return n[i++]=r,n.length=i,n}const An=Number.EPSILON,kn=Number.EPSILON/2,Bn=kn*kn,zn=Yn(1),Fn=function(){const t=3*Bn;return t/(1-t)}();function Yn(t){const n=t*kn;return n/(1-n)}new Array(20).fill(0).map((t,n)=>Yn(n));const{abs:Ln}=Math,{abs:Xn}=Math,Hn=134217729;function Dn(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,c=i-(i-r),s=r-c,u=Hn*t,f=u-(u-t),l=t-f,a=s*l-(o-c*f-s*f-c*l)+e*t,p=o+a;return[a-(p-o),p]}const{abs:Vn}=Math;function $n(t,n,e){const r=t.length-1;if(r<0)return[[],[]];const o=Vn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=i[e-1],r=c[e-1],s=Dn(n,t),u=o*r+Vn(s[1]),f=i[e];i[e]=Ut(f,s),c[e]=c[e]+u+Vn(i[e][1])}return[i,c]}const qn=2**27+1;function jn(t,n){const e=t[1],r=n[1],o=e*r,i=qn*e,c=i-(i-e),s=e-c,u=qn*r,f=u-(u-r),l=r-f,a=s*l-(o-c*f-s*f-c*l)+(e*n[0]+t[0]*r),p=o+a;return[a-(p-o),p]}const{abs:Wn}=Math;function Qn(t,n){const e=t.length-1;if(e<0)return[];const r=t.slice();for(let t=0;t<=e;t++)for(let o=1;o<=e-t;o++)r[o]=Pn(J(r[o],tt(r[o-1],n)));return r}function Rn(t,n){const e=t.length-1;if(e<0)return[];const r=new Array(e+1);r[e]=t[e];let o=[1];for(let i=1;i<=e;i++)o=tt(o,n),r[e-i]=et(t[e-i],o);return r}const{abs:Gn,sign:Un}=Math;const Zn=134217729;function Jn(t,n){const e=t*n,r=Zn*t,o=r-(r-t),i=t-o,c=Zn*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}const{abs:Kn}=Math;function te(t,n){const e=Kn(n);let r=t[0],o=.5*Kn(r);for(let i=1;i<t.length;i++)r=r*n+t[i],o=o*e+Kn(r);return o=kn*(2*o-Kn(r)),[r,o]}const ne=Math.abs,{abs:ee}=Math,re=Yn(1),oe=Yn(2);function ie(t,n,e=void 0,r=1){const o=t[0],[i,c]=te(o,n),s=oe*function(t,n){const e=ne(n);let r=0;for(let n=0;n<t.length;n++)r=r*e+ne(t[n]);return r}(o,n),u=void 0!==e?R(e,ee(n)):0;if((c+s+u)*r<Math.abs(i))return i;const f=function(t,n){const e=[],r=[];let o,i=t[0];for(let c=1;c<t.length;c++){const[s,u]=Jn(i,n);[o,i]=lt(u,t[c]),e.push(s),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(o,n),{pπ:l,pσ:a}=f;let{r̂:p}=f;const[h,d]=te(l,n),[g,v]=te(a,n),[m,x]=te(t[1],n);let b=d+v+x+u;return p=h+g+m+p,b+=re*p,b*r<Math.abs(p)?p:0}function ce(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(t[r],tt(e,n));return e}const{abs:se,min:ue,max:fe,log2:le,ceil:ae}=Math;function pe(t,n,e,r,o,i,c,s){let u=e,f=r,l=u,a=o,p=f-u,h=p;for(;;){let d;se(a)<se(i)&&(u=f,f=l,l=u,o=i,i=a,a=o);const g=fe(se(u),se(f));d=g<=1?An:An*2**ae(le(g));const v=.5*(l-f);if(se(v)<=d)return f<l?[f,l,f]:[l,f,f];if(se(p)<d||se(o)<=se(i))p=v,h=p;else{let t,n,e=i/o;if(u===l)t=2*v*e,n=1-e;else{n=o/a;const r=i/a;t=e*(2*v*n*(n-r)-(f-u)*(r-1)),n=(n-1)*(r-1)*(e-1)}0<t?n=-n:t=-t,e=p,p=h,2*t<3*v*n-se(d*n)&&t<se(.5*e*n)?h=t/n:(p=v,h=p)}if(u=f,o=i,d<se(h)?f+=h:0<v?f+=d:f-=d,0===(i=s?rt(ce(c(),f)):ie(t,f,n))){if(s)return[f,f,f];const o=fe(e,f-d),u=ue(r,f+d);if(ie(t,o,n)*ie(t,u,n)!==0)return[o,u,f];if(s=!0,0===(i=rt(ce(c(),f))))return[f,f,f]}(0<i&&0<a||i<=0&&a<=0)&&(l=u,a=o,p=f-u,h=p)}}const{abs:he}=Math;function de(t,n,e){const r=he(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=o*n;o=s+t[c],i=i*r+he(s)+e[c]+he(o)}return[o,i]}function ge(t){const n=t[0].length,e=[];for(let r=0;r<n;r++){const o=[];for(let e=0;e<t.length;e++)o.push(t[e][n-(r+1)]);e.push(o)}return e}const ve=Ut,me=Dn,{abs:xe}=Math;function be(t,n,e){const r=xe(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=me(n,o);o=ve(s,t[c]),i=i*r+xe(s[1])+e[c]+xe(o[1])}return[o,i]}const{abs:we,min:_e,max:Me,log2:Se,ceil:Ne}=Math,Ie=Fn/zn;function ye(t,n,e,r,o,i,c){const s=t.length-1;let u=0,f=1;for(;;){f*=2;for(let l=1;l<f;l+=2){u++;const a=o+(i-o)*(f+2*l)/(4*f),[p,h]=de(t,a,n);if(we(p)>h*zn)return[a,p];if(u>s)return Ee(e,r,o,i,c)}}}function Ee(t,n,e,r,o){const i=t.length-1;let c=0,s=1;for(;;){s*=2;for(let u=1;u<s;u+=2){c++;const f=e+(r-e)*(s+2*u)/(4*s),[l,a]=be(t,f,n);if(we(l[1])>a*Fn)return[f,l[1]];if(c>i)return Oe(o(),e,r)}}}function Oe(t,n,e){const r=t.length-1;let o=1;for(;;){o*=2;for(let i=1;i<o;i+=2){const c=n+(e-n)*(o+2*i)/(4*o),s=Pn(ce(t,c)),u=s[s.length-1];if(0!==u)return[c,u];if(0>r)throw new Error("Cannot resolve root even in Shewchuk expansion precision")}}}function Ce(t,n=-1/0,e=1/0,r,o,i=!1){let c;"number"==typeof t[0]&&(t=t.map(t=>[0,t]));const s=()=>void 0===o?t:(void 0===c&&(c=o()),c);if(r=r||new Array(t.length).fill(0),({pDd:t,pDd_:r,pExact:c}=function(t,n,e,r){let o;for(;t.length>0&&Tn(t[0][1])<=r*n[0]&&(o=o||e(),0===ct(o[0]));)(t=t.slice()).shift(),(n=n.slice()).shift(),o.shift();return{pDd:t,pDd_:n,pExact:o}}(t,r,s,Fn)),0===t.length)return;if(1===t.length)return[];const u=t.map(t=>t[0]+t[1]);return!i&&n!==-1/0&&e!==1/0||([n,e]=function(t,n,e){return[t=Cn(t,yn(e)),n=On(n,In(e))]}(n,e,u),n!==e)?function(t,n,e,r,o,i){const c=e.map((n,e)=>n*Ie+we(t[e])),s=r,u=o;let f,l,a,p,h=o-r;for(;[f,l]=de(t,r,c),!(we(f)>l*zn);)r-=h/2,h*=2;for(;[a,p]=de(t,o,c),!(we(a)>p*zn);)o+=h/2,h*=2;const d=[[r,o,f,a,0]],g=[],v=function(t,n,e,r,o){return function(i,c,s,u,f){let[l,a]=function(t,n,e){const r=t.length-1,o=Ln(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=n*i[e-1],r=o*c[e-1]+Ln(t);i[e]=i[e]+t,c[e]=c[e]+r+Ln(i[e])}return[i,c]}(t,i,n);!function(t,n,e){const r=t.length-1;if(r<0)return;let o=n,i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Xn(u),l=e[s],a=u*o;t[s]=a,e[s]=l*o+f*i+Xn(a);const p=o*n;i=i*n+p,o=p}}(l,c-i,a),l.reverse(),a.reverse(),function(t,n){const e=t.length-1;for(let r=0;r<=e;r++)for(let o=1;o<=e-r;o++){const e=t[o-1],r=n[o-1]+Ln(e);t[o]=t[o]+e,n[o]=n[o]+r+Ln(t[o])}}(l,a);let p=0,h=0,d=Un(s);for(let t=1;t<l.length-1;t++){let n=Un(l[t]);const e=l[t],r=a[t]*zn;Gn(e)<=r&&(h++,n=-d),n!==d&&(p++,d=n)}return Un(u)!==d&&p++,1===h&&1===p?1:h>0?function(t,n,e,r,o,i,c,s){let[u,f]=$n(t,e,n);(function(t,n,e){const r=t.length-1;if(r<0)return;let o=[0,n],i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Wn(u[1]),l=e[s],a=jn(o,u);t[s]=a,e[s]=l*o[1]+f*i+Wn(a[1]);const p=jn(o,[0,n]);i=i*n+p[1],o=p}})(u,r-e,f),u.reverse(),f.reverse(),[u,f]=$n(u,1,f);let l=0,a=0,p=Un(o);for(let t=0;t<u.length-1;t++){let n=Un(u[t][1]);const e=f[t]*Fn,r=u[t];e>=Gn(r[1])&&(a++,n=-p),n!==p&&(l++,p=n)}return Un(i)!==p&&l++,1===a&&1===l?1:0===a?l:c>1?function(t,n,e,r,o){let i=Qn(t(),n);i=Rn(i,e-n),i.reverse(),i=Qn(i,1);let c=0,s=Un(r);for(let t=1;t<i.length-1;t++){const n=i[t];let e=Un(n[n.length-1]);e!==s&&0!==e&&(c++,s=e)}return Un(o)!==s&&c++,c}(s,e,r,o,i):-l}(e,r,i,c,s,u,f,o):p}}(t,c,n,e,i);let m,x;for(;d.length>0;){const r=d.pop(),[o,s,u,f,l]=r,a=v(o,s,u,f,l);if(0===a)continue;if(1===a){m=m||e.map(t=>t*Fn),x=x||ge(n);const[t,r,c]=pe(x,m,o,s,u,f,i,!1);g.push({t:c,tS:t,tE:r,multiplicity:1});continue}let p=a<0?l+1:0;if(s-o<=2*we(a)*An*Me(1,2**Ne(Se(Me(we(o),we(s)))))){if(0===p){g.push({t:(o+s)/2,tS:o,tE:s,multiplicity:we(a)});continue}p=1/0}const[h,b]=ye(t,c,n,e,o,s,i);d.push([o,h,u,b,p]),d.push([h,s,b,f,p])}return g.reverse(),g.filter(t=>{const{tS:n,tE:e}=t;return!(e<s||n>u)})}(u,t,r,n,e,s):[{t:n,tS:n,tE:e,multiplicity:u.length-1}]}function Te(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const Pe=Math.abs;function Ae(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Pe(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=Pe(n),a=Pe(r),p=Pe(o),h=Pe(i),d=Pe(c),g=Pe(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(Pe(u)+d)*e+m)*e+x)*e,_+(w+(g+(Pe(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=Pe(n),f=Pe(r),l=Pe(o),a=Pe(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Pe(c)+l)*e+p)*e,h+(a+(Pe(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=Pe(n),s=Pe(r);return[c+(Pe(o)+c)*e,s+(Pe(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const ke=Number.EPSILON/2,Be=ke*ke,ze=(Fe(1),Ye(3));function Fe(t){const n=t*ke;return n/(1-n)}function Ye(t){const n=t*Be;return n/(1-n)}const Le=Math.abs,Xe=[[0,0],[0,0],[0,0],[0,0]];function He(t,n,e){return 0===n?1===e?{ps:t,_ps:Xe}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=Le(n),S=Le(c),N=Le(u),I=Le(l),y=Le(p),E=Le(s),O=Le(f),C=Le(a),T=S+M*(S+N),P=N+M*(N+I),A=T+M*(T+P),k=E+M*(E+O),B=O+M*(O+C),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[A,z],[A+M*(A+(P+M*(P+(I+M*(I+y))))),z+M*(z+(B+M*(B+(C+M*(C+Le(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),N=_-n*(_-M),I=S-n*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(D*G+Q)+j),q*ct+(3*D*(D*rt+nt)+K)]]}}(t,n,e)}const De=Math.abs,Ve=[[0,0],[0,0],[0,0]];function $e(t,n,e){return 0===n?1===e?{ps:t,_ps:Ve}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=De(n),v=De(i),m=De(s),x=De(f),b=v+m,w=De(c),_=De(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(De(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=De(n),x=De(i),b=De(s),w=x+b,_=De(f)+b,M=De(c),S=De(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+(De(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=De(n),y=De(e),E=De(d),O=De(c),C=De(u),T=O+C,P=T+De(l)+C,A=De(s),k=De(f),B=A+k,z=B+De(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*P+(2*I*T+O),p*z+(2*I*B+A)],[E*P+(T*(y+I)+O),E*x+(B*(y+I)+A)],[h*P+(2*y*T+O),h*z+(2*y*B+A)]]}}(t,n,e)}const qe=Math.abs,je=[[0,0],[0,0]];const We=Number.EPSILON/2,Qe=Fe(1);function Re(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=He(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*We*r[0][0],f=9*We*r[1][0],l=9*We*r[2][0],a=9*We*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*We*r[0][1],m=9*We*r[1][1],x=9*We*r[2][1],b=9*We*r[3][1],w=Math.min(o-u,i-f,c-l,s-a),_=Math.max(o+u,i+f,c+l,s+a);return[[w,Math.min(p-v,h-m,d-x,g-b)],[_,Math.max(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=$e(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*We*r[0][0],u=5*We*r[1][0],f=5*We*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*We*r[0][1],d=5*We*r[1][1],g=5*We*r[2][1],v=Math.min(o-s,i-u,c-f),m=Math.max(o+s,i+u,c+f);return[[v,Math.min(l-h,a-d,p-g)],[m,Math.max(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:je}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=qe(n),l=qe(o),a=qe(c),p=qe(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(qe(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=qe(n),l=qe(o),a=qe(c),p=qe(i);return{ps:u,_ps:[[f*(a+l)+l,f*(qe(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=qe(n),a=qe(e),p=qe(i),h=qe(s),d=qe(c),g=qe(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*We*r[0][0],s=3*We*r[1][0],u=e[0][1],f=e[1][1],l=3*We*r[0][1],a=3*We*r[1][1],p=Math.min(o-c,i-s),h=Math.max(o+c,i+s);return[[p,Math.min(u-l,f-a)],[h,Math.max(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Te(t,n);let i;if(4===t.length)i=Ae(t,[0,n]).map(t=>8*Qe*t);else if(3===t.length)i=Ae(t,[0,n]).map(t=>5*Qe*t);else if(2===t.length)i=Ae(t,[0,n]).map(t=>2*Qe*t);else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}function Ge(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const Ue=Z,Ze=Number.EPSILON;function Je(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function Ke(t){return[2*t[0],2*t[1]]}function tr(t){return[4*t[0],4*t[1]]}const nr=Je,er=Ut,rr=Dn,or=jn,ir=Ke,cr=tr,sr=Zt;function ur(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=nr(c,d),m=nr(u,d),x=nr(l,d),b=nr(p,d),w=nr(s,g),_=nr(f,g),M=nr(a,g),S=nr(h,g),N=or(v,v),I=rr(6,or(v,m)),y=rr(6,or(v,x)),E=ir(or(v,b)),O=rr(9,or(m,m)),C=rr(18,or(m,x)),T=rr(6,or(m,b)),P=rr(9,or(x,x)),A=rr(6,or(x,b)),k=or(b,b),B=or(w,w),z=rr(6,or(w,_)),F=rr(6,or(w,M)),Y=ir(or(w,S)),L=rr(9,or(_,_)),X=rr(18,or(_,M)),H=rr(6,or(_,S)),D=rr(9,or(M,M)),V=rr(6,or(M,S)),$=or(S,S),q=er(T,P),j=er(E,C),W=er(y,O),Q=er(H,D),R=er(Y,X),G=er(F,L);return[rr(6,er(er(er(er(sr(k,A),sr(N,I)),q),sr(W,j)),er(er(er(sr($,V),sr(B,z)),Q),sr(G,R)))),rr(5,er(sr(er(er(A,rr(5,I)),rr(3,j)),ir(er(er(q,ir(W)),rr(3,N)))),sr(er(er(V,rr(5,z)),rr(3,R)),ir(er(er(Q,ir(G)),rr(3,B)))))),cr(er(sr(sr(q,rr(3,sr(j,ir(W)))),rr(5,sr(ir(I),rr(3,N)))),sr(sr(Q,rr(3,sr(R,ir(G)))),rr(5,sr(ir(z),rr(3,B)))))),rr(3,er(sr(j,ir(sr(ir(W),rr(5,sr(I,ir(N)))))),sr(R,ir(sr(ir(G),rr(5,sr(z,ir(B)))))))),ir(er(sr(W,rr(5,sr(I,rr(3,N)))),sr(G,rr(5,sr(z,rr(3,B)))))),er(sr(I,rr(6,N)),sr(z,rr(6,B)))]}const fr=Je,lr=Ut,ar=Dn,pr=jn,hr=Ke,dr=Zt,gr=tr;function vr(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=fr(e,u),a=fr(o,u),p=fr(c,u),h=fr(r,f),d=fr(i,f),g=fr(s,f),v=pr(l,l),m=pr(l,a),x=pr(l,p),b=pr(a,a),w=pr(a,p),_=pr(p,p),M=pr(h,h),S=pr(h,d),N=pr(h,g),I=pr(d,d),y=pr(d,g),E=pr(g,g),O=lr(N,hr(I)),C=lr(x,hr(b));return[lr(dr(lr(lr(E,M),hr(O)),gr(lr(y,S))),dr(lr(lr(_,v),hr(C)),gr(lr(w,m)))),ar(3,lr(lr(dr(y,O),dr(ar(3,S),M)),lr(dr(w,C),dr(ar(3,m),v)))),lr(dr(O,ar(3,dr(hr(S),M))),dr(C,ar(3,dr(hr(m),v)))),lr(dr(S,M),dr(m,v))]}function mr(t){return[-2*t[0],-2*t[1]]}const xr=Gt,br=Ut,wr=mr;function _r(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=xr(u,u),h=xr(u,f),d=xr(f,f),g=xr(l,l),v=xr(l,a),m=xr(a,a),x=br(h,v),b=br(g,p);return[br(br(d,m),br(b,wr(x))),Zt(x,b)]}function Mr(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function Sr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}const Nr=Z,Ir=nt,yr=Mr,Er=Sr,Or=Z,Cr=nt,Tr=Mr;function Pr(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const Ar=Z,kr=Sr,Br=Math.abs;function zr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=Br(e[0]),s=Br(e[1]),u=Br(r[0]),f=Br(r[1]),l=Br(o[0]),a=Br(o[1]),p=Br(i[0]),h=Br(i[1]),d=Br(n[0]),g=Br(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,O=6*w*_,C=6*M*S,T=6*m*b+9*x*x,P=2*v*b+18*m*x,A=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(A+P)+(S*S+C+(E+O)+k+(z+B))),5*(y+5*I+3*P+2*(T+2*A+3*N)+(C+5*O+3*B+2*(k+2*z+3*E))),4*(T+3*(P+2*A)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*O+3*E))),3*(P+2*(2*A+5*(I+2*N))+(B+2*(2*z+5*(O+2*E)))),2*(A+5*(I+3*N)+(z+5*(O+3*E))),I+6*N+(O+6*E)]}function Fr(t,n){const e=t[0],r=t[1],o=t[2],i=Br(e[0]),c=Br(e[1]),s=Br(r[0]),u=Br(r[1]),f=Br(o[0]),l=Br(o[1]),a=Br(n[0]),p=Br(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function Yr(t,n){const e=t[0],r=t[1],o=Br(e[0]),i=Br(e[1]),c=Br(r[0]),s=Br(r[1]),u=Br(n[0]),f=Br(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}Ye(6);const{sqrt:Lr}=Math;function Xr(t,n,e=0,r=1){const{polyDd:o,polyE:i,getPolyExact:c}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:ur(t,n),polyE:zr(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Nr(c,d),m=Nr(u,d),x=Nr(l,d),b=Nr(p,d),w=Nr(s,g),_=Nr(f,g),M=Nr(a,g),S=Nr(h,g),N=et(v,v),I=Ir(6,et(v,m)),y=Ir(6,et(v,x)),E=yr(et(v,b)),O=Ir(9,et(m,m)),C=Ir(18,et(m,x)),T=Ir(6,et(m,b)),P=Ir(9,et(x,x)),A=Ir(6,et(x,b)),k=et(b,b),B=et(w,w),z=Ir(6,et(w,_)),F=Ir(6,et(w,M)),Y=yr(et(w,S)),L=Ir(9,et(_,_)),X=Ir(18,et(_,M)),H=Ir(6,et(_,S)),D=Ir(9,et(M,M)),V=Ir(6,et(M,S)),$=et(S,S),q=J(T,P),j=J(E,C),W=J(y,O),Q=J(H,D),R=J(Y,X),G=J(F,L),U=it(J(J(k,N),J(q,W)),J(J(j,A),I)),Z=it(J(J($,B),J(Q,G)),J(J(R,V),z)),K=Ir(6,J(U,Z)),tt=J(Er(J(J(q,yr(W)),Ir(3,N))),J(J(A,Ir(3,j)),Ir(5,I))),nt=J(Er(J(J(Q,yr(G)),Ir(3,B))),J(J(V,Ir(3,R)),Ir(5,z))),rt=Ir(5,J(tt,nt)),ot=J(J(q,Ir(3,it(yr(W),j))),Ir(5,it(Ir(3,N),yr(I)))),ct=J(J(Q,Ir(3,it(yr(G),R))),Ir(5,it(Ir(3,B),yr(z)))),st=Ir(4,J(ot,ct)),ut=it(j,yr(it(yr(W),Ir(5,it(I,yr(N)))))),ft=it(R,yr(it(yr(G),Ir(5,it(z,yr(B)))))),lt=Ir(3,J(ut,ft)),at=it(W,Ir(5,it(I,Ir(3,N)))),pt=it(G,Ir(5,it(z,Ir(3,B))));return[K,rt,st,lt,yr(J(at,pt)),J(it(I,Ir(6,N)),it(z,Ir(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:vr(t,n),polyE:Fr(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=Or(e,u),a=Or(o,u),p=Or(c,u),h=Or(r,f),d=Or(i,f),g=Or(s,f),v=et(l,l),m=et(l,a),x=et(l,p),b=et(a,a),w=et(a,p),_=et(p,p),M=et(h,h),S=et(h,d),N=et(h,g),I=et(d,d),y=et(d,g),E=et(g,g),O=J(N,Tr(I)),C=J(x,Tr(b)),T=J(it(J(_,Tr(C)),Pr(J(w,m))),v),P=J(it(J(E,Tr(O)),Pr(J(y,S))),M),A=J(T,P),k=J(it(w,C),it(Cr(3,m),v)),B=J(it(y,O),it(Cr(3,S),M));return[A,Cr(3,J(k,B)),J(it(O,Cr(3,it(Tr(S),M))),it(C,Cr(3,it(Tr(m),v)))),J(it(S,M),it(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:_r(t,n),polyE:Yr(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=Ar(e,c),f=Ar(o,c),l=Ar(r,s),a=Ar(i,s),p=et(u,u),h=et(u,f),d=et(f,f),g=et(l,l),v=et(l,a),m=et(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(kr(x),b)),it(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(t,n),s=Ce(o,e,r,i,c)||[];s.push({t:e,tS:e,tE:e,multiplicity:1}),s.push({t:r,tS:r,tE:r,multiplicity:1});const u=s.map(e=>{const r=Re(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Ue(t,u),r=Ue(n,f),o=rt(J(et(e,e),et(r,r))),i=o*(1-Ze),c=o*(1+Ze);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(r,n);return{p:Ge(r),t:e.t,d:(Lr(o[0])+Lr(o[1]))/2,dSquaredI:o,box:r,ri:e}});let f=Number.POSITIVE_INFINITY;for(let t=0;t<u.length;t++){const n=u[t].dSquaredI[1];n<f&&(f=n)}const l=[];for(let t=0;t<u.length;t++){const n=u[t];n.dSquaredI[0]<=f&&l.push(n)}return l}function Hr(t){return(t.tS+t.tE)/2}function Dr(t){const n=t.xs;if(4===n.length){let t=0,e=0;for(let r=0;r<n.length;r++)0===n[r].x.kind&&t++,4===n[r].x.kind&&e++;if(2===t&&2===e)return!0}return n.length<=2&&7!==n[0].x.kind}function Vr(t){const n=(t=Pn(t)).length;return 2===n?t:n<=1?[0,t[0]]:[t[n-2],t[n-1]]}const{abs:$r,min:qr,max:jr,log2:Wr,ceil:Qr}=Math;function Rr(t,n){const{tS:e,tE:r}=t,o=r-e;if(0===o)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const i=2**Qr(Wr(o)),c=function(t,n,e){return Rn(Qn(t,e),n)}(n,i,e),s=c.map(Vr),u=s.map(t=>t[1]*An**2),f=Ce(s,0,1,u,()=>c),l=[];for(const t of f)l.push({tS:lt(e,t.tS*i),tE:lt(e,t.tE*i),multiplicity:t.multiplicity});return l}function Gr(t,n){return ct(it(t,n))}const{abs:Ur}=Math;function Zr(t,n){const e=t.inOuts;e.sort(function(t){return(n,e)=>{let r=n.side-e.side;if(0!==r)return r;const o=n.sideX,i=e.sideX;r=o.ri.tS-i.ri.tS;const c=8*Number.EPSILON;return Ur(r)>=c?r:(o.compensated||(o.compensated=1,o.riExp=Rr(o.ri,o.getPExact())[0]),i.compensated||(i.compensated=1,i.riExp=Rr(i.ri,i.getPExact())[0]),r=Gr(o.riExp.tS,i.riExp.tS),0!==r?r:(r=n.dir-e.dir,0!==r?t*r:1===n.dir?n.idx-e.idx:e.idx-n.idx))}}(n));let r=e[e.length-1];for(let t=0;t<e.length;t++){const n=e[t];n.prevAround=r,r.nextAround=n,r=n}}function Jr(t,n,e,r){const o=function(t,n){return(e,r,o)=>{t.has(e)||(e.orientation=r,e.parent=o,e.windingNum=o.windingNum+e.orientation,n.push(e))}}(r,e);Zr(t.container,n.orientation);let i,c,s=1,u=t,f=n.orientation;for(;u=1===n.orientation?u.nextAround:u.prevAround,u!==t;){const t=s;s-=u.dir,1===s&&(f*=-1),-1!==u.dir&&(i?1===t&&0===s?o(u,n.orientation,n.parent):0===t&&-1===s&&o(u,-n.orientation,n.parent):0===s?i=u:1===s&&o(u,n.orientation,n))}return Dr(t.container)||(c=[t.p,i.p]),{inOutToUse:i,additionalBezier:c}}function Kr(t,n){const e=t._x_,r=n._x_,o=e.curve,i=e.x.ri.tS,c=r.curve,s=r.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=Hr(Xr(o.ps,t.p)[0].ri));const l=[];for(;;){if(u===c&&(f<s||f===s&&0!==l.length)){const t=u.ps,n=[f,s];return l.push({ps:t,ts:n}),l}{const t=u.ps,n=[f,1];l.push({ps:t,ts:n})}f=0,u=u.next}}function to(t,n){const e=n._x_,r=t._x_,o=r.curve,i=r.x.ri.tS,c=e.curve,s=e.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=Hr(Xr(u.ps,t.p)[0].ri));const l=[];for(;;){const t=u.ps;if(u===c&&(f>s||f===s&&0!==l.length)){const n=[f,s];return l.push({ps:t,ts:n}),l}{const n=[f,0];l.push({ps:t,ts:n})}f=1,u=u.prev}}function no(t,n,e,r){const o=function(t,n,e){return(r,o,i,c)=>{n.has(r)||1!==r.dir||(r.loopsIdxs=new Set(c),r.orientation=o*t.orientation,r.parent=i.parent,r.windingNum=i.windingNum+r.orientation,e.unshift(r))}}(n,r,e);Zr(t.container,1);let i=t.nextAround,c=t;const s=[],u=new Set(n.loopsIdxs);for(;c=c.nextAround,c!==t;)o(c,n.dir,n,u),s.push(c.idx),-1===c.dir?u?.add(c._x_?.curve.loop.idx):u.delete(c._x_?.curve.loop.idx);let f;return Dr(t.container)||(f=[t.p,i.p]),{inOutToUse:i,additionalBezier:f}}function eo(t){const{ps:n,ts:e}=t;return function(t,n,e){if(4===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,O=e*N,C=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*C+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*C+2*y)+(h*y+u-(O+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*C+2*y)+(g*y+u-(2*O+E))],[v*S+(3*e*(e*w-x)+s),v*C+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[e,[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}(n,e[0],e[1])}function ro(t,n,e){const r=[],o=[];let i,c=n;const s=e?no:Jr,u=[];do{t.add(c),u.push(c);const e=c.nextOrPrev;t.add(e);const f=1===c.dir?Kr(c,e):to(c,e);o.push(...f);const l=s(e,n,r,t);if(({inOutToUse:c,additionalBezier:i}=l),void 0!==i){const t=eo(o[o.length-1]),n={ps:t,ts:[0,Hr(Xr(t,i[0])[0].ri)]};o.pop(),o.push(n),o.push({ps:i,ts:[0,1]})}}while(c!==n);return"undefined"!=typeof _debug_&&_debug_.verbose&&function(t){const n=[],e=[];for(let r of t)e.push(1===r.dir?"color: blue;":"color: red"),n.push(`%c${r.idx}`)}(u),{bezierPieces:o,additionalOutsToCheck:r}}function oo(t,n,e,r){const o=[t];for(;o.length;){const t=o.pop();if(n.add(t._x_.curve.loop),e.has(t))continue;t.children=new Set;const{bezierPieces:i,additionalOutsToCheck:c}=ro(e,t,r);t.bezierPieces=i,t.parent.children=t.parent.children||new Set,t.parent.children.add(t);for(let t=0;t<c.length;t++)o.push(c[t])}}function io(t){if(4===t.length)return co(t);if(3===t.length)return so(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n,n],[o-e,e]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[n],[e]]}(t);throw new Error("The given bezier curve must be of order <= 3.")}function co(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function so(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function uo(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function fo(t,n){const[e,r]=uo(t);return[R(e,n),R(r,n)]}function lo(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=uo(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Re(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}function ao(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=uo(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Re(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=lo(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const po=L(ao),ho=L(function(t){const n=uo(t),e=Ce(n[0],0,1)?.map(t=>t.t)||[],r=Ce(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Te(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Te(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}),{min:go,max:vo}=Math;function mo(t){const n=t.map(ho);return{minX:go(...n.map(t=>t.box[0][0])),maxX:vo(...n.map(t=>t.box[1][0])),minY:go(...n.map(t=>t.box[0][1])),maxY:vo(...n.map(t=>t.box[1][1]))}}const xo=new Function("try {return this===window;}catch(e){ return false;}")()?function(t){const n=window.atob(t),e=n.length,r=new Uint8Array(e);for(let t=0;t<e;t++)r[t]=n.charCodeAt(t);return r.buffer}:function(t){return function(t){const n=new ArrayBuffer(t.length),e=new Uint8Array(n);for(let n=0;n<t.length;++n)e[n]=t[n];return n}(Buffer.from(t,"base64"))},bo=xo("AGFzbQEAAAABBgFgAX8BfAMDAgAABQMBAAAHHwMGbWVtb3J5AgAHc3F1YXJlcwAACHNxdWFyZXM0AAEKjgECPwECfiAArULHuuXf9tjQm2p+IgEgASABfnxCIIoiAiACfiABQse65d/22NCbanx8QiCKIgIgAn4gAXxCIIi6C0wBAn4gAK1Cx7rl3/bY0JtqfiIBQse65d/22NCbanwiAiABIAIgASABIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiLoL"),wo=new WebAssembly.Module(bo),_o=new WebAssembly.Instance(wo),Mo=_o.exports.squares;_o.exports.squares4;const So=1e-6;function No(t,n){let e;const r=[t];for(;r.length;)o(r.pop());return e;function o(o){if(o===t||function(t,n){let e=0;do{e++;const o=Mo(e)/4294967296,i=r(t,n,Te(t[Mo(e+1e3)%t.length],o));if(void 0!==i)return i}while(e<100);return;function r(t,n,e){if(function(t,n){const e=mo(t),r=mo(n);return e.minX<r.minX||e.maxX>r.maxX||e.minY<r.minY||e.maxY>r.maxY}(t,n))return!1;const r=function(t,n){const[e,r]=n;let o=0;for(let i=0;i<t.length;i++){const c=t[i],[[s,u],[f,l]]=po(c);let a=u>r||l<r||!1;if(a=a||s>e||!1,a)continue;const p=[];let h,d,g;const v=!0;h=t=>io(t)[1],d=[0,-r],g=0;const m=c.map(j(d)),x=h(m),b=Ce(x,0-So,1+So)?.map(t=>t.t)||[];for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<So||Math.abs(e-1)<So)return;const r=Te(m,e);(v&&n[g]>=r[g]||!v&&n[g]<=r[g])&&p.push(e)}if(1===p.length||3===p.length)for(const t of p){const n=W(fo(c,t));if(Math.abs(n[1])<So)return}o+=p.length}return o}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.bezierPieces.map(eo))){e=o;for(const t of o.children)r.push(t)}}}function Io(t,n){return yo(t)-yo(n)}function yo(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=ho(e).box[0][1];t<n&&(n=t)}return n}const{abs:Eo,sign:Oo}=Math;function Co(t){let n=t.parent;for(;;){if(void 0===n)return!1;if(n.used)return!0;n=n.parent}}function To(t,n,e){let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;o>c&&([o,c]=[c,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]);const a=t||r===i&&s===f,p=t||o===c&&u===l;return(a?r<=f:r<f)&&(a?i>=s:i>s)&&(p?u<=c:u<c)&&(p?l>=o:l>o)}function Po(t,n){return To(!0,t.box,n.box)}function Ao(t,n){for(let e=0;e<n.length;e++){const r=n[e];ko(t,[r.a,r.b])}}function ko(t,n){const[e,r]=n;let o=t.get(e);o||(o=[],t.set(e,o));let i=t.get(r);i||(i=[],t.set(r,i)),o.push(r),i.push(e)}function Bo(t,n,e,r){e.add(n),r.push(n);const o=t.get(n);for(let n=0;n<o.length;n++){const i=o[n];e.has(i)||Bo(t,i,e,r)}}function zo(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Bo(t,o,e,n[n.length-1]))}return n}function Fo(t,n){const e=new Set;for(const t of n)for(const n of t)e.add(n);const r=[];for(let n=0;n<t.length;n++){const o=t[n];e.has(o)||r.push(o)}return r}function Yo(t){const n=[];for(const e of t){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const c=[];for(const n of e){const[[e,s],[u,f]]=n.box;e<t&&(t=e),s<r&&(r=s),u>o&&(o=u),f>i&&(i=f),c.push(...n.xs)}const s={box:[[t,r],[o,i]],xs:c,inOuts:void 0};n.push(s)}return n}function Lo(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}function Xo(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,c=e+(r-(o-i)+(n-i)),s=o+c;return[c-(s-o),s]}const Ho=Je,Do=Dn,Vo=Ut,$o=Xo,qo=Math.abs;function jo(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Ho(s,n),l=Ho(r,i),a=3*(r-i),p=Do(3,l),h=qo(a),d=Vo(f,p),g=h+qo(s-n+a),v=Ho(i,2*r),m=$o(v,n),x=qo(i-2*r+n),b=Do(3,m),w=6*x,_=Ho(r,n),M=Do(3,_),S=qo(3*(r-n)),N=Ho(u,e),I=Ho(o,c),y=3*(o-c),E=Do(3,I),O=qo(y),C=Vo(N,E),T=O+qo(u-e+y),P=Ho(c,2*o),A=$o(P,e),k=qo(c-2*o+e),B=Do(3,A),z=6*k,F=Ho(o,e);return{coeffs:[[d,b,M,[0,n]],[C,B,Do(3,F),[0,e]]],errorBound:[[g,w,S,0],[T,z,qo(3*(o-e)),0]]}}function Wo(t){const[[n,e],[r,o],[i,c]]=t,s=i-2*r,u=Ho(i,2*r),f=$o(u,n),l=qo(s+n),a=Ho(2*r,2*n),p=c-2*o,h=Ho(c,2*o),d=$o(h,e),g=qo(p+e);return{coeffs:[[f,a,[0,n]],[d,Ho(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[g,0,0]]}}function Qo(t){const[[n,e],[r,o]]=t;return[[Ho(r,n),[0,n]],[Ho(o,e),[0,e]]]}const Ro=Zt,Go=Dn,Uo=ot,Zo=Math.abs;function Jo(t){const[[n,[,e]],[r,[,o]]]=Qo(t),i=Uo(r),c=n,s=Go(o,n),u=Zo(s[1]),f=Go(e,r),l=Zo(f[1]),a=Ro(f,s);return{coeffs:{vₓ:i,vᵧ:c,v:a},errorBound:{v_:u+l+Zo(a[1])}}}const{abs:Ko}=Math,ti=Ut,ni=Dn,ei=jn;function ri(t){return[-t[0],-t[1]]}const oi=ri,ii=Ke,ci=Dn,si=jn,ui=Zt,fi=Math.abs;function li(t){const{coeffs:[[n,e,[,r]],[o,i,[,c]]],errorBound:[[s],[u]]}=Wo(t),f=n[1],l=e[1],a=o[1],p=i[1],h=fi(r),d=fi(l),g=fi(f),v=fi(c),m=fi(p),x=fi(a),b=si(n,i),w=s*m+2*fi(f*p),_=si(e,o),M=d*u+2*fi(l*a),S=ci(c,n),N=v*s+fi(c*f),I=ci(r,o),y=h*u+fi(r*a),E=ci(c,e),O=fi(c*l),C=ci(r,i),T=fi(r*p),P=si(n,n),A=2*(s*g+fi(f*f)),k=si(n,o),B=s*x+g*u+2*fi(f*a),z=si(o,o),F=2*(u*x+fi(a*a)),Y=f*p-l*a,L=f*c-r*a,X=l*c-r*p,H=ui(b,_),D=fi(Y),V=w+M+D,$=ui(S,I),q=fi(L),j=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return{coeffs:{vₓₓₓ:Gn,vₓₓᵧ:te,vₓᵧᵧ:ie,vᵧᵧᵧ:se,vₓₓ:Ne,vₓᵧ:Qe,vᵧᵧ:Be,vₓ:_r,vᵧ:Pr,v:Wr},errorBound:{vₓₓₓ_:Un,vₓₓᵧ_:ne,vₓᵧᵧ_:ce,vᵧᵧᵧ_:ue,vₓₓ_:Ie,vₓᵧ_:Re,vᵧᵧ_:ze,vₓ_:Mr,vᵧ_:Ar,v_:jr+$r+mi(Wr[1])}}}const Ii=Gt,yi=Ke,Ei=Dn,Oi=jn,Ci=Ut,{abs:Ti}=Math,Pi=Ut,Ai=Dn,ki=jn,{abs:Bi}=Math,zi=Gt,Fi=Ke,Yi=Dn,Li=jn,Xi=Ut,{abs:Hi}=Math,Di=Gt,Vi=Ke,$i=Dn,qi=jn,ji=Ut,{abs:Wi}=Math,Qi=Ut,Ri=Dn,Gi=jn,{abs:Ui}=Math,Zi=Gt,Ji=Ke,Ki=Dn,tc=jn,nc=Ut,{abs:ec}=Math,rc=Gt,oc=Ke,ic=Dn,cc=jn,sc=Ut,{abs:uc}=Math,fc=Z,lc=lt,ac=nt,pc=at;function hc(t){if(4===t.length)return dc(t);if(3===t.length)return gc(t);if(2===t.length)return vc(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[n]],[[e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}function dc(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[J(fc(s,n),ac(3,fc(r,i))),ac(3,pc(lc(i,n),-2*r)),ac(3,fc(r,n)),[n]].map(Pn),[J(fc(u,e),ac(3,fc(o,c))),ac(3,pc(lc(c,e),-2*o)),ac(3,fc(o,e)),[e]].map(Pn)]}function gc(t){const[[n,e],[r,o],[i,c]]=t;return[[pc(lc(i,n),-2*r),fc(2*r,2*n),[n]],[pc(lc(c,e),-2*o),fc(2*o,2*e),[e]]]}function vc(t){const[[n,e],[r,o]]=t;return[[fc(r,n),[n]],[fc(o,e),[e]]]}const mc=nt,xc=ot;function bc(t){const[[n,[e]],[r,[o]]]=t;if(0!==ct(n)||0!==ct(r))return{vₓ:xc(r),vᵧ:n,v:Pn(it(mc(e,r),mc(o,n)))}}const wc=nt,_c=et,Mc=J;function Sc(t,n){const e=vc(t),[[r,[o]],[i,[c]]]=vc(n),{vₓ:s,vᵧ:u,v:f}=bc(e),l=_c(r,s),a=_c(i,u),p=Mc(l,a),h=wc(o,s),d=wc(c,u),g=Mc(h,d);return[p,Mc(g,f)].map(Pn)}const Nc=nt,Ic=Mr,yc=it,Ec=et,Oc=ot;function Cc(t){const[[n,e,[r]],[o,i,[c]]]=t;if(0===ct(n)&&0===ct(o))return bc([[e,[r]],[i,[c]]]);const s=Ec(n,i),u=Ec(e,o),f=Nc(c,n),l=Nc(r,o),a=Nc(c,e),p=Nc(r,i),h=Ec(n,n),d=Ec(n,o),g=Ec(o,o),v=yc(s,u),m=yc(f,l),x=yc(a,p),b=Pn(Oc(g)),w=Pn(Ic(d)),_=Pn(Oc(h)),M=Ec(i,v),S=Ic(Ec(o,m)),N=Pn(yc(M,S)),I=Ic(Ec(n,m)),y=Ec(e,v),E=Pn(yc(I,y)),O=Ec(v,x),C=Ec(m,m);return{vₓₓ:b,vₓᵧ:w,vᵧᵧ:_,vₓ:N,vᵧ:E,v:Pn(yc(O,C))}}const Tc=Jn,Pc=nt,Ac=et,kc=J,Bc=Mr;function zc(t,n){const e=gc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return Sc([t[0],t[2]],n);const[[r,[o]],[i,[c]]]=vc(n),{vₓₓ:s,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=Cc(e),h=Tc(o,o),d=Pc(o,r),g=Tc(o,c),v=Pc(o,i),m=Ac(r,r),x=Pc(c,r),b=Ac(r,i),w=Tc(c,c),_=Pc(c,i),M=Ac(i,i),S=Ac(m,s),N=Ac(M,f),I=Ac(b,u),y=kc(S,N),E=kc(y,I),O=Ac(d,s),C=Ac(_,f),T=kc(v,x),P=Ac(T,u),A=Bc(kc(O,C)),k=kc(A,P),B=Ac(r,l),z=Ac(i,a),F=kc(B,z),Y=kc(k,F),L=Ac(h,s),X=Ac(g,u),H=Ac(w,f),D=kc(L,X),V=kc(D,H),$=Pc(o,l),q=Pc(c,a),j=kc($,q),W=kc(V,j);return[E,Y,kc(W,p)].map(Pn)}const Fc=et,Yc=Z,Lc=tt,Xc=lt;function Hc(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[rt(it(Lc(Xc(c/4,u/4),3),Xc(t/4,l/4))),rt(it(Lc(Xc(s/4,f/4),3),Xc(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Yc(o,e),a=Yc(i,r),p=Yc(u,c),h=Yc(f,s),d=it(Fc(p,a),Fc(h,l));if(0===ct(d))return;const g=Yc(c,e),v=Yc(s,r),m=rt(it(Fc(v,l),Fc(g,a)))/rt(d);return[c+m*rt(p),s+m*rt(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}const Dc=nt,Vc=et,$c=J,qc=it,jc=ot,Wc=Mr;function Qc(t){const[[n,e,r,[o]],[i,c,s,[u]]]=t;if(0===ct(n)&&0===ct(i))return Cc([[e,r,[o]],[c,s,[u]]]);const f=Vc(n,s),l=Vc(r,i),a=Vc(n,c),p=Vc(e,c),h=Vc(e,i),d=Vc(n,n),g=Vc(c,c),v=Vc(i,i),m=Vc(r,n),x=Vc(e,e),b=Vc(s,i),w=Vc(c,i),_=Vc(e,n),M=Vc(n,i),S=Dc(u,n),N=Dc(o,i),I=Dc(u,e),y=Dc(o,c),E=Vc(e,s),O=Vc(r,c),C=Dc(u,r),T=Dc(o,s),P=qc(S,N),A=qc(f,l),k=qc(a,h),B=qc(I,y),z=qc(E,O),F=qc(C,T),Y=qc(b,g),L=qc(m,x),X=$c(h,a),H=$c(l,f),D=Wc(A),V=Vc(P,P),$=Vc(P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return[d,m,es(w,a)].map(Pn)}const os=Jn,is=nt,cs=et,ss=J,us=Mr;function fs(t,n){const e=gc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return rs([t[0],t[2]],n);const[[r,o,[i]],[c,s,[u]]]=gc(n);if(0===ct(r)&&0===ct(c))return zc(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:a,vₓ:p,vᵧ:h,v:d}=Cc(e),g=os(i,i),v=is(i,o),m=is(i,r),x=os(i,u),b=is(i,s),w=is(i,c),_=cs(o,o),M=cs(o,r),S=is(u,o),N=cs(o,s),I=cs(o,c),y=cs(r,s),E=cs(r,r),O=is(u,r),C=cs(r,c),T=os(u,u),P=is(u,s),A=is(u,c),k=cs(s,s),B=cs(s,c),z=cs(c,c),F=cs(E,f),Y=cs(C,l),L=cs(z,a),X=ss(F,Y),H=ss(X,L),D=cs(M,f),V=cs(B,a),$=ss(I,y),q=cs($,l),j=us(ss(D,V)),W=ss(j,q),Q=ss(us(m),_),R=ss(us(A),k),G=ss(w,N),U=ss(G,O),Z=cs(Q,f),J=cs(R,a),K=cs(U,l),tt=cs(r,p),nt=cs(c,h),et=ss(Z,J),rt=ss(et,K),ot=ss(tt,nt),it=ss(rt,ot),st=cs(v,f),ut=cs(P,a),ft=ss(b,S),lt=cs(ft,l),at=us(ss(st,ut)),pt=cs(o,p),ht=cs(s,h),dt=ss(at,lt),gt=ss(pt,ht),vt=ss(dt,gt),mt=cs(g,f),xt=cs(x,l),bt=cs(T,a),wt=is(i,p),_t=is(u,h),Mt=ss(mt,xt),St=ss(Mt,bt),Nt=ss(wt,_t),It=ss(St,Nt);return[H,W,it,vt,ss(It,d)].map(Pn)}const ls=Jn,as=nt,ps=et,hs=J,ds=Mr;function gs(t,n){const e=dc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return fs(Hc(t),n);const[[r,o,[i]],[c,s,[u]]]=gc(n);if(0===ct(r)&&0===ct(c))return Kc(t,[n[0],n[2]]);const{vₓ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),Zt=ps(o,nt),Jt=ps(o,J),Kt=hs(Gt,Zt),tn=hs(Ut,Jt),nn=ps(L,g),en=ps(y,h),rn=ps(ot,d),on=hs(nn,en),cn=ps(Qt,f),sn=ps(Kt,l),un=ps(Rt,p),fn=ps(tn,a),ln=hs(cn,un),an=hs(sn,fn),pn=hs(ln,an),hn=hs(ds(on),rn),dn=hs(pn,hn),gn=ps(ls(3,i),G),vn=ps(ls(3,u),U),mn=as(i,tt),xn=as(i,J),bn=as(u,Z),wn=as(u,K),_n=hs(mn,bn),Mn=hs(xn,wn),Sn=ps(gn,f),Nn=ps(vn,p),In=ps(_n,l),yn=ps(Mn,a),En=ps(Z,h),On=ps(J,g),Cn=ps(lt,d),Tn=ps(r,v),An=ps(c,m),kn=hs(Sn,Nn),Bn=hs(In,yn),zn=hs(En,On),Fn=hs(kn,Bn),Yn=hs(zn,Cn),Ln=hs(Tn,An),Xn=hs(Fn,Yn),Hn=hs(Xn,Ln),Dn=ps(ls(3,i),w),Vn=ps(ls(3,u),z),$n=as(i,st),qn=as(u,ut),jn=ps(w,h),Wn=ps(z,g),Qn=ps(S,d),Rn=ps(E,d),Gn=ds(hs(jn,Wn)),Un=hs(Qn,Rn),Zn=ps(o,v),Jn=ps(s,m),Kn=ps(Dn,f),te=ps(Vn,p),ne=ps($n,l),ee=ps(qn,a),re=hs(Kn,te),oe=hs(ne,ee),ie=hs(re,oe),ce=hs(Gn,Un),se=hs(Zn,Jn),ue=hs(ie,ce),fe=hs(ue,se),le=as(i,f),ae=as(i,a),pe=as(u,l),he=as(u,p),de=hs(le,pe),ge=hs(ae,he),ve=hs(de,h),me=hs(ge,g),xe=ps(b,ve),be=ps(B,me),we=ps(M,d),_e=as(i,v),Me=as(u,m),Se=hs(xe,be),Ne=hs(Se,we),Ie=hs(_e,Me),ye=hs(Ne,Ie);return[R,It,Wt,dn,Hn,fe,hs(ye,x)].map(Pn)}const vs=nt,ms=et,xs=J;function bs(t,n){const e=vc(t),[[r,o,i,[c]],[s,u,f,[l]]]=dc(n);if(0===ct(r)&&0===ct(s))return rs(t,Hc(n));const{vₓ:a,vᵧ:p,v:h}=bc(e),d=ms(r,a),g=ms(s,p),v=xs(d,g),m=ms(o,a),x=ms(u,p),b=xs(m,x),w=ms(i,a),_=ms(f,p),M=xs(w,_),S=vs(c,a),N=vs(l,p),I=xs(S,N);return[v,b,M,xs(I,h)].map(Pn)}const ws=Jn,_s=nt,Ms=et,Ss=J,Ns=Mr;function Is(t,n){const e=gc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return bs([t[0],t[2]],n);const[[r,o,i,[c]],[s,u,f,[l]]]=dc(n);if(0===ct(r)&&0===ct(s))return fs(t,Hc(n));const{vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=Cc(e),m=ws(c,c),x=_s(c,i),b=_s(c,o),w=_s(c,r),_=ws(c,l),M=_s(c,f),S=_s(c,u),N=_s(c,s),I=Ms(i,i),y=Ms(i,o),E=Ms(i,r),O=_s(l,i),C=Ms(i,f),T=Ms(i,u),P=Ms(i,s),A=Ms(o,f),k=Ms(o,o),B=Ms(o,r),z=_s(l,o),F=Ms(o,u),Y=Ms(o,s),L=Ms(r,r),X=_s(l,r),H=Ms(r,f),D=Ms(r,u),V=Ms(r,s),$=ws(l,l),q=_s(l,f),j=_s(l,u),W=_s(l,s),Q=Ms(f,f),R=Ms(f,u),G=Ms(s,s),U=Ms(u,u),Z=Ms(u,s),J=Ms(f,s),K=Ms(L,a),tt=Ms(V,p),nt=Ms(G,h),et=Ss(K,tt),rt=Ss(et,nt),ot=Ms(B,a),it=Ms(Z,h),st=Ss(ot,it),ut=Ss(Y,D),ft=Ms(ut,p),lt=Ss(Ns(st),ft),at=Ss(Ns(E),k),pt=Ss(Ns(J),U),ht=Ss(P,F),dt=Ss(ht,H),gt=Ms(at,a),vt=Ms(pt,h),mt=Ss(gt,vt),xt=Ms(dt,p),bt=Ss(mt,xt),wt=Ss(w,y),_t=Ss(W,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(a-c),h=c-p,d=o*c,g=s+d,v=d-(g-s)+(l*h-(s-f*p-l*p-f*h)),m=g+v,x=(r-m+(e-(v-(m-g))))/i,b=c+x;return[x-(b-c),b]}const Fs=zs,Ys=Number.EPSILON/2,Ls=Ys*Ys,Xs=Zt,Hs=Zt,Ds=jn,Vs=Ut,$s=Zt,qs=Je,js=Xo,{abs:Ws}=Math,Qs=[0,1],Rs=Zt,Gs=Xo,Us=Ut,Zs=jn,Js=Dn,Ks=Ke,tu=function(t,n,e,r){const o=t[0],i=t[1],c=n[0],s=n[1],u=Fs(t,n),f=Math.abs(o+i),l=Math.abs(c+s),a=l-Ys*l-r;return a<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/a**2+9*Ls*Math.abs(f/l)}},nu=function(t,n){return Xs(t,n)[1]>0?n:t},eu=function(t,n){return Hs(t,n)[1]>0?t:n};function ru(t,n){return n[0][0]!==n[1][0]||n[0][1]!==n[1][1]?4===t.length?function([[t,n],[e,r],[o,i],[c,s]],[u,f]){const l=Rs(f,u),a=3*Be*Ws(l[1]),p=Rs(Qs,u),h=3*Be*Ws(p[1]),d=tu(l,p,a,h);f=Gs(d.est,d.err);const g=Rs(Qs,u),v=Zs(u,u),m=Zs(u,g),x=Zs(g,g),b=Zs(v,u),w=Zs(v,g),_=Zs(x,u),M=Zs(x,g),S=Rs(Qs,f),N=Zs(f,f),I=Zs(f,S),y=Zs(S,S),E=Zs(N,f),O=Zs(N,S),C=Zs(y,f),T=Zs(y,S),P=Ws(u[1]),A=Ws(g[1]),k=Ws(v[1]),B=Ws(m[1]),z=Ws(x[1]),F=Ws(b[1]),Y=Ws(w[1]),L=Ws(_[1]),X=Ws(M[1]),H=Ws(f[1]),D=Ws(S[1]),V=Ws(N[1]),$=Ws(I[1]),q=Ws(y[1]),j=Ws(E[1]),W=Ws(O[1]),Q=Ws(C[1]),R=Ws(T[1]);let G=Ws(t),U=Ws(n),Z=Ws(e),J=Ws(r),K=Ws(o),t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p=Rs(Qs,i),h=Ws(o[1]),d=Ws(a[1]),g=Ws(i[1]),v=Ws(p[1]);let m=Ws(t),x=Ws(n),b=Ws(e),w=Ws(r);const _=Us(Js(e,o),Js(t,a)),M=Us(Js(e,i),Zs(_,p));m=b*h+m*d,b=b*g+m*v,m*=3*ke,b*=7*ke;const S=Us(Js(r,o),Js(n,a)),N=Us(Js(r,i),Zs(S,p));x=w*h+x*d,w=w*g+x*v,x*=3*ke,w*=7*ke;const I=nu(Gs(_,-m),Gs(M,-b)),y=eu(Gs(_,+m),Gs(M,+b));return[[I,nu(Gs(S,-x),Gs(N,-w))],[y,eu(Gs(S,+x),Gs(N,+w))]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n[0]&&0===n[1]){const t=[0,e[0]],n=[0,e[1]];return[[t,n],[t,n]]}if(0===n[0]&&1===n[1]){const t=[0,r[0]],n=[0,r[1]];return[[t,n],[t,n]]}const o=function(t,n){if(0===n[0]&&0===n[1])return t[0].map(t=>[0,t]);if(0===n[0]&&1===n[1])return t[t.length-1].map(t=>[0,t]);if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=js(Ds(qs(o,e),n),e),a=js(Ds(qs(c,o),n),o),p=js(Ds(qs(u,c),n),c),h=Vs(l,Ds($s(a,l),n)),d=Vs(a,Ds($s(p,a),n)),g=Vs(h,Ds($s(d,h),n)),v=js(Ds(qs(i,r),n),r),m=js(Ds(qs(s,i),n),i),x=js(Ds(qs(f,s),n),s),b=Vs(v,Ds($s(m,v),n)),w=Vs(m,Ds($s(x,m),n));return[g,Vs(b,Ds($s(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=Vs([0,e],Ds(qs(o,e),n)),f=Vs([0,o],Ds(qs(c,o),n)),l=Vs(u,Ds($s(f,u),n)),a=Vs([0,r],Ds(qs(i,r),n)),p=Vs([0,i],Ds(qs(s,i),n));return[l,Vs(a,Ds($s(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[js(Ds(qs(o,e),n),e),js(Ds(qs(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}(t,n);let i;if(4===t.length)i=Ae(t,n).map(t=>16*ze*t);else if(3===t.length)i=Ae(t,n).map(t=>10*ze*t);else if(2===t.length)i=Ae(t,n).map(t=>4*ze*t);else if(1===t.length)return[o,o];return[[Gs(o[0],-i[0]),Gs(o[1],-i[1])],[Gs(o[0],+i[0]),Gs(o[1],+i[1])]]}(t,n[0])}function ou(t){return(n,e)=>{let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;return(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])&&([o,c]=[c,o]),(u[1]>l[1]||u[1]===l[1]&&u[0]>l[0])&&([u,l]=[l,u]),(r[1]>i[1]||r[1]===i[1]&&r[0]>i[0])&&([r,i]=[i,r]),(s[1]>f[1]||s[1]===f[1]&&s[0]>f[0])&&([s,f]=[f,s]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>=s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<=c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>=o[0]):(r[1]<f[1]||r[1]===f[1]&&r[0]<f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function iu(t){return[((n=t.x.box)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];var n}function cu(t,n){const e=ks(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,c=Ce(r,0,1,o,i)||[];return 0!==c.length?{ris:c.map(Lo),getPExact:i}:void 0}function su(t){const n=rt(t.tS);return{t:n,tS:n,tE:rt(t.tE),multiplicity:t.multiplicity}}function uu(t,n){const e=cu(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const c=()=>(o=o||r(),o),s=cu(n,t);if(void 0===s)return[];let{ris:u}=s;const{getPExact:f}=s;let l;const a=()=>(l=l||f(),l);let p;p=1;let h,d=0;t:for(;d<p;){h=u.map(n=>ru(t,[n.tS,n.tE]));for(let t=0;t<u.length;t++){const n=h[t];for(let e=t+1;e<u.length;e++){const t=h[e];if(ou(!0)(n,t)){const t=[];for(const n of u)t.push(...Rr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},a()));u=t,d++;continue t}}}break t}p=1;let g,v=0;t:for(;v<p;){g=i.map(t=>ru(n,[t.tS,t.tE]));for(let t=0;t<i.length;t++){const n=g[t];for(let e=t+1;e<i.length;e++){const t=g[e];if(ou(!0)(n,t)){const t=[];for(const n of i)t.push(...Rr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},c()));i=t,v++;continue t}}}break t}const m=[];for(let t=0;t<u.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=g[e];if(ou(!0)(n,o)){const c={compensated:d,ri:su(u[t]),riExp:d?u[t]:void 0,getPExact:d?void 0:f,kind:1,box:fu(n)},s={compensated:v,ri:su(i[e]),riExp:v?i[e]:void 0,getPExact:v?void 0:r,kind:1,box:fu(o)};m.push({psX:c,sideX:s})}}}return m}function fu(t){return t.map(t=>t.map(rt))}function lu(t,n){return function(t,n){const e=t.xs,r=[],o=new Map;for(const t of e){const n=t.curve,e=o.get(n);e?e.push(t):o.set(n,[t])}const i=function(t){const[[n,e],[r,o]]=t.box,i=[[[r,e],[n,e]],[[n,e],[n,o]],[[n,o],[r,o]],[[r,o],[r,e]]];return(n,e,r)=>{const o=n.ps,c=e.slice();for(let t=0;t<i.length;t++){const n=uu(o,i[t]);for(const{psX:e,sideX:r}of n)c.push({x:e,side:t,sideX:r,curve:void 0})}c.sort((t,n)=>t.x.ri.tS-n.x.ri.tS);const s=[],u=[];let f,l;for(const n of c)void 0!==n.side?(!0===l&&(u.push({idx:++r,dir:1,p:iu(n),_x_:f,container:t,side:n.side,sideX:n.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),f.out=u[u.length-1]),l=!1):(!1===l&&(s.push({idx:++r,dir:-1,p:iu(f),_x_:n,container:t,side:f.side,sideX:f.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),n.in_=s[s.length-1]),l=!0),f=n;return{ins:s,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let c,s;({ins:c,outs:s,ioIdx:n}=i(e,o,n)),r.push(...c),r.push(...s)}return{inOuts:r,ioIdx:n}}(t,n)}function au(t,n,e,r){const o=[];for(const r of t)o.push({type:-1,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(pu);const i=new Set,c=[];for(const t of o){const{item:n,type:e}=t;if(-1===e){for(const t of i){const e=r(n,t);e&&c.push({a:n,b:t,u:e})}i.add(n)}else 1===e&&i.delete(n)}return c}function pu(t,n){const e=t.x-n.x;return 0!==e?e:t.type}function hu(t,n,e){const r=(t[0]-e[0])*(n[1]-e[1]),o=(t[1]-e[1])*(n[0]-e[0]),i=r-o;let c;if(r>0){if(o<=0)return i;c=r+o}else{if(!(r<0))return i;if(o>=0)return i;c=-r-o}return Math.abs(i)>=3330669073875472e-31*c?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],c=t[1]-e[1],s=n[1]-e[1],u=it(Jn(o,s),Jn(c,i));let f=rt(u);if(Math.abs(f)>=2220446049250315e-31*r)return f;const l=Z(t[0],e[0])[0],a=Z(n[0],e[0])[0],p=Z(t[1],e[1])[0],h=Z(n[1],e[1])[0];if(0===l&&0===p&&0===a&&0===h)return f;const d=1109335647967049e-46*r+3330669073875471e-31*Math.abs(f);if(f+=o*h+s*l-(c*a+i*p),Math.abs(f)>=d)return f;const g=J(u,it(Jn(l,s),Jn(p,i))),v=J(g,it(Jn(o,h),Jn(c,a)));let m=J(v,it(Jn(l,h),Jn(p,a)));return m=Pn(m),m[m.length-1]}(t,n,e,c)}function du(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function gu(t,n){if(0===t.length)return;const e=t.slice(),r=function(t){let n,e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r=0;r<t.length;r++){const o=t[r][1];(o<e[1]||o===e[1]&&t[r][0]<e[0])&&(n=r,e=t[r])}return n}(e),[o]=e.splice(r,1);e.sort((t,n)=>{let e=-hu(o,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])}),e.unshift(o);const i=function(t){const n=[t[0]],e=t.length;for(let r=1;r<t.length;r++){const o=t[(r+e-1)%e],i=t[r];o[0]===i[0]&&o[1]===i[1]||n.push(i)}return n}(e),c=[];for(const t of i){for(;c.length>=2&&hu(c[c.length-2],c[c.length-1],t)<0;)c.pop();c.push(t)}if(n||c.length<3)return c;const s=[];{const t=c.length;for(let n=0;n<t;n++){const e=(n+1)%t,r=c[(n+t-1)%t],o=c[n],i=c[e];(0!==hu(r,o,i)||vu(r,o,i)<0)&&s.push(o)}}return s}function vu(t,n,e){const r=n[0]-t[0],o=n[1]-t[1];return r*(e[0]-n[0])+o*(e[1]-n[1])}const mu=gu,xu=Ut,bu=et,wu=J,_u=jn,Mu=Math.abs,Su=Ye(3);const Nu=Math.abs;const Iu=Math.abs,yu=jn,Eu=Ut,Ou=et,Cu=J,Tu=Math.abs,Pu=Fe(1),Au=Ye(3);function ku(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓ:n,vₓᵧ:e,vᵧᵧ:r,vₓ:o,vᵧ:i,v:f}=function(t){const[[n,e,r],[o,i,c]]=so(t),s=n*i-e*o,u=n*c-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*s-2*o*u,vᵧ:2*n*u-e*s,v:s*(e*c-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:a,vᵧᵧ_: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t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓ:o,vₓᵧ:i,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=n;return 0===ct(Cu(Cu(Cu(Ou(o,Ou(e,e)),Ou(i,Ou(e,r))),Ou(f,Ou(r,r))),Cu(Cu(Ou(e,l),Ou(r,a)),p)))}}const Bu=Math.abs,zu=jn,Fu=Ut,Yu=et,Lu=J,Xu=Math.abs,Hu=Fe(1),Du=Ye(3);function Vu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:r,vᵧᵧᵧ:o,vₓₓ:i,vₓᵧ:f,vᵧᵧ:l,vₓ:a,vᵧ:p,v:h}=function(t){const[[n,e,r,o],[i,c,s,u]]=co(t),f=n*s,l=r*i,a=n*c,p=e*i,h=n*n,d=i*i,g=n*u-o*i,v=f-l,m=a-p,x=e*u-o*c,b=e*s-r*c,w=r*u-o*s,_=2*v,M=g*g,S=g*b,N=_*x,I=m*x,y=-3*g-b,E=-3*M-2*S+(N+m*w),O=2*(g*v-I),C=g*m-v*v+m*b;return{vₓₓₓ:-i*d,vₓₓᵧ:3*n*d,vₓᵧᵧ:-3*i*h,vᵧᵧᵧ:n*h,vₓₓ:y*d+m*(s*i-c*c)+_*c*i,vₓᵧ:2*(m*(e*c-(l+f)/2)-(y*n*i+v*(p+a))),vᵧᵧ:y*h+m*(r*n-e*e)+_*e*n,vₓ:i*E+(c*O+s*C),vᵧ:-n*E-(e*O+r*C),v:g*(N-M-S)+(C*w-I*x)}}(t),{vₓₓₓ_:d,vₓₓᵧ_:g,vₓᵧᵧ_:v,vᵧᵧᵧ_:m,vₓₓ_:x,vₓᵧ_:b,vᵧᵧ_:w,vₓ_:_,vᵧ_:M,v_:S}=function(t){const[n,e]=t[0],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][1];n.hasOwnProperty("vₓₓₓ")||(n.vₓₓₓ=[0],n.vₓₓᵧ=[0],n.vₓᵧᵧ=[0],n.vᵧᵧᵧ=[0]),n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓₓ:o,vₓₓᵧ:i,vₓᵧᵧ:f,vᵧᵧᵧ:l,vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=n,m=Yu(e,e),x=Yu(e,m),b=Yu(r,r),w=Yu(r,b),_=Yu(r,m),M=Yu(e,b),S=Yu(e,r),N=Yu(o,x),I=Yu(i,_),y=Yu(f,M),E=Yu(l,w),O=Yu(a,m),C=Yu(p,S),T=Yu(h,b),P=Yu(e,d),A=Yu(r,g),k=Lu(N,I),B=Lu(y,E),z=Lu(k,B),F=Lu(O,C),Y=Lu(F,T),L=Lu(z,Y),X=Lu(P,A),H=Lu(X,v);return 0===ct(Lu(L,H))}}function $u(t,n){const{coeffs:e,errBound:r,getPExact:o}=ks(t,n);return Ce(e,0,1,r,o)}const qu=Math.min,ju=Math.max;function Wu(t,n){let[[e,r],[o,i]]=t,[[c,s],[u,f]]=n;if(e>o&&([e,o]=[o,e]),c>u&&([c,u]=[u,c]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]),e<=u&&o>=c&&s<=i&&f>=r)return[[ju(e,c),ju(r,s)],[qu(o,u),qu(i,f)]]}function Qu(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=$u(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map(n=>Re(t,[n.tS,n.tE])),i=e.map(t=>Re(n,[t.tS,t.tE])),c=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const s=Wu(n,i[o]);if(void 0!==s){const n={ri:r[t],box:s,kind:1},i={ri:e[o],box:s,kind:1};c.push([n,i])}}}return c}function Ru(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const c=r[i-1],s=r[i%o],u=[s[1]-c[1],c[0]-s[0]];let f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let n=0;n<t.length;n++){const e=u[0]*t[n][0]+u[1]*t[n][1];e<f&&(f=e),e>l&&(l=e)}let a=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<a&&(a=e),e>p&&(p=e)}if(e&&(l<a||p<f))return!1;if(!e&&(l<=a||p<=f))return!1}}return!0}const Gu=Jn,Uu=J,Zu=Number.EPSILON/2,Ju=Math.abs;function Ku(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=Ju(3*r)+Ju(f)+(Ju(3*i)+Ju(l))+Ju(a);if(Ju(a)-Zu*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=Ju(3*o)+Ju(h)+(Ju(3*c)+Ju(d))+Ju(g);return!(Ju(g)-Zu*v>0)&&0===ct(it(Uu([s],Gu(3,r)),Uu([n],Gu(3,i))))&&0===ct(it(Uu([u],Gu(3,o)),Uu([e],Gu(3,c))))}const tf=lt,{abs:nf}=Math;function ef(t){const[[n,e],[r,o],[i,c]]=t,s=n+i,u=s-2*r,f=nf(s)+nf(u);if(nf(u)-f>0)return!1;const l=e+c,a=l-2*o,p=nf(l)+nf(a);return!(nf(a)-p>0)&&0===ct(it(tf(n,i),[2*r]))&&0===ct(it(tf(e,c),[2*o]))}function rf(t){const n=t[0][0],e=t[0][1];for(let r=1;r<t.length;r++)if(n!==t[r][0]||e!==t[r][1])return!1;return!0}function of(t){return 4===t.length&&Ku(t)&&(t=Hc(t)),3===t.length&&ef(t)&&(t=[t[0],t[2]]),2===t.length&&rf(t)&&(t=[t[0]]),t}const cf=Number.EPSILON,sf=cf/2;function uf(t,n){return n<0?t<1?t:1-sf:0===n?1:t>1?t:1+cf}function ff(t){const n=function(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),c=0===i?0:16,s=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+c,{sign:o,exponent:s,significand:u}}function lf(t){return ff(t).significand}function af(t){return Math.log2(t&-t)}function pf(t){if(0===t||!Number.isFinite(t))return NaN;const n=lf(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=af(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function hf(t){return t>=128?7:t>=64?6:t>=32?5:t>=16?4:t>=8?3:t>=4?2:t>=2?1:t>=1?0:NaN}function df(t){if(0===t||!Number.isFinite(t))return NaN;const n=lf(t),e=n.length;for(let t=0;t<e;t++){const r=hf(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function gf(t){return ff(t).exponent}function vf(t){if(0===t||!Number.isFinite(t))return NaN;const n=gf(t);return df(t)-52+n}function mf(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}function xf(t,n){if(0===ct(t=Pn(t)))return[0];const e=vf(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=vf(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let c=t[o];c=mf(c,i);const s=t.slice(o);return s[0]=c,s}function bf(t){return 0===t?0:df(t)-pf(t)+1}function wf(t){const n=Pn(t);if(0===ct(n))return 0;const e=n[n.length-1],r=n[0];return gf(e)-gf(r)+(53-pf(r))}function _f(t){return rt(function(t,n,e){let r=n,o=t,i=!1,c=0;e||(c=wf(o)-wf(r)+1,e=c/53+1,i=!0);let s=[1/rt(r)],u=1;for(;;){if(o=et(o,s),u>e)return i?(o=xf(o,c),o):o.slice(o.length-e,o.length);r=et(r,s),s=it([2],r),u*=2}}(t[0],t[1],2))}function Mf(t){return ct(t[0])*ct(t[1])}function Sf(t){return(n,e)=>{const r=hc(n),o=hc(e),i=hc(n.slice().reverse()),c=hc(e.slice().reverse()),s=t(r,o),u=t(i,o),f=t(r,c),l=t(i,c),a=-Mf(u),p=-Mf(l),h=_f(s),d=_f(f);return[uf(h,a),uf(d,p)]}}const Nf=Sf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[it(o,r),e]}(t[e],n[e])});function If(t,n){return Gr(et(t[0],n[1]),et(t[1],n[0]))*ct(t[1])*ct(n[1])}function yf(t){let n=-1024;for(let e=0;e<t.length;e++){const r=t[e];for(let t=0;t<r.length;t++){const e=r[t];if(0===e)continue;const o=-gf(e)+bf(e)-1;o>n&&(n=o)}}return 0===n?t.map(t=>t.map(t=>BigInt(t))):n>0?t.map(t=>t.map(t=>{if(0===t)return 0n;const e=-gf(t)+bf(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})):t.map(t=>t.map(t=>BigInt(t*2**n)))}function Ef(t,n){if(n=n<0n?-n:n,0n===(t=t<0n?-t:t))return n;if(0n===n)return t;for(;0n!==n;){const e=n;n=t%n,t=e}return t}const Of=BigInt(2**53);function Cf(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/Of;const o=t%Of;n.push(Number(o)*2**(53*e)),t=r,e++}return Pn(n)}const{round:Tf,sqrt:Pf}=Math;function Af(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(Tf(Pf(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function kf(t){return t<0n?-t:t}function Bf(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function zf(t,n){const[e,r]=Ff(t[0],n[0]),[o,i]=Ff(t[1],n[1]);if(0===If(e,o)||0===If(e,i))return e;if(0===If(r,o)||0===If(r,i))return r;throw new Error("An unexpected error occured.")}function Ff(t,n){const[e,r]=t,[o,i]=n,[c,s]=function(t){const[n,e]=yf(t).map(Bf),r=Ef(n,e);return[Cf(Af(kf(n/r))),Cf(Af(kf(e/r)))]}([o,e]);return[[it(et(i,s),et(r,c)),et(c,Mr(e))],[it(et(i,ot(s)),et(r,c)),et(c,Mr(e))]].sort(If)}function Yf(t,n){const e=hc(t),r=0===ct(e[0][0])?0:0===ct(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],c=n[2][r];return Nf([[e,e],[o,o]],[[i,i],[c,c]])}return Sf(zf)(t,n)}const{round:Lf,cbrt:Xf}=Math;function Hf(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=kf(t))<=1n)return n*t;let r=BigInt(Lf(Xf(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Df(t){return et(t,t)}const Vf=Sf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,c=function(t){const[n,e]=yf(t).map(Bf),r=Ef(n,e);return[Cf(Hf(n/r)),Cf(Hf(e/r))]}([o,e]),s=Df(c[0]);return[it(et(i,Df(c[1])),et(r,s)),et(nt(3,e),s)]}(t[e],n[e])}),{EPSILON:$f}=Number,qf=$f/2+$f**2/2;function jf(t){return t>0?t-t*qf:t+t*qf}const{EPSILON:Wf}=Number,Qf=Wf/2+Wf**2/2;function Rf(t){return t>0?t+t*Qf:t-t*Qf}function Gf(t){if(0===t||1===t)return[t,t];const n=jf(jf(t)),e=function(t){return Rf(Rf(t))}(t);return[n,e]}function Uf(t,n,e,r){const o=t.ps,i=n.ps,c=[];let s=$u(o,i);if(void 0===s){const r=2**(e-47),s=function(t,n,e=!1){e||(t=of(t),n=of(n));const r=[,,Nf,Yf,Vf],[o,i]=r[t.length](t,n),[c,s]=r[t.length](n,t),u=[{tA:o,tB:0,bez:"B",start:!0},{tA:i,tB:1,bez:"B",start:!1},{tA:0,tB:c,bez:"A",start:!0},{tA:1,tB:s,bez:"A",start:!1}].sort((t,n)=>t.tA-n.tA);if(u[1].tA===u[2].tA){const n=u[1],e=n.tA,r=n.tB,o=Re(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{t:e,tS:e,tE:e,multiplicity:1},t2:r,ri2:{t:r,tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[a,p]=Gf(f.tA),[h,d]=Gf(f.tB),[g,v]=Gf(l.tA),[m,x]=Gf(l.tB),b=Re(t,[a,p]),w=Re(n,[h,d]),_=Re(t,[g,v]),M=Re(n,[m,x]),S=Wu(b,w),N=Wu(_,M),I={t:a,tS:a,tE:p,multiplicity:1},y={t:h,tS:h,tE:d,multiplicity:1},E={t:g,tS:g,tE:v,multiplicity:1},O={t:m,tS:m,tE:x,multiplicity:1};return[{p:Ge(S),kind:5,box:S,t1:Hr(I),ri1:I,t2:Hr(y),ri2:y},{p:Ge(N),kind:5,box:N,t1:Hr(E),ri1:E,t2:Hr(O),ri2:O}]}(o,i);for(const e of s){const i=Te(o,e.ri1.tS),s=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:s},curve:t},f={x:{ri:e.ri2,kind:5,box:s},curve:n};c.push([u,f])}return c}if(r&&(s=s.filter(t=>t.tS>0)),0===s.length)return[];const u=Qu(o,i,s);if(void 0===u||0===u.length)return[];for(const e of u){const r={x:e[0],curve:t},o={x:e[1],curve:n};c.push([r,o])}return c}const Zf=Fe(1);function Jf(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[r[0],r[0]],kind:e},curve:n};if(1===t){const o=r[r.length-1];return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=Te(t,n),r=Ae(t,[0,n]);if(4===t.length)return{p:e,pE:r.map(t=>9*Zf*t)};if(3===t.length)return{p:e,pE:r.map(t=>6*Zf*t)};if(2===t.length)return{p:e,pE:r.map(t=>3*Zf*t)};if(1===t.length)return{p:t[0],pE:[0,0]};throw new Error("The given bezier curve must be of order <= 3.")}(r,t);return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]],kind:e},curve:n}}function Kf(t,n){if(n.next===t){if(t.next===n)return;[t,n]=[n,t]}const e=t.ps,r=n.ps;if(function(t,n){if(4===t.length)return Vu(t,n);if(3===t.length)return ku(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=Jo(t),f=Vr(e),l=Vr(r),a=Mu(c),p=Mu(s),h=Mu(n[1]),d=Mu(o[1]),g=a/3,v=p/3,m=n[1]*c,x=_u(f,n),b=h*g+2*Mu(m),w=o[1]*s,_=_u(l,o),M=d*v+2*Mu(w),S=xu(x,_),N=b+M+Mu(S[1]),I=xu(S,i),y=N+u+Mu(I[1]);if(Su*y<Mu(rt(I)))return!1}{const n=function(t){return bc(vc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=bu(e,o),a=bu(r,i);return 0===ct(wu(wu(l,a),f))}}(t,n);if(1===t.length){const e=Pn(n[0]),r=Pn(n[1]);return 1===e.length&&1===r.length&&e[0]===t[0][0]&&r[0]===t[0][1]}throw new Error("The given bezier curve must be of order <= 3")}(e,r[r.length-1].map(t=>[t]))){const i=Qu(e,r,[(o=1,{t:o,tS:o,tE:o,multiplicity:1})]);if(void 0===i||0===i.length)return;return[[{x:i[0][0],curve:t},Jf(1,n,1)]]}var o}function tl(t){return t[t.length-1]<0?ot(t):t}function nl(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}Number.EPSILON;const el=Number.EPSILON/2;function rl(t,n,e,r){const o=t/n,i=Math.abs(t),c=Math.abs(n),s=c-r;return s<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(c*e+i*r)/s**2+el*Math.abs(i/c)}}function ol(t){const n=t[0],e=t[1];if(0===e)return[0,0];const r=Math.sqrt(e),o=r*r,i=134217729*r,c=i-(i-r),s=r-c,u=.5*(e-o-(s*s-(o-c*c-c*s*2))+n)/r;return[u-(r+u-r),r+u]}const{abs:il}=Math;const cl=Math.abs,sl=Fe(1);function ul(t){const{coeffs:[[n,e,r],[o,i,c]],errorBound:[[s,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s-n,l=r-i,a=f+3*l,p=i+n,h=p-2*r,d=r-n,g=u-e,v=o-c,m=g+3*v,x=c+e,b=x-2*o,w=o-e;return{coeffs:[[a,3*h,3*d,n],[m,3*b,3*w,e]],errorBound:[[il(f)+6*il(l)+il(a),6*(il(p)+il(h)),6*il(d),0],[il(g)+6*il(v)+il(m),6*(il(x)+il(b)),6*il(w),0]]}}(t),a=cl(n),p=cl(e),h=cl(r),d=cl(o),g=cl(i),v=cl(c),m=e*o,x=n*i,b=n*c,w=r*o,_=e*c,M=r*i,S=u*d+p*f+cl(m),N=s*g+a*l+cl(x),I=s*v+cl(b),y=h*f+cl(w),E=u*v+cl(_),O=h*l+cl(M),C=m-x,T=cl(C),P=S+N+T,A=w-b,k=cl(A),B=y+I+k,z=_-M,F=cl(z),Y=E+O+F,L=C*C,X=C*A,H=z*C,D=A*A,V=H+D;return{coeffs:[L,X,V],errBound:[2*P*T+cl(L),P*k+T*B+cl(X),Y*T+F*P+cl(H)+(2*k*B+cl(D))+cl(V)].map(t=>sl*t)}}const fl=et,ll=J;function al(t){const[[n,e,r],[o,i,c]]=dc(t),s=fl(e,o),u=fl(n,i),f=fl(n,c),l=fl(r,o),a=fl(e,c),p=fl(r,i),h=it(s,u),d=it(l,f),g=it(a,p),v=fl(h,h),m=fl(h,d),x=fl(h,g),b=fl(d,d);return[v,m,ll(x,b)]}const pl=it,hl=et,dl=nt,gl=Je,vl=nl,ml=ri,xl=Ut,bl=Ke,wl=zs,_l=J,Ml=at,Sl=2*Number.EPSILON,Nl=Math.abs,Il=Fe(1);function yl(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,c,s]}=ul(t);if(Nl(e)<=i){const[[n,e],[r,o],[i,c],[s,u]]=t,f=_l(gl(s,n),dl(3,gl(r,i))),l=Ml(vl(i,n),-2*r),a=_l(gl(u,e),dl(3,gl(o,c))),p=Ml(vl(c,e),-2*o);if(0===Gr(hl(l,a),hl(f,p)))return[]}const u=r*r,f=4*e*o,l=u-f,a=2*c*Nl(r)+Il*u+(4*(i*Nl(o)+Nl(e)*s)+Il*Nl(f))+Il*Nl(l);if(l<-a)return[];if(l>a){const{est:t,err:u}=function(t,n){if(t-n<=0){const e=t>0?Math.sqrt(t):0;return{est:e,err:Math.max(Math.sqrt(t+n)-e,e)}}const e=Math.sqrt(t),r=Math.sqrt(t-n),o=Math.sqrt(t+n);return{est:e,err:Math.max(Math.abs(r-e),Math.abs(o-e))}}(l,a);let f;f=r>=0?-r-t:-r+t;const p=c+u+Il*Nl(f),{est:h,err:d}=rl(f,2*e,p,2*i),{est:g,err:v}=rl(2*o,f,2*s,p);if(n){if(h+d<0||h-d>1||g+v<0||g-v>1)return[]}else if((h+d<0||h-d>1)&&(g+v<0||g-v>1))return[]}let[p,h,d]=al(t);const g=pl(hl(h,h),dl(4,hl(p,d))),v=ct(g);if(v<0)return[];if(v>0){const t=ol(Vr(g));let e;p=Vr(p),h=Vr(h),d=Vr(d),e=ct(h)>=0?ml(xl(h,t)):xl(ml(h),t);let r=rt(wl(e,bl(p))),o=rt(wl(bl(d),e));if(n){if(r<-Sl||r>1+Sl||o<-Sl||o>1+Sl)return[]}else if((r<-Sl||r>1+Sl)&&(o<-Sl||o>1+Sl))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-Sl&&r<=1+Sl?o>=0-Sl&&o<=1+Sl?[r,o]:[r]:o>=0-Sl&&o<=1+Sl?[o]:[]}const m=Sr(p);if(ct(h)*ct(m)<0)return[];if(Gr(tl(h),tl(m))>0)return[];const x=Vr(h),b=Vr(m),w=wl(x,b),_=w[1]+w[0];return[_,_]}const El=Number.EPSILON;function Ol(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-c)),6*(c+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[2*(i-2*r+n)],[2*(c-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function Cl(t){if(4===t.length)return 0===hu(t[0],t[1],t[2])&&0===hu(t[1],t[2],t[3])&&0===hu(t[0],t[2],t[3]);if(3===t.length)return 0===hu(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}function Tl(t){if(Cl(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Ku(t)&&(t=Hc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=i-r,u=s-(r-n),f=c-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(s-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Ce(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=uo(t),[[s,u],[f,l]]=Ol(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i))],[6*(u-e+3*(o-c))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=a*i,d=p*e,g=u*c,v=u*i,m=f*f,x=s*c,b=l*r,w=l*e,_=f*r,M=r*e,S=r*n,N=r*o,I=e*e,y=e*n,E=e*i,O=n*c,C=n*o,T=n*n,P=c*i,A=c*o,k=i*i,B=i*o,z=o*o,F=a*c-p*r,Y=u*r+l*c,L=g-b,X=r*r+c*c,H=E+O,D=A+k,V=S+I,$=e*o+n*i,q=T-z,j=y-B,W=M-P,Q=r*i+e*c,R=A+D,G=S+V,U=N+H,Z=E+H,J=G-R,K=H+O,tt=N+E+O,nt=2*w+_;return{inflectionPoly:[s*o-f*n,u*o+s*i-l*n-f*e,v+x-w-_,g-b],otherExtremaPoly:[T*(h-3*d)+z*(3*h-d)+2*(C*(a*e-p*i+3*(l*f-u*s))+3*s*f*j)+3*($*(m-s*s)+q*(u*f+l*s)),a*(o*(G+3*D)+n*Z)-p*(r*(3*T+z)+e*(3*y+2*B)+n*R)+3*(u*(l*q-u*C+2*(f*j-s*$))+s*(2*l*j+f*(2*(S-A)+(I-k))-s*tt)+l*(l*C+2*f*$)+m*U),a*(2*r*$+e*K+i*(4*A+R))-p*(2*r*(3*y+B)+e*(I+2*A)+i*K)+3*(u*(2*(l*j-s*tt)+f*J-u*$)+s*(2*f*W-s*Q)+l*(l*$+2*f*U+s*J)+m*Q),a*(r*(N+2*H)+c*(I+3*D))-p*(r*(3*V+R)+c*Z)+3*(u*(l*J-u*U+2*(f*W-s*Q))+s*(r*(nt-s*c)-c*(2*l*i+f*c))+l*(l*H+r*(2*f*i+l*o))+f*c*nt),X*(h-d)+2*(M+P)*F-3*(Y*(v+x-w-_)+(u*e+s*r+l*i+f*c)*L),F*X-3*Y*L]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Ce(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=(n-r)*t[r];return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=R(i,n);R(e,n)*r>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Ce(e,0,1)?.map(t=>t.t)||[]}}function Pl(t,n){const[e,r]=uo(t),[o,i]=Ol(t),c=R(e,n),s=R(r,n),u=R(o,n);return(c*R(i,n)-s*u)/Math.sqrt((c*c+s*s)**3)}const{abs:Al}=Math,kl=L(function(t){const{curves:n}=t;let e=lo(n[0].ps).minY,r=n[0];for(let t=1;t<n.length;t++){const o=lo(n[t].ps).minY,i=o.box[0][1],c=e.box[0][1];(i<c||i===c&&o.ts[0]>e.ts[0])&&(e=o,r=n[t])}return{curve:r,y:e}});function Bl(t){const{curve:n,y:e}=kl(t),r=e.ts;return r[0]<=0?[Jf(0,n,0),Jf(1,n.prev,0)]:r[1]>=1?[Jf(1,n,0),Jf(0,n.next,0)]:[{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function zl(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:mf(t,r)}function Fl(t,n,e){const r=function(t,n){const e=[];for(const n of t)for(const t of n.curves)e.push(t);const r=au(e,t=>po(t.ps)[0][0],t=>po(t.ps)[1][0],function(t){return(n,e)=>{const r=n.ps,o=e.ps;if(2===r.length&&2===o.length)return function(t,n,e){let r=t.ps,o=n.ps;const i=po(r),c=po(o);if(t.next!==n&&n.next!==t){if(To(!0,i,c)){const r=Uf(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==hu(r[0],r[1],o[1]))return;if(!To(!1,i,c))return;let s;return s=du(r[0],r[1])>du(o[0],o[1])?[Hr(Xr(r,o[1])[0].ri),1]:[0,Hr(Xr(o,r[0])[0].ri)],[[Jf(1,t,5),Jf(0,n,5)],[Jf(s[0],t,5),Jf(s[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return To(!1,po(r),po(o))&&Ru(mu(r,!1),mu(o,!1),!1)?e.next===n?Uf(e,n,t,!0):Uf(n,e,t,!0):Kf(n,e);let i=To(!0,po(r),po(o));return i?(i=Ru(mu(r,!1),mu(o,!1),!0),i?Uf(n,e,t,!1):void 0):void 0}}(n)),o=[];for(const t of r)for(const n of t.u)o.push(n);return o}(t,e),o=function(t){const n=[];for(const e of t)for(const t of e.curves){const e=t.ps,r=yl(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-El,c=r[0]+El,s=r[1]-El,u=r[1]+El,f=Re(e,[i,c]),l=Re(e,[s,u]);n.push([{x:{ri:{t:i,tS:i,tE:c,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{t:s,tS:s,tE:u,multiplicity:1},box:l,kind:o},curve:t}])}return n}(t),i=function(t){const n=[];for(const e of t)for(const t of e.curves)n.push([Jf(1,t,4),Jf(0,t.next,4)]);return n}(t),{extremes:c,xs:s}=function(t){const n=new Map,e=[];for(const r of t){const t=Bl(r);e.push(t),n.set(r,t)}return{extremes:n,xs:e}}(t),u=function(t,n){const e=[];for(const r of n)for(const n of r.curves){const r=n.ps,o=Tl(r),{minima:i,maxima:c}=o,s=[0,1,...i,...c];for(let o of s)Al(Pl(r,o))>1e7*2**-t&&e.push([Jf(o,n,7),Jf(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...s,...u];if("undefined"!=typeof _debug_){for(const t of r)_debug_.generated.elems.intersection.push(...t);for(const t of o)_debug_.generated.elems.intersection.push(...t);for(const t of i)_debug_.generated.elems.intersection.push(...t);for(const t of s)_debug_.generated.elems.intersection.push(...t);for(const t of u)_debug_.generated.elems.intersection.push(...t)}let l=f.map(t=>({xs:t,box:[[t[0].x.box[0][0]-n,t[0].x.box[0][1]-n],[t[0].x.box[1][0]+n,t[0].x.box[1][1]+n]],inOuts:void 0}));for(;;){const t=au(l,Yl,Ll,Po);if(!t.length)break;const n=new Map;Ao(n,t);const e=zo(n),r=Fo(l,e);l=[...Yo(e),...r]}l=function(t){return t.filter(t=>{const n=t.xs;if(2===t.xs.length){const t=n[0];if(1===t.x.kind&&t.x.ri.multiplicity%2==0)return!1}for(const n of t.xs)if(4!==n.x.kind)return!0;return!1})}(l),l=function(t,n,e){const r=Math.log2(e)-3;return t.map(t=>{const e=t.box.map(t=>t.map(t=>zl(t,n,n-r)));return{...t,box:e}})}(l,e,n),"undefined"!=typeof _debug_&&(_debug_.generated.elems.container=l);let a=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:a}=lu(t,a)),t.inOuts=n}f=f.filter(t=>void 0!==t[0].container),function(t){const n=new Map;for(const e of t)for(const t of e){const e=t.curve.loop,r=n.get(e)||[];r.length||n.set(e,r),r.push(t)}for(const t of n){const n=t[1];if(!n||!n.length)continue;n.sort((t,n)=>{let e=t.curve.idx-n.curve.idx;return 0!==e?e:(e=t.x.ri.tS-n.x.ri.tS,0!==e?e:void 0!==t.in_?-1:1)});const e=n.length;for(let t=0;t<e;t++)n[t].next=n[(t+1)%e],n[t].prev=n[(t-1+e)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.next,void 0===e.in_;);t.nextOrPrev=e.in_,t.idx=t.nextOrPrev.idx}for(const t of l)for(const n of t.inOuts){if(1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.prev,void 0===e.out;);t.nextOrPrev=e.out,t.idx=t.nextOrPrev.idx}return{extremes:c,containers:l}}function Yl(t){return t.box[0][0]}function Ll(t){return t.box[1][0]}function Xl(t,n,e){Zr(t,1);const r=t.inOuts,o=r[0],i=r[r.length-1],c=1===o.dir?o:i,s=i.dir,u=0===n.idx?new Set:1===n.orientation?n.loopsIdxs:new Set;return o.orientation=s,o.parent=n,o.windingNum=n.windingNum+s,o.loopsIdxs=new Set(u),o.children=new Set,1===s&&o.loopsIdxs?.add(e.idx),i.orientation=s,i.parent=n,i.windingNum=n.windingNum+s,i.loopsIdxs=new Set(u),i.children=new Set,1===s&&i.loopsIdxs?.add(e.idx),c}function Hl(t){if(!Cl(t))return!1;const n=t.map(t=>t[0]),e=t.map(t=>t[1]);return!(Dl(n)&&Dl(e))}function Dl(t){return function(t){for(let n=1;n<t.length;n++)if(t[n-1]>t[n])return!1;return!0}(t)||function(t){for(let n=1;n<t.length;n++)if(t[n-1]<t[n])return!1;return!0}(t)}function Vl(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function $l(t){for(let n=0;n<t.length-1;n++)for(let e=n+1;e<t.length;e++)if(t[n][0]===t[e][0]&&t[n][1]===t[e][1])return!1;return!0}const{abs:ql}=Math;function jl(t,n,e){if(void 0!==t&&!rf(t)){if(2===t.length)return t;if(3===t.length){if($l(t))return Cl(t)?[t[0],t[2]]:t;if(Ql(t[0],t[2]))return;return[t[0],t[2]]}if($l(t)){const r=Wl(t);if(void 0===r)return;return function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e][0]!==n[e][0]||t[e][1]!==n[e][1])return!1;return!0}(r,t)?t:jl(r,n,e)}if(Ql(t[0],t[3])){if(Cl(t))return;return t}if(Cl(t))return[t[0],t[3]];if(Ql(t[0],t[1])&&Ql(t[1],t[2])||Ql(t[1],t[2])&&Ql(t[2],t[3])||Ql(t[0],t[1])&&Ql(t[2],t[3]))return jl([t[0],t[t.length-1]],n,e);if(Ql(t[0],t[2])||Ql(t[1],t[3])||Ql(t[1],t[2]))return t;if(Ql(t[0],t[1])){if(du(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=Vl(H(t[1],t[2]),2*n),o=j(t[1],r);return Wl([t[0],e(o),t[2],t[3]])}}if(Ql(t[2],t[3])){if(du(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=Vl(H(t[2],t[1]),2*n),o=j(t[2],r);return Wl([t[0],t[1],e(o),t[3]])}}}}function Wl(t){return Cl(t)?[t[0],t[3]]:Ku(t)?Hc(t):t}function Ql(t,n){return t[0]===n[0]&&t[1]===n[1]}function Rl(t){return t}function Gl(t,n,e,r=!1,o=!0){const i=function(t,n,e=!0){const r=2**t*2**-n,o=e?function(t,n){return e=>{const r=zl(e[0],t,n),o=zl(e[1],t,n);return r===e[0]&&o===e[1]?e:[r,o]}}(t,n):Rl;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const c=n[n.length-1],s=c?c[c.length-1]:o(t[0][0]);i[0]=s,i=i.map(t=>o(t)),Hl(i)&&(i=[i[0],i[i.length-1]]),i=jl(i,r,o),void 0!==i&&n.push(i)}const e=n.length;if(!e)return[];const i=n[e-1];return i[i.length-1]=n[0][0],n}}(e,n,o);let c=t.slice();return c=r?function(t,n,e,r=.02){const o=[];for(const i of t){const t=[];for(const o of i){const i=o.map(t=>t.map(t=>{let o,i=0,c=0,s=0;for(;!(++c>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=zl(i,e,n);const c=bf(i);c>s&&(s=c,o=i)}return o}));t.push(i)}o.push(t)}return o}(c,n,e,1):c,c=c.map(i),c=c.filter(t=>t.length>0),c}const Ul=L(t=>{let n=0;for(const e of t)for(const t of e)for(const e of t)for(const t of e){const e=Math.abs(t);e>n&&(n=e)}return n});function Zl(t){let n=0;for(let e=0;e<=t.length-1&&0===t[e];e++)n++;return 0!==n&&(t=t.slice(n)),t}const{max:Jl}=Math;function Kl(t,n){const e=t.length-1,r=n.length-1;if(e<0||r<0)return[];const o=e+r,i=new Array(o+1).fill(0);for(let c=0;c<e+1;c++)for(let s=0;s<r+1;s++)i[o-(c+s)]+=t[e-c]*n[r-s];return Zl(i)}function ta(t,n){const e=t.length-1,r=new Array(e+2);for(let n=0;n<e+1;n++)r[n]=t[n]/(e+1-n);return r[e+1]=n,r}const{min:na,max:ea}=Math;function ra(t,n){const e=t.length-1,r=n.length-1,o=ea(e,r),i=new Array(o+1),c=na(e,r);for(let s=0;s<=c;s++)i[o-s]=t[e-s]+n[r-s];for(let n=c+1;n<=e;n++)i[o-n]=t[e-n];for(let t=c+1;t<=r;t++)i[o-t]=n[r-t];return Zl(i)}function oa(t){let n=0;for(const e of t){const[t,r]=io(e),[o,i]=uo(e);n+=R(ta(ra(Kl(t,i),Sn(Kl(r,o))),0),1)}return n/2}function ia(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Xt(t[e],t[e+1]);return n}function ca(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=ia(t);if(256*du(t[0],t[t.length-1])<s*s){const[r,o]=Te(t,.5),s=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return ao(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function sa(t){return{ps:t,ts:[0,1]}}const{atan2:ua}=Math,fa=Gt;function la(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=Zt(fa(i,e),fa(o,r))[1],s=Ut(fa(o,e),fa(i,r))[1];return ua(c,s)}const aa=tt,pa=it,ha=lt,da=ct,ga=it,va=et,ma=nt,xa=Je,ba=nl,wa=J,_a=at,Ma=Math.abs,Sa=Fe(1),Na={order:0,realOrder:0,collinear:!0,nodeType:"n/a"},Ia={order:1,realOrder:1,collinear:!0,nodeType:"n/a"},ya={order:1,realOrder:0,collinear:!0,nodeType:"n/a"},Ea={order:2,realOrder:2,collinear:!1,nodeType:"n/a"},Oa={order:2,realOrder:2,collinear:!0,nodeType:"n/a"},Ca={order:2,realOrder:1,collinear:!0,nodeType:"n/a"},Ta={order:2,realOrder:0,collinear:!0,nodeType:"n/a"},Pa={order:3,realOrder:3,collinear:!1,nodeType:"crunode"},Aa={order:3,realOrder:3,collinear:!1,nodeType:"acnode"},ka={order:3,realOrder:3,collinear:!1,nodeType:"cusp"},Ba={order:3,realOrder:3,collinear:!1,nodeType:"explicit"},za={order:3,realOrder:3,collinear:!0,nodeType:"n/a"},Fa={order:3,realOrder:2,collinear:!1,nodeType:"n/a"},Ya={order:3,realOrder:2,collinear:!0,nodeType:"n/a"},La={order:3,realOrder:1,collinear:!0,nodeType:"n/a"},Xa={order:3,realOrder:0,collinear:!0,nodeType:"n/a"};const{abs:Ha,PI:Da}=Math;function Va(t,n=[0,1]){if(t.length<=2)return 0;const[e,r]=n;if(e===r)return 0;if(3===t.length){const n=$e(t,e,r).ps,[[o,i],[c,s],[u,f]]=n;return la([c-o,s-i],[u-c,f-s])}if(4===t.length){const n=He(t,e,r).ps,o=function(t){if(4===t.length)return Ku(t)?function(t){if(!Cl(t))return!1;const[n,e,r,o]=t,[i,c]=n,[s,u]=e,[f,l]=r,[a,p]=o,h=pa(aa(ha(s/4,f/4),3),ha(i/4,a/4)),d=pa(aa(ha(u/4,l/4),3),ha(c/4,p/4));return 0===da(pa(ha(i/2,a/2),h))&&0===da(pa(ha(c/2,p/2),d))}(t)?rf(t)?Xa:La:Cl(t)?Ya:Fa:Cl(t)?za:function(t){const{coeffs:[n,e,r],errBound:[o,i,c]}=ul(t);if(Ma(n)<=o){const[[n,e],[r,o],[i,c],[s,u]]=t,f=wa(xa(s,n),ma(3,xa(r,i))),l=_a(ba(i,n),-2*r),a=wa(xa(u,e),ma(3,xa(o,c))),p=_a(ba(c,e),-2*o);if(0===Gr(va(l,a),va(f,p)))return Ba}const s=e*e,u=4*n*r,f=s-u,l=2*i*Ma(e)+Sa*s+(4*(o*Ma(r)+Ma(n)*c)+Sa*Ma(u))+Sa*Ma(f);if(f<-l)return Aa;if(f>l)return Pa;const[a,p,h]=al(t),d=ct(ga(va(p,p),ma(4,va(a,h))));return d<0?Aa:d>0?Pa:ka}(t);if(3===t.length)return Cl(t)?ef(t)?rf(t)?Ta:Ca:Oa:Ea;if(2===t.length)return rf(t)?ya:Ia;if(1===t.length)return Na;throw new Error("The given bezier curve must be of order <= 3")}(n),[[i,c],[s,u],[f,l],[a,p]]=n,h=[s-i,u-c],d=[f-s,l-u],g=[a-f,p-l];if(0===d[0]&&0===d[1]||o.realOrder<=2)return la(h,g);const v=la(h,d)+la(d,g);return"acnode"===o.nodeType||"cusp"===o.nodeType?v<=-Da?v+2*Da:v>=+Da?v-2*Da:v:v}throw new Error("The given bezier curve must be of order <= 3.")}const{round:$a,PI:qa}=Math;const{abs:ja,max:Wa,ceil:Qa,log2:Ra}=Math;function Ga(n,e,r={}){let o;"undefined"!=typeof _debug_&&(o=performance.now()),e=e||Ul(n);const i=Qa(Ra(e)),{inclMicroCorners:c=!0,minLoopArea:s=(2**i*2**-12)**2,forceOrientationNegative:u=!1,booleanOp:f="OR",containerSizeMultiplier:l=16}=r,a=2**i*2**-46*l;(function(t){if("undefined"!=typeof _debug_)for(const n of t){_debug_.generated.elems.loopPre.push(...t),_debug_.generated.elems.loopsPre.push(t);for(const t of n){const n=po(t),e=ca(t),r=mu(t,!1);_debug_.generated.elems.bezier_.push(t),_debug_.generated.elems.looseBoundingBox_.push(n),_debug_.generated.elems.tightBoundingBox_.push(e),_debug_.generated.elems.boundingHull_.push(r)}}})(n=Gl(n,46,i,!1,!0)),n.sort(Io);const p=n.map((n,e)=>t(n,e)),{extremes:h,containers:d}=Fl(p,a,i),g={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0,loopsIdxs:new Set,orientation:-1},v=new Set,m=new Set;for(const t of p){if(v.has(t))continue;v.add(t);const n=No(g,t),e=h.get(t)[0].container;if(0===e.inOuts.length)continue;const r=Xl(e,n,t),o=2===e.inOuts.length&&2===e.xs.length;if(o&&e.inOuts[0].nextOrPrev===e.inOuts[1])r.bezierPieces=t.beziers.map(sa),r.parent.children=r.parent.children||new Set,r.parent.children.add(r);else if(oo(r,v,m,!1),o&&void 0!==r.bezierPieces){const{bezierPieces:t}=r,n=t[t.length-1],e=t[0];if(n.ps===e.ps){const r={ps:n.ps,ts:[n.ts[0],e.ts[1]]};t.shift(),t.pop(),t.unshift(r)}}}"undefined"!=typeof _debug_&&_debug_.verbose;const x=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(...t.children),e.push(...t.children),0===t.windingNum&&(t.children=new Set)}return n}(g);"undefined"!=typeof _debug_&&_debug_.verbose;const b=function(t){return n=>{const e="OR"===t||"XOR"===t?[n]:[];n.used="OR"===t||"XOR"===t;const r=Array.from(n.children);for(;r.length;){const n=r.pop();if("OR"===t&&0===n.windingNum&&e.push(n),"AND"===t){const t=Co(n);(0===n.windingNum&&t||Eo(n.windingNum)>=2&&!t)&&(e.push(n),n.used=!0)}if("XOR"===t){const t=Co(n);(0===n.windingNum&&t||Eo(n.windingNum)>=2&&t)&&(e.push(n),n.used=!0)}for(const t of n.children)r.push(t)}return e}}(f),w=x.map(b).filter(t=>0!==t.length).map(n=>{const e=n[0].orientation;return n.map((n,r)=>function(n,e,r,o){const i=n.bezierPieces?.map(eo);if(void 0===i)return t([],r);const{orientation:c}=n,s=o?-1:e;return t((0===r?s:-s)*c>0?i:i.map(t=>t.toReversed()).toReversed(),r)}(n,e,r,u))}),_=[];for(let t=0;t<w.length;t++){const n=w[t].filter(t=>ja(oa(t.beziers))>s);n.length&&(n.sort((t,n)=>Io(t.beziers,n.beziers)),_.push(n))}"undefined"!=typeof _debug_&&(_debug_.generated.timing.simplifyPaths=performance.now()-o);const M=c?_:_.map(n=>n.map(n=>{const{beziers:e}=n,r=function(t,n){!function(t){$a(function(t){const n=t.length;let e=0;for(let r=0;r<n;r++){const o=t[(r-1+n)%n],i=t[r];e+=Va(i,[0,1])+la(fo(o,1),fo(i,0))}return e}(t)/(2*qa))}(t);const e=t.map(t=>t.map(t=>[t[0],t[1]])).filter(t=>ia(t)>n),r=e.length;for(let t=0;t<r;t++){const n=e[t],o=e[(t+1)%r],i=n[n.length-1],c=o[0];c[0]===i[0]&&c[1]===i[1]||(i[0]=c[0],i[1]=c[1])}return e}(e,Wa(...d.map(t=>ja(t.box[0][0]-t.box[1][0])),...d.map(t=>ja(t.box[0][1]-t.box[1][1]))));return t(r,n.idx)}));return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.generated.elems.loop.push(...n),_debug_.generated.elems.loops.push(n)}(M),M}const{max:Ua,abs:Za}=Math;function Ja(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Xt(t[e],t[e+1]);return n}function Ka(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}function tp(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=n[0],g=n[1],v=c-d,m=u-d,x=l-d,b=p-d,w=s-g,_=f-g,M=a-g,S=h-g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,O=6*w*_,C=6*M*S,T=6*m*b+9*x*x,P=2*v*b+18*m*x,A=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b-y+(N-I)+T+(A-P)+(S*S-C+(E-O)+k+(z-B))),5*(y+5*I+3*P-2*(T+2*A+3*N)+(C+5*O+3*B-2*(k+2*z+3*E))),4*(T-3*(P-2*A)-5*(2*I-3*N)+(k-3*(B-2*z)-5*(2*O-3*E))),3*(P-2*(2*A-5*(I-2*N))+(B-2*(2*z-5*(O-2*E)))),2*(A-5*(I-3*N)+(z-5*(O-3*E))),I-6*N+(O-6*E)]}function np(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n[0],p=n[1],h=i-a,d=s-a,g=f-a,v=c-p,m=u-p,x=l-p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I-4*(N+S)+(g*g+b+2*y-4*(_+w)),3*(N-I+(3*S-M)+(_-y+(3*w-b))),I-3*(2*S-M)+(y-3*(2*w-b)),S-M+(w-b)]}function ep(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=u*f+l*a,h=l*l+u*u;return[f*f+a*a+(h-2*p),p-h]}const{sqrt:rp}=Math;function op(t,n,e=!0){let r;if(4===t.length)r=tp(t,n);else if(3===t.length)r=np(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Xt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}r=ep(t,n)}const o=Ce(r,0,1)?.map(t=>t.t)||[];e&&(o.push(0),o.push(1));let i,c=Number.POSITIVE_INFINITY;for(const e of o){const r=Ka(t,e),o=du(r,n);o<c&&(c=o,i={p:r,t:e,d:rp(o)})}return i}const{sqrt:ip}=Math,{abs:cp}=Math;function sp(t){let n=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++){const r=t[e],o=cp(r[0]),i=cp(r[1]);o>n&&(n=o),i>n&&(n=i)}return n}const{max:up}=Math;function fp(t){return up(t.hL+t.hEL,t.hR+t.hER)}function lp(t,n){const e=fp(t)-fp(n);return 0!==e?e:t.tS-n.tS}class ap{compare;heap=[];constructor(t){this.compare=t}insert(t){const n=this.heap;n.push(t);let e=n.length-1;for(;;){const r=(e-1-(e+1)%2)/2;if(-1===r)return;const o=n[r];if(this.compare(t,o)<0)break;n[r]=t,n[e]=o,e=r}}popMax(){const t=this.heap,n=t[0];return t[0]=t[t.length-1],t.length--,this.swimDown(),n}swimDown(){const t=this.heap,n=t.length;let e=0;for(;;){const r=2*e+1;if(r>=n)break;const o=2*e+2,i=o>=n||this.compare(t[r],t[o])>0?r:o,c=t[i],s=t[e];if(this.compare(s,c)>0)break;t[i]=s,t[e]=c,e=i}}swapMinOrMax(t){this.heap[0]=t,this.swimDown()}static getParentIdx(t){return(t-1-(t+1)%2)/2}static getLeftChild(t){return 2*t+1}static getRightChild(t){return 2*t+2}}const{max:pp}=Math;function hp(t,n,e,r=50){if(1===t.length)return op(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=tp(t,n);else if(3===t.length)e=np(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Xt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=ep(t,n)}const r=Ce(e,0,1)?.map(t=>t.t)||[];r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=Ka(t,e),c=du(r,n);c>i&&(i=c,o={p:r,t:e,d:ip(c)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=op(n,t[0]).d,r=op(n,t[t.length-1]).d;return e>r?e:r}const o=pp(sp(t),sp(n));e=e||o/1e6;const[i,c]=dp(t,0,1),s={tS:0,tE:1,hL:op(n,t[0]).d,hR:op(n,t[t.length-1]).d,hEL:i,hER:c},u=new ap(lp);u.insert(s);let f=0,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:c,hL:s,hR:p}=o,h=(i+c)/2,[d,g]=dp(t,i,h),[v,m]=dp(t,h,c),x=Ka(t,h),b=Xt(x,op(n,x).p),w=pp(s,b,p);if(w>a&&(a=w),l=fp(o),l-a<e)return a;if(f++>r)return a;const _={tS:i,tE:h,hL:s,hR:b,hEL:d,hER:g},M={tS:h,tE:c,hL:b,hR:p,hEL:v,hER:m};u.swapMinOrMax(_),u.insert(M)}}function dp(t,n,e){const r=(e+n)/2,o=P(t,n,r),i=P(t,r,e);return[Ja(o),Ja(i)]}function gp(t,n=!1){const e=t;let r=e;const o=[];do{n&&r===e||x(r)||o.push(r),r=r.nextOnCircle}while(r!==e);return o}function vp(t){const n=[],e=[t],r=new Set;for(;e.length>0;){const t=Yt(e.pop());if(0===t.length)continue;n.push(t);const o=t[0],i=t[t.length-1].next.prevOnCircle;r.add(o),r.add(i);const c=gp(o,!0),s=gp(i,!0),u=c.filter(t=>!r.has(t)),f=s.filter(t=>!r.has(t));for(const t of u)r.add(t);for(const t of f)r.add(t);e.push(...u,...f)}return n}class mp{datum;color=0;parent;left;right;constructor(t){this.datum=t}}class xp{compare;root;constructor(t){this.compare=t,this.root=void 0}isEmpty(){return void 0===this.root}find(t){let n=this.root;for(;n;){const e=this.compare(t,n.datum);if(0===e)return n;n=e<0?n.left:n.right}}insert(t){if(void 0===this.root)return this.root=new mp(t),void(this.root.color=1);let n,e=this.root;for(;e;){n=e;const r=this.compare(t,e.datum);if(0===r)return void(e.datum=t);e=r<0?e.left:e.right}const r=new mp(t);r.parent=n,this.compare(t,n.datum)<0?n.left=r:n.right=r,this.fixInsert(r)}remove(t,n=!1,e){const r=this.find(t);if(void 0===r)return;const o=r.datum;return this.removeNode(r),o}findBounds(t){let n=this.root;const e=[void 0,void 0];for(;n;)this.compare(t,n.datum)>=0?(e[0]=n,n=n.right):(e[1]=n,n=n.left);return e}getMinNode(t){let n=void 0===t?this.root:t;for(;n&&n.left;)n=n.left;return n}getMaxNode(t){let n=void 0===t?this.root:t;for(;n&&n.right;)n=n.right;return n}removeNode(t){let n,e,r=t,o=r.color;void 0===t.left?(n=t.right,e=t.parent,this.transplant(t,t.right)):void 0===t.right?(n=t.left,e=t.parent,this.transplant(t,t.left)):(r=this.getMinNode(t.right),o=r.color,n=r.right,r.parent===t?(e=r,n&&(n.parent=r)):(e=r.parent,this.transplant(r,r.right),r.right=t.right,r.right.parent=r),this.transplant(t,r),r.left=t.left,r.left.parent=r,r.color=t.color),1===o&&this.fixDelete(n,e)}fixInsert(t){let n=t;for(;n.parent&&0===n.parent.color;){const t=n.parent,e=t.parent;if(t===e.left){const r=e.right;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.right&&(n=t,this.rotateLeft(n)),n.parent.color=1,e.color=0,this.rotateRight(e))}else{const r=e.left;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.left&&(n=t,this.rotateRight(n)),n.parent.color=1,e.color=0,this.rotateLeft(e))}}this.root.color=1}fixDelete(t,n){let e=t,r=n;for(;e!==this.root&&1===this.colorOf(e)&&void 0!==r;)if(e===r?.left){let t=r.right;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateLeft(r),t=r.right),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=e?.parent):(1===this.colorOf(t?.right)&&(t?.left&&(t.left.color=1),t&&(t.color=0,this.rotateRight(t)),t=r.right),t&&(t.color=r.color),r.color=1,t?.right&&(t.right.color=1),this.rotateLeft(r),e=this.root,r=void 0)}else{let t=r?.left;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateRight(r),t=r.left),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=r?.parent):(1===this.colorOf(t?.left)&&(t?.right&&(t.right.color=1),t&&(t.color=0,this.rotateLeft(t)),t=r?.left),t&&(t.color=r.color),r.color=1,t?.left&&(t.left.color=1),this.rotateRight(r),e=this.root,r=void 0)}e&&(e.color=1)}transplant(t,n){void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n&&(n.parent=t.parent)}rotateLeft(t){const n=t.right;t.right=n.left,n.left&&(n.left.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}rotateRight(t){const n=t.left;t.left=n.right,n.right&&(n.right.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}colorOf(t){return t?t.color:1}}function bp(t){const n=new Map;return h(t).forEach(function(t){const e=t.pointOnShape.curve.loop;let r=n.get(e);r||(r=new xp(bn),n.set(e,r)),r.insert(t)}),n}const{max:wp}=Math;function _p(t,n=.125,e=50){let r=O(t.cpNode);for(;!x(r);)r=r.next;const o=vp(r),i=new Set;for(let t=0;t<o.length;t++){const r=o[t];let c=0;for(;c<r.length;){const t=c;for(;(c++,c!==r.length)&&!(Mp(t,c,r,e)>n);)i.add(r[c])}}r=function(t,n){const e=n;do{if(t(n))return n;n=n.next}while(n!==e)}(x,r);for(const n of i)_n(t=>2!==v(t)&&!t.isHoleClosing)(n)||B(n,t.meta);return{cpNode:r,meta:{...t.meta,cpTrees:bp(r)}}}function Mp(t,n,e,r){const o=[],i=Tt(e[t],e[n].next);for(;t<n+1;t++)o.push(hp(Pt(e[t]),i,r));return wp(...o)}function Sp(t){const n=[],e=h(t);for(const t of e)w(t)&&!t.isHoleClosing&&n.push(t);return n}const Np=function(t,n,e){const r=t.get(n);return void 0!==r&&r.has(e)},Ip=function(t,n,e){let r=t.get(n);void 0===r&&(r=new Set,t.set(n,r)),r.add(e)};function yp(t){let n=t,e=t.prevOnCircle;for(;x(e);)e=e.prevOnCircle;const r=[];do{x(n)||r.push(n),n=n.nextOnCircle}while(n!==e);return r}function Ep(t,n){const e=new Map,r=new Map;return N(t,function(t){const o=r.get(t)||n*t.pointOnShape.circle.radius,i=t.next,c=function(t,n,e=.4,r=16){if(4===n.length)return an(t,n,e,r);if(3===n.length)return sn(t,n,e,r);if(2===n.length)return Ht(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}([0,1],Pt(t)),s=i.pointOnShape.circle.radius;if(o-c>n*s)for(const t of m(i))if(r.set(t,o-c),!i.isHoleClosing){const{center:t}=i.pointOnShape.circle;Ip(e,t[0],t[1])}}),e}function Op(t,n){let e=0;"undefined"!=typeof _debug_&&(e=performance.now());const r=function(t){const n=h(t);return n.reduce(function(t,n){return t.pointOnShape.circle.radius>=n.pointOnShape.circle.radius?t:n},n[0])}(O(t.cpNode));!function(t,n){const e=Sp(n);for(;e.length;){const r=e.pop(),{center:o}=r.pointOnShape.circle;if(!Np(t,o[0],o[1])||r.isIntersection)continue;let i=r.prevOnCircle,c=!1;for(;!c;){i=i.next;const{center:e}=i.pointOnShape.circle;if(Np(t,e[0],e[1]))if(kt(i,n))c=!0;else{if(1===yp(i).length)continue;c=!0}else{for(;x(i.prevOnCircle);)i=i.prevOnCircle;c=!0}}if(c){const t=i.prevOnCircle;t.next=i,i.prev=t,t.nextOnCircle=i,i.prevOnCircle=t}}}(Ep(r,n),r);const o={cpNode:r,meta:{...t.meta,cpTrees:bp(r)}};return function(t){"undefined"!=typeof _debug_&&(_debug_.generated.timing.sats=performance.now()-t)}(e),o}const Cp={maxCurviness:.05,maxLength:40,applySat:!0,satScale:2,simplify:!0,simplifyTolerance:2**-4,minBezLength:2**-6,angleIncrement:15},Tp={maxCurviness:{range:[.01,3],scaleByMaxCoordinate:!1},maxLength:{range:[1,1024],scaleByMaxCoordinate:!0},angleIncrement:{range:[.1,360],scaleByMaxCoordinate:!1},satScale:{range:[1,1/0],scaleByMaxCoordinate:!1},simplifyTolerance:{range:[2**-20,2**20],scaleByMaxCoordinate:!0},minBezLength:{range:[2**-20,2],scaleByMaxCoordinate:!0}};function Pp(t){return[t[1],-t[0]]}function Ap(t,n){if(!It(n))return 0;const e=Nt(n);return e.isDull?-D(Pp(e.tangents[0]),W(H(n.p,t))):0}function kp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Bp(t){return t[0]*t[0]+t[1]*t[1]}function zp(t,n,e){return t[0]*(n[1]*e[2]-n[2]*e[1])-t[1]*(n[0]*e[2]-n[2]*e[0])+t[2]*(n[0]*e[1]-n[1]*e[0])}const Fp=function(t){const n=t[0],e=t[1],r=t[2],o=Bp,i=.5*zp([o(n),n[1],1],[o(e),e[1],1],[o(r),r[1],1]),c=.5*zp([n[0],o(n),1],[e[0],o(e),1],[r[0],o(r),1]),s=zp([n[0],n[1],1],[e[0],e[1],1],[r[0],r[1],1]);return[i/s,c/s]},Yp=Je,Lp=Ut,Xp=Dn,Hp=jn,Dp=Ke,Vp=tr,$p=Zt;function qp(t,n){const e=t[0],r=t[1],o=t[2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p=Je,Wp=Ut,Qp=Dn,Rp=jn,Gp=Ke,Up=Zt,Zp=tr;function Jp(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=jp(e,u),a=jp(o,u),p=jp(c,u),h=jp(r,f),d=jp(i,f),g=jp(s,f),v=Rp(l,l),m=Rp(l,a),x=Rp(l,p),b=Rp(a,a),w=Rp(a,p),_=Rp(p,p),M=Rp(h,h),S=Rp(h,d),N=Rp(h,g),I=Rp(d,d),y=Rp(d,g),E=Rp(g,g),O=Wp(N,Gp(I)),C=Wp(x,Gp(b));return[Wp(Up(Wp(Wp(E,M),Gp(O)),Zp(Wp(y,S))),Up(Wp(Wp(_,v),Gp(C)),Zp(Wp(w,m)))),Qp(3,Wp(Wp(Up(y,O),Up(Qp(3,S),M)),Wp(Up(w,C),Up(Qp(3,m),v)))),Wp(Up(O,Qp(3,Up(Gp(S),M))),Up(C,Qp(3,Up(Gp(m),v)))),Wp(Up(S,M),Up(m,v))]}const Kp=Gt,th=Ut,nh=mr;function eh(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=Kp(u,u),h=Kp(u,f),d=Kp(f,f),g=Kp(l,l),v=Kp(l,a),m=Kp(a,a),x=th(h,v),b=th(g,p);return[th(th(d,m),th(b,nh(x))),Zt(x,b)]}const rh=Z,oh=nt,ih=Mr,ch=Sr,sh=Z,uh=nt,fh=Mr;function lh(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const ah=Z,ph=Sr,{abs:hh}=Math;function dh(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=hh(e[0]),s=hh(e[1]),u=hh(r[0]),f=hh(r[1]),l=hh(o[0]),a=hh(o[1]),p=hh(i[0]),h=hh(i[1]),d=hh(n[0]),g=hh(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,O=6*w*_,C=6*M*S,T=6*m*b+9*x*x,P=2*v*b+18*m*x,A=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(A+P)+(S*S+C+(E+O)+k+(z+B))),5*(y+5*I+3*P+2*(T+2*A+3*N)+(C+5*O+3*B+2*(k+2*z+3*E))),4*(T+3*(P+2*A)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*O+3*E))),3*(P+2*(2*A+5*(I+2*N))+(B+2*(2*z+5*(O+2*E)))),2*(A+5*(I+3*N)+(z+5*(O+3*E))),I+6*N+(O+6*E)]}function gh(t,n){const e=t[0],r=t[1],o=t[2],i=hh(e[0]),c=hh(e[1]),s=hh(r[0]),u=hh(r[1]),f=hh(o[0]),l=hh(o[1]),a=hh(n[0]),p=hh(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function vh(t,n){const e=t[0],r=t[1],o=hh(e[0]),i=hh(e[1]),c=hh(r[0]),s=hh(r[1]),u=hh(n[0]),f=hh(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}const{abs:mh}=Math;function xh(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=mh(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=mh(n),a=mh(r),p=mh(o),h=mh(i),d=mh(c),g=mh(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(mh(u)+d)*e+m)*e+x)*e,_+(w+(g+(mh(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=mh(n),f=mh(r),l=mh(o),a=mh(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(mh(c)+l)*e+p)*e,h+(a+(mh(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=mh(n),s=mh(r);return[c+(mh(o)+c)*e,s+(mh(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const bh=Number.EPSILON/2,wh=function(){const t=1*bh;return t/(1-t)}(),{abs:_h}=Math,Mh=[[0,0],[0,0]];const{min:Sh,max:Nh}=Math;function Ih(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=ln(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*bh*r[0][0],f=9*bh*r[1][0],l=9*bh*r[2][0],a=9*bh*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*bh*r[0][1],m=9*bh*r[1][1],x=9*bh*r[2][1],b=9*bh*r[3][1],w=Sh(o-u,i-f,c-l,s-a),_=Nh(o+u,i+f,c+l,s+a);return[[w,Sh(p-v,h-m,d-x,g-b)],[_,Nh(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=Qt(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*bh*r[0][0],u=5*bh*r[1][0],f=5*bh*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*bh*r[0][1],d=5*bh*r[1][1],g=5*bh*r[2][1],v=Sh(o-s,i-u,c-f),m=Nh(o+s,i+u,c+f);return[[v,Sh(l-h,a-d,p-g)],[m,Nh(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Mh}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=_h(n),l=_h(o),a=_h(c),p=_h(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(_h(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=_h(n),l=_h(o),a=_h(c),p=_h(i);return{ps:u,_ps:[[f*(a+l)+l,f*(_h(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=_h(n),a=_h(e),p=_h(i),h=_h(s),d=_h(c),g=_h(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*bh*r[0][0],s=3*bh*r[1][0],u=e[0][1],f=e[1][1],l=3*bh*r[0][1],a=3*bh*r[1][1],p=Sh(o-c,i-s),h=Nh(o+c,i+s);return[[p,Sh(u-l,f-a)],[h,Nh(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Ka(t,n);let i;if(4===t.length)i=xh(t,[0,n]).map(t=>8*wh*t);else if(3===t.length)i=xh(t,[0,n]).map(t=>5*wh*t);else if(2===t.length)i=xh(t,[0,n]).map(t=>2*wh*t);else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}const yh=jn,Eh=Ut,Oh=Zt,Ch=Je,Th=Xo;function Ph(t,n){if(0===n[0]&&0===n[1])return t[0].map(t=>[0,t]);if(0===n[0]&&1===n[1])return t[t.length-1].map(t=>[0,t]);if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=Th(yh(Ch(o,e),n),e),a=Th(yh(Ch(c,o),n),o),p=Th(yh(Ch(u,c),n),c),h=Eh(l,yh(Oh(a,l),n)),d=Eh(a,yh(Oh(p,a),n)),g=Eh(h,yh(Oh(d,h),n)),v=Th(yh(Ch(i,r),n),r),m=Th(yh(Ch(s,i),n),i),x=Th(yh(Ch(f,s),n),s),b=Eh(v,yh(Oh(m,v),n)),w=Eh(m,yh(Oh(x,m),n));return[g,Eh(b,yh(Oh(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=Eh([0,e],yh(Ch(o,e),n)),f=Eh([0,o],yh(Ch(c,o),n)),l=Eh(u,yh(Oh(f,u),n)),a=Eh([0,r],yh(Ch(i,r),n)),p=Eh([0,i],yh(Ch(s,i),n));return[l,Eh(a,yh(Oh(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Th(yh(Ch(o,e),n),e),Th(yh(Ch(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}const Ah=Je,kh=jn,Bh=Ut,zh=Number.EPSILON;function Fh(t,n){const[e,r]=t,[o,i]=n,c=Je(e,o),s=Je(r,i);return Ut(jn(c,c),jn(s,s))[1]}const Yh=Number.EPSILON;function Lh(t,n,e){const[r,o]=e,{ps:i}=t,c=[];if(r!==o){const{polyDd:e,polyE:s,getPolyExact:u}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:qp(t,n),polyE:dh(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=rh(c,d),m=rh(u,d),x=rh(l,d),b=rh(p,d),w=rh(s,g),_=rh(f,g),M=rh(a,g),S=rh(h,g),N=et(v,v),I=oh(6,et(v,m)),y=oh(6,et(v,x)),E=ih(et(v,b)),O=oh(9,et(m,m)),C=oh(18,et(m,x)),T=oh(6,et(m,b)),P=oh(9,et(x,x)),A=oh(6,et(x,b)),k=et(b,b),B=et(w,w),z=oh(6,et(w,_)),F=oh(6,et(w,M)),Y=ih(et(w,S)),L=oh(9,et(_,_)),X=oh(18,et(_,M)),H=oh(6,et(_,S)),D=oh(9,et(M,M)),V=oh(6,et(M,S)),$=et(S,S),q=J(T,P),j=J(E,C),W=J(y,O),Q=J(H,D),R=J(Y,X),G=J(F,L),U=it(J(J(k,N),J(q,W)),J(J(j,A),I)),Z=it(J(J($,B),J(Q,G)),J(J(R,V),z)),K=oh(6,J(U,Z)),tt=J(ch(J(J(q,ih(W)),oh(3,N))),J(J(A,oh(3,j)),oh(5,I))),nt=J(ch(J(J(Q,ih(G)),oh(3,B))),J(J(V,oh(3,R)),oh(5,z))),rt=oh(5,J(tt,nt)),ot=J(J(q,oh(3,it(ih(W),j))),oh(5,it(oh(3,N),ih(I)))),ct=J(J(Q,oh(3,it(ih(G),R))),oh(5,it(oh(3,B),ih(z)))),st=oh(4,J(ot,ct)),ut=it(j,ih(it(ih(W),oh(5,it(I,ih(N)))))),ft=it(R,ih(it(ih(G),oh(5,it(z,ih(B)))))),lt=oh(3,J(ut,ft)),at=it(W,oh(5,it(I,oh(3,N)))),pt=it(G,oh(5,it(z,oh(3,B))));return[K,rt,st,lt,ih(J(at,pt)),J(it(I,oh(6,N)),it(z,oh(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:Jp(t,n),polyE:gh(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=sh(e,u),a=sh(o,u),p=sh(c,u),h=sh(r,f),d=sh(i,f),g=sh(s,f),v=et(l,l),m=et(l,a),x=et(l,p),b=et(a,a),w=et(a,p),_=et(p,p),M=et(h,h),S=et(h,d),N=et(h,g),I=et(d,d),y=et(d,g),E=et(g,g),O=J(N,fh(I)),C=J(x,fh(b)),T=J(it(J(_,fh(C)),lh(J(w,m))),v),P=J(it(J(E,fh(O)),lh(J(y,S))),M),A=J(T,P),k=J(it(w,C),it(uh(3,m),v)),B=J(it(y,O),it(uh(3,S),M));return[A,uh(3,J(k,B)),J(it(O,uh(3,it(fh(S),M))),it(C,uh(3,it(fh(m),v)))),J(it(S,M),it(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:eh(t,n),polyE:vh(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=ah(e,c),f=ah(o,c),l=ah(r,s),a=ah(i,s),p=et(u,u),h=et(u,f),d=et(f,f),g=et(l,l),v=et(l,a),m=et(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(ph(x),b)),it(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(i,n),f=Ce(e,r,o,s,u)||[];c.push(...f.map(e=>{const{tS:r,tE:o,t:c}=e,s=c<0?0:c>1?1:c,u=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=1/0,a=-1/0;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Ah(t,u),r=Ah(n,f),o=Bh(kh(e,e),kh(r,r))[1],i=o*(1-zh),c=o*(1+zh);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(Ih(i,[r,o]),n),f=0===s?1:s;return{curve:0===s?t.prev:t,t:f,dSquaredI:u}}))}const s=e.slice();return r===o&&s.push(r),c.push(...s.map(e=>{const r=Fh(Ph(i,[0,e]).map(t=>t[0]+t[1]),n),o=[r*(1-Yh),r*(1+Yh)],c=0===e?1:e;return{curve:0===e?t.prev:t,t:c,dSquaredI:o}})),c}const{min:Xh}=Math,Hh=1+2**-20;function Dh(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];return u<o?f<i?du(t[0],n):f>s?du([o,s],n):(o-u)**2:u>c?f<i?du([c,i],n):f>s?du(t[1],n):(u-c)**2:f<i?(i-f)**2:f>s?(f-s)**2:0}function Vh(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=G(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ih(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=G(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ih(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const $h=L(Vh),{sqrt:qh}=Math;function jh(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=Ja(t);if(256*du(t[0],t[t.length-1])<s*s){const[r,o]=Ka(t,.5),s=qh((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=qh((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return Vh(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function Wh(t,n){const e=[0,1,2,3].map(e=>function(t,n){const e=du,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let c=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return c=Math.max(0,Math.min(1,c)),e(t,[r[0]+c*(o[0]-r[0]),r[1]+c*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]])),r=du(t[0],t[1]),o=du(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const Qh=L(jh);function Rh(t,n){return Ph(t,[0,n]).map(t=>t[0]+t[1])}function Gh(t,n){t=function(t,n){const e=function(t,n){let e=1/0;for(let r=0;r<t.length;r++){const o=t[r],{curve:{ps:i},ts:c}=o,s=Ka(i,c[0]),u=Ka(i,c[1]);e=Xh(e,du(n,s),du(n,u))}return Hh*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Dh($h(c),n)<=e&&r.push(i)}return r}(t,n,e),t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],c=i.curve.ps;Wh(Qh(c),n)<=e&&r.push(i)}return r}(t,n,e),t}(t,n);const e=[];for(let r=0;r<t.length;r++){const o=t[r],i=Lh(o.curve,n,o.ts);e.push(...i)}let r=1/0;for(let t=0;t<e.length;t++){const n=e[t].dSquaredI[1];n<r&&(r=n)}const o=[];for(let t=0;t<e.length;t++){const n=e[t];n.dSquaredI[0]<=r&&o.push(n)}return o.map(t=>{const{curve:n,t:e}=t,{ps:r}=n;return{p:Rh(r,e),t:e,curve:n,isSource:!1}})}function Uh(t,n){return n.map(n=>Gh(n,t)[0])}function Zh(t,n){return[n*t[0],n*t[1]]}function Jh(t,n,e){const r=kp(e);let o,i,c,s,u=1,f=0;do{i=j(Zh(e,u),n),c=t.map(t=>Gh(t,n)[0]),s=kp(H(i,Fp(c.map(t=>t.p)))),o=s<r,u/=2,f++}while(!o&&f<3);return{newX:i,newV:s,newPoss:c}}const{min:Kh,abs:td,asin:nd}=Math;function ed(t,n,e,r,o){const i=2**(o-32),c=[t[0],t[n],t[t.length-1]],s=[r[0],r[n],r[t.length-1]],u=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e],f=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e];if(_(u[0][0]))return;let l,a=0,p=function(t,n){const e=t[0][0].pointOnShape.circle.center,r=Gh(n[1],e)[0],o=[t[0][0].pointOnShape.p,r.p,t[2][1].pointOnShape.p];return Fp(o)}(u,f),h=1/0;for(;h>i&&a<10;){if(a++,l=Uh(p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;const t=Fp(l.map(t=>t.p)),n=H(p,t);if(!Number.isFinite(n[0])||!Number.isFinite(n[1]))return;const e=Jh(f,p,n);p=e.newX,l=e.newPoss;const r=kp(n);h=td(r-e.newV)}const d=(Xt(p,l[0].p)+Xt(p,l[1].p)+Xt(p,l[2].p))/3,g={center:p,radius:d};let v=0;for(let t=0;t<3;t++){const n=l[t],e=W(H(n.p,p)),r=V(e);if(It(n)&&Nt(n).isDull){const t=St(n.curve.ps,n.curve.next.ps).tangents.map(V),r=nd($(t[0],e)),o=nd($(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),v+=i}else{const t=W(U(n.curve.ps,n.t));v+=td(nd($(r,t)))}}const m=[];for(let t=0;t<r.length;t++){const n=Gh(r[t],p)[0];m.push(Xt(n.p,p))}const x=Kh(...m);return{threeProngInfo:{poss:l,circle:g,δ3s:u},error:1*td(d-x)+1*v}}function rd(t){let n=t[0];const e=t[1],r=[];let o=!0;do{const t=n.pointOnShape,e=n.next.pointOnShape,i=t.curve,c=e.curve;if(o)if(o=!1,c===i&&xn(e,t)>0)r.push({curve:i,ts:[t.t,e.t]}),n=n.next;else{if(i.loop===c.loop){const n={curve:i,ts:[t.t,1]};r.push(n),od(r,i,c,e.t)}n=n.next}else o=!0,n=n.prevOnCircle}while(n!==e);return r}function od(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({curve:o,ts:[0,n]})}while(o!==e)}function id(t,n,e,r){const o={...n,order:e,order2:r},i=t.findBounds({pointOnShape:o});if(void 0!==i[0]||void 0!==i[1])return void 0===i[0]||void 0===i[1]?t.getMaxNode()?.datum:i[0].datum}function cd(t,n,e,r,o,i,c){if(void 0!==i&&!function(t,n,e){const r=xn(n,e.pointOnShape);if(r<0)return!0;if(0===r)return!1;const o=t.getMinNode();if(void 0===o)return!0;const i=o.datum;return xn(t.getMaxNode().datum.pointOnShape,n)<0&&i===e}(r,o,i.next)&&!t)return;const s={pointOnShape:o,isHoleClosing:n,isIntersection:e,id:c.id,next:void 0,prev:void 0,nextOnCircle:void 0,prevOnCircle:void 0};c.id++;const u=void 0===i?s:i,f=void 0===i?s:u.next;return f.prev=s,u.next=s,s.prev=u,s.next=f,r.insert(s),s}function sd(t,n,e,r,o,i,c){const{cpTrees:s}=o;let u=!1;const f=i.map((i,f)=>{const l=r[f],a=s.get(i.curve.loop),p={...i,circle:e,order:l,order2:0},h=void 0===c?id(a,i,l,0):c[f],d=cd(t,n,!1,a,p,h,o.lastInsertId);return void 0===d&&(u=!0),d});return u||function(t,n){n=n.slice().sort(function(t){const n=t.center;return function(t,e){let r=t.pointOnShape.p,o=e.pointOnShape.p;r=[r[0]-n[0],r[1]-n[1]],o=[o[0]-n[0],o[1]-n[1]];const i=Math.atan2(r[1],r[0]);return Math.atan2(o[1],o[0])-i}}(t));const e=n.length;for(let t=0;t<e;t++){const r=n[t];r.nextOnCircle=n[(t+1)%e],r.prevOnCircle=n[(t-1+e)%e]}}(e,f),{anyFailed:u,cpNodes:f}}const ud=Math.cos(Math.PI/180*1);function fd(t,n,e,r,o,i){const{cpTrees:c,maxCoordPowerOf2:s}=t,u=2**(s-40),f=2**(s-46),l=id(c.get(n.curve.loop),n,r,o);if(!l)return;const a=[l,l.next],{p,t:h}=n;for(const t of a){const n=t.pointOnShape.p,r=Xt(p,n);if(!(r>u)&&(D(W(H(n,t.pointOnShape.circle.center)),W(H(p,e.center)))>ud||r<f&&0!==h&&1!==h))return t}}function ld(t,n){const e=[];for(const t of n)e.push([t,t.next]);const r=function(t,n){const e=t.map(rd);let r,o=1/0;for(let i=1;i<t.length-1;i++)for(let c=0;c<3;c++){const s=ed(t,i,c,e,n);if(void 0===s)continue;const{error:u,threeProngInfo:f}=s;u<o&&(o=u,r=f)}return r}(e,t.maxCoordPowerOf2),{circle:o,poss:i,δ3s:c}=r,s=[];for(let t=0;t<3;t++)s.push(Ap(o.center,i[t]));const u=[];for(let n=0;n<i.length;n++){const e=fd(t,i[n],o,s[n],0);void 0!==e&&v(e)<=2&&!e.isHoleClosing&&u.push(e)}return{closeBysFor3Prong:u,cpNodes:0===u.length?sd(!0,!1,o,s,t,i,c.map(t=>t[0])).cpNodes:[]}}let ad=0;function pd(t,n){if(yt(n.pointOnShape))return{closeBysFor3Prong:void 0,addedCpNodes:[]};const e=[];for(;;){if(void 0===n)continue;const r=S(n);if(r.length<=2)break;const{closeBysFor3Prong:o,cpNodes:i}=ld(t,r);if(e.push(i),o.length>0)return{closeBysFor3Prong:o,addedCpNodes:e};if("undefined"!=typeof _debug_&&++ad===_debug_.directives.stopAfterThreeProngsNum)return}return{closeBysFor3Prong:void 0,addedCpNodes:e}}function hd(t){for(const n of t)return n}function dd(t,n,e,r){const o=n[0];m(o).forEach(t=>{e.delete(t),r.delete(t)}),B(o,t)}function gd(t,n,e){const r=new Map;for(let o=0;o<n.length;o++){const i=new xp(bn);r.set(t[o],i);const c=n[o];let s,u;for(const t of c){const n={center:t.p,radius:0},{curve:r}=t,o={...t,curve:r,t:1,circle:n,order:-1,order2:0},c={...t,curve:r.next,t:0,circle:n,order:1,order2:0};s=cd(!0,!1,!1,i,o,u,e),u=cd(!0,!1,!1,i,c,s,e),s.prevOnCircle=u,u.prevOnCircle=s,s.nextOnCircle=u,u.nextOnCircle=s}}return r}const vd=gu;let md;function xd(t,n){md=performance.now()}function bd(t){const n=[],e=[],r=[],o=[],i=[];for(const c of t)for(const t of c.curves){const c=t.ps,s=vd(c,!0);r.push(s);const u=$h(c);n.push(u);const f=jh(c);e.push(f);const l=St(t.ps,t.next.ps);l.isQuiteSharp?o.push(t):l.isQuiteDull&&i.push(t)}return{looseBoundingBoxes:n,tightBoundingBoxes:e,boundingHulls:r,sharpCorners:o,dullCorners:i}}function wd(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ja(o.ps)<t||St(o.ps,o.next.ps).isQuiteSharp&&e.push({curve:o,t:1,isSource:!0,p:Rh(o.ps,1)})}return e}}function _d(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function Md(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function Sd(t,n,e){const[r,o]=t,[i,c]=n,[s,u]=e,f=r-s,l=o-u;return{a0:2*(i*f+c*l),b0:f*f+l*l}}const Nd=[,,function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u],[f,l]]=e,a=f-s,p=l-u,h=r-s,d=o-u,g=i*a+c*p,v=-(a*a+p*p),m=a*h+p*d,x=2*(i*h+c*d),b=-v,w=h*h+d*d;return{A:[-2*g,x],B:[b,-2*m,w],C:[g],D:[v,m],H:[b*g,x*v,x*m-w*g]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u]]=e,[[f,l],[a,p]]=Md(e),h=r-s,d=o-u,g=2*(i*f+c*a),v=i*l+c*p,m=i*h+c*d,x=f*f+a*a,b=f*l+a*p,w=h*l+d*p,_=h*h+d*d,M=2*(h*f+d*a)-(l*l+p*p),S=-M;return{A:[-g,-2*v,2*m],B:[x,2*b,S,-2*w,_],C:[g,v],D:[-2*x,-3*b,M,w],H:[x*g,b*g+3*x*v,4*(b*v-m*x),g*w+v*S-6*m*b,-2*m*S-g*_,2*m*w-v*_]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u,f,l],[a,p,h,d]]=_d(e),g=r-l,v=o-d,m=i*s+c*a,x=i*u+c*p,b=i*f+c*h,w=i*g+c*v,_=s*s+a*a,M=s*u+a*p,S=s*f+a*h,N=u*u+p*p,I=u*f+p*h,y=f*f+h*h,E=s*g+a*v,O=u*g+p*v,C=f*g+h*v,T=g*g+v*v,P=2*S+N,A=2*I-2*E,k=y-2*O,B=-2*C;return{A:[-2*m,-2*x,-2*b,2*w],B:[_,2*M,P,A,k,B,T],C:[3*m,2*x,b],D:[-3*_,-5*M,-4*S-2*N,3*E-3*I,2*O-y,C],H:[3*m*_,4*(m*M+x*_),m*P+6*x*M+5*b*_,2*x*P+8*b*M-6*w*_,-m*k+x*A+3*b*P-10*w*M,-2*m*B+2*b*A-4*w*P,b*k-x*B-3*w*A-3*m*T,-2*w*k-2*x*T,-w*B-b*T]}}],{sqrt:Id,abs:yd,max:Ed}=Math;function Od(t,n,e,r,o,i){const{curve:c,ts:[s,u]}=i,{ps:f}=c,{curve:l,t:a,p}=e,h=c===l,d=0===o&&h,g=[];let v,m=!1,x=!1;if(!(s===u||d&&2===f.length||h&&3===f.length&&r)){const{A:e,B:r,H:o}=d?3===f.length?function(t,n,e){const[[r,o],[i,c]]=Md(e),[s,u]=n,f=r*t+o,l=i*t+c,a=r*r+i*i,p=2*(s*r+u*i);return{A:[-p],B:[a,2*(r*f+i*l),f*f+l*l],H:[a*p,p*(a*t+(r*o+i*c))]}}(a,n,f):function(t,n,e){const[r,o]=n,[[i,c,s],[u,f,l]]=_d(e),a=r*i+o*u,p=r*c+o*f,h=r*s+o*l,d=i*i+u*u,g=i*c+u*f,v=i*s+u*l,m=c*c+f*f,x=c*s+f*l,b=s*s+l*l,w=t*(t*(t*a+p)+h),_=t*(t*(t*d+g)+v),M=t*(t*(t*g+m)+x),S=3*a,N=-3*d,I=-5*g+t*N,y=-4*v-2*m+t*I,E=-3*x+3*_+t*y,O=-2*a,C=2*v+m,T=2*x-2*_,P=b-2*M,A=2*g+2*t*d,k=C+t*(2*A-t*d),B=T+t*(2*k-t*A),z=3*a*d,F=4*(a*g+p*d)+4*t*z,Y=a*C+6*p*g+5*h*d+t*(4*F-6*t*z),L=2*p*C+8*h*g-6*w*d+t*(4*Y+t*(-6*F+4*t*z));return{A:[O,-2*p+2*t*O],B:[d,A,k,B,P+t*(2*B-t*k)],C:[S,2*p+t*S],D:[N,I,y,E,2*M-b+t*E],H:[z,F,Y,L,-a*P+p*T+3*h*C-10*w*g+t*(4*L+t*(-6*Y+t*(4*F-t*z)))]}}(a,n,f):function(t,n,e){if(1===e.length){const{a0:r,b0:o}=Sd(t,n,e[0]);return{A:[r],B:[o],C:[],D:[],H:[]}}return Nd[e.length](t,n,e)}(p,n,f);v=Ce(o,s,u)||[];for(let o=0;o<v.length;o++){const i=v[o],{tS:f,tE:l,t:a}=i;if(i.multiplicity>1)continue;if(l<s||f>u)continue;if(f<0)continue;const h=l>1?1:a,d=R(e,h),b=R(r,h),w=yd(d);if(Ed(w)<2**-40)continue;const _=-b/d;if(_<=0)continue;const M=[_*n[0],_*n[1]],S=Id(Bp(M));if(S<=2**(t-40))continue;const N=[p[0]+M[0],p[1]+M[1]];i.tS<=s&&i.tE>=s&&(m=!0),i.tS<=u&&i.tE>=u&&(x=!0);const I=0===h?1:h,y={curve:0===h?c.prev:c,s:I,d:S,x:N};g.push(y)}}const b=f[f.length-1];let w=0===a&&c===l.prev||1===a&&c===l;const _=[];if(0===s);else if(1===s)w||m||_.push({P:b,t:1});else if(!m){const t=Ka(f,s);_.push({P:t,t:s})}if(s!==u)if(0===u);else if(1===u)w||x||(_.push({P:b,t:1}),w=!0);else if(!x){const t=Ka(f,u);_.push({P:t,t:u})}for(let t=0;t<_.length;t++){const{P:e,t:r}=_[t],{a0:o,b0:i}=Sd(p,n,e);if(yd(o)<=2**-40||yd(i)<=2**-40)continue;const s=-i/o;if(s<2**-40)continue;const u=[s*n[0],s*n[1]],f=Id(Bp(u)),l=[p[0]+u[0],p[1]+u[1]],a=0===r?1:r,h={curve:0===r?c.prev:c,s:a,d:f,x:l};g.push(h)}return g}const{abs:Cd}=Math,Td=1+2**-20,Pd=1+2**-20,Ad=L(jh),kd=Gt,Bd=Ut,zd=Zt,Fd=function(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,c=i-(i-r),s=r-c,u=Hn*t,f=u-(u-t),l=t-f,a=e*t,p=o+a,h=a-(p-o)+(s*l-(o-c*f-s*f-c*l)),d=p+h;return[h-(d-p),d]},{acos:Yd}=Math;function Ld(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Ut(t[r],Dn(n,e));return e}const Xd=nl,Hd=Je,Dd=Dn,Vd=Ut,$d=Xo;function qd(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Dd(3,Vd(Hd(s,n),Dd(3,Hd(r,i)))),Dd(6,$d(Xd(i,n),-2*r)),Dd(3,Hd(r,n))],[Dd(3,Vd(Hd(u,e),Dd(3,Hd(o,c)))),Dd(6,$d(Xd(c,e),-2*o)),Dd(3,Hd(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[$d(Xd(2*i,2*n),-4*r),Hd(2*r,2*n)],[$d(Xd(2*c,2*e),-4*o),Hd(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[Hd(r,n)],[Hd(o,e)]]}(t);if(1===t.length)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const jd=Je,Wd=Ut,Qd=Dn,Rd=Xo;function Gd(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Qd(6,Wd(jd(s,n),Qd(3,jd(r,i)))),Qd(6,Rd(jd(i,2*r),n))],[Qd(6,Wd(jd(u,e),Qd(3,jd(o,c)))),Qd(6,Rd(jd(c,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[Rd(jd(2*i,4*r),2*n)],[Rd(jd(2*c,4*o),2*e)]]}if(t.length<=2)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Ud=jn,Zd=Ut,Jd=Zt;const{sqrt:Kd}=Math;function tg(t,n,e){const{curve:r,p:o,t:i}=n,{ps:c}=r,s=1/t,u=function(t,n){const[e,r]=function(t,n){const[e,r]=qd(t),[o,i]=Gd(t),c=Ld(e,n),s=Ld(r,n),u=Ld(o,n),f=Ld(i,n),l=Jd(Ud(c,f),Ud(s,u)),a=Zd(Ud(c,c),Ud(s,s));return[l,ol(Ud(a,Ud(a,a)))]}(t,n);return zs(e,r)}(c,i),f=-(u[0]+u[1]),l=f<s?s:f,[a,p]=e,h=Kd(a*a+p*p)*l;return[[o[0]+a/h,o[1]+p/h],1/l]}const{sqrt:ng}=Math,{sin:eg,cos:rg,max:og,sqrt:ig}=Math;function cg(t){const{loops:n,maxCoordPowerOf2:e,squaredDiagonalLength:r}=t,o=(2**(e-21))**2,i=2**(e-46),c=ig(r),s=2**(e-32);return function(r,u,f,l){const{curve:{loop:a,ps:p},t:h,p:d}=l,g=function(t,n){const[e,r]=qd(t),o=Ld(r,n);return[[-o[0],-o[1]],Ld(e,n)]}(p,h),v=[-g[0][1],-g[1][1]],m=r?[0,-c]:0!==f?Q(eg(f),rg(f))(v):v;let[x,b]=function(t,n,e,r,o){let i,c;const{p:s}=r;if(n)return[[s[0],s[1]-e],e];if(0===t)return tg(e,r,o);const{p:u}=r,[f,l]=o,a=e/ng(f*f+l*l),p=[f*a,l*a];return i=[u[0]+p[0],u[1]+p[1]],c=e,[i,c]}(f,r,c,l,m);const w=function(t,n,e,r,o,i,c){const{cpTrees:s}=o;if(n)return r.filter(t=>t!==e).flatMap(t=>t.curves.map(t=>({curve:t,ts:[0,1]})));const u=It(i)&&Nt(i).isDull?1===i.t&&0===t?-1:0===i.t?1:Ap(c,i):0,f=id(s.get(e),i,u,0);return f&&f!==f.next.next?rd([f,f]):e.curves.map(t=>({curve:t,ts:[0,1]}))}(f,r,a,n,t,l,x),_=function(t,n,e,r){let o=1/0,i=[e[0]+r[0],e[1]+r[1]];for(let t=0;t<n.length;t++){const c=n[t],{ps:s}=c.curve,u=s[0],f=s[s.length-1];for(const t of[u,f]){if(du(i,t)>o)continue;const{a0:n,b0:c}=Sd(e,r,t);if(Cd(n)<=2**-40||Cd(c)<=2**-40)continue;const s=-c/n;if(s<2**-40)continue;const u=[s*r[0],s*r[1]],f=Bp(u);f<o&&(o=f,i=[e[0]+u[0],e[1]+u[1]])}}return Td*o}(0,w,d,m),M=ig(_),S=ig(m[0]**2+m[1]**2);x=[d[0]+m[0]/S*M,d[1]+m[1]/S*M],function(t,n,e){if(t.length<=2)return t;let r=0;for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Dh($h(c),n)<=Pd*e&&Wh(Ad(c),n)<=Pd*e&&(t[r]=i,r++)}t.length=r}(w,x,_);const N=function(t,n,e,r,o,i){const c=[];for(let s=0;s<i.length;s++){const u=Od(t,n,e,r,o,i[s]);c.push(...u)}let s=1/0;for(let t=0;t<c.length;t++){const n=c[t].d*(1+2**-46);n<s&&(s=n)}const u=[];for(let t=0;t<c.length;t++){const n=c[t];n.d*(1-2**-46)<=s&&u.push(n)}return u}(e,m,l,u,f,w);if(1!==N.length){if(0===N.length)return;if(!function(t){const{curve:n,s:e}=t[0];for(let r=1;r<t.length;r++){const{curve:o,s:i}=t[r];if(n!==o||e!==i)return!1}return!0}(N))return}const{x:I,d:y,curve:E,s:O}=N[0];if(u&&b<(1-s)*y)return void function(t,n,e,r){if(It(r)&&Nt(r).isDull)return;const o={radius:n,center:e};if(fd(t,r,o,Ap(o.center,r),0))return;const{anyFailed:i,cpNodes:c}=sd(!1,!1,o,[-.5,.5],t,[r,r])}(t,b,x,l);const C={curve:E,t:O,isSource:!1,p:Rh(E.ps,O)},T={center:I,radius:y},P=Fh(l.p,C.p),A=Fh(I,C.p);if(!r){if(0===P)return;if(P<=og(function(t,n,e){if(n+e>=t)return 1/0;const r=Je(t,n),o=Fd(n,r),i=t-n,c=n*i,s=(c-n*e-e*e/2)/(c+i*e),u=zs(zd(zd(o,kd(n,e)),kd(e,e/2)),Bd(o,Fd(e,r)))[1];return Yd(s),n*Yd(u)}(b,ig(A),4*i),o))return}return{circle:T,z:C}}}function sg(t,n,e,r,o){e=0===e.t?{...e,curve:e.curve.prev,t:1}:e;const i=Ap(n.center,e),c=Ap(n.center,r),s={...r,circle:n,order:c,order2:0},u={...e,circle:n,order:i,order2:0};if(fd(t,e,n,i,0))return;if(fd(t,r,n,c,0))return;const{anyFailed:f,cpNodes:l}=sd(o,o,n,[i,c],t,[u,s]);if(!f)return o&&function(t,n){const{cpTrees:e}=t,[r,o]=n,i=o.pointOnShape,c=cd(!0,!0,!1,e.get(i.curve.loop),{...i,order2:1},o,t.lastInsertId);c.holeCloserTwin=o,o.holeCloserTwin=c;const s=r.pointOnShape,u=cd(!0,!0,!1,e.get(s.curve.loop),{...r.pointOnShape,order2:-1},r.prev,t.lastInsertId);u.holeCloserTwin=r,r.holeCloserTwin=u,u.prevOnCircle=c,u.nextOnCircle=c,c.prevOnCircle=u,c.nextOnCircle=u,o.next=r,r.prev=o,u.next=c,c.prev=u}(t,l),l[0];l.forEach(n=>{void 0!==n&&k(n,t)})}const{PI:ug,atan2:fg}=Math;function lg(t,n,e,r){let o;const i=cg(t),c=n*ug/180;for(let n=0;n<e.length;n++){const s=e[n],u=ag(c,s);for(const e of u){const c=i(!1,r,e,s);if(c){const{circle:n,z:e}=c,r=sg(t,n,s,e,!1);o=o||r}if("undefined"!=typeof _debug_&&n+1===_debug_.directives.stopAfterTwoProngsNum)return}}return o}function ag(t,n){const e=[0];if(1===n.t){const{curve:r}=n,o=St(r.ps,r.next.ps);if(o.isQuiteDull){const n=Pp(o.tangents[0]),r=Pp(o.tangents[1]),i=(fg(n[1],n[0])+2*ug)%(2*ug),c=((fg(r[1],r[0])+2*ug)%(2*ug)-i+2*ug)%(2*ug);let s=t;for(;s<=c-t/2;)e.push(s),s+=t}}return e}function pg(t,n,e,r){let o;for(let i=0;i<e.length;i++){const c=lg(t,n,e[i],r);o=void 0===o?c:o}return o}function hg(t,n=.4,e=10,r=2**-16){const o=[0],i=[1];for(;;){const c=o[o.length-1],s=i[i.length-1],u=P(t,c,s),f=Ja(u),l=en(u);if(f<=e&&l<=n||s-c<=r){if(o.push(i.pop()),1===s)return o;continue}const a=(c+s)/2;i.push(a)}}function dg(t){if(t.length<4)return[];const[[n,e],[r,o],[i,c],[s,u]]=t,f=r-n,l=o-e,a=i-r-f,p=c-o-l,h=s-i-f-2*a,d=u-c-l-2*p,g=a*d-p*h,v=f*d-l*h,m=f*p-l*a;return Ce([g,v,m],0,1)?.map(t=>t.t)||[]}function gg(t,n,e){return function(r){const o=[],i=r.curves;for(let r=0;r<i.length;r++){const c=i[r],s=c.ps;if(Ja(s)<t)continue;let u=hg(s,n,e);u=2===u.length?[.5]:u,u.push(...dg(s)),u=u.filter(t=>0!==t&&1!==t);const f=u.map(t=>({curve:c,t,isSource:!0,p:Rh(c.ps,t)}));o.push(...f)}return o}}const vg=Je,mg=Ut,xg=Dn,bg=Ke,wg=tr,_g=Dn,Mg=jn,Sg=Ut,Ng=Zt;const Ig=Jn,yg=J,{abs:Eg}=Math,Og=et,Cg=Z,Tg=tt,Pg=lt;const Ag=Je,kg=Dn,Bg=jn,zg=Ut,Fg=Zt;function Yg(t){if(function(t){if(4===t.length)return 0===hu(t[0],t[1],t[2])&&0===hu(t[1],t[2],t[3])&&0===hu(t[0],t[2],t[3]);if(3===t.length)return 0===hu(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=Eg(3*r)+Eg(f)+(Eg(3*i)+Eg(l))+Eg(a);if(Eg(a)-bh*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=Eg(3*o)+Eg(h)+(Eg(3*c)+Eg(d))+Eg(g);return!(Eg(g)-bh*v>0)&&0===ct(it(yg([s],Ig(3,r)),yg([n],Ig(3,i))))&&0===ct(it(yg([u],Ig(3,o)),yg([e],Ig(3,c))))}(t)&&(t=function(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[rt(it(Tg(Pg(c/4,u/4),3),Pg(t/4,l/4))),rt(it(Tg(Pg(s/4,f/4),3),Pg(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Cg(o,e),a=Cg(i,r),p=Cg(u,c),h=Cg(f,s),d=it(Og(p,a),Og(h,l));if(0===ct(d))return;const g=Cg(c,e),v=Cg(s,r),m=rt(it(Og(v,l),Og(g,a)))/rt(d);return[c+m*rt(p),s+m*rt(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=Ag(r,n),u=Ag(i,r),f=Fg(u,s),l=Ag(o,e),a=Ag(c,o),p=Fg(a,l),h=zg(Fg(kg(n,Fg(f,[0,r])),kg(r,Fg(u,[0,r]))),Fg(kg(e,Fg(p,[0,o])),kg(o,Fg(a,[0,o]))));return[zg(Bg(f,f),Bg(p,p)),ri(h)]}(t);return{minima:[],maxima:Ce(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=qd(t),[[s,u],[f,l]]=Gd(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[xg(6,mg(vg(s,n),xg(3,vg(r,i))))],[xg(6,mg(vg(u,e),xg(3,vg(o,c))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=Mg(a,i),d=Mg(p,e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.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=Dn(n-r,t[r]);return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=ce(i,n);ct(et(ce(e,n),r))>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Ce(e,0,1)?.map(t=>t.t)||[]}}function Lg(t){return{curve:t.curve,t:t.t,isSource:!0,p:Rh(t.curve.ps,t.t)}}function Xg(t,n,e,r,o){(o&&(r>t.val||r===t.val&&e>t.t)||!o&&(r<t.val||r===t.val&&e>t.t))&&(t.curve=n,t.t=e,t.val=r)}const Hg=L(function(t){const n=[{curve:void 0,t:void 0,val:1/0},{curve:void 0,t:void 0,val:1/0}],e=[{curve:void 0,t:void 0,val:-1/0},{curve:void 0,t:void 0,val:-1/0}];return t.curves.forEach(function(t){const r=function(t){const n=G(t),e=Ce(n[0],0,1)?.map(t=>t.t)||[],r=Ce(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Ka(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Ka(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}(t.ps);for(let o=0;o<2;o++)Xg(n[o],t,r.ts[0][o],r.box[0][o],!1),Xg(e[o],t,r.ts[1][o],r.box[1][o],!0)}),{minX:Lg(n[0]),minY:Lg(n[1]),maxX:Lg(e[0]),maxY:Lg(e[1])}});function Dg(t){return Hg(t).minY}function Vg(t){const{loops:n}=t,e=n.map(Dg);let r;const o=cg(t);for(let n=1;n<e.length;n++){const i=e[n],c=o(!0,!1,0,i);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:s,z:u}=c,f=sg(t,s,i,u,!0);r=void 0===r?f:r}return r}const $g=L(function(t){let n,e,r,o,i=1/0,c=-1/0,s=1/0,u=-1/0;for(const f of t){const t=Hg(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>c&&(e=t.maxX,c=t.maxX.p[0]),t.minY.p[1]<s&&(r=t.minY,s=t.minY.p[1]),t.maxY.p[1]>u&&(o=t.maxY,u=t.maxY.p[1])}return{minX:n,minY:r,maxX:e,maxY:o}});function qg(t,n,e){const{minBezLength:r,maxCurviness:o,maxLength:i,angleIncrement:c}=e,s=wd(r),u=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(Ja(o.ps)<t)continue;const{next:i,ps:c}=o;if(St(c,i.ps).isQuiteDull){const t=c[c.length-1];e.push({curve:o,t:1,isSource:!0,p:t}),e.push({curve:i,t:0,isSource:!0,p:t})}}return e}}(r),f=gg(r,o,i),l=function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ja(o.ps)<t||e.push(...Yg(o.ps).maxima.map(t=>({curve:o,t,isSource:!0,p:Rh(o.ps,t)})))}return e}}(r),a=$g(t),p=(a.maxX.p[0]-a.minX.p[0])**2+(a.maxY.p[1]-a.minY.p[1])**2,d=t.map(s),g={id:0},v=gd(t,d,g),m=bd(t),x=(xd(),{maxCoordPowerOf2:n,squaredDiagonalLength:p,loops:t,cpTrees:v,lastInsertId:g,...m});let b;if(b=Vg(x),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return{cpNode:b,meta:x};if(function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.holeClosers+=n-md,md=n}(),b=pg(x,c,t.map(u),!1)||b,b=pg(x,c,t.map(l),!0)||b,b=pg(x,c,t.map(f),!1)||b,function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.oneAnd2Prongs+=n-md,md=n}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return{cpNode:b,meta:x};if(b=function(t,n){if(void 0===n)return;const e=new Set;let r=!0;for(;r;){r=!1;const o=new Set(h(n));for(const n of o){const{closeBysFor3Prong:i,addedCpNodes:c}=pd(t,n);c.length>0&&(r=!0),void 0===i?e.add(n):(r=!0,dd(t,i,o,e)),c.forEach(t=>t.forEach(t=>e.add(t)))}n=hd(e)}return n}(x,b),void 0===b)return;if("undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return{cpNode:b,meta:x};const w={cpNode:b,meta:x};return"undefined"!=typeof _debug_&&(_debug_.generated.timing.threeProngs+=performance.now()-md),w}const{ceil:jg,log2:Wg}=Math;function Qg(t,n){const{maxCoordinate:e}=function(t){let n=0,e=1/0,r=-1/0,o=1/0,i=-1/0;for(const c of t)for(const t of c)for(const c of t){const t=c[0],s=c[1],u=Ua(Za(t),Za(s));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),s<o&&(o=s),s>i&&(i=s)}return{maxCoordinate:n,width:r-e,height:i-o}}(t),r=jg(Wg(e)),o=function(t,n){const e={...n};for(const n in Tp){const r=n;let o=e[r];const i=Tp[r],{range:c,scaleByMaxCoordinate:s}=i;o<c[0]&&(o=c[0]),o>c[1]&&(o=c[1]),s&&(o*=2**(t-10)),e[r]=o}return e}(r,{...Cp,...n||{}}),{applySat:i,simplify:c,satScale:s,simplifyTolerance:u}=o,f=Ga(t,void 0,{forceOrientationNegative:!0}),l=[];for(const t of f){let n=qg(t,r,o);void 0!==n&&(i&&(n=Op(n,s)),c&&(n=_p(n,u,50)),l.push(n))}return l}function Rg(t){const n=function(t){let n=t;const e=Sp(t);for(;e.length;){const r=e.pop();if(r.isHoleClosing||r.isIntersection)continue;let o=r.next;for(;;){o=o.next;let e=!1;const r=o.prevOnCircle;if(v(o)>2){const n=o.nextOnCircle;kt(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(x(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(O(t.cpNode));if(n)return{cpNode:n,meta:{...t.meta,cpTrees:bp(n)}}}let Gg=0;function Ug(t){return t.map(t=>{return(n=t.pointOnShape).p[0]+", "+n.p[1]+" | bz: "+n.curve.idx+" | t: "+n.t;var n})}function Zg(t,n=3){return t[0].toFixed(n)+", "+t[1].toFixed(n)}const Jg={δToString:Ug,δsToString:function(t){return t.map(Ug)},pointToStr:Zg,pointsToStr:function(t,n=3){return t.map(t=>Zg(t,n))},nameObj:function(t,n=""){t.name=""+n+Gg++}},Kg="red thin10 nofill ",tv="http://www.w3.org/2000/svg";function nv(t,n,e=Kg,r){const o=n.center,i=n.radius,c=document.createElementNS(tv,"circle");return c.setAttributeNS(null,"cx",o[0].toString()),c.setAttributeNS(null,"cy",o[1].toString()),c.setAttributeNS(null,"r",i.toString()),c.setAttributeNS(null,"class",e),t.appendChild(c),r&&setTimeout(()=>c.remove(),r),[c]}function ev(t,n,e=3,r="red",o){const[i]=nv(t,{center:n,radius:e},"dot "+r,o);return o&&setTimeout(()=>i.remove(),o),[i]}function rv(t,n,e=Kg,r=0,o=void 0,i=0){const c=document.createElementNS(tv,"line");c.setAttributeNS(null,"x1",n[0][0].toString()),c.setAttributeNS(null,"y1",n[0][1].toString()),c.setAttributeNS(null,"x2",n[1][0].toString()),c.setAttributeNS(null,"y2",n[1][1].toString()),c.setAttributeNS(null,"class",e),t.appendChild(c);let s=[];if(void 0!==o)for(const e of n)s.push(...ev(t,e,i,o,r));for(const n of s)t.appendChild(n);const u=[c,...s];return r&&setTimeout(()=>{for(const t of u)t.remove()},r),u}function ov(t,n,e=Kg,r=3,o){const i=nv(t,{center:n,radius:r},e),c=[[n[0]-r,n[1]],[n[0]+r,n[1]]],s=[[n[0],n[1]-r],[n[0],n[1]+r]],u=rv(t,c,e),f=rv(t,s,e);return o&&setTimeout(()=>{i.forEach(t=>t.remove()),u.forEach(t=>t.remove()),f.forEach(t=>t.remove())},o),[...i,...u,...f]}function iv(t){return 2===t?"L":3===t?"Q":4===t?"C":void 0}function cv(t,n,e=Kg,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p]]=n,h=document.createElementNS(tv,"path");h.setAttributeNS(null,"d",`M${s} ${u} Q${f} ${l} ${a} ${p}`),e&&h.setAttributeNS(null,"class",e);let d=[];if(void 0!==o)for(const e of n)d.push(...ev(t,e,i,o,r));let g=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)g.push(...rv(t,[n[e],n[e+1]],c,r));const v=[h,...d,...g];for(const n of v)t.appendChild(n);return r&&setTimeout(()=>{for(const t of v)t.remove()},r),v}function sv(t,n,e=Kg,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p],[h,d]]=n;if(s===h&&f===h&&a===h&&u===d&&l===d&&p===d)return ov(t,[s,u],e,.2,r);const g=document.createElementNS(tv,"path");g.setAttributeNS(null,"d",`M${s} ${u} C${f} ${l} ${a} ${p} ${h} ${d}`),g.setAttributeNS(null,"class",e);let v=[];if(void 0!==o)for(const e of n)v.push(...ev(t,e,i,o,r));let m=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)m.push(...rv(t,[n[e],n[e+1]],c,r));const x=[g,...v,...m];for(const n of x)t.appendChild(n);return r&&setTimeout(()=>{for(const t of x)t.remove()},r),x}function uv(t,n,e=Kg,r=0,o=void 0,i=0,c=void 0){return 2===n.length?rv(t,n,e,r,o,i):3===n.length?cv(t,n,e,r,o,i,c):4===n.length?sv(t,n,e,r,o,i,c):[]}const fv=["red","green","cyan","blue"];function lv(t,n){const e=1-n;if(4===t.length){const[[r,o],[i,c],[s,u],[f,l]]=t;return[r*e**3+3*i*e**2*n+3*s*e*n**2+f*n**3,o*e**3+3*c*e**2*n+3*u*e*n**2+l*n**3]}if(3===t.length){const[[r,o],[i,c],[s,u]]=t;return[r*e**2+2*i*e*n+s*n**2,o*e**2+2*c*e*n+u*n**2]}if(2===t.length){const[[r,o],[i,c]]=t;return[r*e+i*n,o*e+c*n]}return[NaN,NaN]}function av(t,n){return 2===t.length?function(t,n){const[[e,r],[o,i]]=t,c=1-n,s=[c*e+n*o,c*r+n*i];return[[[e,r],s],[s,[o,i]]]}(t,n):3===t.length?function(t,n){const[[e,r],[o,i],[c,s]]=t,u=1-n,f=[u*u*e+2*u*n*o+n*n*c,u*u*r+2*u*n*i+n*n*s];return[[[e,r],[u*e+n*o,u*r+n*i],f],[f,[u*o+n*c,u*i+n*s],[c,s]]]}(t,n):4===t.length?function(t,n){const[[e,r],[o,i],[c,s],[u,f]]=t,l=1-n,a=n*n,p=a*n,h=l*l,d=h*l,g=[p*u+3*l*a*c+3*h*n*o+d*e,p*f+3*l*a*s+3*h*n*i+d*r];return[[[e,r],[n*o+l*e,n*i+l*r],[a*c+2*l*n*o+h*e,a*s+2*l*n*i+h*r],g],[g,[a*u+2*n*l*c+h*o,a*f+2*n*l*s+h*i],[n*u+l*c,n*f+l*s],[u,f]]]}(t,n):[]}const pv={circle:nv,crossHair:ov,dot:ev,line:rv,rect:function(t,n,e=Kg,r){const[[o,i],[c,s]]=n,u=o<c?o:c,f=i<s?i:s,l=Math.abs(o-c),a=Math.abs(i-s),p=document.createElementNS(tv,"rect");return p.setAttributeNS(null,"x",u.toString()),p.setAttributeNS(null,"y",f.toString()),p.setAttributeNS(null,"width",l.toString()),p.setAttributeNS(null,"height",a.toString()),e&&p.setAttributeNS(null,"class",e),t.appendChild(p),r&&setTimeout(()=>p.remove(),r),[p]},beziers:function(t,n,e,r){const o=void 0===e,i=[];for(let r=0;r<n.length;r++){const c=n[r],s=o?"thin5 nofill "+fv[r%fv.length]:e;i.push(...uv(t,c,s))}return r&&setTimeout(()=>i.forEach(t=>t.remove()),r),i},bezier:uv,bezierPiece:function(t,n,e,r=Kg,o){const i=e[0]===e[1]?ov(t,lv(n,e[0]),r,1.5):uv(t,function(t,n){if(0===n[0]&&1===n[1])return t;if(n[0]===n[1]){const e=lv(t,n[0]);return[e,e,e,e]}return 0===n[0]?av(t,n[1])[0]:1===n[1]?av(t,n[0])[1]:av(av(t,n[0])[1],(n[1]-n[0])/(1-n[0]))[0]}(n,e),r);return o&&setTimeout(()=>i.forEach(t=>t.remove()),o),i},quadBezier:cv,cubicBezier:sv,polygon:function(t,n,e=Kg,r){const o=document.createElementNS(tv,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},loop:function(t,n,e=Kg,r){if(!n.length)return[];const o=document.createElementNS(tv,"path");let i=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];i+=`${iv(e.length)} `;for(let t=1;t<e.length;t++)i+=`${e[t][0]} ${e[t][1]} `}return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},polyline:function(t,n,e=Kg,r){if(n.length<2)return[];const o=document.createElementNS(tv,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},text:function(t,n,e,r,o=Kg,i){const c=document.createElementNS(tv,"text");return c.setAttributeNS(null,"x",n[0].toString()),c.setAttributeNS(null,"y",n[1].toString()),c.setAttributeNS(null,"font-size",r.toString()),c.setAttributeNS(null,"class",o),c.textContent=e,t.appendChild(c),i&&setTimeout(()=>c.remove(),i),[c]}};function hv(t,n){return(n,e,r,o=0,i=1)=>{let c,s;switch(e.isHoleClosing){case!1:c="red ",s="2";break;case!0:c="cyan ",s="10"}const{pointOnShape:u}=e,{circle:f}=u,{center:l,radius:a}=f,{isSource:p,p:h}=u,d=e.nextOnCircle.pointOnShape.p,g=p?h:d,v=p?d:h,{line:m,dot:x,circle:b,crossHair:w}=pv,_=x(n,f.center,.02*i,"yellow",o);return[...b(n,f,c+"thin"+s+" nofill",o),...x(n,g,.005*i,c,o),...x(n,v,.01*i,c,o),...t?w(n,f.center,"red thin2 nofill",.002*i,o):[],..._]}}function dv(t,n){return{center:t.center,radius:n*t.radius}}const gv=["thin10 blue nofill","thin10 red nofill"];function vv(t,n,e,r=0,o=1){let i=n.cpNode;if(!i)return[];for(;!x(i);)i=i.next;const c=[];let s=0;return N(i,n=>{if(x(n))return;const e=Pt(n);e&&(c.push(...pv.bezier(t,e,gv[s%2],r)),s++)}),c}function mv(t,n,e,r){const o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttributeNS(null,"cx",n[0].toString()),o.setAttributeNS(null,"cy",n[1].toString()),o.setAttributeNS(null,"r",e.toString()+"%"),o.setAttributeNS(null,"class",r),t.appendChild(o),o}function xv(t,n,e="thin5 purple nofill",r=0,o=1){const i=[],c=[];for(const t of n){if(x(t))continue;const n=Pt(t);n&&c.push(n)}return i.push(...a(t,c,e,r)),i}const bv={oneProng:function(t,n,e,r=0,o=1){const{pointOnShape:i}=n,{circle:c}=i;return[...pv.dot(t,i.p,.02*o,"deeppink",r),...pv.dot(t,c.center,.01*o,"deeppink",r),...pv.circle(t,c,"deeppink thin5 nofill",r)]},twoProng:hv(!1),threeProng:function(t,n,e,r=0,o=1){const i=dv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=pv,p=l(t,i,"blue thin2 nofill",r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...pv.line(t,[e,c],"thin5 red",r))}const g=a(t,i.center,"red thin2 nofill",.02*o,r);return[...h,...d,...p,...g]},boundingHull:function(t,n,e="thin5 black nofill",r=0,o=1){return pv.polygon(t,n,e,r)},looseBoundingBox:function(t,n,e="thin5 brown nofill",r=0,o=1){const[[i,c],[s,u]]=n;return n=[[i,c],[s,c],[s,u],[i,u]],pv.polygon(t,n,e,r)},tightBoundingBox:function(t,n,e="thin5 pinker nofill",r=0,o=1){return pv.polygon(t,n,"thin5 pinker nofill",r)},vertex:function(t,n,e,r=0,o=1){const i=n.pointOnShape.circle;let c=[];return c=[...pv.dot(t,i.center,.01*o,"darkgreen",r)],c},mat:vv,maxVertex:function(t,n){const e=n.pointOnShape.circle;return pv.circle(t,e,"brown thin10 nofill")},leaves:function(t,n,e="thin10 deeppink nofill",r=0,o=1){const i=[],{line:c,dot:s,circle:u}=pv;for(const f of n){const n=f.pointOnShape,{circle:l}=n,{center:a,radius:p}=l,h=[mv(t,a,.5,"pinker thin5 nofill")],d=m(f).map(t=>t.pointOnShape),g=[],v=[];for(let n=0;n<d.length;n++){const e=d[n].p;v.push(...s(t,e,.01*(n+1)*o,"pinker",r)),g.push(...c(t,[e,a],"thin5 red",r))}const x=u(t,l,e,r);i.push(...x,...v,...g,...h)}return i},cull:function(t,n,e="thin10 cyan nofill",r=0,o=1){const i=[];return i.push(...pv.crossHair(t,n,e,.1*o,r)),i},cpNode:function(t,n,e="blue thin2 nofill",r=0,o=1){const i=dv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=pv,p=l(t,i,e,r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...pv.line(t,[e,c],"thin5 red",r))}const g=a(t,c,"orange thin10 nofill",2*o,r);return[...h,...d,...p,...g]},branch:xv,holeCloser:hv(!1)},wv={...bv,twoProng:hv(!0)};function _v(t){if(!t)return void(window._debug_=void 0);let n=window._debug_;n={...n,generated:{...n&&n.generated?n.generated:{},elems:{...n&&n.generated&&n.generated.elems?n.generated.elems:{},oneProng:[],twoProng:[],looseBoundingBox:[],tightBoundingBox:[],vertex:[],threeProng:[],boundingHull:[],mat:[],cpNode:[],maxVertex:[],leaves:[]},timing:{...n&&n.generated&&n.generated.timing?n.generated.timing:{},holeClosers:0,oneAnd2Prongs:0,threeProngs:0,sats:0,simplifyMat:0}},fs:{...n&&n.fs?n.fs:{},drawElem:{...n&&n.fs&&n.fs.drawElem?n.fs.drawElem:{},...bv},...Jg},directives:{...n&&n.directives?n.directives:{},stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}const Mv={oneProng:[],twoProng:[],threeProng:[],looseBoundingBox:[],tightBoundingBox:[],boundingHull:[],vertex:[],mat:[],maxVertex:[],leaves:[],cull:[],cpNode:[],branch:[],holeCloser:[]},Sv=Object.keys(Mv);function Nv(t,n,e,r){const o=[];for(const r of t)o.push({type:0,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(Iv);const i=new Set,c=[];for(const t of o){const{item:n}=t;if(0===t.type){for(const t of i.values())r(n,t)&&c.push([n,t]);i.add(n)}else 1===t.type&&i.delete(t.item)}return c}function Iv(t,n){const e=t.x-n.x;return 0!==e?e:0===t.type?-1:1}const yv=1e-4;function Ev(t,n){const e=t.pointOnShape,r=n.pointOnShape;let{curve:o,p:i,t:c}=e,{curve:s,p:u,t:f}=r;if(i[0]===u[0]&&i[1]===u[1])return[i];1===c&&(c=0,o=o.next),0===f&&(f=1,s=s.prev);const{ps:l}=o,{ps:a}=s,p=[i,j(i)(W(U(l,c)))],h=[u,j(u)(W(U(a,f)))],d=X(p,h),g=H(i,u);let v;if(d){const t=H(i,d),n=H(u,d);v=D(t,g)<0||D(n,g)>0}else v=!0;if(!v)return[i,d,u];const m=H(p[0],p[1]),x=H(h[0],h[1]),b=Math.abs($(g,m))/9,w=Math.abs($(g,x))/9;return b>.01||w>.01||b>yv||w>yv?void 0:[i,u]}const Ov=L(function(t){return pn(Pt(t))});function Cv(t,n){const e=function(t){const n=new Map;for(let e of t)for(let r of t){const t=e.pointOnShape.circle.center,o=r.pointOnShape.circle.center,i=e.pointOnShape.p,c=r.pointOnShape.p;r!==e&&t[0]===o[0]&&t[1]===o[1]&&i[0]===c[0]&&i[1]===c[1]&&n.set(e,r)}return n}(n),r=t.length,o=[];for(let n=0;n<r;n++){const i=t[n],c=[];for(let o=0;o<r;o++){const r=t[o];if(n===o){c.push(0);continue}let s=1/0;for(const t of m(i)){let n=Ov(t),o=t.next;for(;!kt(o,r);)if(o.isHoleClosing)o=Tv(e,o);else{if(Mn(o)){n=1/0;break}n+=Ov(o),o=o.next}n<s&&(s=n)}c.push(s)}o.push(c)}return o}function Tv(t,n){return t.get(n).next}export{wn as CpNodeFs,e as beziersToSvgPathStr,O as clone,bn as cpNodeComparator,gd as createInitialCpTree,Sv as debugElemNames,a as drawBeziersAsSinglePath,xv as drawBranch,bv as drawElemFs,wv as drawElemFsDetailed,vv as drawMat,Mv as emptyDebugElems,_v as enableDebugForMat,M as enhanceCpNode,cg as find2Prong,Vg as findAndAddHoleClosing2Prongs,Qg as findMats,p as floydWarshall,m as getAllOnCircle,h as getAllOnLoop,mn as getAllVertices,T as getBoundaryBezierPartsToNext,hn as getBoundaryBeziersBetween,A as getBoundaryBeziersToNext,rd as getBoundaryPieceBeziers,Yt as getBranch,Lt as getBranchBeziers,vp as getBranches,z as getChildren,Gh as getCloseBoundaryPointsCertified,Dh as getClosestSquareDistanceToRect,Et as getEdgeDirection,At as getFirstExit,gg as getFor2ProngsOnLoop,Cv as getGraph,d as getHoleClosers,Ev as getImpliedBoundaryBezierBetween,vn as getInitialDegAngleBetweenMatCurves,Tt as getMatCurveBetween,Pt as getMatCurveToNext,gn as getMatCurvesBetween,bd as getPartialMeta,l as getPathsFromStr,xd as getPointToCpNode,Lh as getPotentialClosestPointsOnCurveCertified,v as getProngCount,b as getRealProngCount,dn as getSalience,Ep as getSatCulls,$g as getShapeBounds,wd as getSharpCornersOnLoop,I as getVertexForwardChildren,w as isFullyTerminating,kt as isOnSameCircle,Bt as isOneProng,_ as isSharp,x as isTerminating,Ft as isTrivial,zt as isTwoProng,Mn as isVertexSpecial,t as loopFromBeziers,B as removeVertex,dv as scaleCircle,_p as simplifyMat,Nv as sweepLine,Op as toScaleAxis,S as traverseCp,N as traverseEdges,y as traverseVertices,Rg as trimMat};
|
|
1
|
+
function t(t=[],e){const r=[],o={beziers:t,curves:r,idx:e};if(0===t.length)return o;let i,c=0;for(let e=0;e<t.length;e++){if(n(t[e]))continue;const s={loop:o,ps:t[e],prev:i,next:void 0,idx:c};i&&(i.next=s),i=s,r.push(s),c++}const s=r[r.length-1];return r[0].prev=s,s.next=r[0],s.ps[s.ps.length-1]=r[0].ps[0],o}function n(t){return 2===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]:3===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]:t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]&&t[2][1]===t[3][1]&&t[2][1]===t[3][1]}function e(t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];0===e&&n.push("M "+r[0][0].toString()+" "+r[0][1].toString()),4===r.length?n.push("C "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "+r[3][0].toString()+" "+r[3][1].toString()+" "):3===r.length?n.push("Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "):2===r.length&&n.push("L "+r[1][0].toString()+" "+r[1][1].toString()+" ")}return n.push(" z"),n.join("\n")}class r{initialPoint=void 0;p;vals=void 0;prev2ndCubicControlPoint=void 0;prev2ndQuadraticControlPoint=void 0;constructor(){this.p=[0,0]}}function o(t){const n=[t.p,t.initialPoint];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n}function i(t){t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0;const n=(e=t.p,t.vals[0],t.vals[1],t.vals[2],t.vals[3],t.vals[4],[[e,[t.vals[5],t.vals[6]]]]);var e;const r=n[n.length-1];return t.p=r[r.length-1],n}const c={c:function(t){const n=[t.p,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]],[t.vals[4],t.vals[5]]];return t.prev2ndCubicControlPoint=n[2],t.prev2ndQuadraticControlPoint=void 0,n},h:function(t){const n=[t.p,[t.vals[0],t.p[1]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},l:function(t){const n=[t.p,t.vals];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},q:function(t){const n=[t.vals[0],t.vals[1]],e=[t.vals[2],t.vals[3]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},s:function(t){const n=t.prev2ndCubicControlPoint?[t.p[0]-t.prev2ndCubicControlPoint[0]+t.p[0],t.p[1]-t.prev2ndCubicControlPoint[1]+t.p[1]]:t.p,e=[t.p,n,[t.vals[0],t.vals[1]],[t.vals[2],t.vals[3]]];return t.prev2ndCubicControlPoint=e[2],t.prev2ndQuadraticControlPoint=void 0,e},t:function(t){const n=t.prev2ndQuadraticControlPoint?[t.p[0]-t.prev2ndQuadraticControlPoint[0]+t.p[0],t.p[1]-t.prev2ndQuadraticControlPoint[1]+t.p[1]]:t.p,e=[t.vals[0],t.vals[1]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=n,[t.p,n,e]},v:function(t){const n=[t.p,[t.p[0],t.vals[0]]];return t.prev2ndCubicControlPoint=void 0,t.prev2ndQuadraticControlPoint=void 0,n},z:o};function s(t){let n=0,e=0,r=1,o=0,i=1,c=1;const s=t._currentIndex;t._skipOptionalSpaces();let u=t._currentIndex;u<t._endIndex&&"+"===t._string[u]?(t._currentIndex+=1,u+=1):u<t._endIndex&&"-"===t._string[u]&&(t._currentIndex+=1,u+=1,i=-1);const f=t._string[u];if(u===t._endIndex||(f<"0"||f>"9")&&"."!==f)throw new Error(`The first character of a number must be one of [0-9+-.]. Found '${f}' at index ${u}.`);const l=t._currentIndex;for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)t._currentIndex+=1,u+=1;if(u!==l){let n=u-1,r=1;for(;n>=l;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(u<t._endIndex&&"."===t._string[u]){if(t._currentIndex+=1,u+=1,u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be a least one digit following the .");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)r*=10,o+=Number(t._string.charAt(u))/r,t._currentIndex+=1,u+=1}if(u!==s&&u+1<t._endIndex&&("e"===t._string[u]||"E"===t._string[u])&&"x"!==t._string[u+1]&&"m"!==t._string[u+1]){if(t._currentIndex+=1,u+=1,"+"===t._string[u]?(t._currentIndex+=1,u+=1):"-"===t._string[u]&&(t._currentIndex+=1,u+=1,c=-1),u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be an exponent.");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)n*=10,n+=Number(t._string[u]),t._currentIndex+=1,u+=1}let a=e+o;if(a*=i,n&&(a*=Math.pow(10,c*n)),s===u)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),a}const u={Z:"Z",M:"M",L:"L",C:"C",Q:"Q",A:"A",H:"H",V:"V",S:"S",T:"T",z:"Z",m:"m",l:"l",c:"c",q:"q",a:"a",h:"h",v:"v",s:"s",t:"t"};class f{_string;_currentIndex;_endIndex;_prevCommand;constructor(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._prevCommand=void 0,this._skipOptionalSpaces()}parseSegment(){const t=this._string[this._currentIndex];let n,e=u[t];if(void 0===e){if(void 0===this._prevCommand)throw new Error("Implicit command not allowed for first commands.");if(!("+"===t||"-"===t||"."===t||t>="0"&&t<="9")||"Z"===this._prevCommand)throw new Error("Remaining coordinates not found for implicit command");e="M"===this._prevCommand?"L":"m"===this._prevCommand?"l":this._prevCommand}else this._currentIndex+=1;this._prevCommand=e;const r=e.toUpperCase();if("H"===r||"V"===r?n=[s(this)]:"M"===r||"L"===r||"T"===r?n=[s(this),s(this)]:"S"===r||"Q"===r?n=[s(this),s(this),s(this),s(this)]:"C"===r?n=[s(this),s(this),s(this),s(this),s(this),s(this)]:"A"===r?n=[s(this),s(this),s(this),this._parseArcFlag(),this._parseArcFlag(),s(this),s(this)]:"Z"===r&&(this._skipOptionalSpaces(),n=[]),void 0===n)throw new Error("Unknown command");return{type:e,values:n}}hasMoreData(){return this._currentIndex<this._endIndex}initialCommandIsMoveTo(){if(!this.hasMoreData())return!0;const t=u[this._string[this._currentIndex]];return"M"===t||"m"===t}_isCurrentSpace(){const t=this._string[this._currentIndex];return t<=" "&&(" "===t||"\n"===t||"\t"===t||"\r"===t||"\f"===t)}_skipOptionalSpaces(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex+=1;return this._currentIndex<this._endIndex}_skipOptionalSpacesOrDelimiter(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!==this._string[this._currentIndex])&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","===this._string[this._currentIndex]&&(this._currentIndex+=1,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)}_parseArcFlag(){if(this._currentIndex>=this._endIndex)throw new Error("Unable to parse arc flag");let t;const n=this._string[this._currentIndex];if(this._currentIndex+=1,"0"===n)t=0;else{if("1"!==n)throw new Error("Unable to parse arc flag - arc flag must be 0 or 1");t=1}return this._skipOptionalSpacesOrDelimiter(),t}}function l(t){return function(t){if(0===t.length)return[];if("m"!==t[0].type.toLowerCase())throw new Error("Invalid SVG - every new path must start with an M or m.");const n=new r,e=[];let s,u=[];for(let r=0;r<t.length;r++){const f=t[r],l=f.type.toLowerCase();if(n.vals=f.values,f.type===l)if("v"===l)n.vals[0]+=n.p[1];else if("a"===l)n.vals[5]+=n.p[0],n.vals[6]+=n.p[1];else for(let t=0;t<n.vals.length;t++)n.vals[t]+=n.p[t%2];if("m"!==l){if("a"===l)u.push(...i(n));else{const t=c[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}s=l}else u.length&&("z"!==s&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,s=l}return u.length>0&&("z"!==s&&u.push(o(n)),e.push(u)),e}(function(t){if(!t.length)return[];const n=new f(t),e=[];if(!n.initialCommandIsMoveTo())throw new Error("Path must start with m or M");for(;n.hasMoreData();)e.push(n.parseSegment());return e}(t))}function a(t,n,e="thin10 red nofill",r=0){if(0===n.length)return[];let o=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];if(e.length<=1)continue;const[,r,i,c]=e;o+=2===e.length?`L ${r[0]} ${r[1]} `:3===e.length?`Q ${r[0]} ${r[1]} ${i[0]} ${i[1]} `:`C ${r[0]} ${r[1]} ${i[0]} ${i[1]} ${c[0]} ${c[1]} `}const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d",o),i.setAttributeNS(null,"class",e),t.appendChild(i),[i]}function p(t){const n=t.length,e=Array.from(Array(n),()=>new Array(n).fill(0));for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t[r][o];for(let t=0;t<n;t++)for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][t]+e[t][o]<e[r][o]&&(e[r][o]=e[r][t]+e[t][o]);return e}function h(t){const n=t,e=[];do{e.push(t),t=t.next}while(t!==n);return e}function d(t){return h(t).filter(t=>t.isHoleClosing)}function g(t){const n=t.pointOnShape;return{idx:n.curve.idx,t:n.t,order:n.order,order2:n.order2}}function v(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function m(t,n=!1){const e=t,r=n?[]:[t];let o=t.nextOnCircle;for(;o!==e;)r.push(o),o=o.nextOnCircle;return r}function x(t){return t===t.next.prevOnCircle}function b(t){return m(t).filter(t=>!x(t)).length}function w(t){return m(t.prevOnCircle,!0).every(x)}function _(t){return 0===t.pointOnShape.circle.radius}function M(t){const n=t.pointOnShape,e=n.curve;return{...t,pos:n,p:n.p,t:n.t,isTerminating:x(t),isFullyTerminating:w(t),isSharp:_(t),prongCount:v(t),getRealProngCount:b(t),ordering:g(t),curve:e,loop:e.loop}}function S(t){let n=t;if(x(n))return[n];const e=[];do{e.push(n);const t=n.next.prevOnCircle;n=n=n===t?n.next.next:t}while(n!==t);return e}function I(t,n){const e=h(t),r=new Set;for(t of e)x(t)||r.has(t.next.prevOnCircle)||n(t),r.add(t)}function N(t){const n=[],e=t;let r=e;for(;r!==e.prevOnCircle;)x(r)||n.push(r.next),r=r.nextOnCircle;return n}function y(t,n){n(t);const e=m(t).filter(t=>!x(t)).map(t=>t.next);for(const t of e){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...N(t))}}}const C=["prev","next","prevOnCircle","nextOnCircle","holeCloserTwin"];function O(t){const n=new Map,e=E(t);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of C){const i=t[o];if(void 0===i)continue;let c=n.get(i);c||(c=E(i),n.set(i,c),r.push({cpNode:i,newCpNode:c})),e[o]=c}}return e}function E(t){return{...t,prev:void 0,next:void 0,prevOnCircle:void 0,nextOnCircle:void 0,holeCloserTwin:void 0}}function T(t){const n=t,e=t.next,r=n.pointOnShape,o=e.pointOnShape,i=r.curve,c=o.curve;if(i.loop!==c.loop)return[];const s=[];return c===i?s.push({ps:r.curve.ps,ts:[r.t,o.t]}):(s.push({ps:r.curve.ps,ts:[r.t,1]}),function(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({ps:o.ps,ts:[0,n]})}while(o!==e)}(s,r.curve,o.curve,o.t)),s}function A(t,n,e){if(4===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,I=u-l,N=p-l,y=I+N,C=n*I,O=e*I,E=c[1]-u-3*N;return[[d*S+(3*n*(n*w-x)+s),d*E+(3*n*(n*y-I)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*E+2*y)+(h*y+u-(O+2*C))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*E+2*y)+(g*y+u-(2*O+C))],[v*S+(3*e*(e*w-x)+s),v*E+(3*e*(e*y-I)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return function(t,n,e){return 0===n?1===e?t:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[e,[n*(r[0]-o)+o,n*(r[1]-i)+i]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function P(t){return T(t).map(t=>A(t.ps,t.ts[0],t.ts[1]))}function k(t,n){const{cpTrees:e}=n,r=t.prev,o=t.next;r.next=o,o.prev=r,e.get(t.pointOnShape.curve.loop).remove(t,!1)}function B(t,n){const e=v(t);if(2!==e)throw new Error(`Cannot delete \`CpNode\` on ${e}-prong`);m(t).forEach(t=>k(t,n))}function z(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function F(t,n,e){if(void 0===t.size||void 0===e)return;const r=e[n];if(t.size>r&&void 0!==r)for(const[n]of t){t.delete(n);break}}const L=[function(t,n){let e,r=!1;return function(){return r||(e=t(),r=!0),e}},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t){return"object"!=typeof t&&"function"!=typeof t||null===t?o:r}const c=function(r){let c;const s=i(r);return s.has(r)?(e&&console.log("cache hit"),c=s.get(r)):(e&&console.log("cache miss"),c=t(r),s.set(r,c),F(o,0,n)),c};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e){const r=i(e);r.set(e,t),F(r,1,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o){const i=("object"==typeof o||"function"==typeof o)&&null!==o;let c="object"!=typeof t&&"function"!=typeof t||null===t?r:e,s=c.get(t);return void 0===s&&(s={weakMap:new WeakMap,map:new Map},c.set(t,s),F(c,0,n)),i?s.weakMap:s.map}function i(e,r){const i=o(e,r);let c;return i.has(r)?c=i.get(r):(c=t(e,r),i.set(r,c),F(i,1,n)),c}return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r){const i=o(e,r);i.set(r,t),F(i,1,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i){const c=("object"==typeof o||"function"==typeof o)&&null!==o,s=("object"==typeof i||"function"==typeof i)&&null!==i;let u="object"!=typeof t&&"function"!=typeof t||null===t?r:e,f=u.get(t);void 0===f&&(f={weakMap:new WeakMap,map:new Map},u.set(t,f),F(u,0,n));const l=c?f.weakMap:f.map;let a=l.get(o);return void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(o,a),F(l,1,n)),s?a.weakMap:a.map}const i=function(e,r,i){const c=o(e,r,i);let s;return c.has(i)?s=c.get(i):(s=t(e,r,i),c.set(i,s),F(c,2,n)),s};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i){const c=o(e,r,i);c.set(i,t),F(c,2,n)},i},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t,e,i,c){const s=("object"==typeof e||"function"==typeof e)&&null!==e,u=("object"==typeof i||"function"==typeof i)&&null!==i,f=("object"==typeof c||"function"==typeof c)&&null!==c;let l="object"!=typeof t&&"function"!=typeof t||null===t?o:r,a=l.get(t);void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(t,a),F(l,0,n));const p=s?a.weakMap:a.map;let h=p.get(e);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(e,h),F(p,1,n));const d=u?h.weakMap:h.map;let g=d.get(i);return void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(i,g),F(d,2,n)),f?g.weakMap:g.map}const c=function(r,o,c,s){const u=i(r,o,c,s);let f;return u.has(s)?(e&&console.log("cache hit"),f=u.get(s)):(e&&console.log("cache miss"),f=t(r,o,c,s),u.set(s,f),F(u,3,n)),f};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,r,o,c){const s=i(e,r,o,c);s.set(c,t),F(s,3,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s){const u=("object"==typeof o||"function"==typeof o)&&null!==o,f=("object"==typeof i||"function"==typeof i)&&null!==i,l=("object"==typeof c||"function"==typeof c)&&null!==c,a=("object"==typeof s||"function"==typeof s)&&null!==s;let p="object"!=typeof t&&"function"!=typeof t||null===t?r:e,h=p.get(t);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(t,h),F(p,0,n));const d=u?h.weakMap:h.map;let g=d.get(o);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(o,g),F(d,1,n));const v=f?g.weakMap:g.map;let m=v.get(i);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(i,m),F(v,2,n));const x=l?m.weakMap:m.map;let b=x.get(c);return void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(c,b),F(x,3,n)),a?b.weakMap:b.map}const i=function(e,r,i,c,s){const u=o(e,r,i,c,s);let f;return u.has(s)?f=u.get(s):(f=t(e,r,i,c,s),u.set(s,f),F(u,4,n)),f};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s){const u=o(e,r,i,c,s);u.set(s,t),F(u,4,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u){const f=("object"==typeof o||"function"==typeof o)&&null!==o,l=("object"==typeof i||"function"==typeof i)&&null!==i,a=("object"==typeof c||"function"==typeof c)&&null!==c,p=("object"==typeof s||"function"==typeof s)&&null!==s,h=("object"==typeof u||"function"==typeof u)&&null!==u;let d="object"!=typeof t&&"function"!=typeof t||null===t?r:e,g=d.get(t);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(t,g),F(d,0,n));const v=f?g.weakMap:g.map;let m=v.get(o);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(o,m),F(v,1,n));const x=l?m.weakMap:m.map;let b=x.get(i);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(i,b),F(x,2,n));const w=a?b.weakMap:b.map;let _=w.get(c);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(c,_),F(w,3,n));const M=p?_.weakMap:_.map;let S=M.get(s);return void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(s,S),F(M,4,n)),h?S.weakMap:S.map}const i=function(e,r,i,c,s,u){const f=o(e,r,i,c,s,u);let l;return f.has(u)?l=f.get(u):(l=t(e,r,i,c,s,u),f.set(u,l),F(f,5,n)),l};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u){const f=o(e,r,i,c,s,u);f.set(u,t),F(f,5,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f){const l=("object"==typeof o||"function"==typeof o)&&null!==o,a=("object"==typeof i||"function"==typeof i)&&null!==i,p=("object"==typeof c||"function"==typeof c)&&null!==c,h=("object"==typeof s||"function"==typeof s)&&null!==s,d=("object"==typeof u||"function"==typeof u)&&null!==u,g=("object"==typeof f||"function"==typeof f)&&null!==f;let v="object"!=typeof t&&"function"!=typeof t||null===t?r:e,m=v.get(t);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(t,m),F(v,0,n));const x=l?m.weakMap:m.map;let b=x.get(o);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(o,b),F(x,1,n));const w=a?b.weakMap:b.map;let _=w.get(i);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(i,_),F(w,2,n));const M=p?_.weakMap:_.map;let S=M.get(c);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(c,S),F(M,3,n));const I=h?S.weakMap:S.map;let N=I.get(s);void 0===N&&(N={weakMap:new WeakMap,map:new Map},I.set(s,N),F(I,4,n));const y=d?N.weakMap:N.map;let C=y.get(u);return void 0===C&&(C={weakMap:new WeakMap,map:new Map},y.set(u,C),F(y,5,n)),g?C.weakMap:C.map}const i=function(e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);let a;return l.has(f)?a=l.get(f):(a=t(e,r,i,c,s,u,f),l.set(f,a),F(l,6,n)),a};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);l.set(f,t),F(l,6,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f,l){const a=("object"==typeof o||"function"==typeof o)&&null!==o,p=("object"==typeof i||"function"==typeof i)&&null!==i,h=("object"==typeof c||"function"==typeof c)&&null!==c,d=("object"==typeof s||"function"==typeof s)&&null!==s,g=("object"==typeof u||"function"==typeof u)&&null!==u,v=("object"==typeof f||"function"==typeof f)&&null!==f,m=("object"==typeof l||"function"==typeof l)&&null!==l;let x="object"!=typeof t&&"function"!=typeof t||null===t?r:e,b=x.get(t);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(t,b),F(x,0,n));const w=a?b.weakMap:b.map;let _=w.get(o);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(o,_),F(w,1,n));const M=p?_.weakMap:_.map;let S=M.get(i);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(i,S),F(M,2,n));const I=h?S.weakMap:S.map;let N=I.get(c);void 0===N&&(N={weakMap:new WeakMap,map:new Map},I.set(c,N),F(I,3,n));const y=d?N.weakMap:N.map;let C=y.get(s);void 0===C&&(C={weakMap:new WeakMap,map:new Map},y.set(s,C),F(y,4,n));const O=g?C.weakMap:C.map;let E=O.get(u);void 0===E&&(E={weakMap:new WeakMap,map:new Map},O.set(u,E),F(O,5,n));const T=v?E.weakMap:E.map;let A=T.get(f);return void 0===A&&(A={weakMap:new WeakMap,map:new Map},T.set(f,A),F(T,6,n)),m?A.weakMap:A.map}const i=function(e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);let p;return a.has(l)?p=a.get(l):(p=t(e,r,i,c,s,u,f,l),a.set(l,p),F(a,7,n)),p};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);a.set(l,t),F(a,7,n)},i}];function Y(t,n,e=!1){const r=t.length;if(r>8)throw new Error("A maximum of 8 formal parameters are supported");return(0,L[r])(t,n,e)}function H(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=o-e,a=i-r,p=u-c,h=f-s,d=p*a-h*l;if(0===d)return;const g=((s-r)*l-(c-e)*a)/d;return[c+g*p,s+g*h]}function X(t,n){return[n[0]-t[0],n[1]-t[1]]}function $(t,n){return t[0]*n[0]+t[1]*n[1]}function V(t){return[-t[1],t[0]]}function D(t,n){return t[0]*n[1]-t[1]*n[0]}function q(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function j(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function W(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function Q(t,n,e){function r(e){return[e[0]*n-e[1]*t,e[0]*t+e[1]*n]}return void 0===e?r:r(e)}function R(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function G(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+e-2*o),2*(o-e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n],[o-e]]}(t);if(1===t.length)return[[0],[0]];throw new Error("The bezier curve must be of order <= 3.")}function U(t,n){const[e,r]=G(t);return[R(e,n),R(r,n)]}function Z(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function J(t,n){const e=t.length,r=n.length;let o=0,i=0;const c=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(c.push(t[o]),o++):(c.push(n[i]),i++):i++:o++;for(;o<e;)c.push(t[o]),o++;for(;i<r;)c.push(n[i]),i++;if(0===c.length)return[0];const s=c.length;if(1===s)return c;const u=[],f=c[1],l=c[0];let a=f+l;const p=l-(a-f);0!==p&&u.push(p),i=0;for(let t=2;t<s;t++){const n=c[t],e=a+n,r=e-a,o=a-(e-r)+(n-r);0!==o&&u.push(o),a=e}return 0===a&&0!==u.length||u.push(a),u}const K=134217729;function tt(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const c=K*o,s=c-(c-o),u=o-s,f=K*n,l=f-(f-n),a=n-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=t[o],c=e*n,s=K*e,u=s-(s-e),f=e-u,l=K*n,a=l-(l-n),h=n-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function nt(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const c=K*o,s=c-(c-o),u=o-s,f=K*t,l=f-(f-t),a=t-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=n[o],c=e*t,s=K*e,u=s-(s-e),f=e-u,l=K*t,a=l-(l-t),h=t-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function et(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(e,tt(n,t[r]));return e}function rt(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function ot(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}function it(t,n){return J(t,ot(n))}function ct(t){return t[t.length-1]}const st=Z,ut=nt;function ft(t){if(4===t.length){const[[n,e],[r,o]]=t;return[ut(3,st(r,n)),ut(3,st(o,e))]}if(3===t.length){const[[n,e],[r,o]]=t;return[st(2*r,2*n),st(2*o,2*e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[st(r,n),st(o,e)]}if(1===t.length)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function lt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}function at(t,n){const e=t.length;let r=n;const o=[];for(let n=0;n<e;n++){const e=t[n],i=r+e,c=i-r,s=r-(i-c)+(e-c);0!==s&&o.push(s),r=i}return 0===r&&0!==o.length||o.push(r),o}const pt=lt,ht=nt,dt=at;function gt(t){if(4===t.length){const[[n,e],[r,o],[i,c]]=t;return[ht(6,dt(pt(i,n),-2*r)),ht(6,dt(pt(c,e),-2*o))]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[dt(pt(2*i,2*n),-4*r),dt(pt(2*c,2*e),-4*o)]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3")}const vt=Z,mt=nt,xt=J;function bt(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[mt(6,xt(vt(s,n),mt(3,vt(r,i))))],[mt(6,xt(vt(u,e),mt(3,vt(o,c))))]]}if(t.length<=3)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}const{sign:wt}=Math;function _t(t,n){const[e,r]=ft(t),[o,i]=gt(t),[c,s]=ft(n),[u,f]=gt(n),l=it(et(e,i),et(r,o)),a=it(et(c,f),et(s,u)),p=ct(l),h=ct(a);if(wt(p)!==wt(h))return p-h;const d=J(et(c,c),et(s,s)),g=J(et(e,e),et(r,r)),v=et(d,d),m=et(v,d),x=et(g,g),b=et(x,g);if(0!==p||0!==h){const t=et(l,l),n=et(a,a),e=ct(it(et(t,m),et(n,b)));if(0!==e)return p>0?e:-e}const[[w],[_]]=bt(t),[[M],[S]]=bt(n),I=it(et(e,_),et(r,w)),N=J(et(e,o),et(r,i)),y=it(et(c,S),et(s,M)),C=J(et(c,u),et(s,f)),O=it(et(g,I),tt(et(l,N),3)),E=it(et(d,y),tt(et(a,C),3)),T=ct(O),A=ct(E);if(T!==A)return T-A;if(0===T&&0===A)return 0;const P=et(O,O),k=et(v,m),B=et(E,E),z=et(x,b),F=ct(it(et(P,k),et(B,z)));return T>0?F:-F}function Mt(t,n){return t[0]===n[0]&&t[1]===n[1]}function St(t,n){const{ccw:e,tangentI:r,tangentO:o,dotTangents:i}=function(t,n){const e=t.length;let r=t[e-2],o=n[0],i=n[1];Mt(r,o)&&(r=t[e-3]),Mt(o,i)&&(i=n[2]);const c=function(t,n,e){const r=Z(t[0],e[0]),o=Z(n[1],e[1]),i=Z(t[1],e[1]),c=Z(n[0],e[0]);return rt(J(et(r,o),ot(et(i,c))))}(r,o,i),s=[Z(o[0],r[0]),Z(o[1],r[1])],u=[Z(i[0],o[0]),Z(i[1],o[1])],f=function(t,n){return rt(J(et(t[0],n[0]),et(t[1],n[1])))}(s,u);return 0!==c||f>0?{ccw:c,tangentI:s,tangentO:u,dotTangents:f}:{ccw:_t(t.slice().reverse(),n),tangentI:s,tangentO:u,dotTangents:f}}(t,n),c=e<0,s=e>0,u=[W(r.map(t=>t[1])),W(o.map(t=>t[1]))],f=D(u[0],u[1]);let l,a;return i>0?(l=f<-.0698,a=f>.0698):(l=c,a=s),{tangents:u,isSharp:c,isDull:s,isQuiteSharp:l,isQuiteDull:a}}const It=Y(function(t){const{t:n,curve:e}=t;return St(1===n?e.ps:e.prev.ps,1===n?e.next.ps:e.ps)});function Nt(t){return 0===t.t||1===t.t}function yt(t){return!!Nt(t)&&It(t).isSharp}function Ct(t){const n=t.pointOnShape.circle.center,e=t,r=t.nextOnCircle,o=e.pointOnShape,i=r.pointOnShape,c=o.p,s=i.p;let u;if(yt(o)){let t,n;0===o.t?(t=o.curve,n=o.curve.prev):1===o.t&&(t=o.curve.next,n=o.curve);const e=W(U(t.ps,0)),r=[-(f=W(U(n.ps,1)))[0],-f[1]],i=$(e,r),c=Math.sqrt((1+i)/2);u=Q(Math.sqrt((1-i)/2),c,r)}else u=c[0]===s[0]&&c[1]===s[1]?X(c,n):V(X(c,s));var f;return[n,j(W(u),n)]}const{abs:Ot}=Math,Et=1e-4;function Tt(t,n){const e=t.pointOnShape.circle.center,r=Ct(t),o=n.pointOnShape.circle.center,i=Ct(n.prevOnCircle),c=H(r,i),s=X(e,o);let u;if(c){const t=X(e,c),n=X(o,c);u=$(t,s)<0||$(n,s)>0}else u=!0;if(!u)return[e,c,o];const f=V(s),l=X(r[0],r[1]),a=X(i[0],i[1]),p=Ot(D(s,l))/9,h=Ot(D(s,a))/9;if(p>.01||h>.01)return[e,o];if(p>Et||h>Et){const t=q(e,o,1/3),n=q(e,o,2/3),c=j(f,t),s=[n,j(f,n)];return[e,H(r,[t,c]),H(i,s),o]}return[e,o]}function At(t){return Tt(t,t.next)}function Pt(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function kt(t,n){return m(t).indexOf(n)>=0}function Bt(t){return 1===b(t)&&!t.isHoleClosing}function zt(t){return 2===b(t)}function Ft(t){return m(t).every(x)}function Lt(t){if(Ft(t))return[];for(;x(t);)t=t.nextOnCircle;for(t=t.next;2===b(t);)t=t.next;t=t.prevOnCircle;const n=[];do{n.push(t),t=t.next}while(!w(t)&&2===b(t));return n}function Yt(t){return Lt(t).map(t=>At(t))}function Ht(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function Xt(t,n){const[e,r]=t,[[o,i],[c,s]]=n;return Ht([o+e*(c-o),i+e*(s-i)],[o+r*(c-o),i+r*(s-i)])}function $t(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=Vt[e],[i,c]=n;let s=0;const u=(c-i)/2,f=(c+i)/2;for(let n=0;n<=e-1;n++)s+=r[n]*t(u*o[n]+f);return u*s}Y(At);const Vt={2:{weights:[1,1],abscissas:[-.5773502691896257,.5773502691896257]},4:{weights:[.6521451548625461,.6521451548625461,.3478548451374538,.3478548451374538],abscissas:[-.3399810435848563,.3399810435848563,-.8611363115940526,.8611363115940526]},8:{weights:[.362683783378362,.362683783378362,.3137066458778873,.3137066458778873,.2223810344533745,.2223810344533745,.1012285362903763,.1012285362903763],abscissas:[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363]},16:{weights:[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685,.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096],abscissas:[-.9894009349916499,-.9445750230732326,-.8656312023878318,-.755404408355003,-.6178762444026438,-.45801677765722737,-.2816035507792589,-.09501250983763744,.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]},64:{weights:[.048690957009139724,.048690957009139724,.04857546744150343,.04857546744150343,.048344762234802954,.048344762234802954,.04799938859645831,.04799938859645831,.04754016571483031,.04754016571483031,.04696818281621002,.04696818281621002,.046284796581314416,.046284796581314416,.04549162792741814,.04549162792741814,.044590558163756566,.044590558163756566,.04358372452932345,.04358372452932345,.04247351512365359,.04247351512365359,.04126256324262353,.04126256324262353,.03995374113272034,.03995374113272034,.038550153178615626,.038550153178615626,.03705512854024005,.03705512854024005,.035472213256882386,.035472213256882386,.033805161837141606,.033805161837141606,.03205792835485155,.03205792835485155,.030234657072402478,.030234657072402478,.028339672614259483,.028339672614259483,.02637746971505466,.02637746971505466,.024352702568710874,.024352702568710874,.022270173808383253,.022270173808383253,.02013482315353021,.02013482315353021,.017951715775697343,.017951715775697343,.015726030476024718,.015726030476024718,.013463047896718643,.013463047896718643,.011168139460131128,.011168139460131128,.008846759826363947,.008846759826363947,.006504457968978363,.006504457968978363,.004147033260562468,.004147033260562468,.001783280721696433,.001783280721696433],abscissas:[-.024350292663424433,.024350292663424433,-.07299312178779904,.07299312178779904,-.12146281929612056,.12146281929612056,-.16964442042399283,.16964442042399283,-.21742364374000708,.21742364374000708,-.2646871622087674,.2646871622087674,-.31132287199021097,.31132287199021097,-.3572201583376681,.3572201583376681,-.4022701579639916,.4022701579639916,-.4463660172534641,.4463660172534641,-.48940314570705296,.48940314570705296,-.5312794640198946,.5312794640198946,-.571895646202634,.571895646202634,-.6111553551723933,.6111553551723933,-.6489654712546573,.6489654712546573,-.6852363130542333,.6852363130542333,-.7198818501716109,.7198818501716109,-.7528199072605319,.7528199072605319,-.7839723589433414,.7839723589433414,-.8132653151227975,.8132653151227975,-.8406292962525803,.8406292962525803,-.8659993981540928,.8659993981540928,-.8893154459951141,.8893154459951141,-.9105221370785028,.9105221370785028,-.9295691721319396,.9295691721319396,-.9464113748584028,.9464113748584028,-.9610087996520538,.9610087996520538,-.973326827789911,.973326827789911,-.983336253884626,.983336253884626,-.9910133714767443,.9910133714767443,-.9963401167719553,.9963401167719553,-.9993050417357722,.9993050417357722]}},{sqrt:Dt}=Math;function qt(t){const[n,e]=G(t);return function(t){const r=R(n,t),o=R(e,t);return Dt(r*r+o*o)}}const{abs:jt}=Math,Wt=[[0,0],[0,0],[0,0]];function Qt(t,n,e){return 0===n?1===e?{ps:t,_ps:Wt}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=jt(n),v=jt(i),m=jt(s),x=jt(f),b=v+m,w=jt(c),_=jt(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(jt(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=jt(n),x=jt(i),b=jt(s),w=x+b,_=jt(f)+b,M=jt(c),S=jt(u),I=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(I+(jt(l)+S))+(2*m*I+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),I=h*x-(2*e*m-s),N=jt(n),y=jt(e),C=jt(d),O=jt(c),E=jt(u),T=O+E,A=T+jt(l)+E,P=jt(s),k=jt(f),B=P+k,z=B+jt(a)+k;return{ps:[[b,M],[w,S],[_,I]],_ps:[[p*A+(2*N*T+O),p*z+(2*N*B+P)],[C*A+(T*(y+N)+O),C*x+(B*(y+N)+P)],[h*A+(2*y*T+O),h*z+(2*y*B+P)]]}}(t,n,e)}const Rt=134217729;function Gt(t,n){const e=t*n,r=Rt*t,o=r-(r-t),i=t-o,c=Rt*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}function Ut(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r+i,s=c-r,u=e+o,f=u-e,l=r-(c-s)+(i-s)+u,a=c+l,p=e-(u-f)+(o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}function Zt(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r-i,s=c-r,u=e-o,f=u-e,l=r-(c-s)+(-i-s)+u,a=c+l,p=e-(u-f)+(-o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}const{atan2:Jt}=Math,Kt=Gt;function tn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=Zt(Kt(i,e),Kt(o,r))[1],s=Ut(Kt(o,e),Kt(i,r))[1];return Jt(c,s)}const{abs:nn}=Math;function en(t){const n=[];for(let e=0;e<t.length-1;e++){const r=[t[e+1][0]-t[e][0],t[e+1][1]-t[e][1]];0!==(0!==r[0]||r[1])&&n.push(r)}const e=n.length;let r=0;for(let t=0;t<e-1;t++)r+=nn(tn(n[t],n[t+1]));return r}function rn(t,n=.4,e=2**-16){const r=[0],o=[1];for(;;){const i=r[r.length-1],c=o[o.length-1];if(en(A(t,i,c))<=n||c-i<=e){if(r.push(o.pop()),1===c)return r;continue}const s=(i+c)/2;o.push(s)}}const{sqrt:on,log:cn}=Math;function sn(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a]]=n;if(c===u&&u===l&&s===f&&f===a)return 0;const p=Qt(n,o,i).ps,h=rn(p,e);let d=0;for(let t=0;t<h.length-1;t++){const n=h[t],e=h[t+1];d+=$t(qt(p),[n,e],r)}return d}const{abs:un}=Math,fn=[[0,0],[0,0],[0,0],[0,0]];function ln(t,n,e){return 0===n?1===e?{ps:t,_ps:fn}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=un(n),S=un(c),I=un(u),N=un(l),y=un(p),C=un(s),O=un(f),E=un(a),T=S+M*(S+I),A=I+M*(I+N),P=T+M*(T+A),k=C+M*(C+O),B=O+M*(O+E),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[P,z],[P+M*(P+(A+M*(A+(N+M*(N+y))))),z+M*(z+(B+M*(B+(E+M*(E+un(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),I=_-n*(_-M),N=S-n*(S-I),y=un(n),C=un(c),O=un(u),E=un(l),T=un(p),A=un(s),P=un(f),k=un(a),B=C+y*(C+O),z=O+y*(O+E),F=E+y*(E+T),L=B+y*(B+z),Y=z+y*(z+F),H=A+y*(A+P),X=P+y*(P+k),$=k+y*(k+un(h)),V=H+y*(H+X),D=X+y*(X+$);return{ps:[[b,N],[x,I],[v,M],[p,h]],_ps:[[L+y*(L+Y),V+y*(V+D)],[Y,D],[F,$],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=c[0]-s,_=x+b,M=n*x,S=e*x,I=w-3*b,N=u-l,y=p-l,C=c[1]-u,O=N+y,E=n*N,T=e*N,A=C-3*y,P=d*I+(3*n*(n*_-x)+s),k=m*(n*I+2*_)+(h*_+s-(S+2*M)),B=m*(e*I+2*_)+(g*_+s-(2*S+M)),z=v*I+(3*e*(e*_-x)+s),F=d*A+(3*n*(n*O-N)+u),L=m*(n*A+2*O)+(h*O+u-(T+2*E)),Y=m*(e*A+2*O)+(g*O+u-(2*T+E)),H=v*A+(3*e*(e*O-N)+u),X=un(n),$=un(e),V=un(m),D=un(d),q=un(v),j=un(s),W=un(f),Q=j+W,R=un(a)+W,G=Q+R,U=X*Q,Z=$*Q,J=un(w)+3*R,K=un(u),tt=un(l),nt=K+tt,et=un(p)+tt,rt=nt+et,ot=X*nt,it=$*nt,ct=un(C)+3*et;return{ps:[[P,F],[k,L],[B,Y],[z,H]],_ps:[[D*J+(3*X*(X*G+Q)+j),D*ct+(3*X*(X*rt+nt)+K)],[V*(X*J+2*G)+(h*G+j+(Z+2*U)),V*(X*ct+2*rt)+(h*rt+K+(it+2*ot))],[V*($*J+2*G)+(g*G+j+(2*Z+U)),V*($*ct+2*rt)+(g*rt+K+(2*it+ot))],[q*J+(3*$*($*G+Q)+j),q*ct+(3*$*($*rt+nt)+K)]]}}(t,n,e)}function an(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a],[p,h]]=n;if(c===u&&u===l&&l===p&&s===f&&f===a&&a===h)return 0;const d=ln(n,o,i).ps,g=rn(d,e);let v=0;for(let t=0;t<g.length-1;t++){const n=g[t],e=g[t+1];v+=$t(qt(d),[n,e],r)}return v}function pn(t,n=.4,e=16){if(4===t.length)return an([0,1],t,n,e);if(3===t.length)return sn([0,1],t,n,e);if(2===t.length)return Xt([0,1],t);if(1===t.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function hn(t,n,e=!0){const{cpNodes:r,hasHoleCloser:o}=function(t,n,e=!0){if(!e&&t===n)return{cpNodes:[],hasHoleCloser:!1};const r=t,o=[r];let i=t.next,c=r.isHoleClosing;for(;i!==n&&i!==r;)i.isHoleClosing&&(c=!0),o.push(i),i=i.next;return{cpNodes:o,hasHoleCloser:c}}(t,n,e);return{pss:r.flatMap(P),hasHoleCloser:o}}function dn(t){let n=0;for(let e of t)n+=e;return n}function gn(t){const n=t,e=t.nextOnCircle,r=Ht(n.pointOnShape.p,e.pointOnShape.p),{pss:o,hasHoleCloser:i}=hn(n,e),c=dn(o.map(t=>pn(t)));return i?1/0:c/r}function vn(t,n){let e=t;const r=[];for(;e!==n;){const t=Tt(e,e.next);r.push(t),e=e.next}return r}function mn(t,n){const e=D(W(U(At(t),0)),W(U(At(n),0)));return Math.abs(Math.asin(e)*(180/Math.PI))}function xn(t){const n=[];return y(t,t=>{n.push(t)}),n}function bn(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t,0!==e||(e=t.order-n.order,0!==e||(e=t.order2-n.order2))),e}function wn(t,n){return bn(t.pointOnShape,n.pointOnShape)}const _n={getChildren:z,getVertexForwardChildren:N,getAllOnLoop:h,getAllOnCircle:m,isOnSameCircle:kt,isTerminating:x,isFullyTerminating:w,getFirstExit:Pt,isSharp:_,isOneProng:Bt,getProngCount:v,getRealProngCount:b,cpNodeComparator:wn,enhanceCpNode:M,traverseCp:S,traverseEdges:I,traverseVertices:y,clone:O,getBoundaryBezierPartsToNext:T,getBoundaryBeziersToNext:P,removeVertex:B,getMatCurveToNext:At,isTwoProng:zt,getBranch:Lt,getBranchBeziers:Yt,getSalience:gn,getMatCurveBetween:Tt,getEdgeDirection:Ct,getBoundaryBeziersBetween:hn,getMatCurvesBetween:vn,getHoleClosers:d,getInitialDegAngleBetweenMatCurves:mn,getAllVertices:xn};function Mn(t){return n=>m(n).some(t)}const Sn=Mn(function(t){return 2!==b(t)&&!t.isHoleClosing});function In(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=-t[e];return n}function Nn(t){return n=>1/t(n.toReversed())}function yn(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=In(t));const e=[];for(let t=0;t<n;t++)e.push(1);let r=0;for(let o=0;o<=n;o++){if(t[o]>=0)continue;let n=1/0,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const c=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>c&&(n=c),i=!0}i&&r<n&&(r=n)}return r}Nn(yn);const Cn=(On=yn,t=>-On(function(t){const n=t.length-1;if(n<0)return[];const e=t.slice();for(let t=0;t<n+1;t++)t%2==(n-1)%2&&(e[t]=-e[t]);return e}(t)));var On;Nn(Cn);const{min:En,max:Tn}=Math,{abs:An}=Math;function Pn(t){const n=t.slice(),e=n.length;if(1===e)return n;let r=n[e-1],o=e;for(let t=e-2;t>=0;--t){const e=r,i=n[t];r=e+i;const c=i-(r-e);c&&(n[--o]=r,r=c)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const c=o-(r-e);c&&(n[i++]=c)}return n[i++]=r,n.length=i,n}const kn=Number.EPSILON,Bn=Number.EPSILON/2,zn=Bn*Bn,Fn=Yn(1),Ln=function(){const t=3*zn;return t/(1-t)}();function Yn(t){const n=t*Bn;return n/(1-n)}new Array(20).fill(0).map((t,n)=>Yn(n));const{abs:Hn}=Math,{abs:Xn}=Math,$n=134217729;function Vn(t,n){const e=n[0],r=n[1],o=r*t,i=$n*r,c=i-(i-r),s=r-c,u=$n*t,f=u-(u-t),l=t-f,a=s*l-(o-c*f-s*f-c*l)+e*t,p=o+a;return[a-(p-o),p]}const{abs:Dn}=Math;function qn(t,n,e){const r=t.length-1;if(r<0)return[[],[]];const o=Dn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=i[e-1],r=c[e-1],s=Vn(n,t),u=o*r+Dn(s[1]),f=i[e];i[e]=Ut(f,s),c[e]=c[e]+u+Dn(i[e][1])}return[i,c]}const jn=2**27+1;function Wn(t,n){const e=t[1],r=n[1],o=e*r,i=jn*e,c=i-(i-e),s=e-c,u=jn*r,f=u-(u-r),l=r-f,a=s*l-(o-c*f-s*f-c*l)+(e*n[0]+t[0]*r),p=o+a;return[a-(p-o),p]}const{abs:Qn}=Math;function Rn(t,n){const e=t.length-1;if(e<0)return[];const r=t.slice();for(let t=0;t<=e;t++)for(let o=1;o<=e-t;o++)r[o]=Pn(J(r[o],tt(r[o-1],n)));return r}function Gn(t,n){const e=t.length-1;if(e<0)return[];const r=new Array(e+1);r[e]=t[e];let o=[1];for(let i=1;i<=e;i++)o=tt(o,n),r[e-i]=et(t[e-i],o);return r}const{abs:Un,sign:Zn}=Math;const Jn=134217729;function Kn(t,n){const e=t*n,r=Jn*t,o=r-(r-t),i=t-o,c=Jn*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}const{abs:te}=Math;function ne(t,n){const e=te(n);let r=t[0],o=.5*te(r);for(let i=1;i<t.length;i++)r=r*n+t[i],o=o*e+te(r);return o=Bn*(2*o-te(r)),[r,o]}const ee=Math.abs,{abs:re}=Math,oe=Yn(1),ie=Yn(2);function ce(t,n,e=void 0,r=1){const o=t[0],[i,c]=ne(o,n),s=ie*function(t,n){const e=ee(n);let r=0;for(let n=0;n<t.length;n++)r=r*e+ee(t[n]);return r}(o,n),u=void 0!==e?R(e,re(n)):0;if((c+s+u)*r<Math.abs(i))return i;const f=function(t,n){const e=[],r=[];let o,i=t[0];for(let c=1;c<t.length;c++){const[s,u]=Kn(i,n);[o,i]=lt(u,t[c]),e.push(s),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(o,n),{pπ:l,pσ:a}=f;let{r̂:p}=f;const[h,d]=ne(l,n),[g,v]=ne(a,n),[m,x]=ne(t[1],n);let b=d+v+x+u;return p=h+g+m+p,b+=oe*p,b*r<Math.abs(p)?p:0}function se(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(t[r],tt(e,n));return e}const{abs:ue,min:fe,max:le,log2:ae,ceil:pe}=Math;function he(t,n,e,r,o,i,c,s){let u=e,f=r,l=u,a=o,p=f-u,h=p;for(;;){let d;ue(a)<ue(i)&&(u=f,f=l,l=u,o=i,i=a,a=o);const g=le(ue(u),ue(f));d=g<=1?kn:kn*2**pe(ae(g));const v=.5*(l-f);if(ue(v)<=d)return f<l?[f,l,f]:[l,f,f];if(ue(p)<d||ue(o)<=ue(i))p=v,h=p;else{let t,n,e=i/o;if(u===l)t=2*v*e,n=1-e;else{n=o/a;const r=i/a;t=e*(2*v*n*(n-r)-(f-u)*(r-1)),n=(n-1)*(r-1)*(e-1)}0<t?n=-n:t=-t,e=p,p=h,2*t<3*v*n-ue(d*n)&&t<ue(.5*e*n)?h=t/n:(p=v,h=p)}if(u=f,o=i,d<ue(h)?f+=h:0<v?f+=d:f-=d,0===(i=s?rt(se(c(),f)):ce(t,f,n))){if(s)return[f,f,f];const o=le(e,f-d),u=fe(r,f+d);if(ce(t,o,n)*ce(t,u,n)!==0)return[o,u,f];if(s=!0,0===(i=rt(se(c(),f))))return[f,f,f]}(0<i&&0<a||i<=0&&a<=0)&&(l=u,a=o,p=f-u,h=p)}}const{abs:de}=Math;function ge(t,n,e){const r=de(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=o*n;o=s+t[c],i=i*r+de(s)+e[c]+de(o)}return[o,i]}function ve(t){const n=t[0].length,e=[];for(let r=0;r<n;r++){const o=[];for(let e=0;e<t.length;e++)o.push(t[e][n-(r+1)]);e.push(o)}return e}const me=Ut,xe=Vn,{abs:be}=Math;function we(t,n,e){const r=be(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=xe(n,o);o=me(s,t[c]),i=i*r+be(s[1])+e[c]+be(o[1])}return[o,i]}const{abs:_e,min:Me,max:Se,log2:Ie,ceil:Ne}=Math,ye=Ln/Fn;function Ce(t,n,e,r,o,i,c){const s=t.length-1;let u=0,f=1;for(;;){f*=2;for(let l=1;l<f;l+=2){u++;const a=o+(i-o)*(f+2*l)/(4*f),[p,h]=ge(t,a,n);if(_e(p)>h*Fn)return[a,p];if(u>s)return Oe(e,r,o,i,c)}}}function Oe(t,n,e,r,o){const i=t.length-1;let c=0,s=1;for(;;){s*=2;for(let u=1;u<s;u+=2){c++;const f=e+(r-e)*(s+2*u)/(4*s),[l,a]=we(t,f,n);if(_e(l[1])>a*Ln)return[f,l[1]];if(c>i)return Ee(o(),e,r)}}}function Ee(t,n,e){const r=t.length-1;let o=1;for(;;){o*=2;for(let i=1;i<o;i+=2){const c=n+(e-n)*(o+2*i)/(4*o),s=Pn(se(t,c)),u=s[s.length-1];if(0!==u)return[c,u];if(0>r)throw new Error("Cannot resolve root even in Shewchuk expansion precision")}}}function Te(t,n=-1/0,e=1/0,r,o,i=!1){let c;"number"==typeof t[0]&&(t=t.map(t=>[0,t]));const s=()=>void 0===o?t:(void 0===c&&(c=o()),c);if(r=r||new Array(t.length).fill(0),({pDd:t,pDd_:r,pExact:c}=function(t,n,e,r){let o;for(;t.length>0&&An(t[0][1])<=r*n[0]&&(o=o||e(),0===ct(o[0]));)(t=t.slice()).shift(),(n=n.slice()).shift(),o.shift();return{pDd:t,pDd_:n,pExact:o}}(t,r,s,Ln)),0===t.length)return;if(1===t.length)return[];const u=t.map(t=>t[0]+t[1]);return!i&&n!==-1/0&&e!==1/0||([n,e]=function(t,n,e){return[t=Tn(t,Cn(e)),n=En(n,yn(e))]}(n,e,u),n!==e)?function(t,n,e,r,o,i){const c=e.map((n,e)=>n*ye+_e(t[e])),s=r,u=o;let f,l,a,p,h=o-r;for(;[f,l]=ge(t,r,c),!(_e(f)>l*Fn);)r-=h/2,h*=2;for(;[a,p]=ge(t,o,c),!(_e(a)>p*Fn);)o+=h/2,h*=2;const d=[[r,o,f,a,0]],g=[],v=function(t,n,e,r,o){return function(i,c,s,u,f){let[l,a]=function(t,n,e){const r=t.length-1,o=Hn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=n*i[e-1],r=o*c[e-1]+Hn(t);i[e]=i[e]+t,c[e]=c[e]+r+Hn(i[e])}return[i,c]}(t,i,n);!function(t,n,e){const r=t.length-1;if(r<0)return;let o=n,i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Xn(u),l=e[s],a=u*o;t[s]=a,e[s]=l*o+f*i+Xn(a);const p=o*n;i=i*n+p,o=p}}(l,c-i,a),l.reverse(),a.reverse(),function(t,n){const e=t.length-1;for(let r=0;r<=e;r++)for(let o=1;o<=e-r;o++){const e=t[o-1],r=n[o-1]+Hn(e);t[o]=t[o]+e,n[o]=n[o]+r+Hn(t[o])}}(l,a);let p=0,h=0,d=Zn(s);for(let t=1;t<l.length-1;t++){let n=Zn(l[t]);const e=l[t],r=a[t]*Fn;Un(e)<=r&&(h++,n=-d),n!==d&&(p++,d=n)}return Zn(u)!==d&&p++,1===h&&1===p?1:h>0?function(t,n,e,r,o,i,c,s){let[u,f]=qn(t,e,n);(function(t,n,e){const r=t.length-1;if(r<0)return;let o=[0,n],i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Qn(u[1]),l=e[s],a=Wn(o,u);t[s]=a,e[s]=l*o[1]+f*i+Qn(a[1]);const p=Wn(o,[0,n]);i=i*n+p[1],o=p}})(u,r-e,f),u.reverse(),f.reverse(),[u,f]=qn(u,1,f);let l=0,a=0,p=Zn(o);for(let t=0;t<u.length-1;t++){let n=Zn(u[t][1]);const e=f[t]*Ln,r=u[t];e>=Un(r[1])&&(a++,n=-p),n!==p&&(l++,p=n)}return Zn(i)!==p&&l++,1===a&&1===l?1:0===a?l:c>1?function(t,n,e,r,o){let i=Rn(t(),n);i=Gn(i,e-n),i.reverse(),i=Rn(i,1);let c=0,s=Zn(r);for(let t=1;t<i.length-1;t++){const n=i[t];let e=Zn(n[n.length-1]);e!==s&&0!==e&&(c++,s=e)}return Zn(o)!==s&&c++,c}(s,e,r,o,i):-l}(e,r,i,c,s,u,f,o):p}}(t,c,n,e,i);let m,x;for(;d.length>0;){const r=d.pop(),[o,s,u,f,l]=r,a=v(o,s,u,f,l);if(0===a)continue;if(1===a){m=m||e.map(t=>t*Ln),x=x||ve(n);const[t,r,c]=he(x,m,o,s,u,f,i,!1);g.push({t:c,tS:t,tE:r,multiplicity:1});continue}let p=a<0?l+1:0;if(s-o<=2*_e(a)*kn*Se(1,2**Ne(Ie(Se(_e(o),_e(s)))))){if(0===p){g.push({t:(o+s)/2,tS:o,tE:s,multiplicity:_e(a)});continue}p=1/0}const[h,b]=Ce(t,c,n,e,o,s,i);d.push([o,h,u,b,p]),d.push([h,s,b,f,p])}return g.reverse(),g.filter(t=>{const{tS:n,tE:e}=t;return!(e<s||n>u)})}(u,t,r,n,e,s):[{t:n,tS:n,tE:e,multiplicity:u.length-1}]}function Ae(t,n){if(0===n)return t[0];if(1===n)return t[t.length-1];if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-i)*n-f)*n]}if(2===t.length){const[[e,r],[o,i]]=t;return[e+(o-e)*n,r+(i-r)*n]}if(1===t.length)return t[0];throw new Error("The given bezier curve must be of order <= 3.")}const{abs:Pe}=Math;function ke(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Pe(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=Pe(n),a=Pe(r),p=Pe(o),h=Pe(i),d=Pe(c),g=Pe(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(Pe(u)+d)*e+m)*e+x)*e,_+(w+(g+(Pe(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=Pe(n),f=Pe(r),l=Pe(o),a=Pe(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Pe(c)+l)*e+p)*e,h+(a+(Pe(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=Pe(n),s=Pe(r);return[c+(Pe(o)+c)*e,s+(Pe(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}const Be=Number.EPSILON,ze=Number.EPSILON/2,Fe=ze*ze,Le=He(1),Ye=function(){const t=3*Fe;return t/(1-t)}();function He(t){const n=t*ze;return n/(1-n)}const{abs:Xe}=Math,$e=[[0,0],[0,0]];const{min:Ve,max:De}=Math;function qe(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=ln(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*ze*r[0][0],f=9*ze*r[1][0],l=9*ze*r[2][0],a=9*ze*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*ze*r[0][1],m=9*ze*r[1][1],x=9*ze*r[2][1],b=9*ze*r[3][1],w=Ve(o-u,i-f,c-l,s-a),_=De(o+u,i+f,c+l,s+a);return[[w,Ve(p-v,h-m,d-x,g-b)],[_,De(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=Qt(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*ze*r[0][0],u=5*ze*r[1][0],f=5*ze*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*ze*r[0][1],d=5*ze*r[1][1],g=5*ze*r[2][1],v=Ve(o-s,i-u,c-f),m=De(o+s,i+u,c+f);return[[v,Ve(l-h,a-d,p-g)],[m,De(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:$e}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=Xe(n),l=Xe(o),a=Xe(c),p=Xe(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(Xe(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=Xe(n),l=Xe(o),a=Xe(c),p=Xe(i);return{ps:u,_ps:[[f*(a+l)+l,f*(Xe(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=Xe(n),a=Xe(e),p=Xe(i),h=Xe(s),d=Xe(c),g=Xe(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*ze*r[0][0],s=3*ze*r[1][0],u=e[0][1],f=e[1][1],l=3*ze*r[0][1],a=3*ze*r[1][1],p=Ve(o-c,i-s),h=De(o+c,i+s);return[[p,Ve(u-l,f-a)],[h,De(u+l,f+a)]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n)return[e,e];if(1===n)return[r,r];const o=Ae(t,n);let i;if(4===t.length)i=ke(t,[0,n]).map(t=>8*Le*t);else if(3===t.length)i=ke(t,[0,n]).map(t=>5*Le*t);else if(2===t.length)i=ke(t,[0,n]).map(t=>2*Le*t);else if(1===t.length)return[o,o];return[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]]}(t,n[0])}function je(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const We=Z,Qe=Number.EPSILON;function Re(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function Ge(t){return[2*t[0],2*t[1]]}function Ue(t){return[4*t[0],4*t[1]]}const Ze=Re,Je=Ut,Ke=Vn,tr=Wn,nr=Ge,er=Ue,rr=Zt;function or(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Ze(c,d),m=Ze(u,d),x=Ze(l,d),b=Ze(p,d),w=Ze(s,g),_=Ze(f,g),M=Ze(a,g),S=Ze(h,g),I=tr(v,v),N=Ke(6,tr(v,m)),y=Ke(6,tr(v,x)),C=nr(tr(v,b)),O=Ke(9,tr(m,m)),E=Ke(18,tr(m,x)),T=Ke(6,tr(m,b)),A=Ke(9,tr(x,x)),P=Ke(6,tr(x,b)),k=tr(b,b),B=tr(w,w),z=Ke(6,tr(w,_)),F=Ke(6,tr(w,M)),L=nr(tr(w,S)),Y=Ke(9,tr(_,_)),H=Ke(18,tr(_,M)),X=Ke(6,tr(_,S)),$=Ke(9,tr(M,M)),V=Ke(6,tr(M,S)),D=tr(S,S),q=Je(T,A),j=Je(C,E),W=Je(y,O),Q=Je(X,$),R=Je(L,H),G=Je(F,Y);return[Ke(6,Je(Je(Je(Je(rr(k,P),rr(I,N)),q),rr(W,j)),Je(Je(Je(rr(D,V),rr(B,z)),Q),rr(G,R)))),Ke(5,Je(rr(Je(Je(P,Ke(5,N)),Ke(3,j)),nr(Je(Je(q,nr(W)),Ke(3,I)))),rr(Je(Je(V,Ke(5,z)),Ke(3,R)),nr(Je(Je(Q,nr(G)),Ke(3,B)))))),er(Je(rr(rr(q,Ke(3,rr(j,nr(W)))),Ke(5,rr(nr(N),Ke(3,I)))),rr(rr(Q,Ke(3,rr(R,nr(G)))),Ke(5,rr(nr(z),Ke(3,B)))))),Ke(3,Je(rr(j,nr(rr(nr(W),Ke(5,rr(N,nr(I)))))),rr(R,nr(rr(nr(G),Ke(5,rr(z,nr(B)))))))),nr(Je(rr(W,Ke(5,rr(N,Ke(3,I)))),rr(G,Ke(5,rr(z,Ke(3,B)))))),Je(rr(N,Ke(6,I)),rr(z,Ke(6,B)))]}const ir=Re,cr=Ut,sr=Vn,ur=Wn,fr=Ge,lr=Zt,ar=Ue;function pr(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=ir(e,u),a=ir(o,u),p=ir(c,u),h=ir(r,f),d=ir(i,f),g=ir(s,f),v=ur(l,l),m=ur(l,a),x=ur(l,p),b=ur(a,a),w=ur(a,p),_=ur(p,p),M=ur(h,h),S=ur(h,d),I=ur(h,g),N=ur(d,d),y=ur(d,g),C=ur(g,g),O=cr(I,fr(N)),E=cr(x,fr(b));return[cr(lr(cr(cr(C,M),fr(O)),ar(cr(y,S))),lr(cr(cr(_,v),fr(E)),ar(cr(w,m)))),sr(3,cr(cr(lr(y,O),lr(sr(3,S),M)),cr(lr(w,E),lr(sr(3,m),v)))),cr(lr(O,sr(3,lr(fr(S),M))),lr(E,sr(3,lr(fr(m),v)))),cr(lr(S,M),lr(m,v))]}const hr=Gt,dr=Ut,gr=function(t){return[-2*t[0],-2*t[1]]};function vr(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=hr(u,u),h=hr(u,f),d=hr(f,f),g=hr(l,l),v=hr(l,a),m=hr(a,a),x=dr(h,v),b=dr(g,p);return[dr(dr(d,m),dr(b,gr(x))),Zt(x,b)]}function mr(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function xr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}const br=Z,wr=nt,_r=mr,Mr=xr,Sr=Z,Ir=nt,Nr=mr;function yr(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const Cr=Z,Or=xr,{abs:Er}=Math;function Tr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=Er(e[0]),s=Er(e[1]),u=Er(r[0]),f=Er(r[1]),l=Er(o[0]),a=Er(o[1]),p=Er(i[0]),h=Er(i[1]),d=Er(n[0]),g=Er(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,I=v*v,N=6*v*m,y=6*x*b,C=w*w,O=6*w*_,E=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(I+N)+T+(P+A)+(S*S+E+(C+O)+k+(z+B))),5*(y+5*N+3*A+2*(T+2*P+3*I)+(E+5*O+3*B+2*(k+2*z+3*C))),4*(T+3*(A+2*P)+5*(2*N+3*I)+(k+3*(B+2*z)+5*(2*O+3*C))),3*(A+2*(2*P+5*(N+2*I))+(B+2*(2*z+5*(O+2*C)))),2*(P+5*(N+3*I)+(z+5*(O+3*C))),N+6*I+(O+6*C)]}function Ar(t,n){const e=t[0],r=t[1],o=t[2],i=Er(e[0]),c=Er(e[1]),s=Er(r[0]),u=Er(r[1]),f=Er(o[0]),l=Er(o[1]),a=Er(n[0]),p=Er(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,I=m*x,N=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*N+4*(I+S)+(g*g+b+2*y+4*(_+w)),3*(I+N+(3*S+M)+(_+y+(3*w+b))),N+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function Pr(t,n){const e=t[0],r=t[1],o=Er(e[0]),i=Er(e[1]),c=Er(r[0]),s=Er(r[1]),u=Er(n[0]),f=Er(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}function kr(t,n){const e=t.length-1;if(3===e)return{polyDd:or(t,n),polyE:Tr(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=br(c,d),m=br(u,d),x=br(l,d),b=br(p,d),w=br(s,g),_=br(f,g),M=br(a,g),S=br(h,g),I=et(v,v),N=wr(6,et(v,m)),y=wr(6,et(v,x)),C=_r(et(v,b)),O=wr(9,et(m,m)),E=wr(18,et(m,x)),T=wr(6,et(m,b)),A=wr(9,et(x,x)),P=wr(6,et(x,b)),k=et(b,b),B=et(w,w),z=wr(6,et(w,_)),F=wr(6,et(w,M)),L=_r(et(w,S)),Y=wr(9,et(_,_)),H=wr(18,et(_,M)),X=wr(6,et(_,S)),$=wr(9,et(M,M)),V=wr(6,et(M,S)),D=et(S,S),q=J(T,A),j=J(C,E),W=J(y,O),Q=J(X,$),R=J(L,H),G=J(F,Y),U=it(J(J(k,I),J(q,W)),J(J(j,P),N)),Z=it(J(J(D,B),J(Q,G)),J(J(R,V),z)),K=wr(6,J(U,Z)),tt=J(Mr(J(J(q,_r(W)),wr(3,I))),J(J(P,wr(3,j)),wr(5,N))),nt=J(Mr(J(J(Q,_r(G)),wr(3,B))),J(J(V,wr(3,R)),wr(5,z))),rt=wr(5,J(tt,nt)),ot=J(J(q,wr(3,it(_r(W),j))),wr(5,it(wr(3,I),_r(N)))),ct=J(J(Q,wr(3,it(_r(G),R))),wr(5,it(wr(3,B),_r(z)))),st=wr(4,J(ot,ct)),ut=it(j,_r(it(_r(W),wr(5,it(N,_r(I)))))),ft=it(R,_r(it(_r(G),wr(5,it(z,_r(B)))))),lt=wr(3,J(ut,ft)),at=it(W,wr(5,it(N,wr(3,I)))),pt=it(G,wr(5,it(z,wr(3,B))));return[K,rt,st,lt,_r(J(at,pt)),J(it(N,wr(6,I)),it(z,wr(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:pr(t,n),polyE:Ar(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=Sr(e,u),a=Sr(o,u),p=Sr(c,u),h=Sr(r,f),d=Sr(i,f),g=Sr(s,f),v=et(l,l),m=et(l,a),x=et(l,p),b=et(a,a),w=et(a,p),_=et(p,p),M=et(h,h),S=et(h,d),I=et(h,g),N=et(d,d),y=et(d,g),C=et(g,g),O=J(I,Nr(N)),E=J(x,Nr(b)),T=J(it(J(_,Nr(E)),yr(J(w,m))),v),A=J(it(J(C,Nr(O)),yr(J(y,S))),M),P=J(T,A),k=J(it(w,E),it(Ir(3,m),v)),B=J(it(y,O),it(Ir(3,S),M));return[P,Ir(3,J(k,B)),J(it(O,Ir(3,it(Nr(S),M))),it(E,Ir(3,it(Nr(m),v)))),J(it(S,M),it(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:vr(t,n),polyE:Pr(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=Cr(e,c),f=Cr(o,c),l=Cr(r,s),a=Cr(i,s),p=et(u,u),h=et(u,f),d=et(f,f),g=et(l,l),v=et(l,a),m=et(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(Or(x),b)),it(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}const{sqrt:Br}=Math;function zr(t,n,e=0,r=1){const{polyDd:o,polyE:i,getPolyExact:c}=kr(t,n),s=Te(o,e,r,i,c)||[];s.push({t:e,tS:e,tE:e,multiplicity:1}),s.push({t:r,tS:r,tE:r,multiplicity:1});const u=s.map(e=>{const r=qe(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=We(t,u),r=We(n,f),o=rt(J(et(e,e),et(r,r))),i=o*(1-Qe),c=o*(1+Qe);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(r,n);return{p:je(r),t:e.t,d:(Br(o[0])+Br(o[1]))/2,dSquaredI:o,box:r,ri:e}});let f=Number.POSITIVE_INFINITY;for(let t=0;t<u.length;t++){const n=u[t].dSquaredI[1];n<f&&(f=n)}const l=[];for(let t=0;t<u.length;t++){const n=u[t];n.dSquaredI[0]<=f&&l.push(n)}return l}function Fr(t){return(t.tS+t.tE)/2}function Lr(t){const n=t.xs;if(4===n.length){let t=0,e=0;for(let r=0;r<n.length;r++)0===n[r].x.kind&&t++,4===n[r].x.kind&&e++;if(2===t&&2===e)return!0}return n.length<=2&&7!==n[0].x.kind}function Yr(t){const n=(t=Pn(t)).length;return 2===n?t:n<=1?[0,t[0]]:[t[n-2],t[n-1]]}const{abs:Hr,min:Xr,max:$r,log2:Vr,ceil:Dr}=Math;function qr(t,n){const{tS:e,tE:r}=t,o=r-e;if(0===o)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const i=2**Dr(Vr(o)),c=function(t,n,e){return Gn(Rn(t,e),n)}(n,i,e),s=c.map(Yr),u=s.map(t=>t[1]*kn**2),f=Te(s,0,1,u,()=>c),l=[];for(const t of f)l.push({tS:lt(e,t.tS*i),tE:lt(e,t.tE*i),multiplicity:t.multiplicity});return l}function jr(t,n){return ct(it(t,n))}const{abs:Wr}=Math;function Qr(t,n){const e=t.inOuts;e.sort(function(t){return(n,e)=>{let r=n.side-e.side;if(0!==r)return r;const o=n.sideX,i=e.sideX;r=o.ri.tS-i.ri.tS;const c=8*Number.EPSILON;return Wr(r)>=c?r:(o.compensated||(o.compensated=1,o.riExp=qr(o.ri,o.getPExact())[0]),i.compensated||(i.compensated=1,i.riExp=qr(i.ri,i.getPExact())[0]),r=jr(o.riExp.tS,i.riExp.tS),0!==r?r:(r=n.dir-e.dir,0!==r?t*r:1===n.dir?n.idx-e.idx:e.idx-n.idx))}}(n));let r=e[e.length-1];for(let t=0;t<e.length;t++){const n=e[t];n.prevAround=r,r.nextAround=n,r=n}}function Rr(t,n,e,r){const o=function(t,n){return(e,r,o)=>{t.has(e)||(e.orientation=r,e.parent=o,e.windingNum=o.windingNum+e.orientation,n.push(e))}}(r,e);Qr(t.container,n.orientation);let i,c,s=1,u=t,f=n.orientation;for(;u=1===n.orientation?u.nextAround:u.prevAround,u!==t;){const t=s;s-=u.dir,1===s&&(f*=-1),-1!==u.dir&&(i?1===t&&0===s?o(u,n.orientation,n.parent):0===t&&-1===s&&o(u,-n.orientation,n.parent):0===s?i=u:1===s&&o(u,n.orientation,n))}return Lr(t.container)||(c=[t.p,i.p]),{inOutToUse:i,additionalBezier:c}}function Gr(t,n){const e=t._x_,r=n._x_,o=e.curve,i=e.x.ri.tS,c=r.curve,s=r.x.ri.tS;let u=o,f=i;Lr(t.container)||(f=Fr(zr(o.ps,t.p)[0].ri));const l=[];for(;;){if(u===c&&(f<s||f===s&&0!==l.length)){const t=u.ps,n=[f,s];return l.push({ps:t,ts:n}),l}{const t=u.ps,n=[f,1];l.push({ps:t,ts:n})}f=0,u=u.next}}function Ur(t,n){const e=n._x_,r=t._x_,o=r.curve,i=r.x.ri.tS,c=e.curve,s=e.x.ri.tS;let u=o,f=i;Lr(t.container)||(f=Fr(zr(u.ps,t.p)[0].ri));const l=[];for(;;){const t=u.ps;if(u===c&&(f>s||f===s&&0!==l.length)){const n=[f,s];return l.push({ps:t,ts:n}),l}{const n=[f,0];l.push({ps:t,ts:n})}f=1,u=u.prev}}function Zr(t,n,e,r){const o=function(t,n,e){return(r,o,i,c)=>{n.has(r)||1!==r.dir||(r.loopsIdxs=new Set(c),r.orientation=o*t.orientation,r.parent=i.parent,r.windingNum=i.windingNum+r.orientation,e.unshift(r))}}(n,r,e);Qr(t.container,1);let i=t.nextAround,c=t;const s=[],u=new Set(n.loopsIdxs);for(;c=c.nextAround,c!==t;)o(c,n.dir,n,u),s.push(c.idx),-1===c.dir?u?.add(c._x_?.curve.loop.idx):u.delete(c._x_?.curve.loop.idx);let f;return Lr(t.container)||(f=[t.p,i.p]),{inOutToUse:i,additionalBezier:f}}function Jr(t){const{ps:n,ts:e}=t;return A(n,e[0],e[1])}function Kr(t,n,e){const r=[],o=[];let i,c=n;const s=e?Zr:Rr,u=[];do{t.add(c),u.push(c);const e=c.nextOrPrev;t.add(e);const f=1===c.dir?Gr(c,e):Ur(c,e);o.push(...f);const l=s(e,n,r,t);if(({inOutToUse:c,additionalBezier:i}=l),void 0!==i){const t=Jr(o[o.length-1]),n={ps:t,ts:[0,Fr(zr(t,i[0])[0].ri)]};o.pop(),o.push(n),o.push({ps:i,ts:[0,1]})}}while(c!==n);return"undefined"!=typeof _debug_&&_debug_.verbose&&function(t){const n=[],e=[];for(let r of t)e.push(1===r.dir?"color: blue;":"color: red"),n.push(`%c${r.idx}`)}(u),{bezierPieces:o,additionalOutsToCheck:r}}function to(t,n,e,r){const o=[t];for(;o.length;){const t=o.pop();if(n.add(t._x_.curve.loop),e.has(t))continue;t.children=new Set;const{bezierPieces:i,additionalOutsToCheck:c}=Kr(e,t,r);t.bezierPieces=i,t.parent.children=t.parent.children||new Set,t.parent.children.add(t);for(let t=0;t<c.length;t++)o.push(c[t])}}function no(t){if(4===t.length)return eo(t);if(3===t.length)return ro(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[r-n,n],[o-e,e]]}(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[n],[e]]}(t);throw new Error("The given bezier curve must be of order <= 3.")}function eo(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function ro(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function oo(t){const n=t[0],e=t[t.length-1];let r,o;if(n[1]<e[1]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minY:r,maxY:o};const[,i]=G(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=qe(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}function io(t){const n=function(t){const n=t[0],e=t[t.length-1];let r,o;if(n[0]<e[0]?(r={ts:[0,0],box:[n,n]},o={ts:[1,1],box:[e,e]}):(r={ts:[1,1],box:[e,e]},o={ts:[0,0],box:[n,n]}),2===t.length)return{minX:r,maxX:o};const[i]=G(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=qe(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=oo(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const co=Y(io);function so(t){const n=G(t),e=Te(n[0],0,1)?.map(t=>t.t)||[],r=Te(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Ae(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Ae(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}const uo=Y(so),{min:fo,max:lo}=Math;function ao(t){const n=t.map(uo);return{minX:fo(...n.map(t=>t.box[0][0])),maxX:lo(...n.map(t=>t.box[1][0])),minY:fo(...n.map(t=>t.box[0][1])),maxY:lo(...n.map(t=>t.box[1][1]))}}const po=new Function("try {return this===window;}catch(e){ return false;}")()?function(t){const n=window.atob(t),e=n.length,r=new Uint8Array(e);for(let t=0;t<e;t++)r[t]=n.charCodeAt(t);return r.buffer}:function(t){return function(t){const n=new ArrayBuffer(t.length),e=new Uint8Array(n);for(let n=0;n<t.length;++n)e[n]=t[n];return n}(Buffer.from(t,"base64"))},ho=po("AGFzbQEAAAABBgFgAX8BfAMDAgAABQMBAAAHHwMGbWVtb3J5AgAHc3F1YXJlcwAACHNxdWFyZXM0AAEKjgECPwECfiAArULHuuXf9tjQm2p+IgEgASABfnxCIIoiAiACfiABQse65d/22NCbanx8QiCKIgIgAn4gAXxCIIi6C0wBAn4gAK1Cx7rl3/bY0JtqfiIBQse65d/22NCbanwiAiABIAIgASABIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiLoL"),go=new WebAssembly.Module(ho),vo=new WebAssembly.Instance(go),mo=vo.exports.squares;vo.exports.squares4;const xo=1e-6;function bo(t,n){let e;const r=[t];for(;r.length;)o(r.pop());return e;function o(o){if(o===t||function(t,n){let e=0;do{e++;const o=mo(e)/4294967296,i=r(t,n,Ae(t[mo(e+1e3)%t.length],o));if(void 0!==i)return i}while(e<100);return;function r(t,n,e){if(function(t,n){const e=ao(t),r=ao(n);return e.minX<r.minX||e.maxX>r.maxX||e.minY<r.minY||e.maxY>r.maxY}(t,n))return!1;const r=function(t,n){const[e,r]=n;let o=0;for(let i=0;i<t.length;i++){const c=t[i],[[s,u],[f,l]]=co(c);let a=u>r||l<r||!1;if(a=a||s>e||!1,a)continue;const p=[];let h,d,g;const v=!0;h=t=>no(t)[1],d=[0,-r],g=0;const m=c.map(j(d)),x=h(m),b=Te(x,0-xo,1+xo)?.map(t=>t.t)||[];for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<xo||Math.abs(e-1)<xo)return;const r=Ae(m,e);(v&&n[g]>=r[g]||!v&&n[g]<=r[g])&&p.push(e)}if(1===p.length||3===p.length)for(const t of p){const n=W(U(c,t));if(Math.abs(n[1])<xo)return}o+=p.length}return o}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.bezierPieces.map(Jr))){e=o;for(const t of o.children)r.push(t)}}}function wo(t,n){return _o(t)-_o(n)}function _o(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=uo(e).box[0][1];t<n&&(n=t)}return n}const{abs:Mo,sign:So}=Math;function Io(t){let n=t.parent;for(;;){if(void 0===n)return!1;if(n.used)return!0;n=n.parent}}function No(t,n,e){let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;o>c&&([o,c]=[c,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]);const a=t||r===i&&s===f,p=t||o===c&&u===l;return(a?r<=f:r<f)&&(a?i>=s:i>s)&&(p?u<=c:u<c)&&(p?l>=o:l>o)}function yo(t,n){return No(!0,t.box,n.box)}function Co(t,n){for(let e=0;e<n.length;e++){const r=n[e];Oo(t,[r.a,r.b])}}function Oo(t,n){const[e,r]=n;let o=t.get(e);o||(o=[],t.set(e,o));let i=t.get(r);i||(i=[],t.set(r,i)),o.push(r),i.push(e)}function Eo(t,n,e,r){e.add(n),r.push(n);const o=t.get(n);for(let n=0;n<o.length;n++){const i=o[n];e.has(i)||Eo(t,i,e,r)}}function To(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Eo(t,o,e,n[n.length-1]))}return n}function Ao(t,n){const e=new Set;for(const t of n)for(const n of t)e.add(n);const r=[];for(let n=0;n<t.length;n++){const o=t[n];e.has(o)||r.push(o)}return r}function Po(t){const n=[];for(const e of t){let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const c=[];for(const n of e){const[[e,s],[u,f]]=n.box;e<t&&(t=e),s<r&&(r=s),u>o&&(o=u),f>i&&(i=f),c.push(...n.xs)}const s={box:[[t,r],[o,i]],xs:c,inOuts:void 0};n.push(s)}return n}function ko(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}function Bo(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,c=e+(r-(o-i)+(n-i)),s=o+c;return[c-(s-o),s]}const zo=Re,Fo=Vn,Lo=Ut,Yo=Bo,{abs:Ho}=Math;function Xo(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=zo(s,n),l=zo(r,i),a=3*(r-i),p=Fo(3,l),h=Ho(a),d=Lo(f,p),g=h+Ho(s-n+a),v=zo(i,2*r),m=Yo(v,n),x=Ho(i-2*r+n),b=Fo(3,m),w=6*x,_=zo(r,n),M=Fo(3,_),S=Ho(3*(r-n)),I=zo(u,e),N=zo(o,c),y=3*(o-c),C=Fo(3,N),O=Ho(y),E=Lo(I,C),T=O+Ho(u-e+y),A=zo(c,2*o),P=Yo(A,e),k=Ho(c-2*o+e),B=Fo(3,P),z=6*k,F=zo(o,e);return{coeffs:[[d,b,M,[0,n]],[E,B,Fo(3,F),[0,e]]],errorBound:[[g,w,S,0],[T,z,Ho(3*(o-e)),0]]}}function $o(t){const[[n,e],[r,o],[i,c]]=t,s=i-2*r,u=zo(i,2*r),f=Yo(u,n),l=Ho(s+n),a=zo(2*r,2*n),p=c-2*o,h=zo(c,2*o),d=Yo(h,e),g=Ho(p+e);return{coeffs:[[f,a,[0,n]],[d,zo(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[g,0,0]]}}function Vo(t){const[[n,e],[r,o]]=t;return[[zo(r,n),[0,n]],[zo(o,e),[0,e]]]}const Do=Zt,qo=Vn,jo=ot,{abs:Wo}=Math;function Qo(t){const[[n,[,e]],[r,[,o]]]=Vo(t),i=jo(r),c=n,s=qo(o,n),u=Wo(s[1]),f=qo(e,r),l=Wo(f[1]),a=Do(f,s);return{coeffs:{vₓ:i,vᵧ:c,v:a},errorBound:{v_:u+l+Wo(a[1])}}}const{abs:Ro}=Math,Go=Ut,Uo=Vn,Zo=Wn;function Jo(t){return[-t[0],-t[1]]}const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Math,oc=Z,ic=lt,cc=nt,sc=at;function uc(t){if(4===t.length)return fc(t);if(3===t.length)return lc(t);if(2===t.length)return ac(t);if(1===t.length)return function(t){const[[n,e]]=t;return[[[n]],[[e]]]}(t);throw new Error("The given bezier curve must be of order <= cubic.")}function fc(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[J(oc(s,n),cc(3,oc(r,i))),cc(3,sc(ic(i,n),-2*r)),cc(3,oc(r,n)),[n]].map(Pn),[J(oc(u,e),cc(3,oc(o,c))),cc(3,sc(ic(c,e),-2*o)),cc(3,oc(o,e)),[e]].map(Pn)]}function lc(t){const[[n,e],[r,o],[i,c]]=t;return[[sc(ic(i,n),-2*r),oc(2*r,2*n),[n]],[sc(ic(c,e),-2*o),oc(2*o,2*e),[e]]]}function ac(t){const[[n,e],[r,o]]=t;return[[oc(r,n),[n]],[oc(o,e),[e]]]}const pc=nt,hc=ot;function dc(t){const[[n,[e]],[r,[o]]]=t;if(0!==ct(n)||0!==ct(r))return{vₓ:hc(r),vᵧ:n,v:Pn(it(pc(e,r),pc(o,n)))}}const gc=nt,vc=et,mc=J;function xc(t,n){const e=ac(t),[[r,[o]],[i,[c]]]=ac(n),{vₓ:s,vᵧ:u,v:f}=dc(e),l=vc(r,s),a=vc(i,u),p=mc(l,a),h=gc(o,s),d=gc(c,u),g=mc(h,d);return[p,mc(g,f)].map(Pn)}const bc=nt,wc=mr,_c=it,Mc=et,Sc=ot;function Ic(t){const[[n,e,[r]],[o,i,[c]]]=t;if(0===ct(n)&&0===ct(o))return dc([[e,[r]],[i,[c]]]);const s=Mc(n,i),u=Mc(e,o),f=bc(c,n),l=bc(r,o),a=bc(c,e),p=bc(r,i),h=Mc(n,n),d=Mc(n,o),g=Mc(o,o),v=_c(s,u),m=_c(f,l),x=_c(a,p),b=Pn(Sc(g)),w=Pn(wc(d)),_=Pn(Sc(h)),M=Mc(i,v),S=wc(Mc(o,m)),I=Pn(_c(M,S)),N=wc(Mc(n,m)),y=Mc(e,v),C=Pn(_c(N,y)),O=Mc(v,x),E=Mc(m,m);return{vₓₓ:b,vₓᵧ:w,vᵧᵧ:_,vₓ:I,vᵧ:C,v:Pn(_c(O,E))}}const Nc=Kn,yc=nt,Cc=et,Oc=J,Ec=mr;function Tc(t,n){const e=lc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return xc([t[0],t[2]],n);const[[r,[o]],[i,[c]]]=ac(n),{vₓₓ:s,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=Ic(e),h=Nc(o,o),d=yc(o,r),g=Nc(o,c),v=yc(o,i),m=Cc(r,r),x=yc(c,r),b=Cc(r,i),w=Nc(c,c),_=yc(c,i),M=Cc(i,i),S=Cc(m,s),I=Cc(M,f),N=Cc(b,u),y=Oc(S,I),C=Oc(y,N),O=Cc(d,s),E=Cc(_,f),T=Oc(v,x),A=Cc(T,u),P=Ec(Oc(O,E)),k=Oc(P,A),B=Cc(r,l),z=Cc(i,a),F=Oc(B,z),L=Oc(k,F),Y=Cc(h,s),H=Cc(g,u),X=Cc(w,f),$=Oc(Y,H),V=Oc($,X),D=yc(o,l),q=yc(c,a),j=Oc(D,q),W=Oc(V,j);return[C,L,Oc(W,p)].map(Pn)}const Ac=et,Pc=Z,kc=tt,Bc=lt;function zc(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[rt(it(kc(Bc(c/4,u/4),3),Bc(t/4,l/4))),rt(it(kc(Bc(s/4,f/4),3),Bc(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Pc(o,e),a=Pc(i,r),p=Pc(u,c),h=Pc(f,s),d=it(Ac(p,a),Ac(h,l));if(0===ct(d))return;const g=Pc(c,e),v=Pc(s,r),m=rt(it(Ac(v,l),Ac(g,a)))/rt(d);return[c+m*rt(p),s+m*rt(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}const Fc=nt,Lc=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),gt=Wc(lt,at),vt=Wc(dt,gt),mt=Wc(pt,ht),xt=Wc(vt,mt),bt=Wc(C,T),wt=Wc(k,A),_t=Wc(bt,a),Mt=Wc(wt,h),St=jc(m,_t),It=jc(I,Mt),Nt=jc(b,p),yt=Wc(St,It),Ct=Wc(yt,Nt),Ot=qc(o,d),Et=qc(c,g),Tt=Wc(Ot,Et),At=Wc(Ct,Tt);return[D,tt,xt,Wc(At,v)].map(Pn)}const Gc=nt,Uc=et,Zc=J;function Jc(t,n){const e=ac(t),[[r,o,[i]],[c,s,[u]]]=lc(n);if(0===ct(r)&&0===ct(c))return xc(t,[n[0],n[2]]);const{vₓ:f,vᵧ:l,v:a}=dc(e),p=Uc(r,f),h=Uc(c,l),d=Zc(p,h),g=Uc(o,f),v=Uc(s,l),m=Zc(g,v),x=Gc(i,f),b=Gc(u,l),w=Zc(x,b);return[d,m,Zc(w,a)].map(Pn)}const Kc=Kn,ts=nt,ns=et,es=J,rs=mr;function os(t,n){const e=lc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return Jc([t[0],t[2]],n);const[[r,o,[i]],[c,s,[u]]]=lc(n);if(0===ct(r)&&0===ct(c))return Tc(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:a,vₓ:p,vᵧ:h,v:d}=Ic(e),g=Kc(i,i),v=ts(i,o),m=ts(i,r),x=Kc(i,u),b=ts(i,s),w=ts(i,c),_=ns(o,o),M=ns(o,r),S=ts(u,o),I=ns(o,s),N=ns(o,c),y=ns(r,s),C=ns(r,r),O=ts(u,r),E=ns(r,c),T=Kc(u,u),A=ts(u,s),P=ts(u,c),k=ns(s,s),B=ns(s,c),z=ns(c,c),F=ns(C,f),L=ns(E,l),Y=ns(z,a),H=es(F,L),X=es(H,Y),$=ns(M,f),V=ns(B,a),D=es(N,y),q=ns(D,l),j=rs(es($,V)),W=es(j,q),Q=es(rs(m),_),R=es(rs(P),k),G=es(w,I),U=es(G,O),Z=ns(Q,f),J=ns(R,a),K=ns(U,l),tt=ns(r,p),nt=ns(c,h),et=es(Z,J),rt=es(et,K),ot=es(tt,nt),it=es(rt,ot),st=ns(v,f),ut=ns(A,a),ft=es(b,S),lt=ns(ft,l),at=rs(es(st,ut)),pt=ns(o,p),ht=ns(s,h),dt=es(at,lt),gt=es(pt,ht),vt=es(dt,gt),mt=ns(g,f),xt=ns(x,l),bt=ns(T,a),wt=ts(i,p),_t=ts(u,h),Mt=es(mt,xt),St=es(Mt,bt),It=es(wt,_t),Nt=es(St,It);return[X,W,it,vt,es(Nt,d)].map(Pn)}const is=Kn,cs=nt,ss=et,us=J,fs=mr;function ls(t,n){const e=fc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return os(zc(t),n);const[[r,o,[i]],[c,s,[u]]]=lc(n);if(0===ct(r)&&0===ct(c))return Rc(t,[n[0],n[2]]);const{vₓₓₓ:f,vₓₓᵧ:l,vₓᵧᵧ:a,vᵧᵧᵧ:p,vₓₓ:h,vₓᵧ:d,vᵧᵧ:g,vₓ:v,vᵧ:m,v:x}=Vc(e),b=is(i,i),w=cs(i,o),_=cs(i,r),M=is(i,u),S=cs(i,s),I=cs(i,c),N=ss(o,o),y=ss(o,r),C=cs(u,o),O=ss(o,s),E=ss(o,c),T=ss(r,s),A=ss(r,r),P=cs(u,r),k=ss(r,c),B=is(u,u),z=cs(u,s),F=cs(u,c),L=ss(s,s),Y=ss(s,c),H=ss(c,c),X=ss(r,f),$=ss(r,a),V=ss(c,l),D=ss(c,p),q=us(X,V),j=us($,D),W=ss(A,q),Q=ss(H,j),R=us(W,Q),G=us(_,N),U=us(F,L),Z=us(fs(_),N),J=us(fs(F),L),K=us(fs(O),P),tt=us(fs(O),I),nt=us(fs(P),O),et=us(cs(6,_),N),rt=us(cs(6,F),L),ot=us(E,T),it=us(I,P),st=us(fs(C),S),ut=us(fs(S),C),ft=us(I,O),lt=us(ft,P),at=cs(3,A),pt=cs(3,H),ht=ss(at,f),dt=ss(A,l),gt=fs(ss(k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n),Zn=ss(o,v),Jn=ss(s,m),Kn=ss($n,f),te=ss(Vn,p),ne=ss(Dn,l),ee=ss(qn,a),re=us(Kn,te),oe=us(ne,ee),ie=us(re,oe),ce=us(Gn,Un),se=us(Zn,Jn),ue=us(ie,ce),fe=us(ue,se),le=cs(i,f),ae=cs(i,a),pe=cs(u,l),he=cs(u,p),de=us(le,pe),ge=us(ae,he),ve=us(de,h),me=us(ge,g),xe=ss(b,ve),be=ss(B,me),we=ss(M,d),_e=cs(i,v),Me=cs(u,m),Se=us(xe,be),Ie=us(Se,we),Ne=us(_e,Me),ye=us(Ie,Ne);return[R,Nt,Wt,dn,Xn,fe,us(ye,x)].map(Pn)}const as=nt,ps=et,hs=J;function ds(t,n){const e=ac(t),[[r,o,i,[c]],[s,u,f,[l]]]=fc(n);if(0===ct(r)&&0===ct(s))return Jc(t,zc(n));const{vₓ:a,vᵧ:p,v:h}=dc(e),d=ps(r,a),g=ps(s,p),v=hs(d,g),m=ps(o,a),x=ps(u,p),b=hs(m,x),w=ps(i,a),_=ps(f,p),M=hs(w,_),S=as(c,a),I=as(l,p),N=hs(S,I);return[v,b,M,hs(N,h)].map(Pn)}const gs=Kn,vs=nt,ms=et,xs=J,bs=mr;function ws(t,n){const e=lc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return ds([t[0],t[2]],n);const[[r,o,i,[c]],[s,u,f,[l]]]=fc(n);if(0===ct(r)&&0===ct(s))return os(t,zc(n));const{vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=Ic(e),m=gs(c,c),x=vs(c,i),b=vs(c,o),w=vs(c,r),_=gs(c,l),M=vs(c,f),S=vs(c,u),I=vs(c,s),N=ms(i,i),y=ms(i,o),C=ms(i,r),O=vs(l,i),E=ms(i,f),T=ms(i,u),A=ms(i,s),P=ms(o,f),k=ms(o,o),B=ms(o,r),z=vs(l,o),F=ms(o,u),L=ms(o,s),Y=ms(r,r),H=vs(l,r),X=ms(r,f),$=ms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[1],a=u[1],p=e[1],h=r[1],d=o[1],g=l*p,v=2*Ro(g),m=Zo(c,e),x=a*h,b=2*Ro(x),w=Zo(u,r),_=g+x,M=Go(m,w),S=v+b+Ro(_),I=s*p,N=Uo(s,e),y=Ro(I),C=f*h,O=Uo(f,r),E=Ro(C),T=I+C,A=Go(N,O),P=y+E+Ro(T);return{coeffs:[M,Go(A,o)],errBound:[S,P+i+Ro(T+d)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=Qo(t),{coeffs:[[c,s,[,u]],[f,l,[,a]]],errorBound:[[p],[h]]}=$o(n),d=e[1],g=r[1],v=o[1],m=Ei(d),x=Ei(g),b=s[1],w=c[1],_=l[1],M=f[1],S=w*d,I=Oi(c,e),N=p*m+2*Ei(S),y=M*g,C=Oi(f,r),O=h*x+2*Ei(y),E=S+y,T=yi(I,C),A=N+O+Ei(E),P=b*d,k=Oi(s,e),B=2*Ei(P),z=_*g,F=Oi(l,r),L=2*Ei(z),Y=P+z,H=yi(k,F),X=B+L+Ei(Y),$=Ci(u,e),V=u*d,D=Ei(V),q=Ci(a,r),j=a*g,W=Ei(j),Q=V+j,R=yi($,q),G=D+W+Ei(Q),U=Q+v;return{coeffs:[T,H,yi(R,o)],errBound:[A,X,G+i+Ei(U)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=Qo(t),{coeffs:[[c,s,u,[,f]],[l,a,p,[,h]]],errorBound:[[d,g,v],[m,x,b]]}=Xo(n),w=ji(e[1]),_=ji(r[1]),M=qi(c,e),S=d*w+2*ji(M[1]),I=qi(l,r),N=m*_+2*ji(I[1]),y=Vi(M,I),C=S+N+ji(y[1]),O=qi(s,e),E=g*w+2*ji(O[1]),T=qi(a,r),A=x*_+2*ji(T[1]),P=Vi(O,T),k=E+A+ji(P[1]),B=qi(u,e),z=v*w+2*ji(B[1]),F=qi(p,r),L=b*_+2*ji(F[1]),Y=Vi(B,F),H=z+L+ji(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ms(c,h),Ko=Ms(l,d),ti=Is(Jo,Ko),ni=Is(Zo,g),ei=Is(ti,m),ri=Ss(_,ni),oi=Ss(Q,ei),ii=Is(ri,oi),ci=Ss(N,v),si=Is(ii,ci),ui=Ms(c,x),fi=Ms(l,b),li=Is(ui,fi),ai=Is(si,li);return[dt,Ct,Jt,Fn,be,Ke,$r,Io,Ro,Is(ai,w)].map(Pn)}]];function Os(t,n){const{coeffs:e,errBound:r}=ys[t.length-2][n.length-2](t,n);return{coeffs:e,errBound:r,getPExact:()=>Cs[t.length-2][n.length-2](t,n)}}const Es=134217729;function Ts(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r/i,s=i*c,u=Es*i,f=u-(u-i),l=i-f,a=Es*c,p=a-(a-c),h=c-p,d=o*c,g=s+d,v=d-(g-s)+(l*h-(s-f*p-l*p-f*h)),m=g+v,x=(r-m+(e-(v-(m-g))))/i,b=c+x;return[x-(b-c),b]}const As=Ts,Ps=Number.EPSILON/2,ks=Ps*Ps,Bs=Zt,zs=Zt,Fs=Wn,Ls=Ut,Ys=Zt,Hs=Re,Xs=Bo;function $s(t,n){if(0===n[0]&&0===n[1])return t[0].map(t=>[0,t]);if(0===n[0]&&1===n[1])return t[t.length-1].map(t=>[0,t]);if(4===t.length){const[[e,r],[o,i],[c,s],[u,f]]=t,l=Xs(Fs(Hs(o,e),n),e),a=Xs(Fs(Hs(c,o),n),o),p=Xs(Fs(Hs(u,c),n),c),h=Ls(l,Fs(Ys(a,l),n)),d=Ls(a,Fs(Ys(p,a),n)),g=Ls(h,Fs(Ys(d,h),n)),v=Xs(Fs(Hs(i,r),n),r),m=Xs(Fs(Hs(s,i),n),i),x=Xs(Fs(Hs(f,s),n),s),b=Ls(v,Fs(Ys(m,v),n)),w=Ls(m,Fs(Ys(x,m),n));return[g,Ls(b,Fs(Ys(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=Ls([0,e],Fs(Hs(o,e),n)),f=Ls([0,o],Fs(Hs(c,o),n)),l=Ls(u,Fs(Ys(f,u),n)),a=Ls([0,r],Fs(Hs(i,r),n)),p=Ls([0,i],Fs(Hs(s,i),n));return[l,Ls(a,Fs(Ys(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Xs(Fs(Hs(o,e),n),e),Xs(Fs(Hs(i,r),n),r)]}if(1===t.length){const[n,e]=t[0];return[[0,n],[0,e]]}throw new Error("The given bezier curve must be of order <= 3.")}const{abs:Vs}=Math,Ds=[0,1],qs=Zt,js=Bo,Ws=Ut,Qs=Wn,Rs=Vn,Gs=Ge,Us=function(t,n,e,r){const o=t[0],i=t[1],c=n[0],s=n[1],u=As(t,n),f=Math.abs(o+i),l=Math.abs(c+s),a=l-Ps*l-r;return a<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/a**2+9*ks*Math.abs(f/l)}},Zs=function(t,n){return Bs(t,n)[1]>0?n:t},Js=function(t,n){return zs(t,n)[1]>0?t:n};function Ks(t,n){return n[0][0]!==n[1][0]||n[0][1]!==n[1][1]?4===t.length?function([[t,n],[e,r],[o,i],[c,s]],[u,f]){const l=qs(f,u),a=3*Fe*Vs(l[1]),p=qs(Ds,u),h=3*Fe*Vs(p[1]),d=Us(l,p,a,h);f=js(d.est,d.err);const g=qs(Ds,u),v=Qs(u,u),m=Qs(u,g),x=Qs(g,g),b=Qs(v,u),w=Qs(v,g),_=Qs(x,u),M=Qs(x,g),S=qs(Ds,f),I=Qs(f,f),N=Qs(f,S),y=Qs(S,S),C=Qs(I,f),O=Qs(I,S),E=Qs(y,f),T=Qs(y,S),A=Vs(u[1]),P=Vs(g[1]),k=Vs(v[1]),B=Vs(m[1]),z=Vs(x[1]),F=Vs(b[1]),L=Vs(w[1]),Y=Vs(_[1]),H=Vs(M[1]),X=Vs(f[1]),$=Vs(S[1]),V=Vs(I[1]),D=Vs(N[1]),q=Vs(y[1]),j=Vs(C[1]),W=Vs(O[1]),Q=Vs(E[1]),R=Vs(T[1]);let G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(c[1]),u=qs(Ds,o),f=3*Fe*Vs(u[1]),l=Us(c,u,s,f);i=js(l.est,l.err);const a=qs(Ds,o),p=qs(Ds,i),h=Vs(o[1]),d=Vs(a[1]),g=Vs(i[1]),v=Vs(p[1]);let m=Vs(t),x=Vs(n),b=Vs(e),w=Vs(r);const _=Ws(Rs(e,o),Rs(t,a)),M=Ws(Rs(e,i),Qs(_,p));m=b*h+m*d,b=b*g+m*v,m*=3*ze,b*=7*ze;const S=Ws(Rs(r,o),Rs(n,a)),I=Ws(Rs(r,i),Qs(S,p));x=w*h+x*d,w=w*g+x*v,x*=3*ze,w*=7*ze;const N=Zs(js(_,-m),js(M,-b)),y=Js(js(_,+m),js(M,+b));return[[N,Zs(js(S,-x),js(I,-w))],[y,Js(js(S,+x),js(I,+w))]]}(t,n):function(t,n){const e=t[0],r=t[t.length-1];if(0===n[0]&&0===n[1]){const t=[0,e[0]],n=[0,e[1]];return[[t,n],[t,n]]}if(0===n[0]&&1===n[1]){const t=[0,r[0]],n=[0,r[1]];return[[t,n],[t,n]]}const o=$s(t,n);let i;if(4===t.length)i=ke(t,n).map(t=>16*Ye*t);else if(3===t.length)i=ke(t,n).map(t=>10*Ye*t);else if(2===t.length)i=ke(t,n).map(t=>4*Ye*t);else if(1===t.length)return[o,o];return[[js(o[0],-i[0]),js(o[1],-i[1])],[js(o[0],+i[0]),js(o[1],+i[1])]]}(t,n[0])}function tu(t){return(n,e)=>{let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;return(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])&&([o,c]=[c,o]),(u[1]>l[1]||u[1]===l[1]&&u[0]>l[0])&&([u,l]=[l,u]),(r[1]>i[1]||r[1]===i[1]&&r[0]>i[0])&&([r,i]=[i,r]),(s[1]>f[1]||s[1]===f[1]&&s[0]>f[0])&&([s,f]=[f,s]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>=s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<=c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>=o[0]):(r[1]<f[1]||r[1]===f[1]&&r[0]<f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function nu(t){return[((n=t.x.box)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];var n}function eu(t,n){const e=Os(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,c=Te(r,0,1,o,i)||[];return 0!==c.length?{ris:c.map(ko),getPExact:i}:void 0}function ru(t){const n=rt(t.tS);return{t:n,tS:n,tE:rt(t.tE),multiplicity:t.multiplicity}}function ou(t,n){const e=eu(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const c=()=>(o=o||r(),o),s=eu(n,t);if(void 0===s)return[];let{ris:u}=s;const{getPExact:f}=s;let l;const a=()=>(l=l||f(),l);let p;p=1;let h,d=0;t:for(;d<p;){h=u.map(n=>Ks(t,[n.tS,n.tE]));for(let t=0;t<u.length;t++){const n=h[t];for(let e=t+1;e<u.length;e++){const t=h[e];if(tu(!0)(n,t)){const t=[];for(const n of u)t.push(...qr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},a()));u=t,d++;continue t}}}break t}p=1;let g,v=0;t:for(;v<p;){g=i.map(t=>Ks(n,[t.tS,t.tE]));for(let t=0;t<i.length;t++){const n=g[t];for(let e=t+1;e<i.length;e++){const t=g[e];if(tu(!0)(n,t)){const t=[];for(const n of i)t.push(...qr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},c()));i=t,v++;continue t}}}break t}const m=[];for(let t=0;t<u.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=g[e];if(tu(!0)(n,o)){const c={compensated:d,ri:ru(u[t]),riExp:d?u[t]:void 0,getPExact:d?void 0:f,kind:1,box:iu(n)},s={compensated:v,ri:ru(i[e]),riExp:v?i[e]:void 0,getPExact:v?void 0:r,kind:1,box:iu(o)};m.push({psX:c,sideX:s})}}}return m}function iu(t){return t.map(t=>t.map(rt))}function cu(t,n){return function(t,n){const e=t.xs,r=[],o=new Map;for(const t of e){const n=t.curve,e=o.get(n);e?e.push(t):o.set(n,[t])}const i=function(t){const[[n,e],[r,o]]=t.box,i=[[[r,e],[n,e]],[[n,e],[n,o]],[[n,o],[r,o]],[[r,o],[r,e]]];return(n,e,r)=>{const o=n.ps,c=e.slice();for(let t=0;t<i.length;t++){const n=ou(o,i[t]);for(const{psX:e,sideX:r}of n)c.push({x:e,side:t,sideX:r,curve:void 0})}c.sort((t,n)=>t.x.ri.tS-n.x.ri.tS);const s=[],u=[];let f,l;for(const n of c)void 0!==n.side?(!0===l&&(u.push({idx:++r,dir:1,p:nu(n),_x_:f,container:t,side:n.side,sideX:n.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),f.out=u[u.length-1]),l=!1):(!1===l&&(s.push({idx:++r,dir:-1,p:nu(f),_x_:n,container:t,side:f.side,sideX:f.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),n.in_=s[s.length-1]),l=!0),f=n;return{ins:s,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let c,s;({ins:c,outs:s,ioIdx:n}=i(e,o,n)),r.push(...c),r.push(...s)}return{inOuts:r,ioIdx:n}}(t,n)}function su(t,n,e,r){const o=[];for(const r of t)o.push({type:-1,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(uu);const i=new Set,c=[];for(const t of o){const{item:n,type:e}=t;if(-1===e){for(const t of i){const e=r(n,t);e&&c.push({a:n,b:t,u:e})}i.add(n)}else 1===e&&i.delete(n)}return c}function uu(t,n){const e=t.x-n.x;return 0!==e?e:t.type}function fu(t,n,e){const r=(t[0]-e[0])*(n[1]-e[1]),o=(t[1]-e[1])*(n[0]-e[0]),i=r-o;let c;if(r>0){if(o<=0)return i;c=r+o}else{if(!(r<0))return i;if(o>=0)return i;c=-r-o}return Math.abs(i)>=3330669073875472e-31*c?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],c=t[1]-e[1],s=n[1]-e[1],u=it(Kn(o,s),Kn(c,i));let f=rt(u);if(Math.abs(f)>=2220446049250315e-31*r)return f;const l=Z(t[0],e[0])[0],a=Z(n[0],e[0])[0],p=Z(t[1],e[1])[0],h=Z(n[1],e[1])[0];if(0===l&&0===p&&0===a&&0===h)return f;const d=1109335647967049e-46*r+3330669073875471e-31*Math.abs(f);if(f+=o*h+s*l-(c*a+i*p),Math.abs(f)>=d)return f;const g=J(u,it(Kn(l,s),Kn(p,i))),v=J(g,it(Kn(o,h),Kn(c,a)));let m=J(v,it(Kn(l,h),Kn(p,a)));return m=Pn(m),m[m.length-1]}(t,n,e,c)}function lu(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function au(t,n,e){const r=n[0]-t[0],o=n[1]-t[1];return r*(e[0]-n[0])+o*(e[1]-n[1])}const pu=function(t,n){if(0===t.length)return;const e=t.slice(),r=function(t){let n,e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY];for(let r=0;r<t.length;r++){const o=t[r][1];(o<e[1]||o===e[1]&&t[r][0]<e[0])&&(n=r,e=t[r])}return n}(e),[o]=e.splice(r,1);e.sort((t,n)=>{let e=-fu(o,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])}),e.unshift(o);const i=function(t){const n=[t[0]],e=t.length;for(let r=1;r<t.length;r++){const o=t[(r+e-1)%e],i=t[r];o[0]===i[0]&&o[1]===i[1]||n.push(i)}return n}(e),c=[];for(const t of i){for(;c.length>=2&&fu(c[c.length-2],c[c.length-1],t)<0;)c.pop();c.push(t)}if(n||c.length<3)return c;const s=[];{const t=c.length;for(let n=0;n<t;n++){const e=(n+1)%t,r=c[(n+t-1)%t],o=c[n],i=c[e];(0!==fu(r,o,i)||au(r,o,i)<0)&&s.push(o)}}return s},hu=Ut,du=et,gu=J,vu=Wn,{abs:mu}=Math;const{abs:xu}=Math;const{abs:bu}=Math,wu=Wn,_u=Ut,Mu=et,Su=J,{abs:Iu}=Math;function Nu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓ:n,vₓᵧ:e,vᵧᵧ:r,vₓ:o,vᵧ:i,v:f}=function(t){const[[n,e,r],[o,i,c]]=ro(t),s=n*i-e*o,u=n*c-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*s-2*o*u,vᵧ:2*n*u-e*s,v:s*(e*c-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:h,vᵧ_:d,v_:g}=function(t){const[n,e]=t[0],[[r,o],[i,c]]=function(t){const[[n,e],[r,o],[i,c]]=t,s=xu(n),u=xu(r),f=xu(i),l=xu(e),a=xu(o);return[[f+s+2*u,2*(u+s),0],[xu(c)+l+2*a,2*(a+l),0]]}(t),s=bu(n),u=bu(e),f=r*c+o*i,l=r*u+s*i;return{vₓₓ_:i*i,vₓᵧ_:2*r*i,vᵧᵧ_:r*r,vₓ_:c*f+2*i*l,vᵧ_:2*r*l+o*f,v_:f*(o*u+s*c)+l*l}}(t),v=u?0:1,m=Iu(c),x=Iu(s);if((v+12)*Le*(l*(m*m)+a*(m*x)+p*(x*x)+(h*m+d*x)+g)<Iu(n*c*c+e*c*s+r*s*s+(o*c+i*s)+f))return!1}{const{coeffs:{vₓₓ:n,vₓᵧ:o,vᵧᵧ:i,vₓ:u,vᵧ:f,v:l},errorBound:{vₓₓ_:a,vₓᵧ_:p,vᵧᵧ_:h,vₓ_:d,vᵧ_:g,v_:v}}=ii(t),m=Yr(e),x=Yr(r),b=Iu(c),w=Iu(s),_=b/3,M=w/3,S=wu(m,m),I=S[1],N=2*(b*_+I),y=wu(x,x),C=y[1],O=2*(w*M+C),E=wu(m,x),T=Iu(E[1]),A=b*M+_*w+2*T,P=wu(n,S),k=Iu(n[1])*N+a*I+2*Iu(P[1]),B=wu(o,E),z=Iu(o[1])*A+p*T+2*Iu(B[1]),F=wu(i,y),L=Iu(i[1])*O+h*C+2*Iu(F[1]),Y=wu(m,u),H=Iu(u[1])*_+d*b+2*Iu(Y[1]),X=wu(x,f),$=Iu(f[1])*M+g*w+2*Iu(X[1]),V=_u(P,B),D=k+z+Iu(V[1]),q=_u(V,F),j=D+L+Iu(q[1]),W=_u(Y,X),Q=H+$+Iu(W[1]),R=_u(q,W),G=j+Q+Iu(R[1]),U=_u(R,l),Z=G+v+Iu(U[1]);if(Ye*Z<Iu(rt(U)))return!1}{const n=function(t){return Ic(lc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓ:o,vₓᵧ:i,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=n;return 0===ct(Su(Su(Su(Mu(o,Mu(e,e)),Mu(i,Mu(e,r))),Mu(f,Mu(r,r))),Su(Su(Mu(e,l),Mu(r,a)),p)))}}const{abs:yu}=Math,Cu=Wn,Ou=Ut,Eu=et,Tu=J,{abs:Au}=Math;function Pu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:r,vᵧᵧᵧ:o,vₓₓ:i,vₓᵧ:f,vᵧᵧ:l,vₓ:a,vᵧ:p,v:h}=function(t){const[[n,e,r,o],[i,c,s,u]]=eo(t),f=n*s,l=r*i,a=n*c,p=e*i,h=n*n,d=i*i,g=n*u-o*i,v=f-l,m=a-p,x=e*u-o*c,b=e*s-r*c,w=r*u-o*s,_=2*v,M=g*g,S=g*b,I=_*x,N=m*x,y=-3*g-b,C=-3*M-2*S+(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ou(et,it),Mt=ot+ct+Au(_t[1]),St=Ou(st,ft),It=ut+lt+Au(St[1]),Nt=Ou(_t,St),yt=Mt+It+Au(Nt[1]),Ct=Ou(at,ht),Ot=pt+dt+Au(Ct[1]),Et=Ou(Ct,gt),Tt=Ot+vt+Au(Et[1]),At=Ou(Nt,Et),Pt=yt+Tt+Au(At[1]),kt=Ou(mt,bt),Bt=xt+wt+Au(kt[1]),zt=Ou(kt,d),Ft=Bt+I+Au(zt[1]),Lt=Ou(At,zt),Yt=Pt+Ft+Au(Lt[1]);if(Ye*Yt<Au(rt(Lt)))return!1}{const n=function(t){return Vc(fc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];n.hasOwnProperty("vₓₓₓ")||(n.vₓₓₓ=[0],n.vₓₓᵧ=[0],n.vₓᵧᵧ=[0],n.vᵧᵧᵧ=[0]),n.hasOwnProperty("vₓₓ")||(n.vₓₓ=[0],n.vₓᵧ=[0],n.vᵧᵧ=[0]);const{vₓₓₓ:o,vₓₓᵧ:i,vₓᵧᵧ:f,vᵧᵧᵧ:l,vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=n,m=Eu(e,e),x=Eu(e,m),b=Eu(r,r),w=Eu(r,b),_=Eu(r,m),M=Eu(e,b),S=Eu(e,r),I=Eu(o,x),N=Eu(i,_),y=Eu(f,M),C=Eu(l,w),O=Eu(a,m),E=Eu(p,S),T=Eu(h,b),A=Eu(e,d),P=Eu(r,g),k=Tu(I,N),B=Tu(y,C),z=Tu(k,B),F=Tu(O,E),L=Tu(F,T),Y=Tu(z,L),H=Tu(A,P),X=Tu(H,v);return 0===ct(Tu(Y,X))}}function ku(t,n){const{coeffs:e,errBound:r,getPExact:o}=Os(t,n);return Te(e,0,1,r,o)}const{min:Bu,max:zu}=Math;function Fu(t,n){let[[e,r],[o,i]]=t,[[c,s],[u,f]]=n;if(e>o&&([e,o]=[o,e]),c>u&&([c,u]=[u,c]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]),e<=u&&o>=c&&s<=i&&f>=r)return[[zu(e,c),zu(r,s)],[Bu(o,u),Bu(i,f)]]}function Lu(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=ku(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map(n=>qe(t,[n.tS,n.tE])),i=e.map(t=>qe(n,[t.tS,t.tE])),c=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const s=Fu(n,i[o]);if(void 0!==s){const n={ri:r[t],box:s,kind:1},i={ri:e[o],box:s,kind:1};c.push([n,i])}}}return c}function Yu(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const c=r[i-1],s=r[i%o],u=[s[1]-c[1],c[0]-s[0]];let f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let n=0;n<t.length;n++){const e=u[0]*t[n][0]+u[1]*t[n][1];e<f&&(f=e),e>l&&(l=e)}let a=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<a&&(a=e),e>p&&(p=e)}if(e&&(l<a||p<f))return!1;if(!e&&(l<=a||p<=f))return!1}}return!0}const Hu=Kn,Xu=J,{abs:$u}=Math;function Vu(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=$u(3*r)+$u(f)+($u(3*i)+$u(l))+$u(a);if($u(a)-ze*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=$u(3*o)+$u(h)+($u(3*c)+$u(d))+$u(g);return!($u(g)-ze*v>0)&&0===ct(it(Xu([s],Hu(3,r)),Xu([n],Hu(3,i))))&&0===ct(it(Xu([u],Hu(3,o)),Xu([e],Hu(3,c))))}const Du=lt,{abs:qu}=Math;function ju(t){const[[n,e],[r,o],[i,c]]=t,s=n+i,u=s-2*r,f=qu(s)+qu(u);if(qu(u)-f>0)return!1;const l=e+c,a=l-2*o,p=qu(l)+qu(a);return!(qu(a)-p>0)&&0===ct(it(Du(n,i),[2*r]))&&0===ct(it(Du(e,c),[2*o]))}function Wu(t){const n=t[0][0],e=t[0][1];for(let r=1;r<t.length;r++)if(n!==t[r][0]||e!==t[r][1])return!1;return!0}function Qu(t){return 4===t.length&&Vu(t)&&(t=zc(t)),3===t.length&&ju(t)&&(t=[t[0],t[2]]),2===t.length&&Wu(t)&&(t=[t[0]]),t}const Ru=Number.EPSILON,Gu=Ru/2;function Uu(t,n){return n<0?t<1?t:1-Gu:0===n?1:t>1?t:1+Ru}function Zu(t){const n=function(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),c=0===i?0:16,s=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+c,{sign:o,exponent:s,significand:u}}function Ju(t){return Zu(t).significand}function Ku(t){return Math.log2(t&-t)}function tf(t){if(0===t||!Number.isFinite(t))return NaN;const n=Ju(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=Ku(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function nf(t){return t>=128?7:t>=64?6:t>=32?5:t>=16?4:t>=8?3:t>=4?2:t>=2?1:t>=1?0:NaN}function ef(t){if(0===t||!Number.isFinite(t))return NaN;const n=Ju(t),e=n.length;for(let t=0;t<e;t++){const r=nf(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function rf(t){return Zu(t).exponent}function of(t){if(0===t||!Number.isFinite(t))return NaN;const n=rf(t);return ef(t)-52+n}function cf(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}function sf(t,n){if(0===ct(t=Pn(t)))return[0];const e=of(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=of(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let c=t[o];c=cf(c,i);const s=t.slice(o);return s[0]=c,s}function uf(t){return 0===t?0:ef(t)-tf(t)+1}function ff(t){const n=Pn(t);if(0===ct(n))return 0;const e=n[n.length-1],r=n[0];return rf(e)-rf(r)+(53-tf(r))}function lf(t){return rt(function(t,n,e){let r=n,o=t,i=!1,c=0;e||(c=ff(o)-ff(r)+1,e=c/53+1,i=!0);let s=[1/rt(r)],u=1;for(;;){if(o=et(o,s),u>e)return i?(o=sf(o,c),o):o.slice(o.length-e,o.length);r=et(r,s),s=it([2],r),u*=2}}(t[0],t[1],2))}function af(t){return ct(t[0])*ct(t[1])}function pf(t){return(n,e)=>{const r=uc(n),o=uc(e),i=uc(n.slice().reverse()),c=uc(e.slice().reverse()),s=t(r,o),u=t(i,o),f=t(r,c),l=t(i,c),a=-af(u),p=-af(l),h=lf(s),d=lf(f);return[Uu(h,a),Uu(d,p)]}}const hf=pf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[it(o,r),e]}(t[e],n[e])});function df(t,n){return jr(et(t[0],n[1]),et(t[1],n[0]))*ct(t[1])*ct(n[1])}function gf(t){let n=-1024;for(let e=0;e<t.length;e++){const r=t[e];for(let t=0;t<r.length;t++){const e=r[t];if(0===e)continue;const o=-rf(e)+uf(e)-1;o>n&&(n=o)}}return 0===n?t.map(t=>t.map(t=>BigInt(t))):n>0?t.map(t=>t.map(t=>{if(0===t)return 0n;const e=-rf(t)+uf(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})):t.map(t=>t.map(t=>BigInt(t*2**n)))}function vf(t,n){if(n=n<0n?-n:n,0n===(t=t<0n?-t:t))return n;if(0n===n)return t;for(;0n!==n;){const e=n;n=t%n,t=e}return t}const mf=BigInt(2**53);function xf(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/mf;const o=t%mf;n.push(Number(o)*2**(53*e)),t=r,e++}return Pn(n)}const{round:bf,sqrt:wf}=Math;function _f(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(bf(wf(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function Mf(t){return t<0n?-t:t}function Sf(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function If(t,n){const[e,r]=Nf(t[0],n[0]),[o,i]=Nf(t[1],n[1]);if(0===df(e,o)||0===df(e,i))return e;if(0===df(r,o)||0===df(r,i))return r;throw new Error("An unexpected error occured.")}function Nf(t,n){const[e,r]=t,[o,i]=n,[c,s]=function(t){const[n,e]=gf(t).map(Sf),r=vf(n,e);return[xf(_f(Mf(n/r))),xf(_f(Mf(e/r)))]}([o,e]);return[[it(et(i,s),et(r,c)),et(c,mr(e))],[it(et(i,ot(s)),et(r,c)),et(c,mr(e))]].sort(df)}function yf(t,n){const e=uc(t),r=0===ct(e[0][0])?0:0===ct(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],c=n[2][r];return hf([[e,e],[o,o]],[[i,i],[c,c]])}return pf(If)(t,n)}const{round:Cf,cbrt:Of}=Math;function Ef(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=Mf(t))<=1n)return n*t;let r=BigInt(Cf(Of(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Tf(t){return et(t,t)}const Af=pf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,c=function(t){const[n,e]=gf(t).map(Sf),r=vf(n,e);return[xf(Ef(n/r)),xf(Ef(e/r))]}([o,e]),s=Tf(c[0]);return[it(et(i,Tf(c[1])),et(r,s)),et(nt(3,e),s)]}(t[e],n[e])}),{EPSILON:Pf}=Number,kf=Pf/2+Pf**2/2;function Bf(t){return t>0?t-t*kf:t+t*kf}const{EPSILON:zf}=Number,Ff=zf/2+zf**2/2;function Lf(t){return t>0?t+t*Ff:t-t*Ff}function Yf(t){if(0===t||1===t)return[t,t];const n=Bf(Bf(t)),e=function(t){return Lf(Lf(t))}(t);return[n,e]}function Hf(t,n,e,r){const o=t.ps,i=n.ps,c=[];let s=ku(o,i);if(void 0===s){const r=2**(e-47),s=function(t,n,e=!1){e||(t=Qu(t),n=Qu(n));const r=[,,hf,yf,Af],[o,i]=r[t.length](t,n),[c,s]=r[t.length](n,t),u=[{tA:o,tB:0,bez:"B",start:!0},{tA:i,tB:1,bez:"B",start:!1},{tA:0,tB:c,bez:"A",start:!0},{tA:1,tB:s,bez:"A",start:!1}].sort((t,n)=>t.tA-n.tA);if(u[1].tA===u[2].tA){const n=u[1],e=n.tA,r=n.tB,o=qe(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{t:e,tS:e,tE:e,multiplicity:1},t2:r,ri2:{t:r,tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[a,p]=Yf(f.tA),[h,d]=Yf(f.tB),[g,v]=Yf(l.tA),[m,x]=Yf(l.tB),b=qe(t,[a,p]),w=qe(n,[h,d]),_=qe(t,[g,v]),M=qe(n,[m,x]),S=Fu(b,w),I=Fu(_,M),N={t:a,tS:a,tE:p,multiplicity:1},y={t:h,tS:h,tE:d,multiplicity:1},C={t:g,tS:g,tE:v,multiplicity:1},O={t:m,tS:m,tE:x,multiplicity:1};return[{p:je(S),kind:5,box:S,t1:N.t,ri1:N,t2:y.t,ri2:y},{p:je(I),kind:5,box:I,t1:C.t,ri1:C,t2:O.t,ri2:O}]}(o,i);for(const e of s){const i=Ae(o,e.ri1.tS),s=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:s},curve:t},f={x:{ri:e.ri2,kind:5,box:s},curve:n};c.push([u,f])}return c}if(r&&(s=s.filter(t=>t.tS>0)),0===s.length)return[];const u=Lu(o,i,s);if(void 0===u||0===u.length)return[];for(const e of u){const r={x:e[0],curve:t},o={x:e[1],curve:n};c.push([r,o])}return c}const Xf=He(1);function $f(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[r[0],r[0]],kind:e},curve:n};if(1===t){const o=r[r.length-1];return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=Ae(t,n),r=ke(t,[0,n]);if(4===t.length)return{p:e,pE:r.map(t=>9*Xf*t)};if(3===t.length)return{p:e,pE:r.map(t=>6*Xf*t)};if(2===t.length)return{p:e,pE:r.map(t=>3*Xf*t)};if(1===t.length)return{p:t[0],pE:[0,0]};throw new Error("The given bezier curve must be of order <= 3.")}(r,t);return{x:{ri:{t,tS:t,tE:t,multiplicity:1},box:[[o[0]-i[0],o[1]-i[1]],[o[0]+i[0],o[1]+i[1]]],kind:e},curve:n}}function Vf(t,n){if(n.next===t){if(t.next===n)return;[t,n]=[n,t]}const e=t.ps,r=n.ps;if(function(t,n){if(4===t.length)return Pu(t,n);if(3===t.length)return Nu(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=Qo(t),f=Yr(e),l=Yr(r),a=mu(c),p=mu(s),h=mu(n[1]),d=mu(o[1]),g=a/3,v=p/3,m=n[1]*c,x=vu(f,n),b=h*g+2*mu(m),w=o[1]*s,_=vu(l,o),M=d*v+2*mu(w),S=hu(x,_),I=b+M+mu(S[1]),N=hu(S,i),y=I+u+mu(N[1]);if(Ye*y<mu(rt(N)))return!1}{const n=function(t){return dc(ac(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=du(e,o),a=du(r,i);return 0===ct(gu(gu(l,a),f))}}(t,n);if(1===t.length){const e=Pn(n[0]),r=Pn(n[1]);return 1===e.length&&1===r.length&&e[0]===t[0][0]&&r[0]===t[0][1]}throw new Error("The given bezier curve must be of order <= 3")}(e,r[r.length-1].map(t=>[t]))){const i=Lu(e,r,[(o=1,{t:o,tS:o,tE:o,multiplicity:1})]);if(void 0===i||0===i.length)return;return[[{x:i[0][0],curve:t},$f(1,n,1)]]}var o}function Df(t){return t[t.length-1]<0?ot(t):t}function qf(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}Number.EPSILON;const jf=Number.EPSILON/2;function Wf(t,n,e,r){const o=t/n,i=Math.abs(t),c=Math.abs(n),s=c-r;return s<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(c*e+i*r)/s**2+jf*Math.abs(i/c)}}function Qf(t){const n=t[0],e=t[1];if(0===e)return[0,0];const r=Math.sqrt(e),o=r*r,i=134217729*r,c=i-(i-r),s=r-c,u=.5*(e-o-(s*s-(o-c*c-c*s*2))+n)/r;return[u-(r+u-r),r+u]}const{abs:Rf}=Math;const{abs:Gf}=Math;function Uf(t){const{coeffs:[[n,e,r],[o,i,c]],errorBound:[[s,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s-n,l=r-i,a=f+3*l,p=i+n,h=p-2*r,d=r-n,g=u-e,v=o-c,m=g+3*v,x=c+e,b=x-2*o,w=o-e;return{coeffs:[[a,3*h,3*d,n],[m,3*b,3*w,e]],errorBound:[[Rf(f)+6*Rf(l)+Rf(a),6*(Rf(p)+Rf(h)),6*Rf(d),0],[Rf(g)+6*Rf(v)+Rf(m),6*(Rf(x)+Rf(b)),6*Rf(w),0]]}}(t),a=Gf(n),p=Gf(e),h=Gf(r),d=Gf(o),g=Gf(i),v=Gf(c),m=e*o,x=n*i,b=n*c,w=r*o,_=e*c,M=r*i,S=u*d+p*f+Gf(m),I=s*g+a*l+Gf(x),N=s*v+Gf(b),y=h*f+Gf(w),C=u*v+Gf(_),O=h*l+Gf(M),E=m-x,T=Gf(E),A=S+I+T,P=w-b,k=Gf(P),B=y+N+k,z=_-M,F=Gf(z),L=C+O+F,Y=E*E,H=E*P,X=z*E,$=P*P,V=X+$;return{coeffs:[Y,H,V],errBound:[2*A*T+Gf(Y),A*k+T*B+Gf(H),L*T+F*A+Gf(X)+(2*k*B+Gf($))+Gf(V)].map(t=>Le*t)}}const Zf=et,Jf=J;function Kf(t){const[[n,e,r],[o,i,c]]=fc(t),s=Zf(e,o),u=Zf(n,i),f=Zf(n,c),l=Zf(r,o),a=Zf(e,c),p=Zf(r,i),h=it(s,u),d=it(l,f),g=it(a,p),v=Zf(h,h),m=Zf(h,d),x=Zf(h,g),b=Zf(d,d);return[v,m,Jf(x,b)]}const tl=it,nl=et,el=nt,rl=Re,ol=qf,il=Jo,cl=Ut,sl=Ge,ul=Ts,fl=J,ll=at,al=2*Be,{abs:pl}=Math;function hl(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,c,s]}=Uf(t);if(pl(e)<=i){const[[n,e],[r,o],[i,c],[s,u]]=t,f=fl(rl(s,n),el(3,rl(r,i))),l=ll(ol(i,n),-2*r),a=fl(rl(u,e),el(3,rl(o,c))),p=ll(ol(c,e),-2*o);if(0===jr(nl(l,a),nl(f,p)))return[]}const u=r*r,f=4*e*o,l=u-f,a=2*c*pl(r)+Le*u+(4*(i*pl(o)+pl(e)*s)+Le*pl(f))+Le*pl(l);if(l<-a)return[];if(l>a){const{est:t,err:u}=function(t,n){if(t-n<=0){const e=t>0?Math.sqrt(t):0;return{est:e,err:Math.max(Math.sqrt(t+n)-e,e)}}const e=Math.sqrt(t),r=Math.sqrt(t-n),o=Math.sqrt(t+n);return{est:e,err:Math.max(Math.abs(r-e),Math.abs(o-e))}}(l,a);let f;f=r>=0?-r-t:-r+t;const p=c+u+Le*pl(f),{est:h,err:d}=Wf(f,2*e,p,2*i),{est:g,err:v}=Wf(2*o,f,2*s,p);if(n){if(h+d<0||h-d>1||g+v<0||g-v>1)return[]}else if((h+d<0||h-d>1)&&(g+v<0||g-v>1))return[]}let[p,h,d]=Kf(t);const g=tl(nl(h,h),el(4,nl(p,d))),v=ct(g);if(v<0)return[];if(v>0){const t=Qf(Yr(g));let e;p=Yr(p),h=Yr(h),d=Yr(d),e=ct(h)>=0?il(cl(h,t)):cl(il(h),t);let r=rt(ul(e,sl(p))),o=rt(ul(sl(d),e));if(n){if(r<-al||r>1+al||o<-al||o>1+al)return[]}else if((r<-al||r>1+al)&&(o<-al||o>1+al))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-al&&r<=1+al?o>=0-al&&o<=1+al?[r,o]:[r]:o>=0-al&&o<=1+al?[o]:[]}const m=xr(p);if(ct(h)*ct(m)<0)return[];if(jr(Df(h),Df(m))>0)return[];const x=Yr(h),b=Yr(m),w=ul(x,b),_=w[1]+w[0];return[_,_]}const dl=Number.EPSILON;function gl(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-c)),6*(c+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[2*(i-2*r+n)],[2*(c-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function vl(t){if(4===t.length)return 0===fu(t[0],t[1],t[2])&&0===fu(t[1],t[2],t[3])&&0===fu(t[0],t[2],t[3]);if(3===t.length)return 0===fu(t[0],t[1],t[2]);if(t.length<=2)return!0;throw new Error("The given bezier curve must be of order <= 3.")}function ml(t){if(vl(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Vu(t)&&(t=zc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=i-r,u=s-(r-n),f=c-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(s-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Te(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=G(t),[[s,u],[f,l]]=gl(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i))],[6*(u-e+3*(o-c))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=a*i,d=p*e,g=u*c,v=u*i,m=f*f,x=s*c,b=l*r,w=l*e,_=f*r,M=r*e,S=r*n,I=r*o,N=e*e,y=e*n,C=e*i,O=n*c,E=n*o,T=n*n,A=c*i,P=c*o,k=i*i,B=i*o,z=o*o,F=a*c-p*r,L=u*r+l*c,Y=g-b,H=r*r+c*c,X=C+O,$=P+k,V=S+N,D=e*o+n*i,q=T-z,j=y-B,W=M-A,Q=r*i+e*c,R=P+$,U=S+V,Z=I+X,J=C+X,K=U-R,tt=X+O,nt=I+C+O,et=2*w+_;return{inflectionPoly:[s*o-f*n,u*o+s*i-l*n-f*e,v+x-w-_,g-b],otherExtremaPoly:[T*(h-3*d)+z*(3*h-d)+2*(E*(a*e-p*i+3*(l*f-u*s))+3*s*f*j)+3*(D*(m-s*s)+q*(u*f+l*s)),a*(o*(U+3*$)+n*J)-p*(r*(3*T+z)+e*(3*y+2*B)+n*R)+3*(u*(l*q-u*E+2*(f*j-s*D))+s*(2*l*j+f*(2*(S-P)+(N-k))-s*nt)+l*(l*E+2*f*D)+m*Z),a*(2*r*D+e*tt+i*(4*P+R))-p*(2*r*(3*y+B)+e*(N+2*P)+i*tt)+3*(u*(2*(l*j-s*nt)+f*K-u*D)+s*(2*f*W-s*Q)+l*(l*D+2*f*Z+s*K)+m*Q),a*(r*(I+2*X)+c*(N+3*$))-p*(r*(3*V+R)+c*J)+3*(u*(l*K-u*Z+2*(f*W-s*Q))+s*(r*(et-s*c)-c*(2*l*i+f*c))+l*(l*X+r*(2*f*i+l*o))+f*c*et),H*(h-d)+2*(M+A)*F-3*(L*(v+x-w-_)+(u*e+s*r+l*i+f*c)*Y),F*H-3*L*Y]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Te(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=(n-r)*t[r];return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=R(i,n);R(e,n)*r>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Te(e,0,1)?.map(t=>t.t)||[]}}const{sqrt:xl}=Math;function bl(t,n){const[e,r]=function(t,n){const[e,r]=G(t),[o,i]=gl(t),c=R(e,n),s=R(r,n),u=R(o,n);return[c*R(i,n)-s*u,xl((c*c+s*s)**3)]}(t,n);return e/r}const{abs:wl}=Math,_l=Y(function(t){const{curves:n}=t;let e=oo(n[0].ps).minY,r=n[0];for(let t=1;t<n.length;t++){const o=oo(n[t].ps).minY,i=o.box[0][1],c=e.box[0][1];(i<c||i===c&&o.ts[0]>e.ts[0])&&(e=o,r=n[t])}return{curve:r,y:e}});function Ml(t){const{curve:n,y:e}=_l(t),r=e.ts;return r[0]<=0?[$f(0,n,0),$f(1,n.prev,0)]:r[1]>=1?[$f(1,n,0),$f(0,n.next,0)]:[{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function Sl(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:cf(t,r)}function Il(t,n,e){const r=function(t,n){const e=[];for(const n of t)for(const t of n.curves)e.push(t);const r=su(e,t=>co(t.ps)[0][0],t=>co(t.ps)[1][0],function(t){return(n,e)=>{const r=n.ps,o=e.ps;if(2===r.length&&2===o.length)return function(t,n,e){let r=t.ps,o=n.ps;const i=co(r),c=co(o);if(t.next!==n&&n.next!==t){if(No(!0,i,c)){const r=Hf(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==fu(r[0],r[1],o[1]))return;if(!No(!1,i,c))return;let s;return s=lu(r[0],r[1])>lu(o[0],o[1])?[Fr(zr(r,o[1])[0].ri),1]:[0,Fr(zr(o,r[0])[0].ri)],[[$f(1,t,5),$f(0,n,5)],[$f(s[0],t,5),$f(s[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return No(!1,co(r),co(o))&&Yu(pu(r,!1),pu(o,!1),!1)?e.next===n?Hf(e,n,t,!0):Hf(n,e,t,!0):Vf(n,e);let i=No(!0,co(r),co(o));return i?(i=Yu(pu(r,!1),pu(o,!1),!0),i?Hf(n,e,t,!1):void 0):void 0}}(n)),o=[];for(const t of r)for(const n of t.u)o.push(n);return o}(t,e),o=function(t){const n=[];for(const e of t)for(const t of e.curves){const e=t.ps,r=hl(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-dl,c=r[0]+dl,s=r[1]-dl,u=r[1]+dl,f=qe(e,[i,c]),l=qe(e,[s,u]);n.push([{x:{ri:{t:i,tS:i,tE:c,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{t:s,tS:s,tE:u,multiplicity:1},box:l,kind:o},curve:t}])}return n}(t),i=function(t){const n=[];for(const e of t)for(const t of e.curves)n.push([$f(1,t,4),$f(0,t.next,4)]);return n}(t),{extremes:c,xs:s}=function(t){const n=new Map,e=[];for(const r of t){const t=Ml(r);e.push(t),n.set(r,t)}return{extremes:n,xs:e}}(t),u=function(t,n){const e=[];for(const r of n)for(const n of r.curves){const r=n.ps,o=ml(r),{minima:i,maxima:c}=o,s=[0,1,...i,...c];for(let o of s)wl(bl(r,o))>1e7*2**-t&&e.push([$f(o,n,7),$f(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...s,...u];if("undefined"!=typeof _debug_){const{intersection:t}=_debug_.elems;for(const n of[r,o,i,s,u])for(const e of n)t.push(...e)}let l=f.map(t=>({xs:t,box:[[t[0].x.box[0][0]-n,t[0].x.box[0][1]-n],[t[0].x.box[1][0]+n,t[0].x.box[1][1]+n]],inOuts:void 0}));for(;;){const t=su(l,Nl,yl,yo);if(!t.length)break;const n=new Map;Co(n,t);const e=To(n),r=Ao(l,e);l=[...Po(e),...r]}l=function(t){return t.filter(t=>{const n=t.xs;if(2===t.xs.length){const t=n[0];if(1===t.x.kind&&t.x.ri.multiplicity%2==0)return!1}for(const n of t.xs)if(4!==n.x.kind)return!0;return!1})}(l),l=function(t,n,e){const r=Math.log2(e)-3;return t.map(t=>{const e=t.box.map(t=>t.map(t=>Sl(t,n,n-r)));return{...t,box:e}})}(l,e,n),"undefined"!=typeof _debug_&&_debug_.elems.container.push(...l);let a=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:a}=cu(t,a)),t.inOuts=n}f=f.filter(t=>void 0!==t[0].container),function(t){const n=new Map;for(const e of t)for(const t of e){const e=t.curve.loop,r=n.get(e)||[];r.length||n.set(e,r),r.push(t)}for(const t of n){const n=t[1];if(!n||!n.length)continue;n.sort((t,n)=>{let e=t.curve.idx-n.curve.idx;return 0!==e?e:(e=t.x.ri.tS-n.x.ri.tS,0!==e?e:void 0!==t.in_?-1:1)});const e=n.length;for(let t=0;t<e;t++)n[t].next=n[(t+1)%e],n[t].prev=n[(t-1+e)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.next,void 0===e.in_;);t.nextOrPrev=e.in_,t.idx=t.nextOrPrev.idx}for(const t of l)for(const n of t.inOuts){if(1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.prev,void 0===e.out;);t.nextOrPrev=e.out,t.idx=t.nextOrPrev.idx}return{extremes:c,containers:l}}function Nl(t){return t.box[0][0]}function yl(t){return t.box[1][0]}function Cl(t,n,e){Qr(t,1);const r=t.inOuts,o=r[0],i=r[r.length-1],c=1===o.dir?o:i,s=i.dir,u=0===n.idx?new Set:1===n.orientation?n.loopsIdxs:new Set;return o.orientation=s,o.parent=n,o.windingNum=n.windingNum+s,o.loopsIdxs=new Set(u),o.children=new Set,1===s&&o.loopsIdxs?.add(e.idx),i.orientation=s,i.parent=n,i.windingNum=n.windingNum+s,i.loopsIdxs=new Set(u),i.children=new Set,1===s&&i.loopsIdxs?.add(e.idx),c}function Ol(t){if(!vl(t))return!1;const n=t.map(t=>t[0]),e=t.map(t=>t[1]);return!(El(n)&&El(e))}function El(t){return function(t){for(let n=1;n<t.length;n++)if(t[n-1]>t[n])return!1;return!0}(t)||function(t){for(let n=1;n<t.length;n++)if(t[n-1]<t[n])return!1;return!0}(t)}function Tl(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function Al(t){for(let n=0;n<t.length-1;n++)for(let e=n+1;e<t.length;e++)if(t[n][0]===t[e][0]&&t[n][1]===t[e][1])return!1;return!0}const{abs:Pl}=Math;function kl(t,n,e){if(void 0!==t&&!Wu(t)){if(2===t.length)return t;if(3===t.length){if(Al(t))return vl(t)?[t[0],t[2]]:t;if(zl(t[0],t[2]))return;return[t[0],t[2]]}if(Al(t)){const r=Bl(t);if(void 0===r)return;return function(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e][0]!==n[e][0]||t[e][1]!==n[e][1])return!1;return!0}(r,t)?t:kl(r,n,e)}if(zl(t[0],t[3])){if(vl(t))return;return t}if(vl(t))return[t[0],t[3]];if(zl(t[0],t[1])&&zl(t[1],t[2])||zl(t[1],t[2])&&zl(t[2],t[3])||zl(t[0],t[1])&&zl(t[2],t[3]))return kl([t[0],t[t.length-1]],n,e);if(zl(t[0],t[2])||zl(t[1],t[3])||zl(t[1],t[2]))return t;if(zl(t[0],t[1])){if(lu(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=Tl(X(t[1],t[2]),2*n),o=j(t[1],r);return Bl([t[0],e(o),t[2],t[3]])}}if(zl(t[2],t[3])){if(lu(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=Tl(X(t[2],t[1]),2*n),o=j(t[2],r);return Bl([t[0],t[1],e(o),t[3]])}}}}function Bl(t){return vl(t)?[t[0],t[3]]:Vu(t)?zc(t):t}function zl(t,n){return t[0]===n[0]&&t[1]===n[1]}function Fl(t){return t}function Ll(t,n,e,r=!1,o=!0){const i=function(t,n,e=!0){const r=2**t*2**-n,o=e?function(t,n){return e=>{const r=Sl(e[0],t,n),o=Sl(e[1],t,n);return r===e[0]&&o===e[1]?e:[r,o]}}(t,n):Fl;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const c=n[n.length-1],s=c?c[c.length-1]:o(t[0][0]);i[0]=s,i=i.map(t=>o(t)),Ol(i)&&(i=[i[0],i[i.length-1]]),i=kl(i,r,o),void 0!==i&&n.push(i)}const e=n.length;if(!e)return[];const i=n[e-1];return i[i.length-1]=n[0][0],n}}(e,n,o);let c=t.slice();return c=r?function(t,n,e,r=.02){const o=[];for(const i of t){const t=[];for(const o of i){const i=o.map(t=>t.map(t=>{let o,i=0,c=0,s=0;for(;!(++c>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=Sl(i,e,n);const c=uf(i);c>s&&(s=c,o=i)}return o}));t.push(i)}o.push(t)}return o}(c,n,e,1):c,c=c.map(i),c=c.filter(t=>t.length>0),"undefined"!=typeof _debug_&&(_debug_.timing.normalize=performance.now()-_debug_.timing.timingStart),c}const Yl=Y(t=>{let n=0;for(const e of t)for(const t of e)for(const e of t)for(const t of e){const e=Math.abs(t);e>n&&(n=e)}return n});function Hl(t){let n=0;for(let e=0;e<=t.length-1&&0===t[e];e++)n++;return 0!==n&&(t=t.slice(n)),t}const{max:Xl}=Math;function $l(t,n){const e=t.length-1,r=n.length-1;if(e<0||r<0)return[];const o=e+r,i=new Array(o+1).fill(0);for(let c=0;c<e+1;c++)for(let s=0;s<r+1;s++)i[o-(c+s)]+=t[e-c]*n[r-s];return Hl(i)}function Vl(t,n){const e=t.length-1,r=new Array(e+2);for(let n=0;n<e+1;n++)r[n]=t[n]/(e+1-n);return r[e+1]=n,r}const{min:Dl,max:ql}=Math;function jl(t,n){const e=t.length-1,r=n.length-1,o=ql(e,r),i=new Array(o+1),c=Dl(e,r);for(let s=0;s<=c;s++)i[o-s]=t[e-s]+n[r-s];for(let n=c+1;n<=e;n++)i[o-n]=t[e-n];for(let t=c+1;t<=r;t++)i[o-t]=n[r-t];return Hl(i)}function Wl(t){let n=0;for(const e of t){const[t,r]=no(e),[o,i]=G(e);n+=R(Vl(jl($l(t,i),In($l(r,o))),0),1)}return n/2}function Ql(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Ht(t[e],t[e+1]);return n}const{sqrt:Rl}=Math;function Gl(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=Ql(t);if(256*lu(t[0],t[t.length-1])<s*s){const[r,o]=Ae(t,.5),s=Rl((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=Rl((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return io(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function Ul(t){return{ps:t,ts:[0,1]}}const Zl=tt,Jl=it,Kl=lt,ta=ct,na=it,ea=et,ra=nt,oa=Re,ia=qf,ca=J,sa=at,{abs:ua}=Math,fa={order:0,realOrder:0,collinear:!0,nodeType:"n/a"},la={order:1,realOrder:1,collinear:!0,nodeType:"n/a"},aa={order:1,realOrder:0,collinear:!0,nodeType:"n/a"},pa={order:2,realOrder:2,collinear:!1,nodeType:"n/a"},ha={order:2,realOrder:2,collinear:!0,nodeType:"n/a"},da={order:2,realOrder:1,collinear:!0,nodeType:"n/a"},ga={order:2,realOrder:0,collinear:!0,nodeType:"n/a"},va={order:3,realOrder:3,collinear:!1,nodeType:"crunode"},ma={order:3,realOrder:3,collinear:!1,nodeType:"acnode"},xa={order:3,realOrder:3,collinear:!1,nodeType:"cusp"},ba={order:3,realOrder:3,collinear:!1,nodeType:"explicit"},wa={order:3,realOrder:3,collinear:!0,nodeType:"n/a"},_a={order:3,realOrder:2,collinear:!1,nodeType:"n/a"},Ma={order:3,realOrder:2,collinear:!0,nodeType:"n/a"},Sa={order:3,realOrder:1,collinear:!0,nodeType:"n/a"},Ia={order:3,realOrder:0,collinear:!0,nodeType:"n/a"};const{abs:Na,PI:ya}=Math;function Ca(t,n=[0,1]){if(t.length<=2)return 0;const[e,r]=n;if(e===r)return 0;if(3===t.length){const n=Qt(t,e,r).ps,[[o,i],[c,s],[u,f]]=n;return tn([c-o,s-i],[u-c,f-s])}if(4===t.length){const n=ln(t,e,r).ps,o=function(t){if(4===t.length)return Vu(t)?function(t){if(!vl(t))return!1;const[n,e,r,o]=t,[i,c]=n,[s,u]=e,[f,l]=r,[a,p]=o,h=Jl(Zl(Kl(s/4,f/4),3),Kl(i/4,a/4)),d=Jl(Zl(Kl(u/4,l/4),3),Kl(c/4,p/4));return 0===ta(Jl(Kl(i/2,a/2),h))&&0===ta(Jl(Kl(c/2,p/2),d))}(t)?Wu(t)?Ia:Sa:vl(t)?Ma:_a:vl(t)?wa:function(t){const{coeffs:[n,e,r],errBound:[o,i,c]}=Uf(t);if(ua(n)<=o){const[[n,e],[r,o],[i,c],[s,u]]=t,f=ca(oa(s,n),ra(3,oa(r,i))),l=sa(ia(i,n),-2*r),a=ca(oa(u,e),ra(3,oa(o,c))),p=sa(ia(c,e),-2*o);if(0===jr(ea(l,a),ea(f,p)))return ba}const s=e*e,u=4*n*r,f=s-u,l=2*i*ua(e)+Le*s+(4*(o*ua(r)+ua(n)*c)+Le*ua(u))+Le*ua(f);if(f<-l)return ma;if(f>l)return va;const[a,p,h]=Kf(t),d=ct(na(ea(p,p),ra(4,ea(a,h))));return d<0?ma:d>0?va:xa}(t);if(3===t.length)return vl(t)?ju(t)?Wu(t)?ga:da:ha:pa;if(2===t.length)return Wu(t)?aa:la;if(1===t.length)return fa;throw new Error("The given bezier curve must be of order <= 3")}(n),[[i,c],[s,u],[f,l],[a,p]]=n,h=[s-i,u-c],d=[f-s,l-u],g=[a-f,p-l];if(0===d[0]&&0===d[1]||o.realOrder<=2)return tn(h,g);const v=tn(h,d)+tn(d,g);return"acnode"===o.nodeType||"cusp"===o.nodeType?v<=-ya?v+2*ya:v>=+ya?v-2*ya:v:v}throw new Error("The given bezier curve must be of order <= 3.")}const{round:Oa,PI:Ea}=Math;const{abs:Ta,max:Aa,ceil:Pa,log2:ka}=Math;function Ba(n,e,r={}){"undefined"!=typeof _debug_&&(_debug_.timing.timingStart=performance.now()),e=e||Yl(n);const o=Pa(ka(e)),{inclMicroCorners:i=!0,minLoopArea:c=(2**o*2**-12)**2,forceOrientationNegative:s=!1,booleanOp:u="OR",containerSizeMultiplier:f=16}=r,l=2**o*2**-46*f;(function(t){if("undefined"!=typeof _debug_)for(const n of t){_debug_.elems.loopPre.push(...t),_debug_.elems.loopsPre.push(t);for(const t of n){const n=co(t),e=Gl(t),r=pu(t,!1);_debug_.elems.bezier_.push(t),_debug_.elems.looseBoundingBox_.push(n),_debug_.elems.tightBoundingBox_.push(e),_debug_.elems.boundingHull_.push(r)}}})(n=Ll(n,46,o,!1,!0)),n.sort(wo);const a=n.map((n,e)=>t(n,e)),{extremes:p,containers:h}=Il(a,l,o),d={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0,loopsIdxs:new Set,orientation:-1},g=new Set,v=new Set;for(const t of a){if(g.has(t))continue;g.add(t);const n=bo(d,t),e=p.get(t)[0].container;if(0===e.inOuts.length)continue;const r=Cl(e,n,t),o=2===e.inOuts.length&&2===e.xs.length;if(o&&e.inOuts[0].nextOrPrev===e.inOuts[1])r.bezierPieces=t.beziers.map(Ul),r.parent.children=r.parent.children||new Set,r.parent.children.add(r);else if(to(r,g,v,!1),o&&void 0!==r.bezierPieces){const{bezierPieces:t}=r,n=t[t.length-1],e=t[0];if(n.ps===e.ps){const r={ps:n.ps,ts:[n.ts[0],e.ts[1]]};t.shift(),t.pop(),t.unshift(r)}}}const m=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(...t.children),e.push(...t.children),0===t.windingNum&&(t.children=new Set)}return n}(d),x=function(t){return n=>{const e="OR"===t||"XOR"===t?[n]:[];n.used="OR"===t||"XOR"===t;const r=Array.from(n.children);for(;r.length;){const n=r.pop();if("OR"===t&&0===n.windingNum&&e.push(n),"AND"===t){const t=Io(n);(0===n.windingNum&&t||Mo(n.windingNum)>=2&&!t)&&(e.push(n),n.used=!0)}if("XOR"===t){const t=Io(n);(0===n.windingNum&&t||Mo(n.windingNum)>=2&&t)&&(e.push(n),n.used=!0)}for(const t of n.children)r.push(t)}return e}}(u),b=m.map(x).filter(t=>0!==t.length).map(n=>{const e=n[0].orientation;return n.map((n,r)=>function(n,e,r,o){const i=n.bezierPieces?.map(Jr);if(void 0===i)return t([],r);const{orientation:c}=n,s=o?-1:e;return t((0===r?s:-s)*c>0?i:i.map(t=>t.toReversed()).toReversed(),r)}(n,e,r,s))}),w=[];for(let t=0;t<b.length;t++){const n=b[t].filter(t=>Ta(Wl(t.beziers))>c);n.length&&(n.sort((t,n)=>wo(t.beziers,n.beziers)),w.push(n))}"undefined"!=typeof _debug_&&(_debug_.timing.simplifyPaths=performance.now()-_debug_.timing.timingStart-_debug_.timing.normalize);const _=i?w:w.map(n=>n.map(n=>{const{beziers:e}=n,r=function(t,n){!function(t){Oa(function(t){const n=t.length;let e=0;for(let r=0;r<n;r++){const o=t[(r-1+n)%n],i=t[r];e+=Ca(i,[0,1])+tn(U(o,1),U(i,0))}return e}(t)/(2*Ea))}(t);const e=t.map(t=>t.map(t=>[t[0],t[1]])).filter(t=>Ql(t)>n),r=e.length;for(let t=0;t<r;t++){const n=e[t],o=e[(t+1)%r],i=n[n.length-1],c=o[0];c[0]===i[0]&&c[1]===i[1]||(i[0]=c[0],i[1]=c[1])}return e}(e,Aa(...h.map(t=>Ta(t.box[0][0]-t.box[1][0])),...h.map(t=>Ta(t.box[0][1]-t.box[1][1]))));return t(r,n.idx)}));return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.elems.loop.push(...n),_debug_.elems.loops.push(n)}(_),_}const{max:za,abs:Fa}=Math;function La(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=n[0],g=n[1],v=c-d,m=u-d,x=l-d,b=p-d,w=s-g,_=f-g,M=a-g,S=h-g,I=v*v,N=6*v*m,y=6*x*b,C=w*w,O=6*w*_,E=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b-y+(I-N)+T+(P-A)+(S*S-E+(C-O)+k+(z-B))),5*(y+5*N+3*A-2*(T+2*P+3*I)+(E+5*O+3*B-2*(k+2*z+3*C))),4*(T-3*(A-2*P)-5*(2*N-3*I)+(k-3*(B-2*z)-5*(2*O-3*C))),3*(A-2*(2*P-5*(N-2*I))+(B-2*(2*z-5*(O-2*C)))),2*(P-5*(N-3*I)+(z-5*(O-3*C))),N-6*I+(O-6*C)]}function Ya(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n[0],p=n[1],h=i-a,d=s-a,g=f-a,v=c-p,m=u-p,x=l-p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,I=m*x,N=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*N-4*(I+S)+(g*g+b+2*y-4*(_+w)),3*(I-N+(3*S-M)+(_-y+(3*w-b))),N-3*(2*S-M)+(y-3*(2*w-b)),S-M+(w-b)]}function Ha(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=u*f+l*a,h=l*l+u*u;return[f*f+a*a+(h-2*p),p-h]}const{sqrt:Xa}=Math;function $a(t,n,e=!0){let r;if(4===t.length)r=La(t,n);else if(3===t.length)r=Ya(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Ht(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}r=Ha(t,n)}const o=Te(r,0,1)?.map(t=>t.t)||[];e&&(o.push(0),o.push(1));let i,c=Number.POSITIVE_INFINITY;for(const e of o){const r=Ae(t,e),o=lu(r,n);o<c&&(c=o,i={p:r,t:e,d:Xa(o)})}return i}const{sqrt:Va}=Math,{abs:Da}=Math;function qa(t){let n=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++){const r=t[e],o=Da(r[0]),i=Da(r[1]);o>n&&(n=o),i>n&&(n=i)}return n}const{max:ja}=Math;function Wa(t){return ja(t.hL+t.hEL,t.hR+t.hER)}function Qa(t,n){const e=Wa(t)-Wa(n);return 0!==e?e:t.tS-n.tS}class Ra{compare;heap=[];constructor(t){this.compare=t}insert(t){const n=this.heap;n.push(t);let e=n.length-1;for(;;){const r=(e-1-(e+1)%2)/2;if(-1===r)return;const o=n[r];if(this.compare(t,o)<0)break;n[r]=t,n[e]=o,e=r}}popMax(){const t=this.heap,n=t[0];return t[0]=t[t.length-1],t.length--,this.swimDown(),n}swimDown(){const t=this.heap,n=t.length;let e=0;for(;;){const r=2*e+1;if(r>=n)break;const o=2*e+2,i=o>=n||this.compare(t[r],t[o])>0?r:o,c=t[i],s=t[e];if(this.compare(s,c)>0)break;t[i]=s,t[e]=c,e=i}}swapMinOrMax(t){this.heap[0]=t,this.swimDown()}static getParentIdx(t){return(t-1-(t+1)%2)/2}static getLeftChild(t){return 2*t+1}static getRightChild(t){return 2*t+2}}const{max:Ga}=Math;function Ua(t,n,e,r=50){if(1===t.length)return $a(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=La(t,n);else if(3===t.length)e=Ya(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Ht(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=Ha(t,n)}const r=Te(e,0,1)?.map(t=>t.t)||[];r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=Ae(t,e),c=lu(r,n);c>i&&(i=c,o={p:r,t:e,d:Va(c)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=$a(n,t[0]).d,r=$a(n,t[t.length-1]).d;return e>r?e:r}const o=Ga(qa(t),qa(n));e=e||o/1e6;const[i,c]=Za(t,0,1),s={tS:0,tE:1,hL:$a(n,t[0]).d,hR:$a(n,t[t.length-1]).d,hEL:i,hER:c},u=new Ra(Qa);u.insert(s);let f=0,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:c,hL:s,hR:p}=o,h=(i+c)/2,[d,g]=Za(t,i,h),[v,m]=Za(t,h,c),x=Ae(t,h),b=Ht(x,$a(n,x).p),w=Ga(s,b,p);if(w>a&&(a=w),l=Wa(o),l-a<e)return a;if(f++>r)return a;const _={tS:i,tE:h,hL:s,hR:b,hEL:d,hER:g},M={tS:h,tE:c,hL:b,hR:p,hEL:v,hER:m};u.swapMinOrMax(_),u.insert(M)}}function Za(t,n,e){const r=(e+n)/2,o=A(t,n,r),i=A(t,r,e);return[Ql(o),Ql(i)]}function Ja(t,n=!1){const e=t;let r=e;const o=[];do{n&&r===e||x(r)||o.push(r),r=r.nextOnCircle}while(r!==e);return o}function Ka(t){const n=[],e=[t],r=new Set;for(;e.length>0;){const t=Lt(e.pop());if(0===t.length)continue;n.push(t);const o=t[0],i=t[t.length-1].next.prevOnCircle;r.add(o),r.add(i);const c=Ja(o,!0),s=Ja(i,!0),u=c.filter(t=>!r.has(t)),f=s.filter(t=>!r.has(t));for(const t of u)r.add(t);for(const t of f)r.add(t);e.push(...u,...f)}return n}class tp{datum;color=0;parent;left;right;constructor(t){this.datum=t}}class np{compare;root;constructor(t){this.compare=t,this.root=void 0}isEmpty(){return void 0===this.root}find(t){let n=this.root;for(;n;){const e=this.compare(t,n.datum);if(0===e)return n;n=e<0?n.left:n.right}}insert(t){if(void 0===this.root)return this.root=new tp(t),void(this.root.color=1);let n,e=this.root;for(;e;){n=e;const r=this.compare(t,e.datum);if(0===r)return void(e.datum=t);e=r<0?e.left:e.right}const r=new tp(t);r.parent=n,this.compare(t,n.datum)<0?n.left=r:n.right=r,this.fixInsert(r)}remove(t,n=!1,e){const r=this.find(t);if(void 0===r)return;const o=r.datum;return this.removeNode(r),o}findBounds(t){let n=this.root;const e=[void 0,void 0];for(;n;)this.compare(t,n.datum)>=0?(e[0]=n,n=n.right):(e[1]=n,n=n.left);return e}getMinNode(t){let n=void 0===t?this.root:t;for(;n&&n.left;)n=n.left;return n}getMaxNode(t){let n=void 0===t?this.root:t;for(;n&&n.right;)n=n.right;return n}removeNode(t){let n,e,r=t,o=r.color;void 0===t.left?(n=t.right,e=t.parent,this.transplant(t,t.right)):void 0===t.right?(n=t.left,e=t.parent,this.transplant(t,t.left)):(r=this.getMinNode(t.right),o=r.color,n=r.right,r.parent===t?(e=r,n&&(n.parent=r)):(e=r.parent,this.transplant(r,r.right),r.right=t.right,r.right.parent=r),this.transplant(t,r),r.left=t.left,r.left.parent=r,r.color=t.color),1===o&&this.fixDelete(n,e)}fixInsert(t){let n=t;for(;n.parent&&0===n.parent.color;){const t=n.parent,e=t.parent;if(t===e.left){const r=e.right;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.right&&(n=t,this.rotateLeft(n)),n.parent.color=1,e.color=0,this.rotateRight(e))}else{const r=e.left;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.left&&(n=t,this.rotateRight(n)),n.parent.color=1,e.color=0,this.rotateLeft(e))}}this.root.color=1}fixDelete(t,n){let e=t,r=n;for(;e!==this.root&&1===this.colorOf(e)&&void 0!==r;)if(e===r?.left){let t=r.right;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateLeft(r),t=r.right),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=e?.parent):(1===this.colorOf(t?.right)&&(t?.left&&(t.left.color=1),t&&(t.color=0,this.rotateRight(t)),t=r.right),t&&(t.color=r.color),r.color=1,t?.right&&(t.right.color=1),this.rotateLeft(r),e=this.root,r=void 0)}else{let t=r?.left;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateRight(r),t=r.left),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=r?.parent):(1===this.colorOf(t?.left)&&(t?.right&&(t.right.color=1),t&&(t.color=0,this.rotateLeft(t)),t=r?.left),t&&(t.color=r.color),r.color=1,t?.left&&(t.left.color=1),this.rotateRight(r),e=this.root,r=void 0)}e&&(e.color=1)}transplant(t,n){void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n&&(n.parent=t.parent)}rotateLeft(t){const n=t.right;t.right=n.left,n.left&&(n.left.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}rotateRight(t){const n=t.left;t.left=n.right,n.right&&(n.right.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}colorOf(t){return t?t.color:1}}function ep(t){const n=new Map;return h(t).forEach(function(t){const e=t.pointOnShape.curve.loop;let r=n.get(e);r||(r=new np(wn),n.set(e,r)),r.insert(t)}),n}const{max:rp}=Math;function op(t,n=.125,e=50){let r=O(t.cpNode);for(;!x(r);)r=r.next;const o=Ka(r),i=new Set;for(let t=0;t<o.length;t++){const r=o[t];let c=0;for(;c<r.length;){const t=c;for(;(c++,c!==r.length)&&!(ip(t,c,r,e)>n);)i.add(r[c])}}r=function(t,n){const e=n;do{if(t(n))return n;n=n.next}while(n!==e)}(x,r);for(const n of i)Mn(t=>2!==v(t)&&!t.isHoleClosing)(n)||B(n,t.meta);return{cpNode:r,meta:{...t.meta,cpTrees:ep(r)}}}function ip(t,n,e,r){const o=[],i=Tt(e[t],e[n].next);for(;t<n+1;t++)o.push(Ua(At(e[t]),i,r));return rp(...o)}function cp(t){const n=[],e=h(t);for(const t of e)w(t)&&!t.isHoleClosing&&n.push(t);return n}const sp=function(t,n,e){const r=t.get(n);return void 0!==r&&r.has(e)},up=function(t,n,e){let r=t.get(n);void 0===r&&(r=new Set,t.set(n,r)),r.add(e)};function fp(t){let n=t,e=t.prevOnCircle;for(;x(e);)e=e.prevOnCircle;const r=[];do{x(n)||r.push(n),n=n.nextOnCircle}while(n!==e);return r}function lp(t,n,e=.4,r=16){if(4===n.length)return an(t,n,e,r);if(3===n.length)return sn(t,n,e,r);if(2===n.length)return Xt(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function ap(t,n){const e=new Map,r=new Map;return I(t,function(t){const o=r.get(t)||n*t.pointOnShape.circle.radius,i=t.next,c=lp([0,1],At(t)),s=i.pointOnShape.circle.radius;if(o-c>n*s)for(const t of m(i))if(r.set(t,o-c),!i.isHoleClosing){const{center:t}=i.pointOnShape.circle;up(e,t[0],t[1])}}),e}function pp(t,n){let e=0;"undefined"!=typeof _debug_&&(e=performance.now());const r=function(t){const n=h(t);return n.reduce(function(t,n){return t.pointOnShape.circle.radius>=n.pointOnShape.circle.radius?t:n},n[0])}(O(t.cpNode));!function(t,n){const e=cp(n);for(;e.length;){const r=e.pop(),{center:o}=r.pointOnShape.circle;if(!sp(t,o[0],o[1])||r.isIntersection)continue;let i=r.prevOnCircle,c=!1;for(;!c;){i=i.next;const{center:e}=i.pointOnShape.circle;if(sp(t,e[0],e[1]))if(kt(i,n))c=!0;else{if(1===fp(i).length)continue;c=!0}else{for(;x(i.prevOnCircle);)i=i.prevOnCircle;c=!0}}if(c){const t=i.prevOnCircle;t.next=i,i.prev=t,t.nextOnCircle=i,i.prevOnCircle=t}}}(ap(r,n),r);const o={cpNode:r,meta:{...t.meta,cpTrees:ep(r)}};return function(t){"undefined"!=typeof _debug_&&(_debug_.timing.sats=performance.now()-t)}(e),o}const hp={maxCurviness:.05,maxLength:40,applySat:!0,satScale:2,simplify:!0,simplifyTolerance:2**-4,minBezLength:2**-6,angleIncrement:15},dp={maxCurviness:{range:[.01,3],scaleByMaxCoordinate:!1},maxLength:{range:[1,1024],scaleByMaxCoordinate:!0},angleIncrement:{range:[.1,360],scaleByMaxCoordinate:!1},satScale:{range:[1,1/0],scaleByMaxCoordinate:!1},simplifyTolerance:{range:[2**-20,2**20],scaleByMaxCoordinate:!0},minBezLength:{range:[2**-20,2],scaleByMaxCoordinate:!0}};function gp(t){return[t[1],-t[0]]}function vp(t,n){if(!Nt(n))return 0;const e=It(n);return e.isDull?-$(gp(e.tangents[0]),W(X(n.p,t))):0}function mp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function xp(t){return t[0]*t[0]+t[1]*t[1]}function bp(t,n,e){return t[0]*(n[1]*e[2]-n[2]*e[1])-t[1]*(n[0]*e[2]-n[2]*e[0])+t[2]*(n[0]*e[1]-n[1]*e[0])}const wp=function(t){const n=t[0],e=t[1],r=t[2],o=xp,i=.5*bp([o(n),n[1],1],[o(e),e[1],1],[o(r),r[1],1]),c=.5*bp([n[0],o(n),1],[e[0],o(e),1],[r[0],o(r),1]),s=bp([n[0],n[1],1],[e[0],e[1],1],[r[0],r[1],1]);return[i/s,c/s]},_p=Re,Mp=Wn,Sp=Ut,Ip=Number.EPSILON;function Np(t,n){const[e,r]=t,[o,i]=n,c=Re(e,o),s=Re(r,i);return Ut(Wn(c,c),Wn(s,s))[1]}const yp=Number.EPSILON;function Cp(t,n,e){const[r,o]=e,{ps:i}=t,c=[];if(r!==o){const{polyDd:e,polyE:s,getPolyExact:u}=kr(i,n),f=Te(e,r,o,s,u)||[];c.push(...f.map(e=>{const{tS:r,tE:o,t:c}=e,s=c<0?0:c>1?1:c,u=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=1/0,a=-1/0;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=_p(t,u),r=_p(n,f),o=Sp(Mp(e,e),Mp(r,r))[1],i=o*(1-Ip),c=o*(1+Ip);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(qe(i,[r,o]),n),f=0===s?1:s;return{curve:0===s?t.prev:t,t:f,dSquaredI:u}}))}const s=e.slice();return r===o&&s.push(r),c.push(...s.map(e=>{const r=Np($s(i,[0,e]).map(t=>t[0]+t[1]),n),o=[r*(1-yp),r*(1+yp)],c=0===e?1:e;return{curve:0===e?t.prev:t,t:c,dSquaredI:o}})),c}const{min:Op}=Math,Ep=1+2**-20;function Tp(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];return u<o?f<i?lu(t[0],n):f>s?lu([o,s],n):(o-u)**2:u>c?f<i?lu([c,i],n):f>s?lu(t[1],n):(u-c)**2:f<i?(i-f)**2:f>s?(f-s)**2:0}const Ap=Y(io);function Pp(t,n){const e=[0,1,2,3].map(e=>function(t,n){const e=lu,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let c=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return c=Math.max(0,Math.min(1,c)),e(t,[r[0]+c*(o[0]-r[0]),r[1]+c*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]])),r=lu(t[0],t[1]),o=lu(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const kp=Y(Gl);function Bp(t,n){return $s(t,[0,n]).map(t=>t[0]+t[1])}function zp(t,n){t=function(t,n){const e=function(t,n){let e=1/0;for(let r=0;r<t.length;r++){const o=t[r],{curve:{ps:i},ts:c}=o,s=Ae(i,c[0]),u=Ae(i,c[1]);e=Op(e,lu(n,s),lu(n,u))}return Ep*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Tp(Ap(c),n)<=e&&r.push(i)}return r}(t,n,e),t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],c=i.curve.ps;Pp(kp(c),n)<=e&&r.push(i)}return r}(t,n,e),t}(t,n);const e=[];for(let r=0;r<t.length;r++){const o=t[r],i=Cp(o.curve,n,o.ts);e.push(...i)}let r=1/0;for(let t=0;t<e.length;t++){const n=e[t].dSquaredI[1];n<r&&(r=n)}const o=[];for(let t=0;t<e.length;t++){const n=e[t];n.dSquaredI[0]<=r&&o.push(n)}return o.map(t=>{const{curve:n,t:e}=t,{ps:r}=n;return{p:Bp(r,e),t:e,curve:n,isSource:!1}})}function Fp(t,n){return n.map(n=>zp(n,t)[0])}function Lp(t,n){return[n*t[0],n*t[1]]}function Yp(t,n,e){const r=mp(e);let o,i,c,s,u=1,f=0;do{i=j(Lp(e,u),n),c=t.map(t=>zp(t,n)[0]),s=mp(X(i,wp(c.map(t=>t.p)))),o=s<r,u/=2,f++}while(!o&&f<3);return{newX:i,newV:s,newPoss:c}}const{min:Hp,abs:Xp,asin:$p}=Math;function Vp(t,n,e,r,o){const i=2**(o-32),c=[t[0],t[n],t[t.length-1]],s=[r[0],r[n],r[t.length-1]],u=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e],f=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e];if(_(u[0][0]))return;let l,a=0,p=function(t,n){const e=t[0][0].pointOnShape.circle.center,r=zp(n[1],e)[0],o=[t[0][0].pointOnShape.p,r.p,t[2][1].pointOnShape.p];return wp(o)}(u,f),h=1/0;for(;h>i&&a<10;){if(a++,l=Fp(p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;const t=wp(l.map(t=>t.p)),n=X(p,t);if(!Number.isFinite(n[0])||!Number.isFinite(n[1]))return;const e=Yp(f,p,n);p=e.newX,l=e.newPoss;const r=mp(n);h=Xp(r-e.newV)}const d=(Ht(p,l[0].p)+Ht(p,l[1].p)+Ht(p,l[2].p))/3,g={center:p,radius:d};let v=0;for(let t=0;t<3;t++){const n=l[t],e=W(X(n.p,p)),r=V(e);if(Nt(n)&&It(n).isDull){const t=St(n.curve.ps,n.curve.next.ps).tangents.map(V),r=$p(D(t[0],e)),o=$p(D(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),v+=i}else{const t=W(U(n.curve.ps,n.t));v+=Xp($p(D(r,t)))}}const m=[];for(let t=0;t<r.length;t++){const n=zp(r[t],p)[0];m.push(Ht(n.p,p))}const x=Hp(...m);return{threeProngInfo:{poss:l,circle:g,δ3s:u},error:1*Xp(d-x)+1*v}}function Dp(t){let n=t[0];const e=t[1],r=[];let o=!0;do{const t=n.pointOnShape,e=n.next.pointOnShape,i=t.curve,c=e.curve;if(o)if(o=!1,c===i&&bn(e,t)>0)r.push({curve:i,ts:[t.t,e.t]}),n=n.next;else{if(i.loop===c.loop){const n={curve:i,ts:[t.t,1]};r.push(n),qp(r,i,c,e.t)}n=n.next}else o=!0,n=n.prevOnCircle}while(n!==e);return r}function qp(t,n,e,r){let o=n;do{o=o.next;const n=o===e?r:1;t.push({curve:o,ts:[0,n]})}while(o!==e)}function jp(t,n,e,r){const o={...n,order:e,order2:r},i=t.findBounds({pointOnShape:o});if(void 0!==i[0]||void 0!==i[1])return void 0===i[0]||void 0===i[1]?t.getMaxNode()?.datum:i[0].datum}function Wp(t,n,e,r,o,i,c){if(void 0!==i&&!function(t,n,e){const r=bn(n,e.pointOnShape);if(r<0)return!0;if(0===r)return!1;const o=t.getMinNode();if(void 0===o)return!0;const i=o.datum;return bn(t.getMaxNode().datum.pointOnShape,n)<0&&i===e}(r,o,i.next)&&!t)return;const s={pointOnShape:o,isHoleClosing:n,isIntersection:e,id:c.id,next:void 0,prev:void 0,nextOnCircle:void 0,prevOnCircle:void 0};c.id++;const u=void 0===i?s:i,f=void 0===i?s:u.next;return f.prev=s,u.next=s,s.prev=u,s.next=f,r.insert(s),s}function Qp(t,n,e,r,o,i,c){const{cpTrees:s}=o;let u=!1;const f=i.map((i,f)=>{const l=r[f],a=s.get(i.curve.loop),p={...i,circle:e,order:l,order2:0},h=void 0===c?jp(a,i,l,0):c[f],d=Wp(t,n,!1,a,p,h,o.lastInsertId);return void 0===d&&(u=!0),d});return u||function(t,n){n=n.slice().sort(function(t){const n=t.center;return function(t,e){let r=t.pointOnShape.p,o=e.pointOnShape.p;r=[r[0]-n[0],r[1]-n[1]],o=[o[0]-n[0],o[1]-n[1]];const i=Math.atan2(r[1],r[0]);return Math.atan2(o[1],o[0])-i}}(t));const e=n.length;for(let t=0;t<e;t++){const r=n[t];r.nextOnCircle=n[(t+1)%e],r.prevOnCircle=n[(t-1+e)%e]}}(e,f),{anyFailed:u,cpNodes:f}}const Rp=Math.cos(Math.PI/180*1);function Gp(t,n,e,r,o,i){const{cpTrees:c,maxCoordPowerOf2:s}=t,u=2**(s-40),f=2**(s-46),l=jp(c.get(n.curve.loop),n,r,o);if(!l)return;const a=[l,l.next],{p,t:h}=n;for(const t of a){const n=t.pointOnShape.p,r=Ht(p,n);if(!(r>u)&&($(W(X(n,t.pointOnShape.circle.center)),W(X(p,e.center)))>Rp||r<f&&0!==h&&1!==h))return t}}function Up(t,n){const e=[];for(const t of n)e.push([t,t.next]);const r=function(t,n){const e=t.map(Dp);let r,o=1/0;for(let i=1;i<t.length-1;i++)for(let c=0;c<3;c++){const s=Vp(t,i,c,e,n);if(void 0===s)continue;const{error:u,threeProngInfo:f}=s;u<o&&(o=u,r=f)}return r}(e,t.maxCoordPowerOf2),{circle:o,poss:i,δ3s:c}=r,s=[];for(let t=0;t<3;t++)s.push(vp(o.center,i[t]));const u=[];for(let n=0;n<i.length;n++){const e=Gp(t,i[n],o,s[n],0);void 0!==e&&v(e)<=2&&!e.isHoleClosing&&u.push(e)}return{closeBysFor3Prong:u,cpNodes:0===u.length?Qp(!0,!1,o,s,t,i,c.map(t=>t[0])).cpNodes:[]}}let Zp,Jp=0;function Kp(t,n){if(yt(n.pointOnShape))return{closeBysFor3Prong:void 0,addedCpNodes:[]};const e=[];for(;;){if(void 0===n)continue;const r=S(n);if(r.length<=2)break;const{closeBysFor3Prong:o,cpNodes:i}=Up(t,r);if(e.push(i),o.length>0)return{closeBysFor3Prong:o,addedCpNodes:e};if("undefined"!=typeof _debug_&&++Jp===_debug_.directives.stopAfterThreeProngsNum)return}return{closeBysFor3Prong:void 0,addedCpNodes:e}}function th(t){for(const n of t)return n}function nh(t,n,e,r){const o=n[0];m(o).forEach(t=>{e.delete(t),r.delete(t)}),B(o,t)}function eh(t,n,e){const r=new Map;for(let o=0;o<n.length;o++){const i=new np(wn);r.set(t[o],i);const c=n[o];let s,u;for(const t of c){const n={center:t.p,radius:0},{curve:r}=t,o={...t,curve:r,t:1,circle:n,order:-1,order2:0},c={...t,curve:r.next,t:0,circle:n,order:1,order2:0};s=Wp(!0,!1,!1,i,o,u,e),u=Wp(!0,!1,!1,i,c,s,e),s.prevOnCircle=u,u.prevOnCircle=s,s.nextOnCircle=u,u.nextOnCircle=s}}return r}function rh(t){const n=[],e=[],r=[],o=[],i=[];for(const c of t)for(const t of c.curves){const c=t.ps,s=pu(c,!0);r.push(s);const u=Ap(c);n.push(u);const f=Gl(c);e.push(f);const l=St(t.ps,t.next.ps);l.isQuiteSharp?o.push(t):l.isQuiteDull&&i.push(t)}return{looseBoundingBoxes:n,tightBoundingBoxes:e,boundingHulls:r,sharpCorners:o,dullCorners:i}}function oh(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ql(o.ps)<t||St(o.ps,o.next.ps).isQuiteSharp&&e.push({curve:o,t:1,isSource:!0,p:Bp(o.ps,1)})}return e}}function ih(t,n,e){const[r,o]=t,[i,c]=n,[s,u]=e,f=r-s,l=o-u;return{a0:2*(i*f+c*l),b0:f*f+l*l}}const ch=[,,function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u],[f,l]]=e,a=f-s,p=l-u,h=r-s,d=o-u,g=i*a+c*p,v=-(a*a+p*p),m=a*h+p*d,x=2*(i*h+c*d),b=-v,w=h*h+d*d;return{A:[-2*g,x],B:[b,-2*m,w],C:[g],D:[v,m],H:[b*g,x*v,x*m-w*g]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u]]=e,[[f,l],[a,p]]=ro(e),h=r-s,d=o-u,g=2*(i*f+c*a),v=i*l+c*p,m=i*h+c*d,x=f*f+a*a,b=f*l+a*p,w=h*l+d*p,_=h*h+d*d,M=2*(h*f+d*a)-(l*l+p*p),S=-M;return{A:[-g,-2*v,2*m],B:[x,2*b,S,-2*w,_],C:[g,v],D:[-2*x,-3*b,M,w],H:[x*g,b*g+3*x*v,4*(b*v-m*x),g*w+v*S-6*m*b,-2*m*S-g*_,2*m*w-v*_]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u,f,l],[a,p,h,d]]=eo(e),g=r-l,v=o-d,m=i*s+c*a,x=i*u+c*p,b=i*f+c*h,w=i*g+c*v,_=s*s+a*a,M=s*u+a*p,S=s*f+a*h,I=u*u+p*p,N=u*f+p*h,y=f*f+h*h,C=s*g+a*v,O=u*g+p*v,E=f*g+h*v,T=g*g+v*v,A=2*S+I,P=2*N-2*C,k=y-2*O,B=-2*E;return{A:[-2*m,-2*x,-2*b,2*w],B:[_,2*M,A,P,k,B,T],C:[3*m,2*x,b],D:[-3*_,-5*M,-4*S-2*I,3*C-3*N,2*O-y,E],H:[3*m*_,4*(m*M+x*_),m*A+6*x*M+5*b*_,2*x*A+8*b*M-6*w*_,-m*k+x*P+3*b*A-10*w*M,-2*m*B+2*b*P-4*w*A,b*k-x*B-3*w*P-3*m*T,-2*w*k-2*x*T,-w*B-b*T]}}],{sqrt:sh,abs:uh,max:fh}=Math;function lh(t,n,e,r,o,i){const{curve:c,ts:[s,u]}=i,{ps:f}=c,{curve:l,t:a,p}=e,h=c===l,d=0===o&&h,g=[];let v,m=!1,x=!1;if(!(s===u||d&&2===f.length||h&&3===f.length&&r)){const{A:e,B:r,H:o}=d?3===f.length?function(t,n,e){const[[r,o],[i,c]]=ro(e),[s,u]=n,f=r*t+o,l=i*t+c,a=r*r+i*i,p=2*(s*r+u*i);return{A:[-p],B:[a,2*(r*f+i*l),f*f+l*l],H:[a*p,p*(a*t+(r*o+i*c))]}}(a,n,f):function(t,n,e){const[r,o]=n,[[i,c,s],[u,f,l]]=eo(e),a=r*i+o*u,p=r*c+o*f,h=r*s+o*l,d=i*i+u*u,g=i*c+u*f,v=i*s+u*l,m=c*c+f*f,x=c*s+f*l,b=s*s+l*l,w=t*(t*(t*a+p)+h),_=t*(t*(t*d+g)+v),M=t*(t*(t*g+m)+x),S=3*a,I=-3*d,N=-5*g+t*I,y=-4*v-2*m+t*N,C=-3*x+3*_+t*y,O=-2*a,E=2*v+m,T=2*x-2*_,A=b-2*M,P=2*g+2*t*d,k=E+t*(2*P-t*d),B=T+t*(2*k-t*P),z=3*a*d,F=4*(a*g+p*d)+4*t*z,L=a*E+6*p*g+5*h*d+t*(4*F-6*t*z),Y=2*p*E+8*h*g-6*w*d+t*(4*L+t*(-6*F+4*t*z));return{A:[O,-2*p+2*t*O],B:[d,P,k,B,A+t*(2*B-t*k)],C:[S,2*p+t*S],D:[I,N,y,C,2*M-b+t*C],H:[z,F,L,Y,-a*A+p*T+3*h*E-10*w*g+t*(4*Y+t*(-6*L+t*(4*F-t*z)))]}}(a,n,f):function(t,n,e){if(1===e.length){const{a0:r,b0:o}=ih(t,n,e[0]);return{A:[r],B:[o],C:[],D:[],H:[]}}return ch[e.length](t,n,e)}(p,n,f);v=Te(o,s,u)||[];for(let o=0;o<v.length;o++){const i=v[o],{tS:f,tE:l,t:a}=i;if(i.multiplicity>1)continue;if(l<s||f>u)continue;if(f<0)continue;const h=l>1?1:a,d=R(e,h),b=R(r,h),w=uh(d);if(fh(w)<2**-40)continue;const _=-b/d;if(_<=0)continue;const M=[_*n[0],_*n[1]],S=sh(xp(M));if(S<=2**(t-40))continue;const I=[p[0]+M[0],p[1]+M[1]];i.tS<=s&&i.tE>=s&&(m=!0),i.tS<=u&&i.tE>=u&&(x=!0);const N=0===h?1:h,y={curve:0===h?c.prev:c,s:N,d:S,x:I};g.push(y)}}const b=f[f.length-1];let w=0===a&&c===l.prev||1===a&&c===l;const _=[];if(0===s);else if(1===s)w||m||_.push({P:b,t:1});else if(!m){const t=Ae(f,s);_.push({P:t,t:s})}if(s!==u)if(0===u);else if(1===u)w||x||(_.push({P:b,t:1}),w=!0);else if(!x){const t=Ae(f,u);_.push({P:t,t:u})}for(let t=0;t<_.length;t++){const{P:e,t:r}=_[t],{a0:o,b0:i}=ih(p,n,e);if(uh(o)<=2**-40||uh(i)<=2**-40)continue;const s=-i/o;if(s<2**-40)continue;const u=[s*n[0],s*n[1]],f=sh(xp(u)),l=[p[0]+u[0],p[1]+u[1]],a=0===r?1:r,h={curve:0===r?c.prev:c,s:a,d:f,x:l};g.push(h)}return g}const{abs:ah}=Math,ph=1+2**-20,hh=1+2**-20,dh=Y(Gl),gh=Gt,vh=Ut,mh=Zt,xh=function(t,n){const e=n[0],r=n[1],o=r*t,i=$n*r,c=i-(i-r),s=r-c,u=$n*t,f=u-(u-t),l=t-f,a=e*t,p=o+a,h=a-(p-o)+(s*l-(o-c*f-s*f-c*l)),d=p+h;return[h-(d-p),d]},{acos:bh}=Math;function wh(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Ut(t[r],Vn(n,e));return e}const _h=qf,Mh=Re,Sh=Vn,Ih=Ut,Nh=Bo;function yh(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Sh(3,Ih(Mh(s,n),Sh(3,Mh(r,i)))),Sh(6,Nh(_h(i,n),-2*r)),Sh(3,Mh(r,n))],[Sh(3,Ih(Mh(u,e),Sh(3,Mh(o,c)))),Sh(6,Nh(_h(c,e),-2*o)),Sh(3,Mh(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[Nh(_h(2*i,2*n),-4*r),Mh(2*r,2*n)],[Nh(_h(2*c,2*e),-4*o),Mh(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[Mh(r,n)],[Mh(o,e)]]}(t);if(1===t.length)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Ch=Re,Oh=Ut,Eh=Vn,Th=Bo;function Ah(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Eh(6,Oh(Ch(s,n),Eh(3,Ch(r,i)))),Eh(6,Th(Ch(i,2*r),n))],[Eh(6,Oh(Ch(u,e),Eh(3,Ch(o,c)))),Eh(6,Th(Ch(c,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[Th(Ch(2*i,4*r),2*n)],[Th(Ch(2*c,4*o),2*e)]]}if(t.length<=2)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}const Ph=Wn,kh=Ut,Bh=Zt;const{sqrt:zh}=Math;function Fh(t,n,e){const{curve:r,p:o,t:i}=n,{ps:c}=r,s=1/t,u=function(t,n){const[e,r]=function(t,n){const[e,r]=yh(t),[o,i]=Ah(t),c=wh(e,n),s=wh(r,n),u=wh(o,n),f=wh(i,n),l=Bh(Ph(c,f),Ph(s,u)),a=kh(Ph(c,c),Ph(s,s));return[l,Qf(Ph(a,Ph(a,a)))]}(t,n);return Ts(e,r)}(c,i),f=-(u[0]+u[1]),l=f<s?s:f,[a,p]=e,h=zh(a*a+p*p)*l;return[[o[0]+a/h,o[1]+p/h],1/l]}const{sqrt:Lh}=Math,{sin:Yh,cos:Hh,max:Xh,sqrt:$h}=Math;function Vh(t){const{loops:n,maxCoordPowerOf2:e,squaredDiagonalLength:r}=t,o=(2**(e-21))**2,i=2**(e-46),c=$h(r),s=2**(e-32);return function(r,u,f,l){const{curve:{loop:a,ps:p},t:h,p:d}=l,g=function(t,n){const[e,r]=yh(t),o=wh(r,n);return[[-o[0],-o[1]],wh(e,n)]}(p,h),v=[-g[0][1],-g[1][1]],m=r?[0,-c]:0!==f?Q(Yh(f),Hh(f))(v):v;let[x,b]=function(t,n,e,r,o){let i,c;const{p:s}=r;if(n)return[[s[0],s[1]-e],e];if(0===t)return Fh(e,r,o);const{p:u}=r,[f,l]=o,a=e/Lh(f*f+l*l),p=[f*a,l*a];return i=[u[0]+p[0],u[1]+p[1]],c=e,[i,c]}(f,r,c,l,m);const w=function(t,n,e,r,o,i,c){const{cpTrees:s}=o;if(n)return r.filter(t=>t!==e).flatMap(t=>t.curves.map(t=>({curve:t,ts:[0,1]})));const u=Nt(i)&&It(i).isDull?1===i.t&&0===t?-1:0===i.t?1:vp(c,i):0,f=jp(s.get(e),i,u,0);return f&&f!==f.next.next?Dp([f,f]):e.curves.map(t=>({curve:t,ts:[0,1]}))}(f,r,a,n,t,l,x),_=function(t,n,e,r){let o=1/0,i=[e[0]+r[0],e[1]+r[1]];for(let t=0;t<n.length;t++){const c=n[t],{ps:s}=c.curve,u=s[0],f=s[s.length-1];for(const t of[u,f]){if(lu(i,t)>o)continue;const{a0:n,b0:c}=ih(e,r,t);if(ah(n)<=2**-40||ah(c)<=2**-40)continue;const s=-c/n;if(s<2**-40)continue;const u=[s*r[0],s*r[1]],f=xp(u);f<o&&(o=f,i=[e[0]+u[0],e[1]+u[1]])}}return ph*o}(0,w,d,m),M=$h(_),S=$h(m[0]**2+m[1]**2);x=[d[0]+m[0]/S*M,d[1]+m[1]/S*M],function(t,n,e){if(t.length<=2)return t;let r=0;for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Tp(Ap(c),n)<=hh*e&&Pp(dh(c),n)<=hh*e&&(t[r]=i,r++)}t.length=r}(w,x,_);const I=function(t,n,e,r,o,i){const c=[];for(let s=0;s<i.length;s++){const u=lh(t,n,e,r,o,i[s]);c.push(...u)}let s=1/0;for(let t=0;t<c.length;t++){const n=c[t].d*(1+2**-46);n<s&&(s=n)}const u=[];for(let t=0;t<c.length;t++){const n=c[t];n.d*(1-2**-46)<=s&&u.push(n)}return u}(e,m,l,u,f,w);if(1!==I.length){if(0===I.length)return;if(!function(t){const{curve:n,s:e}=t[0];for(let r=1;r<t.length;r++){const{curve:o,s:i}=t[r];if(n!==o||e!==i)return!1}return!0}(I))return}const{x:N,d:y,curve:C,s:O}=I[0];if(u&&b<(1-s)*y)return void function(t,n,e,r){if(Nt(r)&&It(r).isDull)return;const o={radius:n,center:e};Gp(t,r,o,vp(o.center,r),0)||Qp(!1,!1,o,[-.5,.5],t,[r,r])}(t,b,x,l);const E={curve:C,t:O,isSource:!1,p:Bp(C.ps,O)},T={center:N,radius:y},A=Np(l.p,E.p),P=Np(N,E.p);if(!r){if(0===A)return;if(A<=Xh(function(t,n,e){if(n+e>=t)return 1/0;const r=Re(t,n),o=xh(n,r),i=t-n,c=n*i,s=(c-n*e-e*e/2)/(c+i*e),u=Ts(mh(mh(o,gh(n,e)),gh(e,e/2)),vh(o,xh(e,r)))[1];return bh(s),n*bh(u)}(b,$h(P),4*i),o))return}return{circle:T,z:E}}}function Dh(t,n,e,r,o){e=0===e.t?{...e,curve:e.curve.prev,t:1}:e;const i=vp(n.center,e),c=vp(n.center,r),s={...r,circle:n,order:c,order2:0},u={...e,circle:n,order:i,order2:0};if(Gp(t,e,n,i,0))return;if(Gp(t,r,n,c,0))return;const{anyFailed:f,cpNodes:l}=Qp(o,o,n,[i,c],t,[u,s]);if(!f)return o&&function(t,n){const{cpTrees:e}=t,[r,o]=n,i=o.pointOnShape,c=Wp(!0,!0,!1,e.get(i.curve.loop),{...i,order2:1},o,t.lastInsertId);c.holeCloserTwin=o,o.holeCloserTwin=c;const s=r.pointOnShape,u=Wp(!0,!0,!1,e.get(s.curve.loop),{...r.pointOnShape,order2:-1},r.prev,t.lastInsertId);u.holeCloserTwin=r,r.holeCloserTwin=u,u.prevOnCircle=c,u.nextOnCircle=c,c.prevOnCircle=u,c.nextOnCircle=u,o.next=r,r.prev=o,u.next=c,c.prev=u}(t,l),l[0];l.forEach(n=>{void 0!==n&&k(n,t)})}const{PI:qh,atan2:jh}=Math;function Wh(t,n,e,r){let o;const i=Vh(t),c=n*qh/180;for(let n=0;n<e.length;n++){const s=e[n],u=Qh(c,s);for(const e of u){const c=i(!1,r,e,s);if(c){const{circle:n,z:e}=c,r=Dh(t,n,s,e,!1);o=o||r}if("undefined"!=typeof _debug_&&n+1===_debug_.directives.stopAfterTwoProngsNum)return}}return o}function Qh(t,n){const e=[0];if(1===n.t){const{curve:r}=n,o=St(r.ps,r.next.ps);if(o.isQuiteDull){const n=gp(o.tangents[0]),r=gp(o.tangents[1]),i=(jh(n[1],n[0])+2*qh)%(2*qh),c=((jh(r[1],r[0])+2*qh)%(2*qh)-i+2*qh)%(2*qh);let s=t;for(;s<=c-t/2;)e.push(s),s+=t}}return e}function Rh(t,n,e,r){let o;for(let i=0;i<e.length;i++){const c=Wh(t,n,e[i],r);o=void 0===o?c:o}return o}function Gh(t,n=.4,e=10,r=2**-16){const o=[0],i=[1];for(;;){const c=o[o.length-1],s=i[i.length-1],u=A(t,c,s),f=Ql(u),l=en(u);if(f<=e&&l<=n||s-c<=r){if(o.push(i.pop()),1===s)return o;continue}const a=(c+s)/2;i.push(a)}}function Uh(t){if(t.length<4)return[];const[[n,e],[r,o],[i,c],[s,u]]=t,f=r-n,l=o-e,a=i-r-f,p=c-o-l,h=s-i-f-2*a,d=u-c-l-2*p,g=a*d-p*h,v=f*d-l*h,m=f*p-l*a;return Te([g,v,m],0,1)?.map(t=>t.t)||[]}function Zh(t,n,e){return function(r){const o=[],i=r.curves;for(let r=0;r<i.length;r++){const c=i[r],s=c.ps;if(Ql(s)<t)continue;let u=Gh(s,n,e);u=2===u.length?[.5]:u,u.push(...Uh(s)),u=u.filter(t=>0!==t&&1!==t);const f=u.map(t=>({curve:c,t,isSource:!0,p:Bp(c.ps,t)}));o.push(...f)}return o}}const Jh=Re,Kh=Ut,td=Vn,nd=Ge,ed=Ue,rd=Vn,od=Wn,id=Ut,cd=Zt;const sd=Re,ud=Vn,fd=Wn,ld=Ut,ad=Zt;function pd(t){if(vl(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Vu(t)&&(t=zc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=sd(r,n),u=sd(i,r),f=ad(u,s),l=sd(o,e),a=sd(c,o),p=ad(a,l),h=ld(ad(ud(n,ad(f,[0,r])),ud(r,ad(u,[0,r]))),ad(ud(e,ad(p,[0,o])),ud(o,ad(a,[0,o]))));return[ld(fd(f,f),fd(p,p)),Jo(h)]}(t);return{minima:[],maxima:Te(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=yh(t),[[s,u],[f,l]]=Ah(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[td(6,Kh(Jh(s,n),td(3,Jh(r,i))))],[td(6,Kh(Jh(u,e),td(3,Jh(o,c))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=od(a,i),d=od(p,e),g=od(u,c),v=od(u,i),m=od(f,f),x=od(s,c),b=od(l,r),w=od(l,e),_=od(f,r),M=od(r,e),S=od(r,n),I=od(r,o),N=od(e,e),y=od(e,n),C=od(e,i),O=od(n,c),E=od(n,o),T=od(n,n),A=od(c,i),P=od(c,o),k=od(i,i),B=od(i,o),z=od(o,o),F=cd(od(a,c),od(p,r)),L=cd(h,d),Y=id(od(u,r),od(l,c)),H=id(id(od(u,e),od(s,r)),id(od(l,i),od(f,c))),X=cd(g,b),$=cd(id(v,x),id(w,_)),V=id(od(r,r),od(c,c)),D=id(M,A),q=id(C,O),j=id(P,k),W=id(S,N),Q=id(od(e,o),od(n,i)),R=cd(T,z),G=cd(y,B),U=id(I,C),Z=cd(M,A),J=id(od(r,i),od(e,c)),K=id(P,j),tt=id(S,W),nt=id(I,q),et=id(C,q),rt=cd(tt,K),ot=id(q,O),it=id(U,O),ct=id(Ge(w),_),st=od(T,cd(h,rd(3,d))),ut=od(z,cd(rd(3,h),d)),ft=Ge(id(od(E,id(cd(od(a,e),od(p,i)),rd(3,cd(od(l,f),od(u,s))))),rd(3,od(od(s,f),G)))),lt=rd(3,id(od(Q,cd(m,od(s,s))),od(R,id(od(u,f),od(l,s))))),at=id(id(st,ut),id(ft,lt)),pt=od(a,id(od(o,id(tt,rd(3,j))),od(n,et))),ht=od(p,id(id(od(r,id(rd(3,T),z)),od(e,id(rd(3,y),nd(B)))),od(n,K))),dt=rd(3,id(id(od(u,id(cd(od(l,R),od(u,E)),nd(cd(od(f,G),od(s,Q))))),od(s,cd(id(nd(od(l,G)),od(f,id(nd(cd(S,P)),cd(N,k)))),od(s,it)))),id(od(l,id(od(l,E),nd(od(f,Q)))),od(m,nt)))),gt=id(cd(pt,ht),dt),vt=od(a,id(id(nd(od(r,Q)),od(e,ot)),od(i,id(ed(P),K)))),mt=od(p,id(id(nd(od(r,id(rd(3,y),B))),od(e,id(N,nd(P)))),od(i,ot))),xt=rd(3,id(id(od(u,cd(id(nd(cd(od(l,G),od(s,it))),od(f,rt)),od(u,Q))),od(s,cd(nd(od(f,Z)),od(s,J)))),id(od(l,id(id(od(l,Q),nd(od(f,nt))),od(s,rt))),od(m,J)))),bt=id(cd(vt,mt),xt),wt=od(a,id(od(r,id(I,nd(q))),od(c,id(N,rd(3,j))))),_t=od(p,id(od(r,id(rd(3,W),K)),od(c,et))),Mt=rd(3,id(id(od(u,id(cd(od(l,rt),od(u,nt)),nd(cd(od(f,Z),od(s,J))))),od(s,cd(od(r,cd(ct,od(s,c))),od(c,id(nd(od(l,i)),od(f,c)))))),id(od(l,id(od(l,q),od(r,id(nd(od(f,i)),od(l,o))))),od(f,od(c,ct))))),St=id(cd(wt,_t),Mt),It=cd(id(od(V,L),nd(od(D,F))),rd(3,id(od(Y,$),od(H,X)))),Nt=cd(od(F,V),rd(3,od(Y,X)));return{inflectionPoly:[cd(od(s,o),od(f,n)),cd(id(od(u,o),od(s,i)),id(od(l,n),od(f,e))),cd(id(v,x),id(w,_)),cd(g,b)],otherExtremaPoly:[at,gt,bt,St,It,Nt]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Te(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=Vn(n-r,t[r]);return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=se(i,n);ct(et(se(e,n),r))>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Te(e,0,1)?.map(t=>t.t)||[]}}function hd(t){return{curve:t.curve,t:t.t,isSource:!0,p:Bp(t.curve.ps,t.t)}}function dd(t,n,e,r,o){(o&&(r>t.val||r===t.val&&e>t.t)||!o&&(r<t.val||r===t.val&&e>t.t))&&(t.curve=n,t.t=e,t.val=r)}const gd=Y(function(t){const n=[{curve:void 0,t:void 0,val:1/0},{curve:void 0,t:void 0,val:1/0}],e=[{curve:void 0,t:void 0,val:-1/0},{curve:void 0,t:void 0,val:-1/0}];return t.curves.forEach(function(t){const r=so(t.ps);for(let o=0;o<2;o++)dd(n[o],t,r.ts[0][o],r.box[0][o],!1),dd(e[o],t,r.ts[1][o],r.box[1][o],!0)}),{minX:hd(n[0]),minY:hd(n[1]),maxX:hd(e[0]),maxY:hd(e[1])}});function vd(t){return gd(t).minY}function md(t){const{loops:n}=t,e=n.map(vd);let r;const o=Vh(t);for(let n=1;n<e.length;n++){const i=e[n],c=o(!0,!1,0,i);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:s,z:u}=c,f=Dh(t,s,i,u,!0);r=void 0===r?f:r}return r}const xd=Y(function(t){let n,e,r,o,i=1/0,c=-1/0,s=1/0,u=-1/0;for(const f of t){const t=gd(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>c&&(e=t.maxX,c=t.maxX.p[0]),t.minY.p[1]<s&&(r=t.minY,s=t.minY.p[1]),t.maxY.p[1]>u&&(o=t.maxY,u=t.maxY.p[1])}return{minX:n,minY:r,maxX:e,maxY:o}});function bd(t,n,e){const{minBezLength:r,maxCurviness:o,maxLength:i,angleIncrement:c}=e,s=oh(r),u=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(Ql(o.ps)<t)continue;const{next:i,ps:c}=o;if(St(c,i.ps).isQuiteDull){const t=c[c.length-1];e.push({curve:o,t:1,isSource:!0,p:t}),e.push({curve:i,t:0,isSource:!0,p:t})}}return e}}(r),f=Zh(r,o,i),l=function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ql(o.ps)<t||e.push(...pd(o.ps).maxima.map(t=>({curve:o,t,isSource:!0,p:Bp(o.ps,t)})))}return e}}(r),a=xd(t),p=(a.maxX.p[0]-a.minX.p[0])**2+(a.maxY.p[1]-a.minY.p[1])**2,d=t.map(s),g={id:0},v={maxCoordPowerOf2:n,squaredDiagonalLength:p,loops:t,cpTrees:eh(t,d,g),lastInsertId:g,...rh(t)};let m;if(m=md(v),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return{cpNode:m,meta:v};if(function(){if("undefined"==typeof _debug_)return;const t=performance.now();_debug_.timing.holeClosers+=t-Zp,Zp=t}(),m=Rh(v,c,t.map(u),!1)||m,m=Rh(v,c,t.map(l),!0)||m,m=Rh(v,c,t.map(f),!1)||m,function(){if("undefined"==typeof _debug_)return;const t=performance.now();_debug_.timing.oneAnd2Prongs+=t-Zp,Zp=t}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return{cpNode:m,meta:v};if(m=function(t,n){if(void 0===n)return;const e=new Set;let r=!0;for(;r;){r=!1;const o=new Set(h(n));for(const n of o){const{closeBysFor3Prong:i,addedCpNodes:c}=Kp(t,n);c.length>0&&(r=!0),void 0===i?e.add(n):(r=!0,nh(t,i,o,e)),c.forEach(t=>t.forEach(t=>e.add(t)))}n=th(e)}return n}(v,m),void 0===m)return;if("undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return{cpNode:m,meta:v};const x={cpNode:m,meta:v};return"undefined"!=typeof _debug_&&(_debug_.timing.threeProngs+=performance.now()-Zp),x}const{ceil:wd,log2:_d}=Math;function Md(t,n){const{maxCoordinate:e}=function(t){let n=0,e=1/0,r=-1/0,o=1/0,i=-1/0;for(const c of t)for(const t of c)for(const c of t){const t=c[0],s=c[1],u=za(Fa(t),Fa(s));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),s<o&&(o=s),s>i&&(i=s)}return{maxCoordinate:n,width:r-e,height:i-o}}(t),r=wd(_d(e)),o=function(t,n){const e={...n};for(const n in dp){const r=n;let o=e[r];const i=dp[r],{range:c,scaleByMaxCoordinate:s}=i;o<c[0]&&(o=c[0]),o>c[1]&&(o=c[1]),s&&(o*=2**(t-10)),e[r]=o}return e}(r,{...hp,...n||{}}),{applySat:i,simplify:c,satScale:s,simplifyTolerance:u}=o,f=Ba(t,void 0,{forceOrientationNegative:!0}),l=[];for(const t of f){let n=bd(t,r,o);void 0!==n&&(i&&(n=pp(n,s)),c&&(n=op(n,u,50)),l.push(n))}return l}function Sd(t){const n=function(t){let n=t;const e=cp(t);for(;e.length;){const r=e.pop();if(r.isHoleClosing||r.isIntersection)continue;let o=r.next;for(;;){o=o.next;let e=!1;const r=o.prevOnCircle;if(v(o)>2){const n=o.nextOnCircle;kt(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(x(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(O(t.cpNode));if(n)return{cpNode:n,meta:{...t.meta,cpTrees:ep(n)}}}const Id="red thin10 nofill ",Nd="http://www.w3.org/2000/svg";function yd(t,n,e=Id,r){const o=n.center,i=n.radius,c=document.createElementNS(Nd,"circle");return c.setAttributeNS(null,"cx",o[0].toString()),c.setAttributeNS(null,"cy",o[1].toString()),c.setAttributeNS(null,"r",i.toString()),c.setAttributeNS(null,"class",e),t.appendChild(c),r&&setTimeout(()=>c.remove(),r),[c]}function Cd(t,n,e=3,r="red",o){const[i]=yd(t,{center:n,radius:e},"dot "+r,o);return o&&setTimeout(()=>i.remove(),o),[i]}function Od(t,n,e=Id,r=0,o=void 0,i=0){const c=document.createElementNS(Nd,"line");c.setAttributeNS(null,"x1",n[0][0].toString()),c.setAttributeNS(null,"y1",n[0][1].toString()),c.setAttributeNS(null,"x2",n[1][0].toString()),c.setAttributeNS(null,"y2",n[1][1].toString()),c.setAttributeNS(null,"class",e),t.appendChild(c);let s=[];if(void 0!==o)for(const e of n)s.push(...Cd(t,e,i,o,r));for(const n of s)t.appendChild(n);const u=[c,...s];return r&&setTimeout(()=>{for(const t of u)t.remove()},r),u}function Ed(t,n,e=Id,r=3,o){const i=yd(t,{center:n,radius:r},e),c=[[n[0]-r,n[1]],[n[0]+r,n[1]]],s=[[n[0],n[1]-r],[n[0],n[1]+r]],u=Od(t,c,e),f=Od(t,s,e);return o&&setTimeout(()=>{i.forEach(t=>t.remove()),u.forEach(t=>t.remove()),f.forEach(t=>t.remove())},o),[...i,...u,...f]}function Td(t){return 2===t?"L":3===t?"Q":4===t?"C":void 0}function Ad(t,n,e=Id,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p]]=n,h=document.createElementNS(Nd,"path");h.setAttributeNS(null,"d",`M${s} ${u} Q${f} ${l} ${a} ${p}`),e&&h.setAttributeNS(null,"class",e);let d=[];if(void 0!==o)for(const e of n)d.push(...Cd(t,e,i,o,r));let g=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)g.push(...Od(t,[n[e],n[e+1]],c,r));const v=[h,...d,...g];for(const n of v)t.appendChild(n);return r&&setTimeout(()=>{for(const t of v)t.remove()},r),v}function Pd(t,n,e=Id,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p],[h,d]]=n;if(s===h&&f===h&&a===h&&u===d&&l===d&&p===d)return Ed(t,[s,u],e,.2,r);const g=document.createElementNS(Nd,"path");g.setAttributeNS(null,"d",`M${s} ${u} C${f} ${l} ${a} ${p} ${h} ${d}`),g.setAttributeNS(null,"class",e);let v=[];if(void 0!==o)for(const e of n)v.push(...Cd(t,e,i,o,r));let m=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)m.push(...Od(t,[n[e],n[e+1]],c,r));const x=[g,...v,...m];for(const n of x)t.appendChild(n);return r&&setTimeout(()=>{for(const t of x)t.remove()},r),x}function kd(t,n,e=Id,r=0,o=void 0,i=0,c=void 0){return 2===n.length?Od(t,n,e,r,o,i):3===n.length?Ad(t,n,e,r,o,i,c):4===n.length?Pd(t,n,e,r,o,i,c):[]}const Bd=["red","green","cyan","blue"];function zd(t,n){const e=1-n;if(4===t.length){const[[r,o],[i,c],[s,u],[f,l]]=t;return[r*e**3+3*i*e**2*n+3*s*e*n**2+f*n**3,o*e**3+3*c*e**2*n+3*u*e*n**2+l*n**3]}if(3===t.length){const[[r,o],[i,c],[s,u]]=t;return[r*e**2+2*i*e*n+s*n**2,o*e**2+2*c*e*n+u*n**2]}if(2===t.length){const[[r,o],[i,c]]=t;return[r*e+i*n,o*e+c*n]}return[NaN,NaN]}function Fd(t,n){return 2===t.length?function(t,n){const[[e,r],[o,i]]=t,c=1-n,s=[c*e+n*o,c*r+n*i];return[[[e,r],s],[s,[o,i]]]}(t,n):3===t.length?function(t,n){const[[e,r],[o,i],[c,s]]=t,u=1-n,f=[u*u*e+2*u*n*o+n*n*c,u*u*r+2*u*n*i+n*n*s];return[[[e,r],[u*e+n*o,u*r+n*i],f],[f,[u*o+n*c,u*i+n*s],[c,s]]]}(t,n):4===t.length?function(t,n){const[[e,r],[o,i],[c,s],[u,f]]=t,l=1-n,a=n*n,p=a*n,h=l*l,d=h*l,g=[p*u+3*l*a*c+3*h*n*o+d*e,p*f+3*l*a*s+3*h*n*i+d*r];return[[[e,r],[n*o+l*e,n*i+l*r],[a*c+2*l*n*o+h*e,a*s+2*l*n*i+h*r],g],[g,[a*u+2*n*l*c+h*o,a*f+2*n*l*s+h*i],[n*u+l*c,n*f+l*s],[u,f]]]}(t,n):[]}const Ld={circle:yd,crossHair:Ed,dot:Cd,line:Od,rect:function(t,n,e=Id,r){const[[o,i],[c,s]]=n,u=o<c?o:c,f=i<s?i:s,l=Math.abs(o-c),a=Math.abs(i-s),p=document.createElementNS(Nd,"rect");return p.setAttributeNS(null,"x",u.toString()),p.setAttributeNS(null,"y",f.toString()),p.setAttributeNS(null,"width",l.toString()),p.setAttributeNS(null,"height",a.toString()),e&&p.setAttributeNS(null,"class",e),t.appendChild(p),r&&setTimeout(()=>p.remove(),r),[p]},beziers:function(t,n,e,r){const o=void 0===e,i=[];for(let r=0;r<n.length;r++){const c=n[r],s=o?"thin5 nofill "+Bd[r%Bd.length]:e;i.push(...kd(t,c,s))}return r&&setTimeout(()=>i.forEach(t=>t.remove()),r),i},bezier:kd,bezierPiece:function(t,n,e,r=Id,o){const i=e[0]===e[1]?Ed(t,zd(n,e[0]),r,1.5):kd(t,function(t,n){if(0===n[0]&&1===n[1])return t;if(n[0]===n[1]){const e=zd(t,n[0]);return[e,e,e,e]}return 0===n[0]?Fd(t,n[1])[0]:1===n[1]?Fd(t,n[0])[1]:Fd(Fd(t,n[0])[1],(n[1]-n[0])/(1-n[0]))[0]}(n,e),r);return o&&setTimeout(()=>i.forEach(t=>t.remove()),o),i},quadBezier:Ad,cubicBezier:Pd,polygon:function(t,n,e=Id,r){const o=document.createElementNS(Nd,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},loop:function(t,n,e=Id,r){if(!n.length)return[];const o=document.createElementNS(Nd,"path");let i=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];i+=`${Td(e.length)} `;for(let t=1;t<e.length;t++)i+=`${e[t][0]} ${e[t][1]} `}return i+=" z",o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},polyline:function(t,n,e=Id,r){if(n.length<2)return[];const o=document.createElementNS(Nd,"path");let i=`M${n[0][0]} ${n[0][1]} L`;for(let t=0;t<n.length;t++)i+=`${n[t][0]} ${n[t][1]} `;return o.setAttributeNS(null,"d",i),e&&o.setAttributeNS(null,"class",e),t.appendChild(o),r&&setTimeout(()=>o.remove(),r),[o]},text:function(t,n,e,r,o=Id,i){const c=document.createElementNS(Nd,"text");return c.setAttributeNS(null,"x",n[0].toString()),c.setAttributeNS(null,"y",n[1].toString()),c.setAttributeNS(null,"font-size",r.toString()),c.setAttributeNS(null,"class",o),c.textContent=e,t.appendChild(c),i&&setTimeout(()=>c.remove(),i),[c]}};function Yd(t,n){return(n,e,r,o=0,i=1)=>{let c,s;switch(e.isHoleClosing){case!1:c="red ",s="2";break;case!0:c="cyan ",s="10"}const{pointOnShape:u}=e,{circle:f}=u,{center:l,radius:a}=f,{isSource:p,p:h}=u,d=e.nextOnCircle.pointOnShape.p,g=p?h:d,v=p?d:h,{line:m,dot:x,circle:b,crossHair:w}=Ld,_=x(n,f.center,.02*i,"yellow",o);return[...b(n,f,c+"thin"+s+" nofill",o),...x(n,g,.005*i,c,o),...x(n,v,.01*i,c,o),...t?w(n,f.center,"red thin2 nofill",.002*i,o):[],..._]}}function Hd(t,n){return{center:t.center,radius:n*t.radius}}const Xd=["thin10 blue nofill","thin10 red nofill"];function $d(t,n,e,r=0,o=1){let i=n.cpNode;if(!i)return[];for(;!x(i);)i=i.next;const c=[];let s=0;return I(i,n=>{if(x(n))return;const e=At(n);e&&(c.push(...Ld.bezier(t,e,Xd[s%2],r)),s++)}),c}function Vd(t,n,e,r){const o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttributeNS(null,"cx",n[0].toString()),o.setAttributeNS(null,"cy",n[1].toString()),o.setAttributeNS(null,"r",e.toString()+"%"),o.setAttributeNS(null,"class",r),t.appendChild(o),o}function Dd(t,n,e="thin5 purple nofill",r=0,o=1){const i=[],c=[];for(const t of n){if(x(t))continue;const n=At(t);n&&c.push(n)}return i.push(...a(t,c,e,r)),i}const qd={oneProng:function(t,n,e,r=0,o=1){const{pointOnShape:i}=n,{circle:c}=i;return[...Ld.dot(t,i.p,.02*o,"deeppink",r),...Ld.dot(t,c.center,.01*o,"deeppink",r),...Ld.circle(t,c,"deeppink thin5 nofill",r)]},twoProng:Yd(!1),threeProng:function(t,n,e,r=0,o=1){const i=Hd(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=Ld,p=l(t,i,"blue thin2 nofill",r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...Ld.line(t,[e,c],"thin5 red",r))}const g=a(t,i.center,"red thin2 nofill",.02*o,r);return[...h,...d,...p,...g]},boundingHull:function(t,n,e="thin5 black nofill",r=0,o=1){return Ld.polygon(t,n,e,r)},looseBoundingBox:function(t,n,e="thin5 brown nofill",r=0,o=1){const[[i,c],[s,u]]=n;return n=[[i,c],[s,c],[s,u],[i,u]],Ld.polygon(t,n,e,r)},tightBoundingBox:function(t,n,e="thin5 pinker nofill",r=0,o=1){return Ld.polygon(t,n,"thin5 pinker nofill",r)},vertex:function(t,n,e,r=0,o=1){const i=n.pointOnShape.circle;let c=[];return c=[...Ld.dot(t,i.center,.01*o,"darkgreen",r)],c},mat:$d,maxVertex:function(t,n){const e=n.pointOnShape.circle;return Ld.circle(t,e,"brown thin10 nofill")},leaves:function(t,n,e="thin10 deeppink nofill",r=0,o=1){const i=[],{line:c,dot:s,circle:u}=Ld;for(const f of n){const n=f.pointOnShape,{circle:l}=n,{center:a,radius:p}=l,h=[Vd(t,a,.5,"pinker thin5 nofill")],d=m(f).map(t=>t.pointOnShape),g=[],v=[];for(let n=0;n<d.length;n++){const e=d[n].p;v.push(...s(t,e,.01*(n+1)*o,"pinker",r)),g.push(...c(t,[e,a],"thin5 red",r))}const x=u(t,l,e,r);i.push(...x,...v,...g,...h)}return i},cull:function(t,n,e="thin10 cyan nofill",r=0,o=1){const i=[];return i.push(...Ld.crossHair(t,n,e,.1*o,r)),i},cpNode:function(t,n,e="blue thin2 nofill",r=0,o=1){const i=Hd(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=Ld,p=l(t,i,e,r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...Ld.line(t,[e,c],"thin5 red",r))}const g=a(t,c,"orange thin10 nofill",2*o,r);return[...h,...d,...p,...g]},branch:Dd,holeCloser:Yd(!1)},jd={...qd,twoProng:Yd(!0)};function Wd(t){if(!t)return void(window._debug_=void 0);let n=window._debug_;n={...n,elems:{...n?.elems,oneProng:[],twoProng:[],looseBoundingBox:[],tightBoundingBox:[],vertex:[],threeProng:[],boundingHull:[],mat:[],cpNode:[],maxVertex:[],leaves:[]},timing:{...n?.timing,holeClosers:0,oneAnd2Prongs:0,threeProngs:0,sats:0,simplifyMat:0},fs:{...n?.fs,drawElem:{...n?.fs?.drawElem,...qd}},directives:{...n?.directives,stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}const Qd={oneProng:[],twoProng:[],threeProng:[],looseBoundingBox:[],tightBoundingBox:[],boundingHull:[],vertex:[],mat:[],maxVertex:[],leaves:[],cull:[],cpNode:[],branch:[],holeCloser:[]},Rd=Object.keys(Qd);function Gd(t,n,e,r){const o=[];for(const r of t)o.push({type:0,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(Ud);const i=new Set,c=[];for(const t of o){const{item:n}=t;if(0===t.type){for(const t of i.values())r(n,t)&&c.push([n,t]);i.add(n)}else 1===t.type&&i.delete(t.item)}return c}function Ud(t,n){const e=t.x-n.x;return 0!==e?e:0===t.type?-1:1}const Zd=1e-4;function Jd(t,n){const e=t.pointOnShape,r=n.pointOnShape;let{curve:o,p:i,t:c}=e,{curve:s,p:u,t:f}=r;if(i[0]===u[0]&&i[1]===u[1])return[i];1===c&&(c=0,o=o.next),0===f&&(f=1,s=s.prev);const{ps:l}=o,{ps:a}=s,p=[i,j(i)(W(U(l,c)))],h=[u,j(u)(W(U(a,f)))],d=H(p,h),g=X(i,u);let v;if(d){const t=X(i,d),n=X(u,d);v=$(t,g)<0||$(n,g)>0}else v=!0;if(!v)return[i,d,u];const m=X(p[0],p[1]),x=X(h[0],h[1]),b=Math.abs(D(g,m))/9,w=Math.abs(D(g,x))/9;return b>.01||w>.01||b>Zd||w>Zd?void 0:[i,u]}const Kd=Y(function(t){return pn(At(t))});function tg(t,n){const e=function(t){const n=new Map;for(let e of t)for(let r of t){const t=e.pointOnShape.circle.center,o=r.pointOnShape.circle.center,i=e.pointOnShape.p,c=r.pointOnShape.p;r!==e&&t[0]===o[0]&&t[1]===o[1]&&i[0]===c[0]&&i[1]===c[1]&&n.set(e,r)}return n}(n),r=t.length,o=[];for(let n=0;n<r;n++){const i=t[n],c=[];for(let o=0;o<r;o++){const r=t[o];if(n===o){c.push(0);continue}let s=1/0;for(const t of m(i)){let n=Kd(t),o=t.next;for(;!kt(o,r);)if(o.isHoleClosing)o=ng(e,o);else{if(Sn(o)){n=1/0;break}n+=Kd(o),o=o.next}n<s&&(s=n)}c.push(s)}o.push(c)}return o}function ng(t,n){return t.get(n).next}function eg(t,n){return t.pointOnShape.curve.loop===n.pointOnShape.curve.loop}function rg(t){if(!x(t))return!1;if(Ft(t))return!0;for(;t.prev===t.prevOnCircle;)t=t.prev;return m(t.prevOnCircle,!0).every(x)}function og(t){let{cpNode:n}=t,e=n;do{if(rg(n)||n.next!==n.nextOnCircle){n=n.next;continue}const t=n.next,r=t.next,o=n.next.nextOnCircle;n.next=r,n.nextOnCircle=o,r.prev=n,o.prevOnCircle=n,e===t&&(e=n),n=n.next}while(n!==e);return t.cpNode=n,t}const ig=Number.EPSILON,{abs:cg,max:sg}=Math;function ug(t,n){return 0===n?0:function(t){let n=0,e=1.125,r=t(n),o=t(e),i=n,c=r,s=e-n,u=s;for(;;){cg(c)<cg(o)&&(n=e,e=i,i=n,r=o,o=c,c=r);const f=2*ig*sg(1,cg(n),cg(e)),l=.5*(i-e);if(cg(l)<=f)return e;if(cg(s)<f||cg(r)<=cg(o))s=l,u=s;else{let t,a,p=o/r;if(n===i)t=2*l*p,a=1-p;else{a=r/c;const i=o/c;t=p*(2*l*a*(a-i)-(e-n)*(i-1)),a=(a-1)*(i-1)*(p-1)}0<t?a=-a:t=-t,p=s,s=u,2*t<3*l*a-cg(f*a)&&t<cg(.5*p*a)?u=t/a:(s=l,u=s)}if(n=e,r=o,f<cg(u)?e+=u:0<l?e+=f:e-=f,o=t(e),0===o)return e;o*c>0&&(i=n,c=r,s=e-n,u=s)}}(e=>(n=>lp([0,n],t))(e)-n)}const{max:fg,min:lg}=Math;function ag(t,n,e){return fg(n,lg(e,t))}function pg(t){return lp(t.ts,t.ps)}const hg=1e-9;function dg(t){const{ps:n,ts:[e,r]}=t;return{ps:n.toReversed(),ts:[1-r,1-e]}}function gg(t){const n=[0];let e=0;for(let r=0;r<t.length;r++)e+=t[r],n.push(e);return n}function vg(t){let n,e=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r++)t[r]<=e&&(e=t[r],n=r);return n}function mg(t,n){const e=[];for(let r=0;r<t.length;r++)(t[r]===n||xg(t[r],n))&&e.push(r);return e}function xg(t,n){return Math.abs(t-n)<=hg}function bg(t){const n=t.filter(t=>!function(t){const{ps:n,ts:[e,r]}=t;if(e===r||n.length<=1)return!0;const[[o,i],[c,s]]=n,u=o===c&&i===s;if(2===n.length)return u;const[f,l]=n[2],a=u&&c===f&&s===l;if(3===n.length)return a;const[p,h]=n[3],d=a&&f===p&&l===h;return 4===n.length&&d}(t));return n.length>0?n:[t[0]]}function wg(t){const n={ps:At(t),ts:[0,1]};if(t.isHoleClosing&&!eg(t,t.next))return;const e=function(t){const n=rg(t)?void 0:t.next.prevOnCircle;return{boundaryBeziers:bg(T(t)),boundaryBeziersOpp:void 0===n?void 0:bg(T(n))}}(t),{boundaryBeziers:r,boundaryBeziersOpp:o}=e;return function(t,n,e){const r=(e??[]).map(dg).toReversed(),o=function(t){const n=function(t,n){const e=[];for(let r=0;r<t.length;r++){const o=t[r],i=[];for(let t=0;t<o.length;t++)i.push(n(o[t]));e.push(i)}return e}(t,pg),e=n.map(dn),r=n.map(gg).map((t,n)=>{const r=e[n];return r<=hg?t.map((t,n)=>0===n?0:1):t.map(t=>t/r)});let o=new Array(t.length).fill(0),i=new Array(t.length).fill(0);const c=[];let s=0;for(;o.some(t=>t<1)&&s++<100;){const n=[];for(let e=0;e<t.length;e++){const t=i[e],o=r[e][t+1],c=void 0===o?Number.POSITIVE_INFINITY:o;n.push(c)}const e=vg(n),s=mg(n,n[e]),u=n[e],f=new Array(t.length).fill([]);for(let n=0;n<t.length;n++){const e=t[n],c=i[n];if(c>=e.length){const t=e[e.length-1];f[n]={ps:t.ps,ts:[1,1]},o[n]=1;continue}if(s.includes(n)){const t=o[n],r=e[c],[s,u]=r.ts,l=u-s;f[n]={ps:r.ps,ts:[s+t*l,u]};const a=c+1;i[n]=a,o[n]=a>=e.length?1:0}else{const t=o[n],s=e[c],[l,a]=s.ts,p=a-l,h=pg({ps:s.ps,ts:[0,1]}),d=r[n][c],g=r[n][c+1]-d,v=g<=hg?t:ag((u-d)/g,t,1),m=h<=hg?t:ag(ug(s.ps,h*v),t,1);if(f[n]={ps:s.ps,ts:[l+t*p,l+m*p]},xg(m,1)){const t=c+1;i[n]=t,o[n]=t>=e.length?1:0}else i[n]=c,o[n]=m}}c.push(f)}if(o.some(t=>t<1))throw new Error("splitTriPath_: exceeded maximum iterations");return c}(r.length>0?[t,[n],r]:[t,[n]]),i=[];for(let t=0;t<o.length;t++){const n=o[t],[e,r]=n,c={boundaryBezier:e,medialBezier:r};i.push(c)}return i}(r,n,o??[])}function _g(t){const n=[],e=new Map;for(let r=0;r<t.length;r++){const o=t[r],i=[];for(let t=0;t<o.length;t++){const n=o[t];e.set(n,[r,t]);const c=wg(n);i.push(c)}n.push(i)}const r=[];for(let o=0;o<t.length;o++){const i=t[o];for(let t=0;t<i.length;t++){const c=i[t],s=rg(c)?void 0:c.next.prevOnCircle,u=void 0===s?[255,65535]:e.get(s),f=n[o][t];void 0!==u&&void 0!==f?r.push([[o,t],u]):r.push([[o,t],[255,65535]])}}return{mbssByLoop:n,oppArr:r}}function Mg(t){let{cpNode:n}=t;for(;!rg(n);)n=n.next;return eg(n,n.next)||(n=n.holeCloserTwin),function(t){const n=[],e=[t],r=new Set(e);for(t.isHoleClosing&&r.add(t.prevOnCircle.holeCloserTwin),r.add(t);e.length>0;){const t=[],o=e.pop(),i=o.pointOnShape.curve.loop;let c=o;do{if(i===c.pointOnShape.curve.loop){t.push(c),c=c.next;continue}const n=c.holeCloserTwin;r.has(n)||(r.add(n),r.add(n.prevOnCircle.holeCloserTwin),e.push(n)),c=c.prev.holeCloserTwin}while(c!==o);n.push(t)}return n}(n)}function Sg(t){const n=[],e=function(t,n){const e=function(t,n){return t.map(t=>pp(t,n)).map(og)}(t,n);return e.map(Mg).map(_g)}(t,1.5);for(const t of e){const{mbssByLoop:e,oppArr:r}=t;for(let t=0;t<e.length;t++){const r=e[t];for(let o=0;o<r.length;o++){const r=e[t][o];if(void 0===r)continue;const i=r;for(let t=0;t<i.length;t++){const e=i[t],{boundaryBezier:r,medialBezier:o}=e;n.push(r)}}}}return n}export{_n as CpNodeFs,e as beziersToSvgPathStr,O as clone,wn as cpNodeComparator,eh as createInitialCpTree,Rd as debugElemNames,a as drawBeziersAsSinglePath,Dd as drawBranch,qd as drawElemFs,jd as drawElemFsDetailed,$d as drawMat,Qd as emptyDebugElems,Wd as enableDebugForMat,M as enhanceCpNode,Vh as find2Prong,md as findAndAddHoleClosing2Prongs,Md as findMats,p as floydWarshall,m as getAllOnCircle,h as getAllOnLoop,xn as getAllVertices,T as getBoundaryBezierPartsToNext,hn as getBoundaryBeziersBetween,P as getBoundaryBeziersToNext,Dp as getBoundaryPieceBeziers,Lt as getBranch,Yt as getBranchBeziers,Ka as getBranches,z as getChildren,zp as getCloseBoundaryPointsCertified,Tp as getClosestSquareDistanceToRect,Ct as getEdgeDirection,Pt as getFirstExit,Zh as getFor2ProngsOnLoop,tg as getGraph,d as getHoleClosers,Jd as getImpliedBoundaryBezierBetween,mn as getInitialDegAngleBetweenMatCurves,Tt as getMatCurveBetween,At as getMatCurveToNext,vn as getMatCurvesBetween,rh as getPartialMeta,l as getPathsFromStr,Cp as getPotentialClosestPointsOnCurveCertified,v as getProngCount,b as getRealProngCount,gn as getSalience,ap as getSatCulls,xd as getShapeBounds,oh as getSharpCornersOnLoop,N as getVertexForwardChildren,w as isFullyTerminating,kt as isOnSameCircle,eg as isOnSameLoop,Bt as isOneProng,_ as isSharp,x as isTerminating,Ft as isTrivial,zt as isTwoProng,Sn as isVertexSpecial,t as loopFromBeziers,Sg as reconstructFromMats,B as removeVertex,Hd as scaleCircle,op as simplifyMat,Gd as sweepLine,pp as toScaleAxis,S as traverseCp,I as traverseEdges,y as traverseVertices,Sd as trimMat};
|