@antv/g-canvas 1.9.47 → 1.10.0-alpha.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/packages/g-canvas/src/Canvas2DContextService.ts","../src/packages/g-canvas/src/ContextRegisterPlugin.ts","../src/packages/g-canvas/src/index.ts"],"sourcesContent":[null,null,null],"names":["isString","isBrowser","setDOMSize","RenderReason","__extends","AbstractRendererPlugin","ImageLoader","CanvasPathGenerator","CanvasRenderer","DomInteraction","CanvasPicker","HTMLRenderer","AbstractRenderer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAA,sBAAA,kBAAA,YAAA;AAaE,IAAA,SAAA,sBAAA,CAAY,OAAsC,EAAA;AAChD,QAAA,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACjD,QAAA,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;KACpC;AAED,IAAA,sBAAA,CAAA,SAAA,CAAA,IAAI,GAAJ,YAAA;QACQ,IAAA,EAAA,GAAwB,IAAI,CAAC,YAAY,EAAvC,SAAS,GAAA,EAAA,CAAA,SAAA,EAAE,MAAM,GAAA,EAAA,CAAA,MAAsB,CAAC;AAEhD,QAAA,IAAI,MAAM,EAAE;AACV,YAAA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;AAEtB,YAAA,IACE,SAAS;AACR,gBAAA,MAA4B,CAAC,aAAa,KAAK,SAAS,EACzD;AACC,gBAAA,SAAyB,CAAC,WAAW,CAAC,MAA2B,CAAC,CAAC;AACrE,aAAA;AAED,YAAA,IAAI,CAAC,UAAU,GAAI,MAA4B,CAAC,aAAa,CAAC;YAC9D,IAAI,CAAC,YAAY,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;AAC/C,SAAA;AAAM,aAAA,IAAI,SAAS,EAAE;;AAEpB,YAAA,IAAI,CAAC,UAAU,GAAGA,aAAQ,CAAC,SAAS,CAAC;AACnC,kBAAE,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC;kBAClC,SAAS,CAAC;YACd,IAAI,IAAI,CAAC,UAAU,EAAE;;gBAEnB,IAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAEjD,gBAAA,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBACrC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE;oBACnC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;AAC7C,iBAAA;AACD,gBAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACxB,aAAA;AACF,SAAA;QAED,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC7C,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;KAChE,CAAA;AAED,IAAA,sBAAA,CAAA,SAAA,CAAA,UAAU,GAAV,YAAA;QACE,OAAO,IAAI,CAAC,OAAmC,CAAC;KACjD,CAAA;AAED,IAAA,sBAAA,CAAA,SAAA,CAAA,aAAa,GAAb,YAAA;QACE,OAAO,IAAI,CAAC,OAAO,CAAC;KACrB,CAAA;AAED,IAAA,sBAAA,CAAA,SAAA,CAAA,MAAM,GAAN,YAAA;QACE,OAAO,IAAI,CAAC,GAAG,CAAC;KACjB,CAAA;AAED,IAAA,sBAAA,CAAA,SAAA,CAAA,qBAAqB,GAArB,YAAA;AACE,QAAA,IAAK,IAAI,CAAC,OAA6B,CAAC,qBAAqB,EAAE;AAC7D,YAAA,OAAQ,IAAI,CAAC,OAA6B,CAAC,qBAAqB,EAAE,CAAC;AACpE,SAAA;KACF,CAAA;AAED,IAAA,sBAAA,CAAA,SAAA,CAAA,OAAO,GAAP,YAAA;;AAEE,QAAA,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;;;YAG9D,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC3C,SAAA;KACF,CAAA;AAED,IAAA,sBAAA,CAAA,SAAA,CAAA,MAAM,GAAN,UAAO,KAAa,EAAE,MAAc,EAAA;AAC1B,QAAA,IAAA,gBAAgB,GAAK,IAAI,CAAC,YAAY,iBAAtB,CAAuB;;AAG/C,QAAA,IAAI,GAAG,GAAG,gBAAgB,KAAKC,eAAS,IAAI,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAC1E,QAAA,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACpC,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAEf,IAAI,IAAI,CAAC,OAAO,EAAE;;YAEhB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC;YACtC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC;;YAGxCC,gBAAU,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;;;;;AAMzC,SAAA;QAED,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,GAAG,CAACC,kBAAY,CAAC,cAAc,CAAC,CAAC;KACtE,CAAA;IAED,sBAAgB,CAAA,SAAA,CAAA,gBAAA,GAAhB,UAAiB,MAAc,EAAA;QAC7B,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE;YAC5C,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AACvC,SAAA;KACF,CAAA;IAEK,sBAAS,CAAA,SAAA,CAAA,SAAA,GAAf,UAAgB,OAAqC,EAAA;AAArC,QAAA,IAAA,OAAA,KAAA,KAAA,CAAA,EAAA,EAAA,OAAqC,GAAA,EAAA,CAAA,EAAA;;;;gBAC3C,IAAI,GAAqB,OAAO,CAA5B,IAAA,EAAE,cAAc,GAAK,OAAO,eAAZ,CAAa;AACzC,gBAAA,OAAA,CAAA,CAAA,aAAQ,IAAI,CAAC,OAAO,CAAC,MAA4B,CAAC,SAAS,CACzD,IAAI,EACJ,cAAc,CACf,CAAC,CAAA;;;AACH,KAAA,CAAA;IACH,OAAC,sBAAA,CAAA;AAAD,CAAC,EAAA,CAAA;;AChID,IAAA,qBAAA,kBAAA,UAAA,MAAA,EAAA;IAA2CC,eAAsB,CAAA,qBAAA,EAAA,MAAA,CAAA,CAAA;AAAjE,IAAA,SAAA,qBAAA,GAAA;QAAA,IAQC,KAAA,GAAA,MAAA,KAAA,IAAA,IAAA,MAAA,CAAA,KAAA,CAAA,IAAA,EAAA,SAAA,CAAA,IAAA,IAAA,CAAA;QAPC,KAAI,CAAA,IAAA,GAAG,yBAAyB,CAAC;;KAOlC;AANC,IAAA,qBAAA,CAAA,SAAA,CAAA,IAAI,GAAJ,YAAA;AACE,QAAA,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,sBAAsB,CAAC;KACtD,CAAA;AACD,IAAA,qBAAA,CAAA,SAAA,CAAA,OAAO,GAAP,YAAA;AACE,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;KACpC,CAAA;IACH,OAAC,qBAAA,CAAA;AAAD,CARA,CAA2CC,4BAAsB,CAQhE,CAAA;;ACQD,IAAA,QAAA,kBAAA,UAAA,MAAA,EAAA;IAA8BD,eAAgB,CAAA,QAAA,EAAA,MAAA,CAAA,CAAA;AAC5C,IAAA,SAAA,QAAA,CAAY,MAAgC,EAAA;QAA5C,IACE,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAM,MAAM,CAAC,IAcd,IAAA,CAAA;;AAXC,QAAA,KAAI,CAAC,cAAc,CAAC,IAAI,qBAAqB,EAAE,CAAC,CAAC;QACjD,KAAI,CAAC,cAAc,CAAC,IAAIE,sBAAW,CAAC,MAAM,EAAE,CAAC,CAAC;QAC9C,KAAI,CAAC,cAAc,CAAC,IAAIC,8BAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;;QAEtD,KAAI,CAAC,cAAc,CAAC,IAAIC,yBAAc,CAAC,MAAM,EAAE,CAAC,CAAC;QACjD,KAAI,CAAC,cAAc,CAAC,IAAIC,yBAAc,CAAC,MAAM,EAAE,CAAC,CAAC;;QAEjD,KAAI,CAAC,cAAc,CAAC,IAAIC,uBAAY,CAAC,MAAM,EAAE,CAAC,CAAC;;QAG/C,KAAI,CAAC,cAAc,CAAC,IAAIC,uBAAY,CAAC,MAAM,EAAE,CAAC,CAAC;;KAChD;IACH,OAAC,QAAA,CAAA;AAAD,CAjBA,CAA8BC,sBAAgB,CAiB7C;;;;;;;;;;"}
@@ -1 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.Canvas2D={}),t.window.G)}(this,(function(t,e){"use strict";function r(){r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=Object.create((e&&e.prototype instanceof d?e:d).prototype),a=new O(n||[]);return i(o,"_invoke",{value:M(t,r,a)}),o}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function p(){}function v(){}var y={};u(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(L([])));m&&m!==e&&n.call(m,a)&&(y=m);var b=v.prototype=d.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function M(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=h(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function w(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=h(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return p.prototype=v,i(b,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:p,configurable:!0}),p.displayName=u(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},x(E.prototype),u(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new E(l(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(b),u(b,c,"Generator"),u(b,a,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=L,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function n(t,e,r,n,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}var a="undefined"!=typeof Float32Array?Float32Array:Array;function s(){var t=new a(16);return a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function u(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],u=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],v=e[12],y=e[13],g=e[14],m=e[15],b=r[0],x=r[1],E=r[2],M=r[3];return t[0]=b*n+x*s+E*h+M*v,t[1]=b*i+x*c+E*f+M*y,t[2]=b*o+x*u+E*d+M*g,t[3]=b*a+x*l+E*p+M*m,t[4]=(b=r[4])*n+(x=r[5])*s+(E=r[6])*h+(M=r[7])*v,t[5]=b*i+x*c+E*f+M*y,t[6]=b*o+x*u+E*d+M*g,t[7]=b*a+x*l+E*p+M*m,t[8]=(b=r[8])*n+(x=r[9])*s+(E=r[10])*h+(M=r[11])*v,t[9]=b*i+x*c+E*f+M*y,t[10]=b*o+x*u+E*d+M*g,t[11]=b*a+x*l+E*p+M*m,t[12]=(b=r[12])*n+(x=r[13])*s+(E=r[14])*h+(M=r[15])*v,t[13]=b*i+x*c+E*f+M*y,t[14]=b*o+x*u+E*d+M*g,t[15]=b*a+x*l+E*p+M*m,t}function l(t,e,r){var n,i,o,a,s,c,u,l,h,f,d,p,v=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],u=e[6],l=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=n=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=u,t[7]=l,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*v+s*y+h*g+e[12],t[13]=i*v+c*y+f*g+e[13],t[14]=o*v+u*y+d*g+e[14],t[15]=a*v+l*y+p*g+e[15]),t}function h(){var t=new a(3);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function f(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function d(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var p;p=h();!function(){var t,e=(t=new a(2),a!=Float32Array&&(t[0]=0,t[1]=0),t)}();function v(t,e,r){return{x:t*Math.cos(r)-e*Math.sin(r),y:t*Math.sin(r)+e*Math.cos(r)}}function y(t,e,r,n,i,o,a,s,c,u){var l,h,f,d,p,g=t,m=e,b=r,x=n,E=s,M=c,w=120*Math.PI/180,P=Math.PI/180*(+i||0),S=[];if(u)h=u[0],f=u[1],d=u[2],p=u[3];else{m=(l=v(g,m,-P)).y;var O=((g=l.x)-(E=(l=v(E,M,-P)).x))/2,L=(m-(M=l.y))/2,A=O*O/(b*b)+L*L/(x*x);A>1&&(b*=A=Math.sqrt(A),x*=A);var T=b*b,k=x*x,C=(o===a?-1:1)*Math.sqrt(Math.abs((T*k-T*L*L-k*O*O)/(T*L*L+k*O*O)));d=C*b*L/x+(g+E)/2,h=Math.asin(((m-(p=C*-x*O/b+(m+M)/2))/x*1e9>>0)/1e9),f=Math.asin(((M-p)/x*1e9>>0)/1e9),0>(h=d>g?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>E?Math.PI-f:f)&&(f=2*Math.PI+f),a&&h>f&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var R=f-h;if(Math.abs(R)>w){var I=f,N=E,_=M;S=y(E=d+b*Math.cos(f=h+w*(a&&f>h?1:-1)),M=p+x*Math.sin(f),b,x,i,0,a,N,_,[f,I,d,p])}R=f-h;var j=Math.cos(h),D=Math.sin(h),B=Math.cos(f),F=Math.sin(f),G=Math.tan(R/4),$=4/3*b*G,H=4/3*x*G,W=[g,m],Y=[g+$*D,m-H*j],U=[E+$*F,M-H*B],X=[E,M];if(Y[0]=2*W[0]-Y[0],Y[1]=2*W[1]-Y[1],u)return Y.concat(U,X,S);for(var z=[],q=0,Q=(S=Y.concat(U,X,S)).length;Q>q;q+=1)z[q]=q%2?v(S[q-1],S[q],P).y:v(S[q],S[q+1],P).x;return z}var g=function(t){return null==t},m={}.toString,b=function(t,e){return m.call(t)==="[object "+e+"]"},x=function(t){return b(t,"String")},E=function(t,e,r){return e>t?e:t>r?r:t},M=function(t){return b(t,"Number")};function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}function P(t,e){var r=e.r;t.arc(r,r,r,0,2*Math.PI,!1)}function S(t,e){var r=e.rx,n=e.ry;if(t.ellipse)t.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var i=r>n?r:n,o=r>n?1:r/n,a=r>n?n/r:1;t.save(),t.scale(o,a),t.arc(0,0,i,0,2*Math.PI)}}function O(t,r){var n=r.x1,i=r.y1,o=r.x2,a=r.y2,s=r.defX,c=void 0===s?0:s,u=r.defY,l=void 0===u?0:u,h=r.markerStart,f=r.markerEnd,d=r.markerStartOffset,p=r.markerEndOffset,v=0,y=0,g=0,m=0,b=0;h&&e.isDisplayObject(h)&&d&&(v=Math.cos(b=Math.atan2(a-i,o-n))*(d||0),y=Math.sin(b)*(d||0)),f&&e.isDisplayObject(f)&&p&&(g=Math.cos(b=Math.atan2(i-a,n-o))*(p||0),m=Math.sin(b)*(p||0)),t.moveTo(n-c+v,i-l+y),t.lineTo(o-c+g,a-l+m)}function L(t,r){var n=r.defX,i=void 0===n?0:n,o=r.defY,a=void 0===o?0:o,s=r.markerStart,c=r.markerEnd,u=r.markerStartOffset,l=r.markerEndOffset,h=r.path,f=h.absolutePath,d=h.segments,p=0,v=0,y=0,g=0,m=0;if(s&&e.isDisplayObject(s)&&u){var b=s.parentNode.getStartTangent(),x=b[0],E=b[1];p=Math.cos(m=Math.atan2(x[1]-E[1],x[0]-E[0]))*(u||0),v=Math.sin(m)*(u||0)}if(c&&e.isDisplayObject(c)&&l){var M=c.parentNode.getEndTangent(),w=M[0],P=M[1];y=Math.cos(m=Math.atan2(w[1]-P[1],w[0]-P[0]))*(l||0),g=Math.sin(m)*(l||0)}for(var S=0;f.length>S;S++){var O=f[S],L=f[S+1],A=0===S&&(0!==p||0!==v),T=(S===f.length-1||L&&("M"===L[0]||"Z"===L[0]))&&0!==y&&0!==g;switch(O[0]){case"M":A?(t.moveTo(O[1]-i+p,O[2]-a+v),t.lineTo(O[1]-i,O[2]-a)):t.moveTo(O[1]-i,O[2]-a);break;case"L":T?t.lineTo(O[1]-i+y,O[2]-a+g):t.lineTo(O[1]-i,O[2]-a);break;case"Q":t.quadraticCurveTo(O[1]-i,O[2]-a,O[3]-i,O[4]-a),T&&t.lineTo(O[3]-i+y,O[4]-a+g);break;case"C":t.bezierCurveTo(O[1]-i,O[2]-a,O[3]-i,O[4]-a,O[5]-i,O[6]-a),T&&t.lineTo(O[5]-i+y,O[6]-a+g);break;case"A":var k=d[S].arcParams,C=k.cx,R=k.cy,I=k.rx,N=k.ry,_=k.startAngle,j=k.endAngle,D=k.xRotation,B=k.sweepFlag;if(t.ellipse)t.ellipse(C-i,R-a,I,N,D,_,j,!!(1-B));else{var F=I>N?I:N,G=I>N?1:I/N,$=I>N?N/I:1;t.translate(C-i,R-a),t.rotate(D),t.scale(G,$),t.arc(0,0,F,_,j,!!(1-B)),t.scale(1/G,1/$),t.rotate(-D),t.translate(-(C-i),-(R-a))}T&&t.lineTo(O[6]-i+y,O[7]-a+g);break;case"Z":t.closePath()}}}function A(t,r){var n=r.defX,i=void 0===n?0:n,o=r.defY,a=void 0===o?0:o,s=r.markerStart,c=r.markerEnd,u=r.markerStartOffset,l=r.markerEndOffset,h=r.points.points,f=h.length,d=h[0][0]-i,p=h[0][1]-a,v=h[f-1][0]-i,y=h[f-1][1]-a,g=0,m=0,b=0,x=0,E=0;s&&e.isDisplayObject(s)&&u&&(g=Math.cos(E=Math.atan2(h[1][1]-h[0][1],h[1][0]-h[0][0]))*(u||0),m=Math.sin(E)*(u||0)),c&&e.isDisplayObject(c)&&l&&(b=Math.cos(E=Math.atan2(h[f-1][1]-h[0][1],h[f-1][0]-h[0][0]))*(l||0),x=Math.sin(E)*(l||0)),t.moveTo(d+(g||b),p+(m||x));for(var M=1;f-1>M;M++){var w=h[M];t.lineTo(w[0]-i,w[1]-a)}t.lineTo(v,y)}function T(t,r){var n=r.defX,i=void 0===n?0:n,o=r.defY,a=void 0===o?0:o,s=r.markerStart,c=r.markerEnd,u=r.markerStartOffset,l=r.markerEndOffset,h=r.points.points,f=h.length,d=h[0][0]-i,p=h[0][1]-a,v=h[f-1][0]-i,y=h[f-1][1]-a,g=0,m=0,b=0,x=0,E=0;s&&e.isDisplayObject(s)&&u&&(g=Math.cos(E=Math.atan2(h[1][1]-h[0][1],h[1][0]-h[0][0]))*(u||0),m=Math.sin(E)*(u||0)),c&&e.isDisplayObject(c)&&l&&(b=Math.cos(E=Math.atan2(h[f-2][1]-h[f-1][1],h[f-2][0]-h[f-1][0]))*(l||0),x=Math.sin(E)*(l||0)),t.moveTo(d+g,p+m);for(var M=1;f-1>M;M++){var w=h[M];t.lineTo(w[0]-i,w[1]-a)}t.lineTo(v+b,y+x)}function k(t,e){var r=e.radius,n=e.width,i=e.height,o=n,a=i;if(r&&r.some((function(t){return 0!==t}))){var s=n>0?1:-1,c=i>0?1:-1,u=s+c===0,l=r.map((function(t){return E(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),h=l[0],f=l[1],d=l[2],p=l[3];t.moveTo(s*h,0),t.lineTo(o-s*f,0),0!==f&&t.arc(o-s*f,c*f,f,-c*Math.PI/2,s>0?0:Math.PI,u),t.lineTo(o,a-c*d),0!==d&&t.arc(o-s*d,a-c*d,d,s>0?0:Math.PI,c>0?Math.PI/2:1.5*Math.PI,u),t.lineTo(s*p,a),0!==p&&t.arc(s*p,a-c*p,p,c>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,u),t.lineTo(0,c*h),0!==h&&t.arc(s*h,c*h,h,s>0?Math.PI:0,c>0?1.5*Math.PI:Math.PI/2,u)}else t.rect(0,0,o,a)}var C=function(t){var r,n;function i(){for(var e,r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-path-generator",e}(r=i).prototype=Object.create((n=t).prototype),r.prototype.constructor=r,w(r,n);var o=i.prototype;return o.init=function(){var t,r=((t={})[e.Shape.CIRCLE]=P,t[e.Shape.ELLIPSE]=S,t[e.Shape.RECT]=k,t[e.Shape.LINE]=O,t[e.Shape.POLYLINE]=T,t[e.Shape.POLYGON]=A,t[e.Shape.PATH]=L,t[e.Shape.TEXT]=void 0,t[e.Shape.GROUP]=void 0,t[e.Shape.IMAGE]=void 0,t[e.Shape.HTML]=void 0,t[e.Shape.MESH]=void 0,t);this.context.pathGeneratorFactory=r},o.destroy=function(){delete this.context.pathGeneratorFactory},i}(e.AbstractRendererPlugin),R=Object.freeze({__proto__:null,Plugin:C});function I(){I=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,i){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),a=new S(i||[]);return n(o,"_invoke",{value:E(t,r,a)}),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function f(){}function d(){}function p(){}var v={};c(v,o,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(O([])));g&&g!==e&&r.call(g,o)&&(v=g);var m=p.prototype=f.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function i(n,o,a,s){var c=l(t[n],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function E(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return L()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=M(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function M(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,M(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:L}}function L(){return{value:void 0,done:!0}}return d.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=c(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(x.prototype),c(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new x(u(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(m),c(m,s,"Generator"),c(m,o,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(this.prev>=o.tryLoc){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(o.catchLoc>this.prev)return n(o.catchLoc,!0);if(o.finallyLoc>this.prev)return n(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return n(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(this.prev>=i.tryLoc&&r.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function N(t,e,r,n,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function _(t,e){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_(t,e)}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);e>r;r++)n[r]=t[r];return n}function D(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return t.length>n?{done:!1,value:t[n++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var B=h(),F=h(),G=h(),$=s(),H=function(){function t(){var t=this;this.canvasConfig=void 0,this.pathGeneratorFactory=void 0,this.pointInPathPickerFactory=void 0,this.isHit=function(r,n,i,o,a){var s,c,u,l,h,p,v,y,g,m,b,x,E,M,w,P,S,O,L,A,T,k,C,R,I,N,_,j,D,B,H,W=t.pointInPathPickerFactory[r.nodeName];if(W){var Y=(s=$,(H=(L=(u=(c=i)[0])*(y=c[5])-(l=c[1])*(v=c[4]))*(B=(E=c[10])*(O=c[15])-(M=c[11])*(S=c[14]))-(A=u*(g=c[6])-(h=c[2])*v)*(D=(x=c[9])*O-M*(P=c[13]))+(T=u*(m=c[7])-(p=c[3])*v)*(j=x*S-E*P)+(k=l*g-h*y)*(_=(b=c[8])*O-M*(w=c[12]))-(C=l*m-p*y)*(N=b*S-E*w)+(R=h*m-p*g)*(I=b*P-x*w))?(s[0]=(y*B-g*D+m*j)*(H=1/H),s[1]=(h*D-l*B-p*j)*H,s[2]=(P*R-S*C+O*k)*H,s[3]=(E*C-x*R-M*k)*H,s[4]=(g*_-v*B-m*N)*H,s[5]=(u*B-h*_+p*N)*H,s[6]=(S*T-w*R-O*A)*H,s[7]=(b*R-E*T+M*A)*H,s[8]=(v*D-y*_+m*I)*H,s[9]=(l*_-u*D-p*I)*H,s[10]=(w*C-P*T+O*L)*H,s[11]=(x*T-b*C-M*L)*H,s[12]=(y*N-v*j-g*I)*H,s[13]=(u*j-l*N+h*I)*H,s[14]=(P*A-w*k-S*L)*H,s[15]=(b*k-x*A+E*L)*H,s):null),U=d(F,f(G,n[0],n[1],0),Y),X=r.getGeometryBounds().halfExtents,z=r.parsedStyle.anchor;if(U[0]+=(z&&z[0]||0)*X[0]*2,U[1]+=(z&&z[1]||0)*X[1]*2,W(r,new e.Point(U[0],U[1]),o,t.isPointInPath,a))return!0}return!1},this.isPointInPath=function(e,r,n){var i=e.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas),o=t.pathGeneratorFactory[r.nodeName];return o&&(i.beginPath(),o(i,r.parsedStyle),i.closePath()),i.isPointInPath(n.x,n.y)}}var r=t.prototype;return r.apply=function(e,r){var n,i=this,o=e.renderingService,a=e.renderingContext,s=e.pathGeneratorFactory,c=e.pointInPathPickerFactory;this.canvasConfig=e.config,this.pathGeneratorFactory=s,this.pointInPathPickerFactory=c;var u=null===(n=a.root)||void 0===n?void 0:n.ownerDocument;o.hooks.pick.tapPromise(t.tag,function(){var t,e=(t=I().mark((function t(e){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",i.pick(u,e,r));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){N(o,n,i,a,s,"next",t)}function s(t){N(o,n,i,a,s,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}()),o.hooks.pickSync.tap(t.tag,(function(t){return i.pick(u,t,r)}))},r.pick=function(t,r,n){for(var i,o=r.topmost,a=r.position,s=f(B,a.x,a.y,0),c=[],u=D(t.elementsFromBBox(s[0],s[1],s[0],s[1]));!(i=u()).done;){var l=i.value,h=l.getWorldTransform();if(this.isHit(l,s,h,!1,n)){var d=e.findClosestClipPathTarget(l);if(d){var p=d.parsedStyle.clipPath;if(this.isHit(p,s,p.getWorldTransform(),!0,n)){if(o)return r.picked=[l],r;c.push(l)}}else{if(o)return r.picked=[l],r;c.push(l)}}}return r.picked=c,r},t}();function W(t,e,r,n){var i=t-r,o=e-n;return Math.sqrt(i*i+o*o)}function Y(t,e){return.001>Math.abs(t-e)}function U(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}function X(t){return(t+2*Math.PI)%(2*Math.PI)}H.tag="CanvasPicker";var z={box:function(t,e,r,n){return U([t,r],[e,n])},length:function(t,e,r,n){return W(t,e,r,n)},pointAt:function(t,e,r,n,i){return{x:(1-i)*t+i*r,y:(1-i)*e+i*n}},pointDistance:function(t,e,r,n,i,o){var a=(r-t)*(i-t)+(n-e)*(o-e);return 0>a?W(t,e,i,o):a>(r-t)*(r-t)+(n-e)*(n-e)?W(r,n,i,o):this.pointToLine(t,e,r,n,i,o)},pointToLine:function(t,e,r,n,i,o){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],i=r*r+n*n;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))},tangentAngle:function(t,e,r,n){return Math.atan2(n-e,r-t)}};function q(t,e,r,n,i,o){var a=-1,s=1/0,c=[r,n],u=20;o&&o>200&&(u=o/10);for(var l=1/u,h=l/10,f=0;u>=f;f++){var d=f*l,p=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],v=W(c[0],c[1],p[0],p[1]);s>v&&(a=d,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}s=1/0;for(var g=0;32>g&&1e-4<=h;g++){var m=a-h,b=a+h,x=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],E=W(c[0],c[1],x[0],x[1]);if(m>=0&&s>E)a=m,s=E;else{var M=[i.apply(void 0,t.concat([b])),i.apply(void 0,e.concat([b]))],w=W(c[0],c[1],M[0],M[1]);1>=b&&s>w?(a=b,s=w):h*=.5}}return{x:i.apply(void 0,t.concat([a])),y:i.apply(void 0,e.concat([a]))}}function Q(t,e,r,n){var i=1-n;return i*i*t+2*n*i*e+n*n*r}function V(t,e,r){var n=t+r-2*e;if(Y(n,0))return[.5];var i=(t-e)/n;return i>1||0>i?[]:[i]}function Z(t,e,r,n){return 2*(1-n)*(e-t)+2*n*(r-e)}function J(t,e,r,n,i,o,a){var s=Q(t,r,i,a),c=Q(e,n,o,a),u=z.pointAt(t,e,r,n,a),l=z.pointAt(r,n,i,o,a);return[[t,e,u.x,u.y,s,c],[s,c,l.x,l.y,i,o]]}function K(t,e,r,n,i,o,a){if(0===a)return(W(t,e,r,n)+W(r,n,i,o)+W(t,e,i,o))/2;var s=J(t,e,r,n,i,o,.5),c=s[0],u=s[1];return c.push(a-1),u.push(a-1),K.apply(void 0,c)+K.apply(void 0,u)}var tt={box:function(t,e,r,n,i,o){var a=V(t,r,i)[0],s=V(e,n,o)[0],c=[t,i],u=[e,o];return void 0!==a&&c.push(Q(t,r,i,a)),void 0!==s&&u.push(Q(e,n,o,s)),U(c,u)},length:function(t,e,r,n,i,o){return K(t,e,r,n,i,o,3)},nearestPoint:function(t,e,r,n,i,o,a,s){return q([t,r,i],[e,n,o],a,s,Q)},pointDistance:function(t,e,r,n,i,o,a,s){var c=this.nearestPoint(t,e,r,n,i,o,a,s);return W(c.x,c.y,a,s)},interpolationAt:Q,pointAt:function(t,e,r,n,i,o,a){return{x:Q(t,r,i,a),y:Q(e,n,o,a)}},divide:function(t,e,r,n,i,o,a){return J(t,e,r,n,i,o,a)},tangentAngle:function(t,e,r,n,i,o,a){var s=Z(t,r,i,a),c=Z(e,n,o,a);return X(Math.atan2(c,s))}};function et(t,e,r,n,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*r*i*i*o+n*i*i*i}function rt(t,e,r,n,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(r-e)+i*i*(n-r))}function nt(t,e,r,n){var i,o,a,s=-3*t+9*e-9*r+3*n,c=6*t-12*e+6*r,u=3*e-3*t,l=[];if(Y(s,0))Y(c,0)||0>(i=-u/c)||i>1||l.push(i);else{var h=c*c-4*s*u;Y(h,0)?l.push(-c/(2*s)):h>0&&(o=(-c-(a=Math.sqrt(h)))/(2*s),0>(i=(-c+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function it(t,e,r,n,i,o,a,s,c){var u=et(t,r,i,a,c),l=et(e,n,o,s,c),h=z.pointAt(t,e,r,n,c),f=z.pointAt(r,n,i,o,c),d=z.pointAt(i,o,a,s,c),p=z.pointAt(h.x,h.y,f.x,f.y,c),v=z.pointAt(f.x,f.y,d.x,d.y,c);return[[t,e,h.x,h.y,p.x,p.y,u,l],[u,l,v.x,v.y,d.x,d.y,a,s]]}function ot(t,e,r,n,i,o,a,s,c){if(0===c)return function(t,e){for(var r=0,n=t.length,i=0;n>i;i++)r+=W(t[i],e[i],t[(i+1)%n],e[(i+1)%n]);return r/2}([t,r,i,a],[e,n,o,s]);var u=it(t,e,r,n,i,o,a,s,.5),l=[].concat(u[0],[c-1]),h=[].concat(u[1],[c-1]);return ot.apply(void 0,l)+ot.apply(void 0,h)}var at={extrema:nt,box:function(t,e,r,n,i,o,a,s){for(var c=[t,a],u=[e,s],l=nt(t,r,i,a),h=nt(e,n,o,s),f=0;l.length>f;f++)c.push(et(t,r,i,a,l[f]));for(var d=0;h.length>d;d++)u.push(et(e,n,o,s,h[d]));return U(c,u)},length:function(t,e,r,n,i,o,a,s){return ot(t,e,r,n,i,o,a,s,3)},nearestPoint:function(t,e,r,n,i,o,a,s,c,u,l){return q([t,r,i,a],[e,n,o,s],c,u,et,l)},pointDistance:function(t,e,r,n,i,o,a,s,c,u,l){var h=this.nearestPoint(t,e,r,n,i,o,a,s,c,u,l);return W(h.x,h.y,c,u)},interpolationAt:et,pointAt:function(t,e,r,n,i,o,a,s,c){return{x:et(t,r,i,a,c),y:et(e,n,o,s,c)}},divide:function(t,e,r,n,i,o,a,s,c){return it(t,e,r,n,i,o,a,s,c)},tangentAngle:function(t,e,r,n,i,o,a,s,c){var u=rt(t,r,i,a,c),l=rt(e,n,o,s,c);return X(Math.atan2(l,u))}};function st(t,e,r,n){var i=t-r,o=e-n;return Math.sqrt(i*i+o*o)}function ct(t,e,r,n,i,o){return!(t>i||i>t+r||e>o||o>e+n)}function ut(t,e,r,n,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),u={x:t+r*Math.cos(c),y:e+r*Math.sin(c)};return st(u.x,u.y,a,s)<=o/2}function lt(t,e,r,n,i,o,a){var s=i/2;return!(Math.min(t,r)-s>o||o>Math.max(t,r)+s||Math.min(e,n)-s>a||a>Math.max(e,n)+s)&&z.pointToLine(t,e,r,n,o,a)<=i/2}function ht(t,e,r,n,i){var o=t.length;if(2>o)return!1;for(var a=0;o-1>a;a++){if(lt(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(i){var s=t[0],c=t[o-1];if(lt(s[0],s[1],c[0],c[1],e,r,n))return!0}return!1}var ft=1e-6;function dt(t){return ft>Math.abs(t)?0:0>t?-1:1}function pt(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function vt(t,e,r){var n=!1,i=t.length;if(2>=i)return!1;for(var o=0;i>o;o++){var a=t[o],s=t[(o+1)%i];if(pt(a,s,[e,r]))return!0;dt(a[1]-r)>0!=dt(s[1]-r)>0&&0>dt(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])&&(n=!n)}return n}function yt(t,e,r){for(var n=!1,i=0;t.length>i;i++){if(n=vt(t[i],e,r))break}return n}function gt(t,r,n){var i=t.parsedStyle,o=i.r,a=i.fill,s=i.stroke,c=i.pointerEvents,u=((i.lineWidth||0)+(i.increasedLineWidthForHitTesting||0))/2,l=st(o,o,r.x,r.y),h=e.isFillOrStrokeAffected(c,a,s),f=h[0],d=h[1];return f&&d||n?o+u>=l:f?o>=l:!!d&&(l>=o-u&&o+u>=l)}function mt(t,e,r,n){return t/(r*r)+e/(n*n)}function bt(t,r,n){var i=t.parsedStyle,o=i.rx,a=i.ry,s=i.lineWidth,c=i.increasedLineWidthForHitTesting,u=r.x,l=r.y,h=e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke),f=h[0],d=h[1],p=((s||0)+(c||0))/2,v=(u-o)*(u-o),y=(l-a)*(l-a);return f&&d||n?1>=mt(v,y,o+p,a+p):f?1>=mt(v,y,o,a):!!d&&(mt(v,y,o-p,a-p)>=1&&1>=mt(v,y,o+p,a+p))}function xt(t,r,n){var i=t.parsedStyle,o=i.x1,a=i.y1,s=i.x2,c=i.y2,u=i.lineWidth,l=i.increasedLineWidthForHitTesting,h=i.defX,f=void 0===h?0:h,d=i.defY,p=void 0===d?0:d;return!(!e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke)[1]&&!n||!u)&&lt(o,a,s,c,(u||0)+(l||0),r.x+f,r.y+p)}function Et(t,r,n,i,o){var a=t.parsedStyle,s=a.lineWidth,c=a.increasedLineWidthForHitTesting,u=a.defX,l=void 0===u?0:u,h=a.defY,f=void 0===h?0:h,d=a.path,p=d.segments,v=d.hasArc,g=d.polylines,m=d.polygons,b=e.isFillOrStrokeAffected(a.pointerEvents,(null==m?void 0:m.length)&&a.fill,a.stroke),x=b[0],E=b[1],M=e.getOrCalculatePathTotalLength(t),w=!1;return x||n?w=v?i(o,t,r):yt(m,r.x+l,r.y+f)||yt(g,r.x+l,r.y+f):((E||n)&&(w=function(t,e,r,n,i){for(var o=!1,a=e/2,s=0;t.length>s;s++){var c=t[s],u=c.currentPoint,l=c.params,h=c.prePoint,f=c.box;if(!f||ct(f.x-a,f.y-a,f.width+e,f.height+e,r,n))switch(c.command){case"L":case"Z":if(o=lt(h[0],h[1],u[0],u[1],e,r,n))return!0;break;case"Q":if(o=e/2>=tt.pointDistance(h[0],h[1],l[1],l[2],l[3],l[4],r,n))return!0;break;case"C":if(o=e/2>=at.pointDistance(h[0],h[1],l[1],l[2],l[3],l[4],l[5],l[6],r,n,i))return!0;break;case"A":c.cubicParams||(c.cubicParams=y(h[0],h[1],l[1],l[2],l[3],l[4],l[5],l[6],l[7],void 0));for(var d=c.cubicParams,p=h,v=0;d.length>v;v+=6){var g=at.pointDistance(p[0],p[1],d[v],d[v+1],d[v+2],d[v+3],d[v+4],d[v+5],r,n,i);if(p=[d[v+4],d[v+5]],o=e/2>=g)return!0}}}return o}(p,(s||0)+(c||0),r.x+l,r.y+f,M)),w)}function Mt(t,r,n){var i=t.parsedStyle,o=i.lineWidth,a=i.increasedLineWidthForHitTesting,s=i.points,c=i.defX,u=void 0===c?0:c,l=i.defY,h=void 0===l?0:l,f=e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke),d=f[0],p=!1;return(f[1]||n)&&(p=ht(s.points,(o||0)+(a||0),r.x+u,r.y+h,!0)),p||!d&&!n||(p=vt(s.points,r.x+u,r.y+h)),p}function wt(t,r,n){var i=t.parsedStyle,o=i.lineWidth,a=i.increasedLineWidthForHitTesting,s=i.points,c=i.defX,u=void 0===c?0:c,l=i.defY,h=void 0===l?0:l;return!(!e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke)[1]&&!n||!o)&&ht(s.points,(o||0)+(a||0),r.x+u,r.y+h,!1)}function Pt(t,r,n,i,o){var a=t.parsedStyle,s=a.radius,c=a.lineWidth,u=a.increasedLineWidthForHitTesting,l=a.width,h=a.height,f=e.isFillOrStrokeAffected(a.pointerEvents,a.fill,a.stroke),d=f[0],p=f[1],v=(c||0)+(u||0);if(s&&s.some((function(t){return 0!==t}))){var y=!1;return(p||n)&&(y=function(t,e,r,n,i,o,a,s){var c=i[0],u=i[1],l=i[2],h=i[3];return lt(t+c,e,t+r-u,e,o,a,s)||lt(t+r,e+u,t+r,e+n-l,o,a,s)||lt(t+r-l,e+n,t+h,e+n,o,a,s)||lt(t,e+n-h,t,e+c,o,a,s)||ut(t+r-u,e+u,u,0,0,o,a,s)||ut(t+r-l,e+n-l,l,0,0,o,a,s)||ut(t+h,e+n-h,h,0,0,o,a,s)||ut(t+c,e+c,c,0,0,o,a,s)}(0,0,l,h,s.map((function(t){return E(t,0,Math.min(Math.abs(l)/2,Math.abs(h)/2))})),v,r.x,r.y)),y||!d&&!n||(y=i(o,t,r)),y}var g=v/2;return d&&p||n?ct(0-g,0-g,l+g,h+g,r.x,r.y):d?ct(0,0,l,h,r.x,r.y):!!p&&function(t,e,r,n,i,o,a){var s=i/2;return ct(t-s,e-s,r,i,o,a)||ct(t+r-s,e-s,i,n,o,a)||ct(t+s,e+n-s,r,i,o,a)||ct(t-s,e+s,i,n,o,a)}(0,0,l,h,v,r.x,r.y)}var St=function(t){var r,n;function i(){for(var e,r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-picker",e}(r=i).prototype=Object.create((n=t).prototype),r.prototype.constructor=r,_(r,n);var o=i.prototype;return o.init=function(){var t,r=function(){return!0},n=((t={})[e.Shape.CIRCLE]=gt,t[e.Shape.ELLIPSE]=bt,t[e.Shape.RECT]=Pt,t[e.Shape.LINE]=xt,t[e.Shape.POLYLINE]=wt,t[e.Shape.POLYGON]=Mt,t[e.Shape.PATH]=Et,t[e.Shape.TEXT]=r,t[e.Shape.GROUP]=null,t[e.Shape.IMAGE]=r,t[e.Shape.HTML]=null,t[e.Shape.MESH]=null,t);this.context.pointInPathPickerFactory=n,this.addRenderingPlugin(new H)},o.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},i}(e.AbstractRendererPlugin),Ot=Object.freeze({__proto__:null,Plugin:St});function Lt(){return Lt=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Lt.apply(this,arguments)}function At(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Tt(t,e)}function Tt(t,e){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tt(t,e)}var kt=function(){function t(t){this.canvasRendererPluginOptions=void 0,this.context=void 0,this.pathGeneratorFactory=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=s(),this.dprMatrix=s(),this.tmpMat4=s(),this.vec3a=h(),this.vec3b=h(),this.vec3c=h(),this.vec3d=h(),this.canvasRendererPluginOptions=t}var r=t.prototype;return r.apply=function(r,n){var i=this;this.context=r;var o=r.config,a=r.camera,s=r.renderingService,c=r.renderingContext,l=r.pathGeneratorFactory;this.rBush=r.rBushRoot,this.pathGeneratorFactory=l;var h=r.contextService,f=c.root.ownerDocument.defaultView,p=function(t){var e=t.target.rBushNode;e.aabb&&i.removedRBushNodeAABBs.push(e.aabb)},v=function(t){var e=t.target.rBushNode;e.aabb&&i.removedRBushNodeAABBs.push(e.aabb)};s.hooks.init.tap(t.tag,(function(){f.addEventListener(e.ElementEvent.UNMOUNTED,p),f.addEventListener(e.ElementEvent.CULLED,v);var t=h.getDPR(),r=o.width,n=o.height,a=h.getContext();i.clearRect(a,0,0,r*t,n*t,o.background)})),s.hooks.destroy.tap(t.tag,(function(){f.removeEventListener(e.ElementEvent.UNMOUNTED,p),f.removeEventListener(e.ElementEvent.CULLED,v)})),s.hooks.beginFrame.tap(t.tag,(function(){var t=h.getContext(),e=h.getDPR(),r=o.width,n=o.height,a=i.canvasRendererPluginOptions,c=a.dirtyObjectNumThreshold,u=a.dirtyObjectRatioThreshold,l=s.getStats(),f=l.rendered,d=f/l.total;i.clearFullScreen=s.disableDirtyRectangleRendering()||f>c&&d>u,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(t,0,0,r*e,n*e,o.background))}));var y=function t(e,r){e.isVisible()&&!e.isCulled()&&(i.renderDisplayObject(e,r,i.context,i.restoreStack,n),i.saveDirtyAABB(e)),(e.sortable.sorted||e.childNodes).forEach((function(e){t(e,r)}))};s.hooks.endFrame.tap(t.tag,(function(){var t,r,s=h.getContext(),l=h.getDPR();if((t=i.dprMatrix)[0]=(r=[l,l,1])[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=r[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,u(i.vpMatrix,i.dprMatrix,a.getOrthoMatrix()),i.clearFullScreen)y(c.root,s);else{var p=i.safeMergeAABB.apply(i,[i.mergeDirtyAABBs(i.renderQueue)].concat(i.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,i=t.maxX,o=t.maxY,a=new e.AABB;return a.setMinMax([r,n,0],[i,o,0]),a}))));if(i.removedRBushNodeAABBs=[],e.AABB.isEmpty(p))return void(i.renderQueue=[]);var v=i.convertAABB2Rect(p),g=v.x,m=v.y,b=v.width,x=v.height,E=d(i.vec3a,[g,m,0],i.vpMatrix),M=d(i.vec3b,[g+b,m,0],i.vpMatrix),w=d(i.vec3c,[g,m+x,0],i.vpMatrix),P=d(i.vec3d,[g+b,m+x,0],i.vpMatrix),S=Math.min(E[0],M[0],P[0],w[0]),O=Math.min(E[1],M[1],P[1],w[1]),L=Math.max(E[0],M[0],P[0],w[0]),A=Math.max(E[1],M[1],P[1],w[1]),T=Math.floor(S),k=Math.floor(O),C=Math.ceil(L-S),R=Math.ceil(A-O);s.save(),i.clearRect(s,T,k,C,R,o.background),s.beginPath(),s.rect(T,k,C,R),s.clip(),s.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]),o.renderer.getConfig().enableDirtyRectangleRenderingDebug&&f.dispatchEvent(new e.CustomEvent(e.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:{x:T,y:k,width:C,height:R}})),i.searchDirtyObjects(p).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(t){t&&t.isVisible()&&!t.isCulled()&&i.renderDisplayObject(t,s,i.context,i.restoreStack,n)})),s.restore(),i.renderQueue.forEach((function(t){i.saveDirtyAABB(t)})),i.renderQueue=[]}i.restoreStack.forEach((function(){s.restore()})),i.restoreStack=[]})),s.hooks.render.tap(t.tag,(function(t){i.clearFullScreen||i.renderQueue.push(t)}))},r.clearRect=function(t,e,r,n,i,o){t.clearRect(e,r,n,i),o&&(t.fillStyle=o,t.fillRect(e,r,n,i))},r.renderDisplayObject=function(t,r,n,i,o){var a=t.nodeName,s=i[i.length-1];!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(r.restore(),i.pop());var c=this.context.styleRendererFactory[a],u=this.pathGeneratorFactory[a],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(r,l);var h=this.pathGeneratorFactory[l.nodeName];h&&(r.save(),i.push(t),r.beginPath(),h(r,l.parsedStyle),r.closePath(),r.clip())}c&&(this.applyWorldTransform(r,t),r.save(),this.applyAttributesToContext(r,t)),u&&(r.beginPath(),u(r,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&r.closePath()),c&&(c.render(r,t.parsedStyle,t,n,this,o),r.restore()),t.renderable.dirty=!1},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),i=Math.floor(e[1]);return{x:n,y:i,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-i}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=t.getMin(),r=e[0],n=e[1],i=t.getMax();return this.rBush.search({minX:r,minY:n,maxX:i[0],maxY:i[1]}).map((function(t){return t.displayObject}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyAttributesToContext=function(t,e){var r=e.parsedStyle,n=r.stroke,i=r.fill,o=r.opacity,a=r.lineDash,s=r.lineDashOffset;a&&t.setLineDash(a),g(s)||(t.lineDashOffset=s),g(o)||(t.globalAlpha*=o),g(n)||Array.isArray(n)||n.isNone||(t.strokeStyle=e.attributes.stroke),g(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},r.applyWorldTransform=function(t,e,r){var n=0,i=0,o=(e.parsedStyle||{}).anchor,a=o&&o[0]||0,s=o&&o[1]||0;if(0!==a||0!==s){var h=e.geometry.contentBounds;n=-a*(h&&2*h.halfExtents[0]||0),i=-s*(h&&2*h.halfExtents[1]||0)}r?(c(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=n,this.vec3a[1]=i,this.vec3a[2]=0,l(this.tmpMat4,this.tmpMat4,this.vec3a),u(this.tmpMat4,r,this.tmpMat4),u(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(c(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=n,this.vec3a[1]=i,this.vec3a[2]=0,l(this.tmpMat4,this.tmpMat4,this.vec3a),u(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];return n.forEach((function(e){t.add(e)})),t},t}();kt.tag="CanvasRenderer";var Ct=function(){function t(t){this.imagePool=void 0,this.imagePool=t}var r=t.prototype;return r.render=function(t,r,n,i,o,a){var s=r.fill,c=r.fillRule,u=r.opacity,l=r.fillOpacity,h=r.stroke,f=r.strokeOpacity,d=r.lineWidth,p=r.lineCap,v=r.lineJoin,y=r.shadowType,m=r.shadowColor,b=r.shadowBlur,x=r.filter,E=r.miterLimit,M=!g(s)&&!s.isNone,w=!g(h)&&!h.isNone&&d>0,P=0===s.alpha,S=!(!x||!x.length),O=!g(m)&&b>0,L=n.nodeName,A="inner"===y,T=w&&O&&(L===e.Shape.PATH||L===e.Shape.LINE||L===e.Shape.POLYLINE||P||A);M&&(t.globalAlpha=u*l,T||Rt(n,t,O),this.fill(t,n,s,c,i,o,a),T||this.clearShadowAndFilter(t,S,O)),w&&(t.globalAlpha=u*f,t.lineWidth=d,g(E)||(t.miterLimit=E),g(p)||(t.lineCap=p),g(v)||(t.lineJoin=v),T&&(A&&(t.globalCompositeOperation="source-atop"),Rt(n,t,!0),A&&(this.stroke(t,n,h,i,o,a),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,S,!0))),this.stroke(t,n,h,i,o,a))},r.clearShadowAndFilter=function(t,e,r){if(r&&(t.shadowColor="transparent",t.shadowBlur=0),e){var n=t.filter;!g(n)&&n.indexOf("drop-shadow")>-1&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},r.fill=function(t,r,n,i,o,a,s){var c=this;Array.isArray(n)?n.forEach((function(e){t.fillStyle=c.getColor(e,r,t),i?t.fill(i):t.fill()})):(e.isPattern(n)&&(t.fillStyle=this.getPattern(n,r,t,o,a,s)),i?t.fill(i):t.fill())},r.stroke=function(t,r,n,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(e){t.strokeStyle=s.getColor(e,r,t),t.stroke()})):(e.isPattern(n)&&(t.strokeStyle=this.getPattern(n,r,t,i,o,a)),t.stroke())},r.getPattern=function(t,e,r,n,i,o){var a,s;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,u=c.width,l=c.height;s=n.contextService.getDPR();var h=n.config.offscreenCanvas;(a=o.offscreenCanvas.getOrCreateCanvas(h)).width=u*s,a.height=l*s;var f=o.offscreenCanvas.getOrCreateContext(h),d=[];t.image.forEach((function(t){i.renderDisplayObject(t,f,n,d,o)})),d.forEach((function(){f.restore()}))}return this.imagePool.getOrCreatePatternSync(t,r,a,s,(function(){e.renderable.dirty=!0,n.renderingService.dirtify()}))},r.getColor=function(t,r,n){var i;if(t.type===e.GradientType.LinearGradient||t.type===e.GradientType.RadialGradient){var o=r.getGeometryBounds();i=this.imagePool.getOrCreateGradient(Lt({type:t.type},t.value,{width:o&&2*o.halfExtents[0]||1,height:o&&2*o.halfExtents[1]||1}),n)}return i},t}();function Rt(t,e,r){var n=t.parsedStyle,i=n.filter,o=n.shadowColor,a=n.shadowBlur,s=n.shadowOffsetX,c=n.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),r&&(e.shadowColor=""+o,e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}var It=function(){function t(t){this.imagePool=void 0,this.imagePool=t}return t.prototype.render=function(t,e,r){var n,i=e.img,o=e.shadowColor,a=e.shadowBlur,s=e.width,c=e.height;if(x(i)?n=this.imagePool.getImageSync(i):(s||(s=i.width),c||(c=i.height),n=i),n){Rt(r,t,!g(o)&&a>0);try{t.drawImage(n,0,0,s,c)}catch(t){}}},t}(),Nt=function(){function t(){}var r=t.prototype;return r.render=function(t,r,n){var i=r.lineWidth,o=r.textAlign,a=r.textBaseline,s=r.lineJoin,c=r.miterLimit,u=r.letterSpacing,l=r.stroke,h=r.fill,f=r.fillOpacity,d=r.strokeOpacity,p=r.opacity,v=r.metrics,y=r.dx,m=r.dy,b=r.shadowColor,x=r.shadowBlur,E=v.lines,M=v.height,w=v.lineHeight,P=v.lineMetrics;t.font=v.font,t.lineWidth=i,t.textAlign="middle"===o?"center":o;var S=a;e.runtime.enableCSSParsing||"alphabetic"!==S||(S="bottom"),t.lineJoin=s,g(c)||(t.miterLimit=c);var O=0;"middle"===a?O=-M/2-w/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?O=-M:"top"!==a&&"hanging"!==a||(O=-w);var L=y||0;O+=m||0,1===E.length&&("bottom"===S?(S="middle",O-=.5*M):"top"===S&&(S="middle",O+=.5*M)),t.textBaseline=S,Rt(n,t,!g(b)&&x>0);for(var A=0;E.length>A;A++){var T=i/2+L;O+=w,g(l)||l.isNone||!i||this.drawLetterSpacing(t,E[A],P[A],o,T,O,u,f,d,p,!0),g(h)||this.drawLetterSpacing(t,E[A],P[A],o,T,O,u,f,d,p)}},r.drawLetterSpacing=function(t,e,r,n,i,o,a,s,c,u,l){if(void 0===l&&(l=!1),0!==a){var h=t.textAlign;t.textAlign="left";var f=i;"center"===n||"middle"===n?f=i-r.width/2:"right"!==n&&"end"!==n||(f=i-r.width);for(var d=Array.from(e),p=t.measureText(e).width,v=0,y=0;d.length>y;++y){var g=d[y];l?this.strokeText(t,g,f,o,c):this.fillText(t,g,f,o,s,u),f+=p-(v=t.measureText(e.substring(y+1)).width)+a,p=v}t.textAlign=h}else l?this.strokeText(t,e,i,o,c):this.fillText(t,e,i,o,s,u)},r.fillText=function(t,e,r,n,i,o){var a,s=!g(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,r,n),s&&(t.globalAlpha=a)},r.strokeText=function(t,e,r,n,i){var o,a=!g(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,r,n),a&&(t.globalAlpha=o)},t}(),_t=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(Ct),jt=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(Ct),Dt=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(Ct),Bt=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(Ct),Ft=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(Ct),Gt=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(Ct),$t=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(Ct),Ht=function(t){function r(e){var r;return void 0===e&&(e={}),(r=t.call(this)||this).options=void 0,r.name="canvas-renderer",r.options=e,r}At(r,t);var n=r.prototype;return n.init=function(){var t,r=Lt({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,i=new Ct(n),o=((t={})[e.Shape.CIRCLE]=i,t[e.Shape.ELLIPSE]=i,t[e.Shape.RECT]=i,t[e.Shape.IMAGE]=new It(n),t[e.Shape.TEXT]=new Nt,t[e.Shape.LINE]=i,t[e.Shape.POLYLINE]=i,t[e.Shape.POLYGON]=i,t[e.Shape.PATH]=i,t[e.Shape.GROUP]=void 0,t[e.Shape.HTML]=void 0,t[e.Shape.MESH]=void 0,t);this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new kt(r))},n.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},r}(e.AbstractRendererPlugin),Wt=Object.freeze({__proto__:null,CircleRenderer:jt,EllipseRenderer:Dt,ImageRenderer:It,LineRenderer:Bt,PathRenderer:$t,Plugin:Ht,PolygonRenderer:Gt,PolylineRenderer:Ft,RectRenderer:_t,TextRenderer:Nt});function Yt(t,e){return Yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yt(t,e)}var Ut=function(){function t(){this.context=void 0}return t.prototype.apply=function(e,r){var n=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},u=function(t){i.hooks.pointerUp.call(t)},l=function(t){i.hooks.pointerDown.call(t)},h=function(t){i.hooks.pointerOver.call(t)},f=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},v=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=n.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){r.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",l,!0),t.addEventListener("pointerleave",f,!0),t.addEventListener("pointerover",h,!0),r.globalThis.addEventListener("pointerup",u,!0),r.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){r.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",l,!0),t.addEventListener("mouseout",f,!0),t.addEventListener("mouseover",h,!0),r.globalThis.addEventListener("mouseup",u,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",l,!0),t.addEventListener("touchend",u,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",v,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=n.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){r.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",l,!0),t.removeEventListener("pointerleave",f,!0),t.removeEventListener("pointerover",h,!0),r.globalThis.removeEventListener("pointerup",u,!0)}(t):function(t){r.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",l,!0),t.removeEventListener("mouseout",f,!0),t.removeEventListener("mouseover",h,!0),r.globalThis.removeEventListener("mouseup",u,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",l,!0),t.removeEventListener("touchend",u,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",v,!0),t.removeEventListener("wheel",p,!0)}))},t}();Ut.tag="DOMInteraction";var Xt=function(t){var e,r;function n(){for(var e,r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).name="dom-interaction",e}(e=n).prototype=Object.create((r=t).prototype),e.prototype.constructor=e,Yt(e,r);var i=n.prototype;return i.init=function(){this.addRenderingPlugin(new Ut)},i.destroy=function(){this.removeAllRenderingPlugins()},n}(e.AbstractRendererPlugin),zt=Object.freeze({__proto__:null,Plugin:Xt});function qt(t,e){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qt(t,e)}var Qt=function(){function t(){this.context=void 0,this.$camera=void 0}var r=t.prototype;return r.joinTransformMatrix=function(t){return"matrix("+[t[0],t[1],t[4],t[5],t[12],t[13]].join(",")+")"},r.apply=function(r){var n=this,i=r.camera,o=r.renderingContext,a=r.renderingService;this.context=r;var s=o.root.ownerDocument.defaultView,c=function(t,e){e.style.transform=n.joinTransformMatrix(t.getWorldTransform())},u=function(t){var r=t.target;if(r.nodeName===e.Shape.HTML){n.$camera||(n.$camera=n.createCamera(i));var o=n.getOrCreateEl(r);n.$camera.appendChild(o);var a=r.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){o.style[t]=a[t]})),Object.keys(r.attributes).forEach((function(t){n.updateAttribute(t,r)})),c(r,o),e.runtime.nativeHTMLMap.set(o,r)}},l=function(t){var r=t.target;if(r.nodeName===e.Shape.HTML&&n.$camera){var i=n.getOrCreateEl(r);i&&(i.remove(),e.runtime.nativeHTMLMap.delete(i))}},h=function(t){var r=t.target;r.nodeName===e.Shape.HTML&&n.updateAttribute(t.attrName,r)},f=function(t){var r=t.target;if(r.nodeName===e.Shape.HTML){var i=n.getOrCreateEl(r);c(r,i)}},d=function(){if(n.$camera){var t=n.context.config,e=t.height;n.$camera.style.width=(t.width||0)+"px",n.$camera.style.height=(e||0)+"px"}};a.hooks.init.tap(t.tag,(function(){s.addEventListener(e.CanvasEvent.RESIZE,d),s.addEventListener(e.ElementEvent.MOUNTED,u),s.addEventListener(e.ElementEvent.UNMOUNTED,l),s.addEventListener(e.ElementEvent.ATTR_MODIFIED,h),s.addEventListener(e.ElementEvent.BOUNDS_CHANGED,f)})),a.hooks.endFrame.tap(t.tag,(function(){n.$camera&&o.renderReasons.has(e.RenderReason.CAMERA_CHANGED)&&(n.$camera.style.transform=n.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){n.$camera&&n.$camera.remove(),s.removeEventListener(e.CanvasEvent.RESIZE,d),s.removeEventListener(e.ElementEvent.MOUNTED,u),s.removeEventListener(e.ElementEvent.UNMOUNTED,l),s.removeEventListener(e.ElementEvent.ATTR_MODIFIED,h),s.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,f)}))},r.getId=function(t){return t.id||"g-html-"+t.entity},r.createCamera=function(t){var e=this.context.config,r=e.document,n=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#"+s);if(!c){var u=(r||document).createElement("div");c=u,u.id=s,u.style.position="absolute",u.style.left=(o.offsetLeft||0)+"px",u.style.top=(o.offsetTop||0)+"px",u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),u.style.overflow="hidden",u.style.pointerEvents="none",u.style.width=(n||0)+"px",u.style.height=(i||0)+"px",a.appendChild(u)}return c}return null},r.getOrCreateEl=function(t){var e=this.context.config.document,r=this.getId(t),n=this.$camera.querySelector("#"+r);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,n.id=r,t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform())),n},r.updateAttribute=function(t,r){var n=this.getOrCreateEl(r);switch(t){case"innerHTML":var i=r.parsedStyle.innerHTML;x(i)?n.innerHTML=i:(n.innerHTML="",n.appendChild(i));break;case"transformOrigin":var o=r.parsedStyle.transformOrigin;n.style["transform-origin"]=o[0].value+" "+o[1].value;break;case"width":if(e.runtime.enableCSSParsing){var a=r.computedStyleMap().get("width");n.style.width=""+a}else{var s=r.parsedStyle.width;n.style.width=M(s)?s+"px":""+s}break;case"height":if(e.runtime.enableCSSParsing){var c=r.computedStyleMap().get("height");n.style.height=""+c}else{var u=r.parsedStyle.height;n.style.height=M(u)?u+"px":""+u}break;case"zIndex":n.style["z-index"]=""+r.parsedStyle.zIndex;break;case"visibility":n.style.visibility=r.parsedStyle.visibility;break;case"pointerEvents":n.style.pointerEvents=r.parsedStyle.pointerEvents;break;case"opacity":n.style.opacity=""+r.parsedStyle.opacity;break;case"fill":var l=r.parsedStyle.fill,h="";e.isCSSRGB(l)?h=l.isNone?"transparent":r.getAttribute("fill"):Array.isArray(l)?h=r.getAttribute("fill"):e.isPattern(l),n.style.background=h;break;case"stroke":var f=r.parsedStyle.stroke,d="";e.isCSSRGB(f)?d=f.isNone?"transparent":r.getAttribute("stroke"):Array.isArray(f)?d=r.getAttribute("stroke"):e.isPattern(f),n.style["border-color"]=d,n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]=(r.parsedStyle.lineWidth||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=r.style.filter}},t}();Qt.tag="HTMLRendering";var Vt=function(t){var e,r;function n(){for(var e,r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).name="html-renderer",e}(e=n).prototype=Object.create((r=t).prototype),e.prototype.constructor=e,qt(e,r);var i=n.prototype;return i.init=function(){this.addRenderingPlugin(new Qt)},i.destroy=function(){this.removeAllRenderingPlugins()},n}(e.AbstractRendererPlugin),Zt=Object.freeze({__proto__:null,Plugin:Vt});function Jt(t,e){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jt(t,e)}var Kt="undefined"!=typeof Float32Array?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var te=function(){function t(t){this.canvasConfig=void 0,this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=t}var r=t.prototype;return r.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},r.getOrCreateImage=function(t){var r=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(i,o){var a;n?a=n(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){i(a)},a.onerror=function(t){o(t)},a.crossOrigin="Anonymous",a.src=t,r.imageCache[t]=a)}))},r.getOrCreatePatternSync=function(t,r,n,i,o){var a=this.generatePatternKey(t);if(a&&this.patternCache[a])return this.patternCache[a];var s,c=t.image,u=t.repetition,l=t.transform,h=!1;x(c)?s=this.getImageSync(c,o):n?(s=n,h=!0):s=c;var f,d,p=s&&r.createPattern(s,u);p&&(f=l?e.parsedTransformToMat4(e.parseTransform(l)):function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}((d=new Kt(16),Kt!=Float32Array&&(d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0),d[0]=1,d[5]=1,d[10]=1,d[15]=1,d)),h&&function(t,e,r){var n=r[0],i=r[1],o=r[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(f,f,[1/i,1/i,1]),p.setTransform({a:f[0],b:f[1],c:f[4],d:f[5],e:f[12],f:f[13]}));return a&&p&&(this.patternCache[a]=p),p},r.getOrCreateGradient=function(t,r){var n=this.generateGradientKey(t),i=t.type,o=t.steps,a=t.width,s=t.height,c=t.cx,u=t.cy,l=t.size;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(i===e.GradientType.LinearGradient){var f=e.computeLinearGradient(a,s,t.angle);h=r.createLinearGradient(f.x1,f.y1,f.x2,f.y2)}else if(i===e.GradientType.RadialGradient){var d=e.computeRadialGradient(a,s,c,u,l),p=d.x,v=d.y;h=r.createRadialGradient(p,v,0,p,v,d.r)}return h&&(o.forEach((function(t){var r,n=t.offset;n.unit===e.UnitType.kPercentage&&(null===(r=h)||void 0===r||r.addColorStop(n.value/100,""+t.color))})),this.gradientCache[n]=h),this.gradientCache[n]},r.generateGradientKey=function(t){var e=t.angle,r=t.cx,n=t.cy,i=t.size;return"gradient-"+t.type+"-"+((null==e?void 0:""+e)||0)+"-"+((null==r?void 0:""+r)||0)+"-"+((null==n?void 0:""+n)||0)+"-"+((null==i?void 0:""+i)||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return""+t.offset+t.color})).join("-")},r.generatePatternKey=function(t){var e=t.image,r=t.repetition;return x(e)?"pattern-"+e+"-"+r:"rect"===e.nodeName?"pattern-"+e.entity+"-"+r:void 0},t}(),ee=function(){function t(){}return t.prototype.apply=function(r){var n=r.renderingService,i=r.imagePool,o=r.renderingContext.root.ownerDocument.defaultView,a=function(t){var r=t.target;if(r.nodeName===e.Shape.IMAGE){var o=r.attributes.img;x(o)&&i.getImageSync(o,(function(){r.renderable.dirty=!0,n.dirtify()}))}},s=function(t){var r=t.target,o=t.newValue;r.nodeName===e.Shape.IMAGE&&"img"===t.attrName&&x(o)&&i.getOrCreateImage(o).then((function(){r.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(e.ElementEvent.MOUNTED,a),o.addEventListener(e.ElementEvent.ATTR_MODIFIED,s)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(e.ElementEvent.MOUNTED,a),o.removeEventListener(e.ElementEvent.ATTR_MODIFIED,s)}))},t}();ee.tag="LoadImage";var re=function(t){var e,r;function n(){for(var e,r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).name="image-loader",e}(e=n).prototype=Object.create((r=t).prototype),e.prototype.constructor=e,Jt(e,r);var i=n.prototype;return i.init=function(){this.context.imagePool=new te(this.context.config),this.addRenderingPlugin(new ee)},i.destroy=function(){this.removeAllRenderingPlugins()},n}(e.AbstractRendererPlugin),ne=Object.freeze({__proto__:null,ImagePool:te,Plugin:re}),ie=function(){function t(t){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0,this.renderingContext=void 0,this.renderingContext=t.renderingContext,this.canvasConfig=t.config}var i=t.prototype;return i.init=function(){var t=this.canvasConfig,e=t.container,r=t.canvas;if(r)this.$canvas=r,e&&r.parentElement!==e&&e.appendChild(r),this.$container=r.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=x(e)?document.getElementById(e):e,this.$container)){var n=document.createElement("canvas");this.$container.appendChild(n),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=n}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},i.getContext=function(){return this.context},i.getDomElement=function(){return this.$canvas},i.getDPR=function(){return this.dpr},i.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},i.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},i.resize=function(t,r){var n=this.canvasConfig.devicePixelRatio||e.isBrowser&&window.devicePixelRatio||1;this.dpr=n=1>n?1:Math.ceil(n),this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*r,e.setDOMSize(this.$canvas,t,r)),this.renderingContext.renderReasons.add(e.RenderReason.CAMERA_CHANGED)},i.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},i.toDataURL=function(){var t,e=(t=r().mark((function t(e){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e={}),t.abrupt("return",this.context.canvas.toDataURL((n=e).type,n.encoderOptions));case 3:case"end":return t.stop()}}),t,this)})),function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,c,"next",t)}function c(t){n(a,i,o,s,c,"throw",t)}s(void 0)}))});return function(t){return e.apply(this,arguments)}}(),t}(),oe=function(t){function e(){for(var e,r=arguments.length,n=Array(r),i=0;r>i;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).name="canvas-context-register",e}i(e,t);var r=e.prototype;return r.init=function(){this.context.ContextService=ie},r.destroy=function(){delete this.context.ContextService},e}(e.AbstractRendererPlugin),ae=function(t){function e(e){var r;return(r=t.call(this,e)||this).registerPlugin(new oe),r.registerPlugin(new re),r.registerPlugin(new C),r.registerPlugin(new Ht),r.registerPlugin(new Xt),r.registerPlugin(new St),r.registerPlugin(new Vt),r}return i(e,t),e}(e.AbstractRenderer);t.CanvasPathGenerator=R,t.CanvasPicker=Ot,t.CanvasRenderer=Wt,t.DomInteraction=zt,t.HTMLRenderer=Zt,t.ImageLoader=ne,t.Renderer=ae,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.Canvas2D={}),t.window.G)}(this,(function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i.apply(this,arguments)};function a(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}c((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&i[3]>s[1])){o.label=s[1];break}if(6===s[0]&&i[1]>o.label){o.label=i[1],i=s;break}if(i&&i[2]>o.label){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}var c={}.toString,l=function(t,e){return c.call(t)==="[object "+e+"]"},h=function(t,e,n){return e>t?e:t>n?n:t};function u(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function d(t,e){var n=e.rx,r=e.ry;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,a=n>r?1:n/r,o=n>r?r/n:1;t.save(),t.scale(a,o),t.arc(0,0,i,0,2*Math.PI)}}function f(t,n){var r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,c=void 0===s?0:s,l=n.defY,h=void 0===l?0:l,u=n.markerStart,d=n.markerEnd,f=n.markerStartOffset,p=n.markerEndOffset,v=0,y=0,g=0,m=0,E=0;u&&e.isDisplayObject(u)&&f&&(v=Math.cos(E=Math.atan2(o-i,a-r))*(f||0),y=Math.sin(E)*(f||0)),d&&e.isDisplayObject(d)&&p&&(g=Math.cos(E=Math.atan2(i-o,r-a))*(p||0),m=Math.sin(E)*(p||0)),t.moveTo(r-c+v,i-h+y),t.lineTo(a-c+g,o-h+m)}function p(t,n){var r=n.defX,i=void 0===r?0:r,a=n.defY,o=void 0===a?0:a,c=n.markerStart,l=n.markerEnd,h=n.markerStartOffset,u=n.markerEndOffset,d=n.path,f=d.absolutePath,p=d.segments,v=0,y=0,g=0,m=0,E=0;if(c&&e.isDisplayObject(c)&&h){var M=s(c.parentNode.getStartTangent(),2);v=Math.cos(E=Math.atan2((x=M[0])[1]-(b=M[1])[1],x[0]-b[0]))*(h||0),y=Math.sin(E)*(h||0)}if(l&&e.isDisplayObject(l)&&u){var x,b,S=s(l.parentNode.getEndTangent(),2);g=Math.cos(E=Math.atan2((x=S[0])[1]-(b=S[1])[1],x[0]-b[0]))*(u||0),m=Math.sin(E)*(u||0)}for(var P=0;f.length>P;P++){var T=f[P],C=f[P+1],A=0===P&&(0!==v||0!==y),w=(P===f.length-1||C&&("M"===C[0]||"Z"===C[0]))&&0!==g&&0!==m;switch(T[0]){case"M":A?(t.moveTo(T[1]-i+v,T[2]-o+y),t.lineTo(T[1]-i,T[2]-o)):t.moveTo(T[1]-i,T[2]-o);break;case"L":w?t.lineTo(T[1]-i+g,T[2]-o+m):t.lineTo(T[1]-i,T[2]-o);break;case"Q":t.quadraticCurveTo(T[1]-i,T[2]-o,T[3]-i,T[4]-o),w&&t.lineTo(T[3]-i+g,T[4]-o+m);break;case"C":t.bezierCurveTo(T[1]-i,T[2]-o,T[3]-i,T[4]-o,T[5]-i,T[6]-o),w&&t.lineTo(T[5]-i+g,T[6]-o+m);break;case"A":var O=p[P].arcParams,k=O.cx,L=O.cy,R=O.rx,I=O.ry,N=O.startAngle,D=O.endAngle,B=O.xRotation,F=O.sweepFlag;if(t.ellipse)t.ellipse(k-i,L-o,R,I,B,N,D,!!(1-F));else{var G=R>I?R:I,j=R>I?1:R/I,_=R>I?I/R:1;t.translate(k-i,L-o),t.rotate(B),t.scale(j,_),t.arc(0,0,G,N,D,!!(1-F)),t.scale(1/j,1/_),t.rotate(-B),t.translate(-(k-i),-(L-o))}w&&t.lineTo(T[6]-i+g,T[7]-o+m);break;case"Z":t.closePath()}}}function v(t,n){var r=n.defX,i=void 0===r?0:r,a=n.defY,o=void 0===a?0:a,s=n.markerStart,c=n.markerEnd,l=n.markerStartOffset,h=n.markerEndOffset,u=n.points.points,d=u.length,f=u[0][0]-i,p=u[0][1]-o,v=u[d-1][0]-i,y=u[d-1][1]-o,g=0,m=0,E=0,M=0,x=0;s&&e.isDisplayObject(s)&&l&&(g=Math.cos(x=Math.atan2(u[1][1]-u[0][1],u[1][0]-u[0][0]))*(l||0),m=Math.sin(x)*(l||0)),c&&e.isDisplayObject(c)&&h&&(E=Math.cos(x=Math.atan2(u[d-1][1]-u[0][1],u[d-1][0]-u[0][0]))*(h||0),M=Math.sin(x)*(h||0)),t.moveTo(f+(g||E),p+(m||M));for(var b=1;d-1>b;b++){var S=u[b];t.lineTo(S[0]-i,S[1]-o)}t.lineTo(v,y)}function y(t,n){var r=n.defX,i=void 0===r?0:r,a=n.defY,o=void 0===a?0:a,s=n.markerStart,c=n.markerEnd,l=n.markerStartOffset,h=n.markerEndOffset,u=n.points.points,d=u.length,f=u[0][0]-i,p=u[0][1]-o,v=u[d-1][0]-i,y=u[d-1][1]-o,g=0,m=0,E=0,M=0,x=0;s&&e.isDisplayObject(s)&&l&&(g=Math.cos(x=Math.atan2(u[1][1]-u[0][1],u[1][0]-u[0][0]))*(l||0),m=Math.sin(x)*(l||0)),c&&e.isDisplayObject(c)&&h&&(E=Math.cos(x=Math.atan2(u[d-2][1]-u[d-1][1],u[d-2][0]-u[d-1][0]))*(h||0),M=Math.sin(x)*(h||0)),t.moveTo(f+g,p+m);for(var b=1;d-1>b;b++){var S=u[b];t.lineTo(S[0]-i,S[1]-o)}t.lineTo(v+E,y+M)}function g(t,e){var n=e.radius,r=e.width,i=e.height,a=r,o=i;if(n&&n.some((function(t){return 0!==t}))){var c=r>0?1:-1,l=i>0?1:-1,u=c+l===0,d=s(n.map((function(t){return h(t,0,Math.min(Math.abs(a)/2,Math.abs(o)/2))})),4),f=d[0],p=d[1],v=d[2],y=d[3];t.moveTo(c*f,0),t.lineTo(a-c*p,0),0!==p&&t.arc(a-c*p,l*p,p,-l*Math.PI/2,c>0?0:Math.PI,u),t.lineTo(a,o-l*v),0!==v&&t.arc(a-c*v,o-l*v,v,c>0?0:Math.PI,l>0?Math.PI/2:1.5*Math.PI,u),t.lineTo(c*y,o),0!==y&&t.arc(c*y,o-l*y,y,l>0?Math.PI/2:-Math.PI/2,c>0?Math.PI:0,u),t.lineTo(0,l*f),0!==f&&t.arc(c*f,l*f,f,c>0?Math.PI:0,l>0?1.5*Math.PI:Math.PI/2,u)}else t.rect(0,0,a,o)}var m=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-path-generator",e}return r(n,t),n.prototype.init=function(){var t,n=((t={})[e.Shape.CIRCLE]=u,t[e.Shape.ELLIPSE]=d,t[e.Shape.RECT]=g,t[e.Shape.LINE]=f,t[e.Shape.POLYLINE]=y,t[e.Shape.POLYGON]=v,t[e.Shape.PATH]=p,t[e.Shape.TEXT]=void 0,t[e.Shape.GROUP]=void 0,t[e.Shape.IMAGE]=void 0,t[e.Shape.HTML]=void 0,t[e.Shape.MESH]=void 0,t);this.context.pathGeneratorFactory=n},n.prototype.destroy=function(){delete this.context.pathGeneratorFactory},n}(e.AbstractRendererPlugin),E=Object.freeze({__proto__:null,Plugin:m}),M="undefined"!=typeof Float32Array?Float32Array:Array;function x(){var t=new M(16);return M!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function b(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function S(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],h=e[7],u=e[8],d=e[9],f=e[10],p=e[11],v=e[12],y=e[13],g=e[14],m=e[15],E=n[0],M=n[1],x=n[2],b=n[3];return t[0]=E*r+M*s+x*u+b*v,t[1]=E*i+M*c+x*d+b*y,t[2]=E*a+M*l+x*f+b*g,t[3]=E*o+M*h+x*p+b*m,t[4]=(E=n[4])*r+(M=n[5])*s+(x=n[6])*u+(b=n[7])*v,t[5]=E*i+M*c+x*d+b*y,t[6]=E*a+M*l+x*f+b*g,t[7]=E*o+M*h+x*p+b*m,t[8]=(E=n[8])*r+(M=n[9])*s+(x=n[10])*u+(b=n[11])*v,t[9]=E*i+M*c+x*d+b*y,t[10]=E*a+M*l+x*f+b*g,t[11]=E*o+M*h+x*p+b*m,t[12]=(E=n[12])*r+(M=n[13])*s+(x=n[14])*u+(b=n[15])*v,t[13]=E*i+M*c+x*d+b*y,t[14]=E*a+M*l+x*f+b*g,t[15]=E*o+M*h+x*p+b*m,t}function P(t,e,n){var r,i,a,o,s,c,l,h,u,d,f,p,v=n[0],y=n[1],g=n[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],h=e[7],u=e[8],d=e[9],f=e[10],p=e[11],t[0]=r=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=h,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=r*v+s*y+u*g+e[12],t[13]=i*v+c*y+d*g+e[13],t[14]=a*v+l*y+f*g+e[14],t[15]=o*v+h*y+p*g+e[15]),t}function T(){var t=new M(3);return M!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function C(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function A(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o=o||1),t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function w(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function O(t,e,n,r,i,a){var o=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,a-e],s))}function k(t,e,n,r,i,a,o,s,c,l,h){var u=this.nearestPoint(t,e,n,r,i,a,o,s,c,l,h);return w(u.x,u.y,c,l)}function L(t,e,n,r,i,a,o,s){var c=this.nearestPoint(t,e,n,r,i,a,o,s);return w(c.x,c.y,o,s)}function R(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function I(t,e,n,r,i,a,o,s,c,l){var h,u,d,f,p,v=t,y=e,g=n,m=r,E=s,M=c,x=120*Math.PI/180,b=Math.PI/180*(+i||0),S=[];if(l)u=l[0],d=l[1],f=l[2],p=l[3];else{y=(h=R(v,y,-b)).y;var P=((v=h.x)-(E=(h=R(E,M,-b)).x))/2,T=(y-(M=h.y))/2,C=P*P/(g*g)+T*T/(m*m);C>1&&(g*=C=Math.sqrt(C),m*=C);var A=g*g,w=m*m,O=(a===o?-1:1)*Math.sqrt(Math.abs((A*w-A*T*T-w*P*P)/(A*T*T+w*P*P)));f=O*g*T/m+(v+E)/2,u=Math.asin(((y-(p=O*-m*P/g+(y+M)/2))/m*1e9>>0)/1e9),d=Math.asin(((M-p)/m*1e9>>0)/1e9),0>(u=f>v?Math.PI-u:u)&&(u=2*Math.PI+u),0>(d=f>E?Math.PI-d:d)&&(d=2*Math.PI+d),o&&u>d&&(u-=2*Math.PI),!o&&d>u&&(d-=2*Math.PI)}var k=d-u;if(Math.abs(k)>x){var L=d,N=E,D=M;S=I(E=f+g*Math.cos(d=u+x*(o&&d>u?1:-1)),M=p+m*Math.sin(d),g,m,i,0,o,N,D,[d,L,f,p])}k=d-u;var B=Math.cos(u),F=Math.sin(u),G=Math.cos(d),j=Math.sin(d),_=Math.tan(k/4),H=4/3*g*_,$=4/3*m*_,W=[v,y],U=[v+H*F,y-$*B],Y=[E+H*j,M-$*G],X=[E,M];if(U[0]=2*W[0]-U[0],U[1]=2*W[1]-U[1],l)return U.concat(Y,X,S);for(var z=[],q=0,Q=(S=U.concat(Y,X,S)).length;Q>q;q+=1)z[q]=q%2?R(S[q-1],S[q],b).y:R(S[q],S[q+1],b).x;return z}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),T(),function(){var t,e=(t=new M(2),M!=Float32Array&&(t[0]=0,t[1]=0),t)}();var N=function(t){return null==t},D={}.toString,B=function(t,e){return D.call(t)==="[object "+e+"]"},F=function(t){return B(t,"String")},G=function(t,e,n){return e>t?e:t>n?n:t},j=function(t){return B(t,"Number")},_=T(),H=T(),$=T(),W=x(),U=function(){function t(){var t=this;this.isHit=function(n,r,i,a){var o,s,c,l,h,u,d,f,p,v,y,g,m,E,M,x,b,S,P,T,w,O,k,L,R,I,N,D,B,F,G,j=t.context.pointInPathPickerFactory[n.nodeName];if(j){var _=(o=W,(G=(P=(c=(s=i)[0])*(f=s[5])-(l=s[1])*(d=s[4]))*(F=(m=s[10])*(S=s[15])-(E=s[11])*(b=s[14]))-(T=c*(p=s[6])-(h=s[2])*d)*(B=(g=s[9])*S-E*(x=s[13]))+(w=c*(v=s[7])-(u=s[3])*d)*(D=g*b-m*x)+(O=l*p-h*f)*(N=(y=s[8])*S-E*(M=s[12]))-(k=l*v-u*f)*(I=y*b-m*M)+(L=h*v-u*p)*(R=y*x-g*M))?(o[0]=(f*F-p*B+v*D)*(G=1/G),o[1]=(h*B-l*F-u*D)*G,o[2]=(x*L-b*k+S*O)*G,o[3]=(m*k-g*L-E*O)*G,o[4]=(p*N-d*F-v*I)*G,o[5]=(c*F-h*N+u*I)*G,o[6]=(b*w-M*L-S*T)*G,o[7]=(y*L-m*w+E*T)*G,o[8]=(d*B-f*N+v*R)*G,o[9]=(l*N-c*B-u*R)*G,o[10]=(M*k-x*w+S*P)*G,o[11]=(g*w-y*k-E*P)*G,o[12]=(f*I-d*D-p*R)*G,o[13]=(c*D-l*I+h*R)*G,o[14]=(x*T-M*O-b*P)*G,o[15]=(y*O-g*T+m*P)*G,o):null),U=A(H,C($,r[0],r[1],0),_),Y=n.getGeometryBounds().halfExtents,X=n.parsedStyle.anchor;if(U[0]+=(X&&X[0]||0)*Y[0]*2,U[1]+=(X&&X[1]||0)*Y[1]*2,j(n,new e.Point(U[0],U[1]),a,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvas.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,s=e.renderingService,c=e.renderingContext;this.context=e,this.runtime=n;var l=null===(r=c.root)||void 0===r?void 0:r.ownerDocument;s.hooks.pick.tapPromise(t.tag,(function(t){return a(i,void 0,void 0,(function(){return o(this,(function(e){return[2,this.pick(l,t)]}))}))})),s.hooks.pickSync.tap(t.tag,(function(t){return i.pick(l,t)}))},t.prototype.pick=function(t,n){var r,i,a,o=n.topmost,s=(r=n.position).x,c=C(_,s,r.y,0),l=t.elementsFromBBox(c[0],c[1],c[0],c[1]),h=[];try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(l),d=u.next();!d.done;d=u.next()){var f=d.value,p=f.getWorldTransform();if(this.isHit(f,c,p,!1)){var v=e.findClosestClipPathTarget(f);if(v){var y=v.parsedStyle.clipPath;if(this.isHit(y,c,y.getWorldTransform(),!0)){if(o)return n.picked=[f],n;h.push(f)}}else{if(o)return n.picked=[f],n;h.push(f)}}}}catch(t){i={error:t}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}return n.picked=h,n},t.tag="CanvasPicker",t}();function Y(t,n,r){var i=t.parsedStyle,a=i.r,o=i.fill,c=i.stroke,l=i.pointerEvents,h=((i.lineWidth||0)+(i.increasedLineWidthForHitTesting||0))/2,u=w(a,a,n.x,n.y),d=s(e.isFillOrStrokeAffected(l,o,c),2),f=d[0],p=d[1];return f&&p||r?a+h>=u:f?a>=u:!!p&&(u>=a-h&&a+h>=u)}function X(t,e,n,r){return t/(n*n)+e/(r*r)}function z(t,n,r){var i=t.parsedStyle,a=i.rx,o=i.ry,c=i.lineWidth,l=i.increasedLineWidthForHitTesting,h=n.x,u=n.y,d=s(e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke),2),f=d[0],p=d[1],v=((c||0)+(l||0))/2,y=(h-a)*(h-a),g=(u-o)*(u-o);return f&&p||r?1>=X(y,g,a+v,o+v):f?1>=X(y,g,a,o):!!p&&(X(y,g,a-v,o-v)>=1&&1>=X(y,g,a+v,o+v))}function q(t,e,n,r,i,a){return!(t>i||i>t+n||e>a||a>e+r)}function Q(t,e,n,r,i,a,o,s){var c=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return w(l.x,l.y,o,s)<=a/2}function V(t,e,n,r,i,a,o){var s=i/2;return!(Math.min(t,n)-s>a||a>Math.max(t,n)+s||Math.min(e,r)-s>o||o>Math.max(e,r)+s)&&O(t,e,n,r,a,o)<=i/2}function Z(t,e,n,r,i){var a=t.length;if(2>a)return!1;for(var o=0;a-1>o;o++){if(V(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[a-1];if(V(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var J=1e-6;function K(t){return J>Math.abs(t)?0:0>t?-1:1}function tt(t,e,n){return!((n[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(n[1]-t[1])||Math.min(t[0],e[0])>n[0]||n[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>n[1]||n[1]>Math.max(t[1],e[1]))}function et(t,e,n){var r=!1,i=t.length;if(2>=i)return!1;for(var a=0;i>a;a++){var o=t[a],s=t[(a+1)%i];if(tt(o,s,[e,n]))return!0;K(o[1]-n)>0!=K(s[1]-n)>0&&0>K(e-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])&&(r=!r)}return r}function nt(t,e,n){for(var r=!1,i=0;t.length>i;i++){if(r=et(t[i],e,n))break}return r}function rt(t,n,r){var i=t.parsedStyle,a=i.x1,o=i.y1,c=i.x2,l=i.y2,h=i.lineWidth,u=i.increasedLineWidthForHitTesting,d=i.defX,f=void 0===d?0:d,p=i.defY,v=void 0===p?0:p;return!(!s(e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke),2)[1]&&!r||!h)&&V(a,o,c,l,(h||0)+(u||0),n.x+f,n.y+v)}function it(t,n,r,i,a,o){var c=t.parsedStyle,l=c.lineWidth,h=c.increasedLineWidthForHitTesting,u=c.defX,d=void 0===u?0:u,f=c.defY,p=void 0===f?0:f,v=c.path,y=v.segments,g=v.hasArc,m=v.polylines,E=v.polygons,M=s(e.isFillOrStrokeAffected(c.pointerEvents,(null==E?void 0:E.length)&&c.fill,c.stroke),2),x=M[0],b=M[1],S=e.getOrCalculatePathTotalLength(t),P=!1;return x||r?P=g?i(t,n):nt(E,n.x+d,n.y+p)||nt(m,n.x+d,n.y+p):((b||r)&&(P=function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;t.length>s;s++){var c=t[s],l=c.currentPoint,h=c.params,u=c.prePoint,d=c.box;if(!d||q(d.x-o,d.y-o,d.width+e,d.height+e,n,r))switch(c.command){case"L":case"Z":if(a=V(u[0],u[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(a=e/2>=L(u[0],u[1],h[1],h[2],h[3],h[4],n,r))return!0;break;case"C":if(a=e/2>=k(u[0],u[1],h[1],h[2],h[3],h[4],h[5],h[6],n,r,i))return!0;break;case"A":c.cubicParams||(c.cubicParams=I(u[0],u[1],h[1],h[2],h[3],h[4],h[5],h[6],h[7],void 0));for(var f=c.cubicParams,p=u,v=0;f.length>v;v+=6){var y=k(p[0],p[1],f[v],f[v+1],f[v+2],f[v+3],f[v+4],f[v+5],n,r,i);if(p=[f[v+4],f[v+5]],a=e/2>=y)return!0}}}return a}(y,(l||0)+(h||0),n.x+d,n.y+p,S)),P)}function at(t,n,r){var i=t.parsedStyle,a=i.lineWidth,o=i.increasedLineWidthForHitTesting,c=i.points,l=i.defX,h=void 0===l?0:l,u=i.defY,d=void 0===u?0:u,f=s(e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke),2),p=f[0],v=!1;return(f[1]||r)&&(v=Z(c.points,(a||0)+(o||0),n.x+h,n.y+d,!0)),v||!p&&!r||(v=et(c.points,n.x+h,n.y+d)),v}function ot(t,n,r){var i=t.parsedStyle,a=i.lineWidth,o=i.increasedLineWidthForHitTesting,c=i.points,l=i.defX,h=void 0===l?0:l,u=i.defY,d=void 0===u?0:u;return!(!s(e.isFillOrStrokeAffected(i.pointerEvents,i.fill,i.stroke),2)[1]&&!r||!a)&&Z(c.points,(a||0)+(o||0),n.x+h,n.y+d,!1)}function st(t,n,r,i,a){var o=t.parsedStyle,c=o.radius,l=o.lineWidth,h=o.increasedLineWidthForHitTesting,u=o.width,d=o.height,f=s(e.isFillOrStrokeAffected(o.pointerEvents,o.fill,o.stroke),2),p=f[0],v=f[1],y=(l||0)+(h||0);if(c&&c.some((function(t){return 0!==t}))){var g=!1;return(v||r)&&(g=function(t,e,n,r,i,a,o,c){var l=s(i,4),h=l[0],u=l[1],d=l[2],f=l[3];return V(t+h,e,t+n-u,e,a,o,c)||V(t+n,e+u,t+n,e+r-d,a,o,c)||V(t+n-d,e+r,t+f,e+r,a,o,c)||V(t,e+r-f,t,e+h,a,o,c)||Q(t+n-u,e+u,u,0,0,a,o,c)||Q(t+n-d,e+r-d,d,0,0,a,o,c)||Q(t+f,e+r-f,f,0,0,a,o,c)||Q(t+h,e+h,h,0,0,a,o,c)}(0,0,u,d,c.map((function(t){return G(t,0,Math.min(Math.abs(u)/2,Math.abs(d)/2))})),y,n.x,n.y)),g||!p&&!r||(g=i(t,n)),g}var m=y/2;return p&&v||r?q(0-m,0-m,u+m,d+m,n.x,n.y):p?q(0,0,u,d,n.x,n.y):!!v&&function(t,e,n,r,i,a,o){var s=i/2;return q(t-s,e-s,n,i,a,o)||q(t+n-s,e-s,i,r,a,o)||q(t+s,e+r-s,n,i,a,o)||q(t-s,e+s,i,r,a,o)}(0,0,u,d,y,n.x,n.y)}function ct(t,n,r,i,a,o){var s=t.parsedStyle,c=s.width,l=s.height;if("non-transparent-pixel"===s.pointerEvents){var h=a.config.offscreenCanvas,u=o.offscreenCanvas.getOrCreateCanvas(h),d=o.offscreenCanvas.getOrCreateContext(h,{willReadFrequently:!0});return u.width=c,u.height=l,a.defaultStyleRendererFactory[e.Shape.IMAGE].render(d,t.parsedStyle,t,void 0,void 0,void 0),d.getImageData(n.x,n.y,1,1).data.every((function(t){return 0!==t}))}return!0}var lt=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-picker",e}return r(n,t),n.prototype.init=function(){var t,n=((t={})[e.Shape.CIRCLE]=Y,t[e.Shape.ELLIPSE]=z,t[e.Shape.RECT]=st,t[e.Shape.LINE]=rt,t[e.Shape.POLYLINE]=ot,t[e.Shape.POLYGON]=at,t[e.Shape.PATH]=it,t[e.Shape.TEXT]=function(){return!0},t[e.Shape.GROUP]=null,t[e.Shape.IMAGE]=ct,t[e.Shape.HTML]=null,t[e.Shape.MESH]=null,t);this.context.pointInPathPickerFactory=n,this.addRenderingPlugin(new U)},n.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},n}(e.AbstractRendererPlugin),ht=Object.freeze({__proto__:null,Plugin:lt}),ut=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=x(),this.dprMatrix=x(),this.tmpMat4=x(),this.vec3a=T(),this.vec3b=T(),this.vec3c=T(),this.vec3d=T()}return t.prototype.apply=function(n,r){var i=this;this.context=n;var a=n.config,o=n.camera,c=n.renderingService,l=n.renderingContext,h=n.pathGeneratorFactory;this.rBush=n.rBushRoot,this.pathGeneratorFactory=h;var u=n.contextService,d=l.root.ownerDocument.defaultView,f=function(t){var e=t.target.rBushNode;e.aabb&&i.removedRBushNodeAABBs.push(e.aabb)},p=function(t){var e=t.target.rBushNode;e.aabb&&i.removedRBushNodeAABBs.push(e.aabb)};c.hooks.init.tap(t.tag,(function(){d.addEventListener(e.ElementEvent.UNMOUNTED,f),d.addEventListener(e.ElementEvent.CULLED,p);var t=u.getDPR(),n=a.width,r=a.height,o=u.getContext();i.clearRect(o,0,0,n*t,r*t,a.background)})),c.hooks.destroy.tap(t.tag,(function(){d.removeEventListener(e.ElementEvent.UNMOUNTED,f),d.removeEventListener(e.ElementEvent.CULLED,p)})),c.hooks.beginFrame.tap(t.tag,(function(){var t,e,n=u.getContext(),r=u.getDPR(),o=a.width,s=a.height,l=(t=i.canvasRendererPluginOptions).dirtyObjectNumThreshold,h=t.dirtyObjectRatioThreshold,d=(e=c.getStats()).total,f=e.rendered,p=f/d;i.clearFullScreen=c.disableDirtyRectangleRendering()||f>l&&p>h,n&&(n.resetTransform?n.resetTransform():n.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(n,0,0,o*r,s*r,a.background))}));var v=function(t,e){t.isVisible()&&!t.isCulled()&&(i.renderDisplayObject(t,e,i.context,i.restoreStack,r),i.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach((function(t){v(t,e)}))};c.hooks.endFrame.tap(t.tag,(function(){var t,n,c=u.getContext(),h=u.getDPR();if((t=i.dprMatrix)[0]=(n=[h,h,1])[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=n[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,S(i.vpMatrix,i.dprMatrix,o.getOrthoMatrix()),i.clearFullScreen)v(l.root,c);else{var f=i.safeMergeAABB.apply(i,function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;a>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([i.mergeDirtyAABBs(i.renderQueue)],s(i.removedRBushNodeAABBs.map((function(t){var n=t.minX,r=t.minY,i=t.maxX,a=t.maxY,o=new e.AABB;return o.setMinMax([n,r,0],[i,a,0]),o}))),!1));if(i.removedRBushNodeAABBs=[],e.AABB.isEmpty(f))return void(i.renderQueue=[]);var p=i.convertAABB2Rect(f),y=p.x,g=p.y,m=p.width,E=p.height,M=A(i.vec3a,[y,g,0],i.vpMatrix),x=A(i.vec3b,[y+m,g,0],i.vpMatrix),b=A(i.vec3c,[y,g+E,0],i.vpMatrix),P=A(i.vec3d,[y+m,g+E,0],i.vpMatrix),T=Math.min(M[0],x[0],P[0],b[0]),C=Math.min(M[1],x[1],P[1],b[1]),w=Math.max(M[0],x[0],P[0],b[0]),O=Math.max(M[1],x[1],P[1],b[1]),k=Math.floor(T),L=Math.floor(C),R=Math.ceil(w-T),I=Math.ceil(O-C);c.save(),i.clearRect(c,k,L,R,I,a.background),c.beginPath(),c.rect(k,L,R,I),c.clip(),c.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]),a.renderer.getConfig().enableDirtyRectangleRenderingDebug&&d.dispatchEvent(new e.CustomEvent(e.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:{x:k,y:L,width:R,height:I}})),i.searchDirtyObjects(f).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(t){t&&t.isVisible()&&!t.isCulled()&&i.renderDisplayObject(t,c,i.context,i.restoreStack,r)})),c.restore(),i.renderQueue.forEach((function(t){i.saveDirtyAABB(t)})),i.renderQueue=[]}i.restoreStack.forEach((function(){c.restore()})),i.restoreStack=[]})),c.hooks.render.tap(t.tag,(function(t){i.clearFullScreen||i.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,n,r,i,a){var o=t.nodeName,s=i[i.length-1];!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(n.restore(),i.pop());var c=this.context.styleRendererFactory[o],l=this.pathGeneratorFactory[o],h=t.parsedStyle.clipPath;if(h){this.applyWorldTransform(n,h);var u=this.pathGeneratorFactory[h.nodeName];u&&(n.save(),i.push(t),n.beginPath(),u(n,h.parsedStyle),n.closePath(),n.clip())}c&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),l&&(n.beginPath(),l(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),c&&(c.render(n,t.parsedStyle,t,r,this,a),n.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var n=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();n.add(e);var r=t.renderable.dirtyRenderBounds;r&&n.add(r)})),n},t.prototype.searchDirtyObjects=function(t){var e,n,r=(e=s(t.getMin(),2))[0],i=e[1],a=(n=s(t.getMax(),2))[0];return this.rBush.search({minX:r,minY:i,maxX:a,maxY:n[1]}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new e.AABB);var r=t.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n,r=(n=e.parsedStyle).stroke,i=n.fill,a=n.opacity,o=n.lineDash,s=n.lineDashOffset;o&&t.setLineDash(o),N(s)||(t.lineDashOffset=s),N(a)||(t.globalAlpha*=a),N(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),N(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,a=(e.parsedStyle||{}).anchor,o=a&&a[0]||0,s=a&&a[1]||0;if(0!==o||0!==s){var c=e.geometry.contentBounds;r=-o*(c&&2*c.halfExtents[0]||0),i=-s*(c&&2*c.halfExtents[1]||0)}n?(b(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,P(this.tmpMat4,this.tmpMat4,this.vec3a),S(this.tmpMat4,n,this.tmpMat4),S(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(b(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,P(this.tmpMat4,this.tmpMat4,this.vec3a),S(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var t=[],n=0;arguments.length>n;n++)t[n]=arguments[n];var r=new e.AABB;return t.forEach((function(t){r.add(t)})),r},t.tag="CanvasRenderer",t}(),dt=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,n,r,i,a,o){var s=n.fill,c=n.fillRule,l=n.opacity,h=n.fillOpacity,u=n.stroke,d=n.strokeOpacity,f=n.lineWidth,p=n.lineCap,v=n.lineJoin,y=n.shadowType,g=n.shadowColor,m=n.shadowBlur,E=n.filter,M=n.miterLimit,x=!N(s)&&!s.isNone,b=!N(u)&&!u.isNone&&f>0,S=0===s.alpha,P=!(!E||!E.length),T=!N(g)&&m>0,C=r.nodeName,A="inner"===y,w=b&&T&&(C===e.Shape.PATH||C===e.Shape.LINE||C===e.Shape.POLYLINE||S||A);x&&(t.globalAlpha=l*h,w||ft(r,t,T),this.fill(t,r,s,c,i,a,o),w||this.clearShadowAndFilter(t,P,T)),b&&(t.globalAlpha=l*d,t.lineWidth=f,N(M)||(t.miterLimit=M),N(p)||(t.lineCap=p),N(v)||(t.lineJoin=v),w&&(A&&(t.globalCompositeOperation="source-atop"),ft(r,t,!0),A&&(this.stroke(t,r,u,i,a,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,P,!0))),this.stroke(t,r,u,i,a,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!N(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(t,n,r,i,a,o,s){var c=this;Array.isArray(r)?r.forEach((function(e){t.fillStyle=c.getColor(e,n,t),i?t.fill(i):t.fill()})):(e.isPattern(r)&&(t.fillStyle=this.getPattern(r,n,t,a,o,s)),i?t.fill(i):t.fill())},t.prototype.stroke=function(t,n,r,i,a,o){var s=this;Array.isArray(r)?r.forEach((function(e){t.strokeStyle=s.getColor(e,n,t),t.stroke()})):(e.isPattern(r)&&(t.strokeStyle=this.getPattern(r,n,t,i,a,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,a){var o,s;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,l=c.width,h=c.height;s=r.contextService.getDPR();var u=r.config.offscreenCanvas;(o=a.offscreenCanvas.getOrCreateCanvas(u)).width=l*s,o.height=h*s;var d=a.offscreenCanvas.getOrCreateContext(u),f=[];t.image.forEach((function(t){i.renderDisplayObject(t,d,r,f,a)})),f.forEach((function(){d.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,o,s,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,n,r){var a;if(t.type===e.GradientType.LinearGradient||t.type===e.GradientType.RadialGradient){var o=n.getGeometryBounds(),s=o&&2*o.halfExtents[0]||1,c=o&&2*o.halfExtents[1]||1;a=this.imagePool.getOrCreateGradient(i(i({type:t.type},t.value),{width:s,height:c}),r)}return a},t}();function ft(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=""+a,e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}var pt=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.img,a=e.shadowColor,o=e.shadowBlur,s=e.width,c=e.height;if(F(i)?r=this.imagePool.getImageSync(i):(s||(s=i.width),c||(c=i.height),r=i),r){ft(n,t,!N(a)&&o>0);try{t.drawImage(r,0,0,s,c)}catch(t){}}},t}(),vt=function(){function t(){}return t.prototype.render=function(t,n,r){var i=n.lineWidth,a=n.textAlign,o=n.textBaseline,s=n.lineJoin,c=n.miterLimit,l=n.letterSpacing,h=n.stroke,u=n.fill,d=n.fillOpacity,f=n.strokeOpacity,p=n.opacity,v=n.metrics,y=n.dx,g=n.dy,m=n.shadowColor,E=n.shadowBlur,M=v.lines,x=v.height,b=v.lineHeight,S=v.lineMetrics;t.font=v.font,t.lineWidth=i,t.textAlign="middle"===a?"center":a;var P=o;e.runtime.enableCSSParsing||"alphabetic"!==P||(P="bottom"),t.lineJoin=s,N(c)||(t.miterLimit=c);var T=0;"middle"===o?T=-x/2-b/2:"bottom"===o||"alphabetic"===o||"ideographic"===o?T=-x:"top"!==o&&"hanging"!==o||(T=-b);var C=y||0;T+=g||0,1===M.length&&("bottom"===P?(P="middle",T-=.5*x):"top"===P&&(P="middle",T+=.5*x)),t.textBaseline=P,ft(r,t,!N(m)&&E>0);for(var A=0;M.length>A;A++){var w=i/2+C;T+=b,N(h)||h.isNone||!i||this.drawLetterSpacing(t,M[A],S[A],a,w,T,l,d,f,p,!0),N(u)||this.drawLetterSpacing(t,M[A],S[A],a,w,T,l,d,f,p)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,a,o,s,c,l,h){if(void 0===h&&(h=!1),0!==o){var u=t.textAlign;t.textAlign="left";var d=i;"center"===r||"middle"===r?d=i-n.width/2:"right"!==r&&"end"!==r||(d=i-n.width);for(var f=Array.from(e),p=t.measureText(e).width,v=0,y=0;f.length>y;++y){var g=f[y];h?this.strokeText(t,g,d,a,c):this.fillText(t,g,d,a,s,l),d+=p-(v=t.measureText(e.substring(y+1)).width)+o,p=v}t.textAlign=u}else h?this.strokeText(t,e,i,a,c):this.fillText(t,e,i,a,s,l)},t.prototype.fillText=function(t,e,n,r,i,a){var o,s=!N(i)&&1!==i;s&&(o=t.globalAlpha,t.globalAlpha=i*a),t.fillText(e,n,r),s&&(t.globalAlpha=o)},t.prototype.strokeText=function(t,e,n,r,i){var a,o=!N(i)&&1!==i;o&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),o&&(t.globalAlpha=a)},t}(),yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(dt),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(dt),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(dt),Et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(dt),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(dt),xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(dt),bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(dt),St=function(t){function n(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return r(n,t),n.prototype.init=function(){var t,n=i({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),r=this.context.imagePool,a=new dt(r),o=((t={})[e.Shape.CIRCLE]=a,t[e.Shape.ELLIPSE]=a,t[e.Shape.RECT]=a,t[e.Shape.IMAGE]=new pt(r),t[e.Shape.TEXT]=new vt,t[e.Shape.LINE]=a,t[e.Shape.POLYLINE]=a,t[e.Shape.POLYGON]=a,t[e.Shape.PATH]=a,t[e.Shape.GROUP]=void 0,t[e.Shape.HTML]=void 0,t[e.Shape.MESH]=void 0,t);this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new ut(n))},n.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},n}(e.AbstractRendererPlugin),Pt=Object.freeze({__proto__:null,CircleRenderer:gt,EllipseRenderer:mt,ImageRenderer:pt,LineRenderer:Et,PathRenderer:bt,Plugin:St,PolygonRenderer:xt,PolylineRenderer:Mt,RectRenderer:yt,TextRenderer:vt}),Tt=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,a=e.renderingContext,o=e.config;this.context=e;var s=a.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},h=function(t){i.hooks.pointerDown.call(t)},u=function(t){i.hooks.pointerOver.call(t)},d=function(t){i.hooks.pointerOut.call(t)},f=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},v=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",h,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",u,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",h,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",u,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",h,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",f,!0)}(t),o.useNativeClickEvent&&t.addEventListener("click",v,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",h,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",u,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",h,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",u,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",h,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",f,!0)}(t),o.useNativeClickEvent&&t.removeEventListener("click",v,!0),t.removeEventListener("wheel",p,!0)}))},t.tag="DOMInteraction",t}(),Ct=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="dom-interaction",e}return r(e,t),e.prototype.init=function(){this.addRenderingPlugin(new Tt)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(e.AbstractRendererPlugin),At=Object.freeze({__proto__:null,Plugin:Ct}),wt=function(){function t(){}return t.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},t.prototype.apply=function(n){var r=this,i=n.camera,a=n.renderingContext,o=n.renderingService;this.context=n;var s=a.root.ownerDocument.defaultView,c=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform())},l=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){r.$camera||(r.$camera=r.createCamera(i));var a=r.getOrCreateEl(n);r.$camera.appendChild(a);var o=n.ownerDocument.documentElement.attributes;Object.keys(o).forEach((function(t){a.style[t]=o[t]})),Object.keys(n.attributes).forEach((function(t){r.updateAttribute(t,n)})),c(n,a),e.runtime.nativeHTMLMap.set(a,n)}},h=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML&&r.$camera){var i=r.getOrCreateEl(n);i&&(i.remove(),e.runtime.nativeHTMLMap.delete(i))}},u=function(t){var n=t.target;n.nodeName===e.Shape.HTML&&r.updateAttribute(t.attrName,n)},d=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var i=r.getOrCreateEl(n);c(n,i)}},f=function(){if(r.$camera){var t=r.context.config,e=t.height;r.$camera.style.width="".concat(t.width||0,"px"),r.$camera.style.height="".concat(e||0,"px")}};o.hooks.init.tap(t.tag,(function(){s.addEventListener(e.CanvasEvent.RESIZE,f),s.addEventListener(e.ElementEvent.MOUNTED,l),s.addEventListener(e.ElementEvent.UNMOUNTED,h),s.addEventListener(e.ElementEvent.ATTR_MODIFIED,u),s.addEventListener(e.ElementEvent.BOUNDS_CHANGED,d)})),o.hooks.endFrame.tap(t.tag,(function(){r.$camera&&a.renderReasons.has(e.RenderReason.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),o.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(e.CanvasEvent.RESIZE,f),s.removeEventListener(e.ElementEvent.MOUNTED,l),s.removeEventListener(e.ElementEvent.UNMOUNTED,h),s.removeEventListener(e.ElementEvent.ATTR_MODIFIED,u),s.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,d)}))},t.prototype.getId=function(t){return t.id||"g-html-"+t.entity},t.prototype.createCamera=function(t){var e,n=(e=this.context.config).document,r=e.width,i=e.height,a=this.context.contextService.getDomElement(),o=a.parentNode;if(o){var s="g-canvas-camera",c=o.querySelector("#"+s);if(!c){var l=(n||document).createElement("div");c=l,l.id=s,l.style.position="absolute",l.style.left="".concat(a.offsetLeft||0,"px"),l.style.top="".concat(a.offsetTop||0,"px"),l.style.transformOrigin="left top",l.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),l.style.overflow="hidden",l.style.pointerEvents="none",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px"),o.appendChild(l)}return c}return null},t.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.getId(t),r=this.$camera.querySelector("#"+n);return r||(r=(e||document).createElement("div"),t.parsedStyle.$el=r,r.id=n,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(t.getWorldTransform())),r},t.prototype.updateAttribute=function(t,n){var r=this.getOrCreateEl(n);switch(t){case"innerHTML":var i=n.parsedStyle.innerHTML;F(i)?r.innerHTML=i:(r.innerHTML="",r.appendChild(i));break;case"transformOrigin":var a=n.parsedStyle.transformOrigin;r.style["transform-origin"]="".concat(a[0].value," ").concat(a[1].value);break;case"width":if(e.runtime.enableCSSParsing){var o=n.computedStyleMap().get("width");r.style.width=""+o}else{r.style.width=j(o=n.parsedStyle.width)?"".concat(o,"px"):""+o}break;case"height":if(e.runtime.enableCSSParsing){var s=n.computedStyleMap().get("height");r.style.height=""+s}else{r.style.height=j(s=n.parsedStyle.height)?"".concat(s,"px"):""+s}break;case"zIndex":r.style["z-index"]="".concat(n.parsedStyle.zIndex);break;case"visibility":r.style.visibility=n.parsedStyle.visibility;break;case"pointerEvents":r.style.pointerEvents=n.parsedStyle.pointerEvents;break;case"opacity":r.style.opacity="".concat(n.parsedStyle.opacity);break;case"fill":var c=n.parsedStyle.fill,l="";e.isCSSRGB(c)?l=c.isNone?"transparent":n.getAttribute("fill"):Array.isArray(c)?l=n.getAttribute("fill"):e.isPattern(c),r.style.background=l;break;case"stroke":var h=n.parsedStyle.stroke,u="";e.isCSSRGB(h)?u=h.isNone?"transparent":n.getAttribute("stroke"):Array.isArray(h)?u=n.getAttribute("stroke"):e.isPattern(h),r.style["border-color"]=u,r.style["border-style"]="solid";break;case"lineWidth":r.style["border-width"]="".concat(n.parsedStyle.lineWidth||0,"px");break;case"lineDash":r.style["border-style"]="dashed";break;case"filter":r.style.filter=n.style.filter}},t.tag="HTMLRendering",t}(),Ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="html-renderer",e}return r(e,t),e.prototype.init=function(){this.addRenderingPlugin(new wt)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(e.AbstractRendererPlugin),kt=Object.freeze({__proto__:null,Plugin:Ot}),Lt=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var n=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var r=this.canvasConfig.createImage;return new Promise((function(i,a){var o;r?o=r(t):e.isBrowser&&(o=new window.Image),o&&(o.onload=function(){n.imageCache[t]=o,i(o)},o.onerror=function(t){a(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,n,r,i,a){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var s,c=t.image,l=t.repetition,h=t.transform,u=!1;F(c)?s=this.getImageSync(c,a):r?(s=r,u=!0):s=c;var d,f=s&&n.createPattern(s,l);if(f){var p=void 0;h?p=e.parsedTransformToMat4(e.parseTransform(h),new e.DisplayObject({})):((d=x())[0]=1,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,p=d),u&&function(t,e,n){var r=n[0],i=n[1],a=n[2];t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(p,p,[1/i,1/i,1]),f.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12],f:p[13]})}return o&&f&&(this.patternCache[o]=f),f},t.prototype.getOrCreateGradient=function(t,n){var r=this.generateGradientKey(t),i=t.type,a=t.steps,o=t.width,s=t.height,c=t.cx,l=t.cy,h=t.size;if(this.gradientCache[r])return this.gradientCache[r];var u=null;if(i===e.GradientType.LinearGradient){var d=e.computeLinearGradient(o,s,t.angle);u=n.createLinearGradient(d.x1,d.y1,d.x2,d.y2)}else if(i===e.GradientType.RadialGradient){var f=e.computeRadialGradient(o,s,c,l,h),p=f.x,v=f.y;u=n.createRadialGradient(p,v,0,p,v,f.r)}return u&&(a.forEach((function(t){var n=t.offset;n.unit===e.UnitType.kPercentage&&(null==u||u.addColorStop(n.value/100,""+t.color))})),this.gradientCache[r]=u),this.gradientCache[r]},t.prototype.generateGradientKey=function(t){var e=t.width,n=t.height,r=t.steps,i=t.angle,a=t.cx,o=t.cy,s=t.size;return"gradient-".concat(t.type,"-").concat((null==i?void 0:""+i)||0,"-").concat((null==a?void 0:""+a)||0,"-").concat((null==o?void 0:""+o)||0,"-").concat((null==s?void 0:""+s)||0,"-").concat(e,"-").concat(n,"-").concat(r.map((function(t){var e=t.color;return"".concat(t.offset).concat(e)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return F(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),Rt=function(){function t(){}return t.prototype.apply=function(n){var r=n.renderingService,i=n.imagePool,a=n.renderingContext.root.ownerDocument.defaultView,o=function(t){var n=t.target;if(n.nodeName===e.Shape.IMAGE){var a=n.attributes.img;F(a)&&i.getImageSync(a,(function(){n.renderable.dirty=!0,r.dirtify()}))}},s=function(t){var n=t.target,a=t.newValue;n.nodeName===e.Shape.IMAGE&&"img"===t.attrName&&F(a)&&i.getOrCreateImage(a).then((function(){n.renderable.dirty=!0,r.dirtify()}))};r.hooks.init.tap(t.tag,(function(){a.addEventListener(e.ElementEvent.MOUNTED,o),a.addEventListener(e.ElementEvent.ATTR_MODIFIED,s)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(e.ElementEvent.MOUNTED,o),a.removeEventListener(e.ElementEvent.ATTR_MODIFIED,s)}))},t.tag="LoadImage",t}(),It=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="image-loader",e}return r(e,t),e.prototype.init=function(){this.context.imagePool=new Lt(this.context.config),this.addRenderingPlugin(new Rt)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(e.AbstractRendererPlugin),Nt=Object.freeze({__proto__:null,ImagePool:Lt,Plugin:It}),Dt=function(){function t(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=l(e,"String")?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,n){var r=this.canvasConfig.devicePixelRatio||e.isBrowser&&window.devicePixelRatio||1;this.dpr=r=1>r?1:Math.ceil(r),this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,e.setDOMSize(this.$canvas,t,n)),this.renderingContext.renderReasons.add(e.RenderReason.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t.prototype.toDataURL=function(t){return void 0===t&&(t={}),a(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.context.canvas.toDataURL(t.type,t.encoderOptions)]}))}))},t}(),Bt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-context-register",e}return r(e,t),e.prototype.init=function(){this.context.ContextService=Dt},e.prototype.destroy=function(){delete this.context.ContextService},e}(e.AbstractRendererPlugin),Ft=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new Bt),n.registerPlugin(new It),n.registerPlugin(new m),n.registerPlugin(new St),n.registerPlugin(new Ct),n.registerPlugin(new lt),n.registerPlugin(new Ot),n}return r(e,t),e}(e.AbstractRenderer);t.CanvasPathGenerator=E,t.CanvasPicker=ht,t.CanvasRenderer=Pt,t.DomInteraction=At,t.HTMLRenderer=kt,t.ImageLoader=Nt,t.Renderer=Ft}));
2
+ //# sourceMappingURL=index.umd.min.js.map