@netless/appliance-plugin 1.1.22-beta.9 → 1.1.23

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.
@@ -1,473 +0,0 @@
1
- var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["render"],_excluded4=["render"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)o=s[r],t.includes(o)||{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.includes(n))continue;t[n]=r[n];}return t;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _superPropSet(t,e,o,r,p,f){return _set(_getPrototypeOf(f?t.prototype:t),e,o,r,p);}function set(e,r,t,o){return set="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,r,t,o){var f,i=_superPropBase(e,r);if(i){if((f=Object.getOwnPropertyDescriptor(i,r)).set)return f.set.call(o,t),!0;if(!f.writable)return!1;}if(f=Object.getOwnPropertyDescriptor(o,r)){if(!f.writable)return!1;f.value=t,Object.defineProperty(o,r,f);}else _defineProperty(o,r,t);return!0;},set(e,r,t,o);}function _set(e,r,t,o,f){if(!set(e,r,t,o||e)&&f)throw new TypeError("failed to set property");return t;}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest();}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(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 resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(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),y;},finish:function finish(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),resetTryEntry(r),y;}},"catch":function _catch(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 o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n8=0,F=function F(){};return{s:F,n:function n(){return _n8>=r.length?{done:!0}:{done:!1,value:r[_n8++]};},e:function e(r){throw r;},f:F};}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 o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(r){var n=this.s["return"];return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},"throw":function _throw(r){var n=this.s["return"];return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}var ro=Object.defineProperty;var no=function no(u,e,t){return e in u?ro(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t;};var ot=function ot(u,e,t){return no(u,_typeof(e)!="symbol"?e+"":e,t);};var te=/******/function(u){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={/******/i:r,/******/l:!1,/******/exports:{}/******/};return u[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=u,t.c=e,t.d=function(r,n,i){t.o(r,n)||Object.defineProperty(r,n,{enumerable:!0,get:i});},t.r=function(r){(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0});},t.t=function(r,n){if(n&1&&(r=t(r)),n&8||n&4&&_typeof(r)=="object"&&r&&r.__esModule)return r;var i=/* @__PURE__ */Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:r}),n&2&&typeof r!="string")for(var l in r)t.d(i,l,function(o){return r[o];}.bind(null,l));return i;},t.n=function(r){var n=r&&r.__esModule?(/******/function(){return r["default"];}):(/******/function(){return r;});return t.d(n,"a",n),n;},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n);},t.p="/js/",t(t.s=0);}([/* 0 *//***/function(u,e,t){t.r(e),t.d(e,"version",function(){return J;}),t.d(e,"helpers",function(){return X;}),t.d(e,"createElement",function(){return W;}),t.d(e,"isSpriteNode",function(){return D;}),t.d(e,"registerNode",function(){return R;});var r=t(12);t.d(e,"ENV",function(){return r.ENV;});var n=t(68);t.d(e,"requestAnimationFrame",function(){return n.requestAnimationFrame;}),t.d(e,"cancelAnimationFrame",function(){return n.cancelAnimationFrame;});var i=t(70);t.d(e,"Node",function(){return i["default"];});var l=t(217);t.d(e,"Cloud",function(){return l["default"];});var o=t(219);t.d(e,"Block",function(){return o["default"];});var a=t(224);t.d(e,"Sprite",function(){return a["default"];});var c=t(226);t.d(e,"Path",function(){return c["default"];});var m=t(229);t.d(e,"Rect",function(){return m["default"];});var f=t(231);t.d(e,"Triangle",function(){return f["default"];});var v=t(236);t.d(e,"Parallel",function(){return v["default"];});var S=t(238);t.d(e,"Regular",function(){return S["default"];});var E=t(240);t.d(e,"Star",function(){return E["default"];});var T=t(242);t.d(e,"Ellipse",function(){return T["default"];});var P=t(244);t.d(e,"Arc",function(){return P["default"];});var x=t(246);t.d(e,"Ring",function(){return x["default"];});var h=t(232);t.d(e,"Polyline",function(){return h["default"];});var p=t(248);t.d(e,"Label",function(){return p["default"];});var d=t(250);t.d(e,"Group",function(){return d["default"];});var g=t(286);t.d(e,"Layer",function(){return g["default"];});var O=t(287);t.d(e,"SpriteSvg",function(){return O["default"];});var w=t(289);t.d(e,"LayerWorker",function(){return w["default"];});var L=t(290);t.d(e,"Scene",function(){return L["default"];});var B=t(213),A=t(221);t.d(e,"Color",function(){return A.Color;}),t.d(e,"Gradient",function(){return A.Gradient;});var b=t(72);t(1).glMatrix.setMatrixArrayType(Array);var W=B["default"].createElement,D=B["default"].isSpriteNode,R=B["default"].registerNode,X={parseColor:A.parseColor,sizeToPixel:b.sizeToPixel,toArray:b.toArray,toString:b.toString,toNumber:b.toNumber};var H;H="3.8.3";var J=H;},/* 1 *//***/function(u,e,t){t.r(e);var r=t(2);t.d(e,"glMatrix",function(){return r;});var n=t(3);t.d(e,"mat2",function(){return n;});var i=t(4);t.d(e,"mat2d",function(){return i;});var l=t(5);t.d(e,"mat3",function(){return l;});var o=t(6);t.d(e,"mat4",function(){return o;});var a=t(7);t.d(e,"quat",function(){return a;});var c=t(10);t.d(e,"quat2",function(){return c;});var m=t(11);t.d(e,"vec2",function(){return m;});var f=t(8);t.d(e,"vec3",function(){return f;});var v=t(9);t.d(e,"vec4",function(){return v;});},/* 2 *//***/function(u,e,t){t.r(e),t.d(e,"EPSILON",function(){return r;}),t.d(e,"ARRAY_TYPE",function(){return n;}),t.d(e,"RANDOM",function(){return i;}),t.d(e,"setMatrixArrayType",function(){return l;}),t.d(e,"toRadian",function(){return a;}),t.d(e,"equals",function(){return c;});var r=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,i=Math.random;function l(m){n=m;}var o=Math.PI/180;function a(m){return m*o;}function c(m,f){return Math.abs(m-f)<=r*Math.max(1,Math.abs(m),Math.abs(f));}Math.hypot||(Math.hypot=function(){for(var m=0,f=arguments.length;f--;)m+=arguments[f]*arguments[f];return Math.sqrt(m);});},/* 3 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"copy",function(){return l;}),t.d(e,"identity",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"set",function(){return c;}),t.d(e,"transpose",function(){return m;}),t.d(e,"invert",function(){return f;}),t.d(e,"adjoint",function(){return v;}),t.d(e,"determinant",function(){return S;}),t.d(e,"multiply",function(){return E;}),t.d(e,"rotate",function(){return T;}),t.d(e,"scale",function(){return P;}),t.d(e,"fromRotation",function(){return x;}),t.d(e,"fromScaling",function(){return h;}),t.d(e,"str",function(){return p;}),t.d(e,"frob",function(){return d;}),t.d(e,"LDU",function(){return g;}),t.d(e,"add",function(){return O;}),t.d(e,"subtract",function(){return w;}),t.d(e,"exactEquals",function(){return L;}),t.d(e,"equals",function(){return B;}),t.d(e,"multiplyScalar",function(){return A;}),t.d(e,"multiplyScalarAndAdd",function(){return b;}),t.d(e,"mul",function(){return W;}),t.d(e,"sub",function(){return D;});var r=t(2);function n(){var R=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0),R[0]=1,R[3]=1,R;}function i(R){var X=new r.ARRAY_TYPE(4);return X[0]=R[0],X[1]=R[1],X[2]=R[2],X[3]=R[3],X;}function l(R,X){return R[0]=X[0],R[1]=X[1],R[2]=X[2],R[3]=X[3],R;}function o(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R;}function a(R,X,H,J){var et=new r.ARRAY_TYPE(4);return et[0]=R,et[1]=X,et[2]=H,et[3]=J,et;}function c(R,X,H,J,et){return R[0]=X,R[1]=H,R[2]=J,R[3]=et,R;}function m(R,X){if(R===X){var H=X[1];R[1]=X[2],R[2]=H;}else R[0]=X[0],R[1]=X[2],R[2]=X[1],R[3]=X[3];return R;}function f(R,X){var H=X[0],J=X[1],et=X[2],it=X[3],$=H*it-et*J;return $?($=1/$,R[0]=it*$,R[1]=-J*$,R[2]=-et*$,R[3]=H*$,R):null;}function v(R,X){var H=X[0];return R[0]=X[3],R[1]=-X[1],R[2]=-X[2],R[3]=H,R;}function S(R){return R[0]*R[3]-R[2]*R[1];}function E(R,X,H){var J=X[0],et=X[1],it=X[2],$=X[3],V=H[0],rt=H[1],lt=H[2],ct=H[3];return R[0]=J*V+it*rt,R[1]=et*V+$*rt,R[2]=J*lt+it*ct,R[3]=et*lt+$*ct,R;}function T(R,X,H){var J=X[0],et=X[1],it=X[2],$=X[3],V=Math.sin(H),rt=Math.cos(H);return R[0]=J*rt+it*V,R[1]=et*rt+$*V,R[2]=J*-V+it*rt,R[3]=et*-V+$*rt,R;}function P(R,X,H){var J=X[0],et=X[1],it=X[2],$=X[3],V=H[0],rt=H[1];return R[0]=J*V,R[1]=et*V,R[2]=it*rt,R[3]=$*rt,R;}function x(R,X){var H=Math.sin(X),J=Math.cos(X);return R[0]=J,R[1]=H,R[2]=-H,R[3]=J,R;}function h(R,X){return R[0]=X[0],R[1]=0,R[2]=0,R[3]=X[1],R;}function p(R){return"mat2("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+")";}function d(R){return Math.hypot(R[0],R[1],R[2],R[3]);}function g(R,X,H,J){return R[2]=J[2]/J[0],H[0]=J[0],H[1]=J[1],H[3]=J[3]-R[2]*H[1],[R,X,H];}function O(R,X,H){return R[0]=X[0]+H[0],R[1]=X[1]+H[1],R[2]=X[2]+H[2],R[3]=X[3]+H[3],R;}function w(R,X,H){return R[0]=X[0]-H[0],R[1]=X[1]-H[1],R[2]=X[2]-H[2],R[3]=X[3]-H[3],R;}function L(R,X){return R[0]===X[0]&&R[1]===X[1]&&R[2]===X[2]&&R[3]===X[3];}function B(R,X){var H=R[0],J=R[1],et=R[2],it=R[3],$=X[0],V=X[1],rt=X[2],lt=X[3];return Math.abs(H-$)<=r.EPSILON*Math.max(1,Math.abs(H),Math.abs($))&&Math.abs(J-V)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(V))&&Math.abs(et-rt)<=r.EPSILON*Math.max(1,Math.abs(et),Math.abs(rt))&&Math.abs(it-lt)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(lt));}function A(R,X,H){return R[0]=X[0]*H,R[1]=X[1]*H,R[2]=X[2]*H,R[3]=X[3]*H,R;}function b(R,X,H,J){return R[0]=X[0]+H[0]*J,R[1]=X[1]+H[1]*J,R[2]=X[2]+H[2]*J,R[3]=X[3]+H[3]*J,R;}var W=E,D=w;},/* 4 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"copy",function(){return l;}),t.d(e,"identity",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"set",function(){return c;}),t.d(e,"invert",function(){return m;}),t.d(e,"determinant",function(){return f;}),t.d(e,"multiply",function(){return v;}),t.d(e,"rotate",function(){return S;}),t.d(e,"scale",function(){return E;}),t.d(e,"translate",function(){return T;}),t.d(e,"fromRotation",function(){return P;}),t.d(e,"fromScaling",function(){return x;}),t.d(e,"fromTranslation",function(){return h;}),t.d(e,"str",function(){return p;}),t.d(e,"frob",function(){return d;}),t.d(e,"add",function(){return g;}),t.d(e,"subtract",function(){return O;}),t.d(e,"multiplyScalar",function(){return w;}),t.d(e,"multiplyScalarAndAdd",function(){return L;}),t.d(e,"exactEquals",function(){return B;}),t.d(e,"equals",function(){return A;}),t.d(e,"mul",function(){return b;}),t.d(e,"sub",function(){return W;});var r=t(2);function n(){var D=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(D[1]=0,D[2]=0,D[4]=0,D[5]=0),D[0]=1,D[3]=1,D;}function i(D){var R=new r.ARRAY_TYPE(6);return R[0]=D[0],R[1]=D[1],R[2]=D[2],R[3]=D[3],R[4]=D[4],R[5]=D[5],R;}function l(D,R){return D[0]=R[0],D[1]=R[1],D[2]=R[2],D[3]=R[3],D[4]=R[4],D[5]=R[5],D;}function o(D){return D[0]=1,D[1]=0,D[2]=0,D[3]=1,D[4]=0,D[5]=0,D;}function a(D,R,X,H,J,et){var it=new r.ARRAY_TYPE(6);return it[0]=D,it[1]=R,it[2]=X,it[3]=H,it[4]=J,it[5]=et,it;}function c(D,R,X,H,J,et,it){return D[0]=R,D[1]=X,D[2]=H,D[3]=J,D[4]=et,D[5]=it,D;}function m(D,R){var X=R[0],H=R[1],J=R[2],et=R[3],it=R[4],$=R[5],V=X*et-H*J;return V?(V=1/V,D[0]=et*V,D[1]=-H*V,D[2]=-J*V,D[3]=X*V,D[4]=(J*$-et*it)*V,D[5]=(H*it-X*$)*V,D):null;}function f(D){return D[0]*D[3]-D[1]*D[2];}function v(D,R,X){var H=R[0],J=R[1],et=R[2],it=R[3],$=R[4],V=R[5],rt=X[0],lt=X[1],ct=X[2],gt=X[3],st=X[4],Ct=X[5];return D[0]=H*rt+et*lt,D[1]=J*rt+it*lt,D[2]=H*ct+et*gt,D[3]=J*ct+it*gt,D[4]=H*st+et*Ct+$,D[5]=J*st+it*Ct+V,D;}function S(D,R,X){var H=R[0],J=R[1],et=R[2],it=R[3],$=R[4],V=R[5],rt=Math.sin(X),lt=Math.cos(X);return D[0]=H*lt+et*rt,D[1]=J*lt+it*rt,D[2]=H*-rt+et*lt,D[3]=J*-rt+it*lt,D[4]=$,D[5]=V,D;}function E(D,R,X){var H=R[0],J=R[1],et=R[2],it=R[3],$=R[4],V=R[5],rt=X[0],lt=X[1];return D[0]=H*rt,D[1]=J*rt,D[2]=et*lt,D[3]=it*lt,D[4]=$,D[5]=V,D;}function T(D,R,X){var H=R[0],J=R[1],et=R[2],it=R[3],$=R[4],V=R[5],rt=X[0],lt=X[1];return D[0]=H,D[1]=J,D[2]=et,D[3]=it,D[4]=H*rt+et*lt+$,D[5]=J*rt+it*lt+V,D;}function P(D,R){var X=Math.sin(R),H=Math.cos(R);return D[0]=H,D[1]=X,D[2]=-X,D[3]=H,D[4]=0,D[5]=0,D;}function x(D,R){return D[0]=R[0],D[1]=0,D[2]=0,D[3]=R[1],D[4]=0,D[5]=0,D;}function h(D,R){return D[0]=1,D[1]=0,D[2]=0,D[3]=1,D[4]=R[0],D[5]=R[1],D;}function p(D){return"mat2d("+D[0]+", "+D[1]+", "+D[2]+", "+D[3]+", "+D[4]+", "+D[5]+")";}function d(D){return Math.hypot(D[0],D[1],D[2],D[3],D[4],D[5],1);}function g(D,R,X){return D[0]=R[0]+X[0],D[1]=R[1]+X[1],D[2]=R[2]+X[2],D[3]=R[3]+X[3],D[4]=R[4]+X[4],D[5]=R[5]+X[5],D;}function O(D,R,X){return D[0]=R[0]-X[0],D[1]=R[1]-X[1],D[2]=R[2]-X[2],D[3]=R[3]-X[3],D[4]=R[4]-X[4],D[5]=R[5]-X[5],D;}function w(D,R,X){return D[0]=R[0]*X,D[1]=R[1]*X,D[2]=R[2]*X,D[3]=R[3]*X,D[4]=R[4]*X,D[5]=R[5]*X,D;}function L(D,R,X,H){return D[0]=R[0]+X[0]*H,D[1]=R[1]+X[1]*H,D[2]=R[2]+X[2]*H,D[3]=R[3]+X[3]*H,D[4]=R[4]+X[4]*H,D[5]=R[5]+X[5]*H,D;}function B(D,R){return D[0]===R[0]&&D[1]===R[1]&&D[2]===R[2]&&D[3]===R[3]&&D[4]===R[4]&&D[5]===R[5];}function A(D,R){var X=D[0],H=D[1],J=D[2],et=D[3],it=D[4],$=D[5],V=R[0],rt=R[1],lt=R[2],ct=R[3],gt=R[4],st=R[5];return Math.abs(X-V)<=r.EPSILON*Math.max(1,Math.abs(X),Math.abs(V))&&Math.abs(H-rt)<=r.EPSILON*Math.max(1,Math.abs(H),Math.abs(rt))&&Math.abs(J-lt)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(lt))&&Math.abs(et-ct)<=r.EPSILON*Math.max(1,Math.abs(et),Math.abs(ct))&&Math.abs(it-gt)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(gt))&&Math.abs($-st)<=r.EPSILON*Math.max(1,Math.abs($),Math.abs(st));}var b=v,W=O;},/* 5 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"fromMat4",function(){return i;}),t.d(e,"clone",function(){return l;}),t.d(e,"copy",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"set",function(){return c;}),t.d(e,"identity",function(){return m;}),t.d(e,"transpose",function(){return f;}),t.d(e,"invert",function(){return v;}),t.d(e,"adjoint",function(){return S;}),t.d(e,"determinant",function(){return E;}),t.d(e,"multiply",function(){return T;}),t.d(e,"translate",function(){return P;}),t.d(e,"rotate",function(){return x;}),t.d(e,"scale",function(){return h;}),t.d(e,"fromTranslation",function(){return p;}),t.d(e,"fromRotation",function(){return d;}),t.d(e,"fromScaling",function(){return g;}),t.d(e,"fromMat2d",function(){return O;}),t.d(e,"fromQuat",function(){return w;}),t.d(e,"normalFromMat4",function(){return L;}),t.d(e,"projection",function(){return B;}),t.d(e,"str",function(){return A;}),t.d(e,"frob",function(){return b;}),t.d(e,"add",function(){return W;}),t.d(e,"subtract",function(){return D;}),t.d(e,"multiplyScalar",function(){return R;}),t.d(e,"multiplyScalarAndAdd",function(){return X;}),t.d(e,"exactEquals",function(){return H;}),t.d(e,"equals",function(){return J;}),t.d(e,"mul",function(){return et;}),t.d(e,"sub",function(){return it;});var r=t(2);function n(){var $=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&($[1]=0,$[2]=0,$[3]=0,$[5]=0,$[6]=0,$[7]=0),$[0]=1,$[4]=1,$[8]=1,$;}function i($,V){return $[0]=V[0],$[1]=V[1],$[2]=V[2],$[3]=V[4],$[4]=V[5],$[5]=V[6],$[6]=V[8],$[7]=V[9],$[8]=V[10],$;}function l($){var V=new r.ARRAY_TYPE(9);return V[0]=$[0],V[1]=$[1],V[2]=$[2],V[3]=$[3],V[4]=$[4],V[5]=$[5],V[6]=$[6],V[7]=$[7],V[8]=$[8],V;}function o($,V){return $[0]=V[0],$[1]=V[1],$[2]=V[2],$[3]=V[3],$[4]=V[4],$[5]=V[5],$[6]=V[6],$[7]=V[7],$[8]=V[8],$;}function a($,V,rt,lt,ct,gt,st,Ct,xt){var F=new r.ARRAY_TYPE(9);return F[0]=$,F[1]=V,F[2]=rt,F[3]=lt,F[4]=ct,F[5]=gt,F[6]=st,F[7]=Ct,F[8]=xt,F;}function c($,V,rt,lt,ct,gt,st,Ct,xt,F){return $[0]=V,$[1]=rt,$[2]=lt,$[3]=ct,$[4]=gt,$[5]=st,$[6]=Ct,$[7]=xt,$[8]=F,$;}function m($){return $[0]=1,$[1]=0,$[2]=0,$[3]=0,$[4]=1,$[5]=0,$[6]=0,$[7]=0,$[8]=1,$;}function f($,V){if($===V){var rt=V[1],lt=V[2],ct=V[5];$[1]=V[3],$[2]=V[6],$[3]=rt,$[5]=V[7],$[6]=lt,$[7]=ct;}else $[0]=V[0],$[1]=V[3],$[2]=V[6],$[3]=V[1],$[4]=V[4],$[5]=V[7],$[6]=V[2],$[7]=V[5],$[8]=V[8];return $;}function v($,V){var rt=V[0],lt=V[1],ct=V[2],gt=V[3],st=V[4],Ct=V[5],xt=V[6],F=V[7],U=V[8],K=U*st-Ct*F,q=-U*gt+Ct*xt,Y=F*gt-st*xt,k=rt*K+lt*q+ct*Y;return k?(k=1/k,$[0]=K*k,$[1]=(-U*lt+ct*F)*k,$[2]=(Ct*lt-ct*st)*k,$[3]=q*k,$[4]=(U*rt-ct*xt)*k,$[5]=(-Ct*rt+ct*gt)*k,$[6]=Y*k,$[7]=(-F*rt+lt*xt)*k,$[8]=(st*rt-lt*gt)*k,$):null;}function S($,V){var rt=V[0],lt=V[1],ct=V[2],gt=V[3],st=V[4],Ct=V[5],xt=V[6],F=V[7],U=V[8];return $[0]=st*U-Ct*F,$[1]=ct*F-lt*U,$[2]=lt*Ct-ct*st,$[3]=Ct*xt-gt*U,$[4]=rt*U-ct*xt,$[5]=ct*gt-rt*Ct,$[6]=gt*F-st*xt,$[7]=lt*xt-rt*F,$[8]=rt*st-lt*gt,$;}function E($){var V=$[0],rt=$[1],lt=$[2],ct=$[3],gt=$[4],st=$[5],Ct=$[6],xt=$[7],F=$[8];return V*(F*gt-st*xt)+rt*(-F*ct+st*Ct)+lt*(xt*ct-gt*Ct);}function T($,V,rt){var lt=V[0],ct=V[1],gt=V[2],st=V[3],Ct=V[4],xt=V[5],F=V[6],U=V[7],K=V[8],q=rt[0],Y=rt[1],k=rt[2],C=rt[3],M=rt[4],j=rt[5],G=rt[6],Q=rt[7],_=rt[8];return $[0]=q*lt+Y*st+k*F,$[1]=q*ct+Y*Ct+k*U,$[2]=q*gt+Y*xt+k*K,$[3]=C*lt+M*st+j*F,$[4]=C*ct+M*Ct+j*U,$[5]=C*gt+M*xt+j*K,$[6]=G*lt+Q*st+_*F,$[7]=G*ct+Q*Ct+_*U,$[8]=G*gt+Q*xt+_*K,$;}function P($,V,rt){var lt=V[0],ct=V[1],gt=V[2],st=V[3],Ct=V[4],xt=V[5],F=V[6],U=V[7],K=V[8],q=rt[0],Y=rt[1];return $[0]=lt,$[1]=ct,$[2]=gt,$[3]=st,$[4]=Ct,$[5]=xt,$[6]=q*lt+Y*st+F,$[7]=q*ct+Y*Ct+U,$[8]=q*gt+Y*xt+K,$;}function x($,V,rt){var lt=V[0],ct=V[1],gt=V[2],st=V[3],Ct=V[4],xt=V[5],F=V[6],U=V[7],K=V[8],q=Math.sin(rt),Y=Math.cos(rt);return $[0]=Y*lt+q*st,$[1]=Y*ct+q*Ct,$[2]=Y*gt+q*xt,$[3]=Y*st-q*lt,$[4]=Y*Ct-q*ct,$[5]=Y*xt-q*gt,$[6]=F,$[7]=U,$[8]=K,$;}function h($,V,rt){var lt=rt[0],ct=rt[1];return $[0]=lt*V[0],$[1]=lt*V[1],$[2]=lt*V[2],$[3]=ct*V[3],$[4]=ct*V[4],$[5]=ct*V[5],$[6]=V[6],$[7]=V[7],$[8]=V[8],$;}function p($,V){return $[0]=1,$[1]=0,$[2]=0,$[3]=0,$[4]=1,$[5]=0,$[6]=V[0],$[7]=V[1],$[8]=1,$;}function d($,V){var rt=Math.sin(V),lt=Math.cos(V);return $[0]=lt,$[1]=rt,$[2]=0,$[3]=-rt,$[4]=lt,$[5]=0,$[6]=0,$[7]=0,$[8]=1,$;}function g($,V){return $[0]=V[0],$[1]=0,$[2]=0,$[3]=0,$[4]=V[1],$[5]=0,$[6]=0,$[7]=0,$[8]=1,$;}function O($,V){return $[0]=V[0],$[1]=V[1],$[2]=0,$[3]=V[2],$[4]=V[3],$[5]=0,$[6]=V[4],$[7]=V[5],$[8]=1,$;}function w($,V){var rt=V[0],lt=V[1],ct=V[2],gt=V[3],st=rt+rt,Ct=lt+lt,xt=ct+ct,F=rt*st,U=lt*st,K=lt*Ct,q=ct*st,Y=ct*Ct,k=ct*xt,C=gt*st,M=gt*Ct,j=gt*xt;return $[0]=1-K-k,$[3]=U-j,$[6]=q+M,$[1]=U+j,$[4]=1-F-k,$[7]=Y-C,$[2]=q-M,$[5]=Y+C,$[8]=1-F-K,$;}function L($,V){var rt=V[0],lt=V[1],ct=V[2],gt=V[3],st=V[4],Ct=V[5],xt=V[6],F=V[7],U=V[8],K=V[9],q=V[10],Y=V[11],k=V[12],C=V[13],M=V[14],j=V[15],G=rt*Ct-lt*st,Q=rt*xt-ct*st,_=rt*F-gt*st,nt=lt*xt-ct*Ct,ut=lt*F-gt*Ct,mt=ct*F-gt*xt,Pt=U*C-K*k,Tt=U*M-q*k,yt=U*j-Y*k,vt=K*M-q*C,St=K*j-Y*C,Mt=q*j-Y*M,wt=G*Mt-Q*St+_*vt+nt*yt-ut*Tt+mt*Pt;return wt?(wt=1/wt,$[0]=(Ct*Mt-xt*St+F*vt)*wt,$[1]=(xt*yt-st*Mt-F*Tt)*wt,$[2]=(st*St-Ct*yt+F*Pt)*wt,$[3]=(ct*St-lt*Mt-gt*vt)*wt,$[4]=(rt*Mt-ct*yt+gt*Tt)*wt,$[5]=(lt*yt-rt*St-gt*Pt)*wt,$[6]=(C*mt-M*ut+j*nt)*wt,$[7]=(M*_-k*mt-j*Q)*wt,$[8]=(k*ut-C*_+j*G)*wt,$):null;}function B($,V,rt){return $[0]=2/V,$[1]=0,$[2]=0,$[3]=0,$[4]=-2/rt,$[5]=0,$[6]=-1,$[7]=1,$[8]=1,$;}function A($){return"mat3("+$[0]+", "+$[1]+", "+$[2]+", "+$[3]+", "+$[4]+", "+$[5]+", "+$[6]+", "+$[7]+", "+$[8]+")";}function b($){return Math.hypot($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8]);}function W($,V,rt){return $[0]=V[0]+rt[0],$[1]=V[1]+rt[1],$[2]=V[2]+rt[2],$[3]=V[3]+rt[3],$[4]=V[4]+rt[4],$[5]=V[5]+rt[5],$[6]=V[6]+rt[6],$[7]=V[7]+rt[7],$[8]=V[8]+rt[8],$;}function D($,V,rt){return $[0]=V[0]-rt[0],$[1]=V[1]-rt[1],$[2]=V[2]-rt[2],$[3]=V[3]-rt[3],$[4]=V[4]-rt[4],$[5]=V[5]-rt[5],$[6]=V[6]-rt[6],$[7]=V[7]-rt[7],$[8]=V[8]-rt[8],$;}function R($,V,rt){return $[0]=V[0]*rt,$[1]=V[1]*rt,$[2]=V[2]*rt,$[3]=V[3]*rt,$[4]=V[4]*rt,$[5]=V[5]*rt,$[6]=V[6]*rt,$[7]=V[7]*rt,$[8]=V[8]*rt,$;}function X($,V,rt,lt){return $[0]=V[0]+rt[0]*lt,$[1]=V[1]+rt[1]*lt,$[2]=V[2]+rt[2]*lt,$[3]=V[3]+rt[3]*lt,$[4]=V[4]+rt[4]*lt,$[5]=V[5]+rt[5]*lt,$[6]=V[6]+rt[6]*lt,$[7]=V[7]+rt[7]*lt,$[8]=V[8]+rt[8]*lt,$;}function H($,V){return $[0]===V[0]&&$[1]===V[1]&&$[2]===V[2]&&$[3]===V[3]&&$[4]===V[4]&&$[5]===V[5]&&$[6]===V[6]&&$[7]===V[7]&&$[8]===V[8];}function J($,V){var rt=$[0],lt=$[1],ct=$[2],gt=$[3],st=$[4],Ct=$[5],xt=$[6],F=$[7],U=$[8],K=V[0],q=V[1],Y=V[2],k=V[3],C=V[4],M=V[5],j=V[6],G=V[7],Q=V[8];return Math.abs(rt-K)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(K))&&Math.abs(lt-q)<=r.EPSILON*Math.max(1,Math.abs(lt),Math.abs(q))&&Math.abs(ct-Y)<=r.EPSILON*Math.max(1,Math.abs(ct),Math.abs(Y))&&Math.abs(gt-k)<=r.EPSILON*Math.max(1,Math.abs(gt),Math.abs(k))&&Math.abs(st-C)<=r.EPSILON*Math.max(1,Math.abs(st),Math.abs(C))&&Math.abs(Ct-M)<=r.EPSILON*Math.max(1,Math.abs(Ct),Math.abs(M))&&Math.abs(xt-j)<=r.EPSILON*Math.max(1,Math.abs(xt),Math.abs(j))&&Math.abs(F-G)<=r.EPSILON*Math.max(1,Math.abs(F),Math.abs(G))&&Math.abs(U-Q)<=r.EPSILON*Math.max(1,Math.abs(U),Math.abs(Q));}var et=T,it=D;},/* 6 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"copy",function(){return l;}),t.d(e,"fromValues",function(){return o;}),t.d(e,"set",function(){return a;}),t.d(e,"identity",function(){return c;}),t.d(e,"transpose",function(){return m;}),t.d(e,"invert",function(){return f;}),t.d(e,"adjoint",function(){return v;}),t.d(e,"determinant",function(){return S;}),t.d(e,"multiply",function(){return E;}),t.d(e,"translate",function(){return T;}),t.d(e,"scale",function(){return P;}),t.d(e,"rotate",function(){return x;}),t.d(e,"rotateX",function(){return h;}),t.d(e,"rotateY",function(){return p;}),t.d(e,"rotateZ",function(){return d;}),t.d(e,"fromTranslation",function(){return g;}),t.d(e,"fromScaling",function(){return O;}),t.d(e,"fromRotation",function(){return w;}),t.d(e,"fromXRotation",function(){return L;}),t.d(e,"fromYRotation",function(){return B;}),t.d(e,"fromZRotation",function(){return A;}),t.d(e,"fromRotationTranslation",function(){return b;}),t.d(e,"fromQuat2",function(){return W;}),t.d(e,"getTranslation",function(){return D;}),t.d(e,"getScaling",function(){return R;}),t.d(e,"getRotation",function(){return X;}),t.d(e,"fromRotationTranslationScale",function(){return H;}),t.d(e,"fromRotationTranslationScaleOrigin",function(){return J;}),t.d(e,"fromQuat",function(){return et;}),t.d(e,"frustum",function(){return it;}),t.d(e,"perspective",function(){return $;}),t.d(e,"perspectiveFromFieldOfView",function(){return V;}),t.d(e,"ortho",function(){return rt;}),t.d(e,"lookAt",function(){return lt;}),t.d(e,"targetTo",function(){return ct;}),t.d(e,"str",function(){return gt;}),t.d(e,"frob",function(){return st;}),t.d(e,"add",function(){return Ct;}),t.d(e,"subtract",function(){return xt;}),t.d(e,"multiplyScalar",function(){return F;}),t.d(e,"multiplyScalarAndAdd",function(){return U;}),t.d(e,"exactEquals",function(){return K;}),t.d(e,"equals",function(){return q;}),t.d(e,"mul",function(){return Y;}),t.d(e,"sub",function(){return k;});var r=t(2);function n(){var C=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=0,C[12]=0,C[13]=0,C[14]=0),C[0]=1,C[5]=1,C[10]=1,C[15]=1,C;}function i(C){var M=new r.ARRAY_TYPE(16);return M[0]=C[0],M[1]=C[1],M[2]=C[2],M[3]=C[3],M[4]=C[4],M[5]=C[5],M[6]=C[6],M[7]=C[7],M[8]=C[8],M[9]=C[9],M[10]=C[10],M[11]=C[11],M[12]=C[12],M[13]=C[13],M[14]=C[14],M[15]=C[15],M;}function l(C,M){return C[0]=M[0],C[1]=M[1],C[2]=M[2],C[3]=M[3],C[4]=M[4],C[5]=M[5],C[6]=M[6],C[7]=M[7],C[8]=M[8],C[9]=M[9],C[10]=M[10],C[11]=M[11],C[12]=M[12],C[13]=M[13],C[14]=M[14],C[15]=M[15],C;}function o(C,M,j,G,Q,_,nt,ut,mt,Pt,Tt,yt,vt,St,Mt,wt){var Ot=new r.ARRAY_TYPE(16);return Ot[0]=C,Ot[1]=M,Ot[2]=j,Ot[3]=G,Ot[4]=Q,Ot[5]=_,Ot[6]=nt,Ot[7]=ut,Ot[8]=mt,Ot[9]=Pt,Ot[10]=Tt,Ot[11]=yt,Ot[12]=vt,Ot[13]=St,Ot[14]=Mt,Ot[15]=wt,Ot;}function a(C,M,j,G,Q,_,nt,ut,mt,Pt,Tt,yt,vt,St,Mt,wt,Ot){return C[0]=M,C[1]=j,C[2]=G,C[3]=Q,C[4]=_,C[5]=nt,C[6]=ut,C[7]=mt,C[8]=Pt,C[9]=Tt,C[10]=yt,C[11]=vt,C[12]=St,C[13]=Mt,C[14]=wt,C[15]=Ot,C;}function c(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function m(C,M){if(C===M){var j=M[1],G=M[2],Q=M[3],_=M[6],nt=M[7],ut=M[11];C[1]=M[4],C[2]=M[8],C[3]=M[12],C[4]=j,C[6]=M[9],C[7]=M[13],C[8]=G,C[9]=_,C[11]=M[14],C[12]=Q,C[13]=nt,C[14]=ut;}else C[0]=M[0],C[1]=M[4],C[2]=M[8],C[3]=M[12],C[4]=M[1],C[5]=M[5],C[6]=M[9],C[7]=M[13],C[8]=M[2],C[9]=M[6],C[10]=M[10],C[11]=M[14],C[12]=M[3],C[13]=M[7],C[14]=M[11],C[15]=M[15];return C;}function f(C,M){var j=M[0],G=M[1],Q=M[2],_=M[3],nt=M[4],ut=M[5],mt=M[6],Pt=M[7],Tt=M[8],yt=M[9],vt=M[10],St=M[11],Mt=M[12],wt=M[13],Ot=M[14],Bt=M[15],Gt=j*ut-G*nt,jt=j*mt-Q*nt,Ut=j*Pt-_*nt,zt=G*mt-Q*ut,Xt=G*Pt-_*ut,ae=Q*Pt-_*mt,ie=Tt*wt-yt*Mt,se=Tt*Ot-vt*Mt,oe=Tt*Bt-St*Mt,le=yt*Ot-vt*wt,ce=yt*Bt-St*wt,fe=vt*Bt-St*Ot,Jt=Gt*fe-jt*ce+Ut*le+zt*oe-Xt*se+ae*ie;return Jt?(Jt=1/Jt,C[0]=(ut*fe-mt*ce+Pt*le)*Jt,C[1]=(Q*ce-G*fe-_*le)*Jt,C[2]=(wt*ae-Ot*Xt+Bt*zt)*Jt,C[3]=(vt*Xt-yt*ae-St*zt)*Jt,C[4]=(mt*oe-nt*fe-Pt*se)*Jt,C[5]=(j*fe-Q*oe+_*se)*Jt,C[6]=(Ot*Ut-Mt*ae-Bt*jt)*Jt,C[7]=(Tt*ae-vt*Ut+St*jt)*Jt,C[8]=(nt*ce-ut*oe+Pt*ie)*Jt,C[9]=(G*oe-j*ce-_*ie)*Jt,C[10]=(Mt*Xt-wt*Ut+Bt*Gt)*Jt,C[11]=(yt*Ut-Tt*Xt-St*Gt)*Jt,C[12]=(ut*se-nt*le-mt*ie)*Jt,C[13]=(j*le-G*se+Q*ie)*Jt,C[14]=(wt*jt-Mt*zt-Ot*Gt)*Jt,C[15]=(Tt*zt-yt*jt+vt*Gt)*Jt,C):null;}function v(C,M){var j=M[0],G=M[1],Q=M[2],_=M[3],nt=M[4],ut=M[5],mt=M[6],Pt=M[7],Tt=M[8],yt=M[9],vt=M[10],St=M[11],Mt=M[12],wt=M[13],Ot=M[14],Bt=M[15];return C[0]=ut*(vt*Bt-St*Ot)-yt*(mt*Bt-Pt*Ot)+wt*(mt*St-Pt*vt),C[1]=-(G*(vt*Bt-St*Ot)-yt*(Q*Bt-_*Ot)+wt*(Q*St-_*vt)),C[2]=G*(mt*Bt-Pt*Ot)-ut*(Q*Bt-_*Ot)+wt*(Q*Pt-_*mt),C[3]=-(G*(mt*St-Pt*vt)-ut*(Q*St-_*vt)+yt*(Q*Pt-_*mt)),C[4]=-(nt*(vt*Bt-St*Ot)-Tt*(mt*Bt-Pt*Ot)+Mt*(mt*St-Pt*vt)),C[5]=j*(vt*Bt-St*Ot)-Tt*(Q*Bt-_*Ot)+Mt*(Q*St-_*vt),C[6]=-(j*(mt*Bt-Pt*Ot)-nt*(Q*Bt-_*Ot)+Mt*(Q*Pt-_*mt)),C[7]=j*(mt*St-Pt*vt)-nt*(Q*St-_*vt)+Tt*(Q*Pt-_*mt),C[8]=nt*(yt*Bt-St*wt)-Tt*(ut*Bt-Pt*wt)+Mt*(ut*St-Pt*yt),C[9]=-(j*(yt*Bt-St*wt)-Tt*(G*Bt-_*wt)+Mt*(G*St-_*yt)),C[10]=j*(ut*Bt-Pt*wt)-nt*(G*Bt-_*wt)+Mt*(G*Pt-_*ut),C[11]=-(j*(ut*St-Pt*yt)-nt*(G*St-_*yt)+Tt*(G*Pt-_*ut)),C[12]=-(nt*(yt*Ot-vt*wt)-Tt*(ut*Ot-mt*wt)+Mt*(ut*vt-mt*yt)),C[13]=j*(yt*Ot-vt*wt)-Tt*(G*Ot-Q*wt)+Mt*(G*vt-Q*yt),C[14]=-(j*(ut*Ot-mt*wt)-nt*(G*Ot-Q*wt)+Mt*(G*mt-Q*ut)),C[15]=j*(ut*vt-mt*yt)-nt*(G*vt-Q*yt)+Tt*(G*mt-Q*ut),C;}function S(C){var M=C[0],j=C[1],G=C[2],Q=C[3],_=C[4],nt=C[5],ut=C[6],mt=C[7],Pt=C[8],Tt=C[9],yt=C[10],vt=C[11],St=C[12],Mt=C[13],wt=C[14],Ot=C[15],Bt=M*nt-j*_,Gt=M*ut-G*_,jt=M*mt-Q*_,Ut=j*ut-G*nt,zt=j*mt-Q*nt,Xt=G*mt-Q*ut,ae=Pt*Mt-Tt*St,ie=Pt*wt-yt*St,se=Pt*Ot-vt*St,oe=Tt*wt-yt*Mt,le=Tt*Ot-vt*Mt,ce=yt*Ot-vt*wt;return Bt*ce-Gt*le+jt*oe+Ut*se-zt*ie+Xt*ae;}function E(C,M,j){var G=M[0],Q=M[1],_=M[2],nt=M[3],ut=M[4],mt=M[5],Pt=M[6],Tt=M[7],yt=M[8],vt=M[9],St=M[10],Mt=M[11],wt=M[12],Ot=M[13],Bt=M[14],Gt=M[15],jt=j[0],Ut=j[1],zt=j[2],Xt=j[3];return C[0]=jt*G+Ut*ut+zt*yt+Xt*wt,C[1]=jt*Q+Ut*mt+zt*vt+Xt*Ot,C[2]=jt*_+Ut*Pt+zt*St+Xt*Bt,C[3]=jt*nt+Ut*Tt+zt*Mt+Xt*Gt,jt=j[4],Ut=j[5],zt=j[6],Xt=j[7],C[4]=jt*G+Ut*ut+zt*yt+Xt*wt,C[5]=jt*Q+Ut*mt+zt*vt+Xt*Ot,C[6]=jt*_+Ut*Pt+zt*St+Xt*Bt,C[7]=jt*nt+Ut*Tt+zt*Mt+Xt*Gt,jt=j[8],Ut=j[9],zt=j[10],Xt=j[11],C[8]=jt*G+Ut*ut+zt*yt+Xt*wt,C[9]=jt*Q+Ut*mt+zt*vt+Xt*Ot,C[10]=jt*_+Ut*Pt+zt*St+Xt*Bt,C[11]=jt*nt+Ut*Tt+zt*Mt+Xt*Gt,jt=j[12],Ut=j[13],zt=j[14],Xt=j[15],C[12]=jt*G+Ut*ut+zt*yt+Xt*wt,C[13]=jt*Q+Ut*mt+zt*vt+Xt*Ot,C[14]=jt*_+Ut*Pt+zt*St+Xt*Bt,C[15]=jt*nt+Ut*Tt+zt*Mt+Xt*Gt,C;}function T(C,M,j){var G=j[0],Q=j[1],_=j[2],nt,ut,mt,Pt,Tt,yt,vt,St,Mt,wt,Ot,Bt;return M===C?(C[12]=M[0]*G+M[4]*Q+M[8]*_+M[12],C[13]=M[1]*G+M[5]*Q+M[9]*_+M[13],C[14]=M[2]*G+M[6]*Q+M[10]*_+M[14],C[15]=M[3]*G+M[7]*Q+M[11]*_+M[15]):(nt=M[0],ut=M[1],mt=M[2],Pt=M[3],Tt=M[4],yt=M[5],vt=M[6],St=M[7],Mt=M[8],wt=M[9],Ot=M[10],Bt=M[11],C[0]=nt,C[1]=ut,C[2]=mt,C[3]=Pt,C[4]=Tt,C[5]=yt,C[6]=vt,C[7]=St,C[8]=Mt,C[9]=wt,C[10]=Ot,C[11]=Bt,C[12]=nt*G+Tt*Q+Mt*_+M[12],C[13]=ut*G+yt*Q+wt*_+M[13],C[14]=mt*G+vt*Q+Ot*_+M[14],C[15]=Pt*G+St*Q+Bt*_+M[15]),C;}function P(C,M,j){var G=j[0],Q=j[1],_=j[2];return C[0]=M[0]*G,C[1]=M[1]*G,C[2]=M[2]*G,C[3]=M[3]*G,C[4]=M[4]*Q,C[5]=M[5]*Q,C[6]=M[6]*Q,C[7]=M[7]*Q,C[8]=M[8]*_,C[9]=M[9]*_,C[10]=M[10]*_,C[11]=M[11]*_,C[12]=M[12],C[13]=M[13],C[14]=M[14],C[15]=M[15],C;}function x(C,M,j,G){var Q=G[0],_=G[1],nt=G[2],ut=Math.hypot(Q,_,nt),mt,Pt,Tt,yt,vt,St,Mt,wt,Ot,Bt,Gt,jt,Ut,zt,Xt,ae,ie,se,oe,le,ce,fe,Jt,Se;return ut<r.EPSILON?null:(ut=1/ut,Q*=ut,_*=ut,nt*=ut,mt=Math.sin(j),Pt=Math.cos(j),Tt=1-Pt,yt=M[0],vt=M[1],St=M[2],Mt=M[3],wt=M[4],Ot=M[5],Bt=M[6],Gt=M[7],jt=M[8],Ut=M[9],zt=M[10],Xt=M[11],ae=Q*Q*Tt+Pt,ie=_*Q*Tt+nt*mt,se=nt*Q*Tt-_*mt,oe=Q*_*Tt-nt*mt,le=_*_*Tt+Pt,ce=nt*_*Tt+Q*mt,fe=Q*nt*Tt+_*mt,Jt=_*nt*Tt-Q*mt,Se=nt*nt*Tt+Pt,C[0]=yt*ae+wt*ie+jt*se,C[1]=vt*ae+Ot*ie+Ut*se,C[2]=St*ae+Bt*ie+zt*se,C[3]=Mt*ae+Gt*ie+Xt*se,C[4]=yt*oe+wt*le+jt*ce,C[5]=vt*oe+Ot*le+Ut*ce,C[6]=St*oe+Bt*le+zt*ce,C[7]=Mt*oe+Gt*le+Xt*ce,C[8]=yt*fe+wt*Jt+jt*Se,C[9]=vt*fe+Ot*Jt+Ut*Se,C[10]=St*fe+Bt*Jt+zt*Se,C[11]=Mt*fe+Gt*Jt+Xt*Se,M!==C&&(C[12]=M[12],C[13]=M[13],C[14]=M[14],C[15]=M[15]),C);}function h(C,M,j){var G=Math.sin(j),Q=Math.cos(j),_=M[4],nt=M[5],ut=M[6],mt=M[7],Pt=M[8],Tt=M[9],yt=M[10],vt=M[11];return M!==C&&(C[0]=M[0],C[1]=M[1],C[2]=M[2],C[3]=M[3],C[12]=M[12],C[13]=M[13],C[14]=M[14],C[15]=M[15]),C[4]=_*Q+Pt*G,C[5]=nt*Q+Tt*G,C[6]=ut*Q+yt*G,C[7]=mt*Q+vt*G,C[8]=Pt*Q-_*G,C[9]=Tt*Q-nt*G,C[10]=yt*Q-ut*G,C[11]=vt*Q-mt*G,C;}function p(C,M,j){var G=Math.sin(j),Q=Math.cos(j),_=M[0],nt=M[1],ut=M[2],mt=M[3],Pt=M[8],Tt=M[9],yt=M[10],vt=M[11];return M!==C&&(C[4]=M[4],C[5]=M[5],C[6]=M[6],C[7]=M[7],C[12]=M[12],C[13]=M[13],C[14]=M[14],C[15]=M[15]),C[0]=_*Q-Pt*G,C[1]=nt*Q-Tt*G,C[2]=ut*Q-yt*G,C[3]=mt*Q-vt*G,C[8]=_*G+Pt*Q,C[9]=nt*G+Tt*Q,C[10]=ut*G+yt*Q,C[11]=mt*G+vt*Q,C;}function d(C,M,j){var G=Math.sin(j),Q=Math.cos(j),_=M[0],nt=M[1],ut=M[2],mt=M[3],Pt=M[4],Tt=M[5],yt=M[6],vt=M[7];return M!==C&&(C[8]=M[8],C[9]=M[9],C[10]=M[10],C[11]=M[11],C[12]=M[12],C[13]=M[13],C[14]=M[14],C[15]=M[15]),C[0]=_*Q+Pt*G,C[1]=nt*Q+Tt*G,C[2]=ut*Q+yt*G,C[3]=mt*Q+vt*G,C[4]=Pt*Q-_*G,C[5]=Tt*Q-nt*G,C[6]=yt*Q-ut*G,C[7]=vt*Q-mt*G,C;}function g(C,M){return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=M[0],C[13]=M[1],C[14]=M[2],C[15]=1,C;}function O(C,M){return C[0]=M[0],C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=M[1],C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=M[2],C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function w(C,M,j){var G=j[0],Q=j[1],_=j[2],nt=Math.hypot(G,Q,_),ut,mt,Pt;return nt<r.EPSILON?null:(nt=1/nt,G*=nt,Q*=nt,_*=nt,ut=Math.sin(M),mt=Math.cos(M),Pt=1-mt,C[0]=G*G*Pt+mt,C[1]=Q*G*Pt+_*ut,C[2]=_*G*Pt-Q*ut,C[3]=0,C[4]=G*Q*Pt-_*ut,C[5]=Q*Q*Pt+mt,C[6]=_*Q*Pt+G*ut,C[7]=0,C[8]=G*_*Pt+Q*ut,C[9]=Q*_*Pt-G*ut,C[10]=_*_*Pt+mt,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C);}function L(C,M){var j=Math.sin(M),G=Math.cos(M);return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=G,C[6]=j,C[7]=0,C[8]=0,C[9]=-j,C[10]=G,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function B(C,M){var j=Math.sin(M),G=Math.cos(M);return C[0]=G,C[1]=0,C[2]=-j,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=j,C[9]=0,C[10]=G,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function A(C,M){var j=Math.sin(M),G=Math.cos(M);return C[0]=G,C[1]=j,C[2]=0,C[3]=0,C[4]=-j,C[5]=G,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function b(C,M,j){var G=M[0],Q=M[1],_=M[2],nt=M[3],ut=G+G,mt=Q+Q,Pt=_+_,Tt=G*ut,yt=G*mt,vt=G*Pt,St=Q*mt,Mt=Q*Pt,wt=_*Pt,Ot=nt*ut,Bt=nt*mt,Gt=nt*Pt;return C[0]=1-(St+wt),C[1]=yt+Gt,C[2]=vt-Bt,C[3]=0,C[4]=yt-Gt,C[5]=1-(Tt+wt),C[6]=Mt+Ot,C[7]=0,C[8]=vt+Bt,C[9]=Mt-Ot,C[10]=1-(Tt+St),C[11]=0,C[12]=j[0],C[13]=j[1],C[14]=j[2],C[15]=1,C;}function W(C,M){var j=new r.ARRAY_TYPE(3),G=-M[0],Q=-M[1],_=-M[2],nt=M[3],ut=M[4],mt=M[5],Pt=M[6],Tt=M[7],yt=G*G+Q*Q+_*_+nt*nt;return yt>0?(j[0]=(ut*nt+Tt*G+mt*_-Pt*Q)*2/yt,j[1]=(mt*nt+Tt*Q+Pt*G-ut*_)*2/yt,j[2]=(Pt*nt+Tt*_+ut*Q-mt*G)*2/yt):(j[0]=(ut*nt+Tt*G+mt*_-Pt*Q)*2,j[1]=(mt*nt+Tt*Q+Pt*G-ut*_)*2,j[2]=(Pt*nt+Tt*_+ut*Q-mt*G)*2),b(C,M,j),C;}function D(C,M){return C[0]=M[12],C[1]=M[13],C[2]=M[14],C;}function R(C,M){var j=M[0],G=M[1],Q=M[2],_=M[4],nt=M[5],ut=M[6],mt=M[8],Pt=M[9],Tt=M[10];return C[0]=Math.hypot(j,G,Q),C[1]=Math.hypot(_,nt,ut),C[2]=Math.hypot(mt,Pt,Tt),C;}function X(C,M){var j=new r.ARRAY_TYPE(3);R(j,M);var G=1/j[0],Q=1/j[1],_=1/j[2],nt=M[0]*G,ut=M[1]*Q,mt=M[2]*_,Pt=M[4]*G,Tt=M[5]*Q,yt=M[6]*_,vt=M[8]*G,St=M[9]*Q,Mt=M[10]*_,wt=nt+Tt+Mt,Ot=0;return wt>0?(Ot=Math.sqrt(wt+1)*2,C[3]=0.25*Ot,C[0]=(yt-St)/Ot,C[1]=(vt-mt)/Ot,C[2]=(ut-Pt)/Ot):nt>Tt&&nt>Mt?(Ot=Math.sqrt(1+nt-Tt-Mt)*2,C[3]=(yt-St)/Ot,C[0]=0.25*Ot,C[1]=(ut+Pt)/Ot,C[2]=(vt+mt)/Ot):Tt>Mt?(Ot=Math.sqrt(1+Tt-nt-Mt)*2,C[3]=(vt-mt)/Ot,C[0]=(ut+Pt)/Ot,C[1]=0.25*Ot,C[2]=(yt+St)/Ot):(Ot=Math.sqrt(1+Mt-nt-Tt)*2,C[3]=(ut-Pt)/Ot,C[0]=(vt+mt)/Ot,C[1]=(yt+St)/Ot,C[2]=0.25*Ot),C;}function H(C,M,j,G){var Q=M[0],_=M[1],nt=M[2],ut=M[3],mt=Q+Q,Pt=_+_,Tt=nt+nt,yt=Q*mt,vt=Q*Pt,St=Q*Tt,Mt=_*Pt,wt=_*Tt,Ot=nt*Tt,Bt=ut*mt,Gt=ut*Pt,jt=ut*Tt,Ut=G[0],zt=G[1],Xt=G[2];return C[0]=(1-(Mt+Ot))*Ut,C[1]=(vt+jt)*Ut,C[2]=(St-Gt)*Ut,C[3]=0,C[4]=(vt-jt)*zt,C[5]=(1-(yt+Ot))*zt,C[6]=(wt+Bt)*zt,C[7]=0,C[8]=(St+Gt)*Xt,C[9]=(wt-Bt)*Xt,C[10]=(1-(yt+Mt))*Xt,C[11]=0,C[12]=j[0],C[13]=j[1],C[14]=j[2],C[15]=1,C;}function J(C,M,j,G,Q){var _=M[0],nt=M[1],ut=M[2],mt=M[3],Pt=_+_,Tt=nt+nt,yt=ut+ut,vt=_*Pt,St=_*Tt,Mt=_*yt,wt=nt*Tt,Ot=nt*yt,Bt=ut*yt,Gt=mt*Pt,jt=mt*Tt,Ut=mt*yt,zt=G[0],Xt=G[1],ae=G[2],ie=Q[0],se=Q[1],oe=Q[2],le=(1-(wt+Bt))*zt,ce=(St+Ut)*zt,fe=(Mt-jt)*zt,Jt=(St-Ut)*Xt,Se=(1-(vt+Bt))*Xt,Be=(Ot+Gt)*Xt,We=(Mt+jt)*ae,mr=(Ot-Gt)*ae,vr=(1-(vt+wt))*ae;return C[0]=le,C[1]=ce,C[2]=fe,C[3]=0,C[4]=Jt,C[5]=Se,C[6]=Be,C[7]=0,C[8]=We,C[9]=mr,C[10]=vr,C[11]=0,C[12]=j[0]+ie-(le*ie+Jt*se+We*oe),C[13]=j[1]+se-(ce*ie+Se*se+mr*oe),C[14]=j[2]+oe-(fe*ie+Be*se+vr*oe),C[15]=1,C;}function et(C,M){var j=M[0],G=M[1],Q=M[2],_=M[3],nt=j+j,ut=G+G,mt=Q+Q,Pt=j*nt,Tt=G*nt,yt=G*ut,vt=Q*nt,St=Q*ut,Mt=Q*mt,wt=_*nt,Ot=_*ut,Bt=_*mt;return C[0]=1-yt-Mt,C[1]=Tt+Bt,C[2]=vt-Ot,C[3]=0,C[4]=Tt-Bt,C[5]=1-Pt-Mt,C[6]=St+wt,C[7]=0,C[8]=vt+Ot,C[9]=St-wt,C[10]=1-Pt-yt,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function it(C,M,j,G,Q,_,nt){var ut=1/(j-M),mt=1/(Q-G),Pt=1/(_-nt);return C[0]=_*2*ut,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=_*2*mt,C[6]=0,C[7]=0,C[8]=(j+M)*ut,C[9]=(Q+G)*mt,C[10]=(nt+_)*Pt,C[11]=-1,C[12]=0,C[13]=0,C[14]=nt*_*2*Pt,C[15]=0,C;}function $(C,M,j,G,Q){var _=1/Math.tan(M/2),nt;return C[0]=_/j,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=_,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=-1,C[12]=0,C[13]=0,C[15]=0,Q!=null&&Q!==1/0?(nt=1/(G-Q),C[10]=(Q+G)*nt,C[14]=2*Q*G*nt):(C[10]=-1,C[14]=-2*G),C;}function V(C,M,j,G){var Q=Math.tan(M.upDegrees*Math.PI/180),_=Math.tan(M.downDegrees*Math.PI/180),nt=Math.tan(M.leftDegrees*Math.PI/180),ut=Math.tan(M.rightDegrees*Math.PI/180),mt=2/(nt+ut),Pt=2/(Q+_);return C[0]=mt,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=Pt,C[6]=0,C[7]=0,C[8]=-((nt-ut)*mt*0.5),C[9]=(Q-_)*Pt*0.5,C[10]=G/(j-G),C[11]=-1,C[12]=0,C[13]=0,C[14]=G*j/(j-G),C[15]=0,C;}function rt(C,M,j,G,Q,_,nt){var ut=1/(M-j),mt=1/(G-Q),Pt=1/(_-nt);return C[0]=-2*ut,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=-2*mt,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=2*Pt,C[11]=0,C[12]=(M+j)*ut,C[13]=(Q+G)*mt,C[14]=(nt+_)*Pt,C[15]=1,C;}function lt(C,M,j,G){var Q,_,nt,ut,mt,Pt,Tt,yt,vt,St,Mt=M[0],wt=M[1],Ot=M[2],Bt=G[0],Gt=G[1],jt=G[2],Ut=j[0],zt=j[1],Xt=j[2];return Math.abs(Mt-Ut)<r.EPSILON&&Math.abs(wt-zt)<r.EPSILON&&Math.abs(Ot-Xt)<r.EPSILON?c(C):(Tt=Mt-Ut,yt=wt-zt,vt=Ot-Xt,St=1/Math.hypot(Tt,yt,vt),Tt*=St,yt*=St,vt*=St,Q=Gt*vt-jt*yt,_=jt*Tt-Bt*vt,nt=Bt*yt-Gt*Tt,St=Math.hypot(Q,_,nt),St?(St=1/St,Q*=St,_*=St,nt*=St):(Q=0,_=0,nt=0),ut=yt*nt-vt*_,mt=vt*Q-Tt*nt,Pt=Tt*_-yt*Q,St=Math.hypot(ut,mt,Pt),St?(St=1/St,ut*=St,mt*=St,Pt*=St):(ut=0,mt=0,Pt=0),C[0]=Q,C[1]=ut,C[2]=Tt,C[3]=0,C[4]=_,C[5]=mt,C[6]=yt,C[7]=0,C[8]=nt,C[9]=Pt,C[10]=vt,C[11]=0,C[12]=-(Q*Mt+_*wt+nt*Ot),C[13]=-(ut*Mt+mt*wt+Pt*Ot),C[14]=-(Tt*Mt+yt*wt+vt*Ot),C[15]=1,C);}function ct(C,M,j,G){var Q=M[0],_=M[1],nt=M[2],ut=G[0],mt=G[1],Pt=G[2],Tt=Q-j[0],yt=_-j[1],vt=nt-j[2],St=Tt*Tt+yt*yt+vt*vt;St>0&&(St=1/Math.sqrt(St),Tt*=St,yt*=St,vt*=St);var Mt=mt*vt-Pt*yt,wt=Pt*Tt-ut*vt,Ot=ut*yt-mt*Tt;return St=Mt*Mt+wt*wt+Ot*Ot,St>0&&(St=1/Math.sqrt(St),Mt*=St,wt*=St,Ot*=St),C[0]=Mt,C[1]=wt,C[2]=Ot,C[3]=0,C[4]=yt*Ot-vt*wt,C[5]=vt*Mt-Tt*Ot,C[6]=Tt*wt-yt*Mt,C[7]=0,C[8]=Tt,C[9]=yt,C[10]=vt,C[11]=0,C[12]=Q,C[13]=_,C[14]=nt,C[15]=1,C;}function gt(C){return"mat4("+C[0]+", "+C[1]+", "+C[2]+", "+C[3]+", "+C[4]+", "+C[5]+", "+C[6]+", "+C[7]+", "+C[8]+", "+C[9]+", "+C[10]+", "+C[11]+", "+C[12]+", "+C[13]+", "+C[14]+", "+C[15]+")";}function st(C){return Math.hypot(C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],C[8],C[9],C[10],C[11],C[12],C[13],C[14],C[15]);}function Ct(C,M,j){return C[0]=M[0]+j[0],C[1]=M[1]+j[1],C[2]=M[2]+j[2],C[3]=M[3]+j[3],C[4]=M[4]+j[4],C[5]=M[5]+j[5],C[6]=M[6]+j[6],C[7]=M[7]+j[7],C[8]=M[8]+j[8],C[9]=M[9]+j[9],C[10]=M[10]+j[10],C[11]=M[11]+j[11],C[12]=M[12]+j[12],C[13]=M[13]+j[13],C[14]=M[14]+j[14],C[15]=M[15]+j[15],C;}function xt(C,M,j){return C[0]=M[0]-j[0],C[1]=M[1]-j[1],C[2]=M[2]-j[2],C[3]=M[3]-j[3],C[4]=M[4]-j[4],C[5]=M[5]-j[5],C[6]=M[6]-j[6],C[7]=M[7]-j[7],C[8]=M[8]-j[8],C[9]=M[9]-j[9],C[10]=M[10]-j[10],C[11]=M[11]-j[11],C[12]=M[12]-j[12],C[13]=M[13]-j[13],C[14]=M[14]-j[14],C[15]=M[15]-j[15],C;}function F(C,M,j){return C[0]=M[0]*j,C[1]=M[1]*j,C[2]=M[2]*j,C[3]=M[3]*j,C[4]=M[4]*j,C[5]=M[5]*j,C[6]=M[6]*j,C[7]=M[7]*j,C[8]=M[8]*j,C[9]=M[9]*j,C[10]=M[10]*j,C[11]=M[11]*j,C[12]=M[12]*j,C[13]=M[13]*j,C[14]=M[14]*j,C[15]=M[15]*j,C;}function U(C,M,j,G){return C[0]=M[0]+j[0]*G,C[1]=M[1]+j[1]*G,C[2]=M[2]+j[2]*G,C[3]=M[3]+j[3]*G,C[4]=M[4]+j[4]*G,C[5]=M[5]+j[5]*G,C[6]=M[6]+j[6]*G,C[7]=M[7]+j[7]*G,C[8]=M[8]+j[8]*G,C[9]=M[9]+j[9]*G,C[10]=M[10]+j[10]*G,C[11]=M[11]+j[11]*G,C[12]=M[12]+j[12]*G,C[13]=M[13]+j[13]*G,C[14]=M[14]+j[14]*G,C[15]=M[15]+j[15]*G,C;}function K(C,M){return C[0]===M[0]&&C[1]===M[1]&&C[2]===M[2]&&C[3]===M[3]&&C[4]===M[4]&&C[5]===M[5]&&C[6]===M[6]&&C[7]===M[7]&&C[8]===M[8]&&C[9]===M[9]&&C[10]===M[10]&&C[11]===M[11]&&C[12]===M[12]&&C[13]===M[13]&&C[14]===M[14]&&C[15]===M[15];}function q(C,M){var j=C[0],G=C[1],Q=C[2],_=C[3],nt=C[4],ut=C[5],mt=C[6],Pt=C[7],Tt=C[8],yt=C[9],vt=C[10],St=C[11],Mt=C[12],wt=C[13],Ot=C[14],Bt=C[15],Gt=M[0],jt=M[1],Ut=M[2],zt=M[3],Xt=M[4],ae=M[5],ie=M[6],se=M[7],oe=M[8],le=M[9],ce=M[10],fe=M[11],Jt=M[12],Se=M[13],Be=M[14],We=M[15];return Math.abs(j-Gt)<=r.EPSILON*Math.max(1,Math.abs(j),Math.abs(Gt))&&Math.abs(G-jt)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(jt))&&Math.abs(Q-Ut)<=r.EPSILON*Math.max(1,Math.abs(Q),Math.abs(Ut))&&Math.abs(_-zt)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(zt))&&Math.abs(nt-Xt)<=r.EPSILON*Math.max(1,Math.abs(nt),Math.abs(Xt))&&Math.abs(ut-ae)<=r.EPSILON*Math.max(1,Math.abs(ut),Math.abs(ae))&&Math.abs(mt-ie)<=r.EPSILON*Math.max(1,Math.abs(mt),Math.abs(ie))&&Math.abs(Pt-se)<=r.EPSILON*Math.max(1,Math.abs(Pt),Math.abs(se))&&Math.abs(Tt-oe)<=r.EPSILON*Math.max(1,Math.abs(Tt),Math.abs(oe))&&Math.abs(yt-le)<=r.EPSILON*Math.max(1,Math.abs(yt),Math.abs(le))&&Math.abs(vt-ce)<=r.EPSILON*Math.max(1,Math.abs(vt),Math.abs(ce))&&Math.abs(St-fe)<=r.EPSILON*Math.max(1,Math.abs(St),Math.abs(fe))&&Math.abs(Mt-Jt)<=r.EPSILON*Math.max(1,Math.abs(Mt),Math.abs(Jt))&&Math.abs(wt-Se)<=r.EPSILON*Math.max(1,Math.abs(wt),Math.abs(Se))&&Math.abs(Ot-Be)<=r.EPSILON*Math.max(1,Math.abs(Ot),Math.abs(Be))&&Math.abs(Bt-We)<=r.EPSILON*Math.max(1,Math.abs(Bt),Math.abs(We));}var Y=E,k=xt;},/* 7 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return o;}),t.d(e,"identity",function(){return a;}),t.d(e,"setAxisAngle",function(){return c;}),t.d(e,"getAxisAngle",function(){return m;}),t.d(e,"getAngle",function(){return f;}),t.d(e,"multiply",function(){return v;}),t.d(e,"rotateX",function(){return S;}),t.d(e,"rotateY",function(){return E;}),t.d(e,"rotateZ",function(){return T;}),t.d(e,"calculateW",function(){return P;}),t.d(e,"exp",function(){return x;}),t.d(e,"ln",function(){return h;}),t.d(e,"pow",function(){return p;}),t.d(e,"slerp",function(){return d;}),t.d(e,"random",function(){return g;}),t.d(e,"invert",function(){return O;}),t.d(e,"conjugate",function(){return w;}),t.d(e,"fromMat3",function(){return L;}),t.d(e,"fromEuler",function(){return B;}),t.d(e,"str",function(){return A;}),t.d(e,"clone",function(){return b;}),t.d(e,"fromValues",function(){return W;}),t.d(e,"copy",function(){return D;}),t.d(e,"set",function(){return R;}),t.d(e,"add",function(){return X;}),t.d(e,"mul",function(){return H;}),t.d(e,"scale",function(){return J;}),t.d(e,"dot",function(){return et;}),t.d(e,"lerp",function(){return it;}),t.d(e,"length",function(){return $;}),t.d(e,"len",function(){return V;}),t.d(e,"squaredLength",function(){return rt;}),t.d(e,"sqrLen",function(){return lt;}),t.d(e,"normalize",function(){return ct;}),t.d(e,"exactEquals",function(){return gt;}),t.d(e,"equals",function(){return st;}),t.d(e,"rotationTo",function(){return Ct;}),t.d(e,"sqlerp",function(){return xt;}),t.d(e,"setAxes",function(){return F;});var r=t(2),n=t(5),i=t(8),l=t(9);function o(){var U=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(U[0]=0,U[1]=0,U[2]=0),U[3]=1,U;}function a(U){return U[0]=0,U[1]=0,U[2]=0,U[3]=1,U;}function c(U,K,q){q=q*0.5;var Y=Math.sin(q);return U[0]=Y*K[0],U[1]=Y*K[1],U[2]=Y*K[2],U[3]=Math.cos(q),U;}function m(U,K){var q=Math.acos(K[3])*2,Y=Math.sin(q/2);return Y>r.EPSILON?(U[0]=K[0]/Y,U[1]=K[1]/Y,U[2]=K[2]/Y):(U[0]=1,U[1]=0,U[2]=0),q;}function f(U,K){var q=et(U,K);return Math.acos(2*q*q-1);}function v(U,K,q){var Y=K[0],k=K[1],C=K[2],M=K[3],j=q[0],G=q[1],Q=q[2],_=q[3];return U[0]=Y*_+M*j+k*Q-C*G,U[1]=k*_+M*G+C*j-Y*Q,U[2]=C*_+M*Q+Y*G-k*j,U[3]=M*_-Y*j-k*G-C*Q,U;}function S(U,K,q){q*=0.5;var Y=K[0],k=K[1],C=K[2],M=K[3],j=Math.sin(q),G=Math.cos(q);return U[0]=Y*G+M*j,U[1]=k*G+C*j,U[2]=C*G-k*j,U[3]=M*G-Y*j,U;}function E(U,K,q){q*=0.5;var Y=K[0],k=K[1],C=K[2],M=K[3],j=Math.sin(q),G=Math.cos(q);return U[0]=Y*G-C*j,U[1]=k*G+M*j,U[2]=C*G+Y*j,U[3]=M*G-k*j,U;}function T(U,K,q){q*=0.5;var Y=K[0],k=K[1],C=K[2],M=K[3],j=Math.sin(q),G=Math.cos(q);return U[0]=Y*G+k*j,U[1]=k*G-Y*j,U[2]=C*G+M*j,U[3]=M*G-C*j,U;}function P(U,K){var q=K[0],Y=K[1],k=K[2];return U[0]=q,U[1]=Y,U[2]=k,U[3]=Math.sqrt(Math.abs(1-q*q-Y*Y-k*k)),U;}function x(U,K){var q=K[0],Y=K[1],k=K[2],C=K[3],M=Math.sqrt(q*q+Y*Y+k*k),j=Math.exp(C),G=M>0?j*Math.sin(M)/M:0;return U[0]=q*G,U[1]=Y*G,U[2]=k*G,U[3]=j*Math.cos(M),U;}function h(U,K){var q=K[0],Y=K[1],k=K[2],C=K[3],M=Math.sqrt(q*q+Y*Y+k*k),j=M>0?Math.atan2(M,C)/M:0;return U[0]=q*j,U[1]=Y*j,U[2]=k*j,U[3]=0.5*Math.log(q*q+Y*Y+k*k+C*C),U;}function p(U,K,q){return h(U,K),J(U,U,q),x(U,U),U;}function d(U,K,q,Y){var k=K[0],C=K[1],M=K[2],j=K[3],G=q[0],Q=q[1],_=q[2],nt=q[3],ut,mt,Pt,Tt,yt;return mt=k*G+C*Q+M*_+j*nt,mt<0&&(mt=-mt,G=-G,Q=-Q,_=-_,nt=-nt),1-mt>r.EPSILON?(ut=Math.acos(mt),Pt=Math.sin(ut),Tt=Math.sin((1-Y)*ut)/Pt,yt=Math.sin(Y*ut)/Pt):(Tt=1-Y,yt=Y),U[0]=Tt*k+yt*G,U[1]=Tt*C+yt*Q,U[2]=Tt*M+yt*_,U[3]=Tt*j+yt*nt,U;}function g(U){var K=r.RANDOM(),q=r.RANDOM(),Y=r.RANDOM(),k=Math.sqrt(1-K),C=Math.sqrt(K);return U[0]=k*Math.sin(2*Math.PI*q),U[1]=k*Math.cos(2*Math.PI*q),U[2]=C*Math.sin(2*Math.PI*Y),U[3]=C*Math.cos(2*Math.PI*Y),U;}function O(U,K){var q=K[0],Y=K[1],k=K[2],C=K[3],M=q*q+Y*Y+k*k+C*C,j=M?1/M:0;return U[0]=-q*j,U[1]=-Y*j,U[2]=-k*j,U[3]=C*j,U;}function w(U,K){return U[0]=-K[0],U[1]=-K[1],U[2]=-K[2],U[3]=K[3],U;}function L(U,K){var q=K[0]+K[4]+K[8],Y;if(q>0)Y=Math.sqrt(q+1),U[3]=0.5*Y,Y=0.5/Y,U[0]=(K[5]-K[7])*Y,U[1]=(K[6]-K[2])*Y,U[2]=(K[1]-K[3])*Y;else{var k=0;K[4]>K[0]&&(k=1),K[8]>K[k*3+k]&&(k=2);var C=(k+1)%3,M=(k+2)%3;Y=Math.sqrt(K[k*3+k]-K[C*3+C]-K[M*3+M]+1),U[k]=0.5*Y,Y=0.5/Y,U[3]=(K[C*3+M]-K[M*3+C])*Y,U[C]=(K[C*3+k]+K[k*3+C])*Y,U[M]=(K[M*3+k]+K[k*3+M])*Y;}return U;}function B(U,K,q,Y){var k=0.5*Math.PI/180;K*=k,q*=k,Y*=k;var C=Math.sin(K),M=Math.cos(K),j=Math.sin(q),G=Math.cos(q),Q=Math.sin(Y),_=Math.cos(Y);return U[0]=C*G*_-M*j*Q,U[1]=M*j*_+C*G*Q,U[2]=M*G*Q-C*j*_,U[3]=M*G*_+C*j*Q,U;}function A(U){return"quat("+U[0]+", "+U[1]+", "+U[2]+", "+U[3]+")";}var b=l.clone,W=l.fromValues,D=l.copy,R=l.set,X=l.add,H=v,J=l.scale,et=l.dot,it=l.lerp,$=l.length,V=$,rt=l.squaredLength,lt=rt,ct=l.normalize,gt=l.exactEquals,st=l.equals,Ct=function(){var U=i.create(),K=i.fromValues(1,0,0),q=i.fromValues(0,1,0);return function(Y,k,C){var M=i.dot(k,C);return M<-0.999999?(i.cross(U,K,k),i.len(U)<1e-6&&i.cross(U,q,k),i.normalize(U,U),c(Y,U,Math.PI),Y):M>0.999999?(Y[0]=0,Y[1]=0,Y[2]=0,Y[3]=1,Y):(i.cross(U,k,C),Y[0]=U[0],Y[1]=U[1],Y[2]=U[2],Y[3]=1+M,ct(Y,Y));};}(),xt=function(){var U=o(),K=o();return function(q,Y,k,C,M,j){return d(U,Y,M,j),d(K,k,C,j),d(q,U,K,2*j*(1-j)),q;};}(),F=function(){var U=n.create();return function(K,q,Y,k){return U[0]=Y[0],U[3]=Y[1],U[6]=Y[2],U[1]=k[0],U[4]=k[1],U[7]=k[2],U[2]=-q[0],U[5]=-q[1],U[8]=-q[2],ct(K,L(K,U));};}();},/* 8 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"length",function(){return l;}),t.d(e,"fromValues",function(){return o;}),t.d(e,"copy",function(){return a;}),t.d(e,"set",function(){return c;}),t.d(e,"add",function(){return m;}),t.d(e,"subtract",function(){return f;}),t.d(e,"multiply",function(){return v;}),t.d(e,"divide",function(){return S;}),t.d(e,"ceil",function(){return E;}),t.d(e,"floor",function(){return T;}),t.d(e,"min",function(){return P;}),t.d(e,"max",function(){return x;}),t.d(e,"round",function(){return h;}),t.d(e,"scale",function(){return p;}),t.d(e,"scaleAndAdd",function(){return d;}),t.d(e,"distance",function(){return g;}),t.d(e,"squaredDistance",function(){return O;}),t.d(e,"squaredLength",function(){return w;}),t.d(e,"negate",function(){return L;}),t.d(e,"inverse",function(){return B;}),t.d(e,"normalize",function(){return A;}),t.d(e,"dot",function(){return b;}),t.d(e,"cross",function(){return W;}),t.d(e,"lerp",function(){return D;}),t.d(e,"hermite",function(){return R;}),t.d(e,"bezier",function(){return X;}),t.d(e,"random",function(){return H;}),t.d(e,"transformMat4",function(){return J;}),t.d(e,"transformMat3",function(){return et;}),t.d(e,"transformQuat",function(){return it;}),t.d(e,"rotateX",function(){return $;}),t.d(e,"rotateY",function(){return V;}),t.d(e,"rotateZ",function(){return rt;}),t.d(e,"angle",function(){return lt;}),t.d(e,"zero",function(){return ct;}),t.d(e,"str",function(){return gt;}),t.d(e,"exactEquals",function(){return st;}),t.d(e,"equals",function(){return Ct;}),t.d(e,"sub",function(){return xt;}),t.d(e,"mul",function(){return F;}),t.d(e,"div",function(){return U;}),t.d(e,"dist",function(){return K;}),t.d(e,"sqrDist",function(){return q;}),t.d(e,"len",function(){return Y;}),t.d(e,"sqrLen",function(){return k;}),t.d(e,"forEach",function(){return C;});var r=t(2);function n(){var M=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(M[0]=0,M[1]=0,M[2]=0),M;}function i(M){var j=new r.ARRAY_TYPE(3);return j[0]=M[0],j[1]=M[1],j[2]=M[2],j;}function l(M){var j=M[0],G=M[1],Q=M[2];return Math.hypot(j,G,Q);}function o(M,j,G){var Q=new r.ARRAY_TYPE(3);return Q[0]=M,Q[1]=j,Q[2]=G,Q;}function a(M,j){return M[0]=j[0],M[1]=j[1],M[2]=j[2],M;}function c(M,j,G,Q){return M[0]=j,M[1]=G,M[2]=Q,M;}function m(M,j,G){return M[0]=j[0]+G[0],M[1]=j[1]+G[1],M[2]=j[2]+G[2],M;}function f(M,j,G){return M[0]=j[0]-G[0],M[1]=j[1]-G[1],M[2]=j[2]-G[2],M;}function v(M,j,G){return M[0]=j[0]*G[0],M[1]=j[1]*G[1],M[2]=j[2]*G[2],M;}function S(M,j,G){return M[0]=j[0]/G[0],M[1]=j[1]/G[1],M[2]=j[2]/G[2],M;}function E(M,j){return M[0]=Math.ceil(j[0]),M[1]=Math.ceil(j[1]),M[2]=Math.ceil(j[2]),M;}function T(M,j){return M[0]=Math.floor(j[0]),M[1]=Math.floor(j[1]),M[2]=Math.floor(j[2]),M;}function P(M,j,G){return M[0]=Math.min(j[0],G[0]),M[1]=Math.min(j[1],G[1]),M[2]=Math.min(j[2],G[2]),M;}function x(M,j,G){return M[0]=Math.max(j[0],G[0]),M[1]=Math.max(j[1],G[1]),M[2]=Math.max(j[2],G[2]),M;}function h(M,j){return M[0]=Math.round(j[0]),M[1]=Math.round(j[1]),M[2]=Math.round(j[2]),M;}function p(M,j,G){return M[0]=j[0]*G,M[1]=j[1]*G,M[2]=j[2]*G,M;}function d(M,j,G,Q){return M[0]=j[0]+G[0]*Q,M[1]=j[1]+G[1]*Q,M[2]=j[2]+G[2]*Q,M;}function g(M,j){var G=j[0]-M[0],Q=j[1]-M[1],_=j[2]-M[2];return Math.hypot(G,Q,_);}function O(M,j){var G=j[0]-M[0],Q=j[1]-M[1],_=j[2]-M[2];return G*G+Q*Q+_*_;}function w(M){var j=M[0],G=M[1],Q=M[2];return j*j+G*G+Q*Q;}function L(M,j){return M[0]=-j[0],M[1]=-j[1],M[2]=-j[2],M;}function B(M,j){return M[0]=1/j[0],M[1]=1/j[1],M[2]=1/j[2],M;}function A(M,j){var G=j[0],Q=j[1],_=j[2],nt=G*G+Q*Q+_*_;return nt>0&&(nt=1/Math.sqrt(nt)),M[0]=j[0]*nt,M[1]=j[1]*nt,M[2]=j[2]*nt,M;}function b(M,j){return M[0]*j[0]+M[1]*j[1]+M[2]*j[2];}function W(M,j,G){var Q=j[0],_=j[1],nt=j[2],ut=G[0],mt=G[1],Pt=G[2];return M[0]=_*Pt-nt*mt,M[1]=nt*ut-Q*Pt,M[2]=Q*mt-_*ut,M;}function D(M,j,G,Q){var _=j[0],nt=j[1],ut=j[2];return M[0]=_+Q*(G[0]-_),M[1]=nt+Q*(G[1]-nt),M[2]=ut+Q*(G[2]-ut),M;}function R(M,j,G,Q,_,nt){var ut=nt*nt,mt=ut*(2*nt-3)+1,Pt=ut*(nt-2)+nt,Tt=ut*(nt-1),yt=ut*(3-2*nt);return M[0]=j[0]*mt+G[0]*Pt+Q[0]*Tt+_[0]*yt,M[1]=j[1]*mt+G[1]*Pt+Q[1]*Tt+_[1]*yt,M[2]=j[2]*mt+G[2]*Pt+Q[2]*Tt+_[2]*yt,M;}function X(M,j,G,Q,_,nt){var ut=1-nt,mt=ut*ut,Pt=nt*nt,Tt=mt*ut,yt=3*nt*mt,vt=3*Pt*ut,St=Pt*nt;return M[0]=j[0]*Tt+G[0]*yt+Q[0]*vt+_[0]*St,M[1]=j[1]*Tt+G[1]*yt+Q[1]*vt+_[1]*St,M[2]=j[2]*Tt+G[2]*yt+Q[2]*vt+_[2]*St,M;}function H(M,j){j=j||1;var G=r.RANDOM()*2*Math.PI,Q=r.RANDOM()*2-1,_=Math.sqrt(1-Q*Q)*j;return M[0]=Math.cos(G)*_,M[1]=Math.sin(G)*_,M[2]=Q*j,M;}function J(M,j,G){var Q=j[0],_=j[1],nt=j[2],ut=G[3]*Q+G[7]*_+G[11]*nt+G[15];return ut=ut||1,M[0]=(G[0]*Q+G[4]*_+G[8]*nt+G[12])/ut,M[1]=(G[1]*Q+G[5]*_+G[9]*nt+G[13])/ut,M[2]=(G[2]*Q+G[6]*_+G[10]*nt+G[14])/ut,M;}function et(M,j,G){var Q=j[0],_=j[1],nt=j[2];return M[0]=Q*G[0]+_*G[3]+nt*G[6],M[1]=Q*G[1]+_*G[4]+nt*G[7],M[2]=Q*G[2]+_*G[5]+nt*G[8],M;}function it(M,j,G){var Q=G[0],_=G[1],nt=G[2],ut=G[3],mt=j[0],Pt=j[1],Tt=j[2],yt=_*Tt-nt*Pt,vt=nt*mt-Q*Tt,St=Q*Pt-_*mt,Mt=_*St-nt*vt,wt=nt*yt-Q*St,Ot=Q*vt-_*yt,Bt=ut*2;return yt*=Bt,vt*=Bt,St*=Bt,Mt*=2,wt*=2,Ot*=2,M[0]=mt+yt+Mt,M[1]=Pt+vt+wt,M[2]=Tt+St+Ot,M;}function $(M,j,G,Q){var _=[],nt=[];return _[0]=j[0]-G[0],_[1]=j[1]-G[1],_[2]=j[2]-G[2],nt[0]=_[0],nt[1]=_[1]*Math.cos(Q)-_[2]*Math.sin(Q),nt[2]=_[1]*Math.sin(Q)+_[2]*Math.cos(Q),M[0]=nt[0]+G[0],M[1]=nt[1]+G[1],M[2]=nt[2]+G[2],M;}function V(M,j,G,Q){var _=[],nt=[];return _[0]=j[0]-G[0],_[1]=j[1]-G[1],_[2]=j[2]-G[2],nt[0]=_[2]*Math.sin(Q)+_[0]*Math.cos(Q),nt[1]=_[1],nt[2]=_[2]*Math.cos(Q)-_[0]*Math.sin(Q),M[0]=nt[0]+G[0],M[1]=nt[1]+G[1],M[2]=nt[2]+G[2],M;}function rt(M,j,G,Q){var _=[],nt=[];return _[0]=j[0]-G[0],_[1]=j[1]-G[1],_[2]=j[2]-G[2],nt[0]=_[0]*Math.cos(Q)-_[1]*Math.sin(Q),nt[1]=_[0]*Math.sin(Q)+_[1]*Math.cos(Q),nt[2]=_[2],M[0]=nt[0]+G[0],M[1]=nt[1]+G[1],M[2]=nt[2]+G[2],M;}function lt(M,j){var G=M[0],Q=M[1],_=M[2],nt=j[0],ut=j[1],mt=j[2],Pt=Math.sqrt(G*G+Q*Q+_*_),Tt=Math.sqrt(nt*nt+ut*ut+mt*mt),yt=Pt*Tt,vt=yt&&b(M,j)/yt;return Math.acos(Math.min(Math.max(vt,-1),1));}function ct(M){return M[0]=0,M[1]=0,M[2]=0,M;}function gt(M){return"vec3("+M[0]+", "+M[1]+", "+M[2]+")";}function st(M,j){return M[0]===j[0]&&M[1]===j[1]&&M[2]===j[2];}function Ct(M,j){var G=M[0],Q=M[1],_=M[2],nt=j[0],ut=j[1],mt=j[2];return Math.abs(G-nt)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(nt))&&Math.abs(Q-ut)<=r.EPSILON*Math.max(1,Math.abs(Q),Math.abs(ut))&&Math.abs(_-mt)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(mt));}var xt=f,F=v,U=S,K=g,q=O,Y=l,k=w,C=function(){var M=n();return function(j,G,Q,_,nt,ut){var mt,Pt;for(G||(G=3),Q||(Q=0),_?Pt=Math.min(_*G+Q,j.length):Pt=j.length,mt=Q;mt<Pt;mt+=G)M[0]=j[mt],M[1]=j[mt+1],M[2]=j[mt+2],nt(M,M,ut),j[mt]=M[0],j[mt+1]=M[1],j[mt+2]=M[2];return j;};}();},/* 9 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"copy",function(){return o;}),t.d(e,"set",function(){return a;}),t.d(e,"add",function(){return c;}),t.d(e,"subtract",function(){return m;}),t.d(e,"multiply",function(){return f;}),t.d(e,"divide",function(){return v;}),t.d(e,"ceil",function(){return S;}),t.d(e,"floor",function(){return E;}),t.d(e,"min",function(){return T;}),t.d(e,"max",function(){return P;}),t.d(e,"round",function(){return x;}),t.d(e,"scale",function(){return h;}),t.d(e,"scaleAndAdd",function(){return p;}),t.d(e,"distance",function(){return d;}),t.d(e,"squaredDistance",function(){return g;}),t.d(e,"length",function(){return O;}),t.d(e,"squaredLength",function(){return w;}),t.d(e,"negate",function(){return L;}),t.d(e,"inverse",function(){return B;}),t.d(e,"normalize",function(){return A;}),t.d(e,"dot",function(){return b;}),t.d(e,"cross",function(){return W;}),t.d(e,"lerp",function(){return D;}),t.d(e,"random",function(){return R;}),t.d(e,"transformMat4",function(){return X;}),t.d(e,"transformQuat",function(){return H;}),t.d(e,"zero",function(){return J;}),t.d(e,"str",function(){return et;}),t.d(e,"exactEquals",function(){return it;}),t.d(e,"equals",function(){return $;}),t.d(e,"sub",function(){return V;}),t.d(e,"mul",function(){return rt;}),t.d(e,"div",function(){return lt;}),t.d(e,"dist",function(){return ct;}),t.d(e,"sqrDist",function(){return gt;}),t.d(e,"len",function(){return st;}),t.d(e,"sqrLen",function(){return Ct;}),t.d(e,"forEach",function(){return xt;});var r=t(2);function n(){var F=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[3]=0),F;}function i(F){var U=new r.ARRAY_TYPE(4);return U[0]=F[0],U[1]=F[1],U[2]=F[2],U[3]=F[3],U;}function l(F,U,K,q){var Y=new r.ARRAY_TYPE(4);return Y[0]=F,Y[1]=U,Y[2]=K,Y[3]=q,Y;}function o(F,U){return F[0]=U[0],F[1]=U[1],F[2]=U[2],F[3]=U[3],F;}function a(F,U,K,q,Y){return F[0]=U,F[1]=K,F[2]=q,F[3]=Y,F;}function c(F,U,K){return F[0]=U[0]+K[0],F[1]=U[1]+K[1],F[2]=U[2]+K[2],F[3]=U[3]+K[3],F;}function m(F,U,K){return F[0]=U[0]-K[0],F[1]=U[1]-K[1],F[2]=U[2]-K[2],F[3]=U[3]-K[3],F;}function f(F,U,K){return F[0]=U[0]*K[0],F[1]=U[1]*K[1],F[2]=U[2]*K[2],F[3]=U[3]*K[3],F;}function v(F,U,K){return F[0]=U[0]/K[0],F[1]=U[1]/K[1],F[2]=U[2]/K[2],F[3]=U[3]/K[3],F;}function S(F,U){return F[0]=Math.ceil(U[0]),F[1]=Math.ceil(U[1]),F[2]=Math.ceil(U[2]),F[3]=Math.ceil(U[3]),F;}function E(F,U){return F[0]=Math.floor(U[0]),F[1]=Math.floor(U[1]),F[2]=Math.floor(U[2]),F[3]=Math.floor(U[3]),F;}function T(F,U,K){return F[0]=Math.min(U[0],K[0]),F[1]=Math.min(U[1],K[1]),F[2]=Math.min(U[2],K[2]),F[3]=Math.min(U[3],K[3]),F;}function P(F,U,K){return F[0]=Math.max(U[0],K[0]),F[1]=Math.max(U[1],K[1]),F[2]=Math.max(U[2],K[2]),F[3]=Math.max(U[3],K[3]),F;}function x(F,U){return F[0]=Math.round(U[0]),F[1]=Math.round(U[1]),F[2]=Math.round(U[2]),F[3]=Math.round(U[3]),F;}function h(F,U,K){return F[0]=U[0]*K,F[1]=U[1]*K,F[2]=U[2]*K,F[3]=U[3]*K,F;}function p(F,U,K,q){return F[0]=U[0]+K[0]*q,F[1]=U[1]+K[1]*q,F[2]=U[2]+K[2]*q,F[3]=U[3]+K[3]*q,F;}function d(F,U){var K=U[0]-F[0],q=U[1]-F[1],Y=U[2]-F[2],k=U[3]-F[3];return Math.hypot(K,q,Y,k);}function g(F,U){var K=U[0]-F[0],q=U[1]-F[1],Y=U[2]-F[2],k=U[3]-F[3];return K*K+q*q+Y*Y+k*k;}function O(F){var U=F[0],K=F[1],q=F[2],Y=F[3];return Math.hypot(U,K,q,Y);}function w(F){var U=F[0],K=F[1],q=F[2],Y=F[3];return U*U+K*K+q*q+Y*Y;}function L(F,U){return F[0]=-U[0],F[1]=-U[1],F[2]=-U[2],F[3]=-U[3],F;}function B(F,U){return F[0]=1/U[0],F[1]=1/U[1],F[2]=1/U[2],F[3]=1/U[3],F;}function A(F,U){var K=U[0],q=U[1],Y=U[2],k=U[3],C=K*K+q*q+Y*Y+k*k;return C>0&&(C=1/Math.sqrt(C)),F[0]=K*C,F[1]=q*C,F[2]=Y*C,F[3]=k*C,F;}function b(F,U){return F[0]*U[0]+F[1]*U[1]+F[2]*U[2]+F[3]*U[3];}function W(F,U,K,q){var Y=K[0]*q[1]-K[1]*q[0],k=K[0]*q[2]-K[2]*q[0],C=K[0]*q[3]-K[3]*q[0],M=K[1]*q[2]-K[2]*q[1],j=K[1]*q[3]-K[3]*q[1],G=K[2]*q[3]-K[3]*q[2],Q=U[0],_=U[1],nt=U[2],ut=U[3];return F[0]=_*G-nt*j+ut*M,F[1]=-(Q*G)+nt*C-ut*k,F[2]=Q*j-_*C+ut*Y,F[3]=-(Q*M)+_*k-nt*Y,F;}function D(F,U,K,q){var Y=U[0],k=U[1],C=U[2],M=U[3];return F[0]=Y+q*(K[0]-Y),F[1]=k+q*(K[1]-k),F[2]=C+q*(K[2]-C),F[3]=M+q*(K[3]-M),F;}function R(F,U){U=U||1;var K,q,Y,k,C,M;do K=r.RANDOM()*2-1,q=r.RANDOM()*2-1,C=K*K+q*q;while(C>=1);do Y=r.RANDOM()*2-1,k=r.RANDOM()*2-1,M=Y*Y+k*k;while(M>=1);var j=Math.sqrt((1-C)/M);return F[0]=U*K,F[1]=U*q,F[2]=U*Y*j,F[3]=U*k*j,F;}function X(F,U,K){var q=U[0],Y=U[1],k=U[2],C=U[3];return F[0]=K[0]*q+K[4]*Y+K[8]*k+K[12]*C,F[1]=K[1]*q+K[5]*Y+K[9]*k+K[13]*C,F[2]=K[2]*q+K[6]*Y+K[10]*k+K[14]*C,F[3]=K[3]*q+K[7]*Y+K[11]*k+K[15]*C,F;}function H(F,U,K){var q=U[0],Y=U[1],k=U[2],C=K[0],M=K[1],j=K[2],G=K[3],Q=G*q+M*k-j*Y,_=G*Y+j*q-C*k,nt=G*k+C*Y-M*q,ut=-C*q-M*Y-j*k;return F[0]=Q*G+ut*-C+_*-j-nt*-M,F[1]=_*G+ut*-M+nt*-C-Q*-j,F[2]=nt*G+ut*-j+Q*-M-_*-C,F[3]=U[3],F;}function J(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=0,F;}function et(F){return"vec4("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}function it(F,U){return F[0]===U[0]&&F[1]===U[1]&&F[2]===U[2]&&F[3]===U[3];}function $(F,U){var K=F[0],q=F[1],Y=F[2],k=F[3],C=U[0],M=U[1],j=U[2],G=U[3];return Math.abs(K-C)<=r.EPSILON*Math.max(1,Math.abs(K),Math.abs(C))&&Math.abs(q-M)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(M))&&Math.abs(Y-j)<=r.EPSILON*Math.max(1,Math.abs(Y),Math.abs(j))&&Math.abs(k-G)<=r.EPSILON*Math.max(1,Math.abs(k),Math.abs(G));}var V=m,rt=f,lt=v,ct=d,gt=g,st=O,Ct=w,xt=function(){var F=n();return function(U,K,q,Y,k,C){var M,j;for(K||(K=4),q||(q=0),Y?j=Math.min(Y*K+q,U.length):j=U.length,M=q;M<j;M+=K)F[0]=U[M],F[1]=U[M+1],F[2]=U[M+2],F[3]=U[M+3],k(F,F,C),U[M]=F[0],U[M+1]=F[1],U[M+2]=F[2],U[M+3]=F[3];return U;};}();},/* 10 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return l;}),t.d(e,"clone",function(){return o;}),t.d(e,"fromValues",function(){return a;}),t.d(e,"fromRotationTranslationValues",function(){return c;}),t.d(e,"fromRotationTranslation",function(){return m;}),t.d(e,"fromTranslation",function(){return f;}),t.d(e,"fromRotation",function(){return v;}),t.d(e,"fromMat4",function(){return S;}),t.d(e,"copy",function(){return E;}),t.d(e,"identity",function(){return T;}),t.d(e,"set",function(){return P;}),t.d(e,"getReal",function(){return x;}),t.d(e,"getDual",function(){return h;}),t.d(e,"setReal",function(){return p;}),t.d(e,"setDual",function(){return d;}),t.d(e,"getTranslation",function(){return g;}),t.d(e,"translate",function(){return O;}),t.d(e,"rotateX",function(){return w;}),t.d(e,"rotateY",function(){return L;}),t.d(e,"rotateZ",function(){return B;}),t.d(e,"rotateByQuatAppend",function(){return A;}),t.d(e,"rotateByQuatPrepend",function(){return b;}),t.d(e,"rotateAroundAxis",function(){return W;}),t.d(e,"add",function(){return D;}),t.d(e,"multiply",function(){return R;}),t.d(e,"mul",function(){return X;}),t.d(e,"scale",function(){return H;}),t.d(e,"dot",function(){return J;}),t.d(e,"lerp",function(){return et;}),t.d(e,"invert",function(){return it;}),t.d(e,"conjugate",function(){return $;}),t.d(e,"length",function(){return V;}),t.d(e,"len",function(){return rt;}),t.d(e,"squaredLength",function(){return lt;}),t.d(e,"sqrLen",function(){return ct;}),t.d(e,"normalize",function(){return gt;}),t.d(e,"str",function(){return st;}),t.d(e,"exactEquals",function(){return Ct;}),t.d(e,"equals",function(){return xt;});var r=t(2),n=t(7),i=t(6);function l(){var F=new r.ARRAY_TYPE(8);return r.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[4]=0,F[5]=0,F[6]=0,F[7]=0),F[3]=1,F;}function o(F){var U=new r.ARRAY_TYPE(8);return U[0]=F[0],U[1]=F[1],U[2]=F[2],U[3]=F[3],U[4]=F[4],U[5]=F[5],U[6]=F[6],U[7]=F[7],U;}function a(F,U,K,q,Y,k,C,M){var j=new r.ARRAY_TYPE(8);return j[0]=F,j[1]=U,j[2]=K,j[3]=q,j[4]=Y,j[5]=k,j[6]=C,j[7]=M,j;}function c(F,U,K,q,Y,k,C){var M=new r.ARRAY_TYPE(8);M[0]=F,M[1]=U,M[2]=K,M[3]=q;var j=Y*0.5,G=k*0.5,Q=C*0.5;return M[4]=j*q+G*K-Q*U,M[5]=G*q+Q*F-j*K,M[6]=Q*q+j*U-G*F,M[7]=-j*F-G*U-Q*K,M;}function m(F,U,K){var q=K[0]*0.5,Y=K[1]*0.5,k=K[2]*0.5,C=U[0],M=U[1],j=U[2],G=U[3];return F[0]=C,F[1]=M,F[2]=j,F[3]=G,F[4]=q*G+Y*j-k*M,F[5]=Y*G+k*C-q*j,F[6]=k*G+q*M-Y*C,F[7]=-q*C-Y*M-k*j,F;}function f(F,U){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=U[0]*0.5,F[5]=U[1]*0.5,F[6]=U[2]*0.5,F[7]=0,F;}function v(F,U){return F[0]=U[0],F[1]=U[1],F[2]=U[2],F[3]=U[3],F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function S(F,U){var K=n.create();i.getRotation(K,U);var q=new r.ARRAY_TYPE(3);return i.getTranslation(q,U),m(F,K,q),F;}function E(F,U){return F[0]=U[0],F[1]=U[1],F[2]=U[2],F[3]=U[3],F[4]=U[4],F[5]=U[5],F[6]=U[6],F[7]=U[7],F;}function T(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function P(F,U,K,q,Y,k,C,M,j){return F[0]=U,F[1]=K,F[2]=q,F[3]=Y,F[4]=k,F[5]=C,F[6]=M,F[7]=j,F;}var x=n.copy;function h(F,U){return F[0]=U[4],F[1]=U[5],F[2]=U[6],F[3]=U[7],F;}var p=n.copy;function d(F,U){return F[4]=U[0],F[5]=U[1],F[6]=U[2],F[7]=U[3],F;}function g(F,U){var K=U[4],q=U[5],Y=U[6],k=U[7],C=-U[0],M=-U[1],j=-U[2],G=U[3];return F[0]=(K*G+k*C+q*j-Y*M)*2,F[1]=(q*G+k*M+Y*C-K*j)*2,F[2]=(Y*G+k*j+K*M-q*C)*2,F;}function O(F,U,K){var q=U[0],Y=U[1],k=U[2],C=U[3],M=K[0]*0.5,j=K[1]*0.5,G=K[2]*0.5,Q=U[4],_=U[5],nt=U[6],ut=U[7];return F[0]=q,F[1]=Y,F[2]=k,F[3]=C,F[4]=C*M+Y*G-k*j+Q,F[5]=C*j+k*M-q*G+_,F[6]=C*G+q*j-Y*M+nt,F[7]=-q*M-Y*j-k*G+ut,F;}function w(F,U,K){var q=-U[0],Y=-U[1],k=-U[2],C=U[3],M=U[4],j=U[5],G=U[6],Q=U[7],_=M*C+Q*q+j*k-G*Y,nt=j*C+Q*Y+G*q-M*k,ut=G*C+Q*k+M*Y-j*q,mt=Q*C-M*q-j*Y-G*k;return n.rotateX(F,U,K),q=F[0],Y=F[1],k=F[2],C=F[3],F[4]=_*C+mt*q+nt*k-ut*Y,F[5]=nt*C+mt*Y+ut*q-_*k,F[6]=ut*C+mt*k+_*Y-nt*q,F[7]=mt*C-_*q-nt*Y-ut*k,F;}function L(F,U,K){var q=-U[0],Y=-U[1],k=-U[2],C=U[3],M=U[4],j=U[5],G=U[6],Q=U[7],_=M*C+Q*q+j*k-G*Y,nt=j*C+Q*Y+G*q-M*k,ut=G*C+Q*k+M*Y-j*q,mt=Q*C-M*q-j*Y-G*k;return n.rotateY(F,U,K),q=F[0],Y=F[1],k=F[2],C=F[3],F[4]=_*C+mt*q+nt*k-ut*Y,F[5]=nt*C+mt*Y+ut*q-_*k,F[6]=ut*C+mt*k+_*Y-nt*q,F[7]=mt*C-_*q-nt*Y-ut*k,F;}function B(F,U,K){var q=-U[0],Y=-U[1],k=-U[2],C=U[3],M=U[4],j=U[5],G=U[6],Q=U[7],_=M*C+Q*q+j*k-G*Y,nt=j*C+Q*Y+G*q-M*k,ut=G*C+Q*k+M*Y-j*q,mt=Q*C-M*q-j*Y-G*k;return n.rotateZ(F,U,K),q=F[0],Y=F[1],k=F[2],C=F[3],F[4]=_*C+mt*q+nt*k-ut*Y,F[5]=nt*C+mt*Y+ut*q-_*k,F[6]=ut*C+mt*k+_*Y-nt*q,F[7]=mt*C-_*q-nt*Y-ut*k,F;}function A(F,U,K){var q=K[0],Y=K[1],k=K[2],C=K[3],M=U[0],j=U[1],G=U[2],Q=U[3];return F[0]=M*C+Q*q+j*k-G*Y,F[1]=j*C+Q*Y+G*q-M*k,F[2]=G*C+Q*k+M*Y-j*q,F[3]=Q*C-M*q-j*Y-G*k,M=U[4],j=U[5],G=U[6],Q=U[7],F[4]=M*C+Q*q+j*k-G*Y,F[5]=j*C+Q*Y+G*q-M*k,F[6]=G*C+Q*k+M*Y-j*q,F[7]=Q*C-M*q-j*Y-G*k,F;}function b(F,U,K){var q=U[0],Y=U[1],k=U[2],C=U[3],M=K[0],j=K[1],G=K[2],Q=K[3];return F[0]=q*Q+C*M+Y*G-k*j,F[1]=Y*Q+C*j+k*M-q*G,F[2]=k*Q+C*G+q*j-Y*M,F[3]=C*Q-q*M-Y*j-k*G,M=K[4],j=K[5],G=K[6],Q=K[7],F[4]=q*Q+C*M+Y*G-k*j,F[5]=Y*Q+C*j+k*M-q*G,F[6]=k*Q+C*G+q*j-Y*M,F[7]=C*Q-q*M-Y*j-k*G,F;}function W(F,U,K,q){if(Math.abs(q)<r.EPSILON)return E(F,U);var Y=Math.hypot(K[0],K[1],K[2]);q=q*0.5;var k=Math.sin(q),C=k*K[0]/Y,M=k*K[1]/Y,j=k*K[2]/Y,G=Math.cos(q),Q=U[0],_=U[1],nt=U[2],ut=U[3];F[0]=Q*G+ut*C+_*j-nt*M,F[1]=_*G+ut*M+nt*C-Q*j,F[2]=nt*G+ut*j+Q*M-_*C,F[3]=ut*G-Q*C-_*M-nt*j;var mt=U[4],Pt=U[5],Tt=U[6],yt=U[7];return F[4]=mt*G+yt*C+Pt*j-Tt*M,F[5]=Pt*G+yt*M+Tt*C-mt*j,F[6]=Tt*G+yt*j+mt*M-Pt*C,F[7]=yt*G-mt*C-Pt*M-Tt*j,F;}function D(F,U,K){return F[0]=U[0]+K[0],F[1]=U[1]+K[1],F[2]=U[2]+K[2],F[3]=U[3]+K[3],F[4]=U[4]+K[4],F[5]=U[5]+K[5],F[6]=U[6]+K[6],F[7]=U[7]+K[7],F;}function R(F,U,K){var q=U[0],Y=U[1],k=U[2],C=U[3],M=K[4],j=K[5],G=K[6],Q=K[7],_=U[4],nt=U[5],ut=U[6],mt=U[7],Pt=K[0],Tt=K[1],yt=K[2],vt=K[3];return F[0]=q*vt+C*Pt+Y*yt-k*Tt,F[1]=Y*vt+C*Tt+k*Pt-q*yt,F[2]=k*vt+C*yt+q*Tt-Y*Pt,F[3]=C*vt-q*Pt-Y*Tt-k*yt,F[4]=q*Q+C*M+Y*G-k*j+_*vt+mt*Pt+nt*yt-ut*Tt,F[5]=Y*Q+C*j+k*M-q*G+nt*vt+mt*Tt+ut*Pt-_*yt,F[6]=k*Q+C*G+q*j-Y*M+ut*vt+mt*yt+_*Tt-nt*Pt,F[7]=C*Q-q*M-Y*j-k*G+mt*vt-_*Pt-nt*Tt-ut*yt,F;}var X=R;function H(F,U,K){return F[0]=U[0]*K,F[1]=U[1]*K,F[2]=U[2]*K,F[3]=U[3]*K,F[4]=U[4]*K,F[5]=U[5]*K,F[6]=U[6]*K,F[7]=U[7]*K,F;}var J=n.dot;function et(F,U,K,q){var Y=1-q;return J(U,K)<0&&(q=-q),F[0]=U[0]*Y+K[0]*q,F[1]=U[1]*Y+K[1]*q,F[2]=U[2]*Y+K[2]*q,F[3]=U[3]*Y+K[3]*q,F[4]=U[4]*Y+K[4]*q,F[5]=U[5]*Y+K[5]*q,F[6]=U[6]*Y+K[6]*q,F[7]=U[7]*Y+K[7]*q,F;}function it(F,U){var K=lt(U);return F[0]=-U[0]/K,F[1]=-U[1]/K,F[2]=-U[2]/K,F[3]=U[3]/K,F[4]=-U[4]/K,F[5]=-U[5]/K,F[6]=-U[6]/K,F[7]=U[7]/K,F;}function $(F,U){return F[0]=-U[0],F[1]=-U[1],F[2]=-U[2],F[3]=U[3],F[4]=-U[4],F[5]=-U[5],F[6]=-U[6],F[7]=U[7],F;}var V=n.length,rt=V,lt=n.squaredLength,ct=lt;function gt(F,U){var K=lt(U);if(K>0){K=Math.sqrt(K);var q=U[0]/K,Y=U[1]/K,k=U[2]/K,C=U[3]/K,M=U[4],j=U[5],G=U[6],Q=U[7],_=q*M+Y*j+k*G+C*Q;F[0]=q,F[1]=Y,F[2]=k,F[3]=C,F[4]=(M-q*_)/K,F[5]=(j-Y*_)/K,F[6]=(G-k*_)/K,F[7]=(Q-C*_)/K;}return F;}function st(F){return"quat2("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+", "+F[4]+", "+F[5]+", "+F[6]+", "+F[7]+")";}function Ct(F,U){return F[0]===U[0]&&F[1]===U[1]&&F[2]===U[2]&&F[3]===U[3]&&F[4]===U[4]&&F[5]===U[5]&&F[6]===U[6]&&F[7]===U[7];}function xt(F,U){var K=F[0],q=F[1],Y=F[2],k=F[3],C=F[4],M=F[5],j=F[6],G=F[7],Q=U[0],_=U[1],nt=U[2],ut=U[3],mt=U[4],Pt=U[5],Tt=U[6],yt=U[7];return Math.abs(K-Q)<=r.EPSILON*Math.max(1,Math.abs(K),Math.abs(Q))&&Math.abs(q-_)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(_))&&Math.abs(Y-nt)<=r.EPSILON*Math.max(1,Math.abs(Y),Math.abs(nt))&&Math.abs(k-ut)<=r.EPSILON*Math.max(1,Math.abs(k),Math.abs(ut))&&Math.abs(C-mt)<=r.EPSILON*Math.max(1,Math.abs(C),Math.abs(mt))&&Math.abs(M-Pt)<=r.EPSILON*Math.max(1,Math.abs(M),Math.abs(Pt))&&Math.abs(j-Tt)<=r.EPSILON*Math.max(1,Math.abs(j),Math.abs(Tt))&&Math.abs(G-yt)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(yt));}},/* 11 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return i;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"copy",function(){return o;}),t.d(e,"set",function(){return a;}),t.d(e,"add",function(){return c;}),t.d(e,"subtract",function(){return m;}),t.d(e,"multiply",function(){return f;}),t.d(e,"divide",function(){return v;}),t.d(e,"ceil",function(){return S;}),t.d(e,"floor",function(){return E;}),t.d(e,"min",function(){return T;}),t.d(e,"max",function(){return P;}),t.d(e,"round",function(){return x;}),t.d(e,"scale",function(){return h;}),t.d(e,"scaleAndAdd",function(){return p;}),t.d(e,"distance",function(){return d;}),t.d(e,"squaredDistance",function(){return g;}),t.d(e,"length",function(){return O;}),t.d(e,"squaredLength",function(){return w;}),t.d(e,"negate",function(){return L;}),t.d(e,"inverse",function(){return B;}),t.d(e,"normalize",function(){return A;}),t.d(e,"dot",function(){return b;}),t.d(e,"cross",function(){return W;}),t.d(e,"lerp",function(){return D;}),t.d(e,"random",function(){return R;}),t.d(e,"transformMat2",function(){return X;}),t.d(e,"transformMat2d",function(){return H;}),t.d(e,"transformMat3",function(){return J;}),t.d(e,"transformMat4",function(){return et;}),t.d(e,"rotate",function(){return it;}),t.d(e,"angle",function(){return $;}),t.d(e,"zero",function(){return V;}),t.d(e,"str",function(){return rt;}),t.d(e,"exactEquals",function(){return lt;}),t.d(e,"equals",function(){return ct;}),t.d(e,"len",function(){return gt;}),t.d(e,"sub",function(){return st;}),t.d(e,"mul",function(){return Ct;}),t.d(e,"div",function(){return xt;}),t.d(e,"dist",function(){return F;}),t.d(e,"sqrDist",function(){return U;}),t.d(e,"sqrLen",function(){return K;}),t.d(e,"forEach",function(){return q;});var r=t(2);function n(){var Y=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(Y[0]=0,Y[1]=0),Y;}function i(Y){var k=new r.ARRAY_TYPE(2);return k[0]=Y[0],k[1]=Y[1],k;}function l(Y,k){var C=new r.ARRAY_TYPE(2);return C[0]=Y,C[1]=k,C;}function o(Y,k){return Y[0]=k[0],Y[1]=k[1],Y;}function a(Y,k,C){return Y[0]=k,Y[1]=C,Y;}function c(Y,k,C){return Y[0]=k[0]+C[0],Y[1]=k[1]+C[1],Y;}function m(Y,k,C){return Y[0]=k[0]-C[0],Y[1]=k[1]-C[1],Y;}function f(Y,k,C){return Y[0]=k[0]*C[0],Y[1]=k[1]*C[1],Y;}function v(Y,k,C){return Y[0]=k[0]/C[0],Y[1]=k[1]/C[1],Y;}function S(Y,k){return Y[0]=Math.ceil(k[0]),Y[1]=Math.ceil(k[1]),Y;}function E(Y,k){return Y[0]=Math.floor(k[0]),Y[1]=Math.floor(k[1]),Y;}function T(Y,k,C){return Y[0]=Math.min(k[0],C[0]),Y[1]=Math.min(k[1],C[1]),Y;}function P(Y,k,C){return Y[0]=Math.max(k[0],C[0]),Y[1]=Math.max(k[1],C[1]),Y;}function x(Y,k){return Y[0]=Math.round(k[0]),Y[1]=Math.round(k[1]),Y;}function h(Y,k,C){return Y[0]=k[0]*C,Y[1]=k[1]*C,Y;}function p(Y,k,C,M){return Y[0]=k[0]+C[0]*M,Y[1]=k[1]+C[1]*M,Y;}function d(Y,k){var C=k[0]-Y[0],M=k[1]-Y[1];return Math.hypot(C,M);}function g(Y,k){var C=k[0]-Y[0],M=k[1]-Y[1];return C*C+M*M;}function O(Y){var k=Y[0],C=Y[1];return Math.hypot(k,C);}function w(Y){var k=Y[0],C=Y[1];return k*k+C*C;}function L(Y,k){return Y[0]=-k[0],Y[1]=-k[1],Y;}function B(Y,k){return Y[0]=1/k[0],Y[1]=1/k[1],Y;}function A(Y,k){var C=k[0],M=k[1],j=C*C+M*M;return j>0&&(j=1/Math.sqrt(j)),Y[0]=k[0]*j,Y[1]=k[1]*j,Y;}function b(Y,k){return Y[0]*k[0]+Y[1]*k[1];}function W(Y,k,C){var M=k[0]*C[1]-k[1]*C[0];return Y[0]=Y[1]=0,Y[2]=M,Y;}function D(Y,k,C,M){var j=k[0],G=k[1];return Y[0]=j+M*(C[0]-j),Y[1]=G+M*(C[1]-G),Y;}function R(Y,k){k=k||1;var C=r.RANDOM()*2*Math.PI;return Y[0]=Math.cos(C)*k,Y[1]=Math.sin(C)*k,Y;}function X(Y,k,C){var M=k[0],j=k[1];return Y[0]=C[0]*M+C[2]*j,Y[1]=C[1]*M+C[3]*j,Y;}function H(Y,k,C){var M=k[0],j=k[1];return Y[0]=C[0]*M+C[2]*j+C[4],Y[1]=C[1]*M+C[3]*j+C[5],Y;}function J(Y,k,C){var M=k[0],j=k[1];return Y[0]=C[0]*M+C[3]*j+C[6],Y[1]=C[1]*M+C[4]*j+C[7],Y;}function et(Y,k,C){var M=k[0],j=k[1];return Y[0]=C[0]*M+C[4]*j+C[12],Y[1]=C[1]*M+C[5]*j+C[13],Y;}function it(Y,k,C,M){var j=k[0]-C[0],G=k[1]-C[1],Q=Math.sin(M),_=Math.cos(M);return Y[0]=j*_-G*Q+C[0],Y[1]=j*Q+G*_+C[1],Y;}function $(Y,k){var C=Y[0],M=Y[1],j=k[0],G=k[1],Q=Math.sqrt(C*C+M*M)*Math.sqrt(j*j+G*G),_=Q&&(C*j+M*G)/Q;return Math.acos(Math.min(Math.max(_,-1),1));}function V(Y){return Y[0]=0,Y[1]=0,Y;}function rt(Y){return"vec2("+Y[0]+", "+Y[1]+")";}function lt(Y,k){return Y[0]===k[0]&&Y[1]===k[1];}function ct(Y,k){var C=Y[0],M=Y[1],j=k[0],G=k[1];return Math.abs(C-j)<=r.EPSILON*Math.max(1,Math.abs(C),Math.abs(j))&&Math.abs(M-G)<=r.EPSILON*Math.max(1,Math.abs(M),Math.abs(G));}var gt=O,st=m,Ct=f,xt=v,F=d,U=g,K=w,q=function(){var Y=n();return function(k,C,M,j,G,Q){var _,nt;for(C||(C=2),M||(M=0),j?nt=Math.min(j*C+M,k.length):nt=k.length,_=M;_<nt;_+=C)Y[0]=k[_],Y[1]=k[_+1],G(Y,Y,Q),k[_]=Y[0],k[_+1]=Y[1];return k;};}();},/* 12 *//***/function(u,e,t){t.r(e);var r=t(13);t.d(e,"Renderer",function(){return r["default"];});var n=t(40);t.d(e,"Figure2D",function(){return n["default"];});var i=t(56);t.d(e,"Mesh2D",function(){return i["default"];});var l=t(29);t.d(e,"MeshCloud",function(){return l["default"];});var o=t(23);t.d(e,"parseFont",function(){return o["default"];});var a=t(31);t.d(e,"parseColor",function(){return a["default"];});var c=t(21);t.d(e,"ENV",function(){return c["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return B;});var r=t(14),n=t(1),i=t(20),l=t(27),o=t(25),a=t(40),c=t(56),m=t(29),f=t(59),v=t(21),S=t(63);t(1).glMatrix.setMatrixArrayType(Array);var E={autoUpdate:!1,// premultipliedAlpha: true,
2
- preserveDrawingBuffer:!1,// depth: false,
3
- // antialias: false,
4
- bufferSize:1500},T="attribute vec3 a_vertexPosition;\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\nvoid main() {\n gl_PointSize = 1.0;\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0); \n vTextureCoord = a_vertexTextureCoord; \n}\n",P="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",x=Symbol("glRenderer"),h=Symbol("canvasRenderer"),p=Symbol("options"),d=Symbol("globalTransform"),g=Symbol("applyGlobalTransform"),O=Symbol("canvas");function w(A){var b=A.gl,W=A.fbo;W&&b.bindFramebuffer(b.FRAMEBUFFER,W),A._draw(),W&&b.bindFramebuffer(b.FRAMEBUFFER,null);}function L(A,b,W,D){var R=A.createTexture(b.canvas),X=[[[0,0],[W,0],[W,D],[0,D],[0,0]]];X.closed=!0;var H=new c["default"]({contours:X});H.setTexture(R),A.setMeshData([H.meshData]),w(A),R["delete"](),b.clearRect(0,0,W,D),delete b._filter;}var B=/*#__PURE__*/function(){function B(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,B);var D=W.contextType;if(D||(typeof WebGL2RenderingContext=="function"?D="webgl2":typeof WebGLRenderingContext=="function"?D="webgl":D="2d"),!b.getContext){var R=b;b={getContext:function getContext(){return R;},width:W.width,height:W.height},R.canvas=b,D="2d";}if(this[O]=b,D!=="webgl"&&D!=="webgl2"&&D!=="2d")throw new Error("Unknown context type ".concat(D));if(W.contextType=D,this[p]=Object.assign({},E,W),D==="webgl"||D==="webgl2"){D==="webgl2"&&(this[p].webgl2=!0);var _R=new r["default"](b,this[p]);D==="webgl2"&&!_R.isWebGL2&&(W.contextType="webgl"),Object(S.createShaders)(_R),Object(S.applyShader)(_R),Object(S.createCloudShaders)(_R);var X=_R.gl;X.clearColor(0,0,0,0),X.blendFuncSeparate(X.SRC_ALPHA,X.ONE_MINUS_SRC_ALPHA,X.ONE,X.ONE_MINUS_SRC_ALPHA),this[x]=_R;}else this[h]=new i["default"](b,this[p]);this[d]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(B,[{key:"canvas",get:function get(){return this[O];}},{key:"canvasRenderer",get:function get(){return this[h];}},{key:"glRenderer",get:function get(){return this[x];}},{key:"isWebGL2",get:function get(){return this[x]&&this[x].isWebGL2;}},{key:"options",get:function get(){return this[p];}},{key:"globalTransformMatrix",get:function get(){var b=this[d];return[b[0],b[1],b[3],b[4],b[6],b[7]];}},{key:"viewMatrix",get:function get(){return this[d];}},{key:g,value:function value(){var b=this[x]||this[h];if(this[x]){var _this$canvas=this.canvas,W=_this$canvas.width,D=_this$canvas.height;b.uniforms.viewMatrix=this.viewMatrix,b.uniforms.projectionMatrix=this.projectionMatrix,b.uniforms.u_resolution=[W,D];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,b=_this$canvas2.width,W=_this$canvas2.height,D=[// translation
5
- 1,0,0,0,1,0,-b/2,-W/2,1],R=[// scale
6
- 2/b,0,0,0,-2/W,0,0,0,1],X=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,D);this.projectionMatrix=X,this[x]&&this[x].gl.viewport(0,0,b,W);}},{key:"createTexture",value:function createTexture(b,W){return(this[x]||this[h]).createTexture(b,W);}/* async */},{key:"loadTexture",value:function loadTexture(b){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref$useImageBitmap=_ref.useImageBitmap,W=_ref$useImageBitmap===void 0?!1:_ref$useImageBitmap;return(this[x]||this[h]).loadTexture(b,{useImageBitmap:W});}},{key:"createText",value:function createText(b){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref2$font=_ref2.font,W=_ref2$font===void 0?"16px arial":_ref2$font,_ref2$fillColor=_ref2.fillColor,D=_ref2$fillColor===void 0?null:_ref2$fillColor,_ref2$strokeColor=_ref2.strokeColor,R=_ref2$strokeColor===void 0?null:_ref2$strokeColor,_ref2$strokeWidth=_ref2.strokeWidth,X=_ref2$strokeWidth===void 0?1:_ref2$strokeWidth;if(this[x]){var H=v["default"].createText(b,{font:W,fillColor:D,strokeColor:R,strokeWidth:X});return{image:this.createTexture(H.image),rect:H.rect};}return{_img:{font:W,fillColor:D,strokeColor:R,strokeWidth:X,text:b}};}},{key:"createProgram",value:function createProgram(){var _ref3=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},b=_ref3.vertex,W=_ref3.fragment,D=_ref3.options;if(this[x]){var R=this[x].compileSync(W,b);return R._attribOpts=D,R;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref4=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref4$vertex=_ref4.vertex,b=_ref4$vertex===void 0?T:_ref4$vertex,_ref4$fragment=_ref4.fragment,W=_ref4$fragment===void 0?P:_ref4$fragment,D=_ref4.options;return this.createProgram({vertex:b,fragment:W,options:D});}},{key:"useProgram",value:function useProgram(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[x]){var D=Object.assign({},b._attribOpts,W);return this[x].useProgram(b,D);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(b){return(this[x]||this[h]).deleteTexture(b);}},{key:"clear",value:function clear(){var _this$h;if(this[x]){var W=this[x].gl;W.clear(W.COLOR_BUFFER_BIT);}else(_this$h=this[h]).clear.apply(_this$h,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(b){var _ref5=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref5$clear=_ref5.clear,W=_ref5$clear===void 0?!1:_ref5$clear,_ref5$program=_ref5.program,D=_ref5$program===void 0?null:_ref5$program;var R=this[x]||this[h],X=D||b.program;if(this[x]){var H=R.gl;if(W&&H.clear(H.COLOR_BUFFER_BIT),X)R.program!==X&&this.useProgram(X,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});else{var J=b.mesh.meshData,et=!!J.uniforms.u_texSampler,it=!!J.uniforms.u_filterFlag,$=!!J.uniforms.u_radialGradientVector,V=b.hasCloudColor,rt=b.hasCloudFilter,lt=!!J.uniforms.u_clipSampler;Object(S.applyCloudShader)(R,{hasTexture:et,hasFilter:it,hasGradient:$,hasCloudColor:V,hasCloudFilter:rt,hasClipPath:lt});}this[g](),R.setMeshData([b.meshData]),b.beforeRender&&b.beforeRender(H,b),w(R),b.afterRender&&b.afterRender(H,b);}else R.setTransform(this.globalTransformMatrix),R.drawMeshCloud(b,{clear:W,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(b){var _this=this;var _ref6=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref6$clear=_ref6.clear,W=_ref6$clear===void 0?!1:_ref6$clear,_ref6$program=_ref6.program,D=_ref6$program===void 0?null:_ref6$program;var R=this[x]||this[h];if(this[x]){var X=R.fbo,H=Object(l["default"])(this,b,D==null),J=R.gl;W&&J.clear(J.COLOR_BUFFER_BIT);var et=!Object(f.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator2=_createForOfIteratorHelper(H),_step2;try{var _loop=function _loop(){var it=_step2.value;_this._drawCalls++;var $=D||it.program;if(it instanceof m["default"])_this.drawMeshCloud(it,{clear:W,program:$});else{var _this$canvas3=_this.canvas,V=_this$canvas3.width,rt=_this$canvas3.height;if(it.beforeRender&&it.beforeRender(J,it),it.pass.length&&((!_this.fbo||_this.fbo.width!==V||_this.fbo.height!==rt)&&(_this.fbo={width:V,height:rt,target:R.createFBO(),buffer:R.createFBO(),swap:function swap(){var _ref7=[this.buffer,this.target];this.target=_ref7[0];this.buffer=_ref7[1];}}),R.bindFBO(_this.fbo.target)),!$&&it.filterCanvas){Object(S.applyShader)(R,{hasTexture:!0});var lt=_this.filterContext;lt||(lt=v["default"].createCanvas(V,rt).getContext("2d"),_this.filterContext=lt);var ct=b[it.packIndex],gt=ct.filter,st=b[it.packIndex+1],Ct=b[it.packIndex-1];(!Ct||!Ct.filterCanvas||Ct.filter!==gt)&&(!st||!st.filterCanvas||st.filter!==gt)?(et?(lt.save(),Object(o.drawMesh2D)(ct,lt,!1),lt.restore(),Object(o.applyFilter)(lt,gt)):Object(o.drawMesh2D)(ct,lt,!0),_this[g](),L(R,lt,V,rt)):(et&&lt.save(),Object(o.drawMesh2D)(ct,lt,!1),et&&lt.restore(),(!st||!st.filterCanvas||ct.filter!==st.filter)&&(Object(o.applyFilter)(lt,gt),_this[g](),L(R,lt,V,rt)));}else{if($)R.program!==$&&_this.useProgram($,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _lt=!!it.uniforms.u_texSampler,_ct=!!it.uniforms.u_filterFlag,_gt=!!it.uniforms.u_radialGradientVector,_st=!!it.uniforms.u_clipSampler;Object(S.applyShader)(R,{hasTexture:_lt,hasFilter:_ct,hasGradient:_gt,hasClipPath:_st});}it.filterCanvas&&console.warn("User program ignored some filter effects."),_this[g](),R.setMeshData([it]),w(R);}if(it.pass.length){var _lt2=it.pass.length;it.pass.forEach(function(ct,gt){ct.blend=it.enableBlend,ct.setTexture(R.fbo.texture),gt===_lt2-1?R.bindFBO(X):(_this.fbo.swap(),R.bindFBO(_this.fbo.target)),ct.program?R.useProgram(ct.program):(_this.defaultPassProgram=_this.defaultPassProgram||_this.createPassProgram(),R.useProgram(_this.defaultPassProgram)),R.setMeshData([ct.meshData]),J.clear(J.COLOR_BUFFER_BIT),w(R);});}it.afterRender&&it.afterRender(J,it);}};for(_iterator2.s();!(_step2=_iterator2.n()).done;){_loop();}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}else R.setTransform(this.globalTransformMatrix),R.drawMeshes(b,{clear:W});}},{key:"drawImage",value:function drawImage(b){for(var _len=arguments.length,W=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){W[_key-1]=arguments[_key];}var D=W.length;if(D<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(W.length+1," present."));if(D!==2&&D!==4&&D!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat(W.length+1," arguments provided."));var R=null,X=null;D===2?R=[W[0],W[1],b.width,b.height]:D===4?R=W:D===8&&(X=W.slice(0,4),R=W.slice(4));var H=this.createTexture(b),_this$canvas4=this.canvas,J=_this$canvas4.width,et=_this$canvas4.height,it=new a["default"]();it.rect(R[0],R[1],J,et);var $=new c["default"](it,{width:J,height:et});$.setTexture(H,{rect:R,srcRect:X}),this.drawMeshes([$]),this.deleteTexture(H);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[d]=[arguments.length<=0?undefined:arguments[0],arguments.length<=1?undefined:arguments[1],0,arguments.length<=2?undefined:arguments[2],arguments.length<=3?undefined:arguments[3],0,arguments.length<=4?undefined:arguments[4],arguments.length<=5?undefined:arguments[5],1],this;}},{key:"globalTransform",value:function globalTransform(){var W=this[d];for(var _len2=arguments.length,b=new Array(_len2),_key2=0;_key2<_len2;_key2++){b[_key2]=arguments[_key2];}return this[d]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,b),this;}},{key:"globalTranslate",value:function globalTranslate(b,W){var D=n.mat3.create();return D=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),D,[b,W]),this.globalTransform.apply(this,_toConsumableArray(D));}},{key:"globalRotate",value:function globalRotate(b){var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref9=_slicedToArray(_ref8,2),W=_ref9[0],D=_ref9[1];var R=n.mat3.create();return R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[W,D]),R=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),R,b),R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[-W,-D]),this.globalTransform.apply(this,_toConsumableArray(R));}},{key:"globalScale",value:function globalScale(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:b;var _ref10=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref11=_slicedToArray(_ref10,2),D=_ref11[0],R=_ref11[1];var X=n.mat3.create();return X=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),X,[D,R]),X=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),X,[b,W]),X=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),X,[-D,-R]),this.globalTransform.apply(this,_toConsumableArray(X));}},{key:"globalSkew",value:function globalSkew(b){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:b;var _ref12=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref13=_slicedToArray(_ref12,2),D=_ref13[0],R=_ref13[1];var X=n.mat3.create();return X=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),X,[D,R]),X=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),X,n.mat3.fromValues(1,Math.tan(W),Math.tan(b),1,0,0)),X=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),X,[-D,-R]),this.globalTransform.apply(this,_toConsumableArray(X));}},{key:"transformPoint",value:function transformPoint(b,W,D){var R=this.globalTransformMatrix;D&&(R=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),R,D));var X=b*R[0]+W*R[2]+R[4],H=b*R[1]+W*R[3]+R[5];return[X,H];}}]);}();},/* 14 *//***/function(u,e,t){t.r(e);var r=t(15);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r["default"];},/* 15 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return S;});var r=t(16),n=t(17),i=t(18),l=t(19);t(1).glMatrix.setMatrixArrayType(Array);function o(E,T,P){return T in E?Object.defineProperty(E,T,{value:P,enumerable:!0,configurable:!0,writable:!0}):E[T]=P,E;}var a={};function c(E){var T=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var P=[],x=E.length;for(var h=0;h<x;h++)h%T<2&&P.push(0.5*(E[h]+1));return P;}function m(E,T){var P=T._buffers;Object.values(P).forEach(function(x){E.deleteBuffer(x);}),T._buffers={};}function f(E,T,P){return E.activeTexture(E.TEXTURE0+P),Array.isArray(T._img)?E.bindTexture(E.TEXTURE_CUBE_MAP,T):E.bindTexture(E.TEXTURE_2D,T),T;}var v={"int":"1i",ivec2:"2i",ivec3:"3i",ivec4:"4i","float":"1f",vec2:"2f",vec3:"3f",vec4:"4f",mat2:"Matrix2fv",mat3:"Matrix3fv",mat4:"Matrix4fv",sampler1D:"sampler1D",sampler2D:"sampler2D",sampler3D:"sampler3D",samplerCube:"samplerCube",sampler1DShadow:"sampler1DShadow",sampler2DShadow:"sampler2DShadow",sampler2DRect:"sampler2DRect",sampler2DRectShadow:"sampler2DRectShadow"};var S=/*#__PURE__*/function(){function S(T){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,S);this.options=Object.assign({},S.defaultOptions,P),this.canvas=T;var x;this.options.webgl2&&(x=T.getContext("webgl2",this.options)),x==null&&(x=Object(r.setupWebGL)(T,this.options),this.aia_ext=x.getExtension("ANGLE_instanced_arrays")),this.gl=x,x.viewport(0,0,T.width,T.height),x.clearColor(0,0,0,0),x.blendFuncSeparate(x.SRC_ALPHA,x.ONE_MINUS_SRC_ALPHA,x.ONE,x.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(S,[{key:"program",get:function get(){var T=this.gl;return T.getParameter(T.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
7
- // WebGLRenderingContext.uniformMatrix[234]fv()
8
- },{key:"_declareUniform",value:function _declareUniform(T,P){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var h=this.gl,p=h.getUniformLocation(T,P);var d;var g=this;if(/^sampler/.test(x)){var O=T._samplerMap,w=T._bindTextures;Object.defineProperty(T.uniforms,P,{get:function get(){return d;},set:function set(L){d=L;var B=O[P]!=null?O[P]:w.length;w[B]=L,f(h,L,B),O[P]||(O[P]=B,h.uniform1i(p,B)),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}else{var _O=x.indexOf("Matrix")===0,_w=!_O&&/v$/.test(x),L=h["uniform".concat(x)].bind(h);Object.defineProperty(T.uniforms,P,{get:function get(){return d;},set:function set(B){d=B,typeof B=="number"&&(B=[B]),_O?L(p,!1,B):_w?L(p,B):L.apply(void 0,[p].concat(_toConsumableArray(B))),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this2=this;var T=this.program;T.meshData.forEach(function(P,x){var h=P.positions,p=P.cells,d=P.instanceCount,g=P.cellsCount,O=P.attributes,w=P.uniforms,L=P.textureCoord,B=P.enableBlend,A=_this2.gl;var b=P.mode!=null?P.mode:A.TRIANGLES;typeof b=="string"&&(b=A[b]),B?A.enable(A.BLEND):A.disable(A.BLEND),A.bindBuffer(A.ARRAY_BUFFER,T._buffers.verticesBuffer),A.bufferData(A.ARRAY_BUFFER,h,A.STATIC_DRAW),p&&(A.bindBuffer(A.ELEMENT_ARRAY_BUFFER,T._buffers.cellsBuffer),A.bufferData(A.ELEMENT_ARRAY_BUFFER,p,A.STATIC_DRAW));var W=[];O&&Object.values(O).forEach(function(_ref14){var R=_ref14.name,X=_ref14.data,H=_ref14.divisor;if(A.bindBuffer(A.ARRAY_BUFFER,T._buffers[R]),A.bufferData(A.ARRAY_BUFFER,X,A.STATIC_DRAW),H!=null){var J=A.getAttribLocation(T,R);J>=0&&(A.enableVertexAttribArray(J),W.push(J),A.vertexAttribDivisor?A.vertexAttribDivisor(J,H):_this2.aia_ext&&_this2.aia_ext.vertexAttribDivisorANGLE(J,H));}}),w&&Object.entries(w).forEach(function(_ref15){var _ref16=_slicedToArray(_ref15,2),R=_ref16[0],X=_ref16[1];_this2.uniforms[R]=X;});var D;if(!p){var R=T._dimension;D=h.length/R;}if(T._enableTextures&&T._buffers.texCoordBuffer){var _R2=L||c(h,T._dimension);A.bindBuffer(A.ARRAY_BUFFER,T._buffers.texCoordBuffer),A.bufferData(A.ARRAY_BUFFER,S.FLOAT(_R2),A.STATIC_DRAW);}d!=null?(p?A.drawElementsInstanced?A.drawElementsInstanced(b,g,A.UNSIGNED_SHORT,0,d):_this2.aia_ext&&_this2.aia_ext.drawElementsInstancedANGLE(b,g,A.UNSIGNED_SHORT,0,d):A.drawArraysInstanced?A.drawArraysInstanced(b,0,D,d):_this2.aia_ext.drawArraysInstancedANGLE(b,0,D,d),W.forEach(function(R){A.vertexAttribDivisor?A.vertexAttribDivisor(R,null):_this2.aia_ext&&_this2.aia_ext.vertexAttribDivisorANGLE(R,null);})):p?A.drawElements(b,g,A.UNSIGNED_SHORT,0):A.drawArrays(b,0,D);});}},{key:"isWebGL2",get:function get(){return(typeof WebGL2RenderingContext==="undefined"?"undefined":_typeof(WebGL2RenderingContext))<"u"&&this.gl instanceof WebGL2RenderingContext;}},{key:"enableTextures",get:function get(){return this.program&&this.program._enableTextures;}},{key:"uniforms",get:function get(){var T=this.program;if(!T||!T.uniforms)throw Error("No avaliable program.");return T.uniforms;}},{key:"deleteProgram",value:function deleteProgram(T){var P=this.gl;this.program===T&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),P.useProgram(null));var x=this.programs.indexOf(T);x>=0&&this.programs.splice(x,1),m(P,T),P.deleteProgram(T);}/**
9
- [{
10
- positions: ...
11
- cells: ...
12
- textureCoord: ...
13
- attributes: {name: {data:..., normalize: true}},
14
- uniforms: ...
15
- }]
16
- */},{key:"setMeshData",value:function setMeshData(T){var _this3=this;Array.isArray(T)||(T=[T]);var P=this.program;P.meshData=T.map(function(_ref17){var x=_ref17.mode,h=_ref17.positions,p=_ref17.instanceCount,d=_ref17.cells,g=_ref17.cellsCount,O=_ref17.attributes,w=_ref17.uniforms,L=_ref17.textureCoord,B=_ref17.enableBlend;var A={positions:S.FLOAT(h),uniforms:w,enableBlend:!!B,textureCoord:S.FLOAT(L)};if(d&&(A.cells=S.USHORT(d),A.cellsCount=g||A.cells.length),x!=null&&(A.mode=x),p!=null){if(!_this3.isWebGL2&&!_this3.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");A.instanceCount=p;}if(O){var b={};Object.entries(O).forEach(function(_ref18){var _ref19=_slicedToArray(_ref18,2),W=_ref19[0],D=_ref19[1];if(!P._attribute[W])P._attribute[W]="ignored";else if(P._attribute[W]!=="ignored"){var _P$_attribute$W=P._attribute[W],R=_P$_attribute$W.name,X=_P$_attribute$W.type;var H=D.data||D;if(Array.isArray(H)&&(H=S[X](H)),b[W]={name:R,data:H},D.divisor!=null){if(!_this3.isWebGL2&&!_this3.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");b[W].divisor=D.divisor;}}}),A.attributes=b;}return A;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(T,P){var _this4=this;var x=/^\s*uniform\s+sampler/mg.test(T);T==null&&(T=i["default"]),P==null&&(P=x?l["default"]:n["default"]);var h=this.gl,p=Object(r.createProgram)(h,P,T);p.shaderText={vertexShader:P,fragmentShader:T},p._buffers={},p._attribute={},p.uniforms={},p._samplerMap={},p._bindTextures=[];var d=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var g=P.match(d);g&&(p._dimension=Number(g[1]));var O=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");g=P.match(O),g&&(p._texCoordSize=Number(g[1]));var w=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(g=P.match(w),g)for(var A=0;A<g.length;A++){var b=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,W=g[A].match(b);if(W&&W[3]!==this.options.vertexPosition&&W[3]!==this.options.vertexTextureCoord){var _W=_slicedToArray(W,4),D=_W[1],R=_W[2],X=_W[3];D==="mat"&&(R=Math.pow(R,2)),p._buffers[X]=h.createBuffer(),p._attribute[X]={name:X,type:D,size:Number(R)||1};}}var L=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;g=P.match(L)||[],g=g.concat(T.match(L)||[]),g.forEach(function(A){var b=A.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _b$slice=b.slice(1),_b$slice2=_slicedToArray(_b$slice,3),W=_b$slice2[0],D=_b$slice2[1],R=_b$slice2[2];W=v[W],R=!!R,W.indexOf("Matrix")!==0&&R&&(W+="v"),_this4._declareUniform(p,D,W);}),p._buffers.verticesBuffer=h.createBuffer(),p._buffers.cellsBuffer=h.createBuffer();var B=h.getAttribLocation(p,this.options.vertexTextureCoord);return p._enableTextures=B>=0,p._enableTextures&&(p._buffers.texCoordBuffer=h.createBuffer()),this.programs.push(p),p;}},{key:"useProgram",value:function useProgram(T){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var x=this.gl;x.useProgram(T);var h=T._dimension;x.bindBuffer(x.ARRAY_BUFFER,T._buffers.verticesBuffer);var p=x.getAttribLocation(T,this.options.vertexPosition);if(x.vertexAttribPointer(p,h,x.FLOAT,!1,0,0),x.enableVertexAttribArray(p),T._enableTextures){x.bindBuffer(x.ARRAY_BUFFER,T._buffers.texCoordBuffer);var d=x.getAttribLocation(T,this.options.vertexTextureCoord);x.vertexAttribPointer(d,T._texCoordSize||2,x.FLOAT,!1,0,0),x.enableVertexAttribArray(d);}if(Object.entries(T._attribute).forEach(function(_ref20){var _ref21=_slicedToArray(_ref20,2),d=_ref21[0],g=_ref21[1];if(g!=="ignored"){var O=g.size,w=P[d]||{},L=!!w.normalize;var B=w.type||"FLOAT";var A=w.key||d;B==="UBYTE"&&(B="UNSIGNED_BYTE"),B==="USHORT"&&(B="UNSIGNED_SHORT"),g.type=B,A&&A!==d&&(T._attribute[A]=g),x.bindBuffer(x.ARRAY_BUFFER,T._buffers[d]);var b=x.getAttribLocation(T,d);b>=0&&(x.vertexAttribPointer(b,O,x[B],L,0,0),x.enableVertexAttribArray(b));}}),!T.meshData){var _d2=[[-1,-1,0,1].slice(0,h),[1,-1,0,1].slice(0,h),[1,1,0,1].slice(0,h),[-1,1,0,1].slice(0,h)],g=[[0,1,3],[3,1,2]];this.setMeshData({positions:_d2,cells:g});}return T;}},{key:"compileSync",value:function compileSync(T,P){T=T||i["default"];var x={};function h(O){O=O.replace(/^\s*/mg,"");var w=[],L=O.match(/^#pragma\s+include\s+.*/mg);if(L){for(var B=0;B<L.length;B++){var b=L[B].match(/(?:<|")(.*)(?:>|")/);if(b){var W=b[0].indexOf("<")===0?"lib":"link";var D=b[1];if(D==="graph"&&(D="graphics"),x[D])w.push("/* included ".concat(D," */"));else if(x[D]=!0,W==="lib"){var R=h(a[D]);w.push(R);}else if(W==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}w.forEach(function(B){O=O.replace(/^#pragma\s+include\s+.*/m,B);});}return O;}var p=h(T),d=P?h(P):null;return this.createProgram(p,d);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(T,P){var x,h,_h2,p,d;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_h2=function _h4(){_h2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(O){var w,L,B,b,W,D,R,_R3;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:O=O.replace(/^\s*/mg,"");w=[],L=O.match(/^#pragma\s+include\s+.*/mg);if(!L){_context.next=32;break;}B=0;case 4:if(!(B<L.length)){_context.next=31;break;}b=L[B].match(/(?:<|")(.*)(?:>|")/);if(!b){_context.next=28;break;}W=b[0].indexOf("<")===0?"lib":"link";D=b[1];if(!(D==="graph"&&(D="graphics"),x[D])){_context.next=13;break;}w.push("/* included ".concat(D," */"));_context.next=28;break;case 13:if(!(x[D]=!0,W==="lib")){_context.next=20;break;}_context.next=16;return h(a[D]);case 16:R=_context.sent;w.push(R);_context.next=28;break;case 20:if(!(W==="link")){_context.next=28;break;}_context.next=23;return S.fetchShader(D);case 23:_R3=_context.sent;_context.next=26;return h(_R3);case 26:_R3=_context.sent;w.push(_R3);case 28:B++;_context.next=4;break;case 31:w.forEach(function(B){O=O.replace(/^#pragma\s+include\s+.*/m,B);});case 32:return _context.abrupt("return",O);case 33:case"end":return _context.stop();}},_callee);}));return _h2.apply(this,arguments);};h=function _h3(_x3){return _h2.apply(this,arguments);};T=T||i["default"];x={};_context2.next=6;return h(T);case 6:p=_context2.sent;if(!P){_context2.next=13;break;}_context2.next=10;return h(P);case 10:_context2.t0=_context2.sent;_context2.next=14;break;case 13:_context2.t0=null;case 14:d=_context2.t0;return _context2.abrupt("return",this.createProgram(p,d));case 16:case"end":return _context2.stop();}},_callee2,this);}));function compile(_x,_x2){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(T){var P,_args3=arguments;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:P=_args3.length>1&&_args3[1]!==undefined?_args3[1]:null;_context3.next=3;return S.fetchShader(T);case 3:T=_context3.sent;_context3.t0=P;if(!_context3.t0){_context3.next=9;break;}_context3.next=8;return S.fetchShader(P);case 8:P=_context3.sent;case 9:return _context3.abrupt("return",this.compile(T,P));case 10:case"end":return _context3.stop();}},_callee3,this);}));function load(_x4){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this5=this;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref22=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref22$wrapS=_ref22.wrapS,P=_ref22$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref22$wrapS,_ref22$wrapT=_ref22.wrapT,x=_ref22$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref22$wrapT,_ref22$minFilter=_ref22.minFilter,h=_ref22$minFilter===void 0?this.gl.LINEAR:_ref22$minFilter,_ref22$magFilter=_ref22.magFilter,p=_ref22$magFilter===void 0?this.gl.LINEAR:_ref22$magFilter;var d=this.gl,g=Array.isArray(T)?d.TEXTURE_CUBE_MAP:d.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),d.activeTexture(d.TEXTURE0+this._max_texture_image_units-1);var O=d.createTexture();d.bindTexture(g,O),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas5=this.canvas,w=_this$canvas5.width,L=_this$canvas5.height;if(T){if(g===d.TEXTURE_CUBE_MAP)for(var B=0;B<6;B++)d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+B,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,T[B]);else d.texImage2D(g,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,T);}else if(g===d.TEXTURE_CUBE_MAP)for(var _B=0;_B<6;_B++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_B,0,d.RGBA,w,L,0,d.RGBA,d.UNSIGNED_BYTE,null);else d.texImage2D(g,0,d.RGBA,w,L,0,d.RGBA,d.UNSIGNED_BYTE,null);return d.texParameteri(g,d.TEXTURE_MIN_FILTER,h),d.texParameteri(g,d.TEXTURE_MAG_FILTER,p),d.texParameteri(g,d.TEXTURE_WRAP_S,P),d.texParameteri(g,d.TEXTURE_WRAP_T,x),g===d.TEXTURE_CUBE_MAP&&(T.width=T[0].width,T.height=T[0].height),d.bindTexture(g,null),O._img=T||{width:w,height:L},O["delete"]=function(){_this5.deleteTexture(O);},O;}},{key:"deleteTexture",value:function deleteTexture(T){var P=T._img;this.gl.deleteTexture(T),typeof P.close=="function"&&P.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(T){var _ref23,_ref23$useImageBitmap,P,x,_args4=arguments;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_ref23=_args4.length>1&&_args4[1]!==undefined?_args4[1]:{},_ref23$useImageBitmap=_ref23.useImageBitmap,P=_ref23$useImageBitmap===void 0?!0:_ref23$useImageBitmap;_context4.next=3;return S.loadImage(T,{useImageBitmap:P});case 3:x=_context4.sent;return _context4.abrupt("return",this.createTexture(x));case 5:case"end":return _context4.stop();}},_callee4,this);}));function loadTexture(_x5){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref24=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref24$color=_ref24.color,T=_ref24$color===void 0?1:_ref24$color,_ref24$blend=_ref24.blend,P=_ref24$blend===void 0?!1:_ref24$blend,_ref24$depth=_ref24.depth,x=_ref24$depth===void 0?this.options.depth!==!1:_ref24$depth,_ref24$stencil=_ref24.stencil,h=_ref24$stencil===void 0?!!this.options.stencil:_ref24$stencil;var p=this.gl,d=p.createFramebuffer();p.bindFramebuffer(p.FRAMEBUFFER,d);var g=[];for(var L=0;L<T;L++){var B=this.createTexture();p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0+L,p.TEXTURE_2D,B,0/* level */),g.push(B);}d.textures=g,d.texture=g[0],d.blend=P;var _this$canvas6=this.canvas,O=_this$canvas6.width,w=_this$canvas6.height;return x&&!h&&(d.depthBuffer=p.createRenderbuffer(),p.bindRenderbuffer(p.RENDERBUFFER,d.depthBuffer),p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_COMPONENT16,O,w),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_ATTACHMENT,p.RENDERBUFFER,d.depthBuffer)),h&&!x&&(d.stencilBuffer=p.createRenderbuffer(),p.bindRenderbuffer(p.RENDERBUFFER,d.stencilBuffer),p.renderbufferStorage(p.RENDERBUFFER,p.STENCIL_INDEX8,O,w),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.STENCIL_ATTACHMENT,p.RENDERBUFFER,d.stencilBuffer)),x&&h&&(d.depthStencilBuffer=p.createRenderbuffer(),p.bindRenderbuffer(p.RENDERBUFFER,d.depthStencilBuffer),p.renderbufferStorage(p.RENDERBUFFER,p.DEPTH_STENCIL,O,w),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.DEPTH_STENCIL_ATTACHMENT,p.RENDERBUFFER,d.depthStencilBuffer)),p.bindFramebuffer(p.FRAMEBUFFER,null),d;}},{key:"bindFBO",value:function bindFBO(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=T;}},{key:"render",value:function render(){var _ref25=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref25$clearBuffer=_ref25.clearBuffer,T=_ref25$clearBuffer===void 0?!0:_ref25$clearBuffer;this.startRender=!0;var P=this.gl;var x=this.program;x||(x=this.createProgram(),this.useProgram(x)),this.fbo&&P.bindFramebuffer(P.FRAMEBUFFER,this.fbo);var h=this.options.depth;h&&P.enable(P.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(h?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var p=this._renderFrameID;this._draw(),this.fbo&&P.bindFramebuffer(P.FRAMEBUFFER,null),this._renderFrameID===p&&(this._renderFrameID=null);}},{key:"update",value:function update(){this.startRender&&this._renderFrameID==null&&(this._renderFrameID=requestAnimationFrame(this.render.bind(this)));}}],[{key:"addLibs",value:function addLibs(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(a,T);}},{key:"FLOAT",value:function FLOAT(T,P){return Object(r.pointsToBuffer)(T,Float32Array,P);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(T,P){return Object(r.pointsToBuffer)(T,Uint8Array,P);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(T,P){return Object(r.pointsToBuffer)(T,Uint16Array,P);}},{key:"BYTE",value:function BYTE(T,P){return Object(r.pointsToBuffer)(T,Int8Array,P);}},{key:"SHORT",value:function SHORT(T,P){return Object(r.pointsToBuffer)(T,Int16Array,P);}}]);}();o(S,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(S,"UBYTE",S.UNSIGNED_BYTE),o(S,"USHORT",S.UNSIGNED_SHORT),o(S,"fetchShader",r.fetchShader),o(S,"loadImage",r.loadImage);},/* 16 *//***/function(u,e,t){t.r(e),t.d(e,"setupWebGL",function(){return n;}),t.d(e,"createProgram",function(){return i;}),t.d(e,"pointsToBuffer",function(){return l;}),t.d(e,"loadImage",function(){return a;}),t.d(e,"fetchShader",function(){return m;}),t(1).glMatrix.setMatrixArrayType(Array);function r(f,v){var S=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var E=null;for(var T=0;T<S.length;++T){try{E=f.getContext(S[T],v);}catch(_unused){}if(E)break;}return E;}function n(f,v){var S=r(f,v);if(!S)throw new Error("Sorry, your browser doesn't support WebGL.");return S;}function i(f,v,S){var E=f.createShader(f.VERTEX_SHADER);if(f.shaderSource(E,v),f.compileShader(E),!f.getShaderParameter(E,f.COMPILE_STATUS)){var _x6="Vertex shader failed to compile. The error log is:".concat(f.getShaderInfoLog(E));throw new Error(_x6);}var T=f.createShader(f.FRAGMENT_SHADER);if(f.shaderSource(T,S),f.compileShader(T),!f.getShaderParameter(T,f.COMPILE_STATUS)){var _x7="Fragment shader failed to compile. The error log is:".concat(f.getShaderInfoLog(T));throw new Error(_x7);}var P=f.createProgram();if(f.attachShader(P,E),f.attachShader(P,T),f.linkProgram(P),!f.getProgramParameter(P,f.LINK_STATUS)){var _x8="Shader program failed to link. The error log is:".concat(f.getProgramInfoLog(P));throw new Error(_x8);}return f.deleteShader(E),f.deleteShader(T),P;}function l(f){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(S&&!(S instanceof v))throw new TypeError("Wrong buffer type.");if(f==null||f instanceof v)return f;if(f[0]==null||f[0].length==null)return S?(S.set(f,0),S):new v(f);var E=f[0].length,T=f.length;S||(S=new v(E*T));var P=0;for(var _x9=0;_x9<T;_x9++)for(var _h5=0;_h5<E;_h5++)S[P++]=f[_x9][_h5];return S;}var o={};function a(f){var _ref26=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref26$useImageBitmap=_ref26.useImageBitmap,v=_ref26$useImageBitmap===void 0?!0:_ref26$useImageBitmap,_ref26$alias=_ref26.alias,S=_ref26$alias===void 0?null:_ref26$alias;if(!o[f]){if(typeof Image=="function"){var E=new Image();typeof f=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(f)&&(E.crossOrigin="anonymous"),o[f]=new Promise(function(T){E.onload=function(){v&&typeof createImageBitmap=="function"?createImageBitmap(E,{imageOrientation:"flipY"}).then(function(P){o[f]=P,S&&(o[S]=P),T(P);}):(o[f]=E,S&&(o[S]=E),T(E));},E.src=f;}),S&&(o[S]=o[f]);}else if(typeof fetch=="function")return fetch(f,{method:"GET",mode:"cors",cache:"default"}).then(function(E){return E.blob();}).then(function(E){return createImageBitmap(E,{imageOrientation:"flipY"}).then(function(T){return o[f]=T,S&&(o[S]=T),T;});});}return o[f];}var c={};function m(_x10){return _m2.apply(this,arguments);}function _m2(){_m2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(f){var v,S;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!c[f]){_context5.next=2;break;}return _context5.abrupt("return",c[f]);case 2:_context5.next=4;return fetch(f);case 4:v=_context5.sent;if(!(v.status>=200&&v.status<300)){_context5.next=10;break;}_context5.next=8;return v.text();case 8:S=_context5.sent;return _context5.abrupt("return",(c[f]=S,S));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context5.stop();}},_callee5);}));return _m2.apply(this,arguments);}},/* 17 *//***/function(u,e,t){t.r(e),e["default"]="attribute vec3 a_vertexPosition;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = vec4(a_vertexPosition, 1);\n}";},/* 18 *//***/function(u,e,t){t.r(e),e["default"]="#ifdef GL_ES\nprecision mediump float;\n#endif\n\nvoid main() {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.1);\n}";},/* 19 *//***/function(u,e,t){t.r(e),e["default"]="attribute vec4 a_vertexPosition;\nattribute vec2 a_vertexTextureCoord;\nvarying vec2 vTextureCoord;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = a_vertexPosition;\n vTextureCoord = a_vertexTextureCoord;\n}";},/* 20 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol("transform");var l=/*#__PURE__*/function(){function l(a,c){_classCallCheck(this,l);this.context=a.getContext("2d"),this.options=c,this[i]=[1,0,0,1,0,0];}return _createClass(l,[{key:"createTexture",value:function createTexture(a){return{_img:a};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(a){var c;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return r["default"].loadImage(a,{useImageBitmap:!1});case 2:c=_context6.sent;return _context6.abrupt("return",this.createTexture(c));case 4:case"end":return _context6.stop();}},_callee6,this);}));function loadTexture(_x11){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(a){return a;}},{key:"clear",value:function clear(a,c,m,f){var v=this.context;a=a||0,c=c||0,m=m||v.canvas.width-a,f=f||v.canvas.height-c,v.clearRect(a,c,m,f);}},{key:"drawMeshCloud",value:function drawMeshCloud(a){var _ref27=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref27$clear=_ref27.clear,c=_ref27$clear===void 0?!1:_ref27$clear;var m=[];for(var f=0;f<a.amount;f++){var v=a.getTransform(f);var S=a.getTextureFrame(f);S&&(S=S._img);var E=a.getFilter(f),_a$getCloudRGBA=a.getCloudRGBA(f),T=_a$getCloudRGBA.fill,P=_a$getCloudRGBA.stroke;m.push({mesh:a.mesh,_cloudOptions:[T,P,S,v,E]});}a.beforeRender&&a.beforeRender(this.context,a),this.drawMeshes(m,{clear:c,hook:!1}),a.afterRender&&a.afterRender(this.context,a);}},{key:"drawMeshes",value:function drawMeshes(a){var _this6=this;var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$clear=_ref28.clear,c=_ref28$clear===void 0?!1:_ref28$clear,_ref28$hook=_ref28.hook,m=_ref28$hook===void 0?!0:_ref28$hook;var f=this.context;c&&f.clearRect(0,0,f.canvas.width,f.canvas.height);var v=null;var _f$canvas=f.canvas,S=_f$canvas.width,E=_f$canvas.height,T=a.length;a.forEach(function(P,x){var _P$_cloudOptions,_this6$filterBuffer;var h,p,d,g,O;m&&P.beforeRender&&P.beforeRender(f,P),P._cloudOptions&&(_P$_cloudOptions=_slicedToArray(P._cloudOptions,5),h=_P$_cloudOptions[0],p=_P$_cloudOptions[1],d=_P$_cloudOptions[2],g=_P$_cloudOptions[3],O=_P$_cloudOptions[4],P=P.mesh);var w=P.filter;if(O&&(w=w?"".concat(w," ").concat(O):O),w&&!_this6.filterBuffer&&_this6.filterBuffer!==!1){var L=r["default"].createCanvas(S,E);L?_this6.filterBuffer=L.getContext("2d"):_this6.filterBuffer=!1;}v&&v!==w&&(Object(n.applyFilter)(_this6.filterBuffer,v),f.drawImage(_this6.filterBuffer.canvas,0,0,S,E),_this6.filterBuffer.clearRect(0,0,S,E),v=null),w&&_this6.filterBuffer?(_this6.filterBuffer.save(),(_this6$filterBuffer=_this6.filterBuffer).transform.apply(_this6$filterBuffer,_toConsumableArray(_this6[i])),Object(n.drawMesh2D)(P,_this6.filterBuffer,!1,h,p,d,g),_this6.filterBuffer.restore(),x===T-1?(Object(n.applyFilter)(_this6.filterBuffer,w),f.drawImage(_this6.filterBuffer.canvas,0,0,S,E),_this6.filterBuffer.clearRect(0,0,S,E)):v=w):(f.save(),f.transform.apply(f,_toConsumableArray(_this6[i])),Object(n.drawMesh2D)(P,f,!1,h,p,d,g),f.restore()),m&&P.afterRender&&P.afterRender(f,P);});}},{key:"setTransform",value:function setTransform(a){this[i]=a;}}]);}();},/* 21 *//***/function(u,e,t){t.r(e),function(r){var n=t(14),i=t(23),l=t(24);t(1).glMatrix.setMatrixArrayType(Array);var o={};function a(S,E){var T=S.style,P=S.variant,x=S.weight,h=S.stretch,p=S.size,d=S.pxLineHeight,g=S.family;return h==="normal"?"".concat(T," ").concat(P," ").concat(x," ").concat(p*E,"px/").concat(d*E,"px ").concat(g):"".concat(T," ").concat(P," ").concat(x," ").concat(h," ").concat(p*E,"px/").concat(d*E,"px ").concat(g);}function c(S,_ref29){var E=_ref29.font,T=_ref29.fillColor,P=_ref29.strokeColor,x=_ref29.strokeWidth,_ref29$ratio=_ref29.ratio,h=_ref29$ratio===void 0?1:_ref29$ratio,p=_ref29.textCanvas,_ref29$cachable=_ref29.cachable,d=_ref29$cachable===void 0?!1:_ref29$cachable;var g;if(d){g=[S,E,String(T),String(P),String(x)].join("###");var H=o[g];if(H)return H;}p||(p=f(1,1));var O=p.getContext("2d");O.save(),O.font=E;var _O$measureText=O.measureText(S),w=_O$measureText.width;O.restore();var L=Object(i["default"])(E),B=Math.max(L.pxLineHeight,L.pxHeight*1.13);/italic|oblique/.test(E)&&(w+=B*Math.tan(15*Math.PI/180)),!T&&!P&&(T="#000");var A=O.canvas,b=Math.ceil(w),W=Math.ceil(B);A.width=Math.round(b*h),A.height=Math.round(W*h),O.save(),O.font=a(L,h),O.textAlign="center",O.textBaseline="middle";var D=A.height*0.5+L.pxHeight*0.05*h,R=A.width*0.5;if(T){if(Array.isArray(T))T=Object(l["default"])(T);else if(T.vector){var _H;var _T=T,J=_T.vector,et=_T.colors;J.length===6?_H=O.createRadialGradient.apply(O,_toConsumableArray(J)):_H=O.createLinearGradient.apply(O,_toConsumableArray(J)),et.forEach(function(_ref30){var it=_ref30.offset,$=_ref30.color;_H.addColorStop(it,$);}),T=_H;}O.fillStyle=T,O.fillText(S,R,D);}if(P){if(O.lineWidth=x*h,Array.isArray(P))P=Object(l["default"])(P);else if(P.vector){var _H2;var _P=P,_J=_P.vector,_et=_P.colors;_J.length===6?_H2=O.createRadialGradient.apply(O,_toConsumableArray(_J)):_H2=O.createLinearGradient.apply(O,_toConsumableArray(_J)),_et.forEach(function(_ref31){var it=_ref31.offset,$=_ref31.color;_H2.addColorStop(it,$);}),P=_H2;}O.strokeStyle=P,O.strokeText(S,R,D);}O.restore();var X={image:p,rect:[0,0,b,W]};return d&&(o[g]=X),X;}var m=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var S=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);S&&(m=Number(S[1])<70);}function f(S,E){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var P=T.offscreen||!m&&T.offscreen!==!1;var x;return _typeof(r)<"u"&&typeof r.createCanvas=="function"?x=r.createCanvas(S,E,T):P&&typeof OffscreenCanvas=="function"?x=new OffscreenCanvas(S,E):(x=document.createElement("canvas"),x.width=S,x.height=E),x;}var v={createCanvas:f,createText:c,loadImage:n["default"].loadImage};e["default"]=v;}.call(this,t(22));},/* 22 *//***/function(u,e){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused2){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}u.exports=t;},/* 23 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return T;}),t(1).glMatrix.setMatrixArrayType(Array);function r(P,x){if(typeof P=="string"){var d=P.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);d?P={size:parseFloat(d[1]),unit:d[2]}:P={size:parseInt(P,10),unit:"px"};}var _P2=P,h=_P2.size,p=_P2.unit;if(p==="pt")h/=0.75;else if(p==="pc")h*=16;else if(p==="in")h*=96;else if(p==="cm")h*=37.79527559055118;else if(p==="mm")h*=3.7795275590551185;else if(p==="em"||p==="rem"||p==="ex"){if(!x&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _d3=getComputedStyle(document.documentElement).fontSize;x=r(_d3,16);}h*=x,p==="ex"&&(h/=2);}else if(p==="q")h*=0.9448818897637796;else if(p==="vw"||p==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _d4=p==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;h*=_d4/100;}}else if((p==="vmax"||p==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _d5=document.documentElement.clientWidth,g=document.documentElement.clientHeight;p==="vmax"?h*=Math.max(_d5,g)/100:h*=Math.min(_d5,g)/100;}return h;}var n="bold|bolder|lighter|[1-9]00",i="italic|oblique",l="small-caps",o="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",a="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",c="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",m=new RegExp("(".concat(n,") +"),"i"),f=new RegExp("(".concat(i,") +"),"i"),v=new RegExp("(".concat(l,") +"),"i"),S=new RegExp("(".concat(o,") +"),"i"),E=new RegExp("([\\d\\.]+)("+a+")(?:\\/([\\d\\.]+)("+a+"))? *((?:"+c+")( *, *(?:"+c+"))*)");function T(P,x){var h=E.exec(P);if(!h)return;var p=parseFloat(h[3]),d={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(h[1]),unit:h[2],lineHeight:Number.isFinite(p)?p:void 0,lineHeightUnit:h[4],family:h[5].replace(/ *, */g,",")},g=P.substring(0,h.index),O=m.exec(g),w=f.exec(g),L=v.exec(g),B=S.exec(g);return O&&(d.weight=O[1]),w&&(d.style=w[1]),L&&(d.variant=L[1]),B&&(d.stretch=B[1]),d.pxHeight=r({size:d.size,unit:d.unit},x),d.pxLineHeight=r({size:d.lineHeight||d.size,unit:d.lineHeightUnit||d.unit},x),d;}},/* 24 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){return"rgba(".concat(n.map(function(i,l){return l<3?Math.round(i*255):i;}).join(),")");}},/* 25 *//***/function(u,e,t){t.r(e),t.d(e,"applyFilter",function(){return o;}),t.d(e,"drawMesh2D",function(){return c;});var r=t(1),n=t(24),i=t(23),l=t(26);t(1).glMatrix.setMatrixArrayType(Array);function o(m,f){var v=m.canvas;m.save(),m.filter=f,m.drawImage(v,0,0,v.width,v.height),m.restore();}function a(m,f){var v=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;m=m.match(v).slice(1,5).map(Number),f=f.match(v).slice(1,5).map(Number);var S=[],E=f[3];for(var T=0;T<4;T++)S[T]=Object(l.mix)(m[T],f[T],E);return"rgba(".concat(S.join(),")");}function c(m,f){var v=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var S=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var E=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var T=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var P=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;f.save();var x=!1,h=!1;if(f.globalAlpha=m.getOpacity(),m._updateMatrix&&m.transformScale/m.contours.scale>1.5&&m.accurate(m.transformScale),m.lineWidth){var g=m.gradient&&m.gradient.stroke;if(g){var _g=g,O=_g.vector,w=_g.colors;if(O.length===6)g=f.createRadialGradient.apply(f,_toConsumableArray(O));else if(O.length===4)g=f.createLinearGradient.apply(f,_toConsumableArray(O));else if(O.length===3)g=f.createCircularGradient.apply(f,_toConsumableArray(O));else throw new TypeError("Invalid vector dimension.");w.forEach(function(_ref32){var L=_ref32.offset,B=_ref32.color;var A=Object(n["default"])(B);E&&(A=a(A,E)),g.addColorStop(L,A);}),f.strokeStyle=g,x=!0;}else m.strokeStyle&&(E?f.strokeStyle=a(m.strokeStyle,E):f.strokeStyle=m.strokeStyle,x=!0);}x&&(f.lineWidth=m.lineWidth,f.lineJoin=m.lineJoin,f.lineCap=m.lineCap,f.miterLimit=m.miterLimit,m.lineDash&&(f.setLineDash(m.lineDash),m.lineDashOffset&&(f.lineDashOffset=m.lineDashOffset)));var p=m.gradient&&m.gradient.fill;if(p){var _p2=p,_g2=_p2.vector,_O2=_p2.colors;if(_g2.length===6)p=f.createRadialGradient.apply(f,_toConsumableArray(_g2));else if(_g2.length===4)p=f.createLinearGradient.apply(f,_toConsumableArray(_g2));else if(_g2.length===3)p=f.createCircularGradient.apply(f,_toConsumableArray(_g2));else throw new TypeError("Invalid vector dimension.");_O2.forEach(function(_ref33){var w=_ref33.offset,L=_ref33.color;var B=Object(n["default"])(L);E&&(B=a(B,E)),p.addColorStop(w,B);}),f.fillStyle=p,h=!0;}else m.fillStyle&&(S?f.fillStyle=a(m.fillStyle,S):f.fillStyle=m.fillStyle,h=!0);if(P&&f.transform.apply(f,_toConsumableArray(P)),f.transform.apply(f,_toConsumableArray(m.transformMatrix)),m.clipPath){var _g3=m.clipPath,_O3=new Path2D(_g3);f.clip(_O3);}var d=m.contours.length;if(m.contours.forEach(function(g,O){var w=g.length,L=w>1&&r.vec2.equals(g[0],g[w-1]),B=O===d-1&&m.texture;if(g&&w>0){if(h||x||B){f.beginPath(),f.moveTo.apply(f,_toConsumableArray(g[0]));for(var A=1;A<w;A++)A===w-1&&L?f.closePath():f.lineTo.apply(f,_toConsumableArray(g[A]));}if(h&&f.fill(m.fillRule),B){f.save(),f.clip();var _m$texture=m.texture,_A=_m$texture.image,b=_m$texture.options;if(T&&(_A=T),b.repeat&&console.warn("Context 2D not supported image repeat yet."),_A.font){b.scale&&console.warn("Context 2D not supported text scale yet."),b.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _A2=_A,W=_A2.font,D=_A2.fillColor,R=_A2.strokeColor,X=_A2.strokeWidth,H=_A2.text;!D&&!R&&(D="#000"),Array.isArray(D)&&(D=Object(n["default"])(D)),Array.isArray(R)&&(R=Object(n["default"])(R)),f.font=W;var _f$measureText=f.measureText(H),J=_f$measureText.width,et=Object(i["default"])(W),it=Math.max(et.pxLineHeight,et.pxHeight*1.13);f.textAlign="center",f.textBaseline="middle";var $=b.rect,V=$[0]+it*0.5+et.pxHeight*0.06,rt=$[1]+J*0.5;$[2]!=null&&f.scale($[2]/J,$[3]/it),D&&(f.fillStyle=D,f.fillText(H,rt,V)),R&&(f.lineWidth=X,f.strokeStyle=R,f.strokeText(H,rt,V));}else{var _W2=b.rect;var _D=b.srcRect;b.scale&&(_W2=[0,0,f.canvas.width,f.canvas.height]),b.rotated&&_W2&&(_W2=[-_W2[1],_W2[0],_W2[3],_W2[2]]),_D&&(_W2=_W2||[0,0,_D[2],_D[3]]),b.rotated&&(f.translate(0,_W2?_W2[2]:_A.width),f.rotate(-0.5*Math.PI)),_D?f.drawImage.apply(f,[_A].concat(_toConsumableArray(_D),_toConsumableArray(_W2))):_W2?f.drawImage.apply(f,[_A].concat(_toConsumableArray(_W2))):f.drawImage(_A,0,0);}f.restore();}x&&f.stroke();}}),f.restore(),v){var _g4=m.filter;_g4&&o(f,_g4);}}},/* 26 *//***/function(u,e,t){t.r(e),t.d(e,"clamp",function(){return r;}),t.d(e,"mix",function(){return n;}),t.d(e,"transformPoint",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);function r(l,o,a){var _ref34;return o>a&&(_ref34=[a,o],o=_ref34[0],a=_ref34[1],_ref34),l<o?o:l>a?a:l;}function n(l,o,a){return l*(1-a)+o*a;}function i(l,o){var _l2=_slicedToArray(l,2),a=_l2[0],c=_l2[1];return[a*o[0]+c*o[2]+o[4],a*o[1]+c*o[3]+o[5]];}},/* 27 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return a;});var r=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(c,m,f){var v=c.uniforms||{},S=m.uniforms||{};if(v.u_texSampler&&S.u_texSampler&&v.u_texSampler!==S.u_texSampler)return!1;var E=Object.keys(v),T=Object.keys(S),P=E.indexOf("u_texSampler"),x=T.indexOf("u_texSampler");if(P>=0&&E.splice(P,1),x>=0&&T.splice(x,1),E.length!==T.length)return!1;var h=E.every(function(p){var d=v[p],g=S[p];if(d===g)return!0;if(d.length&&g.length&&d.length===g.length){for(var O=0;O<d.length;O++)if(d[O]!==g[O])return!1;return!0;}return!1;});if(h){if(v.u_texSampler&&!S.u_texSampler)m.setTexture(v.u_texSampler,{hidden:!0});else if(!v.u_texSampler&&S.u_texSampler)for(var p=0;p<f.length;p++)f[p].setTexture(S.u_texSampler,{hidden:!0});}return h;}var l={};function o(c,m){if(c.length){var f=Object(r["default"])(c,l);return f.enableBlend=m,c[0].filterCanvas&&(f.filterCanvas=!0),f.packIndex=c[0].packIndex,f.packLength=c.length,f.beforeRender=c[0].beforeRender,f.pass=c[0].pass,f.afterRender=c[c.length-1].afterRender,c.length=0,f;}}function a(c,m){var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var v,S,E,T,P,_x12,_h6,d,p,_d6,g;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:v=[],S=c.options.bufferSize;E=0,T=!1;P=0;case 3:if(!(P<m.length)){_context7.next=47;break;}_x12=m[P];if(!(_x12 instanceof n["default"])){_context7.next=16;break;}_context7.t0=v.length;if(!_context7.t0){_context7.next=10;break;}_context7.next=10;return o(v,T);case 10:E=0;T=!1;_context7.next=14;return _x12;case 14:_context7.next=44;break;case 16:_h6=_x12.meshData;if(_h6.clipPath&&!_h6.uniforms.u_clipSampler){d=c.createTexture(_h6.clipPath);_h6.uniforms.u_clipSampler=d;}p=0;if(!((!f||!_x12.canIgnore())&&_h6&&_h6.positions.length)){_context7.next=40;break;}_x12.packIndex=P;_d6=_x12.filterCanvas;if(!(p=_h6.positions.length,_d6||E+p>S)){_context7.next=31;break;}_context7.t1=v.length;if(!_context7.t1){_context7.next=27;break;}_context7.next=27;return o(v,T);case 27:E=0;T=!1;_context7.next=39;break;case 31:if(!E){_context7.next=39;break;}g=v[v.length-1];_context7.t2=g&&(g.filterCanvas||g.afterRender||_x12.beforeRender||g.pass.length||_x12.pass.length||g.program!==_x12.program||!i(g,_x12,v));if(!_context7.t2){_context7.next=39;break;}_context7.next=37;return o(v,T);case 37:E=0;T=!1;case 39:v.push(_x12),T=T||_x12.enableBlend,E+=p;case 40:_context7.t3=P===m.length-1&&v.length;if(!_context7.t3){_context7.next=44;break;}_context7.next=44;return o(v,T);case 44:P++;_context7.next=3;break;case 47:case"end":return _context7.stop();}},_callee7);})();}},/* 28 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);var r={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(l,o){var a=0,c=0,m=0,f=0,v=0,S=0,E=0;var T=l[0].program;for(var P=0;P<l.length;P++){var _x13=l[P].meshData;if(_x13){E+=_x13.positions.length;var _h7=_x13.positions[0].length;a+=_x13.positions.length*_h7,c+=_x13.cells.length*3,S+=_x13.attributes.a_color.length*4;var p=_x13.textureCoord;p&&(m+=p.length*p[0].length);var d=_x13.attributes.a_sourceRect;d&&(f+=d.length*4);var g=_x13.attributes.a_clipUV;g&&(v+=g.length*2);}}if((!o.positions||o.positions.length<a)&&(o.positions=new Float32Array(a)),(!o.cells||o.cells.length<c)&&(o.cells=new Uint16Array(c)),m&&(!o.textureCoord||o.textureCoord.length<m)&&(o.textureCoord=new Float32Array(m)),(!o.a_color||o.a_color.length<S)&&(o.a_color=new Uint8Array(S)),f&&(!o.a_sourceRect||o.a_sourceRect.length<f)&&(o.a_sourceRect=new Float32Array(f)),v&&(!o.a_clipUV||o.a_clipUV.length<v)&&(o.a_clipUV=new Float32Array(v)),T){var _P3=Object.entries(T._attribute),_x14=T._attribOpts||{};for(var _h8=0;_h8<_P3.length;_h8++){var _P3$_h=_slicedToArray(_P3[_h8],2),_p3=_P3$_h[0],_d7=_P3$_h[1];if(_p3!=="a_color"&&_p3!=="a_sourceRect"&&_d7!=="ignored"){var _g5=_x14[_p3]?_x14[_p3].type:"FLOAT",O=r[_g5],w=_d7.size*E;(!o[_p3]||o[_p3].length<w)&&(o[_p3]=new O(w));}}}return o;}function i(l,o){var a=[],c=[],m=[],f=[],v=[],S=[],E=0,T=0;var P=l[0]?l[0].uniforms||{}:{},x=l[0]?l[0].program:null;o&&(n(l,o),c=o.cells,a=o.positions,m=o.textureCoord,f=o.a_color,v=o.a_sourceRect,S=o.a_clipUV);var h=!1,p=!1;var d={};for(var O=0;O<l.length;O++){var w=l[O];if(w){var _a2,_f2,_v2,_S,_m3;if(w.meshData&&(w=w.meshData),o){var B=w.positions;for(var A=0;A<B.length;A++){var b=B[A],W=3*(E+A);for(var D=0;D<b.length;D++)a[W+D]=b[D];}}else(_a2=a).push.apply(_a2,_toConsumableArray(w.positions));var L=w.cells;for(var _B2=0;_B2<L.length;_B2++){var _A3=L[_B2];if(o){var _b=3*(T+_B2);c[_b]=_A3[0]+E,c[_b+1]=_A3[1]+E,c[_b+2]=_A3[2]+E;}else c.push([_A3[0]+E,_A3[1]+E,_A3[2]+E]);}if(o){var _B3=w.attributes.a_color;for(var _A4=0;_A4<_B3.length;_A4++){var _b2=_B3[_A4],_W3=4*(E+_A4);f[_W3]=_b2[0],f[_W3+1]=_b2[1],f[_W3+2]=_b2[2],f[_W3+3]=_b2[3];}}else(_f2=f).push.apply(_f2,_toConsumableArray(w.attributes.a_color));if(w.attributes.a_sourceRect)if(h=!0,o){var _B4=w.attributes.a_sourceRect;for(var _A5=0;_A5<_B4.length;_A5++){var _b3=_B4[_A5],_W4=4*(E+_A5);v[_W4]=_b3[0],v[_W4+1]=_b3[1],v[_W4+2]=_b3[2],v[_W4+3]=_b3[3];}}else(_v2=v).push.apply(_v2,_toConsumableArray(w.attributes.a_sourceRect));if(w.attributes.a_clipUV)if(p=!0,o){var _B5=w.attributes.a_clipUV;for(var _A6=0;_A6<_B5.length;_A6++){var _b4=_B5[_A6],_W5=2*(E+_A6);S[_W5]=_b4[0],S[_W5+1]=_b4[1];}}else(_S=S).push.apply(_S,_toConsumableArray(w.attributes.a_clipUV));if(w.textureCoord)if(o){var _B6=w.textureCoord;for(var _A7=0;_A7<_B6.length;_A7++){var _b5=_B6[_A7],_W6=3*(E+_A7);for(var _D2=0;_D2<_b5.length;_D2++)m[_W6+_D2]=_b5[_D2];}}else(_m3=m).push.apply(_m3,_toConsumableArray(w.textureCoord));if(x){var _B7=Object.entries(x._attribute);for(var _A8=0;_A8<_B7.length;_A8++){var _d$_b;var _B7$_A=_slicedToArray(_B7[_A8],2),_b6=_B7$_A[0],_W7=_B7$_A[1];if(_b6!=="a_color"&&_b6!=="a_sourceRect"&&_W7!=="ignored")if(d[_b6]=[],o){d[_b6]=o[_b6];var _D3=w.attributes[_b6],R=_D3[0].length;for(var X=0;X<_D3.length;X++){var H=_D3[X],J=R*(E+X);for(var et=0;et<H.length;et++)d[_b6][J+et]=H[et];}}else(_d$_b=d[_b6]).push.apply(_d$_b,_toConsumableArray(w.attributes[_b6]));}}E+=w.positions.length,T+=w.cells.length;}}d.a_color=f,h&&v&&v.length>0&&(d.a_sourceRect=v);var g={positions:a,cells:c,attributes:d,uniforms:P,cellsCount:T*3,program:x};return m&&m.length&&(g.textureCoord=m),p&&S.length>0&&(d.a_clipUV=S),g;}},/* 29 *//***/function(u,e,t){t.r(e);var r=t(1),n=t(30),i=t(26),l=t(31);t(1).glMatrix.setMatrixArrayType(Array);function o(d,g){var O=Object.keys(d);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(d);g&&(w=w.filter(function(L){return Object.getOwnPropertyDescriptor(d,L).enumerable;})),O.push.apply(O,w);}return O;}function a(d){for(var g=1;g<arguments.length;g++){var O=arguments[g]!=null?arguments[g]:{};g%2?o(Object(O),!0).forEach(function(w){c(d,w,O[w]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(O)):o(Object(O)).forEach(function(w){Object.defineProperty(d,w,Object.getOwnPropertyDescriptor(O,w));});}return d;}function c(d,g,O){return g in d?Object.defineProperty(d,g,{value:O,enumerable:!0,configurable:!0,writable:!0}):d[g]=O,d;}var m=Symbol("mesh"),f=Symbol("count"),v=Symbol("blend"),S=Symbol("filter"),E=Symbol("textures"),T=Symbol("textureOptions"),P=Symbol("cloudColor"),x=Symbol("cloudFilter"),h=Symbol("buffer");function p(d){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var O=new Float32Array(3*d),w=new Float32Array(3*d),L=new Float32Array(4*d),B=new Float32Array(4*d),A=new Float32Array(4*d),b=new Float32Array(4*d),W=new Float32Array(4*d),D=new Uint8Array(d),R=new Uint8Array(4*d),X=new Uint8Array(4*d);return g&&(O.set(g.transform0,0),w.set(g.transform1,0),L.set(g.color0,0),B.set(g.color1,0),A.set(g.color2,0),b.set(g.color3,0),W.set(g.color4,0),D.set(g.frameIndex,0),R.set(g.fillColor,0),X.set(g.strokeColor,0)),{bufferSize:d,transform0:O,transform1:w,color0:L,color1:B,color2:A,color3:b,color4:W,frameIndex:D,fillColor:R,strokeColor:X};}e["default"]=/*#__PURE__*/function(){function _class(d){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref35=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref35$buffer=_ref35.buffer,O=_ref35$buffer===void 0?1e3:_ref35$buffer;_classCallCheck(this,_class);O=Math.max(O,g),this[f]=g,this[m]=d,this[h]=p(O),this[E]=[],this[S]=[],this[P]=!1,this[x]=!1,this[v]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var d=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var g=this[f];for(var O=d;O<g;O++)this[h].transform0.set([1,0,0],O*3),this[h].transform1.set([0,1,0],O*3),this[h].frameIndex.set([-1],O),this[h].fillColor.set([0,0,0,0],O*4),this[h].strokeColor.set([0,0,0,0],O*4),this.setColorTransform(O,null);}},{key:"bufferSize",get:function get(){return this[h].bufferSize;}},{key:"mesh",get:function get(){return this[m];},set:function set(d){this[m]=d,this[E]&&this.setTextureFrames(this[E],this[T]);}},{key:"hasCloudColor",get:function get(){return this[P];}},{key:"hasCloudFilter",get:function get(){return this[x];}},{key:"_getFilter",value:function _getFilter(d){return this[S][d]=this[S][d]||[],this[S][d];}},{key:"getFilter",value:function getFilter(d){return this._getFilter(d).join(" ");}},{key:"enableBlend",get:function get(){return this[m].enableBlend||this[v];}},{key:"canIgnore",value:function canIgnore(){return this[m].canIgnore();}},{key:"delete",value:function _delete(d){if(d>=this[f]||d<0)throw new Error("Out of range.");var _this$h2=this[h],g=_this$h2.transform0,O=_this$h2.transform1,w=_this$h2.color0,L=_this$h2.color1,B=_this$h2.color2,A=_this$h2.color3,b=_this$h2.color4,W=_this$h2.frameIndex,D=_this$h2.fillColor,R=_this$h2.strokeColor;g.set(g.subarray(3*(d+1)),3*d),O.set(O.subarray(3*(d+1)),3*d),w.set(w.subarray(4*(d+1)),4*d),L.set(L.subarray(4*(d+1)),4*d),B.set(B.subarray(4*(d+1)),4*d),A.set(A.subarray(4*(d+1)),4*d),b.set(b.subarray(4*(d+1)),4*d),W.set(W.subarray(d+1),d),D.set(D.subarray(4*(d+1)),4*d),R.set(R.subarray(4*(d+1)),4*d);for(var X in this[S])X===d?delete this[S][X]:X>d&&(this[S][X-1]=this[S][X],delete this[S][X]);this[f]--;}},{key:"setColorTransform",value:function setColorTransform(d,g){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=4;var _this$h3=this[h],O=_this$h3.color0,w=_this$h3.color1,L=_this$h3.color2,B=_this$h3.color3,A=_this$h3.color4;return g!=null?(O.set([g[0],g[5],g[10],g[15]],d),w.set([g[1],g[6],g[11],g[16]],d),L.set([g[2],g[7],g[12],g[17]],d),B.set([g[3],g[8],g[13],g[18]],d),A.set([g[4],g[9],g[14],g[19]],d),this[v]=this[v]||g[18]<1,this[x]=!0):(O.set([1,0,0,0],d),w.set([0,1,0,0],d),L.set([0,0,1,0],d),B.set([0,0,0,1],d),A.set([0,0,0,0],d)),this;}},{key:"getColorTransform",value:function getColorTransform(d){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=4;var _this$h4=this[h],g=_this$h4.color0,O=_this$h4.color1,w=_this$h4.color2,L=_this$h4.color3,B=_this$h4.color4;return[g[d],O[d],w[d],L[d],B[d],g[d+1],O[d+1],w[d+1],L[d+1],B[d+1],g[d+2],O[d+2],w[d+2],L[d+2],B[d+2],g[d+3],O[d+3],w[d+3],L[d+3],B[d+3]];}},{key:"transformColor",value:function transformColor(d,g){var O=this.getColorTransform(d);return O=Object(n.multiply)(O,g),this.setColorTransform(d,O),this;}},{key:"setFillColor",value:function setFillColor(d,g){if(d>=this[f]||d<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(l["default"])(g)),g[3]>0&&(this[P]=!0),this[h].fillColor.set(g.map(function(O){return Math.round(255*O);}),4*d);}},{key:"setStrokeColor",value:function setStrokeColor(d,g){if(d>=this[f]||d<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(l["default"])(g)),g[3]>0&&(this[P]=!0),this[h].strokeColor.set(g.map(function(O){return Math.round(255*O);}),4*d);}},{key:"getCloudRGBA",value:function getCloudRGBA(d){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=4;var _this$h5=this[h],g=_this$h5.fillColor,O=_this$h5.strokeColor,w=[g[d],g[d+1],g[d+2],g[d+3]],L=[O[d],O[d+1],O[d+2],O[d+3]];return w[3]/=255,L[3]/=255,{fill:"rgba(".concat(w.join(),")"),stroke:"rgba(".concat(L.join(),")")};}},{key:"grayscale",value:function grayscale(d,g){this.transformColor(d,Object(n.grayscale)(g)),this._getFilter(d).push("grayscale(".concat(100*g,"%)"));}},{key:"brightness",value:function brightness(d,g){this.transformColor(d,Object(n.brightness)(g)),this._getFilter(d).push("brightness(".concat(100*g,"%)"));}},{key:"saturate",value:function saturate(d,g){this.transformColor(d,Object(n.saturate)(g)),this._getFilter(d).push("saturate(".concat(100*g,"%)"));}},{key:"contrast",value:function contrast(d,g){this.transformColor(d,Object(n.contrast)(g)),this._getFilter(d).push("contrast(".concat(100*g,"%)"));}},{key:"invert",value:function invert(d,g){this.transformColor(d,Object(n.invert)(g)),this._getFilter(d).push("invert(".concat(100*g,"%)"));}},{key:"sepia",value:function sepia(d,g){this.transformColor(d,Object(n.sepia)(g)),this._getFilter(d).push("sepia(".concat(100*g,"%)"));}},{key:"opacity",value:function opacity(d,g){this.transformColor(d,Object(n.opacity)(g)),this._getFilter(d).push("opacity(".concat(100*g,"%)"));}},{key:"hueRotate",value:function hueRotate(d,g){this.transformColor(d,Object(n.hueRotate)(g)),this._getFilter(d).push("hue-rotate(".concat(g,"deg)"));}},{key:"setTransform",value:function setTransform(d,g){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=3,g==null&&(g=[1,0,0,1,0,0]);var _this$h6=this[h],O=_this$h6.transform0,w=_this$h6.transform1;return O.set([g[0],g[2],g[4]],d),w.set([g[1],g[3],g[5]],d),this;}},{key:"getTransform",value:function getTransform(d){if(d>=this[f]||d<0)throw new Error("Out of range.");d*=3;var _this$h7=this[h],g=_this$h7.transform0,O=_this$h7.transform1;return[g[d],O[d],g[d+1],O[d+1],g[d+2],O[d+2]];}},{key:"getTextureFrame",value:function getTextureFrame(d){return this[E][this[h].frameIndex[d]];}},{key:"setTextureFrames",value:function setTextureFrames(){var d=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(d.length>12)throw new Error("Max frames exceed. Allow 12 frames.");d.length&&this[m].setTexture(d[0],g),this[E]=d,this[T]=g;}},{key:"setFrameIndex",value:function setFrameIndex(d,g){if(d>=this[f]||d<0)throw new Error("Out of range.");var O=this[E].length;if(O<=0)throw new Error("No frames");this[h].frameIndex[d]=g%O;}},{key:"amount",get:function get(){return this[f];},set:function set(d){var g=this[f];d!==g&&(d>this[h].bufferSize&&(this[h]=p(Math.max(d,this[h].bufferSize+1e3),this[h])),this[f]=d,d>g&&this.initBuffer(g));}},{key:"meshData",get:function get(){var _this$m$meshData=this[m].meshData,d=_this$m$meshData.attributes,g=_this$m$meshData.cells,O=_this$m$meshData.positions,w=_this$m$meshData.textureCoord,L=_this$m$meshData.uniforms,B=this[E],A={attributes:a({},d),cells:g,positions:O,textureCoord:w,uniforms:a({},L),instanceCount:this[f],enableBlend:this.enableBlend};B.length&&B.forEach(function(V,rt){A.uniforms["u_texFrame".concat(rt)]=V;});var _this$h8=this[h],b=_this$h8.transform0,W=_this$h8.transform1,D=_this$h8.color0,R=_this$h8.color1,X=_this$h8.color2,H=_this$h8.color3,J=_this$h8.color4,et=_this$h8.fillColor,it=_this$h8.strokeColor,$=_this$h8.frameIndex;return this[m].uniforms.u_texSampler&&(A.attributes.a_frameIndex={data:$,divisor:1}),A.attributes.a_transform0={data:b,divisor:1},A.attributes.a_transform1={data:W,divisor:1},A.attributes.a_colorCloud0={data:D,divisor:1},A.attributes.a_colorCloud1={data:R,divisor:1},A.attributes.a_colorCloud2={data:X,divisor:1},A.attributes.a_colorCloud3={data:H,divisor:1},A.attributes.a_colorCloud4={data:J,divisor:1},this.hasCloudColor&&(A.attributes.a_fillCloudColor={data:et,divisor:1},A.attributes.a_strokeCloudColor={data:it,divisor:1}),A;}},{key:"setProgram",value:function setProgram(d){this[m].setProgram(d);}},{key:"program",get:function get(){return this[m].program;}},{key:"transform",value:function transform(d,g){var O=this.getTransform(d);return g=r.mat2d.multiply(Array.of(0,0,0,0,0,0),O,g),this.setTransform(d,g),this;}},{key:"translate",value:function translate(d,_ref36){var _ref37=_slicedToArray(_ref36,2),g=_ref37[0],O=_ref37[1];var w=r.mat2d.create();return w=r.mat2d.translate(Array.of(0,0,0,0,0,0),w,[g,O]),this.transform(d,w);}},{key:"rotate",value:function rotate(d,g){var _ref38=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref39=_slicedToArray(_ref38,2),O=_ref39[0],w=_ref39[1];var L=r.mat2d.create();return L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[O,w]),L=r.mat2d.rotate(Array.of(0,0,0,0,0,0),L,g),L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[-O,-w]),this.transform(d,L);}},{key:"scale",value:function scale(d,_ref40){var _ref41=_slicedToArray(_ref40,2),g=_ref41[0],_ref41$=_ref41[1],O=_ref41$===void 0?g:_ref41$;var _ref42=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref43=_slicedToArray(_ref42,2),w=_ref43[0],L=_ref43[1];var B=r.mat2d.create();return B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[w,L]),B=r.mat2d.scale(Array.of(0,0,0,0,0,0),B,[g,O]),B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[-w,-L]),this.transform(d,B);}},{key:"skew",value:function skew(d,_ref44){var _ref45=_slicedToArray(_ref44,2),g=_ref45[0],_ref45$=_ref45[1],O=_ref45$===void 0?g:_ref45$;var _ref46=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref47=_slicedToArray(_ref46,2),w=_ref47[0],L=_ref47[1];var B=r.mat2d.create();return B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[w,L]),B=r.mat2d.multiply(Array.of(0,0,0,0,0,0),B,r.mat2d.fromValues(1,Math.tan(O),Math.tan(g),1,0,0)),B=r.mat2d.translate(Array.of(0,0,0,0,0,0),B,[-w,-L]),this.transform(d,B);}},{key:"isPointCollision",value:function isPointCollision(d,_ref48){var _this$m;var _ref49=_slicedToArray(_ref48,2),g=_ref49[0],O=_ref49[1];var w=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var L=this.getTransform(d),B=Object(i.transformPoint)([g,O],r.mat2d.invert(Array.of(0,0,0,0,0,0),L));return(_this$m=this[m]).isPointCollision.apply(_this$m,_toConsumableArray(B).concat([w]));}},{key:"isPointInFill",value:function isPointInFill(d,_ref50){var _ref51=_slicedToArray(_ref50,2),g=_ref51[0],O=_ref51[1];return this.isPointCollision(d,[g,O],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(d,_ref52){var _ref53=_slicedToArray(_ref52,2),g=_ref53[0],O=_ref53[1];return this.isPointCollision(d,[g,O],"stroke");}}]);}();},/* 30 *//***/function(u,e,t){t.r(e),t.d(e,"multiply",function(){return n;}),t.d(e,"grayscale",function(){return i;}),t.d(e,"brightness",function(){return l;}),t.d(e,"saturate",function(){return o;}),t.d(e,"contrast",function(){return a;}),t.d(e,"invert",function(){return c;}),t.d(e,"sepia",function(){return m;}),t.d(e,"opacity",function(){return f;}),t.d(e,"hueRotate",function(){return v;});var r=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(S,E){var T=[],P=S[0],x=S[1],h=S[2],p=S[3],d=S[4],g=S[5],O=S[6],w=S[7],L=S[8],B=S[9],A=S[10],b=S[11],W=S[12],D=S[13],R=S[14],X=S[15],H=S[16],J=S[17],et=S[18],it=S[19];var $=E[0],V=E[1],rt=E[2],lt=E[3],ct=E[4];return T[0]=$*P+V*g+rt*A+lt*X,T[1]=$*x+V*O+rt*b+lt*H,T[2]=$*h+V*w+rt*W+lt*J,T[3]=$*p+V*L+rt*D+lt*et,T[4]=$*d+V*B+rt*R+lt*it+ct,$=E[5],V=E[6],rt=E[7],lt=E[8],ct=E[9],T[5]=$*P+V*g+rt*A+lt*X,T[6]=$*x+V*O+rt*b+lt*H,T[7]=$*h+V*w+rt*W+lt*J,T[8]=$*p+V*L+rt*D+lt*et,T[9]=$*d+V*B+rt*R+lt*it+ct,$=E[10],V=E[11],rt=E[12],lt=E[13],ct=E[14],T[10]=$*P+V*g+rt*A+lt*X,T[11]=$*x+V*O+rt*b+lt*H,T[12]=$*h+V*w+rt*W+lt*J,T[13]=$*p+V*L+rt*D+lt*et,T[14]=$*d+V*B+rt*R+lt*it+ct,$=E[15],V=E[16],rt=E[17],lt=E[18],ct=E[19],T[15]=$*P+V*g+rt*A+lt*X,T[16]=$*x+V*O+rt*b+lt*H,T[17]=$*h+V*w+rt*W+lt*J,T[18]=$*p+V*L+rt*D+lt*et,T[19]=$*d+V*B+rt*R+lt*it+ct,T;}function i(S){S=Object(r.clamp)(0,1,S);var E=0.2126*S,T=0.7152*S,P=0.0722*S;return[E+1-S,T,P,0,0,E,T+1-S,P,0,0,E,T,P+1-S,0,0,0,0,0,1,0];}function l(S){return[S,0,0,0,0,0,S,0,0,0,0,0,S,0,0,0,0,0,1,0];}function o(S){var E=0.2126*(1-S),T=0.7152*(1-S),P=0.0722*(1-S);return[E+S,T,P,0,0,E,T+S,P,0,0,E,T,P+S,0,0,0,0,0,1,0];}function a(S){var E=0.5*(1-S);return[S,0,0,0,E,0,S,0,0,E,0,0,S,0,E,0,0,0,1,0];}function c(S){var E=1-2*S;return[E,0,0,0,S,0,E,0,0,S,0,0,E,0,S,0,0,0,1,0];}function m(S){return[1-0.607*S,0.769*S,0.189*S,0,0,0.349*S,1-0.314*S,0.168*S,0,0,0.272*S,0.534*S,1-0.869*S,0,0,0,0,0,1,0];}function f(S){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,S,0];}function v(S){var E=S/180*Math.PI,T=Math.cos(E),P=Math.sin(E),x=0.2126,h=0.7152,p=0.0722;return[x+T*(1-x)+P*-x,h+T*-h+P*-h,p+T*-p+P*(1-p),0,0,x+T*-x+P*0.143,h+T*(1-h)+P*0.14,p+T*-p+P*-0.283,0,0,x+T*-x+P*-(1-x),h+T*-h+P*h,p+T*(1-p)+P*p,0,0,0,0,0,1,0];}},/* 31 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return i;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);function i(l){var o=n()(l);if(!o||!o.length)throw new TypeError("Invalid color value.");return[o[0]/255,o[1]/255,o[2]/255,o[3]];}},/* 32 *//***/function(u,e,t){var r=t(33),n=t(37),i=t(39);u.exports=function(o){var a,c=r(o);return c.space?(a=Array(3),a[0]=i(c.values[0],0,255),a[1]=i(c.values[1],0,255),a[2]=i(c.values[2],0,255),c.space[0]==="h"&&(a=n.rgb(a)),a.push(i(c.alpha,0,1)),a):[];};},/* 33 *//***/function(u,e,t){(function(r){var n=t(34),i=t(35),l=t(36);u.exports=a;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function a(c){var m,f=[],v=1,S;if(typeof c=="string"){if(n[c])f=n[c].slice(),S="rgb";else if(c==="transparent")v=0,S="rgb",f=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(c)){var E=c.slice(1),T=E.length,P=T<=4;v=1,P?(f=[parseInt(E[0]+E[0],16),parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16)],T===4&&(v=parseInt(E[3]+E[3],16)/255)):(f=[parseInt(E[0]+E[1],16),parseInt(E[2]+E[3],16),parseInt(E[4]+E[5],16)],T===8&&(v=parseInt(E[6]+E[7],16)/255)),f[0]||(f[0]=0),f[1]||(f[1]=0),f[2]||(f[2]=0),S="rgb";}else if(m=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(c)){var x=m[1],h=x==="rgb",E=x.replace(/a$/,"");S=E;var T=E==="cmyk"?4:E==="gray"?1:3;f=m[2].trim().split(/\s*,\s*/).map(function(O,w){if(/%$/.test(O))return w===T?parseFloat(O)/100:E==="rgb"?parseFloat(O)*255/100:parseFloat(O);if(E[w]==="h"){if(/deg$/.test(O))return parseFloat(O);if(o[O]!==void 0)return o[O];}return parseFloat(O);}),x===E&&f.push(1),v=h||f[T]===void 0?1:f[T],f=f.slice(0,T);}else c.length>10&&/[0-9](?:\s|\/)/.test(c)&&(f=c.match(/([0-9]+)/g).map(function(d){return parseFloat(d);}),S=c.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(c))S="rgb",f=[c>>>16,(c&65280)>>>8,c&255];else if(i(c)){var p=l(c.r,c.red,c.R,null);p!==null?(S="rgb",f=[p,l(c.g,c.green,c.G),l(c.b,c.blue,c.B)]):(S="hsl",f=[l(c.h,c.hue,c.H),l(c.s,c.saturation,c.S),l(c.l,c.lightness,c.L,c.b,c.brightness)]),v=l(c.a,c.alpha,c.opacity,1),c.opacity!=null&&(v/=100);}else(Array.isArray(c)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(c))&&(f=[c[0],c[1],c[2]],S="rgb",v=c.length===4?c[3]:1);return{space:S,values:f,alpha:v};}}).call(this,t(22));},/* 34 *//***/function(u,e,t){u.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};},/* 35 *//***/function(u,e,t){var r=Object.prototype.toString;u.exports=function(n){var i;return r.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 *//***/function(u,e){u.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 *//***/function(u,e,t){var r=t(38);u.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var i=n[0]/360,l=n[1]/100,o=n[2]/100,a,c,m,f,v;if(l===0)return v=o*255,[v,v,v];o<0.5?c=o*(1+l):c=o+l-o*l,a=2*o-c,f=[0,0,0];for(var S=0;S<3;S++)m=i+0.3333333333333333*-(S-1),m<0?m++:m>1&&m--,6*m<1?v=a+(c-a)*6*m:2*m<1?v=c:3*m<2?v=a+(c-a)*(0.6666666666666666-m)*6:v=a,f[S]=v*255;return f;}},r.hsl=function(n){var i=n[0]/255,l=n[1]/255,o=n[2]/255,a=Math.min(i,l,o),c=Math.max(i,l,o),m=c-a,f,v,S;return c===a?f=0:i===c?f=(l-o)/m:l===c?f=2+(o-i)/m:o===c&&(f=4+(i-l)/m),f=Math.min(f*60,360),f<0&&(f+=360),S=(a+c)/2,c===a?v=0:S<=0.5?v=m/(c+a):v=m/(2-c-a),[f,v*100,S*100];};},/* 38 *//***/function(u,e,t){u.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 *//***/function(u,e){u.exports=t;function t(r,n,i){return n<i?r<n?n:r>i?i:r:r<i?i:r>n?n:r;}},/* 40 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return p;});var r=t(41),n=/* @__PURE__ */t.n(r),i=t(42),l=/* @__PURE__ */t.n(i),o=t(43),a=/* @__PURE__ */t.n(o),c=t(44),m=t(46),f=/* @__PURE__ */t.n(m),v=t(53),S=t(55);t(1).glMatrix.setMatrixArrayType(Array);var E=Symbol("contours"),T=Symbol("path"),P=Symbol("simplify"),x=Symbol("scale"),h=2*Math.PI;var p=/*#__PURE__*/function(){function p(){var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,p);typeof g=="string"&&(g={path:g}),g.path?this[T]=n()(g.path):this[T]=[],this[E]=null,this[P]=g.simplify!=null?g.simplify:0,this[x]=g.scale!=null?g.scale:2;}return _createClass(p,[{key:"contours",get:function get(){var g=null;if(!this[E]&&this[T]){var O=Object(c["default"])(a()(this[T]));this[E]=f()(O,this[x],this[P]),this[E].path=O,this[E].simplify=this[P],this[E].scale=this[x];}return this[E]&&(g=this[E].map(function(O){return _toConsumableArray(O);}),g.path=this[E].path,g.simplify=this[E].simplify,g.scale=this[E].scale),g;}},{key:"path",get:function get(){return this[T];}},{key:"simplify",get:function get(){return this[P];}},{key:"boundingBox",get:function get(){var g=this.contours;if(g&&g.length){var O=g.reduce(function(w,L){return[].concat(_toConsumableArray(w),_toConsumableArray(L));});return l()(O);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var g=this.boundingBox;return g?[0.5*(g[0][0]+g[1][0]),0.5*(g[0][1]+g[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$T;var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var O=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var w=Object(c["default"])(a()(this[T])).map(function(_ref54){var _ref55=_toArray(_ref54),L=_ref55[0],B=_ref55.slice(1);var A=[L];for(var b=0;b<B.length;b+=2){var W=B[b]-g,D=B[b+1]-O;A.push(W,D);}return A;});return this.beginPath(),(_this$T=this[T]).push.apply(_this$T,_toConsumableArray(w)),this;}},{key:"getPointAtLength",value:function getPointAtLength(g){return this.contours?Object(v.getPointAtLength)(this[E],g):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(v.getTotalLength)(this[E]):0;}},{key:"addPath",value:function addPath(g){var _this$T2;this[E]=null,typeof g=="string"&&(g=n()(g)),(_this$T2=this[T]).push.apply(_this$T2,_toConsumableArray(g));}},{key:"beginPath",value:function beginPath(){this[T]=[],this[E]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(g,O,w,L,B,A,b){var W=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(A+=B,b+=B,w<=0||L<=0||b===A)return;b<A&&(b=A+h+(b-A)%h),b-A>h&&(b=A+h);var D=b-A;D>=h&&(b-=1e-3);var R=this[T].length>0&&D<h?"L":"M";var X=Object(S.getPoint)(g,O,w,L,A),H=Object(S.getPoint)(g,O,w,L,b),J=+!W;var et=D>Math.PI?1:0;W&&(et=1-et),R+=X.join(" "),R+="A".concat(w," ").concat(L," 0 ").concat(et," ").concat(J," ").concat(H.join(" ")),D>=h&&(R+="Z"),this.addPath(R);}},{key:"arc",value:function arc(g,O,w,L,B){var A=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(g,O,w,w,0,L,B,A);}},{key:"arcTo",value:function arcTo(g,O,w,L,B,A,b){this[E]=null,this[T].push(["A",g,O,w,L,B,A,b]);}},{key:"moveTo",value:function moveTo(g,O){this[E]=null,this[T].push(["M",g,O]);}},{key:"lineTo",value:function lineTo(g,O){this[E]=null,this[T].push(["L",g,O]);}},{key:"bezierCurveTo",value:function bezierCurveTo(g,O,w,L,B,A){this[E]=null,this[T].push(["C",g,O,w,L,B,A]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(g,O,w,L){this[E]=null,this[T].push(["Q",g,O,w,L]);}},{key:"rect",value:function rect(g,O,w,L){var B="M".concat(g," ").concat(O,"L").concat(g+w," ").concat(O,"L").concat(g+w," ").concat(O+L,"L").concat(g," ").concat(O+L,"Z");this.addPath(B);}},{key:"closePath",value:function closePath(){this[E]=null;var g=[];var O=this[T].length;O>0&&(g=this[T][O-1]),g[0]!=="Z"&&g[0]!=="z"&&this[T].push(["Z"]);}}]);}();},/* 41 *//***/function(u,e){u.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(o){var a=[];return o.replace(r,function(c,m,f){var v=m.toLowerCase();for(f=l(f),v=="m"&&f.length>2&&(a.push([m].concat(f.splice(0,2))),v="l",m=m=="m"?"l":"L");;){if(f.length==t[v])return f.unshift(m),a.push(f);if(f.length<t[v])throw new Error("malformed path data");a.push([m].concat(f.splice(0,t[v])));}}),a;}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function l(o){var a=o.match(i);return a?a.map(Number):[];}},/* 42 *//***/function(u,e,t){u.exports=r;function r(n){var i=n.length;if(i===0)return[[],[]];for(var l=n[0].length,o=n[0].slice(),a=n[0].slice(),c=1;c<i;++c)for(var m=n[c],f=0;f<l;++f){var v=m[f];o[f]=Math.min(o[f],v),a[f]=Math.max(a[f],v);}return[o,a];}},/* 43 *//***/function(u,e){u.exports=t;function t(r){var n=0,i=0,l=0,o=0;return r.map(function(a){a=a.slice();var c=a[0],m=c.toUpperCase();if(c!=m)switch(a[0]=m,c){case"a":a[6]+=l,a[7]+=o;break;case"v":a[1]+=o;break;case"h":a[1]+=l;break;default:for(var f=1;f<a.length;)a[f++]+=l,a[f++]+=o;}switch(m){case"Z":l=n,o=i;break;case"H":l=a[1];break;case"V":o=a[1];break;case"M":l=n=a[1],o=i=a[2];break;default:l=a[a.length-2],o=a[a.length-1];}return a;});}},/* 44 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(o){for(var a,c=[],m=0,f=0,v=0,S=0,E=null,T=null,P=0,x=0,h=0,p=o.length;h<p;h++){var d=o[h],g=d[0];switch(g){case"M":v=d[1],S=d[2];break;case"A":var O=Object(r["default"])(P,x,d[6],d[7],d[4],d[5],d[1],d[2],d[3]);if(!O.length)continue;O=O.map(function(b){var _b7=_slicedToArray(b,8),W=_b7[0],D=_b7[1],R=_b7[2],X=_b7[3],H=_b7[4],J=_b7[5],et=_b7[6],it=_b7[7];return{x1:R,y1:X,x2:H,y2:J,x:et,y:it};});for(var w=0,L;w<O.length;w++)L=O[w],d=["C",L.x1,L.y1,L.x2,L.y2,L.x,L.y],w<O.length-1&&c.push(d);break;case"S":var B=P,A=x;(a=="C"||a=="S")&&(B+=B-m,A+=A-f),d=["C",B,A,d[1],d[2],d[3],d[4]];break;case"T":a=="Q"||a=="T"?(E=P*2-E,T=x*2-T):(E=P,T=x),d=l(P,x,E,T,d[1],d[2]);break;case"Q":E=d[1],T=d[2],d=l(P,x,d[1],d[2],d[3],d[4]);break;case"L":d=i(P,x,d[1],d[2]);break;case"H":d=i(P,x,d[1],x);break;case"V":d=i(P,x,P,d[1]);break;case"Z":d=i(P,x,v,S);break;}a=g,P=d[d.length-2],x=d[d.length-1],d.length>4?(m=d[d.length-4],f=d[d.length-3]):(m=P,f=x),c.push(d);}return c;}function i(o,a,c,m){return["C",o,a,c,m,c,m];}function l(o,a,c,m,f,v){return["C",o/3+0.6666666666666666*c,a/3+0.6666666666666666*m,f/3+0.6666666666666666*c,v/3+0.6666666666666666*m,f,v];}},/* 45 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(a,c,m,f){var v=a*f-c*m<0?-1:1;var S=a*m+c*f;return S>1&&(S=1),S<-1&&(S=-1),v*Math.acos(S);}function i(a,c,m,f,v,S,E,T,P,x){var h=x*(a-m)/2+P*(c-f)/2,p=-P*(a-m)/2+x*(c-f)/2,d=E*E,g=T*T,O=h*h,w=p*p;var L=d*g-d*w-g*O;L<0&&(L=0),L/=d*w+g*O,L=Math.sqrt(L)*(v===S?-1:1);var B=L*E/T*p,A=L*-T/E*h,b=x*B-P*A+(a+m)/2,W=P*B+x*A+(c+f)/2,D=(h-B)/E,R=(p-A)/T,X=(-h-B)/E,H=(-p-A)/T,J=n(1,0,D,R);var et=n(D,R,X,H);return S===0&&et>0&&(et-=r),S===1&&et<0&&(et+=r),[b,W,J,et];}function l(a,c){var m=1.3333333333333333*Math.tan(c/4),f=Math.cos(a),v=Math.sin(a),S=Math.cos(a+c),E=Math.sin(a+c);return[f,v,f-v*m,v+f*m,S+E*m,E-S*m,S,E];}function o(a,c,m,f,v,S,E,T,P){var x=Math.sin(P*r/360),h=Math.cos(P*r/360),p=h*(a-m)/2+x*(c-f)/2,d=-x*(a-m)/2+h*(c-f)/2;if(p===0&&d===0)return[];if(E===0||T===0)return[];E=Math.abs(E),T=Math.abs(T);var g=p*p/(E*E)+d*d/(T*T);g>1&&(E*=Math.sqrt(g),T*=Math.sqrt(g));var O=i(a,c,m,f,v,S,E,T,x,h),w=[];var L=O[2],B=O[3];var A=Math.max(Math.ceil(Math.abs(B)/(r/4)),1);B/=A;for(var b=0;b<A;b++)w.push(l(L,B)),L+=B;return w.map(function(b){for(var W=0;W<b.length;W+=2){var D=b[W+0],R=b[W+1];D*=E,R*=T;var X=h*D-x*R,H=x*D+h*R;b[W+0]=X+O[0],b[W+1]=H+O[1];}return b;});}},/* 46 *//***/function(u,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(47),_t2=t(49),n=_t2.copy,i=t(50);function l(f,v,S){return f[0]=v,f[1]=S,f;}var o=[0,0],a=[0,0],c=[0,0];function m(f,v,S,E){r(S,l(o,E[1],E[2]),l(a,E[3],E[4]),l(c,E[5],E[6]),v,f);}u.exports=function(v,S,E){var T=[],P=[],x=[0,0];return v.forEach(function(h,p,d){if(h[0]==="M")n(x,h.slice(1)),P.length>0&&(T.push(P),P=[]);else if(h[0]==="C")m(P,S,x,h),l(x,h[5],h[6]);else throw new Error("illegal type in SVG: "+h[0]);}),P.length>0&&T.push(P),T.map(function(h){return i(h,E||0);});};},/* 47 *//***/function(u,e,t){u.exports=t(48)();},/* 48 *//***/function(u,e){function t(n){return[n[0],n[1]];}function r(n,i){return[n,i];}u.exports=function(i){i=i||{};var l=typeof i.recursion=="number"?i.recursion:8,o=typeof i.epsilon=="number"?i.epsilon:11920929e-14,a=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,c=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,m=i.angleTolerance||0,f=i.cuspLimit||0;return function(T,P,x,h,p,d){d||(d=[]),p=typeof p=="number"?p:1;var g=a/p;return g*=g,v(T,P,x,h,d,g),d;};function v(E,T,P,x,h,p){h.push(t(E));var d=E[0],g=E[1],O=T[0],w=T[1],L=P[0],B=P[1],A=x[0],b=x[1];S(d,g,O,w,L,B,A,b,h,p,0),h.push(t(x));}function S(E,T,P,x,h,p,d,g,O,w,L){if(!(L>l)){var B=Math.PI,A=(E+P)/2,b=(T+x)/2,W=(P+h)/2,D=(x+p)/2,R=(h+d)/2,X=(p+g)/2,H=(A+W)/2,J=(b+D)/2,et=(W+R)/2,it=(D+X)/2,$=(H+et)/2,V=(J+it)/2;if(L>0){var rt=d-E,lt=g-T,ct=Math.abs((P-d)*lt-(x-g)*rt),gt=Math.abs((h-d)*lt-(p-g)*rt),st,Ct;if(ct>o&&gt>o){if((ct+gt)*(ct+gt)<=w*(rt*rt+lt*lt)){if(m<c){O.push(r($,V));return;}var xt=Math.atan2(p-x,h-P);if(st=Math.abs(xt-Math.atan2(x-T,P-E)),Ct=Math.abs(Math.atan2(g-p,d-h)-xt),st>=B&&(st=2*B-st),Ct>=B&&(Ct=2*B-Ct),st+Ct<m){O.push(r($,V));return;}if(f!==0){if(st>f){O.push(r(P,x));return;}if(Ct>f){O.push(r(h,p));return;}}}}else if(ct>o){if(ct*ct<=w*(rt*rt+lt*lt)){if(m<c){O.push(r($,V));return;}if(st=Math.abs(Math.atan2(p-x,h-P)-Math.atan2(x-T,P-E)),st>=B&&(st=2*B-st),st<m){O.push(r(P,x)),O.push(r(h,p));return;}if(f!==0&&st>f){O.push(r(P,x));return;}}}else if(gt>o){if(gt*gt<=w*(rt*rt+lt*lt)){if(m<c){O.push(r($,V));return;}if(st=Math.abs(Math.atan2(g-p,d-h)-Math.atan2(p-x,h-P)),st>=B&&(st=2*B-st),st<m){O.push(r(P,x)),O.push(r(h,p));return;}if(f!==0&&st>f){O.push(r(h,p));return;}}}else if(rt=$-(E+d)/2,lt=V-(T+g)/2,rt*rt+lt*lt<=w){O.push(r($,V));return;}}S(E,T,A,b,H,J,$,V,O,w,L+1),S($,V,et,it,R,X,d,g,O,w,L+1);}}};},/* 49 *//***/function(u,e,t){t.r(e),t.d(e,"create",function(){return i;}),t.d(e,"clone",function(){return n;}),t.d(e,"copy",function(){return l;}),t.d(e,"scaleAndAdd",function(){return o;}),t.d(e,"dot",function(){return a;}),t.d(e,"rotate",function(){return c;}),t.d(e,"cross",function(){return m;}),t.d(e,"sub",function(){return f;}),t.d(e,"add",function(){return v;}),t.d(e,"computeMiter",function(){return P;}),t.d(e,"normal",function(){return x;}),t.d(e,"direction",function(){return h;});var r=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(p){return[p[0],p[1]];}function i(){return[0,0];}var l=r.vec2.copy,o=r.vec2.scaleAndAdd,a=r.vec2.dot,c=r.vec2.rotate,m=r.vec2.cross,f=r.vec2.sub,v=r.vec2.add,S=r.vec2.normalize,E=r.vec2.set,T=i();function P(p,d,g,O,w){v(p,g,O),S(p,p),E(d,-p[1],p[0]),E(T,-g[1],g[0]);var L=w/a(d,T);return Math.abs(L);}function x(p,d){return E(p,-d[1],d[0]),p;}function h(p,d,g){return f(p,d,g),S(p,p),p;}},/* 50 *//***/function(u,e,t){var r=t(51),n=t(52);u.exports=function(l,o){return l=r(l,o),l=n(l,o),l;},u.exports.radialDistance=r,u.exports.douglasPeucker=n;},/* 51 *//***/function(u,e){function t(r,n){var i=r[0]-n[0],l=r[1]-n[1];return i*i+l*l;}u.exports=function(n,i){if(n.length<=1)return n;i=typeof i=="number"?i:1;for(var l=i*i,o=n[0],a=[o],c,m=1,f=n.length;m<f;m++)c=n[m],t(c,o)>l&&(a.push(c),o=c);return o!==c&&a.push(c),a;};},/* 52 *//***/function(u,e){function t(n,i,l){var o=i[0],a=i[1],c=l[0]-o,m=l[1]-a;if(c!==0||m!==0){var f=((n[0]-o)*c+(n[1]-a)*m)/(c*c+m*m);f>1?(o=l[0],a=l[1]):f>0&&(o+=c*f,a+=m*f);}return c=n[0]-o,m=n[1]-a,c*c+m*m;}function r(n,i,l,o,a){for(var c=o,m,f=i+1;f<l;f++){var v=t(n[f],n[i],n[l]);v>c&&(m=f,c=v);}c>o&&(m-i>1&&r(n,i,m,o,a),a.push(n[m]),l-m>1&&r(n,m,l,o,a));}u.exports=function(i,l){if(i.length<=1)return i;l=typeof l=="number"?l:1;var o=l*l,a=i.length-1,c=[i[0]];return r(i,0,a,o,c),c.push(i[a]),c;};},/* 53 *//***/function(u,e,t){t.r(e),t.d(e,"getTotalLength",function(){return n;}),t.d(e,"getPointAtLength",function(){return l;}),t.d(e,"getDashContours",function(){return o;});var r=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(a){if(a.totalLength!=null)return a.totalLength;var c=0;return a.forEach(function(m){var f=m[0];for(var v=1;v<m.length;v++){var S=m[v];c+=Object(r.distance)(f,S),f=S;}}),a.totalLength=c,c;}function i(a,c){var m=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(c=Number(c),!Number.isFinite(c))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(c<=0)throw new TypeError("Length must > 0");var f=n(a);if(c>=f){var S=a[a.length-1],E=S[S.length-2],T=S[S.length-1],P=Math.atan2(T[1]-E[1],T[0]-E[0]);return{current:a.map(function(x){return _toConsumableArray(x);}),point:{x:T[0],y:T[1],angle:P}};}var v=[];for(var _S2=0;_S2<a.length;_S2++){v[_S2]=[];var _E=a[_S2];var _T2=_E[0];for(var _P4=1;_P4<_E.length;_P4++){var _x15=_E[_P4],_h9=Object(r.distance)(_T2,_x15);if(c<_h9){var p=c/_h9,d=Math.atan2(_x15[1]-_T2[1],_x15[0]-_T2[0]),g={x:_T2[0]*(1-p)+_x15[0]*p,y:_T2[1]*(1-p)+_x15[1]*p,angle:d};if(v[_S2].push(_T2),c>0&&v[_S2].push([g.x,g.y]),!m)return{current:v,point:g};var O=[],w=_S2;for(;_S2<a.length;_S2++){for(O[_S2-w]=[],_S2===w&&O[0].push([g.x,g.y]);_P4<_E.length;_P4++)O[_S2-w].push(_E[_P4]);_P4=0;}return{current:v,point:g,rest:O};}c-=_h9,v[_S2].push(_T2),_T2=_x15;}}}function l(a,c){if(c=Number(c),!Number.isFinite(c))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(a.length<=0)return{x:0,y:0,angle:0};if(c<=0){var m=a[0][0],f=a[0][1],v=Math.atan2(f[1]-m[1],f[0]-m[0]);return{x:m[0],y:m[1],angle:v};}return i(a,c,!1).point;}function o(a,c,m){var f=0,v=c[0],S=a;var E=[],T=c.length;if(m>0){do m-=c[f%T],f++;while(m>0);m<0&&(v=-m,f--);}else if(m<0){f=-1;do m+=c[f%T+T-1],f--;while(m<0);m>=0&&(f++,v=c[f%T+T-1]-m);}do{var P=i(S,v);S=P.rest,++f%2&&E.push.apply(E,_toConsumableArray(P.current));var _x16=f%T;_x16<0&&(_x16+=T),v=c[_x16];}while(S);return E;}},/* 54 *//***/function(u,e,t){t.r(e),t.d(e,"normalize",function(){return r;}),t.d(e,"distance",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function r(_ref56,a,c,m){var _ref57=_slicedToArray(_ref56,3),i=_ref57[0],l=_ref57[1],o=_ref57[2];return i=i*2/a-1,l=1-l*2/c,Number.isFinite(m)?(o=o*2/m-1,[i,l,o]):[i,l];}function n(_ref58,_ref59){var _ref60=_slicedToArray(_ref58,3),i=_ref60[0],l=_ref60[1],_ref60$=_ref60[2],o=_ref60$===void 0?0:_ref60$;var _ref61=_slicedToArray(_ref59,3),a=_ref61[0],c=_ref61[1],_ref61$=_ref61[2],m=_ref61$===void 0?0:_ref61$;return Math.hypot(a-i,c-l,m-o);}},/* 55 *//***/function(u,e,t){t.r(e),t.d(e,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(i,l,o,a,c){c%=r,c<0&&(c+=r);var m=Math.tan(c);if(Math.abs(m)<1e5){var f=l-m*i,v=1/Math.pow(o,2)+Math.pow(m,2)/Math.pow(a,2);var S=-1;(c<=Math.PI/2||c>3*Math.PI/2)&&(S=1);var E=S*Math.sqrt(1/v)+i,T=m*E+f;return[E,T];}return c<Math.PI?[i,l+a]:[i,l-a];}},/* 56 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return K;});var r=t(1),n=t(42),i=/* @__PURE__ */t.n(n),l=t(57),o=t(28),a=t(24),c=t(30),m=t(59),f=t(53),v=t(60),S=/* @__PURE__ */t.n(v),E=t(46),T=/* @__PURE__ */t.n(E),P=t(31),x=t(40),h=t(21);t(1).glMatrix.setMatrixArrayType(Array);function p(q,Y){if(q==null)return{};var k=d(q,Y),C,M;if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(q);for(M=0;M<j.length;M++)C=j[M],!(Y.indexOf(C)>=0)&&Object.prototype.propertyIsEnumerable.call(q,C)&&(k[C]=q[C]);}return k;}function d(q,Y){if(q==null)return{};var k={},C=Object.keys(q),M,j;for(j=0;j<C.length;j++)M=C[j],!(Y.indexOf(M)>=0)&&(k[M]=q[M]);return k;}var g=Symbol("mesh"),O=Symbol("contours"),w=Symbol("stroke"),L=Symbol("fill"),B=Symbol("strokeColor"),A=Symbol("fillColor"),b=Symbol("transform"),W=Symbol("invertTransform"),D=Symbol("uniforms"),R=Symbol("texOptions"),X=Symbol("blend"),H=Symbol("applyTexture"),J=Symbol("applyTransform"),et=Symbol("applyGradientTransform"),it=Symbol("applyProgram"),$=Symbol("gradient"),V=Symbol("filter"),rt=Symbol("opacity"),lt=Symbol("program"),ct=Symbol("attributes"),gt=Symbol("pass"),st=Symbol("clipContext"),Ct=Symbol("applyClipPath");function xt(q,Y){var k=q[1][0]-q[0][0],C=q[1][1]-q[0][1],M=[];for(var j=0;j<Y.length;j++){var G=Y[j],Q=[(G[0]-q[0][0])/k,1-(G[1]-q[0][1])/C];M.push(Q);}return M;}function F(_ref62,_ref63,_ref64){var _ref65=_slicedToArray(_ref62,2),q=_ref65[0],Y=_ref65[1];var _ref66=_slicedToArray(_ref63,4),k=_ref66[0],C=_ref66[1],M=_ref66[2],j=_ref66[3];var G=_ref64.scale;return G||(q/=M,Y=1-Y/j,q-=k,Y+=C),[q,Y,0];}function U(q,Y,k){var C=T()(q,Y,k);return C.path=q,C.simplify=k,C.scale=Y,C;}var K=/*#__PURE__*/function(){function K(Y){_classCallCheck(this,K);this[w]=null,this[L]=null,this[b]=[1,0,0,1,0,0],this[rt]=1,this[D]={},this[V]=[],this[X]=null,this[R]={},this.contours=Y.contours,this[lt]=null,this[ct]={},this[gt]=[];}return _createClass(K,[{key:"contours",get:function get(){return this[O];},set:function set(Y){this[g]=null,this[O]=Y;var k=Y.scale;this.transformScale/k>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(Y){this[lt]=Y,this[g]&&this[it](Y);}},{key:"program",get:function get(){return this[lt];}},{key:"setAttribute",value:function setAttribute(Y,k){k==null?delete this[ct][Y]:this[ct][Y]=k;}},{key:"getOpacity",value:function getOpacity(){return this[rt];}},{key:"setOpacity",value:function setOpacity(Y){if(Y<0||Y>1)throw new TypeError("Invalid opacity value.");this[g]&&this[g].positions.forEach(function(k){k[2]=1/k[2]>0?Y:-Y;}),this[rt]=Y;}},{key:"setClipPath",value:function setClipPath(Y){this.clipPath=Y,this[D].u_clipSampler&&this[D].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[g]&&delete this[g].attributes.a_clipUV,Y&&this[g]&&this[Ct]();}},{key:Ct,value:function value(){if(this.clipPath){this[st]||(this[st]=h["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),Y=_this$boundingBox$[0],k=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),C=_this$boundingBox$2[0],M=_this$boundingBox$2[1];C&&M&&(this[st].width=C-Y,this[st].height=M-k);var j=this[st].getContext("2d"),G=new Path2D(this.clipPath);j.clearRect(0,0,this[st].width,this[st].height),j.save(),j.translate(-Y,-k),j.fillStyle="white",j.fill(G),j.restore(),this[g].clipPath=this[st];var Q=xt(this.boundingBox,this[g].position0);this[g].attributes.a_clipUV=Q;}}},{key:"getPointAtLength",value:function getPointAtLength(Y){return Object(f.getPointAtLength)(this[O],Y);}},{key:"getTotalLength",value:function getTotalLength(){return Object(f.getTotalLength)(this[O]);}},{key:"blend",get:function get(){return this[X]==null?"auto":this[X];},set:function set(Y){this[X]=Y,this[g]&&(this[g].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[g]&&this[g].boundingBox)return this[g].boundingBox;var Y=this.meshData;if(Y){var k=Y.position0;if(k.length)Y.boundingBox=i()(k);else return[[0,0],[0,0]];return Y.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var Y=this.boundingBox;return Y?[0.5*(Y[0][0]+Y[1][0]),0.5*(Y[0][1]+Y[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[L]?this[L].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[w]?this[w].lineWidth:0;}},{key:"lineCap",get:function get(){return this[w]?this[w].lineCap:"";}},{key:"lineJoin",get:function get(){return this[w]?this[w].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[w]?this[w].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[B]&&this[B][3]!==0?Object(a["default"])(this[B]):"";}},{key:"lineDash",get:function get(){return this[w]?this[w].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[w]?this[w].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[A]&&this[A][3]!==0?Object(a["default"])(this[A]):"";}},{key:"gradient",get:function get(){return this[$];}},{key:"texture",get:function get(){return this[D].u_texSampler?{image:this[D].u_texSampler._img,options:this[R]}:null;}},{key:"enableBlend",get:function get(){return this[X]===!0||this[X]===!1?this[X]:this[rt]<1||this[B]!=null&&this[B][3]<1||this[A]!=null&&this[A][3]<1||this[D].u_colorMatrix!=null&&this[D].u_colorMatrix[18]<1||this[D].u_radialGradientVector!=null||this.beforeRender||this.afterRender;}},{key:"filterCanvas",get:function get(){return /blur|drop-shadow|url/.test(this.filter);}},{key:"filter",get:function get(){return this[V].join(" ");}},{key:"transformMatrix",get:function get(){return this[b];}},{key:"invertMatrix",get:function get(){if(!this[W]){var Y=r.mat2d.invert(Array.of(0,0,0,0,0,0),this[b]);this[W]=Y;}return this[W];}},{key:"transformScale",get:function get(){var Y=this[b];return Math.max(Math.hypot(Y[0],Y[1]),Math.hypot(Y[2],Y[3]));}},{key:"uniforms",get:function get(){return this[D];}},{key:"pass",get:function get(){return this[gt];}},{key:it,value:function value(Y){var k=this[ct],C=this[g].position0,M=Object.entries(Y._attribute);for(var j=0;j<M.length;j++){var _M$j=_slicedToArray(M[j],2),G=_M$j[0],Q=_M$j[1];if(G!=="a_color"&&G!=="a_sourceRect"&&Q!=="ignored"){var _=k[G];if(G==="uv"&&!_){var nt=this[g].boundingBox||i()(C);this[g].attributes[G]=xt(nt,C);}else{this[g].attributes[G]=[];for(var _nt=0;_nt<C.length;_nt++){var ut=C[_nt];this[g].attributes[G].push(_?_(ut,j,C):Array(Q.size).fill(0));}}}}}// {stroke, fill}
17
- },{key:"meshData",get:function get(){var _this7=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[g]){!this[L]&&!this[w]&&this.setFill();var Y=this[O],k={};if(Y&&Y.length){if(this[L])try{var j=S()(Y,this[L]);j.positions=j.positions.map(function(G){return G.push(_this7[rt]),G;}),j.attributes={a_color:Array.from({length:j.positions.length}).map(function(){return _this7[A].map(function(G){return Math.round(255*G);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
18
- },k.fill=j;}catch(_unused3){}if(this[w]){var _j=this[w].lineDash;var G=Y;if(_j){var _=this[w].lineDashOffset;G=Object(f.getDashContours)(Y,_j,_);}var Q=G.map(function(_,nt){var ut=_.length>1&&r.vec2.equals(_[0],_[_.length-1]),mt=_this7[w].build(_,ut);return S()([mt]);});Q.forEach(function(_){_.positions=_.positions.map(function(nt){return nt.push(-_this7[rt]),nt;}),_.attributes={a_color:Array.from({length:_.positions.length}).map(function(){return _this7[B].map(function(nt){return Math.round(255*nt);});})};}),k.stroke=Object(o["default"])(Q);}}var C=Object(o["default"])([k.fill,k.stroke]);C.fillPointCount=k.fill?k.fill.positions.length:0,C.enableBlend=this.enableBlend,C.position0=C.positions.map(function(_ref67){var _ref68=_slicedToArray(_ref67,3),j=_ref68[0],G=_ref68[1],Q=_ref68[2];return[j,G,Q];}),C.uniforms=this[D],this[g]=C,this[D].u_texSampler&&this[H](C,this[R]);var M=this[b];Object(m.isUnitTransform)(M)||(this[J](C,M),this[D].u_radialGradientVector&&this[et]()),this.clipPath&&this[Ct](),this[lt]&&this[it](this[lt]);}return this._updateMatrix&&(this[g].matrix=this[b],this[J](this[g],this[b]),this[D].u_radialGradientVector&&this[et]()),this[g];}},{key:J,value:function value(Y,k){var C=Y.positions,M=Y.position0;for(var j=0;j<C.length;j++){var _M$j2=_slicedToArray(M[j],2),G=_M$j2[0],Q=_M$j2[1],_=C[j];_[0]=G*k[0]+Q*k[2]+k[4],_[1]=G*k[1]+Q*k[3]+k[5];}this._updateMatrix=!1;}},{key:et,value:function value(){var Y=this[b],k=_toConsumableArray(this._radialGradientVector);if(k){var _k=_slicedToArray(k,5),C=_k[0],M=_k[1],j=_k[3],G=_k[4];k[0]=C*Y[0]+M*Y[2]+Y[4],k[1]=C*Y[1]+M*Y[3]+Y[5],k[3]=j*Y[0]+G*Y[2]+Y[4],k[4]=j*Y[1]+G*Y[3]+Y[5],this[D].u_radialGradientVector=k;}}},{key:H,value:function value(Y,k){function C(nt,ut){return nt==null&&ut==null?!0:nt==null||ut==null?!1:nt[0]===ut[0]&&nt[1]===ut[1]&&nt[2]===ut[2]&&nt[3]===ut[3];}var M=this[D].u_texSampler;if(!M)return;var _M$_img=M._img,j=_M$_img.width,G=_M$_img.height,Q=k.srcRect;var _=k.rect||[0,0];if(k.rotated&&(_=[-_[1],_[0],_[3],_[2]]),_[2]==null&&(_[2]=Q?Q[2]:j),_[3]==null&&(_[3]=Q?Q[3]:G),k.hidden)Y.textureCoord=Y.positions.map(function(){return[-1,-1,-1];});else if(!Y.textureCoord||!C(this[R].rect,k.rect)||this[R].hidden!==k.hidden||this[R].rotated!==k.rotated){var nt=null;k.rotated&&(nt=r.mat2d.rotate(Array.of(0,0,0,0,0,0),r.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),nt=r.mat2d.translate(Array.of(0,0,0,0,0,0),nt,[0,-_[2]])),Y.textureCoord=Y.position0.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),ut=_ref70[0],mt=_ref70[1],Pt=_ref70[2];if(1/Pt>0){if(k.rotated){var yt=ut*nt[0]+mt*nt[2]+nt[4],vt=ut*nt[1]+mt*nt[3]+nt[5];ut=yt;mt=vt;}var Tt=F([ut,mt],[_[0]/_[2],_[1]/_[3],_[2],_[3]],k);return k.repeat&&(Tt[2]=1),Tt;}return[-1,-1,-1];});}if(Q){var _nt2=[Q[0]/j,Q[1]/G,Q[2]/j,Q[3]/G];Y.attributes.a_sourceRect=Y.positions.map(function(){return[].concat(_nt2);});}else Y.attributes.a_sourceRect=Y.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(Y){if(!this.contours)return;if(this.contours.path){var C=this.contours.simplify,M=U(this.contours.path,2*Y,C);this[g]=null,this[O]=M;}}},{key:"canIgnore",value:function canIgnore(){var Y=this[w]==null||this[w].lineWidth===0||this[B][3]===0,k=this[L]==null||this[A][3]===0,C=this[D].u_radialGradientVector==null,M=this[D].u_texSampler==null;return this[rt]===0||this[lt]==null&&Y&&k&&C&&M&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
19
- // cap: 'butt' or 'square'
20
- // lineDash: null
21
- // lineDashOffset: 0
22
- },{key:"setStroke",value:function setStroke(){var _ref71=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref71$thickness=_ref71.thickness,Y=_ref71$thickness===void 0?1:_ref71$thickness,_ref71$cap=_ref71.cap,k=_ref71$cap===void 0?"butt":_ref71$cap,_ref71$join=_ref71.join,C=_ref71$join===void 0?"miter":_ref71$join,_ref71$miterLimit=_ref71.miterLimit,M=_ref71$miterLimit===void 0?10:_ref71$miterLimit,_ref71$color=_ref71.color,j=_ref71$color===void 0?[0,0,0,0]:_ref71$color,_ref71$lineDash=_ref71.lineDash,G=_ref71$lineDash===void 0?null:_ref71$lineDash,_ref71$lineDashOffset=_ref71.lineDashOffset,Q=_ref71$lineDashOffset===void 0?0:_ref71$lineDashOffset,_ref71$roundSegments=_ref71.roundSegments,_=_ref71$roundSegments===void 0?20:_ref71$roundSegments;return this[g]=null,this[w]=new l["default"]({lineWidth:Y,lineCap:k,lineJoin:C,miterLimit:M,roundSegments:_}),typeof j=="string"&&(j=Object(P["default"])(j)),this[B]=j,this[w].lineDash=G,this[w].lineDashOffset=Q,this;}},{key:"setFill",value:function setFill(){var _ref72=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref72$rule=_ref72.rule,Y=_ref72$rule===void 0?this.fillRule:_ref72$rule,_ref72$color=_ref72.color,k=_ref72$color===void 0?[0,0,0,0]:_ref72$color;return this[g]=null,this[L]={rule:Y},typeof k=="string"&&(k=Object(P["default"])(k)),this[A]=k,this;}/**
23
- options: {
24
- scale: false,
25
- repeat: false,
26
- rotated: false,
27
- rect: [10, 10],
28
- srcRect: [...],
29
- hidden: false,
30
- }
31
- */},{key:"setTexture",value:function setTexture(Y){var k=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(Y&&Y.image){var _Y=Y,C=_Y.image,M=_Y.rect;if(Y=C,k.rect)for(var j=0;j<k.rect.length;j++)M[j]=k.rect[j];k.rect=M;}return this[L]||this.setFill(),this.setUniforms({u_texSampler:Y}),this[g]&&this[H](this[g],k),this[R]=k,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref73.vector,k=_ref73.colors,_ref73$type=_ref73.type,C=_ref73$type===void 0?"fill":_ref73$type;if(Y.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:Y,colors:k,type:C});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref74.vector,k=_ref74.colors,_ref74$type=_ref74.type,C=_ref74$type===void 0?"fill":_ref74$type;if(Y.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:Y,colors:k,type:C});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref75.vector,k=_ref75.colors,_ref75$type=_ref75.type,C=_ref75$type===void 0?"fill":_ref75$type;if(Y.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:Y,colors:k,type:C});}/**
32
- vector: [x0, y0, r0, x1, y1, r1],
33
- colors: [{offset:0, color}, {offset:1, color}, ...],
34
- */},{key:"setGradient",value:function setGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref76.vector,k=_ref76.colors,_ref76$type=_ref76.type,C=_ref76$type===void 0?"fill":_ref76$type;k=k.map(function(_ref77){var G=_ref77.offset,Q=_ref77.color;return typeof Q=="string"&&(Q=Object(P["default"])(Q)),{offset:G,color:Q};}),this[$]=this[$]||{},this[$][C]={vector:Y,colors:k},k.sort(function(G,Q){return G.offset-Q.offset;});var M=[];k.forEach(function(_ref78){var G=_ref78.offset,Q=_ref78.color;M.push.apply(M,[G].concat(_toConsumableArray(Q)));});var j;if(Y.length===4?j=[Y[0],Y[1],0,Y[2],Y[3],0]:j=_toConsumableArray(Y),M.length<40&&M.push(-1),M.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=j,this[D].u_colorSteps=M,C==="fill"?this[D].u_gradientType=1:this[D].u_gradientType=0,this[et](),this;}},{key:"setUniforms",value:function setUniforms(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[D],Y),this;}},{key:"setTransform",value:function setTransform(){var k=this[b];for(var _len3=arguments.length,Y=new Array(_len3),_key3=0;_key3<_len3;_key3++){Y[_key3]=arguments[_key3];}return r.mat2d.equals(Y,k)||(this[b]=Y,delete this[W],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var k=this[b];for(var _len4=arguments.length,Y=new Array(_len4),_key4=0;_key4<_len4;_key4++){Y[_key4]=arguments[_key4];}return this[b]=r.mat2d.multiply(Array.of(0,0,0,0,0,0),k,Y),delete this[W],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(Y,k){var C=r.mat2d.create();return C=r.mat2d.translate(Array.of(0,0,0,0,0,0),C,[Y,k]),this.transform.apply(this,_toConsumableArray(C));}},{key:"rotate",value:function rotate(Y){var _ref79=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref80=_slicedToArray(_ref79,2),k=_ref80[0],C=_ref80[1];var M=r.mat2d.create();return M=r.mat2d.translate(Array.of(0,0,0,0,0,0),M,[k,C]),M=r.mat2d.rotate(Array.of(0,0,0,0,0,0),M,Y),M=r.mat2d.translate(Array.of(0,0,0,0,0,0),M,[-k,-C]),this.transform.apply(this,_toConsumableArray(M));}},{key:"scale",value:function scale(Y){var k=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Y;var _ref81=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref82=_slicedToArray(_ref81,2),C=_ref82[0],M=_ref82[1];var j=r.mat2d.create();return j=r.mat2d.translate(Array.of(0,0,0,0,0,0),j,[C,M]),j=r.mat2d.scale(Array.of(0,0,0,0,0,0),j,[Y,k]),j=r.mat2d.translate(Array.of(0,0,0,0,0,0),j,[-C,-M]),this.transform.apply(this,_toConsumableArray(j));}},{key:"skew",value:function skew(Y){var k=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Y;var _ref83=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref84=_slicedToArray(_ref83,2),C=_ref84[0],M=_ref84[1];var j=r.mat2d.create();return j=r.mat2d.translate(Array.of(0,0,0,0,0,0),j,[C,M]),j=r.mat2d.multiply(Array.of(0,0,0,0,0,0),j,r.mat2d.fromValues(1,Math.tan(k),Math.tan(Y),1,0,0)),j=r.mat2d.translate(Array.of(0,0,0,0,0,0),j,[-C,-M]),this.transform.apply(this,_toConsumableArray(j));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[V].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,Y=new Array(_len5),_key5=0;_key5<_len5;_key5++){Y[_key5]=arguments[_key5];}return Y[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:Y}),this;}// apply linear color transform
35
- },{key:"transformColor",value:function transformColor(){var k=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,Y=new Array(_len6),_key6=0;_key6<_len6;_key6++){Y[_key6]=arguments[_key6];}return k?k=Object(c.multiply)(k,Y):k=Y,this.setColorTransform.apply(this,_toConsumableArray(k)),this;}},{key:"blur",value:function blur(Y){return this[V].push("blur(".concat(Y,"px)")),this;}},{key:"brightness",value:function brightness(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("brightness(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.brightness)(Y)));}},{key:"contrast",value:function contrast(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("contrast(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.contrast)(Y)));}},{key:"dropShadow",value:function dropShadow(Y,k){var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var M=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(M)&&(M=Object(a["default"])(M)),this[V].push("drop-shadow(".concat(Y,"px ").concat(k,"px ").concat(C,"px ").concat(M,")")),this;}},{key:"grayscale",value:function grayscale(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("grayscale(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.grayscale)(Y)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
36
- },{key:"hueRotate",value:function hueRotate(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[V].push("hue-rotate(".concat(Y,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(c.hueRotate)(Y)));}},{key:"invert",value:function invert(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("invert(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.invert)(Y)));}},{key:"opacity",value:function opacity(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("opacity(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.opacity)(Y)));}},{key:"saturate",value:function saturate(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("saturate(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.saturate)(Y)));}},{key:"sepia",value:function sepia(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[V].push("sepia(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(c.sepia)(Y)));}},{key:"url",value:function url(Y){return this[V].push("url(".concat(Y,")")),this;}},{key:"isPointCollision",value:function isPointCollision(Y,k){var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var M=this.meshData,j=M.positions,G=M.cells,Q=this.invertMatrix,_=Q[0]*Y+Q[2]*k+Q[4],nt=Q[1]*Y+Q[3]*k+Q[5],ut=this.boundingBox;if(_<ut[0][0]||_>ut[1][0]||nt<ut[0][1]||nt>ut[1][1])return!1;function mt(_ref85,_ref86,_ref87){var _ref88=_slicedToArray(_ref85,2),Pt=_ref88[0],Tt=_ref88[1];var _ref89=_slicedToArray(_ref86,2),yt=_ref89[0],vt=_ref89[1];var _ref90=_slicedToArray(_ref87,2),St=_ref90[0],Mt=_ref90[1];var wt=St-yt,Ot=Mt-vt,Bt=((Pt-yt)*wt+(Tt-vt)*Ot)/(Math.pow(wt,2)+Math.pow(Ot,2));return Bt>=0&&Bt<=1;}for(var Pt=0;Pt<G.length;Pt++){var Tt=G[Pt];if(C==="fill"&&Tt[0]>=M.fillPointCount)break;if(C==="stroke"&&Tt[0]<M.fillPointCount)continue;var _Tt$map=Tt.map(function(Ut){return j[Ut];}),_Tt$map2=_slicedToArray(_Tt$map,3),_Tt$map2$=_slicedToArray(_Tt$map2[0],2),yt=_Tt$map2$[0],vt=_Tt$map2$[1],_Tt$map2$2=_slicedToArray(_Tt$map2[1],2),St=_Tt$map2$2[0],Mt=_Tt$map2$2[1],_Tt$map2$3=_slicedToArray(_Tt$map2[2],2),wt=_Tt$map2$3[0],Ot=_Tt$map2$3[1],Bt=Math.sign((Y-yt)*(Mt-vt)-(St-yt)*(k-vt));if(Bt===0&&mt([Y,k],[yt,vt],[St,Mt]))return!0;var Gt=Math.sign((Y-St)*(Ot-Mt)-(wt-St)*(k-Mt));if(Gt===0&&mt([Y,k],[St,Mt],[wt,Ot]))return!0;var jt=Math.sign((Y-wt)*(vt-Ot)-(yt-wt)*(k-Ot));if(jt===0&&mt([Y,k],[wt,Ot],[yt,vt])||Bt===1&&Gt===1&&jt===1||Bt===-1&&Gt===-1&&jt===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(Y,k){return this.isPointCollision(Y,k,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(Y,k){return this.isPointCollision(Y,k,"stroke");}},{key:"addPass",value:function addPass(Y){var k=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var C=k.width,M=k.height,j=p(k,["width","height"]);var G=new x["default"]();G.rect(0,0,C,M);var Q=new K(G,{width:C,height:M});Q.setUniforms(j),Q.setProgram(Y),this[gt].push(Q);}}]);}();},/* 57 *//***/function(u,e,t){t.r(e);var r=t(58);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r.Stroke;},/* 58 *//***/function(u,e,t){t.r(e),t.d(e,"Stroke",function(){return m;});var r=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(r.create)(),i=Object(r.create)(),l=Object(r.create)(),o=Object(r.create)(),a=Object(r.create)(),c=1e20;var m=/*#__PURE__*/function(){function m(){var _ref91=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref91$lineWidth=_ref91.lineWidth,T=_ref91$lineWidth===void 0?1:_ref91$lineWidth,_ref91$lineJoin=_ref91.lineJoin,P=_ref91$lineJoin===void 0?"miter":_ref91$lineJoin,_ref91$miterLimit=_ref91.miterLimit,x=_ref91$miterLimit===void 0?10:_ref91$miterLimit,_ref91$lineCap=_ref91.lineCap,h=_ref91$lineCap===void 0?"butt":_ref91$lineCap,_ref91$roundSegments=_ref91.roundSegments,p=_ref91$roundSegments===void 0?20:_ref91$roundSegments;_classCallCheck(this,m);this.lineWidth=T,this.lineJoin=P,this.miterLimit=x,this.lineCap=h,this.roundSegments=p,this._normal=null;}return _createClass(m,[{key:"build",value:function build(T){var P=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var x=T.length;if(T=_toConsumableArray(T),x<2)return T;P&&((T[0][0]!==T[x-1][0]||T[0][1]!==T[x-1][1])&&T.push(_toConsumableArray(T[0])),T.push(_toConsumableArray(T[1]))),x=T.length,this._normal=null;var h={left:[],right:[]},p=this.lineWidth/2,d=this.lineCap;if(!P&&d==="square"){Object(r.direction)(i,T[0],T[1]),Object(r.scaleAndAdd)(T[0],T[0],i,p);var O=T.length-1;Object(r.direction)(i,T[O],T[O-1]),Object(r.scaleAndAdd)(T[O],T[O],i,p);}for(var _O4=1;_O4<x;_O4++){var w=T[_O4-1],L=T[_O4],B=T[_O4+1];this._seg(h,w,L,B,p,P);}return!P&&d==="round"&&S(h,this.roundSegments),[].concat(_toConsumableArray(h.left),_toConsumableArray(h.right.reverse()));}},{key:"_seg",value:function _seg(T,P,x,h,p,d){var g=this.lineJoin==="bevel",O=this.lineJoin==="round";if(Object(r.direction)(i,x,P),this._normal||(this._normal=Object(r.create)(),Object(r.normal)(this._normal,i)),T.left.length||v(T,P,this._normal,p),!h)Object(r.normal)(this._normal,i),d?v(T,P,this._normal,p):v(T,x,this._normal,p);else{Object(r.direction)(l,h,x);var w=Object(r.computeMiter)(o,a,i,l,p);w=Math.min(w,c);var L=Object(r.dot)(o,this._normal)<0?-1:1;var B=g||O;if(!B&&this.lineJoin==="miter"&&w/p>this.miterLimit&&(B=!0),B){Object(r.scaleAndAdd)(n,x,this._normal,-p*L),f(T,n,L);var A=1/0;P&&(A=Math.min(A,Math.hypot(x[0]-P[0],x[1]-P[1]))),h&&(A=Math.min(A,Math.hypot(h[0]-x[0],h[1]-x[1])));var b=Math.max(p,Math.min(w,A));if(Object(r.scaleAndAdd)(n,x,a,b*L),f(T,n,-L),h)if(Object(r.normal)(n,l),Object(r.copy)(this._normal,n),Object(r.scaleAndAdd)(n,x,n,-p*L),O){var W=Object(r.clone)(n),D=L>0?T.left[T.left.length-1]:T.right[T.right.length-1],R=Object(r.clone)(x),X=Object(r.sub)(Object(r.create)(),D,R),H=Object(r.sub)(Object(r.create)(),W,R),J=Math.PI/this.roundSegments;for(var et=0;et<this.roundSegments&&(Object(r.rotate)(X,X,[0,0],L*J),Math.sign(Object(r.cross)(n,X,H)[2])===L);et++)Object(r.add)(n,X,R),f(T,n,L);f(T,W,L);}else f(T,n,L);}else v(T,x,a,w),Object(r.copy)(this._normal,a);}}}]);}();function f(E,T,P){P>0?E.left.push(Object(r.clone)(T)):E.right.push(Object(r.clone)(T));}function v(E,T,P,x){var h=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(r.scaleAndAdd)(n,T,P,-x),f(E,n,-h),Object(r.scaleAndAdd)(n,T,P,x),f(E,n,h);}function S(_ref92,P){var E=_ref92.left,T=_ref92.right;var x=Object(r.create)(),h=Object(r.create)();var p=E[0],d=T[0],g=[0.5*(p[0]+d[0]),0.5*(p[1]+d[1])];Object(r.sub)(h,p,g);for(var O=1;O<=P;O++){var w=-1*Math.PI*O/P;Object(r.rotate)(x,h,[0,0],w),Object(r.add)(n,g,x),E.unshift(Object(r.clone)(n));}p=T[T.length-1],d=E[E.length-1],g=[0.5*(p[0]+d[0]),0.5*(p[1]+d[1])],Object(r.sub)(h,p,g);for(var _O5=1;_O5<=P;_O5++){var _w2=-1*Math.PI*_O5/P;Object(r.rotate)(x,h,[0,0],_w2),Object(r.add)(n,g,x),T.push(Object(r.clone)(n));}}},/* 59 *//***/function(u,e,t){t.r(e),t.d(e,"isUnitTransform",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 *//***/function(u,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(61),n=t(62);u.exports=function(i,l){if(l=l||{},i=i.filter(function(P){return P.length>2;}),i.length===0)return{positions:[],cells:[]};typeof l.vertexSize!="number"&&(l.vertexSize=i[0][0].length),i=i.map(function(P){return P.reduce(function(x,h){return x.concat(h);});});var o=l.rule==="evenodd"?r.WINDING_ODD:r.WINDING_NONZERO;for(var a=r.tesselate(n({contours:i,windingRule:o,elementType:r.POLYGONS,polySize:3,vertexSize:2},l)),c=[],m=0;m<a.vertices.length;m+=l.vertexSize){var f=a.vertices.slice(m,m+l.vertexSize);c.push(f);}var v=[];for(m=0;m<a.elements.length;m+=3){var S=a.elements[m],E=a.elements[m+1],T=a.elements[m+2];v.push([S,E,T]);}return{positions:c,cells:v};};},/* 61 *//***/function(u,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r={},n={};u.exports=r,r.WINDING_ODD=0,r.WINDING_NONZERO=1,r.WINDING_POSITIVE=2,r.WINDING_NEGATIVE=3,r.WINDING_ABS_GEQ_TWO=4,r.POLYGONS=0,r.CONNECTED_POLYGONS=1,r.BOUNDARY_CONTOURS=2,r.tesselate=function(h){for(var p=h.debug||!1,d=new x(),g=0;g<h.contours.length;g++)d.addContour(h.vertexSize||2,h.contours[g]);return d.tesselate(h.windingRule||r.WINDING_ODD,h.elementType||r.POLYGONS,h.polySize||3,h.vertexSize||2,h.normal||[0,0,1]),{vertices:d.vertices,vertexIndices:d.vertexIndices,vertexCount:d.vertexCount,elements:d.elements,elementCount:d.elementCount,mesh:p?d.mesh:void 0};};var i=function i(h){if(!h)throw"Assertion Failed!";};function l(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0;}function o(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function a(h){this.next=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Org=null,this.Lface=null,this.activeRegion=null,this.winding=0,this.side=h;}a.prototype={get Rface(){return this.Sym.Lface;},set Rface(h){this.Sym.Lface=h;},get Dst(){return this.Sym.Org;},set Dst(h){this.Sym.Org=h;},get Oprev(){return this.Sym.Lnext;},set Oprev(h){this.Sym.Lnext=h;},get Lprev(){return this.Onext.Sym;},set Lprev(h){this.Onext.Sym=h;},get Dprev(){return this.Lnext.Sym;},set Dprev(h){this.Lnext.Sym=h;},get Rprev(){return this.Sym.Onext;},set Rprev(h){this.Sym.Onext=h;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(h){this.Sym.Onext.Sym=h;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(h){this.Sym.Lnext.Sym=h;}/* 3 pointers */};function c(){var h=new l(),p=new o(),d=new a(0),g=new a(1);h.next=h.prev=h,h.anEdge=null,p.next=p.prev=p,p.anEdge=null,p.trail=null,p.marked=!1,p.inside=!1,d.next=d,d.Sym=g,d.Onext=null,d.Lnext=null,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,g.next=g,g.Sym=d,g.Onext=null,g.Lnext=null,g.Org=null,g.Lface=null,g.winding=0,g.activeRegion=null,this.vHead=h,this.fHead=p,this.eHead=d,this.eHeadSym=g;}c.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
37
- * No vertex or face structures are allocated, but these must be assigned
38
- * before the current edge operation is completed.
39
- *///static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
40
- makeEdge_:function makeEdge_(h){var p=new a(0),d=new a(1);h.Sym.side<h.side&&(h=h.Sym);var g=h.Sym.next;return d.next=g,g.Sym.next=p,p.next=h,h.Sym.next=d,p.Sym=d,p.Onext=p,p.Lnext=d,p.Org=null,p.Lface=null,p.winding=0,p.activeRegion=null,d.Sym=p,d.Onext=d,d.Lnext=p,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,p;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
41
- * CS348a notes (see mesh.h). Basically it modifies the mesh so that
42
- * a->Onext and b->Onext are exchanged. This can have various effects
43
- * depending on whether a and b belong to different face or vertex rings.
44
- * For more explanation see tessMeshSplice() below.
45
- */// static void Splice( TESShalfEdge *a, TESShalfEdge *b )
46
- splice_:function splice_(h,p){var d=h.Onext,g=p.Onext;d.Sym.Lnext=p,g.Sym.Lnext=h,h.Onext=g,p.Onext=d;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
47
- * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
48
- * a place to insert the new vertex in the global vertex list. We insert
49
- * the new vertex *before* vNext so that algorithms which walk the vertex
50
- * list will not see the newly created vertices.
51
- *///static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
52
- makeVertex_:function makeVertex_(h,p,d){var g=h;i(g!==null);var O=d.prev;g.prev=O,O.next=g,g.next=d,d.prev=g,g.anEdge=p;var w=p;do w.Org=g,w=w.Onext;while(w!==p);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
53
- * face of all edges in the face loop to which eOrig belongs. "fNext" gives
54
- * a place to insert the new face in the global face list. We insert
55
- * the new face *before* fNext so that algorithms which walk the face
56
- * list will not see the newly created faces.
57
- */// static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
58
- makeFace_:function makeFace_(h,p,d){var g=h;i(g!==null);var O=d.prev;g.prev=O,O.next=g,g.next=d,d.prev=g,g.anEdge=p,g.trail=null,g.marked=!1,g.inside=d.inside;var w=p;do w.Lface=g,w=w.Lnext;while(w!==p);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
59
- * and removes from the global edge list.
60
- *///static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
61
- killEdge_:function killEdge_(h){h.Sym.side<h.side&&(h=h.Sym);var p=h.next,d=h.Sym.next;p.Sym.next=d,d.Sym.next=p;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
62
- * vertex list. It updates the vertex loop to point to a given new vertex.
63
- *///static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
64
- killVertex_:function killVertex_(h,p){var d=h.anEdge,g=d;do g.Org=p,g=g.Onext;while(g!==d);var O=h.prev,w=h.next;w.prev=O,O.next=w;},/* KillFace( fDel ) destroys a face and removes it from the global face
65
- * list. It updates the face loop to point to a given new face.
66
- *///static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
67
- killFace_:function killFace_(h,p){var d=h.anEdge,g=d;do g.Lface=p,g=g.Lnext;while(g!==d);var O=h.prev,w=h.next;w.prev=O,O.next=w;},/****************** Basic Edge Operations **********************//* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
68
- * The loop consists of the two new half-edges.
69
- *///TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
70
- makeEdge:function makeEdge(){var h=new l(),p=new l(),d=new o(),g=this.makeEdge_(this.eHead);return this.makeVertex_(h,g,this.vHead),this.makeVertex_(p,g.Sym,this.vHead),this.makeFace_(d,g,this.fHead),g;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
71
- * mesh connectivity and topology. It changes the mesh so that
72
- * eOrg->Onext <- OLD( eDst->Onext )
73
- * eDst->Onext <- OLD( eOrg->Onext )
74
- * where OLD(...) means the value before the meshSplice operation.
75
- *
76
- * This can have two effects on the vertex structure:
77
- * - if eOrg->Org != eDst->Org, the two vertices are merged together
78
- * - if eOrg->Org == eDst->Org, the origin is split into two vertices
79
- * In both cases, eDst->Org is changed and eOrg->Org is untouched.
80
- *
81
- * Similarly (and independently) for the face structure,
82
- * - if eOrg->Lface == eDst->Lface, one loop is split into two
83
- * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
84
- * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
85
- *
86
- * Some special cases:
87
- * If eDst == eOrg, the operation has no effect.
88
- * If eDst == eOrg->Lnext, the new face will have a single edge.
89
- * If eDst == eOrg->Lprev, the old face will have a single edge.
90
- * If eDst == eOrg->Onext, the new vertex will have a single edge.
91
- * If eDst == eOrg->Oprev, the old vertex will have a single edge.
92
- *///int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
93
- splice:function splice(h,p){var d=!1,g=!1;if(h!==p){if(p.Org!==h.Org&&(g=!0,this.killVertex_(p.Org,h.Org)),p.Lface!==h.Lface&&(d=!0,this.killFace_(p.Lface,h.Lface)),this.splice_(p,h),!g){var O=new l();this.makeVertex_(O,p,h.Org),h.Org.anEdge=h;}if(!d){var w=new o();this.makeFace_(w,p,h.Lface),h.Lface.anEdge=h;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
94
- * if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
95
- * eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
96
- * the newly created loop will contain eDel->Dst. If the deletion of eDel
97
- * would create isolated vertices, those are deleted as well.
98
- *
99
- * This function could be implemented as two calls to tessMeshSplice
100
- * plus a few calls to memFree, but this would allocate and delete
101
- * unnecessary vertices and faces.
102
- *///int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
103
- "delete":function _delete(h){var p=h.Sym,d=!1;if(h.Lface!==h.Rface&&(d=!0,this.killFace_(h.Lface,h.Rface)),h.Onext===h)this.killVertex_(h.Org,null);else if(h.Rface.anEdge=h.Oprev,h.Org.anEdge=h.Onext,this.splice_(h,h.Oprev),!d){var g=new o();this.makeFace_(g,h,h.Lface);}p.Onext===p?(this.killVertex_(p.Org,null),this.killFace_(p.Lface,null)):(h.Lface.anEdge=p.Oprev,p.Org.anEdge=p.Onext,this.splice_(p,p.Oprev)),this.killEdge_(h);},/******************** Other Edge Operations **********************//* All these routines can be implemented with the basic edge
104
- * operations above. They are provided for convenience and efficiency.
105
- *//* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
106
- * eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
107
- * eOrg and eNew will have the same left face.
108
- */// TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
109
- addEdgeVertex:function addEdgeVertex(h){var p=this.makeEdge_(h),d=p.Sym;this.splice_(p,h.Lnext),p.Org=h.Dst;var g=new l();return this.makeVertex_(g,d,p.Org),p.Lface=d.Lface=h.Lface,p;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
110
- * such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
111
- * eOrg and eNew will have the same left face.
112
- */// TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
113
- splitEdge:function splitEdge(h,p){var d=this.addEdgeVertex(h),g=d.Sym;return this.splice_(h.Sym,h.Sym.Oprev),this.splice_(h.Sym,g),h.Dst=g.Org,g.Dst.anEdge=g.Sym,g.Rface=h.Rface,g.winding=h.winding,g.Sym.winding=h.Sym.winding,g;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
114
- * to eDst->Org, and returns the corresponding half-edge eNew.
115
- * If eOrg->Lface == eDst->Lface, this splits one loop into two,
116
- * and the newly created loop is eNew->Lface. Otherwise, two disjoint
117
- * loops are merged into one, and the loop eDst->Lface is destroyed.
118
- *
119
- * If (eOrg == eDst), the new face will have only two edges.
120
- * If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
121
- * If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
122
- */// TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
123
- connect:function connect(h,p){var d=!1,g=this.makeEdge_(h),O=g.Sym;if(p.Lface!==h.Lface&&(d=!0,this.killFace_(p.Lface,h.Lface)),this.splice_(g,h.Lnext),this.splice_(O,p),g.Org=h.Dst,O.Org=p.Org,g.Lface=O.Lface=h.Lface,h.Lface.anEdge=O,!d){var w=new o();this.makeFace_(w,g,h.Lface);}return g;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
124
- * global face list. All edges of fZap will have a NULL pointer as their
125
- * left face. Any edges which also have a NULL pointer as their right face
126
- * are deleted entirely (along with any isolated vertices this produces).
127
- * An entire mesh can be deleted by zapping its faces, one at a time,
128
- * in any order. Zapped faces cannot be used in further mesh operations!
129
- */zapFace:function zapFace(h){var p=h.anEdge,d,g,O,w,L;g=p.Lnext;do d=g,g=d.Lnext,d.Lface=null,d.Rface===null&&(d.Onext===d?this.killVertex_(d.Org,null):(d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),O=d.Sym,O.Onext===O?this.killVertex_(O.Org,null):(O.Org.anEdge=O.Onext,this.splice_(O,O.Oprev)),this.killEdge_(d));while(d!=p);w=h.prev,L=h.next,L.prev=w,w.next=L;},countFaceVerts_:function countFaceVerts_(h){var p=h.anEdge,d=0;do d++,p=p.Lnext;while(p!==h.anEdge);return d;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
130
- mergeConvexFaces:function mergeConvexFaces(h){var p,d,g,O,w,L,B;for(p=this.fHead.next;p!==this.fHead;p=p.next)if(p.inside)for(d=p.anEdge,w=d.Org;g=d.Lnext,O=d.Sym,O&&O.Lface&&O.Lface.inside&&(L=this.countFaceVerts_(p),B=this.countFaceVerts_(O.Lface),L+B-2<=h&&n.vertCCW(d.Lprev.Org,d.Org,O.Lnext.Lnext.Org)&&n.vertCCW(O.Lprev.Org,O.Org,d.Lnext.Lnext.Org)&&(g=O.Lnext,this["delete"](O),d=null,O=null)),!(d&&d.Lnext.Org===w);)d=g;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
131
- */check:function check(){var h=this.fHead,p=this.vHead,d=this.eHead,g,O,w,L,B,A;for(O=h,O=h;(g=O.next)!==h;O=g){i(g.prev===O),B=g.anEdge;do i(B.Sym!==B),i(B.Sym.Sym===B),i(B.Lnext.Onext.Sym===B),i(B.Onext.Sym.Lnext===B),i(B.Lface===g),B=B.Lnext;while(B!==g.anEdge);}for(i(g.prev===O&&g.anEdge===null),L=p,L=p;(w=L.next)!==p;L=w){i(w.prev===L),B=w.anEdge;do i(B.Sym!==B),i(B.Sym.Sym===B),i(B.Lnext.Onext.Sym===B),i(B.Onext.Sym.Lnext===B),i(B.Org===w),B=B.Onext;while(B!==w.anEdge);}for(i(w.prev===L&&w.anEdge===null),A=d,A=d;(B=A.next)!==d;A=B)i(B.Sym.next===A.Sym),i(B.Sym!==B),i(B.Sym.Sym===B),i(B.Org!==null),i(B.Dst!==null),i(B.Lnext.Onext.Sym===B),i(B.Onext.Sym.Lnext===B);i(B.Sym.next===A.Sym&&B.Sym===this.eHeadSym&&B.Sym.Sym===B&&B.Org===null&&B.Dst===null&&B.Lface===null&&B.Rface===null);}},n.vertEq=function(h,p){return h.s===p.s&&h.t===p.t;},n.vertLeq=function(h,p){return h.s<p.s||h.s===p.s&&h.t<=p.t;},n.transLeq=function(h,p){return h.t<p.t||h.t===p.t&&h.s<=p.s;},n.edgeGoesLeft=function(h){return n.vertLeq(h.Dst,h.Org);},n.edgeGoesRight=function(h){return n.vertLeq(h.Org,h.Dst);},n.vertL1dist=function(h,p){return Math.abs(h.s-p.s)+Math.abs(h.t-p.t);},n.edgeEval=function(h,p,d){i(n.vertLeq(h,p)&&n.vertLeq(p,d));var g=p.s-h.s,O=d.s-p.s;return g+O>0?g<O?p.t-h.t+(h.t-d.t)*(g/(g+O)):p.t-d.t+(d.t-h.t)*(O/(g+O)):0;},n.edgeSign=function(h,p,d){i(n.vertLeq(h,p)&&n.vertLeq(p,d));var g=p.s-h.s,O=d.s-p.s;return g+O>0?(p.t-d.t)*g+(p.t-h.t)*O:0;},n.transEval=function(h,p,d){i(n.transLeq(h,p)&&n.transLeq(p,d));var g=p.t-h.t,O=d.t-p.t;return g+O>0?g<O?p.s-h.s+(h.s-d.s)*(g/(g+O)):p.s-d.s+(d.s-h.s)*(O/(g+O)):0;},n.transSign=function(h,p,d){i(n.transLeq(h,p)&&n.transLeq(p,d));var g=p.t-h.t,O=d.t-p.t;return g+O>0?(p.s-d.s)*g+(p.s-h.s)*O:0;},n.vertCCW=function(h,p,d){return h.s*(p.t-d.t)+p.s*(d.t-h.t)+d.s*(h.t-p.t)>=0;},n.interpolate=function(h,p,d,g){return h=h<0?0:h,d=d<0?0:d,h<=d?d===0?(p+g)/2:p+(g-p)*(h/(h+d)):g+(p-g)*(d/(h+d));},n.intersect=function(h,p,d,g,O){var w,L,B;n.vertLeq(h,p)||(B=h,h=p,p=B),n.vertLeq(d,g)||(B=d,d=g,g=B),n.vertLeq(h,d)||(B=h,h=d,d=B,B=p,p=g,g=B),n.vertLeq(d,p)?n.vertLeq(p,g)?(w=n.edgeEval(h,d,p),L=n.edgeEval(d,p,g),w+L<0&&(w=-w,L=-L),O.s=n.interpolate(w,d.s,L,p.s)):(w=n.edgeSign(h,d,p),L=-n.edgeSign(h,g,p),w+L<0&&(w=-w,L=-L),O.s=n.interpolate(w,d.s,L,g.s)):O.s=(d.s+p.s)/2,n.transLeq(h,p)||(B=h,h=p,p=B),n.transLeq(d,g)||(B=d,d=g,g=B),n.transLeq(h,d)||(B=h,h=d,d=B,B=p,p=g,g=B),n.transLeq(d,p)?n.transLeq(p,g)?(w=n.transEval(h,d,p),L=n.transEval(d,p,g),w+L<0&&(w=-w,L=-L),O.t=n.interpolate(w,d.t,L,p.t)):(w=n.transSign(h,d,p),L=-n.transSign(h,g,p),w+L<0&&(w=-w,L=-L),O.t=n.interpolate(w,d.t,L,g.t)):O.t=(d.t+p.t)/2;};function m(){this.key=null,this.next=null,this.prev=null;}function f(h,p){this.head=new m(),this.head.next=this.head,this.head.prev=this.head,this.frame=h,this.leq=p;}f.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(h){return this.insertBefore(this.head,h);},search:function search(h){var p=this.head;do p=p.next;while(p.key!==null&&!this.leq(this.frame,h,p.key));return p;},insertBefore:function insertBefore(h,p){do h=h.prev;while(h.key!==null&&!this.leq(this.frame,h.key,p));var d=new m();return d.key=p,d.next=h.next,h.next.prev=d,d.prev=h,h.next=d,d;},"delete":function _delete(h){h.next.prev=h.prev,h.prev.next=h.next;}};function v(){this.handle=null;}function S(){this.key=null,this.node=null;}function E(h,p){this.size=0,this.max=h,this.nodes=[],this.nodes.length=h+1;var d;for(d=0;d<this.nodes.length;d++)this.nodes[d]=new v();for(this.handles=[],this.handles.length=h+1,d=0;d<this.handles.length;d++)this.handles[d]=new S();this.initialized=!1,this.freeList=0,this.leq=p,this.nodes[1].handle=1,this.handles[1].key=null;}E.prototype={floatDown_:function floatDown_(h){var p=this.nodes,d=this.handles,g,O,w;for(g=p[h].handle;;){if(w=h<<1,w<this.size&&this.leq(d[p[w+1].handle].key,d[p[w].handle].key)&&++w,i(w<=this.max),O=p[w].handle,w>this.size||this.leq(d[g].key,d[O].key)){p[h].handle=g,d[g].node=h;break;}p[h].handle=O,d[O].node=h,h=w;}},floatUp_:function floatUp_(h){var p=this.nodes,d=this.handles,g,O,w;for(g=p[h].handle;;){if(w=h>>1,O=p[w].handle,w===0||this.leq(d[O].key,d[g].key)){p[h].handle=g,d[g].node=h;break;}p[h].handle=O,d[O].node=h,h=w;}},init:function init(){for(var h=this.size;h>=1;--h)this.floatDown_(h);this.initialized=!0;},min:function min(){return this.handles[this.nodes[1].handle].key;},/* really pqHeapInsert *//* returns INV_HANDLE iff out of memory *///PQhandle pqHeapInsert( TESSalloc* alloc, PriorityQHeap *pq, PQkey keyNew )
132
- insert:function insert(h){var p,d;if(p=++this.size,p*2>this.max){this.max*=2;var g,O;for(O=this.nodes.length,this.nodes.length=this.max+1,g=O;g<this.nodes.length;g++)this.nodes[g]=new v();for(O=this.handles.length,this.handles.length=this.max+1,g=O;g<this.handles.length;g++)this.handles[g]=new S();}return this.freeList===0?d=p:(d=this.freeList,this.freeList=this.handles[d].node),this.nodes[p].handle=d,this.handles[d].node=p,this.handles[d].key=h,this.initialized&&this.floatUp_(p),d;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
133
- extractMin:function extractMin(){var h=this.nodes,p=this.handles,d=h[1].handle,g=p[d].key;return this.size>0&&(h[1].handle=h[this.size].handle,p[h[1].handle].node=1,p[d].key=null,p[d].node=this.freeList,this.freeList=d,--this.size,this.size>0&&this.floatDown_(1)),g;},"delete":function _delete(h){var p=this.nodes,d=this.handles,g;i(h>=1&&h<=this.max&&d[h].key!==null),g=d[h].node,p[g].handle=p[this.size].handle,d[p[g].handle].node=g,--this.size,g<=this.size&&(g<=1||this.leq(d[p[g>>1].handle].key,d[p[g].handle].key)?this.floatDown_(g):this.floatUp_(g)),d[h].key=null,d[h].node=this.freeList,this.freeList=h;}};function T(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var P={};P.regionBelow=function(h){return h.nodeUp.prev.key;},P.regionAbove=function(h){return h.nodeUp.next.key;},P.debugEvent=function(h){},P.addWinding=function(h,p){h.winding+=p.winding,h.Sym.winding+=p.Sym.winding;},P.edgeLeq=function(h,p,d){var g=h.event,L,B,O=p.eUp,w=d.eUp;if(O.Dst===g)return w.Dst===g?n.vertLeq(O.Org,w.Org)?n.edgeSign(w.Dst,O.Org,w.Org)<=0:n.edgeSign(O.Dst,w.Org,O.Org)>=0:n.edgeSign(w.Dst,g,w.Org)<=0;if(w.Dst===g)return n.edgeSign(O.Dst,g,O.Org)>=0;var L=n.edgeEval(O.Dst,g,O.Org),B=n.edgeEval(w.Dst,g,w.Org);return L>=B;},P.deleteRegion=function(h,p){p.fixUpperEdge&&i(p.eUp.winding===0),p.eUp.activeRegion=null,h.dict["delete"](p.nodeUp);},P.fixUpperEdge=function(h,p,d){i(p.fixUpperEdge),h.mesh["delete"](p.eUp),p.fixUpperEdge=!1,p.eUp=d,d.activeRegion=p;},P.topLeftRegion=function(h,p){var d=p.eUp.Org,g;do p=P.regionAbove(p);while(p.eUp.Org===d);if(p.fixUpperEdge){if(g=h.mesh.connect(P.regionBelow(p).eUp.Sym,p.eUp.Lnext),g===null)return null;P.fixUpperEdge(h,p,g),p=P.regionAbove(p);}return p;},P.topRightRegion=function(h){var p=h.eUp.Dst;do h=P.regionAbove(h);while(h.eUp.Dst===p);return h;},P.addRegionBelow=function(h,p,d){var g=new T();return g.eUp=d,g.nodeUp=h.dict.insertBefore(p.nodeUp,g),g.fixUpperEdge=!1,g.sentinel=!1,g.dirty=!1,d.activeRegion=g,g;},P.isWindingInside=function(h,p){switch(h.windingRule){case r.WINDING_ODD:return(p&1)!==0;case r.WINDING_NONZERO:return p!==0;case r.WINDING_POSITIVE:return p>0;case r.WINDING_NEGATIVE:return p<0;case r.WINDING_ABS_GEQ_TWO:return p>=2||p<=-2;}return i(!1),!1;},P.computeWinding=function(h,p){p.windingNumber=P.regionAbove(p).windingNumber+p.eUp.winding,p.inside=P.isWindingInside(h,p.windingNumber);},P.finishRegion=function(h,p){var d=p.eUp,g=d.Lface;g.inside=p.inside,g.anEdge=d,P.deleteRegion(h,p);},P.finishLeftRegions=function(h,p,d){for(var g,L,O=null,w=p,L=p.eUp;w!==d;){if(w.fixUpperEdge=!1,O=P.regionBelow(w),g=O.eUp,g.Org!=L.Org){if(!O.fixUpperEdge){P.finishRegion(h,w);break;}g=h.mesh.connect(L.Lprev,g.Sym),P.fixUpperEdge(h,O,g);}L.Onext!==g&&(h.mesh.splice(g.Oprev,g),h.mesh.splice(L,g)),P.finishRegion(h,w),L=O.eUp,w=O;}return L;},P.addRightEdges=function(h,p,d,g,O,w){var L,B,A,b,W=!0;A=d;do i(n.vertLeq(A.Org,A.Dst)),P.addRegionBelow(h,p,A.Sym),A=A.Onext;while(A!==g);for(O===null&&(O=P.regionBelow(p).eUp.Rprev),B=p,b=O;L=P.regionBelow(B),A=L.eUp.Sym,A.Org===b.Org;)A.Onext!==b&&(h.mesh.splice(A.Oprev,A),h.mesh.splice(b.Oprev,A)),L.windingNumber=B.windingNumber-A.winding,L.inside=P.isWindingInside(h,L.windingNumber),B.dirty=!0,!W&&P.checkForRightSplice(h,B)&&(P.addWinding(A,b),P.deleteRegion(h,B),h.mesh["delete"](b)),W=!1,B=L,b=A;B.dirty=!0,i(B.windingNumber-A.winding===L.windingNumber),w&&P.walkDirtyRegions(h,B);},P.spliceMergeVertices=function(h,p,d){h.mesh.splice(p,d);},P.vertexWeights=function(h,p,d){var g=n.vertL1dist(p,h),O=n.vertL1dist(d,h),w=0.5*O/(g+O),L=0.5*g/(g+O);h.coords[0]+=w*p.coords[0]+L*d.coords[0],h.coords[1]+=w*p.coords[1]+L*d.coords[1],h.coords[2]+=w*p.coords[2]+L*d.coords[2];},P.getIntersectData=function(h,p,d,g,O,w){p.coords[0]=p.coords[1]=p.coords[2]=0,p.idx=-1,P.vertexWeights(p,d,g),P.vertexWeights(p,O,w);},P.checkForRightSplice=function(h,p){var d=P.regionBelow(p),g=p.eUp,O=d.eUp;if(n.vertLeq(g.Org,O.Org)){if(n.edgeSign(O.Dst,g.Org,O.Org)>0)return!1;n.vertEq(g.Org,O.Org)?g.Org!==O.Org&&(h.pq["delete"](g.Org.pqHandle),P.spliceMergeVertices(h,O.Oprev,g)):(h.mesh.splitEdge(O.Sym),h.mesh.splice(g,O.Oprev),p.dirty=d.dirty=!0);}else{if(n.edgeSign(g.Dst,O.Org,g.Org)<0)return!1;P.regionAbove(p).dirty=p.dirty=!0,h.mesh.splitEdge(g.Sym),h.mesh.splice(O.Oprev,g);}return!0;},P.checkForLeftSplice=function(h,p){var d=P.regionBelow(p),g=p.eUp,O=d.eUp,w;if(i(!n.vertEq(g.Dst,O.Dst)),n.vertLeq(g.Dst,O.Dst)){if(n.edgeSign(g.Dst,O.Dst,g.Org)<0)return!1;P.regionAbove(p).dirty=p.dirty=!0,w=h.mesh.splitEdge(g),h.mesh.splice(O.Sym,w),w.Lface.inside=p.inside;}else{if(n.edgeSign(O.Dst,g.Dst,O.Org)>0)return!1;p.dirty=d.dirty=!0,w=h.mesh.splitEdge(O),h.mesh.splice(g.Lnext,O.Sym),w.Rface.inside=p.inside;}return!0;},P.checkForIntersect=function(h,p){var d=P.regionBelow(p),g=p.eUp,O=d.eUp,w=g.Org,L=O.Org,B=g.Dst,A=O.Dst,b,W,D=new l(),R,X;if(i(!n.vertEq(A,B)),i(n.edgeSign(B,h.event,w)<=0),i(n.edgeSign(A,h.event,L)>=0),i(w!==h.event&&L!==h.event),i(!p.fixUpperEdge&&!d.fixUpperEdge),w===L||(b=Math.min(w.t,B.t),W=Math.max(L.t,A.t),b>W))return!1;if(n.vertLeq(w,L)){if(n.edgeSign(A,w,L)>0)return!1;}else if(n.edgeSign(B,L,w)<0)return!1;return P.debugEvent(h),n.intersect(B,w,A,L,D),i(Math.min(w.t,B.t)<=D.t),i(D.t<=Math.max(L.t,A.t)),i(Math.min(A.s,B.s)<=D.s),i(D.s<=Math.max(L.s,w.s)),n.vertLeq(D,h.event)&&(D.s=h.event.s,D.t=h.event.t),R=n.vertLeq(w,L)?w:L,n.vertLeq(R,D)&&(D.s=R.s,D.t=R.t),n.vertEq(D,w)||n.vertEq(D,L)?(P.checkForRightSplice(h,p),!1):!n.vertEq(B,h.event)&&n.edgeSign(B,h.event,D)>=0||!n.vertEq(A,h.event)&&n.edgeSign(A,h.event,D)<=0?A===h.event?(h.mesh.splitEdge(g.Sym),h.mesh.splice(O.Sym,g),p=P.topLeftRegion(h,p),g=P.regionBelow(p).eUp,P.finishLeftRegions(h,P.regionBelow(p),d),P.addRightEdges(h,p,g.Oprev,g,g,!0),!0):B===h.event?(h.mesh.splitEdge(O.Sym),h.mesh.splice(g.Lnext,O.Oprev),d=p,p=P.topRightRegion(p),X=P.regionBelow(p).eUp.Rprev,d.eUp=O.Oprev,O=P.finishLeftRegions(h,d,null),P.addRightEdges(h,p,O.Onext,g.Rprev,X,!0),!0):(n.edgeSign(B,h.event,D)>=0&&(P.regionAbove(p).dirty=p.dirty=!0,h.mesh.splitEdge(g.Sym),g.Org.s=h.event.s,g.Org.t=h.event.t),n.edgeSign(A,h.event,D)<=0&&(p.dirty=d.dirty=!0,h.mesh.splitEdge(O.Sym),O.Org.s=h.event.s,O.Org.t=h.event.t),!1):(h.mesh.splitEdge(g.Sym),h.mesh.splitEdge(O.Sym),h.mesh.splice(O.Oprev,g),g.Org.s=D.s,g.Org.t=D.t,g.Org.pqHandle=h.pq.insert(g.Org),P.getIntersectData(h,g.Org,w,B,L,A),P.regionAbove(p).dirty=p.dirty=d.dirty=!0,!1);},P.walkDirtyRegions=function(h,p){for(var d=P.regionBelow(p),g,O;;){for(;d.dirty;)p=d,d=P.regionBelow(d);if(!p.dirty&&(d=p,p=P.regionAbove(p),p===null||!p.dirty))return;if(p.dirty=!1,g=p.eUp,O=d.eUp,g.Dst!==O.Dst&&P.checkForLeftSplice(h,p)&&(d.fixUpperEdge?(P.deleteRegion(h,d),h.mesh["delete"](O),d=P.regionBelow(p),O=d.eUp):p.fixUpperEdge&&(P.deleteRegion(h,p),h.mesh["delete"](g),p=P.regionAbove(d),g=p.eUp)),g.Org!==O.Org)if(g.Dst!==O.Dst&&!p.fixUpperEdge&&!d.fixUpperEdge&&(g.Dst===h.event||O.Dst===h.event)){if(P.checkForIntersect(h,p))return;}else P.checkForRightSplice(h,p);g.Org===O.Org&&g.Dst===O.Dst&&(P.addWinding(O,g),P.deleteRegion(h,p),h.mesh["delete"](g),p=P.regionAbove(d));}},P.connectRightVertex=function(h,p,d){var g,O=d.Onext,w=P.regionBelow(p),L=p.eUp,B=w.eUp,A=!1;if(L.Dst!==B.Dst&&P.checkForIntersect(h,p),n.vertEq(L.Org,h.event)&&(h.mesh.splice(O.Oprev,L),p=P.topLeftRegion(h,p),O=P.regionBelow(p).eUp,P.finishLeftRegions(h,P.regionBelow(p),w),A=!0),n.vertEq(B.Org,h.event)&&(h.mesh.splice(d,B.Oprev),d=P.finishLeftRegions(h,w,null),A=!0),A){P.addRightEdges(h,p,d.Onext,O,O,!0);return;}n.vertLeq(B.Org,L.Org)?g=B.Oprev:g=L,g=h.mesh.connect(d.Lprev,g),P.addRightEdges(h,p,g,g.Onext,g.Onext,!1),g.Sym.activeRegion.fixUpperEdge=!0,P.walkDirtyRegions(h,p);},P.connectLeftDegenerate=function(h,p,d){var g,O,w,L,B;if(g=p.eUp,n.vertEq(g.Org,d)){i(!1/*TOLERANCE_NONZERO*/),P.spliceMergeVertices(h,g,d.anEdge);return;}if(!n.vertEq(g.Dst,d)){h.mesh.splitEdge(g.Sym),p.fixUpperEdge&&(h.mesh["delete"](g.Onext),p.fixUpperEdge=!1),h.mesh.splice(d.anEdge,g),P.sweepEvent(h,d);return;}i(!1/*TOLERANCE_NONZERO*/),p=P.topRightRegion(p),B=P.regionBelow(p),w=B.eUp.Sym,O=L=w.Onext,B.fixUpperEdge&&(i(O!==w),P.deleteRegion(h,B),h.mesh["delete"](w),w=O.Oprev),h.mesh.splice(d.anEdge,w),n.edgeGoesLeft(O)||(O=null),P.addRightEdges(h,p,w.Onext,L,O,!0);},P.connectLeftVertex=function(h,p){var d,g,O,w,L,B,A=new T();if(A.eUp=p.anEdge.Sym,d=h.dict.search(A).key,g=P.regionBelow(d),!!g){if(w=d.eUp,L=g.eUp,n.edgeSign(w.Dst,p,w.Org)===0){P.connectLeftDegenerate(h,d,p);return;}if(O=n.vertLeq(L.Dst,w.Dst)?d:g,d.inside||O.fixUpperEdge){if(O===d)B=h.mesh.connect(p.anEdge.Sym,w.Lnext);else{var b=h.mesh.connect(L.Dnext,p.anEdge);B=b.Sym;}O.fixUpperEdge?P.fixUpperEdge(h,O,B):P.computeWinding(h,P.addRegionBelow(h,d,B)),P.sweepEvent(h,p);}else P.addRightEdges(h,d,p.anEdge,p.anEdge,null,!0);}},P.sweepEvent=function(h,p){h.event=p,P.debugEvent(h);for(var d=p.anEdge;d.activeRegion===null;)if(d=d.Onext,d===p.anEdge){P.connectLeftVertex(h,p);return;}var g=P.topLeftRegion(h,d.activeRegion);i(g!==null);var O=P.regionBelow(g),w=O.eUp,L=P.finishLeftRegions(h,O,null);L.Onext===w?P.connectRightVertex(h,g,L):P.addRightEdges(h,g,L.Onext,w,w,!0);},P.addSentinel=function(h,p,d,g){var O=new T(),w=h.mesh.makeEdge();w.Org.s=d,w.Org.t=g,w.Dst.s=p,w.Dst.t=g,h.event=w.Dst,O.eUp=w,O.windingNumber=0,O.inside=!1,O.fixUpperEdge=!1,O.sentinel=!0,O.dirty=!1,O.nodeUp=h.dict.insert(O);},P.initEdgeDict=function(h){h.dict=new f(h,P.edgeLeq);var p=h.bmax[0]-h.bmin[0],d=h.bmax[1]-h.bmin[1],g=h.bmin[0]-p,O=h.bmax[0]+p,w=h.bmin[1]-d,L=h.bmax[1]+d;P.addSentinel(h,g,O,w),P.addSentinel(h,g,O,L);},P.doneEdgeDict=function(h){for(var p,d=0;(p=h.dict.min().key)!==null;)p.sentinel||(i(p.fixUpperEdge),i(++d===1)),i(p.windingNumber===0),P.deleteRegion(h,p);},P.removeDegenerateEdges=function(h){var p,d,g,O=h.mesh.eHead;for(p=O.next;p!==O;p=d)d=p.next,g=p.Lnext,n.vertEq(p.Org,p.Dst)&&p.Lnext.Lnext!==p&&(P.spliceMergeVertices(h,g,p),h.mesh["delete"](p),p=g,g=p.Lnext),g.Lnext===p&&(g!==p&&((g===d||g===d.Sym)&&(d=d.next),h.mesh["delete"](g)),(p===d||p===d.Sym)&&(d=d.next),h.mesh["delete"](p));},P.initPriorityQ=function(h){var p,d,g,O=0;for(g=h.mesh.vHead,d=g.next;d!==g;d=d.next)O++;for(O+=8,p=h.pq=new E(O,n.vertLeq),g=h.mesh.vHead,d=g.next;d!==g;d=d.next)d.pqHandle=p.insert(d);return d!==g?!1:(p.init(),!0);},P.donePriorityQ=function(h){h.pq=null;},P.removeDegenerateFaces=function(h,p){var d,g,O;for(d=p.fHead.next;d!==p.fHead;d=g)g=d.next,O=d.anEdge,i(O.Lnext!==O),O.Lnext.Lnext===O&&(P.addWinding(O.Onext,O),h.mesh["delete"](O));return!0;},P.computeInterior=function(h){var p,d;if(P.removeDegenerateEdges(h),!P.initPriorityQ(h))return!1;for(P.initEdgeDict(h);(p=h.pq.extractMin())!==null;){for(;d=h.pq.min(),!(d===null||!n.vertEq(d,p));)d=h.pq.extractMin(),P.spliceMergeVertices(h,p.anEdge,d.anEdge);P.sweepEvent(h,p);}return h.event=h.dict.min().key.eUp.Org,P.debugEvent(h),P.doneEdgeDict(h),P.donePriorityQ(h),P.removeDegenerateFaces(h,h.mesh)?(h.mesh.check(),!0):!1;};function x(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=r.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0;}x.prototype={dot_:function dot_(h,p){return h[0]*p[0]+h[1]*p[1]+h[2]*p[2];},normalize_:function normalize_(h){var p=h[0]*h[0]+h[1]*h[1]+h[2]*h[2];i(p>0),p=Math.sqrt(p),h[0]/=p,h[1]/=p,h[2]/=p;},longAxis_:function longAxis_(h){var p=0;return Math.abs(h[1])>Math.abs(h[0])&&(p=1),Math.abs(h[2])>Math.abs(h[p])&&(p=2),p;},computeNormal_:function computeNormal_(h){var p,d,g,O,w,L,B=[0,0,0],A=[0,0,0],b=[0,0,0],W=[0,0,0],D=[0,0,0],R=[null,null,null],X=[null,null,null],H=this.mesh.vHead,J;for(p=H.next,J=0;J<3;++J)O=p.coords[J],A[J]=O,X[J]=p,B[J]=O,R[J]=p;for(p=H.next;p!==H;p=p.next)for(J=0;J<3;++J)O=p.coords[J],O<A[J]&&(A[J]=O,X[J]=p),O>B[J]&&(B[J]=O,R[J]=p);if(J=0,B[1]-A[1]>B[0]-A[0]&&(J=1),B[2]-A[2]>B[J]-A[J]&&(J=2),A[J]>=B[J]){h[0]=0,h[1]=0,h[2]=1;return;}for(L=0,d=X[J],g=R[J],b[0]=d.coords[0]-g.coords[0],b[1]=d.coords[1]-g.coords[1],b[2]=d.coords[2]-g.coords[2],p=H.next;p!==H;p=p.next)W[0]=p.coords[0]-g.coords[0],W[1]=p.coords[1]-g.coords[1],W[2]=p.coords[2]-g.coords[2],D[0]=b[1]*W[2]-b[2]*W[1],D[1]=b[2]*W[0]-b[0]*W[2],D[2]=b[0]*W[1]-b[1]*W[0],w=D[0]*D[0]+D[1]*D[1]+D[2]*D[2],w>L&&(L=w,h[0]=D[0],h[1]=D[1],h[2]=D[2]);L<=0&&(h[0]=h[1]=h[2]=0,h[this.longAxis_(b)]=1);},checkOrientation_:function checkOrientation_(){var h,p,d=this.mesh.fHead,g,O=this.mesh.vHead,w;for(h=0,p=d.next;p!==d;p=p.next)if(w=p.anEdge,!(w.winding<=0))do h+=(w.Org.s-w.Dst.s)*(w.Org.t+w.Dst.t),w=w.Lnext;while(w!==p.anEdge);if(h<0){for(g=O.next;g!==O;g=g.next)g.t=-g.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
134
- #include <stdlib.h>
135
- extern int RandomSweep;
136
- #define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
137
- #define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
138
- #else
139
- #if defined(SLANTED_SWEEP) *//* The "feature merging" is not intended to be complete. There are
140
- * special cases where edges are nearly parallel to the sweep line
141
- * which are not implemented. The algorithm should still behave
142
- * robustly (ie. produce a reasonable tesselation) in the presence
143
- * of such edges, however it may miss features which could have been
144
- * merged. We could minimize this effect by choosing the sweep line
145
- * direction to be something unusual (ie. not parallel to one of the
146
- * coordinate axes).
147
- *//* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
148
- #define S_UNIT_Y (TESSreal)0.86052074622010633
149
- #else
150
- #define S_UNIT_X (TESSreal)1.0
151
- #define S_UNIT_Y (TESSreal)0.0
152
- #endif
153
- #endif*//* Determine the polygon normal and project vertices onto the plane
154
- * of the polygon.
155
- */projectPolygon_:function projectPolygon_(){var h,p=this.mesh.vHead,d=[0,0,0],g,O,w,L,B=!1;for(d[0]=this.normal[0],d[1]=this.normal[1],d[2]=this.normal[2],d[0]===0&&d[1]===0&&d[2]===0&&(this.computeNormal_(d),B=!0),g=this.sUnit,O=this.tUnit,w=this.longAxis_(d),g[w]=0,g[(w+1)%3]=1,g[(w+2)%3]=0,O[w]=0,O[(w+1)%3]=0,O[(w+2)%3]=d[w]>0?1:-1,h=p.next;h!==p;h=h.next)h.s=this.dot_(h.coords,g),h.t=this.dot_(h.coords,O);for(B&&this.checkOrientation_(),L=!0,h=p.next;h!==p;h=h.next)L?(this.bmin[0]=this.bmax[0]=h.s,this.bmin[1]=this.bmax[1]=h.t,L=!1):(h.s<this.bmin[0]&&(this.bmin[0]=h.s),h.s>this.bmax[0]&&(this.bmax[0]=h.s),h.t<this.bmin[1]&&(this.bmin[1]=h.t),h.t>this.bmax[1]&&(this.bmax[1]=h.t));},addWinding_:function addWinding_(h,p){h.winding+=p.winding,h.Sym.winding+=p.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
156
- * (what else would it do??) The region must consist of a single
157
- * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
158
- * case means that any vertical line intersects the interior of the
159
- * region in a single interval.
160
- *
161
- * Tessellation consists of adding interior edges (actually pairs of
162
- * half-edges), to split the region into non-overlapping triangles.
163
- *
164
- * The basic idea is explained in Preparata and Shamos (which I don''t
165
- * have handy right now), although their implementation is more
166
- * complicated than this one. The are two edge chains, an upper chain
167
- * and a lower chain. We process all vertices from both chains in order,
168
- * from right to left.
169
- *
170
- * The algorithm ensures that the following invariant holds after each
171
- * vertex is processed: the untessellated region consists of two
172
- * chains, where one chain (say the upper) is a single edge, and
173
- * the other chain is concave. The left vertex of the single edge
174
- * is always to the left of all vertices in the concave chain.
175
- *
176
- * Each step consists of adding the rightmost unprocessed vertex to one
177
- * of the two chains, and forming a fan of triangles from the rightmost
178
- * of two chain endpoints. Determining whether we can add each triangle
179
- * to the fan is a simple orientation test. By making the fan as large
180
- * as possible, we restore the invariant (check it yourself).
181
- */// int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
182
- tessellateMonoRegion_:function tessellateMonoRegion_(h,p){var d,g;for(d=p.anEdge,i(d.Lnext!==d&&d.Lnext.Lnext!==d);n.vertLeq(d.Dst,d.Org);d=d.Lprev);for(;n.vertLeq(d.Org,d.Dst);d=d.Lnext);for(g=d.Lprev;d.Lnext!==g;)if(n.vertLeq(d.Dst,g.Org)){for(;g.Lnext!==d&&(n.edgeGoesLeft(g.Lnext)||n.edgeSign(g.Org,g.Dst,g.Lnext.Dst)<=0);){var O=h.connect(g.Lnext,g);g=O.Sym;}g=g.Lprev;}else{for(;g.Lnext!==d&&(n.edgeGoesRight(d.Lprev)||n.edgeSign(d.Dst,d.Org,d.Lprev.Org)>=0);){var O=h.connect(d,d.Lprev);d=O.Sym;}d=d.Lnext;}for(i(g.Lnext!==d);g.Lnext.Lnext!==d;){var O=h.connect(g.Lnext,g);g=O.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
183
- * the mesh which is marked "inside" the polygon. Each such region
184
- * must be monotone.
185
- *///int tessMeshTessellateInterior( TESSmesh *mesh )
186
- tessellateInterior_:function tessellateInterior_(h){var p,d;for(p=h.fHead.next;p!==h.fHead;p=d)if(d=p.next,p.inside&&!this.tessellateMonoRegion_(h,p))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
187
- * which are not marked "inside" the polygon. Since further mesh operations
188
- * on NULL faces are not allowed, the main purpose is to clean up the
189
- * mesh so that exterior loops are not represented in the data structure.
190
- *///void tessMeshDiscardExterior( TESSmesh *mesh )
191
- discardExterior_:function discardExterior_(h){var p,d;for(p=h.fHead.next;p!==h.fHead;p=d)d=p.next,p.inside||h.zapFace(p);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
192
- * winding numbers on all edges so that regions marked "inside" the
193
- * polygon have a winding number of "value", and regions outside
194
- * have a winding number of 0.
195
- *
196
- * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
197
- * separate an interior region from an exterior one.
198
- */// int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
199
- setWindingNumber_:function setWindingNumber_(h,p,d){var g,O;for(g=h.eHead.next;g!==h.eHead;g=O)O=g.next,g.Rface.inside!==g.Lface.inside?g.winding=g.Lface.inside?p:-p:d?h["delete"](g):g.winding=0;},getNeighbourFace_:function getNeighbourFace_(h){return!h.Rface||!h.Rface.inside?-1:h.Rface.n;},outputPolymesh_:function outputPolymesh_(h,p,d,g){var O,w,L,B=0,A=0,b,W;for(d>3&&h.mergeConvexFaces(d),O=h.vHead.next;O!==h.vHead;O=O.next)O.n=-1;for(w=h.fHead.next;w!==h.fHead;w=w.next)if(w.n=-1,!!w.inside){L=w.anEdge,b=0;do O=L.Org,O.n===-1&&(O.n=A,A++),b++,L=L.Lnext;while(L!==w.anEdge);i(b<=d),w.n=B,++B;}for(this.elementCount=B,p===r.CONNECTED_POLYGONS&&(B*=2),this.elements=[],this.elements.length=B*d,this.vertexCount=A,this.vertices=[],this.vertices.length=A*g,this.vertexIndices=[],this.vertexIndices.length=A,O=h.vHead.next;O!==h.vHead;O=O.next)if(O.n!==-1){var D=O.n*g;this.vertices[D+0]=O.coords[0],this.vertices[D+1]=O.coords[1],g>2&&(this.vertices[D+2]=O.coords[2]),this.vertexIndices[O.n]=O.idx;}var R=0;for(w=h.fHead.next;w!==h.fHead;w=w.next)if(w.inside){L=w.anEdge,b=0;do O=L.Org,this.elements[R++]=O.n,b++,L=L.Lnext;while(L!==w.anEdge);for(W=b;W<d;++W)this.elements[R++]=-1;if(p===r.CONNECTED_POLYGONS){L=w.anEdge;do this.elements[R++]=this.getNeighbourFace_(L),L=L.Lnext;while(L!==w.anEdge);for(W=b;W<d;++W)this.elements[R++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
200
- outputContours_:function outputContours_(h,p){var d,g,O,w=0,L=0;for(this.vertexCount=0,this.elementCount=0,d=h.fHead.next;d!==h.fHead;d=d.next)if(d.inside){O=g=d.anEdge;do this.vertexCount++,g=g.Lnext;while(g!==O);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*p,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var B=0,A=0,b=0;for(w=0,d=h.fHead.next;d!==h.fHead;d=d.next)if(d.inside){L=0,O=g=d.anEdge;do this.vertices[B++]=g.Org.coords[0],this.vertices[B++]=g.Org.coords[1],p>2&&(this.vertices[B++]=g.Org.coords[2]),this.vertexIndices[A++]=g.Org.idx,L++,g=g.Lnext;while(g!==O);this.elements[b++]=w,this.elements[b++]=L,w+=L;}},addContour:function addContour(h,p){var d,g;for(this.mesh===null&&(this.mesh=new c()),h<2&&(h=2),h>3&&(h=3),d=null,g=0;g<p.length;g+=h)d===null?(d=this.mesh.makeEdge(),this.mesh.splice(d,d.Sym)):(this.mesh.splitEdge(d),d=d.Lnext),d.Org.coords[0]=p[g+0],d.Org.coords[1]=p[g+1],h>2?d.Org.coords[2]=p[g+2]:d.Org.coords[2]=0,d.Org.idx=this.vertexIndexCounter++,d.winding=1,d.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
201
- tesselate:function tesselate(h,p,d,g,O){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,O&&(this.normal[0]=O[0],this.normal[1]=O[1],this.normal[2]=O[2]),this.windingRule=h,g<2&&(g=2),g>3&&(g=3),!this.mesh)return!1;this.projectPolygon_(),P.computeInterior(this);var w=this.mesh;return p===r.BOUNDARY_CONTOURS?this.setWindingNumber_(w,1,!0):this.tessellateInterior_(w),w.check(),p===r.BOUNDARY_CONTOURS?this.outputContours_(w,g):this.outputPolymesh_(w,p,d,g),!0;}};},/* 62 *//***/function(u,e){u.exports=r;var t=Object.prototype.hasOwnProperty;function r(){for(var n={},i=0;i<arguments.length;i++){var l=arguments[i];for(var o in l)t.call(l,o)&&(n[o]=l[o]);}return n;}},/* 63 *//***/function(u,e,t){t.r(e),t.d(e,"createShaders",function(){return a;}),t.d(e,"applyShader",function(){return c;}),t.d(e,"createCloudShaders",function(){return f;}),t.d(e,"applyCloudShader",function(){return v;});var r=t(64),n=t(65),i=t(66),l=t(67);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("shaders");function a(S){S[o]=[];for(var E=0;E<16;E++){var T=[],P=!!(E&1),_x17=!!(E&2),_h10=!!(E&4),p=!!(E&8);P&&T.push("#define TEXTURE 1"),_x17&&T.push("#define FILTER 1"),_h10&&T.push("#define GRADIENT 1"),p&&T.push("#define CLIPPATH 1");var d="".concat(T.join("\n"),"\n"),g=[];P&&g.push("uniform sampler2D u_texSampler;"),p&&g.push("uniform sampler2D u_clipSampler;"),S[o][E]=[d+g.join("\n")+n["default"],d+r["default"]];}}function c(S){var _ref93=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref93$hasTexture=_ref93.hasTexture,E=_ref93$hasTexture===void 0?!1:_ref93$hasTexture,_ref93$hasFilter=_ref93.hasFilter,T=_ref93$hasFilter===void 0?!1:_ref93$hasFilter,_ref93$hasGradient=_ref93.hasGradient,P=_ref93$hasGradient===void 0?!1:_ref93$hasGradient,_ref93$hasClipPath=_ref93.hasClipPath,x=_ref93$hasClipPath===void 0?!1:_ref93$hasClipPath;var h=E|T<<1|P<<2|x<<3;var p=S[o][h];Array.isArray(p)&&(p=S.createProgram.apply(S,_toConsumableArray(p)),S[o][h]=p),S.program!==p&&S.useProgram(p,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var m=[];function f(S){for(var E=0;E<64;E++){var T=[],P=!!(E&1),_x18=!!(E&2),_h11=!!(E&4),p=!!(E&8),d=!!(E&16),g=!!(E&32);P&&T.push("#define TEXTURE 1"),_x18&&T.push("#define FILTER 1"),_h11&&T.push("#define GRADIENT 1"),p&&T.push("#define CLOUDCOLOR 1"),d&&T.push("#define CLOUDFILTER 1"),g&&T.push("#define CLIPPATH 1");var O="".concat(T.join("\n"),"\n"),w=[];if(P){w.push("uniform sampler2D u_texSampler;");for(var L=0;L<12;L++)w.push("uniform sampler2D u_texFrame".concat(L,";"));}g&&w.push("uniform sampler2D u_clipSampler;"),m[E]=[O+w.join("\n")+l["default"],O+i["default"]];}}function v(S){var _ref94=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref94$hasTexture=_ref94.hasTexture,E=_ref94$hasTexture===void 0?!1:_ref94$hasTexture,_ref94$hasFilter=_ref94.hasFilter,T=_ref94$hasFilter===void 0?!1:_ref94$hasFilter,_ref94$hasGradient=_ref94.hasGradient,P=_ref94$hasGradient===void 0?!1:_ref94$hasGradient,_ref94$hasCloudColor=_ref94.hasCloudColor,x=_ref94$hasCloudColor===void 0?!1:_ref94$hasCloudColor,_ref94$hasCloudFilter=_ref94.hasCloudFilter,h=_ref94$hasCloudFilter===void 0?!1:_ref94$hasCloudFilter,_ref94$hasClipPath=_ref94.hasClipPath,p=_ref94$hasClipPath===void 0?!1:_ref94$hasClipPath;var d=E|T<<1|P<<2|x<<3|h<<4|p<<5;var g=m[d];Array.isArray(g)&&(g=S.createProgram.apply(S,_toConsumableArray(g)),m[d]=g),S.program!==g&&S.useProgram(g,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});}},/* 64 *//***/function(u,e,t){t.r(e),e["default"]="attribute vec3 a_vertexPosition;\nattribute vec4 a_color;\nvarying vec4 vColor;\nvarying float flagBackground;\nuniform vec2 u_resolution;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\n#ifdef TEXTURE\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nattribute vec4 a_sourceRect;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nattribute vec2 a_clipUV;\nvarying vec2 vClipUV;\n#endif\n\n#ifdef GRADIENT\nuniform float u_radialGradientVector[6];\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\n#endif\n\nvoid main() {\n gl_PointSize = 1.0;\n\n vec3 pos = projectionMatrix * viewMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0);\n\n#ifdef GRADIENT\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\n float h = u_resolution.y;\n vg1.y = h - vg1.y;\n vg2.y = h - vg2.y;\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\n#endif\n \n flagBackground = a_vertexPosition.z;\n vColor = a_color;\n\n#ifdef TEXTURE\n vTextureCoord = a_vertexTextureCoord;\n vSourceRect = a_sourceRect;\n#endif\n\n#ifdef CLIPPATH\n vClipUV = a_clipUV;\n#endif\n}";},/* 65 *//***/function(u,e,t){t.r(e),e["default"]="precision mediump float;\n\nvarying vec4 vColor;\nvarying float flagBackground;\n\n#ifdef TEXTURE\nvarying vec3 vTextureCoord;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nvarying vec2 vClipUV;\n#endif\n\n#ifdef FILTER\nuniform int u_filterFlag;\nuniform float u_colorMatrix[20];\n#endif\n\n#ifdef GRADIENT\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\nuniform float u_colorSteps[40];\nuniform int u_gradientType;\n// uniform float u_radialGradientVector[6];\n\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\n float t;\n // center circle radius\n float cr = gv1.z;\n // focal circle radius\n float fr = gv2.z;\n\n if(cr > 0.0 || fr > 0.0) {\n // radial gradient\n vec2 center = gv1.xy;\n vec2 focal = gv2.xy;\n float x = focal.x - gl_FragCoord.x;\n float y = focal.y - gl_FragCoord.y;\n float dx = focal.x - center.x;\n float dy = focal.y - center.y;\n float dr = cr - fr;\n float a = dx * dx + dy * dy - dr * dr;\n float b = -2.0 * (y * dy + x * dx + fr * dr);\n float c = x * x + y * y - fr * fr;\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\n } else {\n // linear gradient\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\n vec2 v2 = gv2.xy - gv1.xy;\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\n }\n\n vec4 colors[8];\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\n \n float steps[8];\n steps[0] = colorSteps[0];\n steps[1] = colorSteps[5];\n steps[2] = colorSteps[10];\n steps[3] = colorSteps[15];\n steps[4] = colorSteps[20];\n steps[5] = colorSteps[25];\n steps[6] = colorSteps[30];\n steps[7] = colorSteps[35];\n\n color = colors[0];\n for (int i = 1; i < 8; i++) {\n if (steps[i] < 0.0 || steps[i] > 1.0) {\n break;\n }\n if(steps[i] == steps[i - 1]) {\n color = colors[i];\n } else {\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\n }\n if (steps[i] >= t) {\n break;\n }\n }\n}\n#endif\n\n#ifdef FILTER\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\n float r = color.r, g = color.g, b = color.b, a = color.a;\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\n}\n#endif\n\nvoid main() {\n vec4 color = vColor;\n float opacity = abs(flagBackground);\n\n#ifdef GRADIENT\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\n }\n#endif\n\n if(opacity < 1.0) {\n color.a *= opacity;\n }\n\n#ifdef TEXTURE\n if(flagBackground > 0.0) {\n vec3 texCoord = vTextureCoord;\n\n if(texCoord.z == 1.0) {\n texCoord = fract(texCoord);\n }\n\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\n if(vSourceRect.z > 0.0) {\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\n }\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\n float alpha = texColor.a;\n if(opacity < 1.0) {\n texColor.a *= opacity;\n alpha *= mix(0.465, 1.0, opacity);\n }\n // color = mix(color, texColor, texColor.a);\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\n }\n }\n#endif\n\n#ifdef FILTER\n if(u_filterFlag > 0) {\n transformColor(color, u_colorMatrix);\n }\n#endif\n\n#ifdef CLIPPATH\n float clip = texture2D(u_clipSampler, vClipUV).r;\n color *= clip;\n#endif\n\n gl_FragColor = color;\n}";},/* 66 *//***/function(u,e,t){t.r(e),e["default"]="attribute vec3 a_vertexPosition;\nattribute vec4 a_color;\nvarying vec4 vColor;\nvarying float flagBackground;\nattribute vec3 a_transform0;\nattribute vec3 a_transform1;\nuniform vec2 u_resolution;\nuniform mat3 viewMatrix;\nuniform mat3 projectionMatrix;\n\n#ifdef TEXTURE\nattribute vec3 a_vertexTextureCoord;\nvarying vec3 vTextureCoord;\nattribute float a_frameIndex;\nvarying float frameIndex;\nattribute vec4 a_sourceRect;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nattribute vec2 a_clipUV;\nvarying vec2 vClipUV;\n#endif\n\n#ifdef CLOUDFILTER\nattribute vec4 a_colorCloud0;\nattribute vec4 a_colorCloud1;\nattribute vec4 a_colorCloud2;\nattribute vec4 a_colorCloud3;\nattribute vec4 a_colorCloud4;\nvarying vec4 colorCloud0;\nvarying vec4 colorCloud1;\nvarying vec4 colorCloud2;\nvarying vec4 colorCloud3;\nvarying vec4 colorCloud4;\n#endif\n\n#ifdef CLOUDCOLOR\nattribute vec4 a_fillCloudColor;\nattribute vec4 a_strokeCloudColor;\n#endif\n\n#ifdef GRADIENT\nuniform float u_radialGradientVector[6];\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\n#endif\n\nvoid main() {\n gl_PointSize = 1.0;\n\n mat3 modelMatrix = mat3(\n a_transform0.x, a_transform1.x, 0, \n a_transform0.y, a_transform1.y, 0,\n a_transform0.z, a_transform1.z, 1\n );\n\n vec3 pos = projectionMatrix * viewMatrix * modelMatrix * vec3(a_vertexPosition.xy, 1.0);\n gl_Position = vec4(pos.xy, 1.0, 1.0);\n\n#ifdef GRADIENT\n vec3 vg1 = viewMatrix * vec3(u_radialGradientVector[0], u_radialGradientVector[1], 1.0);\n vec3 vg2 = viewMatrix * vec3(u_radialGradientVector[3], u_radialGradientVector[4], 1.0);\n float h = u_resolution.y;\n vg1.y = h - vg1.y;\n vg2.y = h - vg2.y;\n vGradientVector1 = vec3(vg1.xy, u_radialGradientVector[2]);\n vGradientVector2 = vec3(vg2.xy, u_radialGradientVector[5]);\n#endif\n \n flagBackground = a_vertexPosition.z;\n\n#ifdef CLOUDCOLOR\n if(flagBackground > 0.0) {\n vColor = mix(a_color, a_fillCloudColor, a_fillCloudColor.a);\n } else {\n vColor = mix(a_color, a_strokeCloudColor, a_strokeCloudColor.a);\n }\n#else\n vColor = a_color;\n#endif\n\n#ifdef TEXTURE\n vTextureCoord = a_vertexTextureCoord;\n frameIndex = a_frameIndex;\n vSourceRect = a_sourceRect;\n#endif\n\n#ifdef CLIPPATH\n vClipUV = a_clipUV;\n#endif\n\n#ifdef CLOUDFILTER\n colorCloud0 = a_colorCloud0;\n colorCloud1 = a_colorCloud1;\n colorCloud2 = a_colorCloud2;\n colorCloud3 = a_colorCloud3;\n colorCloud4 = a_colorCloud4;\n#endif\n}";},/* 67 *//***/function(u,e,t){t.r(e),e["default"]="precision mediump float;\n\nvarying vec4 vColor;\nvarying float flagBackground;\n\n#ifdef TEXTURE\nvarying float frameIndex;\nvarying vec3 vTextureCoord;\nvarying vec4 vSourceRect;\n#endif\n\n#ifdef CLIPPATH\nvarying vec2 vClipUV;\n#endif\n\n#ifdef FILTER\nuniform int u_filterFlag;\nuniform float u_colorMatrix[20];\n#endif\n\n#ifdef CLOUDFILTER\nvarying vec4 colorCloud0;\nvarying vec4 colorCloud1;\nvarying vec4 colorCloud2;\nvarying vec4 colorCloud3;\nvarying vec4 colorCloud4;\n#endif\n\n#ifdef GRADIENT\nvarying vec3 vGradientVector1;\nvarying vec3 vGradientVector2;\nuniform float u_colorSteps[40];\nuniform int u_gradientType;\n\nvoid gradient(inout vec4 color, vec3 gv1, vec3 gv2, float colorSteps[40]) {\n float t;\n // center circle radius\n float cr = gv1.z;\n // focal circle radius\n float fr = gv2.z;\n\n if(cr > 0.0 || fr > 0.0) {\n // radial gradient\n vec2 center = gv1.xy;\n vec2 focal = gv2.xy;\n float x = focal.x - gl_FragCoord.x;\n float y = focal.y - gl_FragCoord.y;\n float dx = focal.x - center.x;\n float dy = focal.y - center.y;\n float dr = cr - fr;\n float a = dx * dx + dy * dy - dr * dr;\n float b = -2.0 * (y * dy + x * dx + fr * dr);\n float c = x * x + y * y - fr * fr;\n t = 1.0 - 0.5 * (1.0 / a) * (-b + sqrt(b * b - 4.0 * a * c));\n } else {\n // linear gradient\n vec2 v1 = gl_FragCoord.xy - gv1.xy;\n vec2 v2 = gv2.xy - gv1.xy;\n t = (v1.x * v2.x + v1.y * v2.y) / (v2.x * v2.x + v2.y * v2.y);\n }\n\n vec4 colors[8];\n colors[0] = vec4(colorSteps[1], colorSteps[2], colorSteps[3], colorSteps[4]);\n colors[1] = vec4(colorSteps[6], colorSteps[7], colorSteps[8], colorSteps[9]);\n colors[2] = vec4(colorSteps[11], colorSteps[12], colorSteps[13], colorSteps[14]);\n colors[3] = vec4(colorSteps[16], colorSteps[17], colorSteps[18], colorSteps[19]);\n colors[4] = vec4(colorSteps[21], colorSteps[22], colorSteps[23], colorSteps[24]);\n colors[5] = vec4(colorSteps[26], colorSteps[27], colorSteps[28], colorSteps[29]);\n colors[6] = vec4(colorSteps[31], colorSteps[32], colorSteps[33], colorSteps[34]);\n colors[7] = vec4(colorSteps[36], colorSteps[37], colorSteps[38], colorSteps[39]);\n \n float steps[8];\n steps[0] = colorSteps[0];\n steps[1] = colorSteps[5];\n steps[2] = colorSteps[10];\n steps[3] = colorSteps[15];\n steps[4] = colorSteps[20];\n steps[5] = colorSteps[25];\n steps[6] = colorSteps[30];\n steps[7] = colorSteps[35];\n\n color = colors[0];\n for (int i = 1; i < 8; i++) {\n if (steps[i] < 0.0 || steps[i] > 1.0) {\n break;\n }\n if(steps[i] == steps[i - 1]) {\n color = colors[i];\n } else {\n color = mix(color, colors[i], clamp((t - steps[i - 1]) / (steps[i] - steps[i - 1]), 0.0, 1.0));\n }\n if (steps[i] >= t) {\n break;\n }\n }\n}\n#endif\n\nvoid transformColor(inout vec4 color, in float colorMatrix[20]) {\n float r = color.r, g = color.g, b = color.b, a = color.a;\n color[0] = colorMatrix[0] * r + colorMatrix[1] * g + colorMatrix[2] * b + colorMatrix[3] * a + colorMatrix[4];\n color[1] = colorMatrix[5] * r + colorMatrix[6] * g + colorMatrix[7] * b + colorMatrix[8] * a + colorMatrix[9];\n color[2] = colorMatrix[10] * r + colorMatrix[11] * g + colorMatrix[12] * b + colorMatrix[13] * a + colorMatrix[14];\n color[3] = colorMatrix[15] * r + colorMatrix[16] * g + colorMatrix[17] * b + colorMatrix[18] * a + colorMatrix[19];\n}\n\n#ifdef CLOUDFILTER\nvoid buildCloudColor(inout float colorCloudMatrix[20]) {\n colorCloudMatrix[0] = colorCloud0[0];\n colorCloudMatrix[1] = colorCloud1[0];\n colorCloudMatrix[2] = colorCloud2[0];\n colorCloudMatrix[3] = colorCloud3[0];\n colorCloudMatrix[4] = colorCloud4[0];\n\n colorCloudMatrix[5] = colorCloud0[1];\n colorCloudMatrix[6] = colorCloud1[1];\n colorCloudMatrix[7] = colorCloud2[1];\n colorCloudMatrix[8] = colorCloud3[1];\n colorCloudMatrix[9] = colorCloud4[1];\n\n colorCloudMatrix[10] = colorCloud0[2];\n colorCloudMatrix[11] = colorCloud1[2];\n colorCloudMatrix[12] = colorCloud2[2];\n colorCloudMatrix[13] = colorCloud3[2];\n colorCloudMatrix[14] = colorCloud4[2];\n\n colorCloudMatrix[15] = colorCloud0[3];\n colorCloudMatrix[16] = colorCloud1[3];\n colorCloudMatrix[17] = colorCloud2[3];\n colorCloudMatrix[18] = colorCloud3[3];\n colorCloudMatrix[19] = colorCloud4[3];\n}\n#endif\n\nvoid main() {\n vec4 color = vColor;\n float opacity = abs(flagBackground);\n\n#ifdef GRADIENT\n if(u_gradientType > 0 && flagBackground > 0.0 || u_gradientType == 0 && flagBackground <= 0.0) {\n gradient(color, vGradientVector1, vGradientVector2, u_colorSteps);\n }\n#endif\n\n if(opacity < 1.0) {\n color.a *= opacity;\n }\n\n#ifdef TEXTURE\n if(flagBackground > 0.0) {\n vec3 texCoord = vTextureCoord;\n\n if(texCoord.z == 1.0) {\n texCoord = fract(texCoord);\n }\n\n if(texCoord.x <= 1.0 && texCoord.x >= 0.0\n && texCoord.y <= 1.0 && texCoord.y >= 0.0) {\n if(vSourceRect.z > 0.0) {\n texCoord.x = vSourceRect.x + texCoord.x * vSourceRect.z;\n texCoord.y = 1.0 - (vSourceRect.y + (1.0 - texCoord.y) * vSourceRect.w);\n }\n if(frameIndex < 0.0) {\n vec4 texColor = texture2D(u_texSampler, texCoord.xy);\n color = mix(color, texColor, texColor.a);\n } else {\n int index = int(floor(clamp(0.0, 11.0, frameIndex)));\n vec4 texColor;\n if(index == 0) texColor = texture2D(u_texFrame0, texCoord.xy);\n else if(index == 1) texColor = texture2D(u_texFrame1, texCoord.xy);\n else if(index == 2) texColor = texture2D(u_texFrame2, texCoord.xy);\n else if(index == 3) texColor = texture2D(u_texFrame3, texCoord.xy);\n else if(index == 4) texColor = texture2D(u_texFrame4, texCoord.xy);\n else if(index == 5) texColor = texture2D(u_texFrame5, texCoord.xy);\n else if(index == 6) texColor = texture2D(u_texFrame6, texCoord.xy);\n else if(index == 7) texColor = texture2D(u_texFrame7, texCoord.xy);\n else if(index == 8) texColor = texture2D(u_texFrame8, texCoord.xy);\n else if(index == 9) texColor = texture2D(u_texFrame9, texCoord.xy);\n else if(index == 10) texColor = texture2D(u_texFrame10, texCoord.xy);\n else texColor = texture2D(u_texFrame11, texCoord.xy);\n float alpha = texColor.a;\n if(opacity < 1.0) {\n texColor.a *= opacity;\n alpha *= mix(0.465, 1.0, opacity);\n }\n // color = mix(color, texColor, texColor.a);\n color.rgb = mix(color.rgb, texColor.rgb, alpha);\n // color.rgb = mix(texColor.rgb, color.rgb, color.a);\n color.rgb = mix(texColor.rgb, color.rgb, clamp(color.a / max(0.0001, texColor.a), 0.0, 1.0));\n color.a = texColor.a + (1.0 - texColor.a) * color.a;\n }\n }\n }\n#endif\n\n#ifdef FILTER\n if(u_filterFlag > 0) {\n transformColor(color, u_colorMatrix);\n }\n#endif\n\n#ifdef CLOUDFILTER\n float colorCloudMatrix[20];\n buildCloudColor(colorCloudMatrix);\n transformColor(color, colorCloudMatrix);\n#endif\n\n#ifdef CLIPPATH\n float clip = texture2D(u_clipSampler, vClipUV).r;\n color *= clip;\n#endif\n\n gl_FragColor = color;\n}";},/* 68 *//***/function(u,e,t){t.r(e),function(r,n){t.d(e,"requestAnimationFrame",function(){return l;}),t.d(e,"cancelAnimationFrame",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function i(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(r)<"u"&&r.hrtime){var _r$hrtime=r.hrtime(),_r$hrtime2=_slicedToArray(_r$hrtime,2),a=_r$hrtime2[0],c=_r$hrtime2[1];return a*1e3+c*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var l,o;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(l=n.requestAnimationFrame,o=n.cancelAnimationFrame):(l=function l(a){return setTimeout(function(){a(i());},16);},o=function o(a){return clearTimeout(a);});}.call(this,t(69),t(22));},/* 69 *//***/function(u,e){var t=u.exports={},r,n;function i(){throw new Error("setTimeout has not been defined");}function l(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?r=setTimeout:r=i;}catch(_unused4){r=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=l;}catch(_unused5){n=l;}})();function o(x){if(r===setTimeout)return setTimeout(x,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(x,0);try{return r(x,0);}catch(_unused6){try{return r.call(null,x,0);}catch(_unused7){return r.call(this,x,0);}}}function a(x){if(n===clearTimeout)return clearTimeout(x);if((n===l||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(x);try{return n(x);}catch(_unused8){try{return n.call(null,x);}catch(_unused9){return n.call(this,x);}}}var c=[],m=!1,f,v=-1;function S(){!m||!f||(m=!1,f.length?c=f.concat(c):v=-1,c.length&&E());}function E(){if(!m){var x=o(S);m=!0;for(var h=c.length;h;){for(f=c,c=[];++v<h;)f&&f[v].run();v=-1,h=c.length;}f=null,m=!1,a(x);}}t.nextTick=function(x){var h=new Array(arguments.length-1);if(arguments.length>1)for(var p=1;p<arguments.length;p++)h[p-1]=arguments[p];c.push(new T(x,h)),c.length===1&&!m&&o(E);};function T(x,h){this.fun=x,this.array=h;}T.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function P(){}t.on=P,t.addListener=P,t.once=P,t.off=P,t.removeListener=P,t.removeAllListeners=P,t.emit=P,t.prependListener=P,t.prependOnceListener=P,t.listeners=function(x){return[];},t.binding=function(x){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(x){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return L;});var r=t(1),n=t(71),i=t(73),l=t(213),o=t(214),a=t(215),c=t(216);t(1).glMatrix.setMatrixArrayType(Array);function m(B,A){var b=Object.keys(B);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(B);A&&(W=W.filter(function(D){return Object.getOwnPropertyDescriptor(B,D).enumerable;})),b.push.apply(b,W);}return b;}function f(B){for(var A=1;A<arguments.length;A++){var b=arguments[A]!=null?arguments[A]:{};A%2?m(Object(b),!0).forEach(function(W){v(B,W,b[W]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(B,Object.getOwnPropertyDescriptors(b)):m(Object(b)).forEach(function(W){Object.defineProperty(B,W,Object.getOwnPropertyDescriptor(b,W));});}return B;}function v(B,A,b){return A in B?Object.defineProperty(B,A,{value:b,enumerable:!0,configurable:!0,writable:!0}):B[A]=b,B;}var S=Symbol["for"]("spritejs_changedAttrs"),E=Symbol["for"]("spritejs_attributes"),T=Symbol("resolution"),P=Symbol("animations"),x=Symbol("eventListeners"),h=Symbol("captureEventListeners"),p=Symbol("filters"),d=Symbol("display"),g=Symbol("program"),O=Symbol("shaderAttrs"),w=Symbol("uniforms");var L=/*#__PURE__*/function(){function L(){var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,L);this.attributes=new this.constructor.Attr(this),this[T]={width:300,height:150},Object.assign(this.attributes,A),this[P]=/* @__PURE__ */new Set(),this[x]={},this[h]={};}return _createClass(L,[{key:"ancestors",get:function get(){var A=this.parent;var b=[];for(;A;)b.push(A),A=A.parent;return b;}},{key:"animations",get:function get(){return this[P];}},{key:"filters",get:function get(){return this[p]||this.parent&&this.parent.filters;}},{key:"isVisible",get:function get(){return!1;}},{key:"layer",get:function get(){return this.parent?this.parent.layer:null;}},{key:"localMatrix",get:function get(){var A=this.transformMatrix,_this$attributes=this.attributes,b=_this$attributes.x,W=_this$attributes.y;return A[4]+=b,A[5]+=W,A;}},{key:"opacity",get:function get(){var A=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(A*=this.parent.opacity),A;}},{key:"parentNode",get:function get(){return this.parent;}},{key:"nextSibling",get:function get(){return this.getNodeNearBy(1);}},{key:"previousSibling",get:function get(){return this.getNodeNearBy(-1);}},{key:"program",get:function get(){return this[g];}/* get parent defined by connect method */},{key:"renderer",get:function get(){return this.parent?this.parent.renderer:null;}},{key:"renderMatrix",get:function get(){if(this.__cacheRenderMatrix)return this.__cacheRenderMatrix;var A=this.localMatrix;var b=this.parent;if(b){var W=b.__cacheRenderMatrix||b.renderMatrix;W&&(A=r.mat2d.multiply(Array.of(0,0,0,0,0,0),W,A));}return A;}},{key:"worldScaling",get:function get(){var A=this.renderMatrix;return[Math.hypot(A[0],A[1]),Math.hypot(A[2],A[3])];}},{key:"worldRotation",get:function get(){var A=this.renderMatrix;return Math.atan2(A[1],A[3]);}},{key:"worldPosition",get:function get(){var A=this.renderMatrix;return[A[4],A[5]];}},{key:"uniforms",get:function get(){return this[w];}/* get zOrder defined by connect method *//* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(A){this.attributes.className=A;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(A){this.attributes.id=A;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(A){this.attributes.name=A;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(A){this.attributes.zIndex=A;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[O]||{};}},{key:"activateAnimations",value:function activateAnimations(){var A=this.layer;if(A){var b=this[P];b.forEach(function(D){D.baseTimeline=A.timeline,D.play(),D.finished.then(function(){b["delete"](D);});});var W=this.children;W&&W.forEach(function(D){D.activateAnimations&&D.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(A,b){var W=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};A==="mousewheel"&&(A="wheel"),typeof W=="boolean"&&(W={capture:W});var _W8=W,D=_W8.capture,R=_W8.once,X=D?h:x;return this[X][A]=this[X][A]||[],this[X][A].push({listener:b,once:R}),this;}},{key:"animate",value:function animate(A,b){var _this8=this;var W=new i["default"](this,A,b);return this.effects&&W.applyEffects(this.effects),this.layer&&(W.baseTimeline=this.layer.timeline,W.play(),W.finished.then(function(){_this8[P]["delete"](W);})),this[P].add(W),W;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,A=new Array(_len7),_key7=0;_key7<_len7;_key7++){A[_key7]=arguments[_key7];}if(A.length===0)return this.attributes[E];if(A.length>1){var b=A[0],W=A[1];return typeof W=="function"&&(W=W(this.attr(b))),this.setAttribute(b,W),this;}return typeof A[0]=="string"?this.getAttribute(A[0]):(Object.assign(this.attributes,A[0]),this);}},{key:"cloneNode",value:function cloneNode(){var A=new this.constructor(),b=this.attributes[S];return A.attr(b),A;}},{key:"connect",value:function connect(A,b){Object.defineProperty(this,"parent",{value:A,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:b,writable:!1,configurable:!0}),A.timeline&&this.activateAnimations(),this.setResolution(A.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:A,zOrder:b}});}},{key:"contains",value:function contains(A){for(;A&&this!==A;)A=A.parent;return!!A;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[P].forEach(function(b){return b.cancel();});var A=this.children;A&&A.forEach(function(b){b.deactivateAnimations&&b.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var A=this.parent,b=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:A,zOrder:b}}),A&&A.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(A){var _this9=this;A instanceof o["default"]||(A=new o["default"](A)),A.target=this;var b=A.type;b==="mousewheel"&&(b="wheel");var W=[this];var D=this.parent;for(;A.bubbles&&D;)W.push(D),D=D.parent;for(var R=W.length-1;R>=0;R--){var X=W[R],H=X[h]&&X[h][b];if(H&&H.length&&(A.currentTarget=X,H.forEach(function(_ref95){var J=_ref95.listener,et=_ref95.once;J.call(_this9,A),et&&W.removeEventListener(J);}),delete A.currentTarget),!A.bubbles&&A.cancelBubble)break;}if(!A.cancelBubble)for(var _R4=0;_R4<W.length;_R4++){var _X=W[_R4],_H3=_X[x]&&_X[x][b];if(_H3&&_H3.length&&(A.currentTarget=_X,_H3.forEach(function(_ref96){var J=_ref96.listener,et=_ref96.once;J.call(_this9,A),et&&W.removeEventListener(J);}),delete A.currentTarget),!A.bubbles||A.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(A){var b=A.layerX,W=A.layerY;return this.isPointCollision(b,W)?(this.dispatchEvent(A),!0):!1;}},{key:"draw",value:function draw(){var _this10=this;var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var b=this.mesh;if(b){if(Object(a.applyFilters)(b,this.filters),A.push(b),this[g]){b.setProgram(this[g]);var W=this[O];W&&Object.entries(W).forEach(function(_ref97){var _ref98=_slicedToArray(_ref97,2),R=_ref98[0],X=_ref98[1];b.setAttribute(R,X);});var D=this[w];if(this[w]){var R={};Object.entries(D).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),X=_ref100[0],H=_ref100[1];typeof H=="function"&&(H=H(_this10,X)),R[X]=H;}),b.setUniforms(R);}}Object(c["default"])(this,b);}return A;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(A){return this.attributes[A];}},{key:"getListeners",value:function getListeners(A){var _ref101=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref101$capture=_ref101.capture,b=_ref101$capture===void 0?!1:_ref101$capture;return _toConsumableArray(this[b?h:x][A]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var A=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(A===0)return this;var b=this.parent.children,W=b.indexOf(this);return b[W+A];}},{key:"getWorldPosition",value:function getWorldPosition(A,b){var W=this.renderMatrix,D=A*W[0]+b*W[2]+W[4],R=A*W[1]+b*W[3]+W[5];return[D,R];}},{key:"getOffsetPosition",value:function getOffsetPosition(A,b){var W=r.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),D=A*W[0]+b*W[2]+W[4],R=A*W[1]+b*W[3]+W[5];return[D,R];}},{key:"getResolution",value:function getResolution(){return f({},this[T]);}},{key:"isPointCollision",value:function isPointCollision(A,b){if(!this.mesh)return!1;var W=this.attributes.pointerEvents;if(W==="none"||W!=="all"&&!this.isVisible)return!1;var D="both";return W==="visibleFill"&&(D="fill"),W==="visibleStroke"&&(D="stroke"),this.mesh.isPointCollision(A,b,D);}},{key:"onPropertyChange",value:function onPropertyChange(A,b,W){A!=="id"&&A!=="name"&&A!=="className"&&A!=="pointerEvents"&&A!=="passEvents"&&this.forceUpdate(),A==="filter"&&(this[p]=Object(a.parseFilterString)(b)),A==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(A,b){A==="attrs"&&this.attr(b),this.attributes[A]=b;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
202
- },{key:"setProgram",value:function setProgram(A){this[g]=A,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(A,b){this[O]=this[O]||{},this[O][A]=b,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(A){this[w]=this[w]||{},Object.assign(this[w],A),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref102){var A=_ref102.width,b=_ref102.height;var _this$T3=this[T],W=_this$T3.width,D=_this$T3.height;(W!==A||D!==b)&&(this[T]={width:A,height:b},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:A,height:b}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[d]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[d]=this.attributes.display,this.attributes.display="none");}},{key:"releaseMouseCapture",value:function releaseMouseCapture(){this.layer&&this.layer.__mouseCapturedTarget===this&&(this.layer.__mouseCapturedTarget=null);}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"removeAllListeners",value:function removeAllListeners(A){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof b=="boolean"&&(b={capture:b});var D=b.capture?h:x;return this[D][A]&&(this[D][A]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(A){this.setAttribute(A,null);}},{key:"removeEventListener",value:function removeEventListener(A,b){var W=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof W=="boolean"&&(W={capture:W});var R=W.capture?h:x;if(this[R][A]){var X=this[R][A];if(X)for(var H=0;H<X.length;H++){var J=X[H].listener;if(J===b){this[R][A].splice(H,1);break;}}}return this;}},{key:"transition",value:function transition(A){var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var W=this,D=Symbol("animation");b=b||"linear";var R=0;return _typeof(A)=="object"&&(R=A.delay||0,A=A.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},D,null),"cancel",function cancel(){var X=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var H=this[D];H&&H.cancel(X);}),"end",function end(){var X=this[D];X&&(X.playState==="running"||X.playState==="pending")&&X.finish();}),"reverse",function reverse(){var X=this[D];if(X)if(X.playState==="running"||X.playState==="pending")X.playbackRate=-X.playbackRate;else{var H=X.timing.direction;X.timing.direction=H==="reverse"?"normal":"reverse",X.play();}return X.finished;}),"attr",function attr(X,H){return this.end(),typeof X=="string"&&(X=_defineProperty({},X,H)),Object.entries(X).forEach(function(_ref103){var _ref104=_slicedToArray(_ref103,2),J=_ref104[0],et=_ref104[1];typeof et=="function"&&(X[J]=et(W.attr(J)));}),this[D]=W.animate([X],{duration:A*1e3,delay:R*1e3,fill:"forwards",easing:b}),this[D].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();v(L,"Attr",n["default"]),l["default"].registerNode(L,"node");},/* 71 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return L;});var r=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_declareAlias"),a=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute"),m=Symbol["for"]("spritejs_attributes"),f=Symbol["for"]("spritejs_changedAttrs"),v=Symbol("subject"),S=Symbol("attr"),E=Symbol("default"),T=Symbol("alias");function P(B,_ref106){var _ref107=_slicedToArray(_ref106,2),A=_ref107[0],b=_ref107[1];var W=r.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(B).forEach(function(_ref108){var _ref109=_slicedToArray(_ref108,2),D=_ref109[0],R=_ref109[1];if((A||b)&&(W=r.mat2d.translate(Array.of(0,0,0,0,0,0),W,[A,b])),D==="matrix")W=r.mat2d.multiply(W,W,R);else if(D==="offsetTranslate")W[4]+=R[0],W[5]+=R[1];else if(D==="offsetRotate")W=r.mat2d.rotate(Array.of(0,0,0,0,0,0),W,R);else if(D==="skew"){var _R5=_slicedToArray(R,2),X=_R5[0],H=_R5[1];W=r.mat2d.multiply(W,W,r.mat2d.fromValues(1,Math.tan(H),Math.tan(X),1,0,0));}else r.mat2d[D](W,W,R);(A||b)&&(W=r.mat2d.translate(Array.of(0,0,0,0,0,0),W,[-A,-b]));}),W;}var x=Symbol("transformMatrix"),h=Symbol("transforms"),p=Symbol("changedAttrs"),d=Symbol("lastChangedAttr"),g=Symbol("offsetFigure");function O(B,A,b){var W=B[S][A];if(B[a](A,b,!1)||B[d]!==A){var R=B[h];R.has(A)&&R["delete"](A),b&&(A==="rotate"&&(b=Math.PI*b/180),A==="scale"&&(b=b.map(function(X){return Math.abs(X)>1e-5?X:1/X>0?1e-5:-1e-5;})),R.set(A,b)),B[x]=null,B[v].onPropertyChange(A,b,W,B);}}function w(B){var A=B[g],b=B.offsetDistance*A.getTotalLength(),W=A.getPointAtLength(b);if(W){var D=B[h];var R=B.offsetRotate;R==="auto"?R=W.angle:R==="reverse"?R=Math.PI+W.angle:R=Math.PI*R/180,D.set("offsetRotate",R),D.set("offsetTranslate",[W.x,W.y]),B[x]=null;}}var L=/*#__PURE__*/function(){function L(A){var _this11=this;_classCallCheck(this,L);this[v]=A,this[S]={},this[x]=r.mat2d.fromValues(1,0,0,1,0,0),this[h]=/* @__PURE__ */new Map(),this[E]={},this[T]=[],Object.defineProperty(A,"transformMatrix",{get:function get(){return _this11[x]||(_this11[x]=P(_this11[h],_this11.transformOrigin)),_toConsumableArray(_this11[x]);}}),this[l]({id:"",name:"",className:"",/* class */x:0,y:0,/* pos */transformOrigin:[0,0],transform:"",translate:[0,0],rotate:0,scale:[1,1],skew:[0,0],opacity:1,zIndex:0,offsetPath:void 0,offsetDistance:0,offsetRotate:"auto",pointerEvents:"visible",// none | visible | visibleFill | visibleStroke | all
203
- filter:"none",display:""}),this[o]("class","pos"),this[p]=/* @__PURE__ */new Set(),this[g]=new n.Figure2D({scale:5,simplify:0});}return _createClass(L,[{key:f,get:function get(){var _this12=this;var A={};return _toConsumableArray(this[p]).forEach(function(b){A[b]=_this12[S][b];}),A;}},{key:m,get:function get(){var A=Object.assign({},this[S]);for(var b=0;b<this[T].length;b++){var W=this[T][b];A[W]=this[W];}return A;}},{key:l,value:function value(A){Object.assign(this[E],A),Object.assign(this[S],A);}},{key:o,value:function value(){var _this$T4;(_this$T4=this[T]).push.apply(_this$T4,arguments);}},{key:a,value:function value(A,b){var W=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var D=this[S][A],R=this[v];return b==null&&(b=this[E][A]),Object(i.compareValue)(D,b)?!1:(this[S][A]=b,this[p].has(A)&&this[p]["delete"](A),this[p].add(A),this[d]=A,W&&R.onPropertyChange(A,b,D,this),!0);}},{key:c,value:function value(A){return this[S][A];}},{key:"id",get:function get(){return this[c]("id");},set:function set(A){this[a]("id",A);}},{key:"name",get:function get(){return this[c]("name");},set:function set(A){this[a]("name",A);}},{key:"className",get:function get(){return this[c]("className");},set:function set(A){this[a]("className",A);}},{key:"class",get:function get(){return this.className;},set:function set(A){this.className=A;}},{key:"x",get:function get(){return this[c]("x");},set:function set(A){this[a]("x",Object(i.toNumber)(A));}},{key:"y",get:function get(){return this[c]("y");},set:function set(A){this[a]("y",Object(i.toNumber)(A));}},{key:"pos",get:function get(){return[this.x,this.y];},set:function set(A){A=Object(i.toArray)(A),Array.isArray(A)||(A=[A,A]),this.x=A[0],this.y=A[1];}},{key:"transform",get:function get(){return this[c]("transform");},set:function set(A){var b=null;if(Array.isArray(A)&&(b=A,A="matrix(".concat(A.map(i.toNumber).join(),")")),typeof A=="string")A=A.replace(/\s*,\s*/g,",");else if(A!=null)throw new TypeError("Invalid transform value.");var W=this[S].transform;if(this[a]("transform",A,!1)){var D=this[h];if(D.has("matrix")&&D["delete"]("matrix"),b)D.set("matrix",b);else if(A){var R=A.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(R){var X=r.mat2d.fromValues(1,0,0,1,0,0);for(var H=0;H<R.length;H++){var et=R[H].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(et){var _et2=_slicedToArray(et,3),it=_et2[1],$=_et2[2];it==="rotate"?$=Math.PI*parseFloat($)/180:$=$.trim().split(/[\s,]+/).map(function(V){return Object(i.toNumber)(V);}),it==="matrix"?X=r.mat2d.multiply(X,X,$):it==="skew"?X=r.mat2d.multiply(X,X,r.mat2d.fromValues(1,Math.tan($[1]),Math.tan($[0]),1,0,0)):r.mat2d[it](X,X,$),D.set("matrix",X);}}}else throw new TypeError("Invalid transform value.");}this[x]=null,this[v].onPropertyChange("transform",A,W,this);}}},{key:"transformOrigin",get:function get(){return this[c]("transformOrigin");},set:function set(A){A=Object(i.toArray)(A,!0),A!=null&&!Array.isArray(A)&&(A=[A,A]),this[a]("transformOrigin",A)&&(this[x]=null);}},{key:"rotate",get:function get(){return this[c]("rotate");},set:function set(A){O(this,"rotate",A);}},{key:"translate",get:function get(){return this[c]("translate");},set:function set(A){A=Object(i.toArray)(A,!0),A!=null&&!Array.isArray(A)&&(A=[A,A]),O(this,"translate",A);}},{key:"scale",get:function get(){return this[c]("scale");},set:function set(A){A=Object(i.toArray)(A,!0),A!=null&&!Array.isArray(A)&&(A=[A,A]),O(this,"scale",A);}},{key:"skew",get:function get(){return this[c]("skew");},set:function set(A){A=Object(i.toArray)(A,!0),A!=null&&!Array.isArray(A)&&(A=[A,A]),O(this,"skew",A);}},{key:"opacity",get:function get(){return this[c]("opacity");},set:function set(A){A!=null&&(A=Number(A)),this[a]("opacity",A);}},{key:"zIndex",get:function get(){return this[c]("zIndex");},set:function set(A){A!=null&&(A=Number(A)),this[a]("zIndex",A);}},{key:"offsetPath",get:function get(){return this[c]("offsetPath");},set:function set(A){this[a]("offsetPath",A)&&(this[g].beginPath(),A!=null&&this[g].addPath(A),w(this));}},{key:"offsetDistance",get:function get(){return this[c]("offsetDistance");},set:function set(A){this[a]("offsetDistance",Object(i.toNumber)(A))&&w(this);}},{key:"offsetRotate",get:function get(){return this[c]("offsetRotate");},set:function set(A){this[a]("offsetRotate",A),w(this);}},{key:"pointerEvents",get:function get(){return this[c]("pointerEvents");},set:function set(A){if(A!=null&&A!=="none"&&A!=="visible"&&A!=="visibleFill"&&A!=="visibleStroke"&&A!=="all")throw new TypeError("Invalid pointerEvents type.");this[a]("pointerEvents",A);}},{key:"filter",get:function get(){return this[c]("filter");},set:function set(A){this[a]("filter",A);}},{key:"display",get:function get(){return this[c]("display");},set:function set(A){this[a]("display",A);}/* istanbul ignore next */},{key:"offset",set:function set(A){}}],[{key:"setDefault",value:function setDefault(A){for(var _len8=arguments.length,b=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){b[_key8-1]=arguments[_key8];}return A[l].apply(A,b);}},{key:"declareAlias",value:function declareAlias(A){for(var _len9=arguments.length,b=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){b[_key9-1]=arguments[_key9];}return A[o].apply(A,b);}},{key:"setAttribute",value:function setAttribute(A){for(var _len10=arguments.length,b=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){b[_key10-1]=arguments[_key10];}return A[a].apply(A,b);}},{key:"getAttribute",value:function getAttribute(A){for(var _len11=arguments.length,b=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){b[_key11-1]=arguments[_key11];}return A[c].apply(A,b);}},{key:"getAttributes",value:function getAttributes(A){return A[m];}},{key:"getChangedAttributes",value:function getChangedAttributes(A){return A[f];}}]);}();},/* 72 *//***/function(u,e,t){t.r(e),t.d(e,"sizeToPixel",function(){return r;}),t.d(e,"toString",function(){return n;}),t.d(e,"toNumber",function(){return i;}),t.d(e,"toArray",function(){return l;}),t.d(e,"compareValue",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);function r(a,c){var m=a.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);m?a={size:parseFloat(m[1]),unit:m[2]}:a={size:parseFloat(a),unit:"px"};var _a3=a,f=_a3.size,v=_a3.unit;if(v==="pt")f/=0.75;else if(v==="pc")f*=16;else if(v==="in")f*=96;else if(v==="cm")f*=37.79527559055118;else if(v==="mm")f*=3.7795275590551185;else if(v==="em"||v==="rem"||v==="ex"){if(!c&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var S=getComputedStyle(document.documentElement).fontSize;S?c=r(S,16):c=16;}f*=c,v==="ex"&&(f/=2);}else if(v==="q")f*=0.9448818897637796;else if(v==="vw"||v==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _S3=v==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;f*=_S3/100;}}else if((v==="vmax"||v==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _S4=window.innerWidth||document.documentElement.clientWidth,E=window.innerHeight||document.documentElement.clientHeight;v==="vmax"?f*=Math.max(_S4,E)/100:f*=Math.min(_S4,E)/100;}return f;}function n(a){return a==null?a:String(a);}function i(a){if(a==null)return a;if(typeof a=="string"&&(a=r(a)),!Number.isFinite(a))throw new TypeError("Invalid value");return a;}function l(a){var c=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return a===""?null:(typeof a=="string"&&(a=a.split(/[\s,]+/g)),Array.isArray(a)&&(c&&(a=a.map(i)),a.length===1)?a[0]:a);}function o(a,c){if(Array.isArray(a)&&Array.isArray(c)){if(a.length!==c.length)return!1;for(var m=0;m<a.length;m++)if(a[m]!==c[m])return!1;return!0;}return a==null&&c==null||a===c;}},/* 73 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return v;});var r=t(74),n=t(32),i=/* @__PURE__ */t.n(n),l=t(68),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function a(){return a=Object.assign||function(S){for(var E=1;E<arguments.length;E++){var T=arguments[E];for(var P in T)Object.prototype.hasOwnProperty.call(T,P)&&(S[P]=T[P]);}return S;},a.apply(this,arguments);}function c(S){if(typeof S=="string"){if(S=S.trim(),/^[0-9.]+%$/.test(S))return parseFloat(S)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(S))return Object(o.sizeToPixel)(S);}return S;}function m(S,E,T,P,x){return typeof S=="string"&&(S=i()(S)),typeof E=="string"&&(E=i()(E)),r.Effects["default"](S,E,T,P,x);}function f(S,E,T,P,x){return r.Effects["default"](S,E,T,P,x);}r.Effects["default"]=function(S,E,T,P,x){return Array.isArray(S)&&Array.isArray(E)?S.map(function(h,p){return h+(T-P)/(x-P)*(E[p]-h);}):typeof S=="number"&&typeof E=="number"?S+(T-P)/(x-P)*(E-S):T-P>x-T?E:S;},r.Effects.fillColor=m,r.Effects.strokeColor=m,r.Effects.bgcolor=m,r.Effects.borderColor=m,r.Effects.text=f;var v=/*#__PURE__*/function(_r$Animator){function v(E,T,P){var _this13;_classCallCheck(this,v);var x=E.attr();Object.entries(x).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),h=_ref111[0],p=_ref111[1];x[h]=r.Effects[h]?p:c(p);}),T=T.map(function(h){var p=a({},h);var d={};return Object.entries(p).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),g=_ref113[0],O=_ref113[1];d[g]=r.Effects[g]?O:c(O);}),d;}),_this13=_callSuper(this,v,[x,T,P]),_this13.target=E,_this13.setter=function(h,p){p.attr(h);};return _this13;}_inherits(v,_r$Animator);return _createClass(v,[{key:"playState",get:function get(){return this.target.parent?_superPropGet(v,"playState",this,1):"idle";}},{key:"finished",get:function get(){var _this14=this;return _superPropGet(v,"finished",this,1).then(function(){var E=_this14;return new Promise(function(T){function P(){E.setter(E.frame,E.target);var x=E.playState;x==="finished"||x==="idle"?(Object(l.cancelAnimationFrame)(E.requestId),T()):Object(l.requestAnimationFrame)(P);}P();});});}},{key:"finish",value:function finish(){_superPropGet(v,"finish",this,3)([]),Object(l.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_superPropGet(v,"play",this,3)([]),this.setter(this.frame,this.target);var E=this;this.ready.then(function(){E.setter(E.frame,E.target),E.requestId=Object(l.requestAnimationFrame)(function T(){var P=E.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&P.layer&&P.layer.canvas&&!document.documentElement.contains(P.layer.canvas)){E.cancel();return;}var x=E.playState;E.setter(E.frame,E.target),x!=="idle"&&(x==="running"?E.requestId=Object(l.requestAnimationFrame)(T):(x==="paused"||x==="pending"&&E.timeline.currentTime<0)&&E.ready.then(function(){E.setter(E.frame,E.target),E.requestId=Object(l.requestAnimationFrame)(T);}));});});}},{key:"cancel",value:function cancel(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(l.cancelAnimationFrame)(this.requestId),E?(this.setter(this.frame,this.target),_superPropGet(v,"cancel",this,3)([])):(_superPropGet(v,"cancel",this,3)([]),this.setter(this.frame,this.target));}}]);}(r.Animator);},/* 74 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.Timeline=e.Effects=e.Easings=e.Animator=void 0;var r=t(75),n=m(r),i=t(187),l=m(i),o=t(188),a=t(190),c=m(a);function m(f){return f&&f.__esModule?f:{"default":f};}e.Animator=c["default"],e.Easings=o.Easings,e.Effects=l["default"],e.Timeline=n["default"];},/* 75 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=h(r),i=t(133),l=h(i),o=t(141),a=h(o),c=t(164),m=h(c),f=t(170),v=h(f),S=t(171),E=h(S),T=t(175),P=h(T),x=t(186);function h(W){return W&&W.__esModule?W:{"default":W};}var p=(0,x.createNowTime)(),d={originTime:0,playbackRate:1},g=(0,P["default"])("timeMark"),O=(0,P["default"])("playbackRate"),w=(0,P["default"])("timers"),L=(0,P["default"])("originTime"),B=(0,P["default"])("setTimer"),A=(0,P["default"])("parent"),b=function(){function W(D,R){(0,v["default"])(this,W),D instanceof W&&(R=D,D={}),D=(0,m["default"])({},d,D),R&&(this[A]=R);var X=D.nowtime||p;if(R)Object.defineProperty(this,"globalTime",{get:function get(){return R.currentTime;}});else{var H=X();Object.defineProperty(this,"globalTime",{get:function get(){return X()-H;}});}this[g]=[{globalTime:this.globalTime,localTime:-D.originTime,entropy:-D.originTime,playbackRate:D.playbackRate,globalEntropy:0}],this[A]&&(this[g][0].globalEntropy=this[A].entropy),this[L]=D.originTime,this[O]=D.playbackRate,this[w]=new a["default"]();}return(0,E["default"])(W,[{key:"markTime",value:function value(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},X=R.time,H=X===void 0?this.currentTime:X,J=R.entropy,et=J===void 0?this.entropy:J,it=R.playbackRate,$=it===void 0?this.playbackRate:it,V={globalTime:this.globalTime,localTime:H,entropy:et,playbackRate:$,globalEntropy:this.globalEntropy};this[g].push(V);}},{key:"fork",value:function value(R){return new W(R,this);}},{key:"seekGlobalTime",value:function value(R){var X=this.seekTimeMark(R),H=this[g][X],J=H.entropy,et=H.playbackRate,it=H.globalTime;return it+(R-J)/Math.abs(et);}},{key:"seekLocalTime",value:function value(R){var X=this.seekTimeMark(R),H=this[g][X],J=H.localTime,et=H.entropy,it=H.playbackRate;return it>0?J+(R-et):J-(R-et);}},{key:"seekTimeMark",value:function value(R){var X=this[g],H=0,J=X.length-1;if(R<=X[H].entropy)return H;if(R>=X[J].entropy)return J;for(var et=Math.floor((H+J)/2);et>H&&et<J;){if(R===X[et].entropy)return et;R<X[et].entropy?J=et:R>X[et].entropy&&(H=et),et=Math.floor((H+J)/2);}return H;}},{key:"updateTimers",value:function value(){var R=this,X=[].concat((0,l["default"])(this[w]));X.forEach(function(H){var J=(0,n["default"])(H,2),et=J[0],it=J[1];R[B](it.handler,it.time,et);});}},{key:"clearTimeout",value:function(D){function R(X){return D.apply(this,arguments);}return R.toString=function(){return D.toString();},R;}(function(D){var R=this[w].get(D);R&&R.timerID!=null&&(this[A]?this[A].clearTimeout(R.timerID):clearTimeout(R.timerID)),this[w]["delete"](D);})},{key:"clearInterval",value:function value(R){return this.clearTimeout(R);}},{key:"clear",value:function value(){var R=this,X=this[w];[].concat((0,l["default"])(X.keys())).forEach(function(H){R.clearTimeout(H);});}/*
204
- setTimeout(func, {delay: 100, isEntropy: true})
205
- setTimeout(func, {entropy: 100})
206
- setTimeout(func, 100})
207
- */},{key:"setTimeout",value:function value(R){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[B](R,X);}},{key:"setInterval",value:function value(R){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},H=this,J=this[B](function et(){H[B](et,X,J),R();},X);return J;}},{key:B,value:function value(R,X){var H=this,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,P["default"])("timerID");X=(0,x.formatDelay)(X);var et=this[w].get(J),it=void 0,$=null,V=void 0,rt=void 0;et?(this.clearTimeout(J),X.isEntropy?it=(X.delay-(this.entropy-et.startEntropy))/Math.abs(this.playbackRate):it=(X.delay-(this.currentTime-et.startTime))/this.playbackRate,V=et.startTime,rt=et.startEntropy):(it=X.delay/(X.isEntropy?Math.abs(this.playbackRate):this.playbackRate),V=this.currentTime,rt=this.entropy);var lt=this[A],ct=lt?lt.setTimeout.bind(lt):setTimeout,gt=X.heading;return!lt&&gt===!1&&it<0&&(it=1/0),(isFinite(it)||lt)&&(it=Math.ceil(it),ct!==setTimeout&&(it={delay:it,heading:gt}),$=ct(function(){H[w]["delete"](J),R();},it)),this[w].set(J,{timerID:$,handler:R,time:X,startTime:V,startEntropy:rt}),J;}},{key:"parent",get:function get(){return this[A];}},{key:"lastTimeMark",get:function get(){return this[g][this[g].length-1];}},{key:"currentTime",get:function get(){var R=this.lastTimeMark,X=R.localTime,H=R.globalTime;return X+(this.globalTime-H)*this.playbackRate;},set:function set(R){var X=this,H=this.currentTime,J=R,et=this[w];this.markTime({time:R}),[].concat((0,l["default"])(et)).forEach(function(it){var $=(0,n["default"])(it,2),V=$[0],rt=$[1];if(et.has(V)){var lt=rt.time,ct=lt.isEntropy,gt=lt.delay,st=lt.heading,Ct=rt.handler,xt=rt.startTime;if(ct)gt===0&&(Ct(),X.clearTimeout(V));else{var F=xt+gt;(gt===0||st!==!1&&(J-H)*gt<=0||H<=F&&F<=J||H>=F&&F>=J)&&(Ct(),X.clearTimeout(V));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
208
- // If current playbackRate is negative, the currentTime should go backwards
209
- // while the entropy remain to go forwards.
210
- // Both of the initial values is set to -originTime
211
- },{key:"entropy",get:function get(){var R=this.lastTimeMark,X=R.entropy,H=R.globalEntropy;return X+Math.abs((this.globalEntropy-H)*this.playbackRate);},// get globalTime() {
212
- // if(this[_parent]) {
213
- // return this[_parent].currentTime;
214
- // }
215
- // return nowtime();
216
- // }
217
- // change entropy will NOT cause currentTime changing but may influence the pass
218
- // and the future of the timeline. (It may change the result of seek***Time)
219
- // While entropy is set, all the marks behind will be droped
220
- set:function set(R){if(this.entropy>R){var X=this.seekTimeMark(R);this[g].length=X+1;}this.markTime({entropy:R}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[A]?this[A].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[O];},set:function set(R){R!==this.playbackRate&&(this.markTime({playbackRate:R}),this[O]=R,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var R=this.parent;R;){if(R.playbackRate===0)return!0;R=R.parent;}return!1;}}]),W;}();e["default"]=b;},/* 76 *//***/function(u,e,t){e.__esModule=!0;var r=t(77),n=o(r),i=t(129),l=o(i);function o(a){return a&&a.__esModule?a:{"default":a};}e["default"]=/* @__PURE__ */function(){function a(c,m){var f=[],v=!0,S=!1,E=void 0;try{for(var T=(0,l["default"])(c),P;!(v=(P=T.next()).done)&&(f.push(P.value),!(m&&f.length===m));v=!0);}catch(x){S=!0,E=x;}finally{try{!v&&T["return"]&&T["return"]();}finally{if(S)throw E;}}return f;}return function(c,m){if(Array.isArray(c))return c;if((0,n["default"])(Object(c)))return a(c,m);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 *//***/function(u,e,t){u.exports={"default":t(78),__esModule:!0};},/* 78 *//***/function(u,e,t){t(79),t(125),u.exports=t(127);},/* 79 *//***/function(u,e,t){t(80);for(var r=t(91),n=t(95),i=t(83),l=t(122)("toStringTag"),o="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),a=0;a<o.length;a++){var c=o[a],m=r[c],f=m&&m.prototype;f&&!f[l]&&n(f,l,c),i[c]=i.Array;}},/* 80 *//***/function(u,e,t){var r=t(81),n=t(82),i=t(83),l=t(84);u.exports=t(88)(Array,"Array",function(o,a){this._t=l(o),this._i=0,this._k=a;},function(){var o=this._t,a=this._k,c=this._i++;return!o||c>=o.length?(this._t=void 0,n(1)):a=="keys"?n(0,c):a=="values"?n(0,o[c]):n(0,[c,o[c]]);},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries");},/* 81 *//***/function(u,e){u.exports=function(){};},/* 82 *//***/function(u,e){u.exports=function(t,r){return{value:r,done:!!t};};},/* 83 *//***/function(u,e){u.exports={};},/* 84 *//***/function(u,e,t){var r=t(85),n=t(87);u.exports=function(i){return r(n(i));};},/* 85 *//***/function(u,e,t){var r=t(86);u.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return r(n)=="String"?n.split(""):Object(n);};},/* 86 *//***/function(u,e){var t={}.toString;u.exports=function(r){return t.call(r).slice(8,-1);};},/* 87 *//***/function(u,e){u.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 *//***/function(u,e,t){var r=t(89),n=t(90),i=t(106),l=t(95),o=t(83),a=t(107),c=t(121),m=t(123),f=t(122)("iterator"),v=!([].keys&&"next"in[].keys()),S="@@iterator",E="keys",T="values",P=function P(){return this;};u.exports=function(x,h,p,d,g,O,w){a(p,h,d);var L=function L($){if(!v&&$ in W)return W[$];switch($){case E:return function(){return new p(this,$);};case T:return function(){return new p(this,$);};}return function(){return new p(this,$);};},B=h+" Iterator",A=g==T,b=!1,W=x.prototype,D=W[f]||W[S]||g&&W[g],R=D||L(g),X=g?A?L("entries"):R:void 0,H=h=="Array"&&W.entries||D,J,et,it;if(H&&(it=m(H.call(new x())),it!==Object.prototype&&it.next&&(c(it,B,!0),!r&&typeof it[f]!="function"&&l(it,f,P))),A&&D&&D.name!==T&&(b=!0,R=function R(){return D.call(this);}),(!r||w)&&(v||b||!W[f])&&l(W,f,R),o[h]=R,o[B]=P,g)if(J={values:A?R:L(T),keys:O?R:L(E),entries:X},w)for(et in J)et in W||i(W,et,J[et]);else n(n.P+n.F*(v||b),h,J);return J;};},/* 89 *//***/function(u,e){u.exports=!0;},/* 90 *//***/function(u,e,t){var r=t(91),n=t(92),i=t(93),l=t(95),o=t(105),a="prototype",_c2=function c(m,f,v){var S=m&_c2.F,E=m&_c2.G,T=m&_c2.S,P=m&_c2.P,x=m&_c2.B,h=m&_c2.W,p=E?n:n[f]||(n[f]={}),d=p[a],g=E?r:T?r[f]:(r[f]||{})[a],O,w,L;E&&(v=f);for(O in v)w=!S&&g&&g[O]!==void 0,!(w&&o(p,O))&&(L=w?g[O]:v[O],p[O]=E&&typeof g[O]!="function"?v[O]:x&&w?i(L,r):h&&g[O]==L?function(B){var A=function A(b,W,D){if(this instanceof B){switch(arguments.length){case 0:return new B();case 1:return new B(b);case 2:return new B(b,W);}return new B(b,W,D);}return B.apply(this,arguments);};return A[a]=B[a],A;}(L):P&&typeof L=="function"?i(Function.call,L):L,P&&((p.virtual||(p.virtual={}))[O]=L,m&_c2.R&&d&&!d[O]&&l(d,O,L)));};_c2.F=1,_c2.G=2,_c2.S=4,_c2.P=8,_c2.B=16,_c2.W=32,_c2.U=64,_c2.R=128,u.exports=_c2;},/* 91 *//***/function(u,e){var t=u.exports=(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&window.Math==Math?window:(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=t);},/* 92 *//***/function(u,e){var t=u.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 *//***/function(u,e,t){var r=t(94);u.exports=function(n,i,l){if(r(n),i===void 0)return n;switch(l){case 1:return function(o){return n.call(i,o);};case 2:return function(o,a){return n.call(i,o,a);};case 3:return function(o,a,c){return n.call(i,o,a,c);};}return function(){return n.apply(i,arguments);};};},/* 94 *//***/function(u,e){u.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 *//***/function(u,e,t){var r=t(96),n=t(104);u.exports=t(100)?function(i,l,o){return r.f(i,l,n(1,o));}:function(i,l,o){return i[l]=o,i;};},/* 96 *//***/function(u,e,t){var r=t(97),n=t(99),i=t(103),l=Object.defineProperty;e.f=t(100)?Object.defineProperty:function(a,c,m){if(r(a),c=i(c,!0),r(m),n)try{return l(a,c,m);}catch(_unused10){}if("get"in m||"set"in m)throw TypeError("Accessors not supported!");return"value"in m&&(a[c]=m.value),a;};},/* 97 *//***/function(u,e,t){var r=t(98);u.exports=function(n){if(!r(n))throw TypeError(n+" is not an object!");return n;};},/* 98 *//***/function(u,e){u.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 *//***/function(u,e,t){u.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 *//***/function(u,e,t){u.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 *//***/function(u,e){u.exports=function(t){try{return!!t();}catch(_unused11){return!0;}};},/* 102 *//***/function(u,e,t){var r=t(98),n=t(91).document,i=r(n)&&r(n.createElement);u.exports=function(l){return i?n.createElement(l):{};};},/* 103 *//***/function(u,e,t){var r=t(98);u.exports=function(n,i){if(!r(n))return n;var l,o;if(i&&typeof(l=n.toString)=="function"&&!r(o=l.call(n))||typeof(l=n.valueOf)=="function"&&!r(o=l.call(n))||!i&&typeof(l=n.toString)=="function"&&!r(o=l.call(n)))return o;throw TypeError("Can't convert object to primitive value");};},/* 104 *//***/function(u,e){u.exports=function(t,r){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:r};};},/* 105 *//***/function(u,e){var t={}.hasOwnProperty;u.exports=function(r,n){return t.call(r,n);};},/* 106 *//***/function(u,e,t){u.exports=t(95);},/* 107 *//***/function(u,e,t){var r=t(108),n=t(104),i=t(121),l={};t(95)(l,t(122)("iterator"),function(){return this;}),u.exports=function(o,a,c){o.prototype=r(l,{next:n(1,c)}),i(o,a+" Iterator");};},/* 108 *//***/function(u,e,t){var r=t(97),n=t(109),i=t(119),l=t(116)("IE_PROTO"),o=function o(){},a="prototype",_c3=function c(){var m=t(102)("iframe"),f=i.length,v="<",S=">",E;for(m.style.display="none",t(120).appendChild(m),m.src="javascript:",E=m.contentWindow.document,E.open(),E.write(v+"script"+S+"document.F=Object"+v+"/script"+S),E.close(),_c3=E.F;f--;)delete _c3[a][i[f]];return _c3();};u.exports=Object.create||function(f,v){var S;return f!==null?(o[a]=r(f),S=new o(),o[a]=null,S[l]=f):S=_c3(),v===void 0?S:n(S,v);};},/* 109 *//***/function(u,e,t){var r=t(96),n=t(97),i=t(110);u.exports=t(100)?Object.defineProperties:function(o,a){n(o);for(var c=i(a),m=c.length,f=0,v;m>f;)r.f(o,v=c[f++],a[v]);return o;};},/* 110 *//***/function(u,e,t){var r=t(111),n=t(119);u.exports=Object.keys||function(l){return r(l,n);};},/* 111 *//***/function(u,e,t){var r=t(105),n=t(84),i=t(112)(!1),l=t(116)("IE_PROTO");u.exports=function(o,a){var c=n(o),m=0,f=[],v;for(v in c)v!=l&&r(c,v)&&f.push(v);for(;a.length>m;)r(c,v=a[m++])&&(~i(f,v)||f.push(v));return f;};},/* 112 *//***/function(u,e,t){var r=t(84),n=t(113),i=t(115);u.exports=function(l){return function(o,a,c){var m=r(o),f=n(m.length),v=i(c,f),S;if(l&&a!=a){for(;f>v;)if(S=m[v++],S!=S)return!0;}else for(;f>v;v++)if((l||v in m)&&m[v]===a)return l||v||0;return!l&&-1;};};},/* 113 *//***/function(u,e,t){var r=t(114),n=Math.min;u.exports=function(i){return i>0?n(r(i),9007199254740991):0;};},/* 114 *//***/function(u,e){var t=Math.ceil,r=Math.floor;u.exports=function(n){return isNaN(n=+n)?0:(n>0?r:t)(n);};},/* 115 *//***/function(u,e,t){var r=t(114),n=Math.max,i=Math.min;u.exports=function(l,o){return l=r(l),l<0?n(l+o,0):i(l,o);};},/* 116 *//***/function(u,e,t){var r=t(117)("keys"),n=t(118);u.exports=function(i){return r[i]||(r[i]=n(i));};},/* 117 *//***/function(u,e,t){var r=t(92),n=t(91),i="__core-js_shared__",l=n[i]||(n[i]={});(u.exports=function(o,a){return l[o]||(l[o]=a!==void 0?a:{});})("versions",[]).push({version:r.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 *//***/function(u,e){var t=0,r=Math.random();u.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+r).toString(36));};},/* 119 *//***/function(u,e){u.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 *//***/function(u,e,t){var r=t(91).document;u.exports=r&&r.documentElement;},/* 121 *//***/function(u,e,t){var r=t(96).f,n=t(105),i=t(122)("toStringTag");u.exports=function(l,o,a){l&&!n(l=a?l:l.prototype,i)&&r(l,i,{configurable:!0,value:o});};},/* 122 *//***/function(u,e,t){var r=t(117)("wks"),n=t(118),i=t(91).Symbol,l=typeof i=="function",o=u.exports=function(a){return r[a]||(r[a]=l&&i[a]||(l?i:n)("Symbol."+a));};o.store=r;},/* 123 *//***/function(u,e,t){var r=t(105),n=t(124),i=t(116)("IE_PROTO"),l=Object.prototype;u.exports=Object.getPrototypeOf||function(o){return o=n(o),r(o,i)?o[i]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?l:null;};},/* 124 *//***/function(u,e,t){var r=t(87);u.exports=function(n){return Object(r(n));};},/* 125 *//***/function(u,e,t){var r=t(126)(!0);t(88)(String,"String",function(n){this._t=String(n),this._i=0;},function(){var n=this._t,i=this._i,l;return i>=n.length?{value:void 0,done:!0}:(l=r(n,i),this._i+=l.length,{value:l,done:!1});});},/* 126 *//***/function(u,e,t){var r=t(114),n=t(87);u.exports=function(i){return function(l,o){var a=String(n(l)),c=r(o),m=a.length,f,v;return c<0||c>=m?i?"":void 0:(f=a.charCodeAt(c),f<55296||f>56319||c+1===m||(v=a.charCodeAt(c+1))<56320||v>57343?i?a.charAt(c):f:i?a.slice(c,c+2):(f-55296<<10)+(v-56320)+65536);};};},/* 127 *//***/function(u,e,t){var r=t(128),n=t(122)("iterator"),i=t(83);u.exports=t(92).isIterable=function(l){var o=Object(l);return o[n]!==void 0||"@@iterator"in o||i.hasOwnProperty(r(o));};},/* 128 *//***/function(u,e,t){var r=t(86),n=t(122)("toStringTag"),i=r(/* @__PURE__ */function(){return arguments;}())=="Arguments",l=function l(o,a){try{return o[a];}catch(_unused12){}};u.exports=function(o){var a,c,m;return o===void 0?"Undefined":o===null?"Null":typeof(c=l(a=Object(o),n))=="string"?c:i?r(a):(m=r(a))=="Object"&&typeof a.callee=="function"?"Arguments":m;};},/* 129 *//***/function(u,e,t){u.exports={"default":t(130),__esModule:!0};},/* 130 *//***/function(u,e,t){t(79),t(125),u.exports=t(131);},/* 131 *//***/function(u,e,t){var r=t(97),n=t(132);u.exports=t(92).getIterator=function(i){var l=n(i);if(typeof l!="function")throw TypeError(i+" is not iterable!");return r(l.call(i));};},/* 132 *//***/function(u,e,t){var r=t(128),n=t(122)("iterator"),i=t(83);u.exports=t(92).getIteratorMethod=function(l){if(l!=null)return l[n]||l["@@iterator"]||i[r(l)];};},/* 133 *//***/function(u,e,t){e.__esModule=!0;var r=t(134),n=i(r);function i(l){return l&&l.__esModule?l:{"default":l};}e["default"]=function(l){if(Array.isArray(l)){for(var o=0,a=Array(l.length);o<l.length;o++)a[o]=l[o];return a;}else return(0,n["default"])(l);};},/* 134 *//***/function(u,e,t){u.exports={"default":t(135),__esModule:!0};},/* 135 *//***/function(u,e,t){t(125),t(136),u.exports=t(92).Array.from;},/* 136 *//***/function(u,e,t){var r=t(93),n=t(90),i=t(124),l=t(137),o=t(138),a=t(113),c=t(139),m=t(132);n(n.S+n.F*!t(140)(function(f){Array.from(f);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
221
- from:function from(v){var S=i(v),E=typeof this=="function"?this:Array,T=arguments.length,P=T>1?arguments[1]:void 0,x=P!==void 0,h=0,p=m(S),d,g,O,w;if(x&&(P=r(P,T>2?arguments[2]:void 0,2)),p!=null&&!(E==Array&&o(p)))for(w=p.call(S),g=new E();!(O=w.next()).done;h++)c(g,h,x?l(w,P,[O.value,h],!0):O.value);else for(d=a(S.length),g=new E(d);d>h;h++)c(g,h,x?P(S[h],h):S[h]);return g.length=h,g;}});},/* 137 *//***/function(u,e,t){var r=t(97);u.exports=function(n,i,l,o){try{return o?i(r(l)[0],l[1]):i(l);}catch(c){var a=n["return"];throw a!==void 0&&r(a.call(n)),c;}};},/* 138 *//***/function(u,e,t){var r=t(83),n=t(122)("iterator"),i=Array.prototype;u.exports=function(l){return l!==void 0&&(r.Array===l||i[n]===l);};},/* 139 *//***/function(u,e,t){var r=t(96),n=t(104);u.exports=function(i,l,o){l in i?r.f(i,l,n(0,o)):i[l]=o;};},/* 140 *//***/function(u,e,t){var r=t(122)("iterator"),n=!1;try{var i=[7][r]();i["return"]=function(){n=!0;},Array.from(i,function(){throw 2;});}catch(_unused13){}u.exports=function(l,o){if(!o&&!n)return!1;var a=!1;try{var c=[7],m=c[r]();m.next=function(){return{done:a=!0};},c[r]=function(){return m;},l(c);}catch(_unused14){}return a;};},/* 141 *//***/function(u,e,t){u.exports={"default":t(142),__esModule:!0};},/* 142 *//***/function(u,e,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),u.exports=t(92).Map;},/* 143 *//***/function(u,e){},/* 144 *//***/function(u,e,t){var r=t(145),n=t(151),i="Map";u.exports=t(152)(i,function(l){return function(){return l(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
222
- get:function get(o){var a=r.getEntry(n(this,i),o);return a&&a.v;},// 23.1.3.9 Map.prototype.set(key, value)
223
- set:function set(o,a){return r.def(n(this,i),o===0?0:o,a);}},r,!0);},/* 145 *//***/function(u,e,t){var r=t(96).f,n=t(108),i=t(146),l=t(93),o=t(147),a=t(148),c=t(88),m=t(82),f=t(149),v=t(100),S=t(150).fastKey,E=t(151),T=v?"_s":"size",P=function P(x,h){var p=S(h),d;if(p!=="F")return x._i[p];for(d=x._f;d;d=d.n)if(d.k==h)return d;};u.exports={getConstructor:function getConstructor(x,h,p,d){var g=x(function(O,w){o(O,g,h,"_i"),O._t=h,O._i=n(null),O._f=void 0,O._l=void 0,O[T]=0,w!=null&&a(w,p,O[d],O);});return i(g.prototype,{// 23.1.3.1 Map.prototype.clear()
224
- // 23.2.3.2 Set.prototype.clear()
225
- clear:function clear(){for(var w=E(this,h),L=w._i,B=w._f;B;B=B.n)B.r=!0,B.p&&(B.p=B.p.n=void 0),delete L[B.i];w._f=w._l=void 0,w[T]=0;},// 23.1.3.3 Map.prototype.delete(key)
226
- // 23.2.3.4 Set.prototype.delete(value)
227
- "delete":function _delete(O){var w=E(this,h),L=P(w,O);if(L){var B=L.n,A=L.p;delete w._i[L.i],L.r=!0,A&&(A.n=B),B&&(B.p=A),w._f==L&&(w._f=B),w._l==L&&(w._l=A),w[T]--;}return!!L;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
228
- // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
229
- forEach:function forEach(w){E(this,h);for(var L=l(w,arguments.length>1?arguments[1]:void 0,3),B;B=B?B.n:this._f;)for(L(B.v,B.k,this);B&&B.r;)B=B.p;},// 23.1.3.7 Map.prototype.has(key)
230
- // 23.2.3.7 Set.prototype.has(value)
231
- has:function has(w){return!!P(E(this,h),w);}}),v&&r(g.prototype,"size",{get:function get(){return E(this,h)[T];}}),g;},def:function def(x,h,p){var d=P(x,h),g,O;return d?d.v=p:(x._l=d={i:O=S(h,!0),// <- index
232
- k:h,// <- key
233
- v:p,// <- value
234
- p:g=x._l,// <- previous entry
235
- n:void 0,// <- next entry
236
- r:!1// <- removed
237
- },x._f||(x._f=d),g&&(g.n=d),x[T]++,O!=="F"&&(x._i[O]=d)),x;},getEntry:P,setStrong:function setStrong(x,h,p){c(x,h,function(d,g){this._t=E(d,h),this._k=g,this._l=void 0;},function(){for(var d=this,g=d._k,O=d._l;O&&O.r;)O=O.p;return!d._t||!(d._l=O=O?O.n:d._t._f)?(d._t=void 0,m(1)):g=="keys"?m(0,O.k):g=="values"?m(0,O.v):m(0,[O.k,O.v]);},p?"entries":"values",!p,!0),f(h);}};},/* 146 *//***/function(u,e,t){var r=t(95);u.exports=function(n,i,l){for(var o in i)l&&n[o]?n[o]=i[o]:r(n,o,i[o]);return n;};},/* 147 *//***/function(u,e){u.exports=function(t,r,n,i){if(!(t instanceof r)||i!==void 0&&i in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 *//***/function(u,f,t){var r=t(93),n=t(137),i=t(138),l=t(97),o=t(113),a=t(132),c={},m={},f=u.exports=function(v,S,E,T,P){var x=P?function(){return v;}:a(v),h=r(E,T,S?2:1),p=0,d,g,O,w;if(typeof x!="function")throw TypeError(v+" is not iterable!");if(i(x)){for(d=o(v.length);d>p;p++)if(w=S?h(l(g=v[p])[0],g[1]):h(v[p]),w===c||w===m)return w;}else for(O=x.call(v);!(g=O.next()).done;)if(w=n(O,h,g.value,S),w===c||w===m)return w;};f.BREAK=c,f.RETURN=m;},/* 149 *//***/function(u,e,t){var r=t(91),n=t(92),i=t(96),l=t(100),o=t(122)("species");u.exports=function(a){var c=typeof n[a]=="function"?n[a]:r[a];l&&c&&!c[o]&&i.f(c,o,{configurable:!0,get:function get(){return this;}});};},/* 150 *//***/function(u,e,t){var r=t(118)("meta"),n=t(98),i=t(105),l=t(96).f,o=0,a=Object.isExtensible||function(){return!0;},c=!t(101)(function(){return a(Object.preventExtensions({}));}),m=function m(T){l(T,r,{value:{i:"O"+ ++o,// object ID
238
- w:{}// weak collections IDs
239
- }});},f=function f(T,P){if(!n(T))return _typeof(T)=="symbol"?T:(typeof T=="string"?"S":"P")+T;if(!i(T,r)){if(!a(T))return"F";if(!P)return"E";m(T);}return T[r].i;},v=function v(T,P){if(!i(T,r)){if(!a(T))return!0;if(!P)return!1;m(T);}return T[r].w;},S=function S(T){return c&&E.NEED&&a(T)&&!i(T,r)&&m(T),T;},E=u.exports={KEY:r,NEED:!1,fastKey:f,getWeak:v,onFreeze:S};},/* 151 *//***/function(u,e,t){var r=t(98);u.exports=function(n,i){if(!r(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 *//***/function(u,e,t){var r=t(91),n=t(90),i=t(150),l=t(101),o=t(95),a=t(146),c=t(148),m=t(147),f=t(98),v=t(121),S=t(96).f,E=t(153)(0),T=t(100);u.exports=function(P,x,h,p,d,g){var O=r[P],w=O,L=d?"set":"add",B=w&&w.prototype,A={};return!T||typeof w!="function"||!(g||B.forEach&&!l(function(){new w().entries().next();}))?(w=p.getConstructor(x,P,d,L),a(w.prototype,h),i.NEED=!0):(w=x(function(b,W){m(b,w,P,"_c"),b._c=new O(),W!=null&&c(W,d,b[L],b);}),E("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(b){var W=b=="add"||b=="set";b in B&&!(g&&b=="clear")&&o(w.prototype,b,function(D,R){if(m(this,w,b),!W&&g&&!f(D))return b=="get"?void 0:!1;var X=this._c[b](D===0?0:D,R);return W?this:X;});}),g||S(w.prototype,"size",{get:function get(){return this._c.size;}})),v(w,P),A[P]=w,n(n.G+n.W+n.F,A),g||p.setStrong(w,P,d),w;};},/* 153 *//***/function(u,e,t){var r=t(93),n=t(85),i=t(124),l=t(113),o=t(154);u.exports=function(a,c){var m=a==1,f=a==2,v=a==3,S=a==4,E=a==6,T=a==5||E,P=c||o;return function(x,h,p){for(var d=i(x),g=n(d),O=r(h,p,3),w=l(g.length),L=0,B=m?P(x,w):f?P(x,0):void 0,A,b;w>L;L++)if((T||L in g)&&(A=g[L],b=O(A,L,d),a)){if(m)B[L]=b;else if(b)switch(a){case 3:return!0;case 5:return A;case 6:return L;case 2:B.push(A);}else if(S)return!1;}return E?-1:v||S?S:B;};};},/* 154 *//***/function(u,e,t){var r=t(155);u.exports=function(n,i){return new(r(n))(i);};},/* 155 *//***/function(u,e,t){var r=t(98),n=t(156),i=t(122)("species");u.exports=function(l){var o;return n(l)&&(o=l.constructor,typeof o=="function"&&(o===Array||n(o.prototype))&&(o=void 0),r(o)&&(o=o[i],o===null&&(o=void 0))),o===void 0?Array:o;};},/* 156 *//***/function(u,e,t){var r=t(86);u.exports=Array.isArray||function(i){return r(i)=="Array";};},/* 157 *//***/function(u,e,t){var r=t(90);r(r.P+r.R,"Map",{toJSON:t(158)("Map")});},/* 158 *//***/function(u,e,t){var r=t(128),n=t(159);u.exports=function(i){return function(){if(r(this)!=i)throw TypeError(i+"#toJSON isn't generic");return n(this);};};},/* 159 *//***/function(u,e,t){var r=t(148);u.exports=function(n,i){var l=[];return r(n,!1,l.push,l,i),l;};},/* 160 *//***/function(u,e,t){t(161)("Map");},/* 161 *//***/function(u,e,t){var r=t(90);u.exports=function(n){r(r.S,n,{of:function of(){for(var l=arguments.length,o=new Array(l);l--;)o[l]=arguments[l];return new this(o);}});};},/* 162 *//***/function(u,e,t){t(163)("Map");},/* 163 *//***/function(u,e,t){var r=t(90),n=t(94),i=t(93),l=t(148);u.exports=function(o){r(r.S,o,{from:function from(c){var m=arguments[1],f,v,S,E;return n(this),f=m!==void 0,f&&n(m),c==null?new this():(v=[],f?(S=0,E=i(m,arguments[2],2),l(c,!1,function(T){v.push(E(T,S++));})):l(c,!1,v.push,v),new this(v));}});};},/* 164 *//***/function(u,e,t){u.exports={"default":t(165),__esModule:!0};},/* 165 *//***/function(u,e,t){t(166),u.exports=t(92).Object.assign;},/* 166 *//***/function(u,e,t){var r=t(90);r(r.S+r.F,"Object",{assign:t(167)});},/* 167 *//***/function(u,e,t){var r=t(100),n=t(110),i=t(168),l=t(169),o=t(124),a=t(85),c=Object.assign;u.exports=!c||t(101)(function(){var m={},f={},v=Symbol(),S="abcdefghijklmnopqrst";return m[v]=7,S.split("").forEach(function(E){f[E]=E;}),c({},m)[v]!=7||Object.keys(c({},f)).join("")!=S;})?function(f,v){for(var S=o(f),E=arguments.length,T=1,P=i.f,x=l.f;E>T;)for(var h=a(arguments[T++]),p=P?n(h).concat(P(h)):n(h),d=p.length,g=0,O;d>g;)O=p[g++],(!r||x.call(h,O))&&(S[O]=h[O]);return S;}:c;},/* 168 *//***/function(u,e){e.f=Object.getOwnPropertySymbols;},/* 169 *//***/function(u,e){e.f={}.propertyIsEnumerable;},/* 170 *//***/function(u,e,t){e.__esModule=!0,e["default"]=function(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function");};},/* 171 *//***/function(u,e,t){e.__esModule=!0;var r=t(172),n=i(r);function i(l){return l&&l.__esModule?l:{"default":l};}e["default"]=/* @__PURE__ */function(){function l(o,a){for(var c=0;c<a.length;c++){var m=a[c];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),(0,n["default"])(o,m.key,m);}}return function(o,a,c){return a&&l(o.prototype,a),c&&l(o,c),o;};}();},/* 172 *//***/function(u,e,t){u.exports={"default":t(173),__esModule:!0};},/* 173 *//***/function(u,e,t){t(174);var r=t(92).Object;u.exports=function(i,l,o){return r.defineProperty(i,l,o);};},/* 174 *//***/function(u,e,t){var r=t(90);r(r.S+r.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 *//***/function(u,e,t){u.exports={"default":t(176),__esModule:!0};},/* 176 *//***/function(u,e,t){t(177),t(143),t(184),t(185),u.exports=t(92).Symbol;},/* 177 *//***/function(u,e,t){var r=t(91),n=t(105),i=t(100),l=t(90),o=t(106),a=t(150).KEY,c=t(101),m=t(117),f=t(121),v=t(118),S=t(122),E=t(178),T=t(179),P=t(180),x=t(156),h=t(97),p=t(98),d=t(124),g=t(84),O=t(103),w=t(104),L=t(108),B=t(181),A=t(183),b=t(168),W=t(96),D=t(110),R=A.f,X=W.f,H=B.f,_J2=r.Symbol,et=r.JSON,it=et&&et.stringify,$="prototype",V=S("_hidden"),rt=S("toPrimitive"),lt={}.propertyIsEnumerable,ct=m("symbol-registry"),gt=m("symbols"),st=m("op-symbols"),Ct=Object[$],xt=typeof _J2=="function"&&!!b.f,F=r.QObject,U=!F||!F[$]||!F[$].findChild,K=i&&c(function(){return L(X({},"a",{get:function get(){return X(this,"a",{value:7}).a;}})).a!=7;})?function(yt,vt,St){var Mt=R(Ct,vt);Mt&&delete Ct[vt],X(yt,vt,St),Mt&&yt!==Ct&&X(Ct,vt,Mt);}:X,q=function q(yt){var vt=gt[yt]=L(_J2[$]);return vt._k=yt,vt;},Y=xt&&_typeof(_J2.iterator)=="symbol"?function(yt){return _typeof(yt)=="symbol";}:function(yt){return yt instanceof _J2;},_k2=function k(vt,St,Mt){return vt===Ct&&_k2(st,St,Mt),h(vt),St=O(St,!0),h(Mt),n(gt,St)?(Mt.enumerable?(n(vt,V)&&vt[V][St]&&(vt[V][St]=!1),Mt=L(Mt,{enumerable:w(0,!1)})):(n(vt,V)||X(vt,V,w(1,{})),vt[V][St]=!0),K(vt,St,Mt)):X(vt,St,Mt);},C=function C(vt,St){h(vt);for(var Mt=P(St=g(St)),wt=0,Ot=Mt.length,Bt;Ot>wt;)_k2(vt,Bt=Mt[wt++],St[Bt]);return vt;},M=function M(vt,St){return St===void 0?L(vt):C(L(vt),St);},j=function j(vt){var St=lt.call(this,vt=O(vt,!0));return this===Ct&&n(gt,vt)&&!n(st,vt)?!1:St||!n(this,vt)||!n(gt,vt)||n(this,V)&&this[V][vt]?St:!0;},G=function G(vt,St){if(vt=g(vt),St=O(St,!0),!(vt===Ct&&n(gt,St)&&!n(st,St))){var Mt=R(vt,St);return Mt&&n(gt,St)&&!(n(vt,V)&&vt[V][St])&&(Mt.enumerable=!0),Mt;}},Q=function Q(vt){for(var St=H(g(vt)),Mt=[],wt=0,Ot;St.length>wt;)!n(gt,Ot=St[wt++])&&Ot!=V&&Ot!=a&&Mt.push(Ot);return Mt;},_=function _(vt){for(var St=vt===Ct,Mt=H(St?st:g(vt)),wt=[],Ot=0,Bt;Mt.length>Ot;)n(gt,Bt=Mt[Ot++])&&(!St||n(Ct,Bt))&&wt.push(gt[Bt]);return wt;};xt||(_J2=function J(){if(this instanceof _J2)throw TypeError("Symbol is not a constructor!");var vt=v(arguments.length>0?arguments[0]:void 0),_St=function St(Mt){this===Ct&&_St.call(st,Mt),n(this,V)&&n(this[V],vt)&&(this[V][vt]=!1),K(this,vt,w(1,Mt));};return i&&U&&K(Ct,vt,{configurable:!0,set:_St}),q(vt);},o(_J2[$],"toString",function(){return this._k;}),A.f=G,W.f=_k2,t(182).f=B.f=Q,t(169).f=j,b.f=_,i&&!t(89)&&o(Ct,"propertyIsEnumerable",j,!0),E.f=function(yt){return q(S(yt));}),l(l.G+l.W+l.F*!xt,{Symbol:_J2});for(var nt=// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
240
- "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ut=0;nt.length>ut;)S(nt[ut++]);for(var mt=D(S.store),Pt=0;mt.length>Pt;)T(mt[Pt++]);l(l.S+l.F*!xt,"Symbol",{// 19.4.2.1 Symbol.for(key)
241
- "for":function _for(yt){return n(ct,yt+="")?ct[yt]:ct[yt]=_J2(yt);},// 19.4.2.5 Symbol.keyFor(sym)
242
- keyFor:function keyFor(vt){if(!Y(vt))throw TypeError(vt+" is not a symbol!");for(var St in ct)if(ct[St]===vt)return St;},useSetter:function useSetter(){U=!0;},useSimple:function useSimple(){U=!1;}}),l(l.S+l.F*!xt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
243
- create:M,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
244
- defineProperty:_k2,// 19.1.2.3 Object.defineProperties(O, Properties)
245
- defineProperties:C,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
246
- getOwnPropertyDescriptor:G,// 19.1.2.7 Object.getOwnPropertyNames(O)
247
- getOwnPropertyNames:Q,// 19.1.2.8 Object.getOwnPropertySymbols(O)
248
- getOwnPropertySymbols:_});var Tt=c(function(){b.f(1);});l(l.S+l.F*Tt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(vt){return b.f(d(vt));}}),et&&l(l.S+l.F*(!xt||c(function(){var yt=_J2();return it([yt])!="[null]"||it({a:yt})!="{}"||it(Object(yt))!="{}";})),"JSON",{stringify:function stringify(vt){for(var St=[vt],Mt=1,wt,Ot;arguments.length>Mt;)St.push(arguments[Mt++]);if(Ot=wt=St[1],!(!p(wt)&&vt===void 0||Y(vt)))return x(wt)||(wt=function wt(Bt,Gt){if(typeof Ot=="function"&&(Gt=Ot.call(this,Bt,Gt)),!Y(Gt))return Gt;}),St[1]=wt,it.apply(et,St);}}),_J2[$][rt]||t(95)(_J2[$],rt,_J2[$].valueOf),f(_J2,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0);},/* 178 *//***/function(u,e,t){e.f=t(122);},/* 179 *//***/function(u,e,t){var r=t(91),n=t(92),i=t(89),l=t(178),o=t(96).f;u.exports=function(a){var c=n.Symbol||(n.Symbol=i?{}:r.Symbol||{});a.charAt(0)!="_"&&!(a in c)&&o(c,a,{value:l.f(a)});};},/* 180 *//***/function(u,e,t){var r=t(110),n=t(168),i=t(169);u.exports=function(l){var o=r(l),a=n.f;if(a)for(var c=a(l),m=i.f,f=0,v;c.length>f;)m.call(l,v=c[f++])&&o.push(v);return o;};},/* 181 *//***/function(u,e,t){var r=t(84),n=t(182).f,i={}.toString,l=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function o(a){try{return n(a);}catch(_unused15){return l.slice();}};u.exports.f=function(c){return l&&i.call(c)=="[object Window]"?o(c):n(r(c));};},/* 182 *//***/function(u,e,t){var r=t(111),n=t(119).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(l){return r(l,n);};},/* 183 *//***/function(u,e,t){var r=t(169),n=t(104),i=t(84),l=t(103),o=t(105),a=t(99),c=Object.getOwnPropertyDescriptor;e.f=t(100)?c:function(f,v){if(f=i(f),v=l(v,!0),a)try{return c(f,v);}catch(_unused16){}if(o(f,v))return n(!r.f.call(f,v),f[v]);};},/* 184 *//***/function(u,e,t){t(179)("asyncIterator");},/* 185 *//***/function(u,e,t){t(179)("observable");},/* 186 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.createNowTime=r,e.formatDelay=n;function r(){var i=null;return Date.now?i=Date.now:i=function i(){return(/* @__PURE__ */new Date()).getTime();},i;}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i;}},/* 187 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={// s - startFrame, e - endFrame
249
- "default":function _default(n,i,l,o,a){return typeof n=="number"&&typeof i=="number"?n+(l-o)/(a-o)*(i-n):l-o>a-l?i:n;}};},/* 188 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.parseEasing=e.Easings=void 0;var r=t(76),n=c(r),i=t(133),l=c(i),o=t(141),a=c(o);function c(x){return x&&x.__esModule?x:{"default":x};}var m=t(189),f=new a["default"]();function v(){for(var x=arguments.length,h=Array(x),p=0;p<x;p++)h[p]=arguments[p];var d=f.get(h);return d||(d=m.apply(void 0,h),f.set(h,d),d);}function S(x){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(p,d){for(var g=1;g<d.length;g++){var O=d[g].offset;if(p<=O){var w=d[g-1].offset,L=O,B=(p-w)/(L-w),A=1/x,b=B/A;return h==="end"?b=Math.floor(b):b=Math.ceil(b),A*b*(L-w)+w;}}return 0;};}function E(x){var h=/^cubic-bezier\((.*)\)/,p=x.match(h);if(p){var d=p[1].trim();return d=d.split(",").map(function(A){return parseFloat(A.trim());}),v.apply(void 0,(0,l["default"])(d));}if(h=/^steps\((.*)\)/,p=x.match(h),p){var g=p[1].trim();g=g.split(",").map(function(A){return A.trim();});var O=g,w=(0,n["default"])(O,2),L=w[0],B=w[1];return S(parseInt(L,10),B);}return x;}var T={linear:function linear(h){return h;},ease:v(0.25,0.1,0.25,1),"ease-in":v(0.42,0,1,1),"ease-out":v(0,0,0.58,1),"ease-in-out":v(0.42,0,0.58,1),// 'step-start': function(p, frames){
250
- // let ret = 0
251
- // for(let i = 0; i < frames.length; i++){
252
- // const {offset} = frames[i]
253
- // ret = offset
254
- // if(p < offset){
255
- // break
256
- // }
257
- // }
258
- // return ret
259
- // },
260
- // 'step-end': function(p, frames){
261
- // let ret = 0
262
- // for(let i = 0; i < frames.length; i++){
263
- // const {offset} = frames[i]
264
- // if(p < offset){
265
- // break
266
- // }
267
- // ret = offset
268
- // }
269
- // return ret
270
- // }
271
- "step-start":S(1,"start"),"step-end":S(1,"end")};function P(x){return typeof x=="string"?T[x]?x=T[x]:x=E(x):x.type==="cubic-bezier"?x=v.apply(void 0,(0,l["default"])(x.value)):x.type==="steps"&&(x=S(x.step,x.pos)),x;}e.Easings=T,e.parseEasing=P;},/* 189 *//***/function(u,e){var t=4,r=1e-3,n=1e-7,i=10,l=11,o=1/(l-1),a=typeof Float32Array=="function";function c(x,h){return 1-3*h+3*x;}function m(x,h){return 3*h-6*x;}function f(x){return 3*x;}function v(x,h,p){return((c(h,p)*x+m(h,p))*x+f(h))*x;}function S(x,h,p){return 3*c(h,p)*x*x+2*m(h,p)*x+f(h);}function E(x,h,p,d,g){var O,w,L=0;do w=h+(p-h)/2,O=v(w,d,g)-x,O>0?p=w:h=w;while(Math.abs(O)>n&&++L<i);return w;}function T(x,h,p,d){for(var g=0;g<t;++g){var O=S(h,p,d);if(O===0)return h;var w=v(h,p,d)-x;h-=w/O;}return h;}function P(x){return x;}u.exports=function(h,p,d,g){if(!(0<=h&&h<=1&&0<=d&&d<=1))throw new Error("bezier x values must be in [0, 1] range");if(h===p&&d===g)return P;for(var O=a?new Float32Array(l):new Array(l),w=0;w<l;++w)O[w]=v(w*o,h,d);function L(B){for(var A=0,b=1,W=l-1;b!==W&&O[b]<=B;++b)A+=o;--b;var D=(B-O[b])/(O[b+1]-O[b]),R=A+D*o,X=S(R,h,d);return X>=r?T(B,R,h,d):X===0?R:E(B,A,A+o,h,d);}return function(A){return A===0?0:A===1?1:v(L(A),p,g);};};},/* 190 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(191),n=p(r),i=t(204),l=p(i),o=t(164),a=p(o),c=t(170),m=p(c),f=t(171),v=p(f),S=t(175),E=p(S),T=t(75),P=p(T),x=t(208),h=t(188);function p(X){return X&&X.__esModule?X:{"default":X};}var d=(0,E["default"])("timing"),g=(0,E["default"])("keyframes"),O=(0,E["default"])("initState"),w=(0,E["default"])("readyDefer"),L=(0,E["default"])("finishedDefer"),B=(0,E["default"])("effects"),A=(0,E["default"])("activeReadyTimer"),b=(0,E["default"])("activeFinishTimer"),W=(0,E["default"])("removeDefer"),D={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},R=function(){function X(H,J,et){var it=this;if((0,m["default"])(this,X),Array.isArray(H)){var $=[H[0],H,J];H=$[0],J=$[1],et=$[2];}typeof et=="number"&&(et={duration:et}),this[d]=(0,a["default"])({},D,et),this[d].easing=(0,h.parseEasing)(this[d].easing),this[g]=(0,x.calculateFramesOffset)(J);var V=this[g][this[g].length-1];this[O]={},(0,l["default"])(V).forEach(function(rt){Object.prototype.hasOwnProperty.call(H,rt)&&rt!=="easing"&&rt!=="offset"&&(it[O][rt]=H[rt]);}),this[g]=this[g].map(function(rt){return(0,a["default"])({},it[O],rt);}),this[g][0].offset!==0&&this[g].unshift((0,a["default"])({},this[O],{offset:0})),V.offset<1&&this[g].push((0,a["default"])({},V,{offset:1})),this[B]={},this.timeline=null;}return(0,v["default"])(X,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:A,value:function value(){var J=this;this[w]&&!this[w].timerID&&(this.timeline.currentTime<0?this[w].timerID=this.timeline.setTimeout(function(){J[w].resolve(),delete J[w];},{delay:-this.timeline.currentTime,heading:!1}):this[w].timerID=this.timeline.setTimeout(function(){J[w].resolve(),delete J[w];},{delay:0,isEntropy:!0}));}},{key:b,value:function value(){var J=this,et=this[d],it=et.duration,$=et.iterations,V=et.endDelay,rt=Math.ceil(it*$+V-this.timeline.currentTime)+1;this[L]&&!this[L].timerID&&(this[L].timerID=this.timeline.setTimeout(function(){J[L].resolve(),J[W](w),J[W](L);},{delay:rt,heading:!1}),this[L].reverseTimerID=this.timeline.setTimeout(function(){J[L].resolve(),J[W](w),J[W](L),J.timeline=null;},{delay:-this[d].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var J=this[d],et=J.delay,it=J.playbackRate,$=J.timeline;this.timeline=new P["default"]({originTime:et,playbackRate:it},$),this[A](),this[b]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[A]());}},{key:W,value:function value(J){var et=this[J],it=this.timeline;et&&it&&(it.clearTimeout(et.timerID),et.reverseTimerID&&it.clearTimeout(et.reverseTimerID)),delete this[J];}},{key:"cancel",value:function value(){this[W](w),this[W](L),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[W](w),this[W](L);}},{key:"applyEffects",value:function value(J){return(0,a["default"])(this[B],J);}},{key:"playbackRate",get:function get(){return this[d].playbackRate;},set:function set(J){this.timeline&&(this.timeline.playbackRate=J),this[d].playbackRate=J;}},{key:"playState",get:function get(){var J=this.timeline,et=this[d],it=et.iterations,$=et.duration,V=et.endDelay,rt="running";if(J==null)rt="idle";else if(J.paused)rt="paused";else if(J.currentTime<0)rt="pending";else{var lt=J.currentTime-it*$;lt>0&&lt<V?rt="pending":lt>=V&&(rt="finished");}return rt;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var J=this[d],et=J.duration,it=J.iterations,$=this.timeline,V=this.playState,rt=void 0;if(V==="idle")rt=0;else if(V==="paused"&&$.currentTime<0)rt=0;else if(V==="pending"){if($.currentTime<0)rt=0;else{var lt=$.seekLocalTime(it*et);rt=(0,x.periodicity)(lt,et)[1]/et;}}else(V==="running"||V==="paused")&&(rt=(0,x.periodicity)($.currentTime,et)[1]/et);return V==="finished"&&(rt=(0,x.periodicity)(it,1)[1]),rt;}},{key:"frame",get:function get(){var J=this.playState,et=this[O],it=this[d].fill;if(J==="idle")return et;var $=this.timeline.currentTime,V=this[g].slice(0),rt=(0,x.getProgress)(this.timeline,this[d],this.progress),lt=rt.p,ct=rt.inverted,gt=et;return $<0&&J==="pending"?(it==="backwards"||it==="both")&&(gt=ct?V[V.length-1]:V[0]):(J!=="pending"&&J!=="finished"||it==="forwards"||it==="both")&&(gt=(0,x.getCurrentFrame)(this[d],V,this[B],lt)),gt;}},{key:"timing",get:function get(){return this[d];}},{key:"effects",get:function get(){return this[B];}},{key:"baseTimeline",set:function set(J){this[d].timeline=J;},get:function get(){return this[d].timeline;}},{key:"ready",get:function get(){return this[w]?this[w].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[w]=(0,x.defer)(),this.timeline&&this[A](),this[w]?this[w].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[L]||(this[L]=(0,x.defer)(),this.timeline&&this[b]()),this[L].promise);}}]),X;}();e["default"]=R;},/* 191 *//***/function(u,e,t){u.exports={"default":t(192),__esModule:!0};},/* 192 *//***/function(u,e,t){t(143),t(125),t(79),t(193),t(202),t(203),u.exports=t(92).Promise;},/* 193 *//***/function(u,e,t){var r=t(89),n=t(91),i=t(93),l=t(128),o=t(90),a=t(98),c=t(94),m=t(147),f=t(148),v=t(194),S=t(195).set,E=t(197)(),T=t(198),P=t(199),x=t(200),h=t(201),p="Promise",d=n.TypeError,g=n.process,O=g&&g.versions,w=O&&O.v8||"",_L=n[p],B=l(g)=="process",A=function A(){},b,W,D,R,X=W=T.f,H=!!function(){try{var ct=_L.resolve(1),gt=(ct.constructor={})[t(122)("species")]=function(st){st(A,A);};return(B||typeof PromiseRejectionEvent=="function")&&ct.then(A)instanceof gt&&w.indexOf("6.6")!==0&&x.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),J=function J(ct){var gt;return a(ct)&&typeof(gt=ct.then)=="function"?gt:!1;},et=function et(ct,gt){if(!ct._n){ct._n=!0;var st=ct._c;E(function(){for(var Ct=ct._v,xt=ct._s==1,F=0,U=function U(K){var q=xt?K.ok:K.fail,Y=K.resolve,k=K.reject,C=K.domain,M,j,G;try{q?(xt||(ct._h==2&&V(ct),ct._h=1),q===!0?M=Ct:(C&&C.enter(),M=q(Ct),C&&(C.exit(),G=!0)),M===K.promise?k(d("Promise-chain cycle")):(j=J(M))?j.call(M,Y,k):Y(M)):k(Ct);}catch(Q){C&&!G&&C.exit(),k(Q);}};st.length>F;)U(st[F++]);ct._c=[],ct._n=!1,gt&&!ct._h&&it(ct);});}},it=function it(ct){S.call(n,function(){var gt=ct._v,st=$(ct),Ct,xt,F;if(st&&(Ct=P(function(){B?g.emit("unhandledRejection",gt,ct):(xt=n.onunhandledrejection)?xt({promise:ct,reason:gt}):(F=n.console)&&F.error&&F.error("Unhandled promise rejection",gt);}),ct._h=B||$(ct)?2:1),ct._a=void 0,st&&Ct.e)throw Ct.v;});},$=function $(ct){return ct._h!==1&&(ct._a||ct._c).length===0;},V=function V(ct){S.call(n,function(){var gt;B?g.emit("rejectionHandled",ct):(gt=n.onrejectionhandled)&&gt({promise:ct,reason:ct._v});});},rt=function rt(ct){var gt=this;gt._d||(gt._d=!0,gt=gt._w||gt,gt._v=ct,gt._s=2,gt._a||(gt._a=gt._c.slice()),et(gt,!0));},_lt3=function lt(ct){var gt=this,st;if(!gt._d){gt._d=!0,gt=gt._w||gt;try{if(gt===ct)throw d("Promise can't be resolved itself");(st=J(ct))?E(function(){var Ct={_w:gt,_d:!1};try{st.call(ct,i(_lt3,Ct,1),i(rt,Ct,1));}catch(xt){rt.call(Ct,xt);}}):(gt._v=ct,gt._s=1,et(gt,!1));}catch(Ct){rt.call({_w:gt,_d:!1},Ct);}}};H||(_L=function L(gt){m(this,_L,p,"_h"),c(gt),b.call(this);try{gt(i(_lt3,this,1),i(rt,this,1));}catch(st){rt.call(this,st);}},b=function b(gt){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},b.prototype=t(146)(_L.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
272
- then:function then(gt,st){var Ct=X(v(this,_L));return Ct.ok=typeof gt=="function"?gt:!0,Ct.fail=typeof st=="function"&&st,Ct.domain=B?g.domain:void 0,this._c.push(Ct),this._a&&this._a.push(Ct),this._s&&et(this,!1),Ct.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
273
- "catch":function _catch(ct){return this.then(void 0,ct);}}),D=function D(){var ct=new b();this.promise=ct,this.resolve=i(_lt3,ct,1),this.reject=i(rt,ct,1);},T.f=X=function X(ct){return ct===_L||ct===R?new D(ct):W(ct);}),o(o.G+o.W+o.F*!H,{Promise:_L}),t(121)(_L,p),t(149)(p),R=t(92)[p],o(o.S+o.F*!H,p,{// 25.4.4.5 Promise.reject(r)
274
- reject:function reject(gt){var st=X(this),Ct=st.reject;return Ct(gt),st.promise;}}),o(o.S+o.F*(r||!H),p,{// 25.4.4.6 Promise.resolve(x)
275
- resolve:function resolve(gt){return h(r&&this===R?_L:this,gt);}}),o(o.S+o.F*!(H&&t(140)(function(ct){_L.all(ct)["catch"](A);})),p,{// 25.4.4.1 Promise.all(iterable)
276
- all:function all(gt){var st=this,Ct=X(st),xt=Ct.resolve,F=Ct.reject,U=P(function(){var K=[],q=0,Y=1;f(gt,!1,function(k){var C=q++,M=!1;K.push(void 0),Y++,st.resolve(k).then(function(j){M||(M=!0,K[C]=j,--Y||xt(K));},F);}),--Y||xt(K);});return U.e&&F(U.v),Ct.promise;},// 25.4.4.4 Promise.race(iterable)
277
- race:function race(gt){var st=this,Ct=X(st),xt=Ct.reject,F=P(function(){f(gt,!1,function(U){st.resolve(U).then(Ct.resolve,xt);});});return F.e&&xt(F.v),Ct.promise;}});},/* 194 *//***/function(u,e,t){var r=t(97),n=t(94),i=t(122)("species");u.exports=function(l,o){var a=r(l).constructor,c;return a===void 0||(c=r(a)[i])==null?o:n(c);};},/* 195 *//***/function(u,e,t){var r=t(93),n=t(196),i=t(120),l=t(102),o=t(91),a=o.process,c=o.setImmediate,m=o.clearImmediate,f=o.MessageChannel,v=o.Dispatch,S=0,E={},T="onreadystatechange",P,x,h,p=function p(){var g=+this;if(E.hasOwnProperty(g)){var O=E[g];delete E[g],O();}},d=function d(g){p.call(g.data);};(!c||!m)&&(c=function c(O){for(var w=[],L=1;arguments.length>L;)w.push(arguments[L++]);return E[++S]=function(){n(typeof O=="function"?O:Function(O),w);},P(S),S;},m=function m(O){delete E[O];},t(86)(a)=="process"?P=function P(g){a.nextTick(r(p,g,1));}:v&&v.now?P=function P(g){v.now(r(p,g,1));}:f?(x=new f(),h=x.port2,x.port1.onmessage=d,P=r(h.postMessage,h,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(P=function P(g){o.postMessage(g+"","*");},o.addEventListener("message",d,!1)):T in l("script")?P=function P(g){i.appendChild(l("script"))[T]=function(){i.removeChild(this),p.call(g);};}:P=function P(g){setTimeout(r(p,g,1),0);}),u.exports={set:c,clear:m};},/* 196 *//***/function(u,e){u.exports=function(t,r,n){var i=n===void 0;switch(r.length){case 0:return i?t():t.call(n);case 1:return i?t(r[0]):t.call(n,r[0]);case 2:return i?t(r[0],r[1]):t.call(n,r[0],r[1]);case 3:return i?t(r[0],r[1],r[2]):t.call(n,r[0],r[1],r[2]);case 4:return i?t(r[0],r[1],r[2],r[3]):t.call(n,r[0],r[1],r[2],r[3]);}return t.apply(n,r);};},/* 197 *//***/function(u,e,t){var r=t(91),n=t(195).set,i=r.MutationObserver||r.WebKitMutationObserver,l=r.process,o=r.Promise,a=t(86)(l)=="process";u.exports=function(){var c,m,f,v=function v(){var P,x;for(a&&(P=l.domain)&&P.exit();c;){x=c.fn,c=c.next;try{x();}catch(h){throw c?f():m=void 0,h;}}m=void 0,P&&P.enter();};if(a)f=function f(){l.nextTick(v);};else if(i&&!(r.navigator&&r.navigator.standalone)){var S=!0,E=document.createTextNode("");new i(v).observe(E,{characterData:!0}),f=function f(){E.data=S=!S;};}else if(o&&o.resolve){var T=o.resolve(void 0);f=function f(){T.then(v);};}else f=function f(){n.call(r,v);};return function(P){var x={fn:P,next:void 0};m&&(m.next=x),c||(c=x,f()),m=x;};};},/* 198 *//***/function(u,e,t){var r=t(94);function n(i){var l,o;this.promise=new i(function(a,c){if(l!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");l=a,o=c;}),this.resolve=r(l),this.reject=r(o);}u.exports.f=function(i){return new n(i);};},/* 199 *//***/function(u,e){u.exports=function(t){try{return{e:!1,v:t()};}catch(r){return{e:!0,v:r};}};},/* 200 *//***/function(u,e,t){var r=t(91),n=r.navigator;u.exports=n&&n.userAgent||"";},/* 201 *//***/function(u,e,t){var r=t(97),n=t(98),i=t(198);u.exports=function(l,o){if(r(l),n(o)&&o.constructor===l)return o;var a=i.f(l),c=a.resolve;return c(o),a.promise;};},/* 202 *//***/function(u,e,t){var r=t(90),n=t(92),i=t(91),l=t(194),o=t(201);r(r.P+r.R,"Promise",{"finally":function _finally(a){var c=l(this,n.Promise||i.Promise),m=typeof a=="function";return this.then(m?function(f){return o(c,a()).then(function(){return f;});}:a,m?function(f){return o(c,a()).then(function(){throw f;});}:a);}});},/* 203 *//***/function(u,e,t){var r=t(90),n=t(198),i=t(199);r(r.S,"Promise",{"try":function _try(l){var o=n.f(this),a=i(l);return(a.e?o.reject:o.resolve)(a.v),o.promise;}});},/* 204 *//***/function(u,e,t){u.exports={"default":t(205),__esModule:!0};},/* 205 *//***/function(u,e,t){t(206),u.exports=t(92).Object.keys;},/* 206 *//***/function(u,e,t){var r=t(124),n=t(110);t(207)("keys",function(){return function(l){return n(r(l));};});},/* 207 *//***/function(u,e,t){var r=t(90),n=t(92),i=t(101);u.exports=function(l,o){var a=(n.Object||{})[l]||Object[l],c={};c[l]=o(a),r(r.S+r.F*i(function(){a(1);}),"Object",c);};},/* 208 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=E(r),i=t(209),l=E(i),o=t(164),a=E(o),c=t(191),m=E(c);e.defer=T,e.periodicity=P,e.calculateFramesOffset=x,e.getProgress=h,e.getCurrentFrame=d;var f=t(188),v=t(187),S=E(v);function E(g){return g&&g.__esModule?g:{"default":g};}function T(){var g={};return g.promise=new m["default"](function(O,w){g.resolve=O,g.reject=w;}),g;}function P(g,O){var w=Math.floor(g/O),L=g-w*O;return L===0&&w>0&&(L=O,w--),[w,L];}function x(g){g=g.slice(0);var O=g[0],w=g[g.length-1];w.offset=w.offset||1,O.offset=O.offset||0;for(var L=0,B=-1,A=0;A<g.length;A++){var b=g[A];if(b.offset!=null){var W=A-B;if(W>1)for(var D=(b.offset-L)/W,R=0;R<W-1;R++)g[B+R+1].offset=L+D*(R+1);L=b.offset,B=A;}if(b.easing!=null&&(b.easing=(0,f.parseEasing)(b.easing)),A>0){var X=g[A].easing!=null;g[A]=(0,a["default"])({},g[A-1],g[A]),X||delete g[A].easing;}}return g;}function h(g,O,w){var L=g.currentTime,B=O.direction,A=O.duration,b=!1;if(B==="reverse")w=1-w,b=!0;else if(B==="alternate"||B==="alternate-reverse"){var W=Math.floor(L/A);w===1&&W--,W%2^B==="alternate-reverse"&&(w=1-w,b=!0);}return{p:w,inverted:b};}function p(g,O,w,L){var B={};return(0,l["default"])(O).forEach(function(A){var b=(0,n["default"])(A,2),W=b[0],D=b[1];if(W!=="offset"&&W!=="easing"){var R=w[W]||w["default"],X=R(g[W],D,L,g.offset,O.offset);X!=null&&(B[W]=X);}}),B;}function d(g,O,w,L){var B=g.easing,A=g.effect;A||(w=(0,a["default"])({},S["default"],w));var b={};L=B(L,O);for(var W=1;W<O.length;W++){var D=O[W],R=D.offset;if(R>=L||W===O.length-1){var X=O[W-1],H=X.offset,J=X.easing,et=L;if(J){var it=R-H;et=J((L-H)/it)*it+H;}A?b=A(X,D,et,H,R):b=p(X,D,w,et);break;}}return b;}},/* 209 *//***/function(u,e,t){u.exports={"default":t(210),__esModule:!0};},/* 210 *//***/function(u,e,t){t(211),u.exports=t(92).Object.entries;},/* 211 *//***/function(u,e,t){var r=t(90),n=t(212)(!0);r(r.S,"Object",{entries:function entries(l){return n(l);}});},/* 212 *//***/function(u,e,t){var r=t(100),n=t(110),i=t(84),l=t(169).f;u.exports=function(o){return function(a){for(var c=i(a),m=n(c),f=m.length,v=0,S=[],E;f>v;)E=m[v++],(!r||l.call(c,E))&&S.push(o?[E,c[E]]:c[E]);return S;};};},/* 213 *//***/function(u,e,t){t.r(e),t(1).glMatrix.setMatrixArrayType(Array);var r=/* @__PURE__ */new Map();function n(l){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];l=l.toLowerCase();var c=r.get(l);if(!c)throw new TypeError("Invalid node: ".concat(l));var m=new c(o);return a.forEach(function(f){m.appendChild(f);}),m;}var i={registerNode:function registerNode(l,o){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(o=o.toLowerCase(),r.has(o))throw new TypeError("Cannot registerNode, ".concat(o," has been taken."));r.set(o,l),Object.defineProperties(l.prototype,{nodeType:{value:a},tagName:{value:o.toUpperCase()},nodeName:{value:o},ownerDocument:{value:i},namespaceURI:{value:"http://spritejs.com/".concat(o)}});},createElement:n,createElementNS:function createElementNS(l,o){return n(o);},isSpriteNode:function isSpriteNode(l){return r.has(l.toLowerCase());}};e["default"]=i;},/* 214 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),l=Symbol("detail");var o=/*#__PURE__*/function(){function o(c){var _ref114=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref114$bubbles=_ref114.bubbles,m=_ref114$bubbles===void 0?null:_ref114$bubbles;_classCallCheck(this,o);if(typeof c=="string"?(this[r]=c,this[n]=!!m):(this[r]=c.type,this[i]=c,this[n]=m!=null?!!m:!!c.bubbles,c.detail&&(this[l]=c.detail)),!this[r])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{key:"setOriginalEvent",value:function setOriginalEvent(c){this[i]=c;}},{key:"originalEvent",get:function get(){return this[i];}},{key:"type",get:function get(){return this[r];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[l];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 *//***/function(u,e,t){t.r(e),t.d(e,"parseFilterString",function(){return n;}),t.d(e,"applyFilters",function(){return i;});var r=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(l){if(l=l.trim(),!l||l==="none")return null;var o=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,a=l.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),c=[];return a&&a.forEach(function(m){var f=m.match(o);if(!f)throw new TypeError("Invalid fitler string.");var _f3=_slicedToArray(f,3),v=_f3[1],S=_f3[2];v=v.toLowerCase(),S=S.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(E,T){var P;return v==="url"||v==="drop-shadow"&&T===3?P=E:P=Object(r.toNumber)(E),/%$/.test(E)&&(P/=100),P;}),c.push({type:v,args:S});}),c;}function i(l,o){l.clearFilter(),o&&o.forEach(function(_ref115){var a=_ref115.type,c=_ref115.args;var m=a;m==="drop-shadow"?m="dropShadow":m==="hue-rotate"&&(m="hueRotate"),l[m].apply(l,_toConsumableArray(c));});}},/* 216 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n,i){if(!i)return;var l=n.getListeners("beforerender"),o=n.getListeners("afterrender");l.length&&!i.beforeRender?i.beforeRender=function(a){n.dispatchEvent({type:"beforerender",detail:{context:a}});}:l.length||(i.beforeRender=null),o.length&&!i.afterRender?i.afterRender=function(a){n.dispatchEvent({type:"afterrender",detail:{context:a}});}:o.length||(i.afterRender=null);}},/* 217 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(12),n=t(218),i=t(70),l=t(213);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("amount"),a=Symbol("meshCloud");var c=/*#__PURE__*/function(_i$default){function c(f){var _this15;var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,c);_this15=_callSuper(this,c),_this15.meshNode=f,f.connect(_assertThisInitialized(_this15)),_this15[o]=v,_this15[a]=null;return _this15;}_inherits(c,_i$default);return _createClass(c,[{key:"meshCloud",get:function get(){var f=this.meshNode,v=this[o];return!this[a]&&f.mesh&&(this[a]=new r.MeshCloud(f.mesh,v)),this[a];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[o];},set:function set(f){this[o]=f,this[a]&&(this[a].amount=f);}},{key:"brightness",value:function brightness(f,v){this.meshCloud&&(this.meshCloud.brightness(f,v),this.forceUpdate());}},{key:"contrast",value:function contrast(f,v){this.meshCloud&&(this.meshCloud.contrast(f,v),this.forceUpdate());}},{key:"delete",value:function _delete(f){this.meshCloud&&(this.meshCloud["delete"](f),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this16=this;var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_superPropGet(c,"draw",this,3)([f]),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var v=this.shaderAttrs;v&&Object.entries(v).forEach(function(_ref116){var _ref117=_slicedToArray(_ref116,2),E=_ref117[0],T=_ref117[1];_this16.meshCloud.mesh.setAttribute(E,T);});var S=this.uniforms;if(this.uniforms){var E={};Object.entries(S).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),T=_ref119[0],P=_ref119[1];typeof P=="function"&&(P=P(_this16,T)),E[T]=P;}),this.meshCloud.mesh.setUniforms(E);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),f.push(this.meshCloud);}return f;}},{key:"getTransform",value:function getTransform(f){if(this.meshCloud)return this.meshCloud.getTransform(f);}},{key:"grayscale",value:function grayscale(f,v){this.meshCloud&&(this.meshCloud.grayscale(f,v),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(f,v){this.meshCloud&&(this.meshCloud.hueRotate(f,v),this.forceUpdate());}},{key:"invert",value:function invert(f,v){this.meshCloud&&(this.meshCloud.invert(f,v),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(f,v){if(!this.meshCloud)return!1;var S=this.attributes.pointerEvents;if(S==="none"||S!=="all"&&!this.isVisible)return!1;var E="both";S==="visibleFill"&&(E="fill"),S==="visibleStroke"&&(E="stroke");for(var T=0;T<this[o];T++)if(!this.meshCloud.isPointCollision(T,[f,v],E))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(f,v){this.meshCloud&&(this.meshCloud.opacity(f,v),this.forceUpdate());}},{key:"rotate",value:function rotate(f,v){var _ref120=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref121=_slicedToArray(_ref120,2),S=_ref121[0],E=_ref121[1];var T=Math.PI*v/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,P=_this$meshNode$attrib.x,_x19=_this$meshNode$attrib.y;this.meshCloud.rotate(f,T,[S+P,E+_x19]),this.forceUpdate();}}},{key:"saturate",value:function saturate(f,v){this.meshCloud&&(this.meshCloud.saturate(f,v),this.forceUpdate());}},{key:"scale",value:function scale(f,_ref122){var _ref123=_slicedToArray(_ref122,2),v=_ref123[0],_ref123$=_ref123[1],S=_ref123$===void 0?v:_ref123$;var _ref124=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref125=_slicedToArray(_ref124,2),E=_ref125[0],T=_ref125[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,P=_this$meshNode$attrib2.x,_x20=_this$meshNode$attrib2.y,_h12=1e-5;Math.abs(v)<_h12&&(v=1/v>0?_h12:-_h12),Math.abs(S)<_h12&&(S=1/S>0?_h12:-_h12),this.meshCloud.scale(f,[v,S],[E+P,T+_x20]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(f,v){this.meshCloud&&(this.meshCloud.setColorTransform(f,v),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(f,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setFillColor(f,v),this.forceUpdate());}},{key:"sepia",value:function sepia(f,v){this.meshCloud&&(this.meshCloud.sepia(f,v),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref126){var f=_ref126.width,v=_ref126.height;_superPropGet(c,"setResolution",this,3)([{width:f,height:v}]),this.meshNode.setResolution({width:f,height:v});}},{key:"setStrokeColor",value:function setStrokeColor(f,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setStrokeColor(f,v),this.forceUpdate());}},{key:"setTransform",value:function setTransform(f,v){this.meshCloud&&(this.meshCloud.setTransform(f,v),this.forceUpdate());}},{key:"skew",value:function skew(f,_ref127){var _ref128=_slicedToArray(_ref127,2),v=_ref128[0],_ref128$=_ref128[1],S=_ref128$===void 0?v:_ref128$;var _ref129=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref130=_slicedToArray(_ref129,2),E=_ref130[0],T=_ref130[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,P=_this$meshNode$attrib3.x,_x21=_this$meshNode$attrib3.y;this.meshCloud.skew(f,[v,S],[E+P,T+_x21]),this.forceUpdate();}}},{key:"transform",value:function transform(f,v){this.meshCloud&&(this.meshCloud.transform(f,v),this.forceUpdate());}},{key:"transformColor",value:function transformColor(f,v){this.meshCloud&&(this.meshCloud.transformColor(f,v),this.forceUpdate());}},{key:"translate",value:function translate(f,_ref131){var _ref132=_slicedToArray(_ref131,2),v=_ref132[0],S=_ref132[1];this.meshCloud&&(this.meshCloud.translate(f,[v,S]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[a]&&(this[a].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);l["default"].registerNode(c,"cloud");},/* 218 *//***/function(u,e,t){t.r(e),t.d(e,"loadTexture",function(){return l;}),t.d(e,"applyTexture",function(){return o;}),t.d(e,"createTexture",function(){return c;}),t.d(e,"deleteTexture",function(){return m;}),t.d(e,"drawTexture",function(){return v;}),t.d(e,"loadFrames",function(){return S;});var r=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function l(E,T){if(i[E])return i[E];var P=r.ENV.loadImage(E,{alias:T,useImageBitmap:!1});return P!==null&&P!==void 0?P:E;}function o(_x22,_x23,_x24){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(E,T,P){var x,_E$attributes,_h13,p,d,g;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:x=T;typeof T=="string"&&(x=l(T));_context8.t0=x&&typeof x.then=="function";if(!_context8.t0){_context8.next=7;break;}_context8.next=6;return x;case 6:x=_context8.sent;case 7:if(!(T===E.attributes.texture)){_context8.next=11;break;}x&&x.image&&(x.sourceRect&&(E.attributes.sourceRect=x.sourceRect),E.textureImageRotated=!!x.rotated,x=x.image);_E$attributes=E.attributes,_h13=_E$attributes.width,p=_E$attributes.height,d=_E$attributes.textureRect,g=E.textureImage;E.textureImage=x,P&&g!==x&&!d&&(_h13==null||p==null)&&E.updateContours(),E.forceUpdate();case 11:return _context8.abrupt("return",x);case 12:case"end":return _context8.stop();}},_callee8);}));return _o2.apply(this,arguments);}var a=Symbol("textureMap");function c(E,T){if(T[a]=T[a]||/* @__PURE__ */new Map(),T[a].has(E))return T[a].get(E);var P=T.createTexture(E);return!/^blob:/.test(E.src)&&typeof E.getContext!="function"&&T[a].set(E,P),P;}function m(E,T){if(T[a]&&T[a].has(E)){var P=T[a].get(E);return T.deleteTexture(P),T[a]["delete"](E),!0;}return!1;}var f=Symbol("textureContext");function v(E,T){var P=E.textureImage instanceof String?String(E.textureImage):E.textureImage,x=E.textureImageRotated,h=T.texture,p=E.renderer;if(P){var d=E.originalContentRect;var g=E.attributes.textureRect;var O=E.attributes.textureRepeat,w=E.attributes.sourceRect;if(!h||E[f]&&E[f]!==p||h.image!==P||h.options.repeat!==O||!Object(n.compareValue)(h.options.rect,g)||!Object(n.compareValue)(h.options.srcRect,w)){var L=c(P,p);g?(g[0]+=d[0],g[1]+=d[1]):g=d;var B=null;h&&!p[a].has(h.image)&&(!h.options||!h.options.hidden)&&(B=T.uniforms.u_texSampler),T.setTexture(L,{rect:g,repeat:O,srcRect:w,rotated:x}),B&&B["delete"]&&B["delete"](),E[f]=p;}}else if(h){var _d8=null;!p[a].has(h.image)&&(!h.options||!h.options.hidden)&&(_d8=T.uniforms.u_texSampler),T.setTexture(null),_d8&&_d8["delete"]&&_d8["delete"]();}}function S(_x25,_x26){return _S5.apply(this,arguments);}function _S5(){_S5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(E,T){var P,x;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.t0=typeof T=="string";if(!_context9.t0){_context9.next=7;break;}_context9.next=4;return fetch(T,{method:"GET",mode:"cors",cache:"default"});case 4:_context9.next=6;return _context9.sent.json();case 6:T=_context9.sent;case 7:_context9.next=9;return l(E);case 9:P=_context9.sent;x=T.frames;return _context9.abrupt("return",(Object.entries(x).forEach(function(_ref133){var _ref134=_slicedToArray(_ref133,2),h=_ref134[0],p=_ref134[1];var _p$frame=p.frame,d=_p$frame.x,g=_p$frame.y,O=_p$frame.w,w=_p$frame.h;var L=[d,g,O,w];var B=p.rotated;B&&(L=[L[0],L[1],L[3],L[2]]),i[h]={image:P,sourceRect:L,rotated:B};}),P));case 12:case"end":return _context9.stop();}},_callee9);}));return _S5.apply(this,arguments);}},/* 219 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return S;});var r=t(1),n=t(12),i=t(70),l=t(220),o=t(221),a=t(222),c=t(213),m=t(223);t(1).glMatrix.setMatrixArrayType(Array);function f(E,T,P){return T in E?Object.defineProperty(E,T,{value:P,enumerable:!0,configurable:!0,writable:!0}):E[T]=P,E;}var v=Symbol("mesh");var S=/*#__PURE__*/function(_i$default2){function S(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,S);return _callSuper(this,S,[T]);}_inherits(S,_i$default2);return _createClass(S,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,T=_this$attributes2.paddingTop,P=_this$attributes2.paddingRight,x=_this$attributes2.paddingBottom,h=_this$attributes2.paddingLeft,p=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),d=_this$contentSize[0],g=_this$contentSize[1];return[h+d+P+p,T+g+x+p];}// content + padding
278
- },{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,T=_this$attributes3.paddingTop,P=_this$attributes3.paddingRight,x=_this$attributes3.paddingBottom,h=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),p=_this$contentSize2[0],d=_this$contentSize2[1];return[h+p+P,T+d+x];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,T=_this$attributes4.width,P=_this$attributes4.height,x=_this$attributes4.boxSizing,h=_this$attributes4.paddingTop,p=_this$attributes4.paddingRight,d=_this$attributes4.paddingBottom,g=_this$attributes4.paddingLeft;if(T=T||0,P=P||0,x==="border-box"){var O=2*this.attributes.borderWidth;T-=O+p+g,P-=O+h+d,T=Math.max(0,T),P=Math.max(0,P);}return[T,P];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),T=_this$borderSize[0],P=_this$borderSize[1];return T>0&&P>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var T=this.clientBox;if(T){var _P5;var P=this[v];if(P)P.box!==T&&(P.contours=T.contours,P.box=T);else{P=new n.Mesh2D(T),P.box=T;var _h14=this.attributes.bgcolor;if(Object(o.setFillColor)(P,{color:_h14}),this.hasBorder){var _this$attributes5=this.attributes,d=_this$attributes5.borderColor,g=_this$attributes5.borderWidth,O=_this$attributes5.borderDash,w=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(P,{color:d,lineWidth:g,lineDash:O,lineDashOffset:w});}this[v]=P;var p=this.attributes.clipPath;p&&this[v].setClipPath(p);}var _x27=this.opacity;return P.getOpacity()!==_x27&&P.setOpacity(_x27),(_P5=P).setTransform.apply(_P5,_toConsumableArray(this.renderMatrix)),P;}return null;}// content + padding + border
279
- },{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,T=_this$attributes6.paddingTop,P=_this$attributes6.paddingRight,x=_this$attributes6.paddingBottom,h=_this$attributes6.paddingLeft,p=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),d=_this$contentSize3[0],g=_this$contentSize3[1],O=2*p;return[h+d+P+O,T+g+x+O];}},{key:"originalClientRect",get:function get(){if(this.mesh){var T=this.mesh.boundingBox;return[T[0][0],T[0][1],T[1][0]-T[0][0],T[1][1]-T[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),T=_this$originalClientR[0],P=_this$originalClientR[1],x=_this$originalClientR[2],h=_this$originalClientR[3],p=this.attributes.padding;return[T+p[0],P+p[1],x-p[0]-p[2],h-p[1]-p[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var T=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(T=r.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,T));var P=null;if(this.mesh){P=_toConsumableArray(this.mesh.boundingBox);var _x28=this.attributes.borderWidth;_x28&&(P[0]=[P[0][0]-_x28,P[0][1]-_x28],P[1]=[P[1][0]+_x28,P[1][1]+_x28]);}return Object(m["default"])(P,T);}// transformPoint(x, y) {
280
- // const m = mat2d.invert(this.renderMatrix);
281
- // const newX = x * m[0] + y * m[2] + m[4];
282
- // const newY = x * m[1] + y * m[3] + m[5];
283
- // return [newX, newY];
284
- // }
285
- /* override */},{key:"onPropertyChange",value:function onPropertyChange(T,P,x){if(_superPropGet(S,"onPropertyChange",this,3)([T,P,x]),(T==="anchorX"||T==="anchorY"||T==="boxSizing"||T==="width"||T==="height"||T==="borderWidth"||T==="paddingLeft"||T==="paddingRight"||T==="paddingTop"||T==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(T))&&this.updateContours(),this[v]&&T==="clipPath"&&this[v].setClipPath(P),this[v]&&T==="bgcolor"&&Object(o.setFillColor)(this[v],{color:P}),this[v]&&(T==="borderColor"||T==="borderWidth"||T==="borderDash"||T==="borderDashOffset")){var _this$attributes7=this.attributes,_h15=_this$attributes7.borderColor,p=_this$attributes7.borderWidth,d=_this$attributes7.borderDash,g=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[v],{color:_h15,lineWidth:p,lineDash:p?d:0,lineDashOffset:g});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,T=_this$attributes8.anchorX,P=_this$attributes8.anchorY,x=_this$attributes8.borderWidth,h=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),p=_this$borderSize2[0],d=_this$borderSize2[1],g=this.offsetSize,O=0.5*x,w=-T*g[0]+O,L=-P*g[1]+O;this.clientBox=new n.Figure2D(),Object(a.createRadiusBox)(this.clientBox,[w,L,p,d],h);}}]);}(i["default"]);f(S,"Attr",l["default"]),c["default"].registerNode(S,"block");},/* 220 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return m;});var r=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),a=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_declareAlias");var m=/*#__PURE__*/function(_r$default){function m(v){var _this17;_classCallCheck(this,m);_this17=_callSuper(this,m,[v]),_this17[a]({anchorX:0,anchorY:0,/* anchor */width:void 0,height:void 0,/* size */borderWidth:0,borderColor:"rgba(0,0,0,1)",/* border */borderDash:void 0,borderDashOffset:0,borderTopLeftRadius:[0,0],borderTopRightRadius:[0,0],borderBottomRightRadius:[0,0],borderBottomLeftRadius:[0,0],/* borderRadius */bgcolor:"rgba(0,0,0,0)",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,/* padding */boxSizing:"content-box",clipPath:void 0}),_this17[c]("anchor","size","border","borderRadius","padding");return _this17;}_inherits(m,_r$default);return _createClass(m,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(v){this[l]("anchorX",Object(n.toNumber)(v));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(v){this[l]("anchorY",Object(n.toNumber)(v));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.anchorX=v[0],this.anchorY=v[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(v){this[l]("width",Object(n.toNumber)(v));}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){this[l]("height",Object(n.toNumber)(v));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(v){this[l]("borderWidth",Object(n.toNumber)(v));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(v){this[l]("borderColor",Object(i.parseColor)(v));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v]),this.borderWidth=v[0],v[1]!=null&&(this.borderColor=v[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(v){v=Object(n.toArray)(v,!0),v!=null&&!Array.isArray(v)&&(v=[v]),this[l]("borderDash",v?v.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(v){this[l]("borderDashOffset",Object(n.toNumber)(v));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[l]("borderTopLeftRadius",v.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[l]("borderTopRightRadius",v.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[l]("borderBottomRightRadius",v.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[l]("borderBottomLeftRadius",v.map(n.toNumber));}},{key:"borderRadius",get:function get(){return[].concat(_toConsumableArray(this.borderTopLeftRadius),_toConsumableArray(this.borderTopRightRadius),_toConsumableArray(this.borderBottomRightRadius),_toConsumableArray(this.borderBottomLeftRadius));},set:function set(v){if(v=Object(n.toArray)(v),!Array.isArray(v))v=Array(8).fill(v);else if(v.length===2)v=[v[0],v[1],v[0],v[1],v[0],v[1],v[0],v[1]];else if(v.length===4)v=[v[0],v[1],v[2],v[3],v[0],v[1],v[2],v[3]];else if(v.length===6)v=[v[0],v[1],v[2],v[3],v[4],v[5],v[2],v[3]];else if(v.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[v[0],v[1]],this.borderTopRightRadius=[v[2],v[3]],this.borderBottomRightRadius=[v[4],v[5]],this.borderBottomLeftRadius=[v[6],v[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(v){this[l]("bgcolor",Object(i.parseColor)(v));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(v){this[l]("paddingTop",Object(n.toNumber)(v));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(v){this[l]("paddingRight",Object(n.toNumber)(v));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(v){this[l]("paddingBottom",Object(n.toNumber)(v));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(v){this[l]("paddingLeft",Object(n.toNumber)(v));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)?v.length===2?v=[v[0],v[1],v[0],v[1]]:v.length===3&&(v=[v[0],v[1],v[2],v[1]]):v=[v,v,v,v],this.paddingTop=v[0],this.paddingRight=v[1],this.paddingBottom=v[2],this.paddingLeft=v[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(v){this[l]("clipPath",v);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(v){if(v!=null&&v!=="border-box"&&v!=="content-box")throw new TypeError("Invalid boxSizing type.");this[l]("boxSizing",v);}}]);}(r["default"]);},/* 221 *//***/function(u,e,t){t.r(e),t.d(e,"Gradient",function(){return i;}),t.d(e,"isTransparent",function(){return l;}),t.d(e,"parseColor",function(){return o;}),t.d(e,"setFillColor",function(){return c;}),t.d(e,"setStrokeColor",function(){return m;}),t.d(e,"Color",function(){return f;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref135){var S=_ref135.vector,E=_ref135.colors;_classCallCheck(this,i);if(!Array.isArray(S)||S.length!==4&&S.length!==6&&S.length!==3)throw new TypeError("Invalid gradient");this.vector=S,this.colors=E.map(function(_ref136){var T=_ref136.offset,P=_ref136.color;return{offset:T,color:o(P)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function l(v){return v instanceof i?!1:v==null?!0:n()(v)[3]===0;}function o(v){if(v==null||(v||(v="transparent"),v instanceof i))return v;var S=n()(v);if(!S||!S.length)throw new TypeError("Invalid color value.");return"rgba(".concat(S.join(),")");}function a(v,S,E){var T=v.boundingBox[0];if(E.vector){var P=E.vector,_x29=E.colors;P.length===4?(P=[P[0]+T[0],P[1]+T[1],P[2]+T[0],P[3]+T[1]],v.setLinearGradient({vector:P,colors:_x29,type:S})):P.length===3?(P=[P[0]+T[0],P[1]+T[1],P[2]],v.setCircularGradient({vector:P,colors:_x29,type:S})):(P=[P[0]+T[0],P[1]+T[1],P[2],P[3]+T[0],P[4]+T[1],P[5]],v.setRadialGradient({vector:P,colors:_x29,type:S}));}else v.gradient&&v.gradient[S]&&(delete v.gradient[S],delete v.uniforms.u_radialGradientVector);}function c(v,_ref137){var S=_ref137.color,_ref137$rule=_ref137.rule,E=_ref137$rule===void 0?"nonzero":_ref137$rule;return a(v,"fill",S),S.vector||v.setFill({color:S,rule:E}),v;}function m(v,_ref138){var S=_ref138.color,E=_ref138.lineWidth,T=_ref138.lineCap,P=_ref138.lineJoin,x=_ref138.lineDash,h=_ref138.lineDashOffset,p=_ref138.miterLimit,d=_ref138.roundSegments;a(v,"stroke",S),S.vector&&(S=[0,0,0,1]),v.setStroke({color:S,thickness:E,cap:T,join:P,miterLimit:p,lineDash:x,lineDashOffset:h,roundSegments:d});}var f=/*#__PURE__*/function(_Array){function f(){var _S6,_S7,_n2,_n3;var _this18;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var E=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var P=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,f);return _possibleConstructorReturn(_this18,(Array.isArray(S)&&(_S6=S,_S7=_slicedToArray(_S6,4),S=_S7[0],E=_S7[1],T=_S7[2],P=_S7[3],_S6),typeof S=="string"&&(_n2=n()(S),_n3=_slicedToArray(_n2,4),S=_n3[0],E=_n3[1],T=_n3[2],P=_n3[3],S/=255,E/=255,T/=255),_this18=_callSuper(this,f,[S,E,T,P]),_assertThisInitialized(_this18)));}_inherits(f,_Array);return _createClass(f,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(S){this[0]=S/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(S){this[1]=S/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(S){this[2]=S/255;}},{key:"a",get:function get(){return this[3];},set:function set(S){this[3]=S;}},{key:"hex",get:function get(){var S="0".concat(this.r.toString(16)).slice(-2),E="0".concat(this.g.toString(16)).slice(-2),T="0".concat(this.b.toString(16)).slice(-2);var P;return this.a<1&&(P=Math.round(this[3]*255),P="0".concat(P.toString(16)).slice(-2)),"#".concat(S).concat(E).concat(T).concat(P||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(S){return typeof S=="string"&&(S=n()(S),S[0]/=255,S[1]/=255,S[2]/=255),this[0]=S[0],this[1]=S[1],this[2]=S[2],this[3]=S[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 *//***/function(u,e,t){t.r(e),t.d(e,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function r(i,l,o,a,c){var m=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var f=0.5522848,v=a/2*f,S=c/2*f,E=l+a,T=o+c,P=l+a/2,x=o+c/2;m==="leftTop"?(i.moveTo(l,x),i.bezierCurveTo(l,x-S,P-v,o,P,o)):m==="rightTop"?i.bezierCurveTo(P+v,o,E,x-S,E,x):m==="rightBottom"?i.bezierCurveTo(E,x+S,P+v,T,P,T):m==="leftBottom"&&i.bezierCurveTo(P-v,T,l,x+S,l,x);}function n(i,_ref139,m){var _ref140=_slicedToArray(_ref139,4),l=_ref140[0],o=_ref140[1],a=_ref140[2],c=_ref140[3];if(!m||Array.isArray(m)&&m.every(function(f){return f===0;}))i.beginPath(),i.rect(l,o,a,c);else{typeof m=="number"&&(m=Array(8).fill(m));var _m$map=m.map(function(p,d){return d%2?Math.min(p,c/2):Math.min(p,a/2);}),_m$map2=_slicedToArray(_m$map,8),f=_m$map2[0],v=_m$map2[1],S=_m$map2[2],E=_m$map2[3],T=_m$map2[4],P=_m$map2[5],_x30=_m$map2[6],_h16=_m$map2[7];i.beginPath(),i.moveTo(l,o+v),r(i,l,o,f*2,v*2,"leftTop"),i.lineTo(l+a-S,o),r(i,l+a-S*2,o,S*2,E*2,"rightTop"),i.lineTo(l+a,o+c-P),r(i,l+a-T*2,o+c-P*2,T*2,P*2,"rightBottom"),i.lineTo(l+_x30,o+c),r(i,l,o+c-_h16*2,_x30*2,_h16*2,"leftBottom"),i.closePath();}return i;}},/* 223 *//***/function(u,e,t){t.r(e),t(1).glMatrix.setMatrixArrayType(Array),e["default"]=function(r,n){if(!r)return{x:0,y:0,width:0,height:0,left:0,top:0,right:0,bottom:0};var _r2=_slicedToArray(r,2),_r2$=_slicedToArray(_r2[0],2),i=_r2$[0],l=_r2$[1],_r2$2=_slicedToArray(_r2[1],2),o=_r2$2[0],a=_r2$2[1],c=i*n[0]+l*n[2]+n[4],m=i*n[1]+l*n[3]+n[5],f=o*n[0]+l*n[2]+n[4],v=o*n[1]+l*n[3]+n[5],S=o*n[0]+a*n[2]+n[4],E=o*n[1]+a*n[3]+n[5],T=i*n[0]+a*n[2]+n[4],P=i*n[1]+a*n[3]+n[5],x=Math.min(c,f,S,T),h=Math.min(m,v,E,P),p=Math.max(c,f,S,T),d=Math.max(m,v,E,P);return{x:x,y:h,width:p-x,height:d-h,left:x,top:h,right:p,bottom:d};};},/* 224 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(218),n=t(219),i=t(225),l=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(m,f,v){return f in m?Object.defineProperty(m,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):m[f]=v,m;}var a=Symbol("textureTask");var c=/*#__PURE__*/function(_n$default){function c(){var _this19;var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,c);typeof f=="string"&&(f={texture:f}),_this19=_callSuper(this,c,[f]);return _this19;}/* override */_inherits(c,_n$default);return _createClass(c,[{key:"contentSize",get:function get(){var _superPropGet2=_superPropGet(c,"contentSize",this,1),_superPropGet3=_slicedToArray(_superPropGet2,2),f=_superPropGet3[0],v=_superPropGet3[1];var _this$attributes9=this.attributes,S=_this$attributes9.width,E=_this$attributes9.height;if(S==null||E==null){var T=this.textureImage,P=this.attributes.textureRect,_x31=this.attributes.sourceRect;if(P)S==null&&(f=P[0]+P[2]),E==null&&(v=P[1]+P[3]);else if(_x31){var _h17=this.layer?this.layer.displayRatio:1;S==null&&(f=_x31[2]/_h17),E==null&&(v=_x31[3]/_h17);}else if(T){var _h18=this.layer?this.layer.displayRatio:1;S==null&&(f=T.width/_h18),E==null&&(v=T.height/_h18);}}return[f,v];}},{key:"textureImageReady",get:function get(){return this[a]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(c,"draw",this,3)([f]);var v=this.mesh;return v&&Object(r.drawTexture)(this,v),f;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(f,v,S){if(_superPropGet(c,"onPropertyChange",this,3)([f,v,S]),f==="texture"&&(this[a]=Object(r.applyTexture)(this,v,!0)),f==="textureRect"){var _this$attributes10=this.attributes,E=_this$attributes10.width,T=_this$attributes10.height;(E==null||T==null)&&this.updateContours();}}}]);}(n["default"]);o(c,"Attr",i["default"]),l["default"].registerNode(c,"sprite");},/* 225 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),i=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");var o=/*#__PURE__*/function(_r$default2){function o(c){var _this20;_classCallCheck(this,o);_this20=_callSuper(this,o,[c]),_this20[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this20;}_inherits(o,_r$default2);return _createClass(o,[{key:"texture",get:function get(){return this[l]("texture");},set:function set(c){this[i]("texture",c);}},{key:"textureRect",get:function get(){return this[l]("textureRect");},set:function set(c){this[i]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[l]("sourceRect");},set:function set(c){this[i]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[l]("textureRepeat");},set:function set(c){this[i]("textureRepeat",!!c);}}]);}(r["default"]);},/* 226 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return E;});var r=t(12),n=t(227),i=/* @__PURE__ */t.n(n),l=t(70),o=t(228),a=t(221),c=t(218),m=t(213),f=t(223);t(1).glMatrix.setMatrixArrayType(Array);function v(T,P,x){return P in T?Object.defineProperty(T,P,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[P]=x,T;}var S=Symbol("mesh");var E=/*#__PURE__*/function(_l$default){function E(){var _this21;var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,E);typeof P=="string"&&(P={d:P}),_this21=_callSuper(this,E,[P]),_this21.effects={d:function d(x,h,p,_d9,g){var _i$a;var O=(p-_d9)/(g-_d9);if(O<=0)return x;if(O>=1)return h;var w=i.a._preprocessing(i.a.path2shapes(x),i.a.path2shapes(h)),L=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(w).concat([O]))[0];return L.reduce(function(A,b){return"".concat(A).concat(b.slice(2).join(" ")," ");},"M".concat(L[0][0]," ").concat(L[0][1],"C")).trim();}};return _this21;}/* override */_inherits(E,_l$default);return _createClass(E,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var P=this.path;if(P){var _x33;var _x32=this[S];if(_x32)_x32.path!==P&&(_x32.contours=P.contours,_x32.path=P);else{_x32=new r.Mesh2D(this.path),_x32.path=P;var p=this.attributes.fillColor,d=this.attributes.fillRule;p&&Object(a.setFillColor)(_x32,{color:p,rule:d});var g=this.attributes.lineWidth,O=this.attributes.strokeColor;if(O&&g>0){var _this$attributes11=this.attributes,L=_this$attributes11.lineCap,B=_this$attributes11.lineJoin,A=_this$attributes11.miterLimit,b=_this$attributes11.lineDash,W=_this$attributes11.lineDashOffset,D=_this$attributes11.roundSegments;Object(a.setStrokeColor)(_x32,{color:O,lineWidth:g,lineCap:L,lineJoin:B,miterLimit:A,lineDash:b,lineDashOffset:W,roundSegments:D});}this[S]=_x32;var w=this.attributes.clipPath;w&&this[S].setClipPath(w);}var _h19=this.opacity;return _x32.getOpacity()!==_h19&&_x32.setOpacity(_h19),(_x33=_x32).setTransform.apply(_x33,_toConsumableArray(this.renderMatrix)),_x32;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var P=this.path.boundingBox;return[P[0][0],P[0][1],P[1][0]-P[0][0],P[1][1]-P[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var P=this.mesh.boundingBox;return[P[0][0],P[0][1],P[1][0]-P[0][0],P[1][1]-P[0][1]];}return[0,0,0,0];}},{key:"originalClientCenter",get:function get(){return this.mesh?this.mesh.boundingCenter:[0,0];}},{key:"d",get:function get(){return this.attributes.d;}/* override */,set:function set(P){this.attributes.d=P;}},{key:"draw",value:function draw(){var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(E,"draw",this,3)([P]);var x=this.mesh;return x&&Object(c.drawTexture)(this,x),P;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var P=null;return this.mesh&&(P=this.mesh.boundingBox),Object(f["default"])(P,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(P){if(this.mesh){var _x34=this.mesh.getPointAtLength(P);if(_x34)return[_x34.x,_x34.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(P,x,h){if(_superPropGet(E,"onPropertyChange",this,3)([P,x,h]),(P==="d"||P==="normalize")&&this.updateContours(),this[S]&&(P==="fillColor"||P==="fillRule")){var _this$attributes12=this.attributes,p=_this$attributes12.fillColor,d=_this$attributes12.fillRule;Object(a.setFillColor)(this[S],{color:p,rule:d});}if(this[S]&&(P==="strokeColor"||P==="lineWidth"||P==="lineCap"||P==="lineJoin"||P==="lineDash"||P==="lineDashOffset"||P==="roundSegments")){var _this$attributes13=this.attributes,_p4=_this$attributes13.strokeColor,_d10=_this$attributes13.lineWidth;if(_p4&&_d10>0){var _this$attributes14=this.attributes,g=_this$attributes14.lineCap,O=_this$attributes14.lineJoin,w=_this$attributes14.lineDash,L=_this$attributes14.lineDashOffset,B=_this$attributes14.miterLimit,A=_this$attributes14.roundSegments;Object(a.setStrokeColor)(this[S],{color:_p4,lineCap:g,lineJoin:O,lineWidth:_d10,lineDash:w,lineDashOffset:L,miterLimit:B,roundSegments:A});}}this[S]&&P==="clipPath"&&this[S].setClipPath(x),P==="texture"&&Object(c.applyTexture)(this,x);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new r.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(l["default"]);v(E,"Attr",o["default"]),m["default"].registerNode(E,"path");},/* 227 *//***/function(u,e,t){(function(r,n){u.exports=n();})(this,function(){var r=/* @__PURE__ */function(){function b(W,D){var R=[],X=!0,H=!1,J=void 0;try{for(var et=W[Symbol.iterator](),it;!(X=(it=et.next()).done)&&(R.push(it.value),!(D&&R.length===D));X=!0);}catch($){H=!0,J=$;}finally{try{!X&&et["return"]&&et["return"]();}finally{if(H)throw J;}}return R;}return function(W,D){if(Array.isArray(W))return W;if(Symbol.iterator in Object(W))return b(W,D);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(W,D,R,X,H,J,et){var it=W.x,$=W.y;it*=D,$*=R;var V=X*it-H*$,rt=H*it+X*$;return{x:V+J,y:rt+et};},l=function l(W,D){var R=1.3333333333333333*Math.tan(D/4),X=Math.cos(W),H=Math.sin(W),J=Math.cos(W+D),et=Math.sin(W+D);return[{x:X-H*R,y:H+X*R},{x:J+et*R,y:et-J*R},{x:J,y:et}];},o=function o(W,D,R,X){var H=W*X-D*R<0?-1:1,J=Math.sqrt(W*W+D*D),et=Math.sqrt(W*W+D*D),it=W*R+D*X,$=it/(J*et);return $>1&&($=1),$<-1&&($=-1),H*Math.acos($);},a=function a(W,D,R,X,H,J,et,it,$,V,rt,lt){var ct=Math.pow(H,2),gt=Math.pow(J,2),st=Math.pow(rt,2),Ct=Math.pow(lt,2),xt=ct*gt-ct*Ct-gt*st;xt<0&&(xt=0),xt/=ct*Ct+gt*st,xt=Math.sqrt(xt)*(et===it?-1:1);var F=xt*H/J*lt,U=xt*-J/H*rt,K=V*F-$*U+(W+R)/2,q=$*F+V*U+(D+X)/2,Y=(rt-F)/H,k=(lt-U)/J,C=(-rt-F)/H,M=(-lt-U)/J,j=o(1,0,Y,k),G=o(Y,k,C,M);return it===0&&G>0&&(G-=n),it===1&&G<0&&(G+=n),[K,q,j,G];},c=function c(W){var D=W.px,R=W.py,X=W.cx,H=W.cy,J=W.rx,et=W.ry,it=W.xAxisRotation,$=it===void 0?0:it,V=W.largeArcFlag,rt=V===void 0?0:V,lt=W.sweepFlag,ct=lt===void 0?0:lt,gt=[];if(J===0||et===0)return[];var st=Math.sin($*n/360),Ct=Math.cos($*n/360),xt=Ct*(D-X)/2+st*(R-H)/2,F=-st*(D-X)/2+Ct*(R-H)/2;if(xt===0&&F===0)return[];J=Math.abs(J),et=Math.abs(et);var U=Math.pow(xt,2)/Math.pow(J,2)+Math.pow(F,2)/Math.pow(et,2);U>1&&(J*=Math.sqrt(U),et*=Math.sqrt(U));var K=a(D,R,X,H,J,et,rt,ct,st,Ct,xt,F),q=r(K,4),Y=q[0],k=q[1],C=q[2],M=q[3],j=Math.max(Math.ceil(Math.abs(M)/(n/4)),1);M/=j;for(var G=0;G<j;G++)gt.push(l(C,M)),C+=M;return gt.map(function(Q){var _=i(Q[0],J,et,Ct,st,Y,k),nt=_.x,ut=_.y,mt=i(Q[1],J,et,Ct,st,Y,k),Pt=mt.x,Tt=mt.y,yt=i(Q[2],J,et,Ct,st,Y,k),vt=yt.x,St=yt.y;return{x1:nt,y1:ut,x2:Pt,y2:Tt,x:vt,y:St};});},m={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
286
- * segment pattern
287
- * @type {RegExp}
288
- */},f=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function v(b){var W=[];return b.replace(f,function(D,R,X){var H=R.toLowerCase();for(X=E(X),H=="m"&&X.length>2&&(W.push([R].concat(X.splice(0,2))),H="l",R=R=="m"?"l":"L");;){if(X.length==m[H])return X.unshift(R),W.push(X);if(X.length<m[H])throw new Error("malformed path data");W.push([R].concat(X.splice(0,m[H])));}}),W;}var S=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function E(b){var W=b.match(S);return W?W.map(Number):[];}function T(b){var W=b[0][0],D=b[0][1],R=W,X=D;return b.forEach(function(H){var J=H[0],et=H[2],it=H[4],$=H[6],V=H[1],rt=H[3],lt=H[5],ct=H[7];W=Math.min(W,J,et,it,$),D=Math.min(D,V,rt,lt,ct),R=Math.max(R,J,et,it,$),X=Math.max(X,V,rt,lt,ct);}),[W,D,R,X];}function P(b,W){return Math.sqrt(Math.pow(b[0]-W[0],2)+Math.pow(b[1]-W[1],2))+Math.sqrt(Math.pow(b[2]-W[2],2)+Math.pow(b[3]-W[3],2));}function x(b,W){var D=b[0],R=b[2],X=b[4],H=b[6],J=b[1],et=b[3],it=b[5],$=b[7],V=W[0],rt=W[2],lt=W[4],ct=W[6],gt=W[1],st=W[3],Ct=W[5],xt=W[7];return Math.sqrt(Math.pow(V-D,2)+Math.pow(gt-J,2))+Math.sqrt(Math.pow(rt-R,2)+Math.pow(st-et,2))+Math.sqrt(Math.pow(lt-X,2)+Math.pow(Ct-it,2))+Math.sqrt(Math.pow(ct-H,2)+Math.pow(xt-$,2));}function h(b,W){var D=d(b.length),R=[];D.forEach(function(H){var J=0,et=0;H.forEach(function(it){J+=x(b[it],W[et++]);}),R.push({index:H,distance:J});}),R.sort(function(H,J){return H.distance-J.distance;});var X=[];return R[0].index.forEach(function(H){X.push(b[H]);}),X;}function p(b,W){var D=g(b.length),R=[];D.forEach(function(H){var J=0;H.forEach(function(et){J+=P(T(b[et]),T(W[et]));}),R.push({index:H,distance:J});}),R.sort(function(H,J){return H.distance-J.distance;});var X=[];return R[0].index.forEach(function(H){X.push(b[H]);}),X;}function d(b){for(var W=[],D=0;D<b;D++){for(var R=[],X=0;X<b;X++){var H=X+D;H>b-1&&(H-=b),R[H]=X;}W.push(R);}return W;}function g(b){for(var W=[],D=0;D<b;D++)W.push(D);return O(W);}function O(b){var W=[],D=[];function R(X){var H,J;for(H=0;H<X.length;H++)J=X.splice(H,1)[0],D.push(J),X.length==0&&W.push(D.slice()),R(X),X.splice(H,0,J),D.pop();return W;}return R(b);}var w={};w.parser=v,w.lerpCurve=function(b,W,D){return w.lerpPoints(b[0],b[1],W[0],W[1],D).concat(w.lerpPoints(b[2],b[3],W[2],W[3],D)).concat(w.lerpPoints(b[4],b[5],W[4],W[5],D)).concat(w.lerpPoints(b[6],b[7],W[6],W[7],D));},w.lerpPoints=function(b,W,D,R,X){return[b+(D-b)*X,W+(R-W)*X];},w.q2b=function(b,W,D,R,X,H){return[b,W,(b+2*D)/3,(W+2*R)/3,(X+2*D)/3,(H+2*R)/3,X,H];},w.path2shapes=function(b){for(var W=w.parser(b),D=0,R=0,X=0,H=W.length,J=[],et=null,it=void 0,$=void 0,V=void 0,rt=void 0,lt=void 0,ct=void 0,gt=void 0;X<H;X++){var st=W[X],Ct=st[0],xt=W[X-1];switch(Ct){case"m":lt=J.length,J[lt]=[],et=J[lt],D=D+st[1],R=R+st[2];break;case"M":lt=J.length,J[lt]=[],et=J[lt],D=st[1],R=st[2];break;case"l":et.push([D,R,D,R,D,R,D+st[1],R+st[2]]),D+=st[1],R+=st[2];break;case"L":et.push([D,R,st[1],st[2],st[1],st[2],st[1],st[2]]),D=st[1],R=st[2];break;case"h":et.push([D,R,D,R,D,R,D+st[1],R]),D+=st[1];break;case"H":et.push([D,R,st[1],R,st[1],R,st[1],R]),D=st[1];break;case"v":et.push([D,R,D,R,D,R,D,R+st[1]]),R+=st[1];break;case"V":et.push([D,R,D,st[1],D,st[1],D,st[1]]),R=st[1];break;case"C":et.push([D,R,st[1],st[2],st[3],st[4],st[5],st[6]]),D=st[5],R=st[6];break;case"S":xt[0]==="C"||xt[0]==="c"?et.push([D,R,D+xt[5]-xt[3],R+xt[6]-xt[4],st[1],st[2],st[3],st[4]]):(xt[0]==="S"||xt[0]==="s")&&et.push([D,R,D+xt[3]-xt[1],R+xt[4]-xt[2],st[1],st[2],st[3],st[4]]),D=st[3],R=st[4];break;case"c":et.push([D,R,D+st[1],R+st[2],D+st[3],R+st[4],D+st[5],R+st[6]]),D=D+st[5],R=R+st[6];break;case"s":xt[0]==="C"||xt[0]==="c"?et.push([D,R,D+xt[5]-xt[3],R+xt[6]-xt[4],D+st[1],R+st[2],D+st[3],R+st[4]]):(xt[0]==="S"||xt[0]==="s")&&et.push([D,R,D+xt[3]-xt[1],R+xt[4]-xt[2],D+st[1],R+st[2],D+st[3],R+st[4]]),D=D+st[3],R=R+st[4];break;case"a":ct=c({rx:st[1],ry:st[2],px:D,py:R,xAxisRotation:st[3],largeArcFlag:st[4],sweepFlag:st[5],cx:D+st[6],cy:R+st[7]}),gt=ct[ct.length-1],ct.forEach(function(F,U){U===0?et.push([D,R,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):et.push([ct[U-1].x,ct[U-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),D=gt.x,R=gt.y;break;case"A":ct=c({rx:st[1],ry:st[2],px:D,py:R,xAxisRotation:st[3],largeArcFlag:st[4],sweepFlag:st[5],cx:st[6],cy:st[7]}),gt=ct[ct.length-1],ct.forEach(function(F,U){U===0?et.push([D,R,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):et.push([ct[U-1].x,ct[U-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),D=gt.x,R=gt.y;break;case"Q":et.push(w.q2b(D,R,st[1],st[2],st[3],st[4])),D=st[3],R=st[4];break;case"q":et.push(w.q2b(D,R,D+st[1],R+st[2],st[3]+D,st[4]+R)),D+=st[3],R+=st[4];break;case"T":xt[0]==="Q"||xt[0]==="q"?(V=D+xt[3]-xt[1],rt=R+xt[4]-xt[2],et.push(w.q2b(D,R,V,rt,st[1],st[2]))):(xt[0]==="T"||xt[0]==="t")&&(et.push(w.q2b(D,R,D+D-V,R+R-rt,st[1],st[2])),V=D+D-V,rt=R+R-rt),D=st[1],R=st[2];break;case"t":xt[0]==="Q"||xt[0]==="q"?(V=D+xt[3]-xt[1],rt=R+xt[4]-xt[2],et.push(w.q2b(D,R,V,rt,D+st[1],R+st[2]))):(xt[0]==="T"||xt[0]==="t")&&(et.push(w.q2b(D,R,D+D-V,R+R-rt,D+st[1],R+st[2])),V=D+D-V,rt=R+R-rt),D+=st[1],R+=st[2];break;case"Z":it=et[0][0],$=et[0][1],et.push([D,R,it,$,it,$,it,$]);break;case"z":it=et[0][0],$=et[0][1],et.push([D,R,it,$,it,$,it,$]);break;}}return J;},w._upCurves=function(b,W){for(var D=0,R=0,X=b.length;D<W;D++)b.push(b[R].slice(0)),R++,R>X-1&&(R-=X);};function L(b,W,D,R,X,H,J,et,it){return{left:B(b,W,D,R,X,H,J,et,it),right:B(J,et,X,H,D,R,b,W,1-it,!0)};}function B(b,W,D,R,X,H,J,et,it,$){var V=(D-b)*it+b,rt=(R-W)*it+W,lt=(X-D)*it+D,ct=(H-R)*it+R,gt=(J-X)*it+X,st=(et-H)*it+H,Ct=(lt-V)*it+V,xt=(ct-rt)*it+rt,F=(gt-lt)*it+lt,U=(st-ct)*it+ct,K=(F-Ct)*it+Ct,q=(U-xt)*it+xt;return $?[K,q,Ct,xt,V,rt,b,W]:[b,W,V,rt,Ct,xt,K,q];}w._splitCurves=function(b,W){for(var D=0,R=0;D<W;D++){var X=b[R],H=L(X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],0.5);b.splice(R,1),b.splice(R,0,H.left,H.right),R+=2,R>=b.length-1&&(R=0);}};function A(b,W){for(var D=function D(H){var J=b[b.length-1],et=[];J.forEach(function(it){et.push(it.slice(0));}),b.push(et);},R=0;R<W;R++)D();}return w.lerp=function(b,W,D){return w._lerp(w.path2shapes(b),w.path2shapes(W),D);},w.MIM_CURVES_COUNT=100,w._preprocessing=function(b,W){var D=b.length,R=W.length,X=JSON.parse(JSON.stringify(b)),H=JSON.parse(JSON.stringify(W));return D>R?A(H,D-R):D<R&&A(X,R-D),X=p(X,H),X.forEach(function(J,et){var it=J.length,$=H[et].length;it>$?it<w.MIM_CURVES_COUNT?(w._splitCurves(J,w.MIM_CURVES_COUNT-it),w._splitCurves(H[et],w.MIM_CURVES_COUNT-$)):w._splitCurves(H[et],it-$):it<$&&($<w.MIM_CURVES_COUNT?(w._splitCurves(J,w.MIM_CURVES_COUNT-it),w._splitCurves(H[et],w.MIM_CURVES_COUNT-$)):w._splitCurves(J,$-it));}),X.forEach(function(J,et){X[et]=h(J,H[et]);}),[X,H];},w._lerp=function(b,W,D){var R=[];return b.forEach(function(X,H){var J=[];X.forEach(function(et,it){J.push(w.lerpCurve(et,W[H][it],D));}),R.push(J);}),R;},w.animate=function(b){var W=w.path2shapes(b.from),D=w.path2shapes(b.to),R=w._preprocessing(W,D),X=/* @__PURE__ */new Date(),H=b.end||function(){},J=b.progress||function(){},et=b.begin||function(){},it=b.easing||function(ct){return ct;},$=null,V=null,rt=b.time;et(W);var lt=function ct(){var gt=/* @__PURE__ */new Date()-X;if(gt>=rt){V=D,J(V,1),H(V),cancelAnimationFrame($);return;}var st=it(gt/rt);V=w._lerp(R[0],R[1],st),J(V,st),$=requestAnimationFrame(ct);};lt();},w;});},/* 228 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(71),n=t(221),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute");var c=/*#__PURE__*/function(_r$default3){function c(f){var _this22;_classCallCheck(this,c);_this22=_callSuper(this,c,[f]),_this22[l]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
289
- lineCap:"butt",// 'butt' or 'square' or 'round'
290
- roundSegments:20,// default roundSegment if lineJoin or lineCap is round
291
- lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this22;}_inherits(c,_r$default3);return _createClass(c,[{key:"d",get:function get(){return this[a]("d");},set:function set(f){this[o]("d",f);}},{key:"normalize",get:function get(){return this[a]("normalize");},set:function set(f){this[o]("normalize",!!f);}},{key:"fillColor",get:function get(){return this[a]("fillColor");},set:function set(f){this[o]("fillColor",Object(n.parseColor)(f));}},{key:"fillRule",get:function get(){return this[a]("fillRule");},set:function set(f){if(f!=null&&f!=="nonzero"&&f!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",f);}},{key:"strokeColor",get:function get(){return this[a]("strokeColor");},set:function set(f){this[o]("strokeColor",Object(n.parseColor)(f));}},{key:"lineWidth",get:function get(){return this[a]("lineWidth");},set:function set(f){this[o]("lineWidth",Object(i.toNumber)(f));}},{key:"lineJoin",get:function get(){return this[a]("lineJoin");},set:function set(f){if(f!=null&&f!=="miter"&&f!=="bevel"&&f!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",f);}},{key:"lineCap",get:function get(){return this[a]("lineCap");},set:function set(f){if(f!=null&&f!=="butt"&&f!=="square"&&f!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",f);}},{key:"lineDash",get:function get(){return this[a]("lineDash");},set:function set(f){f=Object(i.toArray)(f,!0),f!=null&&!Array.isArray(f)&&(f=[f]),this[o]("lineDash",f?f.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[a]("lineDashOffset");},set:function set(f){this[o]("lineDashOffset",Object(i.toNumber)(f));}},{key:"miterLimit",get:function get(){return this[a]("miterLimit");},set:function set(f){this[o]("miterLimit",Object(i.toNumber)(f));}},{key:"roundSegments",get:function get(){return this[a]("roundSegments");},set:function set(f){this[o]("roundSegments",f);}},{key:"texture",get:function get(){return this[a]("texture");},set:function set(f){this[o]("texture",f);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(f){this[o]("textureRect",f);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(f){this[o]("sourceRect",f);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(f){this[o]("textureRepeat",!!f);}},{key:"clipPath",get:function get(){return this[a]("clipPath");},set:function set(f){this[o]("clipPath",f);}}]);}(r["default"]);},/* 229 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,m){return c in a?Object.defineProperty(a,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):a[c]=m,a;}var o=/*#__PURE__*/function(_r$default4){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default4);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,c=_this$attributes15.width,m=_this$attributes15.height;return c>0&&m>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"rect");},/* 230 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return m;});var r=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),a=Symbol["for"]("spritejs_declareAlias");function c(f){var v=f.width,S=f.height;return"M0 0L".concat(v," 0L").concat(v," ").concat(S,"L0 ").concat(S,"Z");}var m=/*#__PURE__*/function(_r$default5){function m(v){var _this23;_classCallCheck(this,m);_this23=_callSuper(this,m,[v]),_this23[i]({width:0,height:0/* size */}),_this23[a]("size");return _this23;}// readonly
292
- _inherits(m,_r$default5);return _createClass(m,[{key:"d",get:function get(){return this[o]("d");},set:function set(v){}// eslint-disable-line no-empty-function
293
- },{key:"width",get:function get(){return this[o]("width");},set:function set(v){if(v=Object(n.toNumber)(v),this[l]("width",v)){var S=c(this);this[l]("d",S);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){if(v=Object(n.toNumber)(v),this[l]("height",v)){var S=c(this);this[l]("d",S);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}}]);}(r["default"]);},/* 231 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,m){return c in a?Object.defineProperty(a,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):a[c]=m,a;}var o=/*#__PURE__*/function(_r$default6){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default6);return _createClass(o,[{key:"isVisible",get:function get(){var c=this.attributes.sides;return c[0]>0&&c[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"triangle");},/* 232 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,m){return c in a?Object.defineProperty(a,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):a[c]=m,a;}var o=/*#__PURE__*/function(_r$default7){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default7);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var c=this.attributes.points;return c.length>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"polyline");},/* 233 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function m(v){var S=v.points,E=v.smooth,T=v.smoothRange,P=v.close,x=[];for(var p=0;p<S.length;p+=2)x.push([S[p],S[p+1]]);var h="";return E?h=Object(i.makeSmoothCurveLine)(x,T):x.length&&(h="M".concat(x.map(function(p){return p.join(" ");}).join("L"))),h&&P&&(h+="Z"),h;}var f=/*#__PURE__*/function(_r$default8){function f(S){var _this24;_classCallCheck(this,f);_this24=_callSuper(this,f,[S]),_this24[l]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
294
- /* close */}),_this24[c]("close");return _this24;}// readonly
295
- _inherits(f,_r$default8);return _createClass(f,[{key:"d",get:function get(){return this[a]("d");},set:function set(S){}// eslint-disable-line no-empty-function
296
- },{key:"close",get:function get(){return this.closeType!=="none";},set:function set(S){S=S?"normal":"none",this.closeType=S;}},{key:"closeType",get:function get(){return this[a]("closeType");},set:function set(S){if(S!=null&&S!=="none"&&S!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",S)){var E=m(this);this[o]("d",E);}}},{key:"smooth",get:function get(){return this[a]("smooth");},set:function set(S){if(this[o]("smooth",S)){var E=m(this);this[o]("d",E);}}},{key:"smoothRange",get:function get(){return this[a]("smoothRange");},set:function set(S){if(S&&!Array.isArray(S)&&(S=[S]),this[o]("smoothRange",S)&&this.smooth){var E=m(this);this[o]("d",E);}}},{key:"points",get:function get(){return this[a]("points");},set:function set(S){if(S=Object(n.toArray)(S),Array.isArray(S)&&(S=S.reduce(function(E,T){return Array.isArray(T)?[].concat(_toConsumableArray(E),_toConsumableArray(T.map(function(P){return Object(n.toNumber)(P);}))):[].concat(_toConsumableArray(E),[Object(n.toNumber)(T)]);},[])),this[o]("points",S)){var E=m(this);this[o]("d",E);}}}]);}(r["default"]);},/* 234 *//***/function(u,e,t){t.r(e),t.d(e,"makeSmoothCurveLine",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function l(c){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var v,S,E,T;if((n[c].x===n[c+1].x||n[c].y===n[c+1].y)&&(m=0,f=0),c<1?(v=n[0].x+(n[1].x-n[0].x)*m,S=n[0].y+(n[1].y-n[0].y)*m):(v=n[c].x+(n[c+1].x-n[c-1].x)*m,S=n[c].y+(n[c+1].y-n[c-1].y)*m),c>n.length-3){var P=n.length-1;E=n[P].x-(n[P].x-n[P-1].x)*f,T=n[P].y-(n[P].y-n[P-1].y)*f;}else E=n[c+1].x-(n[c+2].x-n[c].x)*f,T=n[c+1].y-(n[c+2].y-n[c].y)*f;return[{x:v,y:S},{x:E,y:T}];}n=n.map(function(_ref141){var _ref142=_slicedToArray(_ref141,2),c=_ref142[0],m=_ref142[1];return{x:c,y:m};});var o="",a=0;return n.forEach(function(c,m){if(m===0)o+="M".concat(c.x," ").concat(c.y);else{for(;m>i[a];)a++;if(a%2){var _l3=l(m-1),_l4=_slicedToArray(_l3,2),f=_l4[0],v=_l4[1];o+="C".concat([f.x,f.y,v.x,v.y,c.x,c.y].join(" "));}else o+="L".concat(c.x," ").concat(c.y);}}),o;}},/* 235 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(m){var _m$sides=_slicedToArray(m.sides,2),f=_m$sides[0],v=_m$sides[1];var S=m.angle%360;return S<0&&(S+=360),S=Math.PI*S/180,[0,0,f,0,v*Math.cos(S),v*Math.sin(S)];}var c=/*#__PURE__*/function(_r$default9){function c(f){var _this25;_classCallCheck(this,c);_this25=_callSuper(this,c,[f]),_this25[i]({sides:[0,0],angle:60,closeType:"normal"});return _this25;}// readonly
297
- _inherits(c,_r$default9);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(f){}// eslint-disable-line no-empty-function
298
- },{key:"sides",get:function get(){return this[o]("sides");},set:function set(f){if(f=Object(n.toArray)(f,!0),f!=null&&!Array.isArray(f)&&(f=[f,f]),this[l]("sides",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("angle",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}}]);}(r["default"]);},/* 236 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,m){return c in a?Object.defineProperty(a,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):a[c]=m,a;}var o=/*#__PURE__*/function(_r$default10){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default10);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var c=this.attributes.sides;return c[0]>0&&c[1]>0&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"parallel");},/* 237 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(m){var _m$sides2=_slicedToArray(m.sides,2),f=_m$sides2[0],v=_m$sides2[1];var S=m.angle%360;S<0&&(S+=360),S=Math.PI*S/180;var E=v*Math.cos(S),T=v*Math.sin(S);return[0,0,f,0,E+f,T,E,T];}var c=/*#__PURE__*/function(_r$default11){function c(f){var _this26;_classCallCheck(this,c);_this26=_callSuper(this,c,[f]),_this26[i]({sides:[0,0],angle:90,closeType:"normal"});return _this26;}// readonly
299
- _inherits(c,_r$default11);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(f){}// eslint-disable-line no-empty-function
300
- },{key:"sides",get:function get(){return this[o]("sides");},set:function set(f){if(f=Object(n.toArray)(f,!0),f!=null&&!Array.isArray(f)&&(f=[f,f]),this[l]("sides",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("angle",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}}]);}(r["default"]);},/* 238 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,m){return c in a?Object.defineProperty(a,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):a[c]=m,a;}var o=/*#__PURE__*/function(_r$default12){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default12);return _createClass(o);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"regular");},/* 239 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(m){var f=m.edges,v=m.radius,S=m.offsetAngle,E=Math.PI*S/180-0.5*Math.PI;if(f<3||v<=0)return[];var T=[];for(var P=0;P<f;P++){var _x35=P*2*Math.PI/f+E,_h20=v*Math.cos(_x35),p=v*Math.sin(_x35);T.push(_h20,p);}return T;}var c=/*#__PURE__*/function(_r$default13){function c(f){var _this27;_classCallCheck(this,c);_this27=_callSuper(this,c,[f]),_this27[i]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this27;}// readonly
301
- _inherits(c,_r$default13);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(f){}// eslint-disable-line no-empty-function
302
- },{key:"edges",get:function get(){return this[o]("edges");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("edges",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}},{key:"radius",get:function get(){return this[o]("radius");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("radius",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("offsetAngle",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}}]);}(r["default"]);},/* 240 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(232),n=t(213),i=t(241);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,m){return c in a?Object.defineProperty(a,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):a[c]=m,a;}var o=/*#__PURE__*/function(_r$default14){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default14);return _createClass(o);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"star");},/* 241 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");function a(m){var f=m.angles,v=m.innerRadius,S=m.outerRadius,E=m.offsetAngle,T=Math.PI*E/180-0.5*Math.PI;if(f<3||v<=0||S<=0)return[];var P=[];for(var _x36=0;_x36<f*2;_x36++){var _h21=_x36*Math.PI/f+T,p=_x36%2?v:S,d=p*Math.cos(_h21),g=p*Math.sin(_h21);P.push(d,g);}return P;}var c=/*#__PURE__*/function(_r$default15){function c(f){var _this28;_classCallCheck(this,c);_this28=_callSuper(this,c,[f]),_this28[i]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this28;}// readonly
303
- _inherits(c,_r$default15);return _createClass(c,[{key:"points",get:function get(){return _superPropGet(c,"points",this,1);},set:function set(f){}// eslint-disable-line no-empty-function
304
- },{key:"angles",get:function get(){return this[o]("angles");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("angles",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("innerRadius",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("outerRadius",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(f){f=Object(n.toArray)(f,!0),Array.isArray(f)||(f=[f,f]),this.innerRadius=f[0],this.outerRadius=f[1];}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(f){if(f=Object(n.toNumber)(f),this[l]("offsetAngle",f)){var v=a(this);_superPropSet(c,"points",v,this,1,1);}}}]);}(r["default"]);},/* 242 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),i=t(243);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,m){return c in a?Object.defineProperty(a,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):a[c]=m,a;}var o=/*#__PURE__*/function(_r$default16){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default16);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,c=_this$attributes16.radiusX,m=_this$attributes16.radiusY,f=_this$attributes16.startAngle,v=_this$attributes16.endAngle;return c>0&&m>0&&f!==v&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"ellipse");},/* 243 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function m(v){var S=v.radiusX,E=v.radiusY,T=v.startAngle,P=v.endAngle,x=v.direction,h=v.closeType,p=x==="anitclockwise",d=new r.Figure2D();return h==="sector"&&d.moveTo(0,0),d.ellipse(0,0,S,E,0,Math.PI*T/180,Math.PI*P/180,p),h!=="none"&&d.closePath(),d.path.reduce(function(w,L){return w+L.join(" ");},"");}var f=/*#__PURE__*/function(_n$default2){function f(S){var _this29;_classCallCheck(this,f);_this29=_callSuper(this,f,[S]),_this29[l]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
305
- closeType:"none"// none | sector | normal
306
- }),_this29[c]("radius","angle");return _this29;}// readonly
307
- _inherits(f,_n$default2);return _createClass(f,[{key:"d",get:function get(){return this[a]("d");},set:function set(S){}// eslint-disable-line no-empty-function
308
- },{key:"radiusX",get:function get(){return this[a]("radiusX");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("radiusX",S)){var E=m(this);this[o]("d",E);}}},{key:"radiusY",get:function get(){return this[a]("radiusY");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("radiusY",S)){var E=m(this);this[o]("d",E);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(S){S=Object(i.toArray)(S,!0),Array.isArray(S)||(S=[S,S]),this.radiusX=S[0],this.radiusY=S[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(S){S=Object(i.toArray)(S),Array.isArray(S)||(S=[S,S]),this.startAngle=S[0],this.endAngle=S[1];}},{key:"direction",get:function get(){return this[a]("direction");},set:function set(S){if(S!=null&&S!=="clockwise"&&S!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",S);}},{key:"startAngle",get:function get(){return this[a]("startAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("startAngle",S)){var E=m(this);this[o]("d",E);}}},{key:"endAngle",get:function get(){return this[a]("endAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("endAngle",S)){var E=m(this);this[o]("d",E);}}},{key:"closeType",get:function get(){return this[a]("closeType");},set:function set(S){if(S!=null&&S!=="none"&&S!=="sector"&&S!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",S)){var E=m(this);this[o]("d",E);}}}]);}(n["default"]);},/* 244 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,m){return c in a?Object.defineProperty(a,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):a[c]=m,a;}var o=/*#__PURE__*/function(_r$default17){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default17);return _createClass(o);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"arc");},/* 245 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return i;});var r=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(_r$default18){function i(){_classCallCheck(this,i);return _callSuper(this,i,arguments);}_inherits(i,_r$default18);return _createClass(i,[{key:"radius",get:function get(){return _superPropGet(i,"radiusX",this,1);},set:function set(o){o=Object(n.toNumber)(o),_superPropSet(i,"radiusX",o,this,1,1),_superPropSet(i,"radiusY",o,this,1,1);}}]);}(r["default"]);},/* 246 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function l(a,c,m){return c in a?Object.defineProperty(a,c,{value:m,enumerable:!0,configurable:!0,writable:!0}):a[c]=m,a;}var o=/*#__PURE__*/function(_r$default19){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_r$default19);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,c=_this$attributes17.innerRadius,m=_this$attributes17.outerRadius,f=_this$attributes17.startAngle,v=_this$attributes17.endAngle;return(c>0||m>0)&&f!==v&&_superPropGet(o,"isVisible",this,1);}}]);}(r["default"]);l(o,"Attr",i["default"]),n["default"].registerNode(o,"ring");},/* 247 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute"),c=Symbol["for"]("spritejs_declareAlias");function m(v){var _ref143;var S=v.innerRadius,E=v.outerRadius,T=v.startAngle,P=v.endAngle;var x=new r.Figure2D();if(T=Math.PI*T/180,P=Math.PI*P/180,S>E&&(_ref143=[E,S],S=_ref143[0],E=_ref143[1],_ref143),S<=0&&x.moveTo(0,0),x.arc(0,0,E,T,P,!1),S>0){var d=Math.PI*2;P<T&&(P=T+d+(P-T)%d),P-T>=d&&(P=T+d-1e-6),x.arc(0,0,S,P,T,!0);}return x.closePath(),x.path.reduce(function(d,g){return d+g.join(" ");},"");}var f=/*#__PURE__*/function(_n$default3){function f(S){var _this30;_classCallCheck(this,f);_this30=_callSuper(this,f,[S]),_this30[l]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this30[c]("radius","angle");return _this30;}// readonly
309
- _inherits(f,_n$default3);return _createClass(f,[{key:"d",get:function get(){return this[a]("d");},set:function set(S){}// eslint-disable-line no-empty-function
310
- },{key:"innerRadius",get:function get(){return this[a]("innerRadius");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("innerRadius",S)){var E=m(this);this[o]("d",E);}}},{key:"outerRadius",get:function get(){return this[a]("outerRadius");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("outerRadius",S)){var E=m(this);this[o]("d",E);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(S){S=Object(i.toArray)(S,!0),Array.isArray(S)||(S=[S,S]),this.innerRadius=S[0],this.outerRadius=S[1];}},{key:"startAngle",get:function get(){return this[a]("startAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("startAngle",S)){var E=m(this);this[o]("d",E);}}},{key:"endAngle",get:function get(){return this[a]("endAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("endAngle",S)){var E=m(this);this[o]("d",E);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(S){S=Object(i.toArray)(S),Array.isArray(S)||(S=[S,S]),this.startAngle=S[0],this.endAngle=S[1];}}]);}(n["default"]);},/* 248 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return E;});var r=t(12),n=t(218),i=t(219),l=t(249),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function a(T,P,x){return P in T?Object.defineProperty(T,P,{value:x,enumerable:!0,configurable:!0,writable:!0}):T[P]=x,T;}var c=Symbol("textImage"),m=Symbol("textImageTask"),f=Symbol("textureContext"),v=Symbol("updateTextureRect"),S=Symbol("textCanvas");var E=/*#__PURE__*/function(_i$default3){function E(){var _this31;var P=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,E);typeof P=="string"&&(P={text:P}),_this31=_callSuper(this,E,[P]);return _this31;}/* override */_inherits(E,_i$default3);return _createClass(E,[{key:"contentSize",get:function get(){var _superPropGet4=_superPropGet(E,"contentSize",this,1),_superPropGet5=_slicedToArray(_superPropGet4,2),P=_superPropGet5[0],x=_superPropGet5[1];var _this$attributes18=this.attributes,h=_this$attributes18.width,p=_this$attributes18.height;if(h==null||p==null){var d=this[c];d&&(h==null&&(P=d.rect[2]),p==null&&(x=d.rect[3]));}return[P,x];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(P){this.attributes.text=P;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(P){this.attributes.text=P;}},{key:"textImage",get:function get(){return this[c]||{};}},{key:"textImageReady",get:function get(){return this[m]||Promise.resolve();}/* override */},{key:"draw",value:function draw(P){_superPropGet(E,"draw",this,3)([P]);var x=this.mesh;if(x){var _h22=this[c];if(_h22){var p=x.texture;if(!p||this[f]&&this[f]!==this.renderer||_h22.needsUpdate?(_h22.needsUpdate=!1,Object(n.deleteTexture)(_h22.image,this.renderer),p=Object(n.createTexture)(_h22.image,this.renderer),this[v]=!0):p=x.uniforms.u_texSampler,this[v]){var _h22$rect$slice=_h22.rect.slice(2),_h22$rect$slice2=_slicedToArray(_h22$rect$slice,2),d=_h22$rect$slice2[0],g=_h22$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),O=_this$contentSize4[0],w=_this$contentSize4[1],L=this.attributes.textAlign,B=this.attributes.verticalAlign;var A=0;L==="center"?A=(O-d)/2:(L==="right"||L==="end")&&(A=O-d);var b=this.attributes.fontSize,W=this.attributes.lineHeight;var D=0;B==="top"?D=(b-W)/2:B==="bottom"&&(D=(W-b)/2);var _this$attributes19=this.attributes,R=_this$attributes19.paddingLeft,X=_this$attributes19.paddingTop,H=this.attributes.borderWidth;A+=R+H,D+=X+H;var _this$attributes20=this.attributes,J=_this$attributes20.anchorX,et=_this$attributes20.anchorY;A-=this.offsetSize[0]*J,D-=this.offsetSize[1]*et,x.setTexture(p,{rect:[A,D,d,g]}),this[v]=!1,this[f]=this.renderer;}}}return P;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(P,x,h){P==="text"||P==="fontSize"||P==="fontFamily"||P==="fontStyle"||P==="fontVariant"||P==="fontWeight"||P==="fontStretch"||P==="lineHeight"||P==="strokeColor"||P==="fillColor"||P==="strokeWidth"?this.updateText():((P==="textAlign"||P==="verticalAlign")&&(this[v]=!0),_superPropGet(E,"onPropertyChange",this,3)([P,x,h]));}/* override */},{key:"updateContours",value:function updateContours(){_superPropGet(E,"updateContours",this,3)([]),this[v]=!0;}},{key:"updateText",value:function updateText(){var _this32=this;this[m]||(this[m]=Promise.resolve().then(function(){_this32[m]=null;var _this32$attributes=_this32.attributes,P=_this32$attributes.text,x=_this32$attributes.font,h=_this32$attributes.fillColor,p=_this32$attributes.strokeColor,d=_this32$attributes.strokeWidth,g=_this32.layer?_this32.layer.displayRatio:1;return _this32[S]=_this32[S]||r.ENV.createCanvas(1,1),_this32[c]=r.ENV.createText(P,{font:x,fillColor:h,strokeColor:p,strokeWidth:d,parseFont:r.parseFont,ratio:g,textCanvas:_this32[S]}),_this32[c].needsUpdate=!0,_this32.updateContours(),_this32.forceUpdate(),_this32[c];}));}}]);}(i["default"]);a(E,"Attr",l["default"]),o["default"].registerNode(E,"label");},/* 249 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(12),n=t(72),i=t(221),l=t(220);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute"),m=Symbol["for"]("spritejs_declareAlias");var f=/*#__PURE__*/function(_l$default2){function f(S){var _this33;_classCallCheck(this,f);_this33=_callSuper(this,f,[S]),_this33[o]({text:"",fontSize:16,fontFamily:"Helvetica,Arial,sans-serif",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",lineHeight:"",/* font */textAlign:"left",strokeColor:void 0,strokeWidth:1,fillColor:void 0,verticalAlign:"middle"}),_this33[m]("font");return _this33;}_inherits(f,_l$default2);return _createClass(f,[{key:"text",get:function get(){return this[c]("text")||" ";},set:function set(S){this[a]("text",S);}},{key:"fontSize",get:function get(){return this[c]("fontSize");},set:function set(S){this[a]("fontSize",Object(n.toNumber)(S));}},{key:"fontFamily",get:function get(){return this[c]("fontFamily");},set:function set(S){this[a]("fontFamily",S);}},{key:"fontStyle",get:function get(){return this[c]("fontStyle");},set:function set(S){this[a]("fontStyle",S);}},{key:"fontVariant",get:function get(){return this[c]("fontVariant");},set:function set(S){this[a]("fontVariant",S);}},{key:"fontWeight",get:function get(){return this[c]("fontWeight");},set:function set(S){this[a]("fontWeight",S);}},{key:"fontStretch",get:function get(){return this[c]("fontStretch");},set:function set(S){this[a]("fontStretch",S);}},{key:"lineHeight",get:function get(){return this[c]("lineHeight")||this.fontSize;},set:function set(S){this[a]("lineHeight",Object(n.toNumber)(S));}},{key:"textAlign",get:function get(){return this[c]("textAlign");},set:function set(S){this[a]("textAlign",S);}},{key:"strokeColor",get:function get(){return this[c]("strokeColor");},set:function set(S){this[a]("strokeColor",Object(i.parseColor)(S));}},{key:"strokeWidth",get:function get(){return this[c]("strokeWidth");},set:function set(S){this[a]("strokeWidth",Object(n.toNumber)(S));}},{key:"verticalAlign",get:function get(){return this[c]("verticalAlign");},set:function set(S){this[a]("verticalAlign",S);}},{key:"fillColor",get:function get(){return this[c]("fillColor");},set:function set(S){this[a]("fillColor",Object(i.parseColor)(S));}},{key:"font",get:function get(){var S=this.fontStyle,E=this.fontVariant,T=this.fontWeight,P=this.fontStretch,x=this.fontSize,h=this.lineHeight,p=this.fontFamily;return"".concat(S," ").concat(E," ").concat(T," ").concat(P," ").concat(x,"px/").concat(h,"px ").concat(p);},set:function set(S){if(S==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var E=Object(r.parseFont)(S);this.fontStyle=E.style,this.fontVariant=E.variant,this.fontWeight=E.weight,this.fontStretch=E.stretch,this.fontSize=Object(n.toNumber)("".concat(E.size).concat(E.unit)),E.lineHeight&&(this.lineHeight=E.pxLineHeight),this.fontFamily=E.family;}}}]);}(l["default"]);},/* 250 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return S;});var r=t(12),n=t(219),i=t(251),l=t(213),o=t(252);t(1).glMatrix.setMatrixArrayType(Array);function a(E,T,P){return T in E?Object.defineProperty(E,T,{value:P,enumerable:!0,configurable:!0,writable:!0}):E[T]=P,E;}var c=Symbol("zOrder"),m=Symbol("ordered"),f=Symbol("children"),v=Symbol("sealed");var S=/*#__PURE__*/function(_n$default4){function S(){var _this34;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,S);_this34=_callSuper(this,S,[T]),_this34[f]=[],_this34[m]=null,_this34[c]=0;return _this34;}_inherits(S,_n$default4);return _createClass(S,[{key:"childNodes",get:function get(){return this[f];}},{key:"children",get:function get(){return this[f];}},{key:"orderedChildren",get:function get(){return this[m]||(this[m]=_toConsumableArray(this[f]),this[m].sort(function(T,P){return T.zIndex-P.zIndex||T.zOrder-P.zOrder;})),this[m];}},{key:"append",value:function append(){var _this35=this;for(var _len12=arguments.length,T=new Array(_len12),_key12=0;_key12<_len12;_key12++){T[_key12]=arguments[_key12];}return T.map(function(P){return _this35.appendChild(P);});}},{key:"appendChild",value:function appendChild(T){return T.remove(),this[f].push(T),T.connect(this,this[c]++),this[m]&&(this[m].length&&T.zIndex<this[m][this[m].length-1].zIndex?this.reorder():this[m].push(T)),T;}/* override */// get isVisible() {
311
- // return this.attributes.opacity > 0 && this[_children].length > 0;
312
- // }
313
- /* override */},{key:"cloneNode",value:function cloneNode(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var P=_superPropGet(S,"cloneNode",this,3)([]);return T&&this[f].forEach(function(x){var h=x.cloneNode(T);P.appendChild(h);}),P;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(T){var P=this.orderedChildren;for(var _x37=P.length-1;_x37>=0;_x37--)if(P[_x37].dispatchPointerEvent(T))return!0;return _superPropGet(S,"dispatchPointerEvent",this,3)([T]);}/* override */},{key:"draw",value:function draw(){var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(S,"draw",this,3)([T]),!this[v]&&this.attributes.display!=="none"){var P=this.orderedChildren;for(var _x38=0;_x38<P.length;_x38++)P[_x38].draw(T);}return this.__cacheRenderMatrix=null,T;}},{key:"getElementById",value:function getElementById(T){return Object(o.querySelector)("#".concat(T),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(T){return Object(o.querySelectorAll)(".".concat(T),this);}},{key:"getElementsByName",value:function getElementsByName(T){return Object(o.querySelectorAll)("[name=\"".concat(T,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(T){return Object(o.querySelectorAll)(T,this);}},{key:"insertBefore",value:function insertBefore(T,P){if(P==null)return this.appendChild(T);T.remove();var x=this[f].indexOf(P);if(x<0)throw new Error("Invalid reference node.");var h=P.zOrder;for(var p=x;p<this[f].length;p++){var d=this[f][p].zOrder,g=this[f][p];delete g.zOrder,Object.defineProperty(g,"zOrder",{value:d+1,writable:!1,configurable:!0});}if(this[f].splice(x,0,T),T.connect(this,h),this[m])if(T.zIndex!==P.zIndex)this.reorder();else{var _p5=this[m].indexOf(P);this[m].splice(_p5,0,T);}return T;}},{key:"querySelector",value:function querySelector(T){return Object(o.querySelector)(T,this);}},{key:"querySelectorAll",value:function querySelectorAll(T){return Object(o.querySelectorAll)(T,this);}},{key:"replaceChild",value:function replaceChild(T,P){T.remove();var x=this[f].indexOf(P);if(x<0)throw new Error("Invalid reference node.");if(this[f][x]=T,T.connect(this,P.zOrder),this[m])if(T.zIndex!==P.zIndex)this.reorder();else{var _h23=this[m].indexOf(P);this[m][_h23]=T;}return P.disconnect(this),T;}},{key:"removeAllChildren",value:function removeAllChildren(){var T=this[f];for(var P=T.length-1;P>=0;P--)T[P].remove();}},{key:"removeChild",value:function removeChild(T){var P=this[f].indexOf(T);if(P>=0){if(this[f].splice(P,1),this[m]){var _x39=this[m].indexOf(T);this[m].splice(_x39,1);}return T.disconnect(this),T;}return null;}},{key:"reorder",value:function reorder(){this[m]=null;}},{key:"seal",value:function seal(){function T(p,d){var g=[];for(var O=0;O<p.length;O++){var w=_toConsumableArray(p[O]);for(var L=1;L<w.length;L+=2){var B=w[L],A=w[L+1];w[L]=B*d[0]+A*d[2]+d[4],w[L+1]=B*d[1]+A*d[3]+d[5];}g.push(w);}return g;}var P=this.orderedChildren,x=new r.Figure2D(),h=this.localMatrix;for(var p=0;p<P.length;p++){var d=P[p];if(d instanceof S&&(d=d.seal()),d.clientBox){var g=d.clientBox.contours.path;g=T(g,d.localMatrix),x.addPath(g);}if(d.path){var _g6=d.path.contours.path;_g6=T(_g6,d.localMatrix),x.addPath(_g6);}}return this[v]=!0,this.clientBox=x,{clientBox:x,localMatrix:h};}/* override */},{key:"setResolution",value:function setResolution(_ref144){var T=_ref144.width,P=_ref144.height;_superPropGet(S,"setResolution",this,3)([{width:T,height:P}]),this[f].forEach(function(x){x.setResolution({width:T,height:P});});}/* override */},{key:"updateContours",value:function updateContours(){this[v]||_superPropGet(S,"updateContours",this,3)([]);}}]);}(n["default"]);a(S,"Attr",i["default"]),l["default"].registerNode(S,"group");},/* 251 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=/*#__PURE__*/function(_r$default20){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_r$default20);return _createClass(n);}(r["default"]);},/* 252 *//***/function(u,e,t){t.r(e),t.d(e,"querySelectorAll",function(){return v;}),t.d(e,"querySelector",function(){return S;}),t.d(e,"isMatched",function(){return E;}),t.d(e,"compile",function(){return T;});var r=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var i=t(253);function l(P){return P.nodeType===1||n["default"].isSpriteNode(P.nodeName);}function o(P){return Array.from(P.childNodes||[]);}function a(P){return n["default"].isSpriteNode(P.nodeName)?P.parent||P.canvas||P.container:P.parentElement;}function c(P){var x=P.length,h,p,d;for(;--x>-1;){for(h=p=P[x],P[x]=null,d=!0;p;){if(P.indexOf(p)>-1){d=!1,P.splice(x,1);break;}p=a(p);}d&&(P[x]=h);}return P;}var m={isTag:l,existsOne:function existsOne(P,x){return x.some(function(h){return l(h)?P(h)||m.existsOne(P,o(h)):!1;});},getSiblings:function getSiblings(P){var x=a(P);return x&&o(x);},getChildren:o,getParent:a,getAttributeValue:function getAttributeValue(P,x){if(P.nodeType===1&&x==="class"||x==="id")return P[x];if(this.hasAttrib(P,x)){var _h24=P.attributes[x];return Array.isArray(_h24)&&(_h24="[".concat(_h24.join(),"]")),String(_h24);}},hasAttrib:function hasAttrib(P,x){return P.attributes[x]!=null;},removeSubsets:c,getName:function getName(P){return P.tagName?P.tagName.toLowerCase():null;},findOne:function P(x,h){var p=null;for(var d=0,g=h.length;d<g&&!p;d++)if(x(h[d]))p=h[d];else{var O=o(h[d]);O&&O.length>0&&(p=P(x,O));}return p;},findAll:function P(x,h){var p=[];for(var d=0,g=h.length;d<g;d++){if(!l(h[d]))continue;x(h[d])&&p.push(h[d]);var O=o(h[d]);O&&(p=p.concat(P(x,O)));}return p;},getText:function P(x){return Array.isArray(x)?x.map(P).join(""):l(x)?P(o(x)):x.nodeType===3?x.nodeValue:n["default"].isSpriteNode(x.nodeName)?x.text:"";}};function f(P){if(typeof P!="string")return P;var x=P.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return x&&(x=x.map(function(h){var p=h.slice(1,-1).split("="),d=Object(r.parseColor)(p[1].replace(/['"]/g,""));return[h,"[".concat(p[0],"=\"").concat(d,"\"]")];}),x.forEach(function(_ref145){var _ref146=_slicedToArray(_ref145,2),h=_ref146[0],p=_ref146[1];P=P.replace(h,p);})),x=P.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),x&&(x=x.map(function(h){var p=h.slice(1,-1).split("="),d=p[1].slice(2,-2).split(/,/g).map(function(g){return g.trim();});return[h,"[".concat(p[0],"=\"[").concat(d,"]\"]")];}),x.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),h=_ref148[0],p=_ref148[1];P=P.replace(h,p);})),P;}function v(P,x){return i.selectAll(f(P),x,{adapter:m});}function S(P,x){return i.selectOne(f(P),x,{adapter:m});}function E(P,x){return i.is(P,f(x),{adapter:m});}function T(P){return i.compile(f(P),{adapter:m});}},/* 253 *//***/function(u,e,t){u.exports=T;var r=t(254),n=t(273).falseFunc,i=t(274);function l(P){return function(h,p,d){return p=p||{},p.adapter=p.adapter||r,P(h,p,d);};}var o=l(i),a=l(i.compileUnsafe);function c(P){return function(h,p,d){return d=d||{},d.adapter=d.adapter||r,typeof h!="function"&&(h=a(h,d,p)),h.shouldTestNextSiblings&&(p=f(d&&d.context||p,d.adapter)),Array.isArray(p)?p=d.adapter.removeSubsets(p):p=d.adapter.getChildren(p),P(h,p,d);};}function m(P,x){var h=x.getSiblings(P);if(!Array.isArray(h))return[];for(h=h.slice(0);h.shift()!==P;);return h;}function f(P,x){Array.isArray(P)||(P=[P]);for(var h=P.slice(0),p=0,d=P.length;p<d;p++){var g=m(h[p],x);h.push.apply(h,g);}return h;}var v=c(function(x,h,p){return x===n||!h||h.length===0?[]:p.adapter.findAll(x,h);}),S=c(function(x,h,p){return x===n||!h||h.length===0?null:p.adapter.findOne(x,h);});function E(P,x,h){return h=h||{},h.adapter=h.adapter||r,(typeof x=="function"?x:o(x,h))(P);}function T(P,x,h){return v(P,x,h);}T.compile=o,T.filters=i.Pseudos.filters,T.pseudos=i.Pseudos.pseudos,T.selectAll=v,T.selectOne=S,T.is=E,T.parse=o,T.iterate=v,T._compileUnsafe=a,T._compileToken=i.compileToken;},/* 254 *//***/function(u,e,t){var r=u.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(i){r[i]=n[i].bind(r);});});},/* 255 *//***/function(u,e,t){var r=t(256),n=t(257),i=r.isTag;u.exports={getInnerHTML:l,getOuterHTML:n,getText:o};function l(a,c){return a.children?a.children.map(function(m){return n(m,c);}).join(""):"";}function o(a){return Array.isArray(a)?a.map(o).join(""):i(a)?a.name==="br"?"\n":o(a.children):a.type===r.CDATA?o(a.children):a.type===r.Text?a.data:"";}},/* 256 *//***/function(u,e){u.exports={Text:"text",//Text
314
- Directive:"directive",//<? ... ?>
315
- Comment:"comment",//<!-- ... -->
316
- Script:"script",//<script> tags
317
- Style:"style",//<style> tags
318
- Tag:"tag",//Any tag
319
- CDATA:"cdata",//<![CDATA[ ... ]]>
320
- Doctype:"doctype",isTag:function isTag(t){return t.type==="tag"||t.type==="script"||t.type==="style";}};},/* 257 *//***/function(u,e,t){var r=t(258),n=t(259),i=t(267);i.elementNames.__proto__=null,i.attributeNames.__proto__=null;var l={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function o(P,x){if(P){var h="",p;for(var d in P)p=P[d],h&&(h+=" "),x.xmlMode==="foreign"&&(d=i.attributeNames[d]||d),h+=d,(p!==null&&p!==""||x.xmlMode)&&(h+='="'+(x.decodeEntities?n.encodeXML(p):p.replace(/\"/g,"&quot;"))+'"');return h;}}var a={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},c=u.exports=function(P,x){!Array.isArray(P)&&!P.cheerio&&(P=[P]),x=x||{};for(var h="",p=0;p<P.length;p++){var d=P[p];d.type==="root"?h+=c(d.children,x):r.isTag(d)?h+=f(d,x):d.type===r.Directive?h+=v(d):d.type===r.Comment?h+=T(d):d.type===r.CDATA?h+=E(d):h+=S(d,x);}return h;},m=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function f(P,x){x.xmlMode==="foreign"&&(P.name=i.elementNames[P.name]||P.name,P.parent&&m.indexOf(P.parent.name)>=0&&(x=Object.assign({},x,{xmlMode:!1}))),!x.xmlMode&&["svg","math"].indexOf(P.name)>=0&&(x=Object.assign({},x,{xmlMode:"foreign"}));var h="<"+P.name,p=o(P.attribs,x);return p&&(h+=" "+p),x.xmlMode&&(!P.children||P.children.length===0)?h+="/>":(h+=">",P.children&&(h+=c(P.children,x)),(!a[P.name]||x.xmlMode)&&(h+="</"+P.name+">")),h;}function v(P){return"<"+P.data+">";}function S(P,x){var h=P.data||"";return x.decodeEntities&&!(P.parent&&P.parent.name in l)&&(h=n.encodeXML(h)),h;}function E(P){return"<![CDATA["+P.children[0].data+"]]>";}function T(P){return"<!--"+P.data+"-->";}},/* 258 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});function r(n){return n.type==="tag"||n.type==="script"||n.type==="style";}e.isTag=r,e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype";},/* 259 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.encode=e.decodeStrict=e.decode=void 0;var r=t(260),n=t(266);function i(m,f){return(!f||f<=0?r.decodeXML:r.decodeHTML)(m);}e.decode=i;function l(m,f){return(!f||f<=0?r.decodeXML:r.decodeHTMLStrict)(m);}e.decodeStrict=l;function o(m,f){return(!f||f<=0?n.encodeXML:n.encodeHTML)(m);}e.encode=o;var a=t(266);Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function get(){return a.encodeXML;}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function get(){return a.encodeHTML;}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function get(){return a.escape;}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function get(){return a.encodeHTML;}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function get(){return a.encodeHTML;}});var c=t(260);Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function get(){return c.decodeXML;}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function get(){return c.decodeHTML;}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function get(){return c.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function get(){return c.decodeXML;}});},/* 260 *//***/function(u,e,t){var r=this&&this.__importDefault||function(f){return f&&f.__esModule?f:{"default":f};};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHTML=e.decodeHTMLStrict=e.decodeXML=void 0;var n=r(t(261)),i=r(t(262)),l=r(t(263)),o=r(t(264));e.decodeXML=a(l["default"]),e.decodeHTMLStrict=a(n["default"]);function a(f){var v=Object.keys(f).join("|"),S=m(f);v+="|#[xX][\\da-fA-F]+|#\\d+";var E=new RegExp("&(?:"+v+");","g");return function(T){return String(T).replace(E,S);};}var c=function c(f,v){return f<v?1:-1;};e.decodeHTML=function(){for(var f=Object.keys(i["default"]).sort(c),v=Object.keys(n["default"]).sort(c),S=0,E=0;S<v.length;S++)f[E]===v[S]?(v[S]+=";?",E++):v[S]+=";";var T=new RegExp("&(?:"+v.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),P=m(n["default"]);function x(h){return h.substr(-1)!==";"&&(h+=";"),P(h);}return function(h){return String(h).replace(T,x);};}();function m(f){return function(S){if(S.charAt(1)==="#"){var E=S.charAt(2);return E==="X"||E==="x"?o["default"](parseInt(S.substr(3),16)):o["default"](parseInt(S.substr(2),10));}return f[S.slice(1,-1)];};}},/* 261 *//***/function(u){u.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}');},/* 262 *//***/function(u){u.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}');},/* 263 *//***/function(u){u.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 *//***/function(u,e,t){var r=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{"default":l};};Object.defineProperty(e,"__esModule",{value:!0});var n=r(t(265));function i(l){if(l>=55296&&l<=57343||l>1114111)return"�";l in n["default"]&&(l=n["default"][l]);var o="";return l>65535&&(l-=65536,o+=String.fromCharCode(l>>>10&1023|55296),l=56320|l&1023),o+=String.fromCharCode(l),o;}e["default"]=i;},/* 265 *//***/function(u){u.exports=JSON.parse('{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}');},/* 266 *//***/function(u,e,t){var r=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{"default":x};};Object.defineProperty(e,"__esModule",{value:!0}),e.escape=e.encodeHTML=e.encodeXML=void 0;var n=r(t(263)),i=m(n["default"]),l=f(i);e.encodeXML=E(i,l);var o=r(t(261)),a=m(o["default"]),c=f(a);e.encodeHTML=E(a,c);function m(x){return Object.keys(x).sort().reduce(function(h,p){return h[x[p]]="&"+p+";",h;},{});}function f(x){for(var h=[],p=[],d=0,g=Object.keys(x);d<g.length;d++){var O=g[d];O.length===1?h.push("\\"+O):p.push(O);}h.sort();for(var w=0;w<h.length-1;w++){for(var L=w;L<h.length-1&&h[L].charCodeAt(1)+1===h[L+1].charCodeAt(1);)L+=1;var B=1+L-w;B<3||h.splice(w,B,h[w]+"-"+h[L]);}return p.unshift("["+h.join("")+"]"),new RegExp(p.join("|"),"g");}var v=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function S(x){return"&#x"+x.codePointAt(0).toString(16).toUpperCase()+";";}function E(x,h){return function(p){return p.replace(h,function(d){return x[d];}).replace(v,S);};}var T=f(i);function P(x){return x.replace(T,S).replace(v,S);}e.escape=P;},/* 267 *//***/function(u){u.exports=JSON.parse('{"elementNames":{"altglyph":"altGlyph","altglyphdef":"altGlyphDef","altglyphitem":"altGlyphItem","animatecolor":"animateColor","animatemotion":"animateMotion","animatetransform":"animateTransform","clippath":"clipPath","feblend":"feBlend","fecolormatrix":"feColorMatrix","fecomponenttransfer":"feComponentTransfer","fecomposite":"feComposite","feconvolvematrix":"feConvolveMatrix","fediffuselighting":"feDiffuseLighting","fedisplacementmap":"feDisplacementMap","fedistantlight":"feDistantLight","fedropshadow":"feDropShadow","feflood":"feFlood","fefunca":"feFuncA","fefuncb":"feFuncB","fefuncg":"feFuncG","fefuncr":"feFuncR","fegaussianblur":"feGaussianBlur","feimage":"feImage","femerge":"feMerge","femergenode":"feMergeNode","femorphology":"feMorphology","feoffset":"feOffset","fepointlight":"fePointLight","fespecularlighting":"feSpecularLighting","fespotlight":"feSpotLight","fetile":"feTile","feturbulence":"feTurbulence","foreignobject":"foreignObject","glyphref":"glyphRef","lineargradient":"linearGradient","radialgradient":"radialGradient","textpath":"textPath"},"attributeNames":{"definitionurl":"definitionURL","attributename":"attributeName","attributetype":"attributeType","basefrequency":"baseFrequency","baseprofile":"baseProfile","calcmode":"calcMode","clippathunits":"clipPathUnits","diffuseconstant":"diffuseConstant","edgemode":"edgeMode","filterunits":"filterUnits","glyphref":"glyphRef","gradienttransform":"gradientTransform","gradientunits":"gradientUnits","kernelmatrix":"kernelMatrix","kernelunitlength":"kernelUnitLength","keypoints":"keyPoints","keysplines":"keySplines","keytimes":"keyTimes","lengthadjust":"lengthAdjust","limitingconeangle":"limitingConeAngle","markerheight":"markerHeight","markerunits":"markerUnits","markerwidth":"markerWidth","maskcontentunits":"maskContentUnits","maskunits":"maskUnits","numoctaves":"numOctaves","pathlength":"pathLength","patterncontentunits":"patternContentUnits","patterntransform":"patternTransform","patternunits":"patternUnits","pointsatx":"pointsAtX","pointsaty":"pointsAtY","pointsatz":"pointsAtZ","preservealpha":"preserveAlpha","preserveaspectratio":"preserveAspectRatio","primitiveunits":"primitiveUnits","refx":"refX","refy":"refY","repeatcount":"repeatCount","repeatdur":"repeatDur","requiredextensions":"requiredExtensions","requiredfeatures":"requiredFeatures","specularconstant":"specularConstant","specularexponent":"specularExponent","spreadmethod":"spreadMethod","startoffset":"startOffset","stddeviation":"stdDeviation","stitchtiles":"stitchTiles","surfacescale":"surfaceScale","systemlanguage":"systemLanguage","tablevalues":"tableValues","targetx":"targetX","targety":"targetY","textlength":"textLength","viewbox":"viewBox","viewtarget":"viewTarget","xchannelselector":"xChannelSelector","ychannelselector":"yChannelSelector","zoomandpan":"zoomAndPan"}}');},/* 268 *//***/function(u,e){var t=e.getChildren=function(n){return n.children;},r=e.getParent=function(n){return n.parent;};e.getSiblings=function(n){var i=r(n);return i?t(i):[n];},e.getAttributeValue=function(n,i){return n.attribs&&n.attribs[i];},e.hasAttrib=function(n,i){return!!n.attribs&&hasOwnProperty.call(n.attribs,i);},e.getName=function(n){return n.name;};},/* 269 *//***/function(u,e){e.removeElement=function(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var r=t.parent.children;r.splice(r.lastIndexOf(t),1);}},e.replaceElement=function(t,r){var n=r.prev=t.prev;n&&(n.next=r);var i=r.next=t.next;i&&(i.prev=r);var l=r.parent=t.parent;if(l){var o=l.children;o[o.lastIndexOf(t)]=r;}},e.appendChild=function(t,r){if(r.parent=t,t.children.push(r)!==1){var n=t.children[t.children.length-2];n.next=r,r.prev=n,r.next=null;}},e.append=function(t,r){var n=t.parent,i=t.next;if(r.next=i,r.prev=t,t.next=r,r.parent=n,i){if(i.prev=r,n){var l=n.children;l.splice(l.lastIndexOf(i),0,r);}}else n&&n.children.push(r);},e.prepend=function(t,r){var n=t.parent;if(n){var i=n.children;i.splice(i.lastIndexOf(t),0,r);}t.prev&&(t.prev.next=r),r.parent=n,r.prev=t.prev,r.next=t,t.prev=r;};},/* 270 *//***/function(u,e,t){var r=t(256).isTag;u.exports={filter:n,find:i,findOneChild:l,findOne:o,existsOne:a,findAll:c};function n(m,f,v,S){return Array.isArray(f)||(f=[f]),(typeof S!="number"||!isFinite(S))&&(S=1/0),i(m,f,v!==!1,S);}function i(m,f,v,S){for(var E=[],T,P=0,x=f.length;P<x&&!(m(f[P])&&(E.push(f[P]),--S<=0)||(T=f[P].children,v&&T&&T.length>0&&(T=i(m,T,v,S),E=E.concat(T),S-=T.length,S<=0)));P++);return E;}function l(m,f){for(var v=0,S=f.length;v<S;v++)if(m(f[v]))return f[v];return null;}function o(m,f){for(var v=null,S=0,E=f.length;S<E&&!v;S++)if(r(f[S]))m(f[S])?v=f[S]:f[S].children.length>0&&(v=o(m,f[S].children));else continue;return v;}function a(m,f){for(var v=0,S=f.length;v<S;v++)if(r(f[v])&&(m(f[v])||f[v].children.length>0&&a(m,f[v].children)))return!0;return!1;}function c(m,f){for(var v=[],S=f.slice();S.length;){var E=S.shift();r(E)&&(E.children&&E.children.length>0&&S.unshift.apply(S,E.children),m(E)&&v.push(E));}return v;}},/* 271 *//***/function(u,e,t){var r=t(256),n=e.isTag=r.isTag;e.testElement=function(a,c){for(var m in a)if(a.hasOwnProperty(m)){if(m==="tag_name"){if(!n(c)||!a.tag_name(c.name))return!1;}else if(m==="tag_type"){if(!a.tag_type(c.type))return!1;}else if(m==="tag_contains"){if(n(c)||!a.tag_contains(c.data))return!1;}else if(!c.attribs||!a[m](c.attribs[m]))return!1;}return!0;};var i={tag_name:function tag_name(a){return typeof a=="function"?function(c){return n(c)&&a(c.name);}:a==="*"?n:function(c){return n(c)&&c.name===a;};},tag_type:function tag_type(a){return typeof a=="function"?function(c){return a(c.type);}:function(c){return c.type===a;};},tag_contains:function tag_contains(a){return typeof a=="function"?function(c){return!n(c)&&a(c.data);}:function(c){return!n(c)&&c.data===a;};}};function l(a,c){return typeof c=="function"?function(m){return m.attribs&&c(m.attribs[a]);}:function(m){return m.attribs&&m.attribs[a]===c;};}function o(a,c){return function(m){return a(m)||c(m);};}e.getElements=function(a,c,m,f){var v=Object.keys(a).map(function(S){var E=a[S];return S in i?i[S](E):l(S,E);});return v.length===0?[]:this.filter(v.reduce(o),c,m,f);},e.getElementById=function(a,c,m){return Array.isArray(c)||(c=[c]),this.findOne(l("id",a),c,m!==!1);},e.getElementsByTagName=function(a,c,m,f){return this.filter(i.tag_name(a),c,m,f);},e.getElementsByTagType=function(a,c,m,f){return this.filter(i.tag_type(a),c,m,f);};},/* 272 *//***/function(u,e){e.removeSubsets=function(n){for(var i=n.length,l,o,a;--i>-1;){for(l=o=n[i],n[i]=null,a=!0;o;){if(n.indexOf(o)>-1){a=!1,n.splice(i,1);break;}o=o.parent;}a&&(n[i]=l);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},r=e.compareDocumentPosition=function(n,i){var l=[],o=[],a,c,m,f,v,S;if(n===i)return 0;for(a=n;a;)l.unshift(a),a=a.parent;for(a=i;a;)o.unshift(a),a=a.parent;for(S=0;l[S]===o[S];)S++;return S===0?t.DISCONNECTED:(c=l[S-1],m=c.children,f=l[S],v=o[S],m.indexOf(f)>m.indexOf(v)?c===i?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:c===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};e.uniqueSort=function(n){var i=n.length,l,o;for(n=n.slice();--i>-1;)l=n[i],o=n.indexOf(l),o>-1&&o<i&&n.splice(i,1);return n.sort(function(a,c){var m=r(a,c);return m&t.PRECEDING?-1:m&t.FOLLOWING?1:0;}),n;};},/* 273 *//***/function(u,e){u.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 *//***/function(u,e,t){u.exports=v;var r=t(275).parse,n=t(273),i=t(278),l=t(279),o=t(280),a=t(282),c=n.trueFunc,m=n.falseFunc,f=a.filters;function v(A,b,W){var D=E(A,b,W);return S(D,b);}function S(A,b){var W=b.adapter;return function(R){return W.isTag(R)&&A(R);};}function E(A,b,W){var D=r(A,b);return g(D,b,W);}function T(A){return A.type==="pseudo"&&(A.name==="scope"||Array.isArray(A.data)&&A.data.some(function(b){return b.some(T);}));}var P={type:"descendant"},x={type:"_flexibleDescendant"},h={type:"pseudo",name:"scope"},p={};function d(A,b,W){var D=b.adapter,R=!!W&&!!W.length&&W.every(function(X){return X===p||!!D.getParent(X);});A.forEach(function(X){if(!(X.length>0&&O(X[0])&&X[0].type!=="descendant"))if(R&&!(Array.isArray(X)?X.some(T):T(X)))X.unshift(P);else return;X.unshift(h);});}function g(A,b,W){A=A.filter(function(H){return H.length>0;}),A.forEach(i);var D=Array.isArray(W);W=b&&b.context||W,W&&!D&&(W=[W]),d(A,b,W);var R=!1,X=A.map(function(H){if(H[0]&&H[1]&&H[0].name==="scope"){var J=H[1].type;D&&J==="descendant"?H[1]=x:(J==="adjacent"||J==="sibling")&&(R=!0);}return w(H,b,W);}).reduce(L,m);return X.shouldTestNextSiblings=R,X;}function O(A){return l[A.type]<0;}function w(A,b,W){return A.reduce(function(D,R){if(D===m)return D;if(!(R.type in o))throw new Error("Rule type "+R.type+" is not supported by css-select");return o[R.type](D,R,b,W);},b&&b.rootFunc||c);}function L(A,b){return b===m||A===c?A:A===m||b===c?b:function(D){return A(D)||b(D);};}function B(A){return A.some(O);}f.not=function(A,b,W,D){var R={xmlMode:!!(W&&W.xmlMode),strict:!!(W&&W.strict),adapter:W.adapter};if(R.strict&&(b.length>1||b.some(B)))throw new Error("complex selectors in :not aren't allowed in strict mode");var X=g(b,R,D);return X===m?A:X===c?m:function(J){return!X(J)&&A(J);};},f.has=function(A,b,W){var D=W.adapter,R={xmlMode:!!(W&&W.xmlMode),strict:!!(W&&W.strict),adapter:D},X=b.some(B)?[p]:null,H=g(b,R,X);return H===m?m:H===c?function(et){return D.getChildren(et).some(D.isTag)&&A(et);}:(H=S(H,W),X?function(et){return A(et)&&(X[0]=et,D.existsOne(H,D.getChildren(et)));}:function(et){return A(et)&&D.existsOne(H,D.getChildren(et));});},f.matches=function(A,b,W,D){var R={xmlMode:!!(W&&W.xmlMode),strict:!!(W&&W.strict),rootFunc:A,adapter:W.adapter};return g(b,R,D);},v.compileToken=g,v.compileUnsafe=E,v.Pseudos=a;},/* 275 *//***/function(u,e,t){var r=this&&this.__createBinding||(Object.create?function(o,a,c,m){m===void 0&&(m=c),Object.defineProperty(o,m,{enumerable:!0,get:function get(){return a[c];}});}:function(o,a,c,m){m===void 0&&(m=c),o[m]=a[c];}),n=this&&this.__exportStar||function(o,a){for(var c in o)c!=="default"&&!a.hasOwnProperty(c)&&r(a,o,c);};Object.defineProperty(e,"__esModule",{value:!0}),n(t(276),e);var i=t(276);Object.defineProperty(e,"parse",{enumerable:!0,get:function get(){return i["default"];}});var l=t(277);Object.defineProperty(e,"stringify",{enumerable:!0,get:function get(){return l["default"];}});},/* 276 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=T;var r=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,i=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,l={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},a={"#":["id","equals"],".":["class","element"]},c=/* @__PURE__ */new Set(["has","not","matches"]),m=/* @__PURE__ */new Set(["contains","icontains"]),f=/* @__PURE__ */new Set(['"',"'"]);function v(h,p,d){var g=parseInt(p,16)-65536;return g!==g||d?p:g<0?// BMP codepoint
321
- String.fromCharCode(g+65536):// Supplemental Plane codepoint (surrogate pair)
322
- String.fromCharCode(g>>10|55296,g&1023|56320);}function S(h){return h.replace(n,v);}function E(h){return h===" "||h==="\n"||h===" "||h==="\f"||h==="\r";}function T(h,p){var d=[];if(h=P(d,""+h,p),h!=="")throw new Error("Unmatched selector: "+h);return d;}function P(h,p,d){var g=[],O=!1;function w(){var rt=p.match(r);if(!rt)throw new Error("Expected name, found "+p);var lt=rt[0];return p=p.substr(lt.length),S(lt);}function L(rt){for(;E(p.charAt(rt));)rt++;p=p.substr(rt);}function B(rt){for(var lt=0;p.charAt(--rt)==="\\";)lt++;return(lt&1)===1;}for(L(0);p!=="";){var A=p.charAt(0);if(E(A))O=!0,L(1);else if(A in o)g.push({type:o[A]}),O=!1,L(1);else if(A===","){if(g.length===0)throw new Error("Empty sub-selector");h.push(g),g=[],O=!1,L(1);}else if(O&&(g.length>0&&g.push({type:"descendant"}),O=!1),A==="*")p=p.substr(1),g.push({type:"universal"});else if(A in a){var b=a[A],W=b[0],D=b[1];p=p.substr(1),g.push({type:"attribute",name:W,action:D,value:w(),ignoreCase:!1});}else if(A==="["){p=p.substr(1);var R=p.match(i);if(!R)throw new Error("Malformed attribute selector: "+p);p=p.substr(R[0].length);var X=S(R[1]);(!d||("lowerCaseAttributeNames"in d?d.lowerCaseAttributeNames:!d.xmlMode))&&(X=X.toLowerCase()),g.push({type:"attribute",name:X,action:l[R[2]],value:S(R[4]||R[5]||""),ignoreCase:!!R[6]});}else if(A===":"){if(p.charAt(1)===":"){p=p.substr(2),g.push({type:"pseudo-element",name:w().toLowerCase()});continue;}p=p.substr(1);var H=w().toLowerCase(),R=null;if(p.charAt(0)==="(")if(c.has(H)){var J=p.charAt(1),et=f.has(J);if(p=p.substr(et?2:1),R=[],p=P(R,p,d),et){if(p.charAt(0)!==J)throw new Error("Unmatched quotes in :"+H);p=p.substr(1);}if(p.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+H+" ("+p+")");p=p.substr(1);}else{for(var it=1,$=1;$>0&&it<p.length;it++)p.charAt(it)==="("&&!B(it)?$++:p.charAt(it)===")"&&!B(it)&&$--;if($)throw new Error("Parenthesis not matched");if(R=p.substr(1,it-2),p=p.substr(it),m.has(H)){var J=R.charAt(0);J===R.slice(-1)&&f.has(J)&&(R=R.slice(1,-1)),R=S(R);}}g.push({type:"pseudo",name:H,data:R});}else if(r.test(p)){var V=w();(!d||("lowerCaseTags"in d?d.lowerCaseTags:!d.xmlMode))&&(V=V.toLowerCase()),g.push({type:"tag",name:V});}else return g.length&&g[g.length-1].type==="descendant"&&g.pop(),x(h,g),p;}return x(h,g),p;}function x(h,p){if(h.length>0&&p.length===0)throw new Error("Empty sub-selector");h.push(p);}},/* 277 *//***/function(u,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(a){return a.map(i).join(", ");}e["default"]=n;function i(a){return a.map(l).join("");}function l(a){switch(a.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return a.name;case"pseudo-element":return"::"+a.name;case"pseudo":return a.data===null?":"+a.name:typeof a.data=="string"?":"+a.name+"("+a.data+")":":"+a.name+"("+n(a.data)+")";case"attribute":return a.action==="exists"?"["+a.name+"]":a.name==="id"&&a.action==="equals"&&!a.ignoreCase?"#"+a.value:a.name==="class"&&a.action==="element"&&!a.ignoreCase?"."+a.value:"["+a.name+r[a.action]+"='"+a.value+"'"+(a.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function o(a){return a;}},/* 278 *//***/function(u,e,t){u.exports=i;var r=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function i(o){for(var a=o.map(l),c=1;c<o.length;c++){var m=a[c];if(!(m<0))for(var f=c-1;f>=0&&m<a[f];f--){var v=o[f+1];o[f+1]=o[f],o[f]=v,a[f+1]=a[f],a[f]=m;}}}function l(o){var a=r[o.type];if(a===r.attribute)a=n[o.action],a===n.equals&&o.name==="id"&&(a=9),o.ignoreCase&&(a>>=1);else if(a===r.pseudo)if(!o.data)a=3;else if(o.name==="has"||o.name==="contains")a=0;else if(o.name==="matches"||o.name==="not"){a=0;for(var c=0;c<o.data.length;c++)if(o.data[c].length===1){var m=l(o.data[c][0]);if(m===0){a=0;break;}m>a&&(a=m);}o.data.length>1&&a>0&&(a-=1);}else a=1;return a;}},/* 279 *//***/function(u){u.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 *//***/function(u,e,t){var r=t(281),n=t(282);u.exports={__proto__:null,attribute:r.compile,pseudo:n.compile,//tags
323
- tag:function tag(i,l,o){var a=l.name,c=o.adapter;return function(f){return c.getName(f)===a&&i(f);};},//traversal
324
- descendant:function descendant(i,l,o){var a=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,c=o.adapter;return function(f){for(var v=!1;!v&&(f=c.getParent(f));)(!a||!a.has(f))&&(v=i(f),!v&&a&&a.add(f));return v;};},_flexibleDescendant:function _flexibleDescendant(i,l,o){var a=o.adapter;return function(m){for(var f=i(m);!f&&(m=a.getParent(m));)f=i(m);return f;};},parent:function parent(i,l,o){if(o&&o.strict)throw new Error("Parent selector isn't part of CSS3");var a=o.adapter;return function(f){return a.getChildren(f).some(c);};function c(m){return a.isTag(m)&&i(m);}},child:function child(i,l,o){var a=o.adapter;return function(m){var f=a.getParent(m);return!!f&&i(f);};},sibling:function sibling(i,l,o){var a=o.adapter;return function(m){for(var f=a.getSiblings(m),v=0;v<f.length;v++)if(a.isTag(f[v])){if(f[v]===m)break;if(i(f[v]))return!0;}return!1;};},adjacent:function adjacent(i,l,o){var a=o.adapter;return function(m){for(var f=a.getSiblings(m),v,S=0;S<f.length;S++)if(a.isTag(f[S])){if(f[S]===m)break;v=f[S];}return!!v&&i(v);};},universal:function universal(i){return i;}};},/* 281 *//***/function(u,e,t){var r=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,i={__proto__:null,equals:function equals(l,o,a){var c=o.name,m=o.value,f=a.adapter;return o.ignoreCase?(m=m.toLowerCase(),function(S){var E=f.getAttributeValue(S,c);return E!=null&&E.toLowerCase()===m&&l(S);}):function(S){return f.getAttributeValue(S,c)===m&&l(S);};},hyphen:function hyphen(l,o,a){var c=o.name,m=o.value,f=m.length,v=a.adapter;return o.ignoreCase?(m=m.toLowerCase(),function(E){var T=v.getAttributeValue(E,c);return T!=null&&(T.length===f||T.charAt(f)==="-")&&T.substr(0,f).toLowerCase()===m&&l(E);}):function(E){var T=v.getAttributeValue(E,c);return T!=null&&T.substr(0,f)===m&&(T.length===f||T.charAt(f)==="-")&&l(E);};},element:function element(l,o,a){var c=o.name,m=o.value,f=a.adapter;if(/\s/.test(m))return r;m=m.replace(n,"\\$&");var v="(?:^|\\s)"+m+"(?:$|\\s)",S=o.ignoreCase?"i":"",E=new RegExp(v,S);return function(P){var x=f.getAttributeValue(P,c);return x!=null&&E.test(x)&&l(P);};},exists:function exists(l,o,a){var c=o.name,m=a.adapter;return function(v){return m.hasAttrib(v,c)&&l(v);};},start:function start(l,o,a){var c=o.name,m=o.value,f=m.length,v=a.adapter;return f===0?r:o.ignoreCase?(m=m.toLowerCase(),function(E){var T=v.getAttributeValue(E,c);return T!=null&&T.substr(0,f).toLowerCase()===m&&l(E);}):function(E){var T=v.getAttributeValue(E,c);return T!=null&&T.substr(0,f)===m&&l(E);};},end:function end(l,o,a){var c=o.name,m=o.value,f=-m.length,v=a.adapter;return f===0?r:o.ignoreCase?(m=m.toLowerCase(),function(E){var T=v.getAttributeValue(E,c);return T!=null&&T.substr(f).toLowerCase()===m&&l(E);}):function(E){var T=v.getAttributeValue(E,c);return T!=null&&T.substr(f)===m&&l(E);};},any:function any(l,o,a){var c=o.name,m=o.value,f=a.adapter;if(m==="")return r;if(o.ignoreCase){var v=new RegExp(m.replace(n,"\\$&"),"i");return function(E){var T=f.getAttributeValue(E,c);return T!=null&&v.test(T)&&l(E);};}return function(E){var T=f.getAttributeValue(E,c);return T!=null&&T.indexOf(m)>=0&&l(E);};},not:function not(l,o,a){var c=o.name,m=o.value,f=a.adapter;return m===""?function(S){return!!f.getAttributeValue(S,c)&&l(S);}:o.ignoreCase?(m=m.toLowerCase(),function(S){var E=f.getAttributeValue(S,c);return E!=null&&E.toLowerCase()!==m&&l(S);}):function(S){return f.getAttributeValue(S,c)!==m&&l(S);};}};u.exports={compile:function compile(l,o,a){if(a&&a.strict&&(o.ignoreCase||o.action==="not"))throw new Error("Unsupported attribute selector");return i[o.action](l,o,a);},rules:i};},/* 282 *//***/function(u,e,t){var r=t(283),n=t(273),i=t(281),l=n.trueFunc,o=n.falseFunc,a=i.rules.equals;function c(x,h){var p={name:x,value:h};return function(g,O,w){return a(g,p,w);};}function m(x,h){return function(p){return!!h.getParent(p)&&x(p);};}var f={contains:function contains(x,h,p){var d=p.adapter;return function(O){return x(O)&&d.getText(O).indexOf(h)>=0;};},icontains:function icontains(x,h,p){var d=h.toLowerCase(),g=p.adapter;return function(w){return x(w)&&g.getText(w).toLowerCase().indexOf(d)>=0;};},//location specific methods
325
- "nth-child":function nthChild(x,h,p){var d=r(h),g=p.adapter;return d===o?d:d===l?m(x,g):function(w){for(var L=g.getSiblings(w),B=0,A=0;B<L.length;B++)if(g.isTag(L[B])){if(L[B]===w)break;A++;}return d(A)&&x(w);};},"nth-last-child":function nthLastChild(x,h,p){var d=r(h),g=p.adapter;return d===o?d:d===l?m(x,g):function(w){for(var L=g.getSiblings(w),B=0,A=L.length-1;A>=0;A--)if(g.isTag(L[A])){if(L[A]===w)break;B++;}return d(B)&&x(w);};},"nth-of-type":function nthOfType(x,h,p){var d=r(h),g=p.adapter;return d===o?d:d===l?m(x,g):function(w){for(var L=g.getSiblings(w),B=0,A=0;A<L.length;A++)if(g.isTag(L[A])){if(L[A]===w)break;g.getName(L[A])===g.getName(w)&&B++;}return d(B)&&x(w);};},"nth-last-of-type":function nthLastOfType(x,h,p){var d=r(h),g=p.adapter;return d===o?d:d===l?m(x,g):function(w){for(var L=g.getSiblings(w),B=0,A=L.length-1;A>=0;A--)if(g.isTag(L[A])){if(L[A]===w)break;g.getName(L[A])===g.getName(w)&&B++;}return d(B)&&x(w);};},//TODO determine the actual root element
326
- root:function root(x,h,p){var d=p.adapter;return function(g){return!d.getParent(g)&&x(g);};},scope:function scope(x,h,p,d){var g=p.adapter;if(!d||d.length===0)return f.root(x,h,p);function O(w,L){return typeof g.equals=="function"?g.equals(w,L):w===L;}return d.length===1?function(w){return O(d[0],w)&&x(w);}:function(w){return d.indexOf(w)>=0&&x(w);};},//jQuery extensions (others follow as pseudos)
327
- checkbox:c("type","checkbox"),file:c("type","file"),password:c("type","password"),radio:c("type","radio"),reset:c("type","reset"),image:c("type","image"),submit:c("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
328
- hover:function hover(x,h,p){var d=p.adapter;return typeof d.isHovered=="function"?function(O){return x(O)&&d.isHovered(O);}:o;},visited:function visited(x,h,p){var d=p.adapter;return typeof d.isVisited=="function"?function(O){return x(O)&&d.isVisited(O);}:o;},active:function active(x,h,p){var d=p.adapter;return typeof d.isActive=="function"?function(O){return x(O)&&d.isActive(O);}:o;}};function v(x,h){for(var p=0;x&&p<x.length;p++)if(h.isTag(x[p]))return x[p];}var S={empty:function empty(x,h){return!h.getChildren(x).some(function(p){return h.isTag(p)||p.type==="text";});},"first-child":function firstChild(x,h){return v(h.getSiblings(x),h)===x;},"last-child":function lastChild(x,h){for(var p=h.getSiblings(x),d=p.length-1;d>=0;d--){if(p[d]===x)return!0;if(h.isTag(p[d]))break;}return!1;},"first-of-type":function firstOfType(x,h){for(var p=h.getSiblings(x),d=0;d<p.length;d++)if(h.isTag(p[d])){if(p[d]===x)return!0;if(h.getName(p[d])===h.getName(x))break;}return!1;},"last-of-type":function lastOfType(x,h){for(var p=h.getSiblings(x),d=p.length-1;d>=0;d--)if(h.isTag(p[d])){if(p[d]===x)return!0;if(h.getName(p[d])===h.getName(x))break;}return!1;},"only-of-type":function onlyOfType(x,h){for(var p=h.getSiblings(x),d=0,g=p.length;d<g;d++)if(h.isTag(p[d])){if(p[d]===x)continue;if(h.getName(p[d])===h.getName(x))return!1;}return!0;},"only-child":function onlyChild(x,h){for(var p=h.getSiblings(x),d=0;d<p.length;d++)if(h.isTag(p[d])&&p[d]!==x)return!1;return!0;},//:matches(a, area, link)[href]
329
- link:function link(x,h){return h.hasAttrib(x,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
330
- //forms
331
- //to consider: :target
332
- //:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
333
- selected:function selected(x,h){if(h.hasAttrib(x,"selected"))return!0;if(h.getName(x)!=="option")return!1;var p=h.getParent(x);if(!p||h.getName(p)!=="select"||h.hasAttrib(p,"multiple"))return!1;for(var d=h.getChildren(p),g=!1,O=0;O<d.length;O++)if(h.isTag(d[O]))if(d[O]===x)g=!0;else if(g){if(h.hasAttrib(d[O],"selected"))return!1;}else return!1;return g;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
334
- //:matches(
335
- // :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
336
- // optgroup[disabled] > option),
337
- // fieldset[disabled] * //TODO not child of first <legend>
338
- //)
339
- disabled:function disabled(x,h){return h.hasAttrib(x,"disabled");},enabled:function enabled(x,h){return!h.hasAttrib(x,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
340
- checked:function checked(x,h){return h.hasAttrib(x,"checked")||S.selected(x,h);},//:matches(input, select, textarea)[required]
341
- required:function required(x,h){return h.hasAttrib(x,"required");},//:matches(input, select, textarea):not([required])
342
- optional:function optional(x,h){return!h.hasAttrib(x,"required");},//jQuery extensions
343
- //:not(:empty)
344
- parent:function parent(x,h){return!S.empty(x,h);},//:matches(h1, h2, h3, h4, h5, h6)
345
- header:E(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
346
- button:function button(x,h){var p=h.getName(x);return p==="button"||p==="input"&&h.getAttributeValue(x,"type")==="button";},//:matches(input, textarea, select, button)
347
- input:E(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
348
- text:function text(x,h){var p;return h.getName(x)==="input"&&(!(p=h.getAttributeValue(x,"type"))||p.toLowerCase()==="text");}};function E(x){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var h=new Set(x);return function(p,d){return h.has(d.getName(p));};}return function(p,d){return x.indexOf(d.getName(p))>=0;};}function T(x,h,p){if(p===null){if(x.length>2&&h!=="scope")throw new Error("pseudo-selector :"+h+" requires an argument");}else if(x.length===2)throw new Error("pseudo-selector :"+h+" doesn't have any arguments");}var P=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;u.exports={compile:function compile(x,h,p,d){var g=h.name,O=h.data,w=p.adapter;if(p&&p.strict&&!P.test(g))throw new Error(":"+g+" isn't part of CSS3");if(typeof f[g]=="function")return f[g](x,O,p,d);if(typeof S[g]=="function"){var L=S[g];return T(L,g,O),L===o?L:x===l?function(A){return L(A,w,O);}:function(A){return L(A,w,O)&&x(A);};}else throw new Error("unmatched pseudo-class :"+g);},filters:f,pseudos:S};},/* 283 *//***/function(u,e,t){var r=t(284),n=t(285);u.exports=function(l){return n(r(l));},u.exports.parse=r,u.exports.compile=n;},/* 284 *//***/function(u,e){u.exports=r;var t=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/;function r(n){if(n=n.trim().toLowerCase(),n==="even")return[2,0];if(n==="odd")return[2,1];var i=n.match(t);if(!i)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var l;return i[1]?(l=parseInt(i[1],10),isNaN(l)&&(i[1].charAt(0)==="-"?l=-1:l=1)):l=0,[l,i[3]?parseInt((i[2]||"")+i[3],10):0];}},/* 285 *//***/function(u,e,t){u.exports=l;var r=t(273),n=r.trueFunc,i=r.falseFunc;function l(o){var a=o[0],c=o[1]-1;if(c<0&&a<=0)return i;if(a===-1)return function(f){return f<=c;};if(a===0)return function(f){return f===c;};if(a===1)return c<0?n:function(f){return f>=c;};var m=c%a;return m<0&&(m+=a),a>1?function(f){return f>=c&&f%a===m;}:(a*=-1,function(f){return f<=c&&f%a===m;});}},/* 286 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return O;});var r=t(12),n=t(74),i=t(1),l=t(68),o=t(250),a=t(213),c=t(218);t(1).glMatrix.setMatrixArrayType(Array);function m(w,L){if(w==null)return{};var B=f(w,L),A,b;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(w);for(b=0;b<W.length;b++)A=W[b],!(L.indexOf(A)>=0)&&Object.prototype.propertyIsEnumerable.call(w,A)&&(B[A]=w[A]);}return B;}function f(w,L){if(w==null)return{};var B={},A=Object.keys(w),b,W;for(W=0;W<A.length;W++)b=A[W],!(L.indexOf(b)>=0)&&(B[b]=w[b]);return B;}var v={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
349
- },S=Symbol("autoRender"),E=Symbol("renderer"),T=Symbol("timeline"),P=Symbol("prepareRender"),x=Symbol("tickRender"),h=Symbol("pass"),p=Symbol("fbo"),d=Symbol("tickers"),g=Symbol("layerTransformInvert");var O=/*#__PURE__*/function(_o$default){function O(){var _this36;var L=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);if(_this36=_callSuper(this,O),!L.canvas){var _this36$getResolution=_this36.getResolution(),W=_this36$getResolution.width,D=_this36$getResolution.height,R=r.ENV.createCanvas(W,D,{offscreen:!!L.offscreen,id:L.id,extra:L.extra});R.style&&(R.style.position="absolute"),R.dataset&&(R.dataset.layerId=L.id),R.contextType&&(L.contextType=R.contextType),L.canvas=R;}var B=L.canvas,A=Object.assign({},v,L);_this36[S]=A.autoRender,delete L.autoRender;var b=A.Renderer||r.Renderer;_this36[E]=new b(B,A),_this36.options=L,_this36.id=L.id,_this36[h]=[],_this36.setResolution(B),_this36.canvas=B,_this36[T]=new n.Timeline(),_this36.__mouseCapturedTarget=null,_this36[g]=null;return _this36;}_inherits(O,_o$default);return _createClass(O,[{key:"autoRender",get:function get(){return this[S];}},{key:"displayRatio",get:function get(){return this.parent&&this.parent.options?this.parent.options.displayRatio:1;}},{key:"height",get:function get(){var _this$getResolution=this.getResolution(),L=_this$getResolution.height;return L/this.displayRatio;}},{key:"gl",get:function get(){return this.renderer.glRenderer?this.renderer.glRenderer.gl:null;}/* override */},{key:"layer",get:function get(){return this;}},{key:"offscreen",get:function get(){return!!this.options.offscreen||this.canvas._offscreen;}},{key:"pass",get:function get(){return this[h];}},{key:"prepareRender",get:function get(){return this[P]?this[P]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[E];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,L=_this$parent$options.left,B=_this$parent$options.top;return[L,B];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[T];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),L=_this$getResolution2.width;return L/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,L=_this$attributes21.x,B=_this$attributes21.y;return[1,0,0,1,L,B];}},{key:"layerTransformInvert",get:function get(){if(this[g])return this[g];var L=this.transformMatrix;return L[0]===1&&L[1]===0&&L[2]===0&&L[3]===1&&L[4]===0&&L[5]===0?null:(this[g]=i.mat2d.invert(Array.of(0,0,0,0,0,0),L),this[g]);}},{key:"forceContextLoss",value:function forceContextLoss(){var L=this.renderer.glRenderer;if(L){var B=L.getExtension("WEBGL_lose_context");if(B)return B.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
350
- // return true;
351
- // }
352
- },{key:"addPass",value:function addPass(){var _ref149=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref149.vertex,B=_ref149.fragment,A=_ref149.options,b=_ref149.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),W=_this$getResolution3.width,D=_this$getResolution3.height,R=this.renderer.createPassProgram({vertex:L,fragment:B,options:A}),X=new r.Figure2D();X.rect(0,0,W/this.displayRatio,D/this.displayRatio);var H=new r.Mesh2D(X);return H.setUniforms(b),H.setProgram(R),this[h].push(H),this.forceUpdate(),H;}return null;}// delete unused texture to release memory.
353
- },{key:"deleteTexture",value:function deleteTexture(L){return Object(c.deleteTexture)(L,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(L){var B=L.type;if(B==="mousedown"||B==="mouseup"||B==="mousemove"){var R=this.__mouseCapturedTarget;if(R){if(R.layer===this)return R.dispatchEvent(L),!0;this.__mouseCapturedTarget=null;}}var A,b;var W=this.layerTransformInvert;if(W){A=L.x,b=L.y;var _R6=W,X=_R6[0]*A+_R6[2]*b+_R6[4],H=_R6[1]*A+_R6[3]*b+_R6[5];delete L.x,delete L.y,delete L.layerX,delete L.layerY,Object.defineProperties(L,{layerX:{value:X,configurable:!0},layerY:{value:H,configurable:!0},x:{value:X,configurable:!0},y:{value:H,configurable:!0}});}var D=_superPropGet(O,"dispatchPointerEvent",this,3)([L]);return W&&Object.defineProperties(L,{layerX:{value:A,configurable:!0},layerY:{value:b,configurable:!0},x:{value:A,configurable:!0},y:{value:b,configurable:!0}}),D;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this37=this;if(!this[P])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var L=null;var B=new Promise(function(A){L=A;});B._resolve=L,this[P]=B;}else{var _L2=null,_B8=null;var A=new Promise(function(b){_L2=b,_this37[S]&&(_B8=Object(l.requestAnimationFrame)(function(){delete A._requestID,_this37.render();}));});A._resolve=_L2,A._requestID=_B8,this[P]=A;}}},{key:"getFBO",value:function getFBO(){var L=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),B=_this$getResolution4.width,A=_this$getResolution4.height;return L&&(!this[p]||this[p].width!==B||this[p].height!==A)?(this[p]={width:B,height:A,target:L.createFBO(),buffer:L.createFBO(),swap:function swap(){var _ref150=[this.buffer,this.target];this.target=_ref150[0];this.buffer=_ref150[1];}},this[p]):this[p]?this[p]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var L=this.renderer,B=L.__globalTransformMatrix||L.globalTransformMatrix;L.__globalTransformMatrix=B;var A=i.mat2d.fromValues(1,0,0,1,0,0);L.setGlobalTransform.apply(L,_toConsumableArray(i.mat2d.multiply(A,B,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(L,B,A){if(_superPropGet(O,"onPropertyChange",this,3)([L,B,A]),L==="zIndex"&&(this.canvas.style.zIndex=B),L==="transform"||L==="translate"||L==="rotate"||L==="scale"||L==="skew"){var b=this[g];if(this[g]=null,this.updateGlobalTransform(),b&&!this.layerTransformInvert){var W=this.renderer,D=W.__globalTransformMatrix||W.globalTransformMatrix;W.setGlobalTransform.apply(W,_toConsumableArray(D));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[P]&&(this[P]._requestID&&Object(l.cancelAnimationFrame)(this[P]._requestID),this[P]._resolve(),delete this[P]);}},{key:"render",value:function render(){var _this38=this;var _ref151=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref151$clear=_ref151.clear,L=_ref151$clear===void 0?!0:_ref151$clear;var B=this[h].length?this.getFBO():null;B&&this.renderer.glRenderer.bindFBO(B.target),L&&this[E].clear();var A=this.draw();if(A&&A.length&&(this.renderer.drawMeshes(A),this.canvas.draw&&this.canvas.draw()),B){var b=this.renderer.glRenderer,W=this[h].length,_this$getResolution5=this.getResolution(),D=_this$getResolution5.width,R=_this$getResolution5.height,X=[0,0,D/this.displayRatio,R/this.displayRatio];this[h].forEach(function(H,J){H.blend=!0,H.setTexture(B.target.texture,{rect:X}),J===W-1?b.bindFBO(null):(B.swap(),b.bindFBO(B.target)),_this38[E].clear(),_this38.renderer.drawMeshes([H]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref152){var _this39=this;var L=_ref152.width,B=_ref152.height;var A=this.renderer,b=A.__globalTransformMatrix||A.globalTransformMatrix,W=b[4],D=b[5],R=b[0],_this$getResolution6=this.getResolution(),X=_this$getResolution6.width,H=_this$getResolution6.height;(X!==L||H!==B)&&(_superPropGet(O,"setResolution",this,3)([{width:L,height:B}]),this.canvas&&(this.canvas.width=L,this.canvas.height=B,A.updateResolution&&A.updateResolution()),this.attributes.size=[L,B],this[h].length&&this[h].forEach(function($){var V=new r.Figure2D();V.rect(0,0,L/_this39.displayRatio,B/_this39.displayRatio),$.contours=V.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),J=_this$renderOffset[0],et=_this$renderOffset[1],it=this.displayRatio;(W!==J||D!==et||R!==it)&&(A.setGlobalTransform(it,0,0,it,J,et),A.__globalTransformMatrix=null,this[g]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
354
- * tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
355
- * @param {*} handler
356
- * @param {*} options
357
- */},{key:"tick",value:function tick(){var _this40=this;var L=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var B=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _B$duration=B.duration,A=_B$duration===void 0?1/0:_B$duration,b=m(B,["duration"]);var W=this.timeline.fork(b),D=this;this[d]=this[d]||[],this[d].push({handler:L,duration:A});var _R7=function R(){var X=null,H=null;var J=function J(){var et=_this40[d].map(function(_ref153){var it=_ref153.handler,$=_ref153.duration;var V=Math.min(1,W.currentTime/$);return{value:it?it(W.currentTime,V):null,p:V};});D[x]||(D[x]=Promise.resolve().then(function(){D[S]&&D.render(),delete D[x];for(var it=et.length-1;it>=0;it--){var _et$it=et[it],$=_et$it.value,V=_et$it.p;($===!1||V>=1)&&_this40[d].splice(it,1);}_this40[d].length>0&&_R7();}));};if(_this40[P]&&_this40[P]._type!=="ticker"&&(Object(l.cancelAnimationFrame)(_this40[P]._requestID),delete _this40[P]),!_this40[P]){var et=new Promise(function(it){X=it,H=Object(l.requestAnimationFrame)(J);});et._resolve=X,et._requestID=H,et._type="ticker",_this40[P]=et;}};_R7();}},{key:"toGlobalPos",value:function toGlobalPos(L,B){if(this.layerTransformInvert){var X=this.transformMatrix;L=X[0]*L+X[2]*B+X[4],B=X[1]*L+X[3]*B+X[5];}var _this$getResolution7=this.getResolution(),A=_this$getResolution7.width,b=_this$getResolution7.height,W=this.renderOffset,D=[this.canvas.clientWidth,this.canvas.clientHeight];L=L*D[0]/A+W[0],B=B*D[1]/b+W[1];var R=this.displayRatio;return L*=R,B*=R,[L,B];}},{key:"toLocalPos",value:function toLocalPos(L,B){var _this$getResolution8=this.getResolution(),A=_this$getResolution8.width,b=_this$getResolution8.height,W=this.renderOffset,D=[this.canvas.clientWidth,this.canvas.clientHeight];L=L*A/D[0]-W[0],B=B*b/D[1]-W[1];var R=this.displayRatio;L/=R,B/=R;var X=this.layerTransformInvert;return X&&(L=X[0]*L+X[2]*B+X[4],B=X[1]*L+X[3]*B+X[5]),[L,B];}}]);}(o["default"]);a["default"].registerNode(O,"layer");},/* 287 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return P;});var r=t(224),n=t(288),i=t(213),l=t(252),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function a(x,h){if(x==null)return{};var p=c(x,h),d,g;if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(x);for(g=0;g<O.length;g++)d=O[g],!(h.indexOf(d)>=0)&&Object.prototype.propertyIsEnumerable.call(x,d)&&(p[d]=x[d]);}return p;}function c(x,h){if(x==null)return{};var p={},d=Object.keys(x),g,O;for(O=0;O<d.length;O++)g=d[O],!(h.indexOf(g)>=0)&&(p[g]=x[g]);return p;}function m(x,h,p){return h in x?Object.defineProperty(x,h,{value:p,enumerable:!0,configurable:!0,writable:!0}):x[h]=p,x;}var f="http://www.w3.org/2000/svg",v=Symbol["for"]("spritejs_setAttribute"),S=Symbol("root"),E=Symbol("task");function T(x){var h=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var p=x[S];if(p&&p.children[0]){var d=x.svg,g=x.layer?x.layer.displayRatio:1;if(!d.hasAttribute("data-original-width")){var L=d.getAttribute("width");L=L?Object(o.sizeToPixel)(L):300;var B=d.getAttribute("height");B=B?Object(o.sizeToPixel)(B):150,d.hasAttribute("viewBox")||d.setAttribute("viewBox","0 0 ".concat(Math.round(L)," ").concat(Math.round(B))),d.setAttribute("data-original-width",L),d.setAttribute("data-original-height",B);}var O=x.attributes.width||Number(d.getAttribute("data-original-width")),w=x.attributes.height||Number(d.getAttribute("data-original-height"));if(O*=g,w*=g,h&&x.attributes.flexible){var _L3=x.attributes.scale[0];if(O*=_L3,w*=_L3,d.setAttribute("width",O),d.setAttribute("height",w),O&&w&&x.textureImage){var _B9=x.textureImage.width,A=x.textureImage.height,b=x.clientSize;x.attributes.textureRect=[0,0,Math.round(b[0]*_B9/O),Math.round(b[1]*A/w)];}}else x[E]||(d.setAttribute("width",O),d.setAttribute("height",w),x[E]=Promise.resolve().then(function(){delete x[E];var L=p.innerHTML,B=new Blob([L],{type:"image/svg+xml"}),A=URL.createObjectURL(B),b=new Image();b.onload=function(){b.width&&b.height?(x.attributes[v]("texture",b),x.attributes.flexible&&(x.attributes.textureRect=null)):x.attributes[v]("texture",null);},b.src=A;}));}}var P=/*#__PURE__*/function(_r$default21){function P(){var _this41;var h=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,P);typeof h=="string"&&(h={svgText:h});var _h25=h,p=_h25.svgText,d=a(h,["svgText"]);if(_this41=_callSuper(this,P,[d]),_this41[S]=document.createElement("div"),p){_this41[S].innerHTML=p;var g=_this41[S].children[0];g?g.setAttribute("xmlns",f):(fetch(p).then(function(O){return O.text();}).then(function(O){_this41[S].innerHTML=O,(!_this41.observer||_this41.attributes.flexible)&&T(_assertThisInitialized(_this41));}),p=null);}if(!p){var _g7=document.createElementNS(f,"svg");_g7.setAttribute("xmlns",f),_this41[S].appendChild(_g7);}if(typeof MutationObserver=="function"){var _g8=new MutationObserver(function(O){T(_this41,!1);});_g8.observe(_this41[S],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this41.observer=_g8;}return _this41;}_inherits(P,_r$default21);return _createClass(P,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[S]?this[S].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref154){var h=_ref154.width,p=_ref154.height;_superPropGet(P,"setResolution",this,3)([{width:h,height:p}]),T(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(h){var p=_superPropGet(P,"dispatchPointerEvent",this,3)([h]);if(p&&this.attributes.passEvents&&typeof MouseEvent=="function"){var d=h.x,g=h.y;var _this$getOffsetPositi=this.getOffsetPosition(d,g),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),O=_this$getOffsetPositi2[0],w=_this$getOffsetPositi2[1];var L=h.originalEvent,B=this.attributes.anchor,A=this.clientSize;O=(O+B[0]*A[0])/2,w=(w+B[1]*A[1])/2;var b=h.type;if(b===L.type){var W=null;if(L instanceof MouseEvent)W=new MouseEvent(b,{screenX:O,screenY:w,clientX:O,clientY:w,bubbles:L.bubbles,button:L.button,buttons:L.buttons,cancelBubble:L.cancelBubble,cancelable:L.cancelable,currentTarget:L.currentTarget,fromElement:L.fromElement,relatedTarget:L.relatedTarget,returnValue:L.returnValue,srcElement:L.srcElement,target:L.target,toElement:L.toElement,// view: originalEvent.view,
358
- which:L.witch});else if(L instanceof TouchEvent){var D=null;var R=L.changedTouches||[L];for(var X=0;X<R.length;X++){var H=R[X];if(h.identifier===H.identifier){D=H;break;}}if(D){var _X3=new Touch({identifier:D.identifier,target:D.target,clientX:O,clientY:w,screenX:O,screenY:w,pageX:O,pageY:w,radiusX:D.radiusX,radiusY:D.radiusY,rotationAngle:D.rotationAngle,force:D.force});W=new TouchEvent(b,{cancelable:L.cancelable,bubbles:L.bubbles,composed:L.composed,touches:[_X3],targetTouches:[_X3],changedTouches:[_X3]});}}else W=L;W&&this.svg.dispatchEvent(W);}}return p;}},{key:"getElementById",value:function getElementById(h){return Object(l.querySelector)("#".concat(h),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(h){return Object(l.querySelectorAll)(".".concat(h),this);}},{key:"getElementsByName",value:function getElementsByName(h){return Object(l.querySelectorAll)("[name=\"".concat(h,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(h){return Object(l.querySelectorAll)(h,this);}},{key:"querySelector",value:function querySelector(h){return Object(l.querySelector)(h,this);}},{key:"querySelectorAll",value:function querySelectorAll(h){return Object(l.querySelectorAll)(h,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(h,p,d){_superPropGet(P,"onPropertyChange",this,3)([h,p,d]),h==="flexible"&&T(this),this.attributes.flexible&&(h==="width"||h==="height"||h==="scale"||h==="transform")&&T(this);}}]);}(r["default"]);m(P,"Attr",n["default"]),i["default"].registerNode(P,"spritesvg");},/* 288 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return o;});var r=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),i=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_setAttributeDefault");var o=/*#__PURE__*/function(_r$default22){function o(c){var _this42;_classCallCheck(this,o);_this42=_callSuper(this,o,[c]),_this42[l]({passEvents:!1,flexible:!1});return _this42;}// readonly
359
- _inherits(o,_r$default22);return _createClass(o,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(c){}// eslint-disable-line no-empty-function
360
- },{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(c){return this[i]("passEvents",c);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(c){return this[i]("flexible",c);}}]);}(r["default"]);},/* 289 *//***/function(u,e,t){t.r(e);var r=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(c,m){var f=Object.keys(c);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(c);m&&(v=v.filter(function(S){return Object.getOwnPropertyDescriptor(c,S).enumerable;})),f.push.apply(f,v);}return f;}function i(c){for(var m=1;m<arguments.length;m++){var f=arguments[m]!=null?arguments[m]:{};m%2?n(Object(f),!0).forEach(function(v){l(c,v,f[v]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(f)):n(Object(f)).forEach(function(v){Object.defineProperty(c,v,Object.getOwnPropertyDescriptor(f,v));});}return c;}function l(c,m,f){return m in c?Object.defineProperty(c,m,{value:f,enumerable:!0,configurable:!0,writable:!0}):c[m]=f,c;}var o=Symbol("inited");var a=null;typeof Worker=="function"&&(a=/*#__PURE__*/function(_Worker){function a(c){var _this43;_classCallCheck(this,a);if(c.worker===!0&&(c.worker="./".concat(c.id,".worker.js")),_this43=_callSuper(this,a,[c.worker]),_this43.options=c,!c.canvas){var _this43$getResolution=_this43.getResolution(),m=_this43$getResolution.width,f=_this43$getResolution.height,v=r.ENV.createCanvas(m,f,{offscreen:!1});v.style&&(v.style.position="absolute"),v.dataset&&(v.dataset.layerId=c.id),c.canvas=v;}_this43.canvas=c.canvas;return _this43;}_inherits(a,_Worker);return _createClass(a,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref155){var c=_ref155.width,m=_ref155.height;if(this[o])this.postMessage({type:"resolution_change",width:c,height:m});else{this.canvas.width=c,this.canvas.height=m;var f=this.options,v=f.canvas.transferControlToOffscreen(),S=i({},f);delete S.container,S.canvas=v,this.postMessage({type:"create",options:S},[v]),this[o]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas7=this.canvas,c=_this$canvas7.width,m=_this$canvas7.height;return{width:c,height:m};}return{width:300,height:150};}},{key:"remove",value:function remove(){return this.parent&&this.parent.removeChild?(this.parent.removeChild(this),!0):!1;}},{key:"connect",value:function connect(c,m){Object.defineProperty(this,"parent",{value:c,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:m,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(c){this.postMessage({type:"event",event:{cancelBubble:c.cancelBubble,bubbles:c.bubbles,detail:c.detail,identifier:c.identifier,layerX:c.layerX,layerY:c.layerY,originalX:c.originalX,originalY:c.originalY,type:c.type,x:c.x,y:c.y}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),e["default"]=a;},/* 290 *//***/function(u,e,t){t.r(e),function(r){t.d(e,"default",function(){return O;});var n=t(12),i=t(68),l=t(70),o=t(286),a=t(289),c=t(250),m=t(291),f=t(214),v=t(218),S=t(213);t(1).glMatrix.setMatrixArrayType(Array);var E=Symbol("enteredTargets");function T(w){return w.id=w.id||"_layer".concat(Math.random().toString(36).slice(2,12)),w.dataset||(w.dataset={}),w.dataset.layerId=w.id,w.connect=function(L,B){w.parent=L,Object.defineProperty(w,"zOrder",{value:B,writable:!1,configurable:!0});},w.disconnect=function(L){delete w.zOrder;},w.canvas=w,w.getResolution=function(){return{width:0,height:0};},w.setResolution=function(){return!1;},w.options={handleEvent:!1},w;}function P(w,L){var B=w.children;var A=null;for(var b=0;b<B.length;b++){var W=B[b];if((L===W||A!=null)&&(A=W),A&&A!==L&&!A.offscreen)return A.canvas;}return null;}function x(w,L){var _w$renderOffset=_slicedToArray(w.renderOffset,2),B=_w$renderOffset[0],A=_w$renderOffset[1],_w$getResolution=w.getResolution(),b=_w$getResolution.width,W=_w$getResolution.height,D=w.displayRatio;w.renderer.drawImage(L.canvas,-B/D,-A/D,b/D,W/D);}var h={};function p(w){var L=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],B=w.container;B.addEventListener("mouseleave",function(A){var b=w[E];if(b.size){var W=new f["default"]("mouseleave");W.setOriginalEvent(A),_toConsumableArray(b).forEach(function(D){D.dispatchEvent(W);}),w[E].clear();}},{passive:!0}),L.forEach(function(A){B.addEventListener(A,function(b){var _w$options=w.options,W=_w$options.left,D=_w$options.top,R=_w$options.displayRatio,X=w.orderedChildren;Object(m["default"])(b,{offsetLeft:W,offsetTop:D,displayRatio:R}).forEach(function(J){var et=J.identifier;if(J.type==="touchmove"||J.type==="touchend"){var $=h[et];$&&$.dispatchEvent(J),J.type==="touchend"&&delete h[et];}else{for(var _$=X.length-1;_$>=0;_$--){var V=X[_$];if(V.options.handleEvent!==!1){if(V.dispatchPointerEvent(J)&&J.target!==V)break;J.cancelBubble=!1;}}if(J.target===X[0])for(var _$2=X.length-1;_$2>=0;_$2--){var _V=X[_$2];if(_V.options.handleEvent!==!1){J.target=_V;break;}}}var it=J.target;if(J.type==="touchstart"&&(h[et]=J.target),J.type==="mousemove"){var _$3=w[E];var _V2;if(it){var ct=it.ancestors||[];_V2=/* @__PURE__ */new Set([it].concat(_toConsumableArray(ct)));}else _V2=/* @__PURE__ */new Set();var rt=Object.entries(b);if(!_$3.has(it)&&it){var _ct2=new f["default"]("mouseenter");_ct2.setOriginalEvent(b),rt.forEach(function(_ref156){var _ref157=_slicedToArray(_ref156,2),st=_ref157[0],Ct=_ref157[1];_ct2[st]=Ct;}),_$3.add(it),it.dispatchEvent(_ct2);var gt=it.ancestors;gt&&gt.forEach(function(st){st instanceof l["default"]&&!_$3.has(st)&&(_$3.add(st),st.dispatchEvent(_ct2));});}var lt=new f["default"]("mouseleave");lt.setOriginalEvent(b),rt.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),ct=_ref159[0],gt=_ref159[1];lt[ct]=gt;}),_toConsumableArray(_$3).forEach(function(ct){_V2.has(ct)||(_$3["delete"](ct),ct.dispatchEvent(lt));});}});},{passive:A!=="contextmenu"});});}function d(w,L){if(L&&L.style){var B=w.width,A=w.height,b=w.mode,W=w.container;var D=W.clientWidth,R=W.clientHeight;B=B||D,A=A||R,b==="static"?(L.style.width="".concat(B,"px"),L.style.height="".concat(A,"px")):(L.style.top="0",L.style.left="0",L.style.width="".concat(D,"px"),L.style.height="".concat(R,"px"),L.style.transform="",L.style.webkitTransform="");}}var g=Symbol("offscreenLayerCount");var O=/*#__PURE__*/function(_c$default){/**
361
- width
362
- height
363
- mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
364
- */function O(){var _this44;var L=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);if(_this44=_callSuper(this,O),!L.container)if(typeof n.ENV.Container=="function")L.container=new n.ENV.Container(L.width||300,L.height||150);else throw new Error("No container specified.");if(_this44.container=L.container,_this44.container.style&&(_this44.container.style.overflow||(_this44.container.style.overflow="hidden"),_this44.container.style.position||(_this44.container.style.position="relative")),_this44.options=L,L.displayRatio=L.displayRatio||1,L.mode=L.mode||"scale",L.left=0,L.top=0,L.autoResize=L.autoResize!==!1,L.autoResize){var B;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?B=globalThis:B=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:r,B.addEventListener){var A=_this44;B.addEventListener("resize",function b(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(A.container)?A.resize():B.removeEventListener("resize",b);});}}_this44[E]=/* @__PURE__ */new Set(),_this44.setResolution(L),p(_this44),_this44[g]=0;return _this44;}_inherits(O,_c$default);return _createClass(O,[{key:"hasOffscreenCanvas",get:function get(){return this[g]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(L){this.options.displayRatio!==L&&(this.options.displayRatio=L,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(L){this.options.height!==L&&(this.options.height=L,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(L){this.options.mode!==L&&(this.options.mode=L,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(L){this.options.width!==L&&(this.options.width=L,this.resize());}},{key:"appendChild",value:function appendChild(L){!(L instanceof o["default"])&&!(L instanceof a["default"])&&T(L);var B=_superPropGet(O,"appendChild",this,3)([L]),A=L.canvas;return L.offscreen?this[g]++:this.container.appendChild(A),d(this.options,A),L.setResolution(this.getResolution()),B;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this45=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(i.requestAnimationFrame)(function(){delete _this45._requestID,_this45.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(L,B){!(L instanceof o["default"])&&!(L instanceof a["default"])&&T(L);var A=_superPropGet(O,"insertBefore",this,3)([L,B]),b=L.canvas;if(!L.offscreen){var W=P(this,L);this.container.insertBefore(b,W);}return d(this.options,b),L.setResolution(this.getResolution()),A;}},{key:"layer",value:function layer(){var L=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var B=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};B=Object.assign({},this.options,B),B.id=L;var A=this.orderedChildren;for(var D=0;D<A.length;D++)if(A[D].id===L)return A[D];var b=B.worker;var W;return b?W=new a["default"](B):W=new o["default"](B),this.appendChild(W),W;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _this46=this;var _len13,L,_key13,B,A,b,_loop2,W,_args11=arguments;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:for(_len13=_args11.length,L=new Array(_len13),_key13=0;_key13<_len13;_key13++){L[_key13]=_args11[_key13];}B=[],A=[],b=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(W){var D,R,X,H;return _regeneratorRuntime().wrap(function _loop2$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:D=L[W];if(typeof D=="string")R=Object(v.loadTexture)(D);else if(Array.isArray(D))R=Object(v.loadFrames).apply(void 0,_toConsumableArray(D));else{X=D.id,H=D.src;R=Object(v.loadTexture)(H,X);}R instanceof Promise||(R=Promise.resolve(R)),A.push(R.then(function(X){B.push(X),b[W]=X;var H=new f["default"]({type:"preload",detail:{current:X,loaded:B,resources:L}});_this46.dispatchEvent(H);}));case 3:case"end":return _context10.stop();}},_loop2);});W=0;case 4:if(!(W<L.length)){_context11.next=9;break;}return _context11.delegateYield(_loop2(W),"t0",6);case 6:W++;_context11.next=4;break;case 9:_context11.next=11;return Promise.all(A);case 11:return _context11.abrupt("return",b);case 12:case"end":return _context11.stop();}},_callee10);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(L){var B=_superPropGet(O,"removeChild",this,3)([L]);if(B){L._prepareRenderFinished&&L._prepareRenderFinished();var A=L.canvas;A&&A.remove&&A.remove(),L.offscreen&&this[g]--;}return B;}// for offscreen mode rendering
365
- },{key:"render",value:function render(){var L=this.orderedChildren;var B=null;var A=[];for(var b=0;b<L.length;b++){var W=L[b],D=A.length>0;if(W instanceof o["default"]&&!W.offscreen){if(!W.autoRender)D&&(console.warn("Some offscreen canvas will not be rendered."),A.length=0);else if(B=W,D){W.renderer.clear();for(var R=0;R<A.length;R++){var X=A[R];X.render(),x(W,X);}A.length=0,W.render({clear:!1});}else W.prepareRender&&W.render();}else W.offscreen?B?(W.prepareRender&&W.render(),x(B,W)):A.push(W):W instanceof a["default"]&&D&&(console.warn("Some offscreen canvas will not be rendered."),A.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(L,B){var A=_superPropGet(O,"replaceChild",this,3)([L,B]);B.canvas.remove&&B.canvas.remove(),B.offscreen&&this[g]--;var b=L.canvas;if(!L.offscreen){var W=P(this,L);this.container.insertBefore(b,W);}return d(this.options,b),L.setResolution(this.getResolution()),A;}},{key:"resize",value:function resize(){var L=this.options;this.children.forEach(function(B){d(L,B.canvas);}),this.setResolution(L),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _L4,_B10;var _ref160=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref160.width,B=_ref160.height;var A=this.container,b=A.clientWidth,W=A.clientHeight;(L==null||B==null)&&(L=(_L4=L)!==null&&_L4!==void 0?_L4:b,B=(_B10=B)!==null&&_B10!==void 0?_B10:W);var _this$options=this.options,D=_this$options.mode,R=_this$options.displayRatio;if(L*=R,B*=R,this.options.left=0,this.options.top=0,D==="stickyHeight"||D==="stickyLeft"||D==="stickyRight"){var X=L;L=b*B/W,D==="stickyHeight"&&(this.options.left=0.5*(L-X)),D==="stickyRight"&&(this.options.left=L-X);}else if(D==="stickyWidth"||D==="stickyTop"||D==="stickyBottom"){var _X4=B;B=W*L/b,D==="stickyWidth"&&(this.options.top=0.5*(B-_X4)),D==="stickyBottom"&&(this.options.top=B-_X4);}_superPropGet(O,"setResolution",this,3)([{width:L,height:B}]);}},{key:"snapshot",value:function snapshot(){var _ref161=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref161$offscreen=_ref161.offscreen,L=_ref161$offscreen===void 0?!1:_ref161$offscreen,B=_ref161.layers;var A=L?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),b=_this$getResolution9.width,W=_this$getResolution9.height;this[A]=this[A]||n.ENV.createCanvas(b,W,{offscreen:L});var D=this[A].getContext("2d");B=B||this.orderedChildren,this[A].width=b,this[A].height=W;for(var R=0;R<B.length;R++){var X=B[R];if(!X.options.ignoreSnapshot){X.render&&X.render();var H=X.canvas;H&&H!==X&&D.drawImage(H,0,0,b,W);}}return this[A];}}]);}(c["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(O.prototype.layer3d=function(w){var _this47=this;var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var B=L.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(A,b){var W=document.createElement("script");W.async=!1,W.src=B,W.onload=function(){try{A(_this47.layer3d(w,L));}catch(D){b(D);}},document.documentElement.appendChild(W);});}),S["default"].registerNode(O,"scene");}.call(this,t(22));},/* 291 *//***/function(u,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(i){var _ref162=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref162$offsetTop=_ref162.offsetTop,l=_ref162$offsetTop===void 0?0:_ref162$offsetTop,_ref162$offsetLeft=_ref162.offsetLeft,o=_ref162$offsetLeft===void 0?0:_ref162$offsetLeft,_ref162$displayRatio=_ref162.displayRatio,a=_ref162$displayRatio===void 0?1:_ref162$displayRatio;var c,m;var f=[],_i$target$getBounding=i.target.getBoundingClientRect(),v=_i$target$getBounding.left,S=_i$target$getBounding.top,E=_i$target$getBounding.width,T=_i$target$getBounding.height,P=i.target.width,x=i.target.height,h=i.changedTouches||[i];for(var d=0;d<h.length;d++){var g=h[d],O=g.identifier,w=g.clientX,L=g.clientY;w!=null&&L!=null&&f.push({x:Math.round((w|0)-v),y:Math.round((L|0)-S),identifier:O});}f.length<=0&&f.push({x:c,y:m});var p=[];return f.forEach(function(d){d.x!=null&&d.y!=null&&(c=(d.x*P/E-o)/a,m=(d.y*x/T-l)/a);var g=new r["default"](i);Object.defineProperties(g,{layerX:{value:c,configurable:!0},layerY:{value:m,configurable:!0},originalX:{value:d.x},originalY:{value:d.y},x:{value:c,configurable:!0},y:{value:m,configurable:!0},identifier:{value:d.identifier}}),p.push(g);}),p;}}/******/]);te.version;te.Arc;te.Block;te.Cloud;te.Color;var io=te.Ellipse;te.Gradient;var ye=te.Group,so=te.Label,$r=te.Layer;te.LayerWorker;te.Node;te.Parallel;var be=te.Path,we=te.Polyline,xn=te.Rect;te.Regular;te.Ring;var di=te.Scene,pi=te.Sprite;te.SpriteSvg;te.Star;te.Triangle;te.helpers;te.createElement;te.isSpriteNode;te.registerNode;te.requestAnimationFrame;te.cancelAnimationFrame;te.ENV;var Zt=/* @__PURE__ */function(u){return u.Normal="Normal",u.Stroke="Stroke",u.Dotted="Dotted",u.LongDotted="LongDotted",u;}(Zt||{}),$t=/* @__PURE__ */function(u){return u.None="None",u.ShowFloatBar="ShowFloatBar",u.ZIndexFloatBar="ZIndexFloatBar",u.DeleteNode="DeleteNode",u.CopyNode="CopyNode",u.ZIndexActive="ZIndexActive",u.ZIndexNode="ZIndexNode",u.RotateNode="RotateNode",u.SetColorNode="SetColorNode",u.TranslateNode="TranslateNode",u.ScaleNode="ScaleNode",u.OriginalEvent="OriginalEvent",u.CreateScene="CreateScene",u.ActiveCursor="ActiveCursor",u.MoveCursor="MoveCursor",u.CommandEditor="CommandEditor",u.SetEditorData="SetEditorData",u.SetFontStyle="SetFontStyle",u.SetPoint="SetPoint",u.SetLock="SetLock",u.SetShapeOpt="SetShapeOpt",u.CameraChange="CameraChange",u.ActiveMethod="ActiveMethod",u.HidFloatBarBtn="HidFloatBarBtn",u;}($t||{}),pt=/* @__PURE__ */function(u){return u[u.Pencil=1]="Pencil",u[u.Eraser=2]="Eraser",u[u.PencilEraser=3]="PencilEraser",u[u.BitMapEraser=4]="BitMapEraser",u[u.Selector=5]="Selector",u[u.Clicker=6]="Clicker",u[u.Arrow=7]="Arrow",u[u.Hand=8]="Hand",u[u.LaserPen=9]="LaserPen",u[u.Text=10]="Text",u[u.Straight=11]="Straight",u[u.Rectangle=12]="Rectangle",u[u.Ellipse=13]="Ellipse",u[u.Star=14]="Star",u[u.Triangle=15]="Triangle",u[u.Rhombus=16]="Rhombus",u[u.Polygon=17]="Polygon",u[u.SpeechBalloon=18]="SpeechBalloon",u[u.Image=19]="Image",u;}(pt||{}),Dt=/* @__PURE__ */function(u){return u[u.Local=1]="Local",u[u.Service=2]="Service",u[u.Worker=3]="Worker",u;}(Dt||{}),Ft=/* @__PURE__ */function(u){return u[u.Pending=0]="Pending",u[u.Start=1]="Start",u[u.Doing=2]="Doing",u[u.Done=3]="Done",u[u.Unwritable=4]="Unwritable",u;}(Ft||{}),dt=/* @__PURE__ */function(u){return u[u.None=0]="None",u[u.Init=1]="Init",u[u.UpdateCamera=2]="UpdateCamera",u[u.UpdateTools=3]="UpdateTools",u[u.CreateWork=4]="CreateWork",u[u.DrawWork=5]="DrawWork",u[u.FullWork=6]="FullWork",u[u.UpdateNode=7]="UpdateNode",u[u.RemoveNode=8]="RemoveNode",u[u.Clear=9]="Clear",u[u.Select=10]="Select",u[u.Destroy=11]="Destroy",u[u.Snapshot=12]="Snapshot",u[u.BoundingBox=13]="BoundingBox",u[u.Cursor=14]="Cursor",u[u.TextUpdate=15]="TextUpdate",u[u.GetTextActive=16]="GetTextActive",u[u.TasksQueue=17]="TasksQueue",u[u.CursorHover=18]="CursorHover",u[u.CursorBlur=19]="CursorBlur",u[u.Console=20]="Console",u[u.GetImageBitMap=23]="GetImageBitMap",u[u.AuthWriter=24]="AuthWriter",u[u.AuthReader=25]="AuthReader",u[u.AuthClear=26]="AuthClear",u[u.AuthPage=27]="AuthPage",u[u.GetVNodeInfo=28]="GetVNodeInfo",u[u.UpdateDpr=29]="UpdateDpr",u[u.SetFontFace=30]="SetFontFace",u;}(dt||{}),Et=/* @__PURE__ */function(u){return u[u.None=0]="None",u[u.Bg=1]="Bg",u[u.ServiceFloat=2]="ServiceFloat",u[u.Float=3]="Float",u[u.TopFloat=4]="TopFloat",u;}(Et||{}),Qt=/* @__PURE__ */function(u){return u[u.none=1]="none",u[u.all=2]="all",u[u.both=3]="both",u[u.proportional=4]="proportional",u;}(Qt||{}),Pe=/* @__PURE__ */function(u){return u[u.inside=0]="inside",u[u.outside=1]="outside",u[u.intersect=2]="intersect",u;}(Pe||{}),Qr=/* @__PURE__ */function(u){return u.Image="image",u.Iconify="iconify",u;}(Qr||{});var Ie=/*#__PURE__*/function(){function Ie(){_classCallCheck(this,Ie);ot(this,"localWork");ot(this,"serviceWork");ot(this,"threadEngine");}return _createClass(Ie,[{key:"registerForWorker",value:function registerForWorker(e){return this.threadEngine=e,this.localWork=e.localWork,this.serviceWork=e.serviceWork,this;}}]);}();var oo=/*#__PURE__*/function(_Ie){function oo(){var _this48;_classCallCheck(this,oo);_this48=_callSuper(this,oo,arguments);ot(_this48,"emitEventType",$t.CopyNode);return _this48;}_inherits(oo,_Ie);return _createClass(oo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.FullWork&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(t){var n,r;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:r=t.workId;_context12.t0=r;if(!_context12.t0){_context12.next=5;break;}_context12.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t);case 5:case"end":return _context12.stop();}},_callee11,this);}));function consumeForLocalWorker(_x40){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(Ie);var Je="++",qt="selector",ao="all";var lo=/*#__PURE__*/function(_Ie2){function lo(){var _this49;_classCallCheck(this,lo);_this49=_callSuper(this,lo,arguments);ot(_this49,"emitEventType",$t.SetColorNode);return _this49;}_inherits(lo,_Ie2);return _createClass(lo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(t){var c,r,n,i,l,o,a;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker;_context13.t0=r===qt&&n;if(!_context13.t0){_context13.next=5;break;}_context13.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,textUpdateForWoker:a,callback:this.updateSelectorCallback});case 5:case"end":return _context13.stop();}},_callee12,this);}));function consumeForLocalWorker(_x41){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=r.willSyncService,o=r.isSync,a=r.textUpdateForWoker,c=n.render||[],m=n.sp||[];if(l){var _iterator3=_createForOfIteratorHelper(i.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),f=_step3$value[0],v=_step3$value[1];a&&v.toolsType===pt.Text?m.push(_objectSpread(_objectSpread({},v),{},{workId:f,type:dt.TextUpdate,dataType:Dt.Local,willSyncService:!0})):m.push(_objectSpread(_objectSpread({},v),{},{workId:f,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return{render:c,sp:m};}}]);}(Ie);var co=/*#__PURE__*/function(_Ie3){function co(){var _this50;_classCallCheck(this,co);_this50=_callSuper(this,co,arguments);ot(_this50,"emitEventType",$t.ZIndexNode);return _this50;}_inherits(co,_Ie3);return _createClass(co,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(t){var a,r,n,i,l,o;return _regeneratorRuntime().wrap(function _callee13$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData;_context14.t0=r===qt&&n;if(!_context14.t0){_context14.next=5;break;}_context14.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context14.stop();}},_callee13,this);}));function consumeForLocalWorker(_x42){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=r.willSyncService,o=r.isSync,a=n.render||[],c=n.sp||[];if(l&&c){var _iterator4=_createForOfIteratorHelper(i.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),m=_step4$value[0],f=_step4$value[1];c.push(_objectSpread(_objectSpread({},f),{},{workId:m,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:a,sp:c};}}]);}(Ie);var fo=/*#__PURE__*/function(_Ie4){function fo(){var _this51;_classCallCheck(this,fo);_this51=_callSuper(this,fo,arguments);ot(_this51,"emitEventType",$t.TranslateNode);return _this51;}_inherits(fo,_Ie4);return _createClass(fo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(t){var f,v,r,n,i,l,o,a,c,m;return _regeneratorRuntime().wrap(function _callee14$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker,c=t.emitEventType,m=t.smoothSync;_context15.t0=r===qt&&n;if(!_context15.t0){_context15.next=9;break;}if(!(n.workState===Ft.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Ft.Done)){_context15.next=8;break;}_context15.next=6;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,isSync:!0,textUpdateForWoker:a,emitEventType:c,callback:this.updateSelectorCallback,smoothSync:m});case 6:_context15.next=9;break;case 8:n.workState===Ft.Done&&((v=this.localWork)==null||v.vNodes.deleteLastTarget());case 9:case"end":return _context15.stop();}},_callee14,this);}));function consumeForLocalWorker(_x43){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=t.workShapeNode,o=t.res,a=t.smoothSync,c=r.willSyncService,m=r.isSync,f=r.updateSelectorOpt,v=r.textUpdateForWoker,S=f.workState,E=n.render||[],T=n.sp||[];if(S===Ft.Start)return{sp:[],render:[]};var P=o==null?void 0:o.selectRect;if(c){T.push({type:dt.Select,selectIds:l.selectIds,selectRect:P,willSyncService:S===Ft.Done?!0:a,isSync:!0,points:S===Ft.Done&&l.getChildrenPoints()||void 0,textOpt:l.textOpt});var _x44={useAnimation:f.useAnimation||!1};f.uid&&(_x44.uid=f.uid);var _iterator5=_createForOfIteratorHelper(i.entries()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _step5$value=_slicedToArray(_step5.value,2),_h26=_step5$value[0],p=_step5$value[1];v&&p.toolsType===pt.Text?T.push(_objectSpread(_objectSpread({},p),{},{workId:_h26,type:dt.TextUpdate,dataType:Dt.Local,willSyncService:S===Ft.Done?!0:a,updateNodeOpt:_x44})):(a||S===Ft.Done)&&T.push(_objectSpread(_objectSpread({},p),{},{workId:_h26,type:dt.UpdateNode,updateNodeOpt:_x44,isSync:m}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return{render:E,sp:T};}}]);}(Ie);var ho=/*#__PURE__*/function(_Ie5){function ho(){var _this52;_classCallCheck(this,ho);_this52=_callSuper(this,ho,arguments);ot(_this52,"emitEventType",$t.DeleteNode);return _this52;}_inherits(ho,_Ie5);return _createClass(ho,[{key:"consume",value:function consume(){return!1;}}]);}(Ie);var uo=/*#__PURE__*/function(_Ie6){function uo(){var _this53;_classCallCheck(this,uo);_this53=_callSuper(this,uo,arguments);ot(_this53,"emitEventType",$t.ScaleNode);return _this53;}_inherits(uo,_Ie6);return _createClass(uo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(t){var a,r,n,i,l,o;return _regeneratorRuntime().wrap(function _callee15$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willSyncService,l=t.willSerializeData,o=t.smoothSync;_context16.t0=r===qt&&n;if(!_context16.t0){_context16.next=5;break;}_context16.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:l,isSync:!0,callback:this.updateSelectorCallback.bind(this),smoothSync:o});case 5:case"end":return _context16.stop();}},_callee15,this);}));function consumeForLocalWorker(_x45){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.workShapeNode,l=t.res,o=t.newServiceStore,a=t.smoothSync,c=r.updateSelectorOpt,m=r.willSyncService,f=c.workState,v=n.render||[],S=n.sp||[],E=l==null?void 0:l.selectRect;if(f===Ft.Start)return{sp:[],render:[]};if(m){S.push({type:dt.Select,selectIds:i.selectIds,selectRect:E,willSyncService:f===Ft.Done?!0:a,isSync:!0,points:f===Ft.Done&&i.getChildrenPoints()||void 0,textOpt:i.textOpt});var T={useAnimation:c.useAnimation||!1};c.uid&&(T.uid=c.uid);var _iterator6=_createForOfIteratorHelper(o.entries()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),P=_step6$value[0],_x46=_step6$value[1];_x46.toolsType===pt.Text?S.push(_objectSpread(_objectSpread({},_x46),{},{workId:P,type:dt.TextUpdate,dataType:Dt.Local,willSyncService:f===Ft.Done?!0:a,updateNodeOpt:T})):(a||f===Ft.Done)&&S.push(_objectSpread(_objectSpread({},_x46),{},{workId:P,type:dt.UpdateNode,updateNodeOpt:T,isSync:!0}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return{render:v,sp:S};}}]);}(Ie);var po=/*#__PURE__*/function(_Ie7){function po(){var _this54;_classCallCheck(this,po);_this54=_callSuper(this,po,arguments);ot(_this54,"emitEventType",$t.RotateNode);return _this54;}_inherits(po,_Ie7);return _createClass(po,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(t){var m,r,n,i,l,o,a,c;return _regeneratorRuntime().wrap(function _callee16$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.emitEventType,c=t.smoothSync;_context17.t0=r===qt&&n;if(!_context17.t0){_context17.next=5;break;}_context17.next=5;return(m=this.localWork)==null?void 0:m.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,emitEventType:a,isSync:!0,callback:this.updateSelectorCallback,smoothSync:c});case 5:case"end":return _context17.stop();}},_callee16,this);}));function consumeForLocalWorker(_x47){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.workShapeNode,l=t.res,o=t.newServiceStore,a=t.smoothSync,c=r.updateSelectorOpt,m=r.willSyncService,f=r.willSerializeData,v=r.isSync,S=c.workState,E=n.render||[],T=n.sp||[],P=l==null?void 0:l.selectRect;if(m){f&&S===Ft.Done&&T.push({type:dt.Select,selectIds:i.selectIds,selectRect:P,willSyncService:!0,isSync:v,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt,thickness:i.thickness,useStroke:i.useStroke,strokeType:i.strokeType});var _x48={useAnimation:c.useAnimation||!1};if(c.uid&&(_x48.uid=c.uid),a||S===Ft.Done){var _iterator7=_createForOfIteratorHelper(o.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),_h27=_step7$value[0],p=_step7$value[1];T.push(_objectSpread(_objectSpread({},p),{},{workId:_h27,type:dt.UpdateNode,updateNodeOpt:_x48,isSync:v}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}}return{render:E,sp:T};}}]);}(Ie);var mo=/*#__PURE__*/function(_Ie8){function mo(){var _this55;_classCallCheck(this,mo);_this55=_callSuper(this,mo,arguments);ot(_this55,"emitEventType",$t.SetFontStyle);return _this55;}_inherits(mo,_Ie8);return _createClass(mo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(t){var c,r,n,i,l,o,a;return _regeneratorRuntime().wrap(function _callee17$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker;_context18.t0=r===qt&&n;if(!_context18.t0){_context18.next=5;break;}_context18.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,textUpdateForWoker:a,callback:this.updateSelectorCallback});case 5:case"end":return _context18.stop();}},_callee17,this);}));function consumeForLocalWorker(_x49){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,c=r.isSync,m=r.updateSelectorOpt,f=r.textUpdateForWoker,v=n.render||[],S=n.sp||[],E=o==null?void 0:o.selectRect;if(a&&S){m.fontSize&&S.push({type:dt.Select,selectIds:l.selectIds,selectRect:E,willSyncService:a,isSync:c,points:l.getChildrenPoints()});var _iterator8=_createForOfIteratorHelper(i.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),T=_step8$value[0],P=_step8$value[1];f&&P.toolsType===pt.Text?S.push(_objectSpread(_objectSpread({},P),{},{workId:T,type:dt.TextUpdate,dataType:Dt.Local,willSyncService:!0})):S.push(_objectSpread(_objectSpread({},P),{},{workId:T,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}return{render:v,sp:S};}}]);}(Ie);var vo=/*#__PURE__*/function(_Ie9){function vo(){var _this56;_classCallCheck(this,vo);_this56=_callSuper(this,vo,arguments);ot(_this56,"emitEventType",$t.SetPoint);return _this56;}_inherits(vo,_Ie9);return _createClass(vo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(t){var c,r,n,i,l,o,a;return _regeneratorRuntime().wrap(function _callee18$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData,a=t.textUpdateForWoker;_context19.t0=r===qt&&n;if(!_context19.t0){_context19.next=5;break;}_context19.next=5;return(c=this.localWork)==null?void 0:c.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,emitEventType:this.emitEventType,willSerializeData:o,isSync:!0,textUpdateForWoker:a,callback:this.updateSelectorCallback});case 5:case"end":return _context19.stop();}},_callee18,this);}));function consumeForLocalWorker(_x50){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,c=r.isSync,m=n.render||[],f=n.sp||[],v=o==null?void 0:o.selectRect;if(a&&f){var _iterator9=_createForOfIteratorHelper(i.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),S=_step9$value[0],E=_step9$value[1];f.push(_objectSpread(_objectSpread({},E),{},{workId:S,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}f.push({type:dt.Select,selectIds:l.selectIds,selectRect:v,willSyncService:a,isSync:c,points:l.getChildrenPoints()});}return{render:m,sp:f};}}]);}(Ie);var yo=/*#__PURE__*/function(_Ie10){function yo(){var _this57;_classCallCheck(this,yo);_this57=_callSuper(this,yo,arguments);ot(_this57,"emitEventType",$t.SetLock);return _this57;}_inherits(yo,_Ie10);return _createClass(yo,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(t){var a,r,n,i,l,o;return _regeneratorRuntime().wrap(function _callee19$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData;_context20.t0=r===qt&&n;if(!_context20.t0){_context20.next=5;break;}_context20.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context20.stop();}},_callee19,this);}));function consumeForLocalWorker(_x51){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=t.workShapeNode,o=t.res,a=r.willSyncService,c=r.isSync,m=r.updateSelectorOpt,f=n.render||[],v=n.sp||[],S=o==null?void 0:o.selectRect;if(a&&v){var _iterator10=_createForOfIteratorHelper(i.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),E=_step10$value[0],T=_step10$value[1];v.push(_objectSpread(_objectSpread({},T),{},{workId:E,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}v.push({isLocked:m.isLocked,selectorColor:l.selectorColor,scaleType:l.scaleType,canRotate:l.canRotate,type:dt.Select,selectIds:l.selectIds,selectRect:S,willSyncService:a,isSync:c});}return{render:f,sp:v};}}]);}(Ie);var go=/*#__PURE__*/function(_Ie11){function go(){var _this58;_classCallCheck(this,go);_this58=_callSuper(this,go,arguments);ot(_this58,"emitEventType",$t.SetShapeOpt);return _this58;}_inherits(go,_Ie11);return _createClass(go,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,i=t.emitEventType;if(r===dt.UpdateNode&&n===Dt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(t){var a,r,n,i,l,o;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:r=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,l=t.willSyncService,o=t.willSerializeData;_context21.t0=r===qt&&n;if(!_context21.t0){_context21.next=5;break;}_context21.next=5;return(a=this.localWork)==null?void 0:a.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:l,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context21.stop();}},_callee20,this);}));function consumeForLocalWorker(_x52){return _consumeForLocalWorker10.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,i=t.newServiceStore,l=r.willSyncService,o=r.isSync,a=n.render||[],c=n.sp||[];if(l&&c){var _iterator11=_createForOfIteratorHelper(i.entries()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var _step11$value=_slicedToArray(_step11.value,2),m=_step11$value[0],f=_step11$value[1];c.push(_objectSpread(_objectSpread({},f),{},{workId:m,type:dt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}}return{render:a,sp:c};}}]);}(Ie);var mi=/*#__PURE__*/function(){function mi(e){var _this59=this;_classCallCheck(this,mi);ot(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(e.map(function(t){return[t,_this59.build(t)];}));}return _createClass(mi,[{key:"build",value:function build(e){switch(e){case $t.TranslateNode:return new fo();case $t.ZIndexNode:return new co();case $t.CopyNode:return new oo();case $t.SetColorNode:return new lo();case $t.DeleteNode:return new ho();case $t.ScaleNode:return new uo();case $t.RotateNode:return new po();case $t.SetFontStyle:return new mo();case $t.SetPoint:return new vo();case $t.SetLock:return new yo();case $t.SetShapeOpt:return new go();}}},{key:"registerForWorker",value:function registerForWorker(e){return this.builders.forEach(function(t){t&&t.registerForWorker(e);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(e){var _iterator12=_createForOfIteratorHelper(this.builders.values()),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var t=_step12.value;if(t!=null&&t.consume(e))return!0;}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}return!1;}}]);}();var Po={linear:function linear(u){return u;},easeInQuad:function easeInQuad(u){return u*u;},easeOutQuad:function easeOutQuad(u){return u*(2-u);},easeInOutQuad:function easeInOutQuad(u){return u<0.5?2*u*u:-1+(4-2*u)*u;},easeInCubic:function easeInCubic(u){return u*u*u;},easeOutCubic:function easeOutCubic(u){return--u*u*u+1;},easeInOutCubic:function easeInOutCubic(u){return u<0.5?4*u*u*u:(u-1)*(2*u-2)*(2*u-2)+1;},easeInQuart:function easeInQuart(u){return u*u*u*u;},easeOutQuart:function easeOutQuart(u){return 1- --u*u*u*u;},easeInOutQuart:function easeInOutQuart(u){return u<0.5?8*u*u*u*u:1-8*--u*u*u*u;},easeInQuint:function easeInQuint(u){return u*u*u*u*u;},easeOutQuint:function easeOutQuint(u){return 1+--u*u*u*u*u;},easeInOutQuint:function easeInOutQuint(u){return u<0.5?16*u*u*u*u*u:1+16*--u*u*u*u*u;},easeInSine:function easeInSine(u){return 1-Math.cos(u*Math.PI/2);},easeOutSine:function easeOutSine(u){return Math.sin(u*Math.PI/2);},easeInOutSine:function easeInOutSine(u){return-(Math.cos(Math.PI*u)-1)/2;},easeInExpo:function easeInExpo(u){return u<=0?0:Math.pow(2,10*u-10);},easeOutExpo:function easeOutExpo(u){return u>=1?1:1-Math.pow(2,-10*u);},easeInOutExpo:function easeInOutExpo(u){return u<=0?0:u>=1?1:u<0.5?Math.pow(2,20*u-10)/2:(2-Math.pow(2,-20*u+10))/2;}};var at=/*#__PURE__*/function(){function at(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;_classCallCheck(this,at);this.x=e,this.y=t,this.z=r;}return _createClass(at,[{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setz",value:function setz(e){return this.z=e,this;}},{key:"setXY",value:function setXY(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;return this.x=e,this.y=t,this;}},{key:"set",value:function set(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;return this.x=e,this.y=t,this.z=r,this;}},{key:"setTo",value:function setTo(_ref163){var _ref163$x=_ref163.x,e=_ref163$x===void 0?0:_ref163$x,_ref163$y=_ref163.y,t=_ref163$y===void 0?0:_ref163$y,_ref163$z=_ref163.z,r=_ref163$z===void 0?1:_ref163$z;return this.x=e,this.y=t,this.z=r,this;}},{key:"rot",value:function rot(e){if(e===0)return this;var t=this.x,r=this.y,n=Math.sin(e),i=Math.cos(e);return this.x=t*i-r*n,this.y=t*n+r*i,this;}},{key:"rotWith",value:function rotWith(e,t){if(t===0)return this;var r=this.x-e.x,n=this.y-e.y,i=Math.sin(t),l=Math.cos(t);return this.x=e.x+(r*l-n*i),this.y=e.y+(r*i+n*l),this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z;return new at(e,t,r);}},{key:"sub",value:function sub(e){return this.x-=e.x,this.y-=e.y,this;}},{key:"subXY",value:function subXY(e,t){return this.x-=e,this.y-=t,this;}},{key:"subScalar",value:function subScalar(e){return this.x-=e,this.y-=e,this;}},{key:"add",value:function add(e){return this.x+=e.x,this.y+=e.y,this;}},{key:"addXY",value:function addXY(e,t){return this.x+=e,this.y+=t,this;}},{key:"addScalar",value:function addScalar(e){return this.x+=e,this.y+=e,this;}},{key:"clamp",value:function clamp(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,e),t!==void 0&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this;}},{key:"div",value:function div(e){return this.x/=e,this.y/=e,this;}},{key:"divV",value:function divV(e){return this.x/=e.x,this.y/=e.y,this;}},{key:"mul",value:function mul(e){return this.x*=e,this.y*=e,this;}},{key:"mulV",value:function mulV(e){return this.x*=e.x,this.y*=e.y,this;}},{key:"abs",value:function abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this;}},{key:"nudge",value:function nudge(e,t){var r=at.Tan(e,this);return this.add(r.mul(t));}},{key:"neg",value:function neg(){return this.x*=-1,this.y*=-1,this;}},{key:"cross",value:function cross(e){return this.x=this.y*e.z-this.z*e.y,this.y=this.z*e.x-this.x*e.z,this;}},{key:"dpr",value:function dpr(e){return at.Dpr(this,e);}},{key:"cpr",value:function cpr(e){return at.Cpr(this,e);}},{key:"len2",value:function len2(){return at.Len2(this);}},{key:"len",value:function len(){return at.Len(this);}},{key:"pry",value:function pry(e){return at.Pry(this,e);}},{key:"per",value:function per(){var e=this.x,t=this.y;return this.x=t,this.y=-e,this;}},{key:"uni",value:function uni(){return at.Uni(this);}},{key:"tan",value:function tan(e){return at.Tan(this,e);}},{key:"dist",value:function dist(e){return at.Dist(this,e);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(e,t){return at.DistanceToLineSegment(e,t,this);}},{key:"slope",value:function slope(e){return at.Slope(this,e);}},{key:"snapToGrid",value:function snapToGrid(e){return this.x=Math.round(this.x/e)*e,this.y=Math.round(this.y/e)*e,this;}},{key:"angle",value:function angle(e){return at.Angle(this,e);}},{key:"toAngle",value:function toAngle(){return at.ToAngle(this);}},{key:"lrp",value:function lrp(e,t){return this.x=this.x+(e.x-this.x)*t,this.y=this.y+(e.y-this.y)*t,this;}},{key:"equals",value:function equals(e,t){return at.Equals(this,e,t);}},{key:"equalsXY",value:function equalsXY(e,t){return at.EqualsXY(this,e,t);}},{key:"norm",value:function norm(){var e=this.len();return this.x=e===0?0:this.x/e,this.y=e===0?0:this.y/e,this;}},{key:"toFixed",value:function toFixed(){return at.ToFixed(this);}},{key:"toString",value:function toString(){return at.ToString(at.ToFixed(this));}},{key:"toJson",value:function toJson(){return at.ToJson(this);}},{key:"toArray",value:function toArray(){return at.ToArray(this);}}],[{key:"Add",value:function Add(e,t){return new at(e.x+t.x,e.y+t.y);}},{key:"AddXY",value:function AddXY(e,t,r){return new at(e.x+t,e.y+r);}},{key:"Sub",value:function Sub(e,t){return new at(e.x-t.x,e.y-t.y);}},{key:"SubXY",value:function SubXY(e,t,r){return new at(e.x-t,e.y-r);}},{key:"AddScalar",value:function AddScalar(e,t){return new at(e.x+t,e.y+t);}},{key:"SubScalar",value:function SubScalar(e,t){return new at(e.x-t,e.y-t);}},{key:"Div",value:function Div(e,t){return new at(e.x/t,e.y/t);}},{key:"Mul",value:function Mul(e,t){return new at(e.x*t,e.y*t);}},{key:"DivV",value:function DivV(e,t){return new at(e.x/t.x,e.y/t.y);}},{key:"MulV",value:function MulV(e,t){return new at(e.x*t.x,e.y*t.y);}},{key:"Neg",value:function Neg(e){return new at(-e.x,-e.y);}},{key:"Per",value:function Per(e){return new at(e.y,-e.x);}},{key:"Dist2",value:function Dist2(e,t){return at.Sub(e,t).len2();}},{key:"Abs",value:function Abs(e){return new at(Math.abs(e.x),Math.abs(e.y));}},{key:"Dist",value:function Dist(e,t){return Math.hypot(e.y-t.y,e.x-t.x);}},{key:"Dpr",value:function Dpr(e,t){return e.x*t.x+e.y*t.y;}},{key:"Cross",value:function Cross(e,t){return new at(e.y*t.z-e.z*t.y,e.z*t.x-e.x*t.z// A.z = A.x * V.y - A.y * V.x
366
- );}},{key:"Cpr",value:function Cpr(e,t){return e.x*t.y-t.x*e.y;}},{key:"Len2",value:function Len2(e){return e.x*e.x+e.y*e.y;}},{key:"Len",value:function Len(e){return Math.hypot(e.x,e.y);}},{key:"Pry",value:function Pry(e,t){return at.Dpr(e,t)/at.Len(t);}},{key:"Uni",value:function Uni(e){return at.Div(e,at.Len(e));}},{key:"Tan",value:function Tan(e,t){return at.Uni(at.Sub(e,t));}},{key:"Min",value:function Min(e,t){return new at(Math.min(e.x,t.x),Math.min(e.y,t.y));}},{key:"Max",value:function Max(e,t){return new at(Math.max(e.x,t.x),Math.max(e.y,t.y));}},{key:"From",value:function From(e){return new at().add(e);}},{key:"FromArray",value:function FromArray(e){return new at(e[0],e[1]);}},{key:"Rot",value:function Rot(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=Math.sin(t),n=Math.cos(t);return new at(e.x*n-e.y*r,e.x*r+e.y*n);}},{key:"RotWith",value:function RotWith(e,t,r){var n=e.x-t.x,i=e.y-t.y,l=Math.sin(r),o=Math.cos(r);return new at(t.x+(n*o-i*l),t.y+(n*l+i*o));}/**
367
- * Get the nearest point on a line with a known unit vector that passes through point A
368
- *
369
- * ```ts
370
- * Vec.nearestPointOnLineThroughPoint(A, u, Point)
371
- * ```
372
- *
373
- * @param A - Any point on the line
374
- * @param u - The unit vector for the line.
375
- * @param P - A point not on the line to test.
376
- */},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(e,t,r){return at.Mul(t,at.Sub(r,e).pry(t)).add(e);}},{key:"NearestPointOnLineSegment",value:function NearestPointOnLineSegment(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var i=at.Tan(t,e),l=at.Add(e,at.Mul(i,at.Sub(r,e).pry(i)));if(n){if(l.x<Math.min(e.x,t.x))return at.Cast(e.x<t.x?e:t);if(l.x>Math.max(e.x,t.x))return at.Cast(e.x>t.x?e:t);if(l.y<Math.min(e.y,t.y))return at.Cast(e.y<t.y?e:t);if(l.y>Math.max(e.y,t.y))return at.Cast(e.y>t.y?e:t);}return l;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(e,t,r){return at.Dist(r,at.NearestPointOnLineThroughPoint(e,t,r));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return at.Dist(r,at.NearestPointOnLineSegment(e,t,r,n));}},{key:"Snap",value:function Snap(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new at(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}},{key:"Cast",value:function Cast(e){return e instanceof at?e:at.From(e);}},{key:"Slope",value:function Slope(e,t){return e.x===t.y?NaN:(e.y-t.y)/(e.x-t.x);}},{key:"Angle",value:function Angle(e,t){return Math.atan2(t.y-e.y,t.x-e.x);}},{key:"Lrp",value:function Lrp(e,t,r){return at.Sub(t,e).mul(r).add(e);}},{key:"Med",value:function Med(e,t){return new at((e.x+t.x)/2,(e.y+t.y)/2);}},{key:"Equals",value:function Equals(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(e.x-t.x)<r&&Math.abs(e.y-t.y)<r;}},{key:"EqualsXY",value:function EqualsXY(e,t,r){return e.x===t&&e.y===r;}},{key:"EqualsXYZ",value:function EqualsXYZ(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return at.Equals(e,t,r)&&Math.abs((e.z||0)-(t.z||0))<r;}},{key:"Clockwise",value:function Clockwise(e,t,r){return(r.x-e.x)*(t.y-e.y)-(t.x-e.x)*(r.y-e.y)<0;}},{key:"Rescale",value:function Rescale(e,t){var r=at.Len(e);return new at(t*e.x/r,t*e.y/r);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(e,t,r){return at.Sub(e,r).mul(t).add(r);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(e,t,r){return at.Sub(e,r).mulV(t).add(r);}},{key:"ToFixed",value:function ToFixed(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return new at(+e.x.toFixed(t),+e.y.toFixed(t),+e.z.toFixed(t));}},{key:"Nudge",value:function Nudge(e,t,r){return at.Add(e,at.Tan(t,e).mul(r));}},{key:"ToString",value:function ToString(e){return"".concat(e.x,", ").concat(e.y);}},{key:"ToAngle",value:function ToAngle(e){var t=Math.atan2(e.y,e.x);return t<0&&(t+=Math.PI*2),t;}},{key:"FromAngle",value:function FromAngle(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new at(Math.cos(e)*t,Math.sin(e)*t);}},{key:"ToArray",value:function ToArray(e){return[e.x,e.y,e.z];}},{key:"ToJson",value:function ToJson(e){var t=e.x,r=e.y,n=e.z;return{x:t,y:r,z:n};}},{key:"Average",value:function Average(e){var t=e.length,r=new at(0,0);for(var n=0;n<t;n++)r.add(e[n]);return r.div(t);}},{key:"Clamp",value:function Clamp(e,t,r){return r===void 0?new at(Math.min(Math.max(e.x,t)),Math.min(Math.max(e.y,t))):new at(Math.min(Math.max(e.x,t),r),Math.min(Math.max(e.y,t),r));}/**
377
- * Get an array of points (with simulated pressure) between two points.
378
- *
379
- * @param A - The first point.
380
- * @param B - The second point.
381
- * @param steps - The number of points to return.
382
- */},{key:"PointsBetween",value:function PointsBetween(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var i=0;i<r;i++){var l=Po.easeInQuad(i/(r-1)),o=at.Lrp(e,t,l);o.z=Math.min(1,0.5+Math.abs(0.5-So(l))*0.65),n.push(o);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new at(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}}]);}();var So=function So(u){return u<0.5?2*u*u:-1+(4-2*u)*u;};var Nt=/*#__PURE__*/function(_at){function Nt(){var _this60;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var l=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,Nt);_this60=_callSuper(this,Nt,[e,t,r]),_this60.x=e,_this60.y=t,_this60.z=r,_this60.v=n,_this60.t=i,_this60.a=l;return _this60;}_inherits(Nt,_at);return _createClass(Nt,[{key:"timestamp",get:function get(){return this.t;}},{key:"pressure",get:function get(){return this.z;}},{key:"angleNum",get:function get(){return this.a;}},{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setA",value:function setA(e){this.a=e;}},{key:"setT",value:function setT(e){this.t=e;}},{key:"setv",value:function setv(e){return this.v={x:e.x,y:e.y},this;}},{key:"set",value:function set(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var l=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=e,this.y=t,this.z=r,this.v=n,this.t=i,this.a=l,this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z,n=this.v,i=this.t,l=this.a,o={x:n.x,y:n.y};return new Nt(e,t,r,o,i,l);}},{key:"distance",value:function distance(e){return Nt.GetDistance(this,e);}},{key:"isNear",value:function isNear(e,t){return Nt.IsNear(this,e,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(e,t){return Nt.GetAngleByPoints(e,this,t);}}],[{key:"Sub",value:function Sub(e,t){return new Nt(e.x-t.x,e.y-t.y);}},{key:"Add",value:function Add(e,t){return new Nt(e.x+t.x,e.y+t.y);}},{key:"GetDistance",value:function GetDistance(e,t){return Nt.Len(e.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(e,t,r){var n=t.x-e.x,i=r.x-t.x,l=t.y-e.y,o=r.y-t.y;var a=0;var c=Math.sqrt(n*n+l*l),m=Math.sqrt(i*i+o*o);if(c&&m){var f=n*i+l*o;a=Math.acos(f/(c*m)),a=a/Math.PI*180;var v=n*o-l*i;v=v>0?1:-1,a=180+v*a;}return a;}},{key:"IsNear",value:function IsNear(e,t,r){return Nt.Len(e.clone().sub(t))<r;}},{key:"RotWith",value:function RotWith(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;var i=e.x-t.x,l=e.y-t.y,o=Math.sin(r),a=Math.cos(r),c=Math.pow(10,n),m=Math.floor((t.x+(i*a-l*o))*c)/c,f=Math.floor((t.y+(i*o+l*a))*c)/c;return new Nt(m,f);}/**
383
- * 根据圆心和半径,获取圆上的等份点
384
- * @param o 圆心
385
- * @param radius 半径
386
- * @param average 均分数
387
- * @returns
388
- */},{key:"GetDotStroke",value:function GetDotStroke(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new at(1,1),i=Math.PI+1e-3,l=Nt.Add(e,Nt.Sub(e,n).uni().per().mul(-t)),o=[];for(var a=1/r,c=a;c<=1;c+=a)o.push(Nt.RotWith(l,e,i*2*c));return o;}/**
389
- * 根据圆心和圆上的起始点,获取半圆上的等份点
390
- * @param o 圆心
391
- * @param p 圆弧起始点
392
- * @param radian 1,逆时针180度 -1,顺时针
393
- * @param average 均分数
394
- * @returns
395
- */},{key:"GetSemicircleStroke",value:function GetSemicircleStroke(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:8;var i=r*(Math.PI+1e-3),l=[];for(var o=1/n,a=o;a<=1;a+=o)l.push(Nt.RotWith(t,e,i*a));return l;}}]);}(at);var yr=(typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?globalThis:(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:(typeof global==="undefined"?"undefined":_typeof(global))<"u"?global:(typeof self==="undefined"?"undefined":_typeof(self))<"u"?self:{};function Ne(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u["default"]:u;}var xo=_typeof(yr)=="object"&&yr&&yr.Object===Object&&yr,vi=xo,To=vi,Co=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,Io=To||Co||Function("return this")(),Ae=Io,Oo=Ae,Eo=Oo.Symbol,ur=Eo,Tn=ur,yi=Object.prototype,Mo=yi.hasOwnProperty,Ao=yi.toString,sr=Tn?Tn.toStringTag:void 0;function wo(u){var e=Mo.call(u,sr),t=u[sr];try{u[sr]=void 0;var r=!0;}catch(_unused18){}var n=Ao.call(u);return r&&(e?u[sr]=t:delete u[sr]),n;}var Lo=wo,Ro=Object.prototype,Do=Ro.toString;function bo(u){return Do.call(u);}var No=bo,Cn=ur,Bo=Lo,Wo=No,Fo="[object Null]",Uo="[object Undefined]",In=Cn?Cn.toStringTag:void 0;function jo(u){return u==null?u===void 0?Uo:Fo:In&&In in Object(u)?Bo(u):Wo(u);}var qe=jo;function Yo(u){return u!=null&&_typeof(u)=="object";}var Le=Yo,Xo=qe,zo=Le,$o="[object Number]";function Go(u){return typeof u=="number"||zo(u)&&Xo(u)==$o;}var ko=Go,he=/* @__PURE__ */Ne(ko);function Ho(){this.__data__=[],this.size=0;}var Vo=Ho;function Ko(u,e){return u===e||u!==u&&e!==e;}var qr=Ko,Zo=qr;function Jo(u,e){for(var t=u.length;t--;)if(Zo(u[t][0],e))return t;return-1;}var Rr=Jo,Qo=Rr,qo=Array.prototype,_o=qo.splice;function ta(u){var e=this.__data__,t=Qo(e,u);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():_o.call(e,t,1),--this.size,!0;}var ea=ta,ra=Rr;function na(u){var e=this.__data__,t=ra(e,u);return t<0?void 0:e[t][1];}var ia=na,sa=Rr;function oa(u){return sa(this.__data__,u)>-1;}var aa=oa,la=Rr;function ca(u,e){var t=this.__data__,r=la(t,u);return r<0?(++this.size,t.push([u,e])):t[r][1]=e,this;}var fa=ca,ha=Vo,ua=ea,da=ia,pa=aa,ma=fa;function _e(u){var e=-1,t=u==null?0:u.length;for(this.clear();++e<t;){var r=u[e];this.set(r[0],r[1]);}}_e.prototype.clear=ha;_e.prototype["delete"]=ua;_e.prototype.get=da;_e.prototype.has=pa;_e.prototype.set=ma;var Dr=_e,va=Dr;function ya(){this.__data__=new va(),this.size=0;}var ga=ya;function Pa(u){var e=this.__data__,t=e["delete"](u);return this.size=e.size,t;}var Sa=Pa;function xa(u){return this.__data__.get(u);}var Ta=xa;function Ca(u){return this.__data__.has(u);}var Ia=Ca;function Oa(u){var e=_typeof(u);return u!=null&&(e=="object"||e=="function");}var dr=Oa,Ea=qe,Ma=dr,Aa="[object AsyncFunction]",wa="[object Function]",La="[object GeneratorFunction]",Ra="[object Proxy]";function Da(u){if(!Ma(u))return!1;var e=Ea(u);return e==wa||e==La||e==Aa||e==Ra;}var gi=Da,ba=Ae,Na=ba["__core-js_shared__"],Ba=Na,jr=Ba,On=function(){var u=/[^.]+$/.exec(jr&&jr.keys&&jr.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:"";}();function Wa(u){return!!On&&On in u;}var Fa=Wa,Ua=Function.prototype,ja=Ua.toString;function Ya(u){if(u!=null){try{return ja.call(u);}catch(_unused19){}try{return u+"";}catch(_unused20){}}return"";}var Pi=Ya,Xa=gi,za=Fa,$a=dr,Ga=Pi,ka=/[\\^$.*+?()[\]{}|]/g,Ha=/^\[object .+?Constructor\]$/,Va=Function.prototype,Ka=Object.prototype,Za=Va.toString,Ja=Ka.hasOwnProperty,Qa=RegExp("^"+Za.call(Ja).replace(ka,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qa(u){if(!$a(u)||za(u))return!1;var e=Xa(u)?Qa:Ha;return e.test(Ga(u));}var _a=qa;function tl(u,e){return u==null?void 0:u[e];}var el=tl,rl=_a,nl=el;function il(u,e){var t=nl(u,e);return rl(t)?t:void 0;}var Ue=il,sl=Ue,ol=Ae,al=sl(ol,"Map"),_r=al,ll=Ue,cl=ll(Object,"create"),br=cl,En=br;function fl(){this.__data__=En?En(null):{},this.size=0;}var hl=fl;function ul(u){var e=this.has(u)&&delete this.__data__[u];return this.size-=e?1:0,e;}var dl=ul,pl=br,ml="__lodash_hash_undefined__",vl=Object.prototype,yl=vl.hasOwnProperty;function gl(u){var e=this.__data__;if(pl){var t=e[u];return t===ml?void 0:t;}return yl.call(e,u)?e[u]:void 0;}var Pl=gl,Sl=br,xl=Object.prototype,Tl=xl.hasOwnProperty;function Cl(u){var e=this.__data__;return Sl?e[u]!==void 0:Tl.call(e,u);}var Il=Cl,Ol=br,El="__lodash_hash_undefined__";function Ml(u,e){var t=this.__data__;return this.size+=this.has(u)?0:1,t[u]=Ol&&e===void 0?El:e,this;}var Al=Ml,wl=hl,Ll=dl,Rl=Pl,Dl=Il,bl=Al;function tr(u){var e=-1,t=u==null?0:u.length;for(this.clear();++e<t;){var r=u[e];this.set(r[0],r[1]);}}tr.prototype.clear=wl;tr.prototype["delete"]=Ll;tr.prototype.get=Rl;tr.prototype.has=Dl;tr.prototype.set=bl;var Nl=tr,Mn=Nl,Bl=Dr,Wl=_r;function Fl(){this.size=0,this.__data__={hash:new Mn(),map:new(Wl||Bl)(),string:new Mn()};}var Ul=Fl;function jl(u){var e=_typeof(u);return e=="string"||e=="number"||e=="symbol"||e=="boolean"?u!=="__proto__":u===null;}var Yl=jl,Xl=Yl;function zl(u,e){var t=u.__data__;return Xl(e)?t[typeof e=="string"?"string":"hash"]:t.map;}var Nr=zl,$l=Nr;function Gl(u){var e=$l(this,u)["delete"](u);return this.size-=e?1:0,e;}var kl=Gl,Hl=Nr;function Vl(u){return Hl(this,u).get(u);}var Kl=Vl,Zl=Nr;function Jl(u){return Zl(this,u).has(u);}var Ql=Jl,ql=Nr;function _l(u,e){var t=ql(this,u),r=t.size;return t.set(u,e),this.size+=t.size==r?0:1,this;}var tc=_l,ec=Ul,rc=kl,nc=Kl,ic=Ql,sc=tc;function er(u){var e=-1,t=u==null?0:u.length;for(this.clear();++e<t;){var r=u[e];this.set(r[0],r[1]);}}er.prototype.clear=ec;er.prototype["delete"]=rc;er.prototype.get=nc;er.prototype.has=ic;er.prototype.set=sc;var Si=er,oc=Dr,ac=_r,lc=Si,cc=200;function fc(u,e){var t=this.__data__;if(t instanceof oc){var r=t.__data__;if(!ac||r.length<cc-1)return r.push([u,e]),this.size=++t.size,this;t=this.__data__=new lc(r);}return t.set(u,e),this.size=t.size,this;}var hc=fc,uc=Dr,dc=ga,pc=Sa,mc=Ta,vc=Ia,yc=hc;function rr(u){var e=this.__data__=new uc(u);this.size=e.size;}rr.prototype.clear=dc;rr.prototype["delete"]=pc;rr.prototype.get=mc;rr.prototype.has=vc;rr.prototype.set=yc;var xi=rr;function gc(u,e){for(var t=-1,r=u==null?0:u.length;++t<r&&e(u[t],t,u)!==!1;);return u;}var Pc=gc,Sc=Ue,xc=function(){try{var u=Sc(Object,"defineProperty");return u({},"",{}),u;}catch(_unused21){}}(),Ti=xc,An=Ti;function Tc(u,e,t){e=="__proto__"&&An?An(u,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):u[e]=t;}var Ci=Tc,Cc=Ci,Ic=qr,Oc=Object.prototype,Ec=Oc.hasOwnProperty;function Mc(u,e,t){var r=u[e];(!(Ec.call(u,e)&&Ic(r,t))||t===void 0&&!(e in u))&&Cc(u,e,t);}var Ii=Mc,Ac=Ii,wc=Ci;function Lc(u,e,t,r){var n=!t;t||(t={});for(var i=-1,l=e.length;++i<l;){var o=e[i],a=r?r(t[o],u[o],o,t,u):void 0;a===void 0&&(a=u[o]),n?wc(t,o,a):Ac(t,o,a);}return t;}var Br=Lc;function Rc(u,e){for(var t=-1,r=Array(u);++t<u;)r[t]=e(t);return r;}var Dc=Rc,bc=qe,Nc=Le,Bc="[object Arguments]";function Wc(u){return Nc(u)&&bc(u)==Bc;}var Fc=Wc,wn=Fc,Uc=Le,Oi=Object.prototype,jc=Oi.hasOwnProperty,Yc=Oi.propertyIsEnumerable,Xc=wn(/* @__PURE__ */function(){return arguments;}())?wn:function(u){return Uc(u)&&jc.call(u,"callee")&&!Yc.call(u,"callee");},Ei=Xc,zc=Array.isArray,pr=zc,Sr={exports:{}};function $c(){return!1;}var Gc=$c;Sr.exports;(function(u,e){var t=Ae,r=Gc,n=e&&!e.nodeType&&e,i=n&&!0&&u&&!u.nodeType&&u,l=i&&i.exports===n,o=l?t.Buffer:void 0,a=o?o.isBuffer:void 0,c=a||r;u.exports=c;})(Sr,Sr.exports);var tn=Sr.exports,kc=9007199254740991,Hc=/^(?:0|[1-9]\d*)$/;function Vc(u,e){var _e2;var t=_typeof(u);return e=(_e2=e)!==null&&_e2!==void 0?_e2:kc,!!e&&(t=="number"||t!="symbol"&&Hc.test(u))&&u>-1&&u%1==0&&u<e;}var Kc=Vc,Zc=9007199254740991;function Jc(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=Zc;}var Mi=Jc,Qc=qe,qc=Mi,_c=Le,tf="[object Arguments]",ef="[object Array]",rf="[object Boolean]",nf="[object Date]",sf="[object Error]",of="[object Function]",af="[object Map]",lf="[object Number]",cf="[object Object]",ff="[object RegExp]",hf="[object Set]",uf="[object String]",df="[object WeakMap]",pf="[object ArrayBuffer]",mf="[object DataView]",vf="[object Float32Array]",yf="[object Float64Array]",gf="[object Int8Array]",Pf="[object Int16Array]",Sf="[object Int32Array]",xf="[object Uint8Array]",Tf="[object Uint8ClampedArray]",Cf="[object Uint16Array]",If="[object Uint32Array]",ne={};ne[vf]=ne[yf]=ne[gf]=ne[Pf]=ne[Sf]=ne[xf]=ne[Tf]=ne[Cf]=ne[If]=!0;ne[tf]=ne[ef]=ne[pf]=ne[rf]=ne[mf]=ne[nf]=ne[sf]=ne[of]=ne[af]=ne[lf]=ne[cf]=ne[ff]=ne[hf]=ne[uf]=ne[df]=!1;function Of(u){return _c(u)&&qc(u.length)&&!!ne[Qc(u)];}var Ef=Of;function Mf(u){return function(e){return u(e);};}var Wr=Mf,xr={exports:{}};xr.exports;(function(u,e){var t=vi,r=e&&!e.nodeType&&e,n=r&&!0&&u&&!u.nodeType&&u,i=n&&n.exports===r,l=i&&t.process,o=function(){try{var a=n&&n.require&&n.require("util").types;return a||l&&l.binding&&l.binding("util");}catch(_unused22){}}();u.exports=o;})(xr,xr.exports);var en=xr.exports,Af=Ef,wf=Wr,Ln=en,Rn=Ln&&Ln.isTypedArray,Lf=Rn?wf(Rn):Af,Ai=Lf,Rf=Dc,Df=Ei,bf=pr,Nf=tn,Bf=Kc,Wf=Ai,Ff=Object.prototype,Uf=Ff.hasOwnProperty;function jf(u,e){var t=bf(u),r=!t&&Df(u),n=!t&&!r&&Nf(u),i=!t&&!r&&!n&&Wf(u),l=t||r||n||i,o=l?Rf(u.length,String):[],a=o.length;for(var c in u)(e||Uf.call(u,c))&&!(l&&(// Safari 9 has enumerable `arguments.length` in strict mode.
396
- c=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
397
- n&&(c=="offset"||c=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
398
- i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||// Skip index properties.
399
- Bf(c,a)))&&o.push(c);return o;}var wi=jf,Yf=Object.prototype;function Xf(u){var e=u&&u.constructor,t=typeof e=="function"&&e.prototype||Yf;return u===t;}var rn=Xf;function zf(u,e){return function(t){return u(e(t));};}var Li=zf,$f=Li,Gf=$f(Object.keys,Object),kf=Gf,Hf=rn,Vf=kf,Kf=Object.prototype,Zf=Kf.hasOwnProperty;function Jf(u){if(!Hf(u))return Vf(u);var e=[];for(var t in Object(u))Zf.call(u,t)&&t!="constructor"&&e.push(t);return e;}var Qf=Jf,qf=gi,_f=Mi;function th(u){return u!=null&&_f(u.length)&&!qf(u);}var nn=th,eh=wi,rh=Qf,nh=nn;function ih(u){return nh(u)?eh(u):rh(u);}var sn=ih,sh=Br,oh=sn;function ah(u,e){return u&&sh(e,oh(e),u);}var lh=ah;function ch(u){var e=[];if(u!=null)for(var t in Object(u))e.push(t);return e;}var fh=ch,hh=dr,uh=rn,dh=fh,ph=Object.prototype,mh=ph.hasOwnProperty;function vh(u){if(!hh(u))return dh(u);var e=uh(u),t=[];for(var r in u)r=="constructor"&&(e||!mh.call(u,r))||t.push(r);return t;}var yh=vh,gh=wi,Ph=yh,Sh=nn;function xh(u){return Sh(u)?gh(u,!0):Ph(u);}var on=xh,Th=Br,Ch=on;function Ih(u,e){return u&&Th(e,Ch(e),u);}var Oh=Ih,Tr={exports:{}};Tr.exports;(function(u,e){var t=Ae,r=e&&!e.nodeType&&e,n=r&&!0&&u&&!u.nodeType&&u,i=n&&n.exports===r,l=i?t.Buffer:void 0,o=l?l.allocUnsafe:void 0;function a(c,m){if(m)return c.slice();var f=c.length,v=o?o(f):new c.constructor(f);return c.copy(v),v;}u.exports=a;})(Tr,Tr.exports);var Eh=Tr.exports;function Mh(u,e){var t=-1,r=u.length;for(e||(e=Array(r));++t<r;)e[t]=u[t];return e;}var Ah=Mh;function wh(u,e){for(var t=-1,r=u==null?0:u.length,n=0,i=[];++t<r;){var l=u[t];e(l,t,u)&&(i[n++]=l);}return i;}var Ri=wh;function Lh(){return[];}var Di=Lh,Rh=Ri,Dh=Di,bh=Object.prototype,Nh=bh.propertyIsEnumerable,Dn=Object.getOwnPropertySymbols,Bh=Dn?function(u){return u==null?[]:(u=Object(u),Rh(Dn(u),function(e){return Nh.call(u,e);}));}:Dh,an=Bh,Wh=Br,Fh=an;function Uh(u,e){return Wh(u,Fh(u),e);}var jh=Uh;function Yh(u,e){for(var t=-1,r=e.length,n=u.length;++t<r;)u[n+t]=e[t];return u;}var ln=Yh,Xh=Li,zh=Xh(Object.getPrototypeOf,Object),bi=zh,$h=ln,Gh=bi,kh=an,Hh=Di,Vh=Object.getOwnPropertySymbols,Kh=Vh?function(u){for(var e=[];u;)$h(e,kh(u)),u=Gh(u);return e;}:Hh,Ni=Kh,Zh=Br,Jh=Ni;function Qh(u,e){return Zh(u,Jh(u),e);}var qh=Qh,_h=ln,tu=pr;function eu(u,e,t){var r=e(u);return tu(u)?r:_h(r,t(u));}var Bi=eu,ru=Bi,nu=an,iu=sn;function su(u){return ru(u,iu,nu);}var Wi=su,ou=Bi,au=Ni,lu=on;function cu(u){return ou(u,lu,au);}var fu=cu,hu=Ue,uu=Ae,du=hu(uu,"DataView"),pu=du,mu=Ue,vu=Ae,yu=mu(vu,"Promise"),gu=yu,Pu=Ue,Su=Ae,xu=Pu(Su,"Set"),Fi=xu,Tu=Ue,Cu=Ae,Iu=Tu(Cu,"WeakMap"),Ou=Iu,Gr=pu,kr=_r,Hr=gu,Vr=Fi,Kr=Ou,Ui=qe,nr=Pi,bn="[object Map]",Eu="[object Object]",Nn="[object Promise]",Bn="[object Set]",Wn="[object WeakMap]",Fn="[object DataView]",Mu=nr(Gr),Au=nr(kr),wu=nr(Hr),Lu=nr(Vr),Ru=nr(Kr),Fe=Ui;(Gr&&Fe(new Gr(new ArrayBuffer(1)))!=Fn||kr&&Fe(new kr())!=bn||Hr&&Fe(Hr.resolve())!=Nn||Vr&&Fe(new Vr())!=Bn||Kr&&Fe(new Kr())!=Wn)&&(Fe=function Fe(u){var e=Ui(u),t=e==Eu?u.constructor:void 0,r=t?nr(t):"";if(r)switch(r){case Mu:return Fn;case Au:return bn;case wu:return Nn;case Lu:return Bn;case Ru:return Wn;}return e;});var Fr=Fe,Du=Object.prototype,bu=Du.hasOwnProperty;function Nu(u){var e=u.length,t=new u.constructor(e);return e&&typeof u[0]=="string"&&bu.call(u,"index")&&(t.index=u.index,t.input=u.input),t;}var Bu=Nu,Wu=Ae,Fu=Wu.Uint8Array,ji=Fu,Un=ji;function Uu(u){var e=new u.constructor(u.byteLength);return new Un(e).set(new Un(u)),e;}var cn=Uu,ju=cn;function Yu(u,e){var t=e?ju(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.byteLength);}var Xu=Yu,zu=/\w*$/;function $u(u){var e=new u.constructor(u.source,zu.exec(u));return e.lastIndex=u.lastIndex,e;}var Gu=$u,jn=ur,Yn=jn?jn.prototype:void 0,Xn=Yn?Yn.valueOf:void 0;function ku(u){return Xn?Object(Xn.call(u)):{};}var Hu=ku,Vu=cn;function Ku(u,e){var t=e?Vu(u.buffer):u.buffer;return new u.constructor(t,u.byteOffset,u.length);}var Zu=Ku,Ju=cn,Qu=Xu,qu=Gu,_u=Hu,td=Zu,ed="[object Boolean]",rd="[object Date]",nd="[object Map]",id="[object Number]",sd="[object RegExp]",od="[object Set]",ad="[object String]",ld="[object Symbol]",cd="[object ArrayBuffer]",fd="[object DataView]",hd="[object Float32Array]",ud="[object Float64Array]",dd="[object Int8Array]",pd="[object Int16Array]",md="[object Int32Array]",vd="[object Uint8Array]",yd="[object Uint8ClampedArray]",gd="[object Uint16Array]",Pd="[object Uint32Array]";function Sd(u,e,t){var r=u.constructor;switch(e){case cd:return Ju(u);case ed:case rd:return new r(+u);case fd:return Qu(u,t);case hd:case ud:case dd:case pd:case md:case vd:case yd:case gd:case Pd:return td(u,t);case nd:return new r();case id:case ad:return new r(u);case sd:return qu(u);case od:return new r();case ld:return _u(u);}}var xd=Sd,Td=dr,zn=Object.create,Cd=/* @__PURE__ */function(){function u(){}return function(e){if(!Td(e))return{};if(zn)return zn(e);u.prototype=e;var t=new u();return u.prototype=void 0,t;};}(),Id=Cd,Od=Id,Ed=bi,Md=rn;function Ad(u){return typeof u.constructor=="function"&&!Md(u)?Od(Ed(u)):{};}var wd=Ad,Ld=Fr,Rd=Le,Dd="[object Map]";function bd(u){return Rd(u)&&Ld(u)==Dd;}var Nd=bd,Bd=Nd,Wd=Wr,$n=en,Gn=$n&&$n.isMap,Fd=Gn?Wd(Gn):Bd,Ud=Fd,jd=Fr,Yd=Le,Xd="[object Set]";function zd(u){return Yd(u)&&jd(u)==Xd;}var $d=zd,Gd=$d,kd=Wr,kn=en,Hn=kn&&kn.isSet,Hd=Hn?kd(Hn):Gd,Yi=Hd,Vd=/* @__PURE__ */Ne(Yi),Kd=xi,Zd=Pc,Jd=Ii,Qd=lh,qd=Oh,_d=Eh,tp=Ah,ep=jh,rp=qh,np=Wi,ip=fu,sp=Fr,op=Bu,ap=xd,lp=wd,cp=pr,fp=tn,hp=Ud,up=dr,dp=Yi,pp=sn,mp=on,vp=1,yp=2,gp=4,Xi="[object Arguments]",Pp="[object Array]",Sp="[object Boolean]",xp="[object Date]",Tp="[object Error]",zi="[object Function]",Cp="[object GeneratorFunction]",Ip="[object Map]",Op="[object Number]",$i="[object Object]",Ep="[object RegExp]",Mp="[object Set]",Ap="[object String]",wp="[object Symbol]",Lp="[object WeakMap]",Rp="[object ArrayBuffer]",Dp="[object DataView]",bp="[object Float32Array]",Np="[object Float64Array]",Bp="[object Int8Array]",Wp="[object Int16Array]",Fp="[object Int32Array]",Up="[object Uint8Array]",jp="[object Uint8ClampedArray]",Yp="[object Uint16Array]",Xp="[object Uint32Array]",re={};re[Xi]=re[Pp]=re[Rp]=re[Dp]=re[Sp]=re[xp]=re[bp]=re[Np]=re[Bp]=re[Wp]=re[Fp]=re[Ip]=re[Op]=re[$i]=re[Ep]=re[Mp]=re[Ap]=re[wp]=re[Up]=re[jp]=re[Yp]=re[Xp]=!0;re[Tp]=re[zi]=re[Lp]=!1;function Pr(u,e,t,r,n,i){var l,o=e&vp,a=e&yp,c=e&gp;if(t&&(l=n?t(u,r,n,i):t(u)),l!==void 0)return l;if(!up(u))return u;var m=cp(u);if(m){if(l=op(u),!o)return tp(u,l);}else{var f=sp(u),v=f==zi||f==Cp;if(fp(u))return _d(u,o);if(f==$i||f==Xi||v&&!n){if(l=a||v?{}:lp(u),!o)return a?rp(u,qd(l,u)):ep(u,Qd(l,u));}else{if(!re[f])return n?u:{};l=ap(u,f,o);}}i||(i=new Kd());var S=i.get(u);if(S)return S;i.set(u,l),dp(u)?u.forEach(function(P){l.add(Pr(P,e,t,P,u,i));}):hp(u)&&u.forEach(function(P,x){l.set(x,Pr(P,e,t,x,u,i));});var E=c?a?ip:np:a?mp:pp,T=m?void 0:E(u);return Zd(T||u,function(P,x){T&&(x=P,P=u[x]),Jd(l,x,Pr(P,e,t,x,u,i));}),l;}var zp=Pr,$p=zp,Gp=1,kp=4;function Hp(u){return $p(u,Gp|kp);}var Vp=Hp,ue=/* @__PURE__ */Ne(Vp);var Gi="1.1.22-beta.9",Kp="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var u=window.__netlessUA||"";u+=" ".concat(Kp,"@").concat(Gi),window.__netlessUA=u;}var me={useWorker:"auto",useSimple:!1,syncOpt:{interval:300,smoothSync:!0},cursor:{enable:!0,expirationTime:5e3,moveDelayTime:100},bufferSize:{full:2e4,sub:600},bezier:{enable:!0,maxDrawCount:1/0,combineUnitTime:300},pencilEraser:{useBitMap:!0,maxImageWidth:1920,maxImageHeight:1920,maxCombineTime:500},strokeWidth:{min:1,max:10},textEditor:{showFloatBar:!0,canSelectorSwitch:!0,rightBoundBreak:!1,extendFontFaces:[],loadFontFacesTimeout:1e4}};function De(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=u.length;if(t<2)return"";var r=u[0],n=u[1];if(t===2)return"M".concat(ze(r),"L").concat(ze(n));var i="";for(var l=2,o=t-1;l<o;l++)r=u[l],n=u[l+1],i+=$e(r,n);return e?"M".concat($e(u[0],u[1]),"Q").concat(ze(u[1])).concat($e(u[1],u[2]),"T").concat(i).concat($e(u[t-1],u[0])).concat($e(u[0],u[1]),"Z"):"M".concat(ze(u[0]),"Q").concat(ze(u[1])).concat($e(u[1],u[2])).concat(u.length>3?"T":"").concat(i,"L").concat(ze(u[t-1]));}var xe=/*#__PURE__*/function(){function xe(e){_classCallCheck(this,xe);ot(this,"maxImageWidth",me.pencilEraser.maxImageWidth);ot(this,"maxImageHeight",me.pencilEraser.maxImageHeight);ot(this,"syncUnitTime",me.syncOpt.interval);ot(this,"vNodes");ot(this,"drawLayer");ot(this,"fullLayer");ot(this,"workId");ot(this,"isDelete",!1);var t=e.vNodes,r=e.fullLayer,n=e.drawLayer,i=e.workId,l=e.toolsOpt;this.vNodes=t,this.fullLayer=r,this.drawLayer=n,this.workId=i,this.syncUnitTime=l.syncUnitTime||this.syncUnitTime;}return _createClass(xe,[{key:"baseConsumeResult",get:function get(){return{workId:this.workId,toolsType:this.toolsType,opt:this.workOptions};}},{key:"filterSamePoints",value:function filterSamePoints(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;return e.reduce(function(r,n){var i=r[r.length-1];return(n&&!i||n&&i&&!n.isNear(i,t))&&r.push(n),r;},[]);}/** 设置工作id */},{key:"setWorkId",value:function setWorkId(e){this.workId=e;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(e){var n,i,l;this.workOptions=e,this.syncUnitTime=e.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),r=t&&((i=this.vNodes)==null?void 0:i.get(t))||void 0;t&&r&&(r.opt=e,(l=this.vNodes)==null||l.setInfo(t,r));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(e){var n,i;var t;var r=(n=this.workId)==null?void 0:n.toString();if(r&&e){var l=this.fullLayer.getElementsByName(r)||this.drawLayer&&this.drawLayer.getElementsByName(r)||[];if(l.length!==1)return;var o=l[0],a=e.pos,c=e.zIndex,m=e.scale,f=e.angle,v=e.translate,S={};he(c)&&(S.zIndex=c),a&&(S.pos=[a[0],a[1]]),m&&(S.scale=m),f&&(S.rotate=f),v&&(S.translate=v),o.attr(S);var E=o==null?void 0:o.getBoundingClientRect();return E&&(t=bt(t,{x:Math.floor(E.x-xe.SafeBorderPadding),y:Math.floor(E.y-xe.SafeBorderPadding),w:Math.floor(E.width+xe.SafeBorderPadding*2),h:Math.floor(E.height+xe.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(r,{rect:t,centerPos:a}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(e,t){var r=e.group,n=e.eraserlines,i=e.pos,l=e.layer,o=l.parent;if(t)try{var c=(l.renderer.glRenderer||l.renderer.canvasRenderer).options.displayRatio,m=r.getBoundingClientRect(),f=m.width*c*l.worldScaling[0],v=m.height*c*l.worldScaling[1];var S=1;(f>this.maxImageWidth||v>this.maxImageHeight)&&(S=Math.min(this.maxImageWidth/f,this.maxImageHeight/v));var E=l.getAttribute("scale");E=[E[0]*S,E[1]*S];var T=l.parent.parent,P=l.getAttribute("translate"),_x53=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),T,{offscreen:o.offscreen,width:o.width,height:o.height,contextType:"2d",autoRender:!1,bufferSize:500},E,P),_h28=r.cloneNode(!0);if(!n||!n.length)return;this.addEraserlines(_h28,n,i,!1),_x53.appendChild(_h28);var p=_x53.parent;p.render();var d=_x53.renderer.canvasRenderer,g=d.context;if(!g)return;var O=d.options.displayRatio,w=_h28.getBoundingClientRect(),L={x:w.x,y:w.y,w:w.width,h:w.height},B={x:0,y:0,w:T.width,h:T.height};if(or(L,B)===Pe.outside){Te(_h28,p),T.removeChild(p),this.isDelete=!0;return;}var b=ue(L);b.x=Math.floor(Math.max(L.x,0)),b.y=Math.floor(Math.max(L.y,0)),b.w=Math.min(L.x+L.w,T.width)-b.x,b.h=Math.min(L.y+L.h,T.height)-b.y;var W=this.getGroupRect(b,O),D=W.x,R=W.y,X=W.w,H=W.h;var J=g.getImageData(D,R,X,H);if(this.isTransparentRectByCanvas(J)){Te(_h28,p),T.removeChild(p),this.isDelete=!0,J=null;return;}Te(r,o);var it=this.createSpriteNode({imageData:J,safariRect:b,originRect:L,worldScaling:_x53.worldScaling});it&&r.append(it),Te(_h28,p),T.removeChild(p),o.deleteTexture(J),J=null;}catch(a){console.error("[BaseShapeTool] drawEraserlines error:",a);return;}}},{key:"createVmRenderNode",value:function createVmRenderNode(e,t,r,n,i){var l=r.width,o=r.height,a="bitMap-".concat(e),c=t.layer(a,r),m=new ye({anchor:[0.5,0.5],pos:[l*0.5,o*0.5],size:[l,o],name:"viewport",id:e});return m.setAttribute("scale",n),m.setAttribute("translate",i),c.append(m),m;}},{key:"getGroupRect",value:function getGroupRect(e,t){var r=Math.floor(e.x*t),n=Math.floor(e.y*t),i=Math.floor(e.w*t),l=Math.floor(e.h*t);return{x:r,y:n,w:i,h:l};}},{key:"addEraserlines",value:function addEraserlines(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var _iterator13=_createForOfIteratorHelper(t),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var i=_step13.value;var l=i.thickness,o=i.op;var _iterator14=_createForOfIteratorHelper(o),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var a=_step14.value;var c=a.map(function(E,T){return T%2?E-r[1]:E-r[0];}),m=this.computEraserPoints(c,l),f=De(m,!0),v={pos:[0,0],d:f,fillColor:"rgba(0,0,0,1)"},S=new be(v);S.addEventListener("beforerender",function(_ref164){var E=_ref164.detail;var T=E.context;n?T.blendFuncSeparate(T.ZERO,T.ZERO,T.ZERO,T.ZERO):T.globalCompositeOperation="destination-out";}),S.addEventListener("afterrender",function(_ref165){var E=_ref165.detail;var T=E.context;n?T.blendFuncSeparate(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA,T.ONE,T.ONE_MINUS_SRC_ALPHA):T.globalCompositeOperation="source-over";}),e.append(S);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}}},{key:"isTransparentRectByCanvas",value:function isTransparentRectByCanvas(e){var t=!0;for(var r=0;r<e.data.length;r+=4)if(e.data[r+3]!==0){t=!1;break;}return t;}},{key:"createSpriteNode",value:function createSpriteNode(e){var t=e.imageData,r=e.worldScaling,n=e.safariRect,i=e.originRect;var l;if(typeof OffscreenCanvas=="function"){l=new OffscreenCanvas(t.width,t.height);var m=l.getContext("2d");m&&m.putImageData(t,0,0);}else if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){l=document.createElement("canvas"),l.width=t.width,l.height=t.height;var _m4=l.getContext("2d");_m4&&_m4.putImageData(t,0,0);}if(!l)return console.warn("Failed to create imageEraserBitmap Sprite"),null;var o=[Math.floor(i.w/r[0]),Math.floor(i.h/r[1])],a=[Math.floor((n.x-i.x)/r[0]),Math.floor((n.y-i.y)/r[1]),Math.floor(n.w/r[0]),Math.floor(n.h/r[1])],c={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:o,texture:l,textureRect:a};return new pi(c);}},{key:"computEraserPoints",value:function computEraserPoints(e,t){var r=Math.ceil(t/2);return e.length===2?this.computDot(e,r):this.computLine(e,r);}},{key:"computDot",value:function computDot(e,t){var r=new Nt(e[0],e[1]);return Nt.GetDotStroke(r,t,8);}},{key:"computLine",value:function computLine(e,t){var r=[],n=[];var i,l;for(var o=0;o<e.length;o+=2){var a=new Nt(e[o],e[o+1]);var c=void 0;if(o==e.length-2){var m=new Nt(e[o-2],e[o-1]);c=at.Sub(a,m).uni(),i=a;}else{o===0&&(l=a);var _m5=new Nt(e[o+2],e[o+3]);c=at.Sub(_m5,a).uni();}if(c){var _m6=at.Per(c).mul(t);r.push(Nt.Sub(a,_m6)),n.push(Nt.Add(a,_m6));}}if(i&&l){var _o3=Nt.GetSemicircleStroke(i,r[r.length-1],-1,8),_a4=Nt.GetSemicircleStroke(l,n[0],-1,8);return r.concat(_o3,n.reverse(),_a4);}return[];}},{key:"replace",value:function replace(e,t,r){var _this61=this;var i;if(!t){r&&e.append(r);return;}var n=e.getElementsByName(t);if(n.length){var _iterator15=_createForOfIteratorHelper(n),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var l=_step15.value;r?Tm(r,l,e):(l.remove(),_pe(l,e.parent));}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}}else r&&e.append(r);this.fullLayer!==this.drawLayer&&(this.fullLayer===e?(i=this.drawLayer)==null||i.getElementsByName(t).forEach(function(o){var a;o.remove(),_pe(o,(a=_this61.drawLayer)==null?void 0:a.parent);}):this.fullLayer.getElementsByName(t).forEach(function(o){o.remove(),_pe(o,_this61.fullLayer.parent);}));}},{key:"removeDrawCountNodes",value:function removeDrawCountNodes(e,t){var r=[];e.getElementsByName(this.workId).forEach(function(n){n.id&&t&&Number(n.id)<t&&r.push(n);});for(var _i2=0,_r3=r;_i2<_r3.length;_i2++){var n=_r3[_i2];n.remove(),_pe(n,e.parent);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(e){var h;var t=e.node,r=e.opt,n=e.vNodes,i=e.willSerializeData,l=e.targetNode,o=r.zIndex,a=r.translate,c=r.angle,m=r.originPoint,f=r.scenePoint,v=r.scale,S=r.pointMap,E=r.thickness;var T;var P=l&&ue(l)||n.get(t.name);if(!P)return;he(o)&&(t.setAttribute("zIndex",o),P.opt.zIndex=o);var x=t.parent;if(x){if(m&&v&&l){var p=[P.op[0],P.op[1]];vn(P.op,f,v,a);var d=[P.op[0],P.op[1]],g=[d[0]-p[0],d[1]-p[1]];if(P.centerPos=[P.centerPos[0]+g[0],P.centerPos[1]+g[1]],P.opt.translate=void 0,P.opt.scale=void 0,P.opt.eraserlines)for(var O=0;O<P.opt.eraserlines.length;O++){var _P$opt$eraserlines$O=P.opt.eraserlines[O],w=_P$opt$eraserlines$O.op,L=_P$opt$eraserlines$O.thickness;P.opt.eraserlines[O].thickness=Math.round(L*Math.max(v[0],v[1]));for(var B=0;B<w.length;B++)yn(w[B],f,v,a);}}else if(a){if(t.setAttribute("translate",a),P.opt.translate=a,l){var _p6=[a[0]*x.worldScaling[0],a[1]*x.worldScaling[1]];T=fr(P.rect,_p6),P.rect=T;}else{var _p7=xe.getRectFromLayer(x,t.name);P.rect=_p7||P.rect;}}else if(he(c))if(t.setAttribute("rotate",c),P.opt.rotate=c,l)T=as(P.rect,c),P.rect=T;else{var _p8=xe.getRectFromLayer(x,t.name);P.rect=_p8||P.rect;}if(S){var _p9=S.get(t.name);if(_p9)for(var _d11=0,_g9=0;_d11<P.op.length;_d11+=3,_g9++)P.op[_d11]=_p9[_g9][0],P.op[_d11+1]=_p9[_g9][1];}if(E&&(h=P==null?void 0:P.opt)!=null&&h.thickness&&(P.opt.thickness=E),i&&!(m&&v&&l)){if(a){var _p10=P.op.map(function(d,g){var O=g%3;return O===0?d+a[0]:O===1?d+a[1]:d;});if(P.op=_p10,P.centerPos=[P.centerPos[0]+a[0],P.centerPos[1]+a[1]],P!=null&&P.opt&&(P.opt.translate=void 0),P.opt.eraserlines)for(var _d12=0;_d12<P.opt.eraserlines.length;_d12++){var _g10=P.opt.eraserlines[_d12].op;for(var _O6=0;_O6<_g10.length;_O6++){var _w3=_g10[_O6].map(function(L,B){return B%2?L+a[1]:L+a[0];});P.opt.eraserlines[_d12].op[_O6]=_w3;}}}else if(he(c)){var _p11=P.op;if(pm(_p11,P.centerPos,c),P.op=_p11,P!=null&&P.opt&&(P.opt.rotate=void 0),P.opt.eraserlines)for(var _d13=0;_d13<P.opt.eraserlines.length;_d13++){var _g11=P.opt.eraserlines[_d13].op;for(var _O7=0;_O7<_g11.length;_O7++)mm(_g11[_O7],P.centerPos,c);}}}P&&n.setInfo(t.name,P);}}},{key:"getCenterPos",value:function getCenterPos(e,t){var r=t.worldPosition,n=t.worldScaling;return[(e.x+e.w/2-r[0])/n[0],(e.y+e.h/2-r[1])/n[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(e,t){var r=e.getElementsByName(t)[0];if(r){var n=r.getBoundingClientRect();return{x:Math.floor(n.x-xe.SafeBorderPadding),y:Math.floor(n.y-xe.SafeBorderPadding),w:Math.floor(n.width+xe.SafeBorderPadding*2),h:Math.floor(n.height+xe.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(e){var t=e.toolsType,r=e.opt,n=e.node,i=e.updateOpt,l=e.willSerializeData;return!!(l&&(i.angle||i.translate)||i.thickness&&r.thickness&&r.thickness!==i.thickness||i.strokeType&&r.strokeType&&r.strokeType!==i.strokeType||i.originPoint&&i.scenePoint&&i.scale||i.pointMap&&i.pointMap.has(n.name)||t===pt.Text&&(i.fontSize||i.translate||i.textInfos&&i.textInfos.get(n.name))||t===pt.Image&&(i.angle||i.translate||i.scale||i.strokeColor&&i.type===Qr.Iconify)||t===i.toolsType&&i.willRefresh||r.eraserlines&&r.eraserlines.length&&(i.strokeColor||i.fillColor));}}]);}();ot(xe,"SafeBorderPadding",10);var At=xe;var fn=Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50}),Object.freeze({width:48,height:74})]);var hn={exports:{}};hn.exports;(function(u){var e=function(){var t=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function l(a,c){if(!i[a]){i[a]={};for(var m=0;m<a.length;m++)i[a][a.charAt(m)]=m;}return i[a][c];}var o={compressToBase64:function compressToBase64(a){if(a==null)return"";var c=o._compress(a,6,function(m){return r.charAt(m);});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"=";}},decompressFromBase64:function decompressFromBase64(a){return a==null?"":a==""?null:o._decompress(a.length,32,function(c){return l(r,a.charAt(c));});},compressToUTF16:function compressToUTF16(a){return a==null?"":o._compress(a,15,function(c){return t(c+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(a){return a==null?"":a==""?null:o._decompress(a.length,16384,function(c){return a.charCodeAt(c)-32;});},//compress into uint8array (UCS-2 big endian format)
400
- compressToUint8Array:function compressToUint8Array(a){for(var c=o.compress(a),m=new Uint8Array(c.length*2),f=0,v=c.length;f<v;f++){var S=c.charCodeAt(f);m[f*2]=S>>>8,m[f*2+1]=S%256;}return m;},//decompress from uint8array (UCS-2 big endian format)
401
- decompressFromUint8Array:function decompressFromUint8Array(a){if(a==null)return o.decompress(a);for(var c=new Array(a.length/2),m=0,f=c.length;m<f;m++)c[m]=a[m*2]*256+a[m*2+1];var v=[];return c.forEach(function(S){v.push(t(S));}),o.decompress(v.join(""));},//compress into a string that is already URI encoded
402
- compressToEncodedURIComponent:function compressToEncodedURIComponent(a){return a==null?"":o._compress(a,6,function(c){return n.charAt(c);});},//decompress from an output of compressToEncodedURIComponent
403
- decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(a){return a==null?"":a==""?null:(a=a.replace(/ /g,"+"),o._decompress(a.length,32,function(c){return l(n,a.charAt(c));}));},compress:function compress(a){return o._compress(a,16,function(c){return t(c);});},_compress:function _compress(a,c,m){if(a==null)return"";var f,v,S={},E={},T="",P="",x="",h=2,p=3,d=2,g=[],O=0,w=0,L;for(L=0;L<a.length;L+=1)if(T=a.charAt(L),Object.prototype.hasOwnProperty.call(S,T)||(S[T]=p++,E[T]=!0),P=x+T,Object.prototype.hasOwnProperty.call(S,P))x=P;else{if(Object.prototype.hasOwnProperty.call(E,x)){if(x.charCodeAt(0)<256){for(f=0;f<d;f++)O=O<<1,w==c-1?(w=0,g.push(m(O)),O=0):w++;for(v=x.charCodeAt(0),f=0;f<8;f++)O=O<<1|v&1,w==c-1?(w=0,g.push(m(O)),O=0):w++,v=v>>1;}else{for(v=1,f=0;f<d;f++)O=O<<1|v,w==c-1?(w=0,g.push(m(O)),O=0):w++,v=0;for(v=x.charCodeAt(0),f=0;f<16;f++)O=O<<1|v&1,w==c-1?(w=0,g.push(m(O)),O=0):w++,v=v>>1;}h--,h==0&&(h=Math.pow(2,d),d++),delete E[x];}else for(v=S[x],f=0;f<d;f++)O=O<<1|v&1,w==c-1?(w=0,g.push(m(O)),O=0):w++,v=v>>1;h--,h==0&&(h=Math.pow(2,d),d++),S[P]=p++,x=String(T);}if(x!==""){if(Object.prototype.hasOwnProperty.call(E,x)){if(x.charCodeAt(0)<256){for(f=0;f<d;f++)O=O<<1,w==c-1?(w=0,g.push(m(O)),O=0):w++;for(v=x.charCodeAt(0),f=0;f<8;f++)O=O<<1|v&1,w==c-1?(w=0,g.push(m(O)),O=0):w++,v=v>>1;}else{for(v=1,f=0;f<d;f++)O=O<<1|v,w==c-1?(w=0,g.push(m(O)),O=0):w++,v=0;for(v=x.charCodeAt(0),f=0;f<16;f++)O=O<<1|v&1,w==c-1?(w=0,g.push(m(O)),O=0):w++,v=v>>1;}h--,h==0&&(h=Math.pow(2,d),d++),delete E[x];}else for(v=S[x],f=0;f<d;f++)O=O<<1|v&1,w==c-1?(w=0,g.push(m(O)),O=0):w++,v=v>>1;h--,h==0&&(h=Math.pow(2,d),d++);}for(v=2,f=0;f<d;f++)O=O<<1|v&1,w==c-1?(w=0,g.push(m(O)),O=0):w++,v=v>>1;for(;;)if(O=O<<1,w==c-1){g.push(m(O));break;}else w++;return g.join("");},decompress:function decompress(a){return a==null?"":a==""?null:o._decompress(a.length,32768,function(c){return a.charCodeAt(c);});},_decompress:function _decompress(a,c,m){var f=[],v=4,S=4,E=3,T="",P=[],x,h,p,d,g,O,w,L={val:m(0),position:c,index:1};for(x=0;x<3;x+=1)f[x]=x;for(p=0,g=Math.pow(2,2),O=1;O!=g;)d=L.val&L.position,L.position>>=1,L.position==0&&(L.position=c,L.val=m(L.index++)),p|=(d>0?1:0)*O,O<<=1;switch(p){case 0:for(p=0,g=Math.pow(2,8),O=1;O!=g;)d=L.val&L.position,L.position>>=1,L.position==0&&(L.position=c,L.val=m(L.index++)),p|=(d>0?1:0)*O,O<<=1;w=t(p);break;case 1:for(p=0,g=Math.pow(2,16),O=1;O!=g;)d=L.val&L.position,L.position>>=1,L.position==0&&(L.position=c,L.val=m(L.index++)),p|=(d>0?1:0)*O,O<<=1;w=t(p);break;case 2:return"";}for(f[3]=w,h=w,P.push(w);;){if(L.index>a)return"";for(p=0,g=Math.pow(2,E),O=1;O!=g;)d=L.val&L.position,L.position>>=1,L.position==0&&(L.position=c,L.val=m(L.index++)),p|=(d>0?1:0)*O,O<<=1;switch(w=p){case 0:for(p=0,g=Math.pow(2,8),O=1;O!=g;)d=L.val&L.position,L.position>>=1,L.position==0&&(L.position=c,L.val=m(L.index++)),p|=(d>0?1:0)*O,O<<=1;f[S++]=t(p),w=S-1,v--;break;case 1:for(p=0,g=Math.pow(2,16),O=1;O!=g;)d=L.val&L.position,L.position>>=1,L.position==0&&(L.position=c,L.val=m(L.index++)),p|=(d>0?1:0)*O,O<<=1;f[S++]=t(p),w=S-1,v--;break;case 2:return P.join("");}if(v==0&&(v=Math.pow(2,E),E++),f[w])T=f[w];else if(w===S)T=h+h.charAt(0);else return null;P.push(T),f[S++]=h+T.charAt(0),v--,h=T,v==0&&(v=Math.pow(2,E),E++);}}};return o;}();u!=null?u.exports=e:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e;});})(hn);var ki=hn.exports;function Qe(u){return JSON.parse(ki.decompress(u));}function ve(u){return ki.compress(JSON.stringify(u));}var Hi={exports:{}};(function(u){(function(){var e={};e.version="6.4.2.2",e.use_lines=!0,e.use_xyz=!1;var t=!1;u.exports?(u.exports=e,t=!0):(typeof document==="undefined"?"undefined":_typeof(document))<"u"?window.ClipperLib=e:self.ClipperLib=e;var r;if(t){var n="chrome";r="Netscape";}else{var n=navigator.userAgent.toString().toLowerCase();r=navigator.appName;}var i={};n.indexOf("chrome")!=-1&&n.indexOf("chromium")==-1?i.chrome=1:i.chrome=0,n.indexOf("chromium")!=-1?i.chromium=1:i.chromium=0,n.indexOf("safari")!=-1&&n.indexOf("chrome")==-1&&n.indexOf("chromium")==-1?i.safari=1:i.safari=0,n.indexOf("firefox")!=-1?i.firefox=1:i.firefox=0,n.indexOf("firefox/17")!=-1?i.firefox17=1:i.firefox17=0,n.indexOf("firefox/15")!=-1?i.firefox15=1:i.firefox15=0,n.indexOf("firefox/3")!=-1?i.firefox3=1:i.firefox3=0,n.indexOf("opera")!=-1?i.opera=1:i.opera=0,n.indexOf("msie 10")!=-1?i.msie10=1:i.msie10=0,n.indexOf("msie 9")!=-1?i.msie9=1:i.msie9=0,n.indexOf("msie 8")!=-1?i.msie8=1:i.msie8=0,n.indexOf("msie 7")!=-1?i.msie7=1:i.msie7=0,n.indexOf("msie ")!=-1?i.msie=1:i.msie=0,e.biginteger_used=null;var l;function o(s,y,I){e.biginteger_used=1,s!=null&&(typeof s=="number"&&_typeof(y)>"u"?this.fromInt(s):typeof s=="number"?this.fromNumber(s,y,I):y==null&&typeof s!="string"?this.fromString(s,256):this.fromString(s,y));}function a(){return new o(null,void 0,void 0);}function c(s,y,I,N,z,Z){for(;--Z>=0;){var tt=y*this[s++]+I[N]+z;z=Math.floor(tt/67108864),I[N++]=tt&67108863;}return z;}function m(s,y,I,N,z,Z){for(var tt=y&32767,ft=y>>15;--Z>=0;){var ht=this[s]&32767,It=this[s++]>>15,Rt=ft*ht+It*tt;ht=tt*ht+((Rt&32767)<<15)+I[N]+(z&1073741823),z=(ht>>>30)+(Rt>>>15)+ft*It+(z>>>30),I[N++]=ht&1073741823;}return z;}function f(s,y,I,N,z,Z){for(var tt=y&16383,ft=y>>14;--Z>=0;){var ht=this[s]&16383,It=this[s++]>>14,Rt=ft*ht+It*tt;ht=tt*ht+((Rt&16383)<<14)+I[N]+z,z=(ht>>28)+(Rt>>14)+ft*It,I[N++]=ht&268435455;}return z;}r=="Microsoft Internet Explorer"?(o.prototype.am=m,l=30):r!="Netscape"?(o.prototype.am=c,l=26):(o.prototype.am=f,l=28),o.prototype.DB=l,o.prototype.DM=(1<<l)-1,o.prototype.DV=1<<l;var v=52;o.prototype.FV=Math.pow(2,v),o.prototype.F1=v-l,o.prototype.F2=2*l-v;var S="0123456789abcdefghijklmnopqrstuvwxyz",E=new Array(),T,P;for(T=48,P=0;P<=9;++P)E[T++]=P;for(T=97,P=10;P<36;++P)E[T++]=P;for(T=65,P=10;P<36;++P)E[T++]=P;function x(s){return S.charAt(s);}function h(s,y){var I=E[s.charCodeAt(y)];return I!==null&&I!==void 0?I:-1;}function p(s){for(var y=this.t-1;y>=0;--y)s[y]=this[y];s.t=this.t,s.s=this.s;}function d(s){this.t=1,this.s=s<0?-1:0,s>0?this[0]=s:s<-1?this[0]=s+this.DV:this.t=0;}function g(s){var y=a();return y.fromInt(s),y;}function O(s,y){var I;if(y==16)I=4;else if(y==8)I=3;else if(y==256)I=8;else if(y==2)I=1;else if(y==32)I=5;else if(y==4)I=2;else{this.fromRadix(s,y);return;}this.t=0,this.s=0;for(var N=s.length,z=!1,Z=0;--N>=0;){var tt=I==8?s[N]&255:h(s,N);if(tt<0){s.charAt(N)=="-"&&(z=!0);continue;}z=!1,Z==0?this[this.t++]=tt:Z+I>this.DB?(this[this.t-1]|=(tt&(1<<this.DB-Z)-1)<<Z,this[this.t++]=tt>>this.DB-Z):this[this.t-1]|=tt<<Z,Z+=I,Z>=this.DB&&(Z-=this.DB);}I==8&&s[0]&128&&(this.s=-1,Z>0&&(this[this.t-1]|=(1<<this.DB-Z)-1<<Z)),this.clamp(),z&&o.ZERO.subTo(this,this);}function w(){for(var s=this.s&this.DM;this.t>0&&this[this.t-1]==s;)--this.t;}function L(s){if(this.s<0)return"-"+this.negate().toString(s);var y;if(s==16)y=4;else if(s==8)y=3;else if(s==2)y=1;else if(s==32)y=5;else if(s==4)y=2;else return this.toRadix(s);var I=(1<<y)-1,N,z=!1,Z="",tt=this.t,ft=this.DB-tt*this.DB%y;if(tt-->0)for(ft<this.DB&&(N=this[tt]>>ft)>0&&(z=!0,Z=x(N));tt>=0;)ft<y?(N=(this[tt]&(1<<ft)-1)<<y-ft,N|=this[--tt]>>(ft+=this.DB-y)):(N=this[tt]>>(ft-=y)&I,ft<=0&&(ft+=this.DB,--tt)),N>0&&(z=!0),z&&(Z+=x(N));return z?Z:"0";}function B(){var s=a();return o.ZERO.subTo(this,s),s;}function A(){return this.s<0?this.negate():this;}function b(s){var y=this.s-s.s;if(y!=0)return y;var I=this.t;if(y=I-s.t,y!=0)return this.s<0?-y:y;for(;--I>=0;)if((y=this[I]-s[I])!=0)return y;return 0;}function W(s){var y=1,I;return(I=s>>>16)!=0&&(s=I,y+=16),(I=s>>8)!=0&&(s=I,y+=8),(I=s>>4)!=0&&(s=I,y+=4),(I=s>>2)!=0&&(s=I,y+=2),(I=s>>1)!=0&&(s=I,y+=1),y;}function D(){return this.t<=0?0:this.DB*(this.t-1)+W(this[this.t-1]^this.s&this.DM);}function R(s,y){var I;for(I=this.t-1;I>=0;--I)y[I+s]=this[I];for(I=s-1;I>=0;--I)y[I]=0;y.t=this.t+s,y.s=this.s;}function X(s,y){for(var I=s;I<this.t;++I)y[I-s]=this[I];y.t=Math.max(this.t-s,0),y.s=this.s;}function H(s,y){var I=s%this.DB,N=this.DB-I,z=(1<<N)-1,Z=Math.floor(s/this.DB),tt=this.s<<I&this.DM,ft;for(ft=this.t-1;ft>=0;--ft)y[ft+Z+1]=this[ft]>>N|tt,tt=(this[ft]&z)<<I;for(ft=Z-1;ft>=0;--ft)y[ft]=0;y[Z]=tt,y.t=this.t+Z+1,y.s=this.s,y.clamp();}function J(s,y){y.s=this.s;var I=Math.floor(s/this.DB);if(I>=this.t){y.t=0;return;}var N=s%this.DB,z=this.DB-N,Z=(1<<N)-1;y[0]=this[I]>>N;for(var tt=I+1;tt<this.t;++tt)y[tt-I-1]|=(this[tt]&Z)<<z,y[tt-I]=this[tt]>>N;N>0&&(y[this.t-I-1]|=(this.s&Z)<<z),y.t=this.t-I,y.clamp();}function et(s,y){for(var I=0,N=0,z=Math.min(s.t,this.t);I<z;)N+=this[I]-s[I],y[I++]=N&this.DM,N>>=this.DB;if(s.t<this.t){for(N-=s.s;I<this.t;)N+=this[I],y[I++]=N&this.DM,N>>=this.DB;N+=this.s;}else{for(N+=this.s;I<s.t;)N-=s[I],y[I++]=N&this.DM,N>>=this.DB;N-=s.s;}y.s=N<0?-1:0,N<-1?y[I++]=this.DV+N:N>0&&(y[I++]=N),y.t=I,y.clamp();}function it(s,y){var I=this.abs(),N=s.abs(),z=I.t;for(y.t=z+N.t;--z>=0;)y[z]=0;for(z=0;z<N.t;++z)y[z+I.t]=I.am(0,N[z],y,z,0,I.t);y.s=0,y.clamp(),this.s!=s.s&&o.ZERO.subTo(y,y);}function $(s){for(var y=this.abs(),I=s.t=2*y.t;--I>=0;)s[I]=0;for(I=0;I<y.t-1;++I){var N=y.am(I,y[I],s,2*I,0,1);(s[I+y.t]+=y.am(I+1,2*y[I],s,2*I+1,N,y.t-I-1))>=y.DV&&(s[I+y.t]-=y.DV,s[I+y.t+1]=1);}s.t>0&&(s[s.t-1]+=y.am(I,y[I],s,2*I,0,1)),s.s=0,s.clamp();}function V(s,y,I){var N=s.abs();if(!(N.t<=0)){var z=this.abs();if(z.t<N.t){y!=null&&y.fromInt(0),I!=null&&this.copyTo(I);return;}I==null&&(I=a());var Z=a(),tt=this.s,ft=s.s,ht=this.DB-W(N[N.t-1]);ht>0?(N.lShiftTo(ht,Z),z.lShiftTo(ht,I)):(N.copyTo(Z),z.copyTo(I));var It=Z.t,Rt=Z[It-1];if(Rt!=0){var Lt=Rt*(1<<this.F1)+(It>1?Z[It-2]>>this.F2:0),Wt=this.FV/Lt,Yt=(1<<this.F1)/Lt,Vt=1<<this.F2,Kt=I.t,ee=Kt-It,ge=y!==null&&y!==void 0?y:a();for(Z.dlShiftTo(ee,ge),I.compareTo(ge)>=0&&(I[I.t++]=1,I.subTo(ge,I)),o.ONE.dlShiftTo(It,ge),ge.subTo(Z,Z);Z.t<It;)Z[Z.t++]=0;for(;--ee>=0;){var Oe=I[--Kt]==Rt?this.DM:Math.floor(I[Kt]*Wt+(I[Kt-1]+Vt)*Yt);if((I[Kt]+=Z.am(0,Oe,I,ee,0,It))<Oe)for(Z.dlShiftTo(ee,ge),I.subTo(ge,I);I[Kt]<--Oe;)I.subTo(ge,I);}y!=null&&(I.drShiftTo(It,y),tt!=ft&&o.ZERO.subTo(y,y)),I.t=It,I.clamp(),ht>0&&I.rShiftTo(ht,I),tt<0&&o.ZERO.subTo(I,I);}}}function rt(s){var y=a();return this.abs().divRemTo(s,null,y),this.s<0&&y.compareTo(o.ZERO)>0&&s.subTo(y,y),y;}function lt(s){this.m=s;}function ct(s){return s.s<0||s.compareTo(this.m)>=0?s.mod(this.m):s;}function gt(s){return s;}function st(s){s.divRemTo(this.m,null,s);}function Ct(s,y,I){s.multiplyTo(y,I),this.reduce(I);}function xt(s,y){s.squareTo(y),this.reduce(y);}lt.prototype.convert=ct,lt.prototype.revert=gt,lt.prototype.reduce=st,lt.prototype.mulTo=Ct,lt.prototype.sqrTo=xt;function F(){if(this.t<1)return 0;var s=this[0];if(!(s&1))return 0;var y=s&3;return y=y*(2-(s&15)*y)&15,y=y*(2-(s&255)*y)&255,y=y*(2-((s&65535)*y&65535))&65535,y=y*(2-s*y%this.DV)%this.DV,y>0?this.DV-y:-y;}function U(s){this.m=s,this.mp=s.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<s.DB-15)-1,this.mt2=2*s.t;}function K(s){var y=a();return s.abs().dlShiftTo(this.m.t,y),y.divRemTo(this.m,null,y),s.s<0&&y.compareTo(o.ZERO)>0&&this.m.subTo(y,y),y;}function q(s){var y=a();return s.copyTo(y),this.reduce(y),y;}function Y(s){for(;s.t<=this.mt2;)s[s.t++]=0;for(var y=0;y<this.m.t;++y){var I=s[y]&32767,N=I*this.mpl+((I*this.mph+(s[y]>>15)*this.mpl&this.um)<<15)&s.DM;for(I=y+this.m.t,s[I]+=this.m.am(0,N,s,y,0,this.m.t);s[I]>=s.DV;)s[I]-=s.DV,s[++I]++;}s.clamp(),s.drShiftTo(this.m.t,s),s.compareTo(this.m)>=0&&s.subTo(this.m,s);}function k(s,y){s.squareTo(y),this.reduce(y);}function C(s,y,I){s.multiplyTo(y,I),this.reduce(I);}U.prototype.convert=K,U.prototype.revert=q,U.prototype.reduce=Y,U.prototype.mulTo=C,U.prototype.sqrTo=k;function M(){return(this.t>0?this[0]&1:this.s)==0;}function j(s,y){if(s>4294967295||s<1)return o.ONE;var I=a(),N=a(),z=y.convert(this),Z=W(s)-1;for(z.copyTo(I);--Z>=0;)if(y.sqrTo(I,N),(s&1<<Z)>0)y.mulTo(N,z,I);else{var tt=I;I=N,N=tt;}return y.revert(I);}function G(s,y){var I;return s<256||y.isEven()?I=new lt(y):I=new U(y),this.exp(s,I);}o.prototype.copyTo=p,o.prototype.fromInt=d,o.prototype.fromString=O,o.prototype.clamp=w,o.prototype.dlShiftTo=R,o.prototype.drShiftTo=X,o.prototype.lShiftTo=H,o.prototype.rShiftTo=J,o.prototype.subTo=et,o.prototype.multiplyTo=it,o.prototype.squareTo=$,o.prototype.divRemTo=V,o.prototype.invDigit=F,o.prototype.isEven=M,o.prototype.exp=j,o.prototype.toString=L,o.prototype.negate=B,o.prototype.abs=A,o.prototype.compareTo=b,o.prototype.bitLength=D,o.prototype.mod=rt,o.prototype.modPowInt=G,o.ZERO=g(0),o.ONE=g(1);function Q(){var s=a();return this.copyTo(s),s;}function _(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1;}else{if(this.t==1)return this[0];if(this.t==0)return 0;}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0];}function nt(){return this.t==0?this.s:this[0]<<24>>24;}function ut(){return this.t==0?this.s:this[0]<<16>>16;}function mt(s){return Math.floor(Math.LN2*this.DB/Math.log(s));}function Pt(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1;}function Tt(s){if(s==null&&(s=10),this.signum()==0||s<2||s>36)return"0";var y=this.chunkSize(s),I=Math.pow(s,y),N=g(I),z=a(),Z=a(),tt="";for(this.divRemTo(N,z,Z);z.signum()>0;)tt=(I+Z.intValue()).toString(s).substr(1)+tt,z.divRemTo(N,z,Z);return Z.intValue().toString(s)+tt;}function yt(s,y){this.fromInt(0),y==null&&(y=10);for(var I=this.chunkSize(y),N=Math.pow(y,I),z=!1,Z=0,tt=0,ft=0;ft<s.length;++ft){var ht=h(s,ft);if(ht<0){s.charAt(ft)=="-"&&this.signum()==0&&(z=!0);continue;}tt=y*tt+ht,++Z>=I&&(this.dMultiply(N),this.dAddOffset(tt,0),Z=0,tt=0);}Z>0&&(this.dMultiply(Math.pow(y,Z)),this.dAddOffset(tt,0)),z&&o.ZERO.subTo(this,this);}function vt(s,y,I){if(typeof y=="number"){if(s<2)this.fromInt(1);else for(this.fromNumber(s,I),this.testBit(s-1)||this.bitwiseTo(o.ONE.shiftLeft(s-1),Ut,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(y);)this.dAddOffset(2,0),this.bitLength()>s&&this.subTo(o.ONE.shiftLeft(s-1),this);}else{var N=new Array(),z=s&7;N.length=(s>>3)+1,y.nextBytes(N),z>0?N[0]&=(1<<z)-1:N[0]=0,this.fromString(N,256);}}function St(){var s=this.t,y=new Array();y[0]=this.s;var I=this.DB-s*this.DB%8,N,z=0;if(s-->0)for(I<this.DB&&(N=this[s]>>I)!=(this.s&this.DM)>>I&&(y[z++]=N|this.s<<this.DB-I);s>=0;)I<8?(N=(this[s]&(1<<I)-1)<<8-I,N|=this[--s]>>(I+=this.DB-8)):(N=this[s]>>(I-=8)&255,I<=0&&(I+=this.DB,--s)),N&128&&(N|=-256),z==0&&(this.s&128)!=(N&128)&&++z,(z>0||N!=this.s)&&(y[z++]=N);return y;}function Mt(s){return this.compareTo(s)==0;}function wt(s){return this.compareTo(s)<0?this:s;}function Ot(s){return this.compareTo(s)>0?this:s;}function Bt(s,y,I){var N,z,Z=Math.min(s.t,this.t);for(N=0;N<Z;++N)I[N]=y(this[N],s[N]);if(s.t<this.t){for(z=s.s&this.DM,N=Z;N<this.t;++N)I[N]=y(this[N],z);I.t=this.t;}else{for(z=this.s&this.DM,N=Z;N<s.t;++N)I[N]=y(z,s[N]);I.t=s.t;}I.s=y(this.s,s.s),I.clamp();}function Gt(s,y){return s&y;}function jt(s){var y=a();return this.bitwiseTo(s,Gt,y),y;}function Ut(s,y){return s|y;}function zt(s){var y=a();return this.bitwiseTo(s,Ut,y),y;}function Xt(s,y){return s^y;}function ae(s){var y=a();return this.bitwiseTo(s,Xt,y),y;}function ie(s,y){return s&~y;}function se(s){var y=a();return this.bitwiseTo(s,ie,y),y;}function oe(){for(var s=a(),y=0;y<this.t;++y)s[y]=this.DM&~this[y];return s.t=this.t,s.s=~this.s,s;}function le(s){var y=a();return s<0?this.rShiftTo(-s,y):this.lShiftTo(s,y),y;}function ce(s){var y=a();return s<0?this.lShiftTo(-s,y):this.rShiftTo(s,y),y;}function fe(s){if(s==0)return-1;var y=0;return s&65535||(s>>=16,y+=16),s&255||(s>>=8,y+=8),s&15||(s>>=4,y+=4),s&3||(s>>=2,y+=2),s&1||++y,y;}function Jt(){for(var s=0;s<this.t;++s)if(this[s]!=0)return s*this.DB+fe(this[s]);return this.s<0?this.t*this.DB:-1;}function Se(s){for(var y=0;s!=0;)s&=s-1,++y;return y;}function Be(){for(var s=0,y=this.s&this.DM,I=0;I<this.t;++I)s+=Se(this[I]^y);return s;}function We(s){var y=Math.floor(s/this.DB);return y>=this.t?this.s!=0:(this[y]&1<<s%this.DB)!=0;}function mr(s,y){var I=o.ONE.shiftLeft(s);return this.bitwiseTo(I,y,I),I;}function vr(s){return this.changeBit(s,Ut);}function xs(s){return this.changeBit(s,ie);}function Ts(s){return this.changeBit(s,Xt);}function Cs(s,y){for(var I=0,N=0,z=Math.min(s.t,this.t);I<z;)N+=this[I]+s[I],y[I++]=N&this.DM,N>>=this.DB;if(s.t<this.t){for(N+=s.s;I<this.t;)N+=this[I],y[I++]=N&this.DM,N>>=this.DB;N+=this.s;}else{for(N+=this.s;I<s.t;)N+=s[I],y[I++]=N&this.DM,N>>=this.DB;N+=s.s;}y.s=N<0?-1:0,N>0?y[I++]=N:N<-1&&(y[I++]=this.DV+N),y.t=I,y.clamp();}function Is(s){var y=a();return this.addTo(s,y),y;}function Os(s){var y=a();return this.subTo(s,y),y;}function Es(s){var y=a();return this.multiplyTo(s,y),y;}function Ms(){var s=a();return this.squareTo(s),s;}function As(s){var y=a();return this.divRemTo(s,y,null),y;}function ws(s){var y=a();return this.divRemTo(s,null,y),y;}function Ls(s){var y=a(),I=a();return this.divRemTo(s,y,I),new Array(y,I);}function Rs(s){this[this.t]=this.am(0,s-1,this,0,0,this.t),++this.t,this.clamp();}function Ds(s,y){if(s!=0){for(;this.t<=y;)this[this.t++]=0;for(this[y]+=s;this[y]>=this.DV;)this[y]-=this.DV,++y>=this.t&&(this[this.t++]=0),++this[y];}}function ir(){}function Pn(s){return s;}function bs(s,y,I){s.multiplyTo(y,I);}function Ns(s,y){s.squareTo(y);}ir.prototype.convert=Pn,ir.prototype.revert=Pn,ir.prototype.mulTo=bs,ir.prototype.sqrTo=Ns;function Bs(s){return this.exp(s,new ir());}function Ws(s,y,I){var N=Math.min(this.t+s.t,y);for(I.s=0,I.t=N;N>0;)I[--N]=0;var z;for(z=I.t-this.t;N<z;++N)I[N+this.t]=this.am(0,s[N],I,N,0,this.t);for(z=Math.min(s.t,y);N<z;++N)this.am(0,s[N],I,N,0,y-N);I.clamp();}function Fs(s,y,I){--y;var N=I.t=this.t+s.t-y;for(I.s=0;--N>=0;)I[N]=0;for(N=Math.max(y-this.t,0);N<s.t;++N)I[this.t+N-y]=this.am(y-N,s[N],I,0,0,this.t+N-y);I.clamp(),I.drShiftTo(1,I);}function je(s){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*s.t,this.r2),this.mu=this.r2.divide(s),this.m=s;}function Us(s){if(s.s<0||s.t>2*this.m.t)return s.mod(this.m);if(s.compareTo(this.m)<0)return s;var y=a();return s.copyTo(y),this.reduce(y),y;}function js(s){return s;}function Ys(s){for(s.drShiftTo(this.m.t-1,this.r2),s.t>this.m.t+1&&(s.t=this.m.t+1,s.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);s.compareTo(this.r2)<0;)s.dAddOffset(1,this.m.t+1);for(s.subTo(this.r2,s);s.compareTo(this.m)>=0;)s.subTo(this.m,s);}function Xs(s,y){s.squareTo(y),this.reduce(y);}function zs(s,y,I){s.multiplyTo(y,I),this.reduce(I);}je.prototype.convert=Us,je.prototype.revert=js,je.prototype.reduce=Ys,je.prototype.mulTo=zs,je.prototype.sqrTo=Xs;function $s(s,y){var I=s.bitLength(),N,z=g(1),Z;if(I<=0)return z;I<18?N=1:I<48?N=3:I<144?N=4:I<768?N=5:N=6,I<8?Z=new lt(y):y.isEven()?Z=new je(y):Z=new U(y);var tt=new Array(),ft=3,ht=N-1,It=(1<<N)-1;if(tt[1]=Z.convert(this),N>1){var Rt=a();for(Z.sqrTo(tt[1],Rt);ft<=It;)tt[ft]=a(),Z.mulTo(Rt,tt[ft-2],tt[ft]),ft+=2;}var Lt=s.t-1,Wt,Yt=!0,Vt=a(),Kt;for(I=W(s[Lt])-1;Lt>=0;){for(I>=ht?Wt=s[Lt]>>I-ht&It:(Wt=(s[Lt]&(1<<I+1)-1)<<ht-I,Lt>0&&(Wt|=s[Lt-1]>>this.DB+I-ht)),ft=N;!(Wt&1);)Wt>>=1,--ft;if((I-=ft)<0&&(I+=this.DB,--Lt),Yt)tt[Wt].copyTo(z),Yt=!1;else{for(;ft>1;)Z.sqrTo(z,Vt),Z.sqrTo(Vt,z),ft-=2;ft>0?Z.sqrTo(z,Vt):(Kt=z,z=Vt,Vt=Kt),Z.mulTo(Vt,tt[Wt],z);}for(;Lt>=0&&!(s[Lt]&1<<I);)Z.sqrTo(z,Vt),Kt=z,z=Vt,Vt=Kt,--I<0&&(I=this.DB-1,--Lt);}return Z.revert(z);}function Gs(s){var y=this.s<0?this.negate():this.clone(),I=s.s<0?s.negate():s.clone();if(y.compareTo(I)<0){var N=y;y=I,I=N;}var z=y.getLowestSetBit(),Z=I.getLowestSetBit();if(Z<0)return y;for(z<Z&&(Z=z),Z>0&&(y.rShiftTo(Z,y),I.rShiftTo(Z,I));y.signum()>0;)(z=y.getLowestSetBit())>0&&y.rShiftTo(z,y),(z=I.getLowestSetBit())>0&&I.rShiftTo(z,I),y.compareTo(I)>=0?(y.subTo(I,y),y.rShiftTo(1,y)):(I.subTo(y,I),I.rShiftTo(1,I));return Z>0&&I.lShiftTo(Z,I),I;}function ks(s){if(s<=0)return 0;var y=this.DV%s,I=this.s<0?s-1:0;if(this.t>0)if(y==0)I=this[0]%s;else for(var N=this.t-1;N>=0;--N)I=(y*I+this[N])%s;return I;}function Hs(s){var y=s.isEven();if(this.isEven()&&y||s.signum()==0)return o.ZERO;for(var I=s.clone(),N=this.clone(),z=g(1),Z=g(0),tt=g(0),ft=g(1);I.signum()!=0;){for(;I.isEven();)I.rShiftTo(1,I),y?((!z.isEven()||!Z.isEven())&&(z.addTo(this,z),Z.subTo(s,Z)),z.rShiftTo(1,z)):Z.isEven()||Z.subTo(s,Z),Z.rShiftTo(1,Z);for(;N.isEven();)N.rShiftTo(1,N),y?((!tt.isEven()||!ft.isEven())&&(tt.addTo(this,tt),ft.subTo(s,ft)),tt.rShiftTo(1,tt)):ft.isEven()||ft.subTo(s,ft),ft.rShiftTo(1,ft);I.compareTo(N)>=0?(I.subTo(N,I),y&&z.subTo(tt,z),Z.subTo(ft,Z)):(N.subTo(I,N),y&&tt.subTo(z,tt),ft.subTo(Z,ft));}if(N.compareTo(o.ONE)!=0)return o.ZERO;if(ft.compareTo(s)>=0)return ft.subtract(s);if(ft.signum()<0)ft.addTo(s,ft);else return ft;return ft.signum()<0?ft.add(s):ft;}var de=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Vs=(1<<26)/de[de.length-1];function Ks(s){var y,I=this.abs();if(I.t==1&&I[0]<=de[de.length-1]){for(y=0;y<de.length;++y)if(I[0]==de[y])return!0;return!1;}if(I.isEven())return!1;for(y=1;y<de.length;){for(var N=de[y],z=y+1;z<de.length&&N<Vs;)N*=de[z++];for(N=I.modInt(N);y<z;)if(N%de[y++]==0)return!1;}return I.millerRabin(s);}function Zs(s){var y=this.subtract(o.ONE),I=y.getLowestSetBit();if(I<=0)return!1;var N=y.shiftRight(I);s=s+1>>1,s>de.length&&(s=de.length);for(var z=a(),Z=0;Z<s;++Z){z.fromInt(de[Math.floor(Math.random()*de.length)]);var tt=z.modPow(N,this);if(tt.compareTo(o.ONE)!=0&&tt.compareTo(y)!=0){for(var ft=1;ft++<I&&tt.compareTo(y)!=0;)if(tt=tt.modPowInt(2,this),tt.compareTo(o.ONE)==0)return!1;if(tt.compareTo(y)!=0)return!1;}}return!0;}o.prototype.chunkSize=mt,o.prototype.toRadix=Tt,o.prototype.fromRadix=yt,o.prototype.fromNumber=vt,o.prototype.bitwiseTo=Bt,o.prototype.changeBit=mr,o.prototype.addTo=Cs,o.prototype.dMultiply=Rs,o.prototype.dAddOffset=Ds,o.prototype.multiplyLowerTo=Ws,o.prototype.multiplyUpperTo=Fs,o.prototype.modInt=ks,o.prototype.millerRabin=Zs,o.prototype.clone=Q,o.prototype.intValue=_,o.prototype.byteValue=nt,o.prototype.shortValue=ut,o.prototype.signum=Pt,o.prototype.toByteArray=St,o.prototype.equals=Mt,o.prototype.min=wt,o.prototype.max=Ot,o.prototype.and=jt,o.prototype.or=zt,o.prototype.xor=ae,o.prototype.andNot=se,o.prototype.not=oe,o.prototype.shiftLeft=le,o.prototype.shiftRight=ce,o.prototype.getLowestSetBit=Jt,o.prototype.bitCount=Be,o.prototype.testBit=We,o.prototype.setBit=vr,o.prototype.clearBit=xs,o.prototype.flipBit=Ts,o.prototype.add=Is,o.prototype.subtract=Os,o.prototype.multiply=Es,o.prototype.divide=As,o.prototype.remainder=ws,o.prototype.divideAndRemainder=Ls,o.prototype.modPow=$s,o.prototype.modInverse=Hs,o.prototype.pow=Bs,o.prototype.gcd=Gs,o.prototype.isProbablePrime=Ks,o.prototype.square=Ms;var Ht=o;Ht.prototype.IsNegative=function(){return this.compareTo(Ht.ZERO)==-1;},Ht.op_Equality=function(s,y){return s.compareTo(y)==0;},Ht.op_Inequality=function(s,y){return s.compareTo(y)!=0;},Ht.op_GreaterThan=function(s,y){return s.compareTo(y)>0;},Ht.op_LessThan=function(s,y){return s.compareTo(y)<0;},Ht.op_Addition=function(s,y){return new Ht(s,void 0,void 0).add(new Ht(y,void 0,void 0));},Ht.op_Subtraction=function(s,y){return new Ht(s,void 0,void 0).subtract(new Ht(y,void 0,void 0));},Ht.Int128Mul=function(s,y){return new Ht(s,void 0,void 0).multiply(new Ht(y,void 0,void 0));},Ht.op_Division=function(s,y){return s.divide(y);},Ht.prototype.ToDouble=function(){return parseFloat(this.toString());};var Sn=function Sn(s,y){var I;if(_typeof(Object.getOwnPropertyNames)>"u"){for(I in y.prototype)(_typeof(s.prototype[I])>"u"||s.prototype[I]===Object.prototype[I])&&(s.prototype[I]=y.prototype[I]);for(I in y)_typeof(s[I])>"u"&&(s[I]=y[I]);s.$baseCtor=y;}else{for(var N=Object.getOwnPropertyNames(y.prototype),z=0;z<N.length;z++)_typeof(Object.getOwnPropertyDescriptor(s.prototype,N[z]))>"u"&&Object.defineProperty(s.prototype,N[z],Object.getOwnPropertyDescriptor(y.prototype,N[z]));for(I in y)_typeof(s[I])>"u"&&(s[I]=y[I]);s.$baseCtor=y;}};e.Path=function(){return[];},e.Path.prototype.push=Array.prototype.push,e.Paths=function(){return[];},e.Paths.prototype.push=Array.prototype.push,e.DoublePoint=function(){var s=arguments;this.X=0,this.Y=0,s.length===1?(this.X=s[0].X,this.Y=s[0].Y):s.length===2&&(this.X=s[0],this.Y=s[1]);},e.DoublePoint0=function(){this.X=0,this.Y=0;},e.DoublePoint0.prototype=e.DoublePoint.prototype,e.DoublePoint1=function(s){this.X=s.X,this.Y=s.Y;},e.DoublePoint1.prototype=e.DoublePoint.prototype,e.DoublePoint2=function(s,y){this.X=s,this.Y=y;},e.DoublePoint2.prototype=e.DoublePoint.prototype,e.PolyNode=function(){this.m_Parent=null,this.m_polygon=new e.Path(),this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1;},e.PolyNode.prototype.IsHoleNode=function(){for(var s=!0,y=this.m_Parent;y!==null;)s=!s,y=y.m_Parent;return s;},e.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length;},e.PolyNode.prototype.Contour=function(){return this.m_polygon;},e.PolyNode.prototype.AddChild=function(s){var y=this.m_Childs.length;this.m_Childs.push(s),s.m_Parent=this,s.m_Index=y;},e.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp();},e.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index===this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1];},e.PolyNode.prototype.Childs=function(){return this.m_Childs;},e.PolyNode.prototype.Parent=function(){return this.m_Parent;},e.PolyNode.prototype.IsHole=function(){return this.IsHoleNode();},e.PolyTree=function(){this.m_AllPolys=[],e.PolyNode.call(this);},e.PolyTree.prototype.Clear=function(){for(var s=0,y=this.m_AllPolys.length;s<y;s++)this.m_AllPolys[s]=null;this.m_AllPolys.length=0,this.m_Childs.length=0;},e.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null;},e.PolyTree.prototype.Total=function(){var s=this.m_AllPolys.length;return s>0&&this.m_Childs[0]!==this.m_AllPolys[0]&&s--,s;},Sn(e.PolyTree,e.PolyNode),e.Math_Abs_Int64=e.Math_Abs_Int32=e.Math_Abs_Double=function(s){return Math.abs(s);},e.Math_Max_Int32_Int32=function(s,y){return Math.max(s,y);},i.msie||i.opera||i.safari?e.Cast_Int32=function(s){return s|0;}:e.Cast_Int32=function(s){return~~s;},_typeof(Number.toInteger)>"u"&&(Number.toInteger=null),i.chrome?e.Cast_Int64=function(s){return s<-2147483648||s>2147483647?s<0?Math.ceil(s):Math.floor(s):~~s;}:i.firefox&&typeof Number.toInteger=="function"?e.Cast_Int64=function(s){return Number.toInteger(s);}:i.msie7||i.msie8?e.Cast_Int64=function(s){return parseInt(s,10);}:i.msie?e.Cast_Int64=function(s){return s<-2147483648||s>2147483647?s<0?Math.ceil(s):Math.floor(s):s|0;}:e.Cast_Int64=function(s){return s<0?Math.ceil(s):Math.floor(s);},e.Clear=function(s){s.length=0;},e.PI=3.141592653589793,e.PI2=2*3.141592653589793,e.IntPoint=function(){var s=arguments,y=s.length;if(this.X=0,this.Y=0,e.use_xyz){if(this.Z=0,y===3)this.X=s[0],this.Y=s[1],this.Z=s[2];else if(y===2)this.X=s[0],this.Y=s[1],this.Z=0;else if(y===1){if(s[0]instanceof e.DoublePoint){var I=s[0];this.X=e.Clipper.Round(I.X),this.Y=e.Clipper.Round(I.Y),this.Z=0;}else{var N=s[0];_typeof(N.Z)>"u"&&(N.Z=0),this.X=N.X,this.Y=N.Y,this.Z=N.Z;}}else this.X=0,this.Y=0,this.Z=0;}else if(y===2)this.X=s[0],this.Y=s[1];else if(y===1){if(s[0]instanceof e.DoublePoint){var I=s[0];this.X=e.Clipper.Round(I.X),this.Y=e.Clipper.Round(I.Y);}else{var N=s[0];this.X=N.X,this.Y=N.Y;}}else this.X=0,this.Y=0;},e.IntPoint.op_Equality=function(s,y){return s.X===y.X&&s.Y===y.Y;},e.IntPoint.op_Inequality=function(s,y){return s.X!==y.X||s.Y!==y.Y;},e.IntPoint0=function(){this.X=0,this.Y=0,e.use_xyz&&(this.Z=0);},e.IntPoint0.prototype=e.IntPoint.prototype,e.IntPoint1=function(s){this.X=s.X,this.Y=s.Y,e.use_xyz&&(_typeof(s.Z)>"u"?this.Z=0:this.Z=s.Z);},e.IntPoint1.prototype=e.IntPoint.prototype,e.IntPoint1dp=function(s){this.X=e.Clipper.Round(s.X),this.Y=e.Clipper.Round(s.Y),e.use_xyz&&(this.Z=0);},e.IntPoint1dp.prototype=e.IntPoint.prototype,e.IntPoint2=function(s,y,I){this.X=s,this.Y=y,e.use_xyz&&(_typeof(I)>"u"?this.Z=0:this.Z=I);},e.IntPoint2.prototype=e.IntPoint.prototype,e.IntRect=function(){var s=arguments,y=s.length;if(y===4)this.left=s[0],this.top=s[1],this.right=s[2],this.bottom=s[3];else if(y===1){var I=s[0];this.left=I.left,this.top=I.top,this.right=I.right,this.bottom=I.bottom;}else this.left=0,this.top=0,this.right=0,this.bottom=0;},e.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0;},e.IntRect0.prototype=e.IntRect.prototype,e.IntRect1=function(s){this.left=s.left,this.top=s.top,this.right=s.right,this.bottom=s.bottom;},e.IntRect1.prototype=e.IntRect.prototype,e.IntRect4=function(s,y,I,N){this.left=s,this.top=y,this.right=I,this.bottom=N;},e.IntRect4.prototype=e.IntRect.prototype,e.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3},e.PolyType={ptSubject:0,ptClip:1},e.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3},e.JoinType={jtSquare:0,jtRound:1,jtMiter:2},e.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4},e.EdgeSide={esLeft:0,esRight:1},e.Direction={dRightToLeft:0,dLeftToRight:1},e.TEdge=function(){this.Bot=new e.IntPoint0(),this.Curr=new e.IntPoint0(),this.Top=new e.IntPoint0(),this.Delta=new e.IntPoint0(),this.Dx=0,this.PolyTyp=e.PolyType.ptSubject,this.Side=e.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null;},e.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new e.IntPoint0();},e.MyIntersectNodeSort=function(){},e.MyIntersectNodeSort.Compare=function(s,y){var I=y.Pt.Y-s.Pt.Y;return I>0?1:I<0?-1:0;},e.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null;},e.Scanbeam=function(){this.Y=0,this.Next=null;},e.Maxima=function(){this.X=0,this.Next=null,this.Prev=null;},e.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null;},e.OutPt=function(){this.Idx=0,this.Pt=new e.IntPoint0(),this.Next=null,this.Prev=null;},e.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new e.IntPoint0();},e.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array(),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_Scanbeam=null,this.m_PolyOuts=null,this.m_ActiveEdges=null;},e.ClipperBase.horizontal=-9007199254740992,e.ClipperBase.Skip=-2,e.ClipperBase.Unassigned=-1,e.ClipperBase.tolerance=1e-20,e.ClipperBase.loRange=47453132,e.ClipperBase.hiRange=4503599627370495,e.ClipperBase.near_zero=function(s){return s>-e.ClipperBase.tolerance&&s<e.ClipperBase.tolerance;},e.ClipperBase.IsHorizontal=function(s){return s.Delta.Y===0;},e.ClipperBase.prototype.PointIsVertex=function(s,y){var I=y;do{if(e.IntPoint.op_Equality(I.Pt,s))return!0;I=I.Next;}while(I!==y);return!1;},e.ClipperBase.prototype.PointOnLineSegment=function(s,y,I,N){return N?s.X===y.X&&s.Y===y.Y||s.X===I.X&&s.Y===I.Y||s.X>y.X==s.X<I.X&&s.Y>y.Y==s.Y<I.Y&&Ht.op_Equality(Ht.Int128Mul(s.X-y.X,I.Y-y.Y),Ht.Int128Mul(I.X-y.X,s.Y-y.Y)):s.X===y.X&&s.Y===y.Y||s.X===I.X&&s.Y===I.Y||s.X>y.X==s.X<I.X&&s.Y>y.Y==s.Y<I.Y&&(s.X-y.X)*(I.Y-y.Y)===(I.X-y.X)*(s.Y-y.Y);},e.ClipperBase.prototype.PointOnPolygon=function(s,y,I){for(var N=y;;){if(this.PointOnLineSegment(s,N.Pt,N.Next.Pt,I))return!0;if(N=N.Next,N===y)break;}return!1;},e.ClipperBase.prototype.SlopesEqual=e.ClipperBase.SlopesEqual=function(){var s=arguments,y=s.length,I,N,z,Z,tt,ft,ht;return y===3?(I=s[0],N=s[1],ht=s[2],ht?Ht.op_Equality(Ht.Int128Mul(I.Delta.Y,N.Delta.X),Ht.Int128Mul(I.Delta.X,N.Delta.Y)):e.Cast_Int64(I.Delta.Y*N.Delta.X)===e.Cast_Int64(I.Delta.X*N.Delta.Y)):y===4?(z=s[0],Z=s[1],tt=s[2],ht=s[3],ht?Ht.op_Equality(Ht.Int128Mul(z.Y-Z.Y,Z.X-tt.X),Ht.Int128Mul(z.X-Z.X,Z.Y-tt.Y)):e.Cast_Int64((z.Y-Z.Y)*(Z.X-tt.X))-e.Cast_Int64((z.X-Z.X)*(Z.Y-tt.Y))===0):(z=s[0],Z=s[1],tt=s[2],ft=s[3],ht=s[4],ht?Ht.op_Equality(Ht.Int128Mul(z.Y-Z.Y,tt.X-ft.X),Ht.Int128Mul(z.X-Z.X,tt.Y-ft.Y)):e.Cast_Int64((z.Y-Z.Y)*(tt.X-ft.X))-e.Cast_Int64((z.X-Z.X)*(tt.Y-ft.Y))===0);},e.ClipperBase.SlopesEqual3=function(s,y,I){return I?Ht.op_Equality(Ht.Int128Mul(s.Delta.Y,y.Delta.X),Ht.Int128Mul(s.Delta.X,y.Delta.Y)):e.Cast_Int64(s.Delta.Y*y.Delta.X)===e.Cast_Int64(s.Delta.X*y.Delta.Y);},e.ClipperBase.SlopesEqual4=function(s,y,I,N){return N?Ht.op_Equality(Ht.Int128Mul(s.Y-y.Y,y.X-I.X),Ht.Int128Mul(s.X-y.X,y.Y-I.Y)):e.Cast_Int64((s.Y-y.Y)*(y.X-I.X))-e.Cast_Int64((s.X-y.X)*(y.Y-I.Y))===0;},e.ClipperBase.SlopesEqual5=function(s,y,I,N,z){return z?Ht.op_Equality(Ht.Int128Mul(s.Y-y.Y,I.X-N.X),Ht.Int128Mul(s.X-y.X,I.Y-N.Y)):e.Cast_Int64((s.Y-y.Y)*(I.X-N.X))-e.Cast_Int64((s.X-y.X)*(I.Y-N.Y))===0;},e.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var s=0,y=this.m_edges.length;s<y;++s){for(var I=0,N=this.m_edges[s].length;I<N;++I)this.m_edges[s][I]=null;e.Clear(this.m_edges[s]);}e.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1;},e.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var s=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=s;}this.m_CurrentLM=null;},e.ClipperBase.prototype.RangeTest=function(s,y){y.Value?(s.X>e.ClipperBase.hiRange||s.Y>e.ClipperBase.hiRange||-s.X>e.ClipperBase.hiRange||-s.Y>e.ClipperBase.hiRange)&&e.Error("Coordinate outside allowed range in RangeTest()."):(s.X>e.ClipperBase.loRange||s.Y>e.ClipperBase.loRange||-s.X>e.ClipperBase.loRange||-s.Y>e.ClipperBase.loRange)&&(y.Value=!0,this.RangeTest(s,y));},e.ClipperBase.prototype.InitEdge=function(s,y,I,N){s.Next=y,s.Prev=I,s.Curr.X=N.X,s.Curr.Y=N.Y,e.use_xyz&&(s.Curr.Z=N.Z),s.OutIdx=-1;},e.ClipperBase.prototype.InitEdge2=function(s,y){s.Curr.Y>=s.Next.Curr.Y?(s.Bot.X=s.Curr.X,s.Bot.Y=s.Curr.Y,e.use_xyz&&(s.Bot.Z=s.Curr.Z),s.Top.X=s.Next.Curr.X,s.Top.Y=s.Next.Curr.Y,e.use_xyz&&(s.Top.Z=s.Next.Curr.Z)):(s.Top.X=s.Curr.X,s.Top.Y=s.Curr.Y,e.use_xyz&&(s.Top.Z=s.Curr.Z),s.Bot.X=s.Next.Curr.X,s.Bot.Y=s.Next.Curr.Y,e.use_xyz&&(s.Bot.Z=s.Next.Curr.Z)),this.SetDx(s),s.PolyTyp=y;},e.ClipperBase.prototype.FindNextLocMin=function(s){for(var y;;){for(;e.IntPoint.op_Inequality(s.Bot,s.Prev.Bot)||e.IntPoint.op_Equality(s.Curr,s.Top);)s=s.Next;if(s.Dx!==e.ClipperBase.horizontal&&s.Prev.Dx!==e.ClipperBase.horizontal)break;for(;s.Prev.Dx===e.ClipperBase.horizontal;)s=s.Prev;for(y=s;s.Dx===e.ClipperBase.horizontal;)s=s.Next;if(s.Top.Y!==s.Prev.Bot.Y){y.Prev.Bot.X<s.Bot.X&&(s=y);break;}}return s;},e.ClipperBase.prototype.ProcessBound=function(s,y){var I,N=s,z;if(N.OutIdx===e.ClipperBase.Skip){if(s=N,y){for(;s.Top.Y===s.Next.Bot.Y;)s=s.Next;for(;s!==N&&s.Dx===e.ClipperBase.horizontal;)s=s.Prev;}else{for(;s.Top.Y===s.Prev.Bot.Y;)s=s.Prev;for(;s!==N&&s.Dx===e.ClipperBase.horizontal;)s=s.Next;}if(s===N)y?N=s.Next:N=s.Prev;else{y?s=N.Next:s=N.Prev;var Z=new e.LocalMinima();Z.Next=null,Z.Y=s.Bot.Y,Z.LeftBound=null,Z.RightBound=s,s.WindDelta=0,N=this.ProcessBound(s,y),this.InsertLocalMinima(Z);}return N;}if(s.Dx===e.ClipperBase.horizontal&&(y?I=s.Prev:I=s.Next,I.Dx===e.ClipperBase.horizontal?I.Bot.X!==s.Bot.X&&I.Top.X!==s.Bot.X&&this.ReverseHorizontal(s):I.Bot.X!==s.Bot.X&&this.ReverseHorizontal(s)),I=s,y){for(;N.Top.Y===N.Next.Bot.Y&&N.Next.OutIdx!==e.ClipperBase.Skip;)N=N.Next;if(N.Dx===e.ClipperBase.horizontal&&N.Next.OutIdx!==e.ClipperBase.Skip){for(z=N;z.Prev.Dx===e.ClipperBase.horizontal;)z=z.Prev;z.Prev.Top.X>N.Next.Top.X&&(N=z.Prev);}for(;s!==N;)s.NextInLML=s.Next,s.Dx===e.ClipperBase.horizontal&&s!==I&&s.Bot.X!==s.Prev.Top.X&&this.ReverseHorizontal(s),s=s.Next;s.Dx===e.ClipperBase.horizontal&&s!==I&&s.Bot.X!==s.Prev.Top.X&&this.ReverseHorizontal(s),N=N.Next;}else{for(;N.Top.Y===N.Prev.Bot.Y&&N.Prev.OutIdx!==e.ClipperBase.Skip;)N=N.Prev;if(N.Dx===e.ClipperBase.horizontal&&N.Prev.OutIdx!==e.ClipperBase.Skip){for(z=N;z.Next.Dx===e.ClipperBase.horizontal;)z=z.Next;(z.Next.Top.X===N.Prev.Top.X||z.Next.Top.X>N.Prev.Top.X)&&(N=z.Next);}for(;s!==N;)s.NextInLML=s.Prev,s.Dx===e.ClipperBase.horizontal&&s!==I&&s.Bot.X!==s.Next.Top.X&&this.ReverseHorizontal(s),s=s.Prev;s.Dx===e.ClipperBase.horizontal&&s!==I&&s.Bot.X!==s.Next.Top.X&&this.ReverseHorizontal(s),N=N.Prev;}return N;},e.ClipperBase.prototype.AddPath=function(s,y,I){e.use_lines?!I&&y===e.PolyType.ptClip&&e.Error("AddPath: Open paths must be subject."):I||e.Error("AddPath: Open paths have been disabled.");var N=s.length-1;if(I)for(;N>0&&e.IntPoint.op_Equality(s[N],s[0]);)--N;for(;N>0&&e.IntPoint.op_Equality(s[N],s[N-1]);)--N;if(I&&N<2||!I&&N<1)return!1;for(var z=new Array(),Z=0;Z<=N;Z++)z.push(new e.TEdge());var tt=!0;z[1].Curr.X=s[1].X,z[1].Curr.Y=s[1].Y,e.use_xyz&&(z[1].Curr.Z=s[1].Z);var ft={Value:this.m_UseFullRange};this.RangeTest(s[0],ft),this.m_UseFullRange=ft.Value,ft.Value=this.m_UseFullRange,this.RangeTest(s[N],ft),this.m_UseFullRange=ft.Value,this.InitEdge(z[0],z[1],z[N],s[0]),this.InitEdge(z[N],z[0],z[N-1],s[N]);for(var Z=N-1;Z>=1;--Z)ft.Value=this.m_UseFullRange,this.RangeTest(s[Z],ft),this.m_UseFullRange=ft.Value,this.InitEdge(z[Z],z[Z+1],z[Z-1],s[Z]);for(var ht=z[0],It=ht,Rt=ht;;){if(It.Curr===It.Next.Curr&&(I||It.Next!==ht)){if(It===It.Next)break;It===ht&&(ht=It.Next),It=this.RemoveEdge(It),Rt=It;continue;}if(It.Prev===It.Next)break;if(I&&e.ClipperBase.SlopesEqual4(It.Prev.Curr,It.Curr,It.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(It.Prev.Curr,It.Curr,It.Next.Curr))){It===ht&&(ht=It.Next),It=this.RemoveEdge(It),It=It.Prev,Rt=It;continue;}if(It=It.Next,It===Rt||!I&&It.Next===ht)break;}if(!I&&It===It.Next||I&&It.Prev===It.Next)return!1;I||(this.m_HasOpenPaths=!0,ht.Prev.OutIdx=e.ClipperBase.Skip),It=ht;do this.InitEdge2(It,y),It=It.Next,tt&&It.Curr.Y!==ht.Curr.Y&&(tt=!1);while(It!==ht);if(tt){if(I)return!1;It.Prev.OutIdx=e.ClipperBase.Skip;var Lt=new e.LocalMinima();for(Lt.Next=null,Lt.Y=It.Bot.Y,Lt.LeftBound=null,Lt.RightBound=It,Lt.RightBound.Side=e.EdgeSide.esRight,Lt.RightBound.WindDelta=0;It.Bot.X!==It.Prev.Top.X&&this.ReverseHorizontal(It),It.Next.OutIdx!==e.ClipperBase.Skip;)It.NextInLML=It.Next,It=It.Next;return this.InsertLocalMinima(Lt),this.m_edges.push(z),!0;}this.m_edges.push(z);var Wt,Yt=null;for(e.IntPoint.op_Equality(It.Prev.Bot,It.Prev.Top)&&(It=It.Next);It=this.FindNextLocMin(It),It!==Yt;){Yt===null&&(Yt=It);var Lt=new e.LocalMinima();Lt.Next=null,Lt.Y=It.Bot.Y,It.Dx<It.Prev.Dx?(Lt.LeftBound=It.Prev,Lt.RightBound=It,Wt=!1):(Lt.LeftBound=It,Lt.RightBound=It.Prev,Wt=!0),Lt.LeftBound.Side=e.EdgeSide.esLeft,Lt.RightBound.Side=e.EdgeSide.esRight,I?Lt.LeftBound.Next===Lt.RightBound?Lt.LeftBound.WindDelta=-1:Lt.LeftBound.WindDelta=1:Lt.LeftBound.WindDelta=0,Lt.RightBound.WindDelta=-Lt.LeftBound.WindDelta,It=this.ProcessBound(Lt.LeftBound,Wt),It.OutIdx===e.ClipperBase.Skip&&(It=this.ProcessBound(It,Wt));var Vt=this.ProcessBound(Lt.RightBound,!Wt);Vt.OutIdx===e.ClipperBase.Skip&&(Vt=this.ProcessBound(Vt,!Wt)),Lt.LeftBound.OutIdx===e.ClipperBase.Skip?Lt.LeftBound=null:Lt.RightBound.OutIdx===e.ClipperBase.Skip&&(Lt.RightBound=null),this.InsertLocalMinima(Lt),Wt||(It=Vt);}return!0;},e.ClipperBase.prototype.AddPaths=function(s,y,I){for(var N=!1,z=0,Z=s.length;z<Z;++z)this.AddPath(s[z],y,I)&&(N=!0);return N;},e.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(s,y,I){return e.IntPoint.op_Equality(s,I)||e.IntPoint.op_Equality(s,y)||e.IntPoint.op_Equality(I,y)?!1:s.X!==I.X?y.X>s.X==y.X<I.X:y.Y>s.Y==y.Y<I.Y;},e.ClipperBase.prototype.RemoveEdge=function(s){s.Prev.Next=s.Next,s.Next.Prev=s.Prev;var y=s.Next;return s.Prev=null,y;},e.ClipperBase.prototype.SetDx=function(s){s.Delta.X=s.Top.X-s.Bot.X,s.Delta.Y=s.Top.Y-s.Bot.Y,s.Delta.Y===0?s.Dx=e.ClipperBase.horizontal:s.Dx=s.Delta.X/s.Delta.Y;},e.ClipperBase.prototype.InsertLocalMinima=function(s){if(this.m_MinimaList===null)this.m_MinimaList=s;else if(s.Y>=this.m_MinimaList.Y)s.Next=this.m_MinimaList,this.m_MinimaList=s;else{for(var y=this.m_MinimaList;y.Next!==null&&s.Y<y.Next.Y;)y=y.Next;s.Next=y.Next,y.Next=s;}},e.ClipperBase.prototype.PopLocalMinima=function(s,y){return y.v=this.m_CurrentLM,this.m_CurrentLM!==null&&this.m_CurrentLM.Y===s?(this.m_CurrentLM=this.m_CurrentLM.Next,!0):!1;},e.ClipperBase.prototype.ReverseHorizontal=function(s){var y=s.Top.X;s.Top.X=s.Bot.X,s.Bot.X=y,e.use_xyz&&(y=s.Top.Z,s.Top.Z=s.Bot.Z,s.Bot.Z=y);},e.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!==null){this.m_Scanbeam=null;for(var s=this.m_MinimaList;s!==null;){this.InsertScanbeam(s.Y);var y=s.LeftBound;y!==null&&(y.Curr.X=y.Bot.X,y.Curr.Y=y.Bot.Y,e.use_xyz&&(y.Curr.Z=y.Bot.Z),y.OutIdx=e.ClipperBase.Unassigned),y=s.RightBound,y!==null&&(y.Curr.X=y.Bot.X,y.Curr.Y=y.Bot.Y,e.use_xyz&&(y.Curr.Z=y.Bot.Z),y.OutIdx=e.ClipperBase.Unassigned),s=s.Next;}this.m_ActiveEdges=null;}},e.ClipperBase.prototype.InsertScanbeam=function(s){if(this.m_Scanbeam===null)this.m_Scanbeam=new e.Scanbeam(),this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=s;else if(s>this.m_Scanbeam.Y){var y=new e.Scanbeam();y.Y=s,y.Next=this.m_Scanbeam,this.m_Scanbeam=y;}else{for(var I=this.m_Scanbeam;I.Next!==null&&s<=I.Next.Y;)I=I.Next;if(s===I.Y)return;var N=new e.Scanbeam();N.Y=s,N.Next=I.Next,I.Next=N;}},e.ClipperBase.prototype.PopScanbeam=function(s){return this.m_Scanbeam===null?(s.v=0,!1):(s.v=this.m_Scanbeam.Y,this.m_Scanbeam=this.m_Scanbeam.Next,!0);},e.ClipperBase.prototype.LocalMinimaPending=function(){return this.m_CurrentLM!==null;},e.ClipperBase.prototype.CreateOutRec=function(){var s=new e.OutRec();return s.Idx=e.ClipperBase.Unassigned,s.IsHole=!1,s.IsOpen=!1,s.FirstLeft=null,s.Pts=null,s.BottomPt=null,s.PolyNode=null,this.m_PolyOuts.push(s),s.Idx=this.m_PolyOuts.length-1,s;},e.ClipperBase.prototype.DisposeOutRec=function(s){var y=this.m_PolyOuts[s];y.Pts=null,y=null,this.m_PolyOuts[s]=null;},e.ClipperBase.prototype.UpdateEdgeIntoAEL=function(s){s.NextInLML===null&&e.Error("UpdateEdgeIntoAEL: invalid call");var y=s.PrevInAEL,I=s.NextInAEL;return s.NextInLML.OutIdx=s.OutIdx,y!==null?y.NextInAEL=s.NextInLML:this.m_ActiveEdges=s.NextInLML,I!==null&&(I.PrevInAEL=s.NextInLML),s.NextInLML.Side=s.Side,s.NextInLML.WindDelta=s.WindDelta,s.NextInLML.WindCnt=s.WindCnt,s.NextInLML.WindCnt2=s.WindCnt2,s=s.NextInLML,s.Curr.X=s.Bot.X,s.Curr.Y=s.Bot.Y,s.PrevInAEL=y,s.NextInAEL=I,e.ClipperBase.IsHorizontal(s)||this.InsertScanbeam(s.Top.Y),s;},e.ClipperBase.prototype.SwapPositionsInAEL=function(s,y){if(!(s.NextInAEL===s.PrevInAEL||y.NextInAEL===y.PrevInAEL)){if(s.NextInAEL===y){var I=y.NextInAEL;I!==null&&(I.PrevInAEL=s);var N=s.PrevInAEL;N!==null&&(N.NextInAEL=y),y.PrevInAEL=N,y.NextInAEL=s,s.PrevInAEL=y,s.NextInAEL=I;}else if(y.NextInAEL===s){var z=s.NextInAEL;z!==null&&(z.PrevInAEL=y);var Z=y.PrevInAEL;Z!==null&&(Z.NextInAEL=s),s.PrevInAEL=Z,s.NextInAEL=y,y.PrevInAEL=s,y.NextInAEL=z;}else{var tt=s.NextInAEL,ft=s.PrevInAEL;s.NextInAEL=y.NextInAEL,s.NextInAEL!==null&&(s.NextInAEL.PrevInAEL=s),s.PrevInAEL=y.PrevInAEL,s.PrevInAEL!==null&&(s.PrevInAEL.NextInAEL=s),y.NextInAEL=tt,y.NextInAEL!==null&&(y.NextInAEL.PrevInAEL=y),y.PrevInAEL=ft,y.PrevInAEL!==null&&(y.PrevInAEL.NextInAEL=y);}s.PrevInAEL===null?this.m_ActiveEdges=s:y.PrevInAEL===null&&(this.m_ActiveEdges=y);}},e.ClipperBase.prototype.DeleteFromAEL=function(s){var y=s.PrevInAEL,I=s.NextInAEL;y===null&&I===null&&s!==this.m_ActiveEdges||(y!==null?y.NextInAEL=I:this.m_ActiveEdges=I,I!==null&&(I.PrevInAEL=y),s.NextInAEL=null,s.PrevInAEL=null);},e.Clipper=function(s){_typeof(s)>"u"&&(s=0),this.m_PolyOuts=null,this.m_ClipType=e.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_Maxima=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=e.PolyFillType.pftEvenOdd,this.m_SubjFillType=e.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,e.ClipperBase.call(this),this.m_Scanbeam=null,this.m_Maxima=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array(),this.m_IntersectNodeComparer=e.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array(),this.m_Joins=new Array(),this.m_GhostJoins=new Array(),this.ReverseSolution=(1&s)!==0,this.StrictlySimple=(2&s)!==0,this.PreserveCollinear=(4&s)!==0,e.use_xyz&&(this.ZFillFunction=null);},e.Clipper.ioReverseSolution=1,e.Clipper.ioStrictlySimple=2,e.Clipper.ioPreserveCollinear=4,e.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),e.ClipperBase.prototype.Clear.call(this));},e.Clipper.prototype.InsertMaxima=function(s){var y=new e.Maxima();if(y.X=s,this.m_Maxima===null)this.m_Maxima=y,this.m_Maxima.Next=null,this.m_Maxima.Prev=null;else if(s<this.m_Maxima.X)y.Next=this.m_Maxima,y.Prev=null,this.m_Maxima=y;else{for(var I=this.m_Maxima;I.Next!==null&&s>=I.Next.X;)I=I.Next;if(s===I.X)return;y.Next=I.Next,y.Prev=I,I.Next!==null&&(I.Next.Prev=y),I.Next=y;}},e.Clipper.prototype.Execute=function(){var s=arguments,y=s.length,I=s[1]instanceof e.PolyTree;if(y===4&&!I){var N=s[0],z=s[1],Z=s[2],tt=s[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&e.Error("Error: PolyTree struct is needed for open path clipping."),this.m_ExecuteLocked=!0,e.Clear(z),this.m_SubjFillType=Z,this.m_ClipFillType=tt,this.m_ClipType=N,this.m_UsingPolyTree=!1;try{var ft=this.ExecuteInternal();ft&&this.BuildResult(z);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return ft;}else if(y===4&&I){var N=s[0],ht=s[1],Z=s[2],tt=s[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=Z,this.m_ClipFillType=tt,this.m_ClipType=N,this.m_UsingPolyTree=!0;try{var ft=this.ExecuteInternal();ft&&this.BuildResult2(ht);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return ft;}else if(y===2&&!I){var N=s[0],z=s[1];return this.Execute(N,z,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}else if(y===2&&I){var N=s[0],ht=s[1];return this.Execute(N,ht,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}},e.Clipper.prototype.FixHoleLinkage=function(s){if(!(s.FirstLeft===null||s.IsHole!==s.FirstLeft.IsHole&&s.FirstLeft.Pts!==null)){for(var y=s.FirstLeft;y!==null&&(y.IsHole===s.IsHole||y.Pts===null);)y=y.FirstLeft;s.FirstLeft=y;}},e.Clipper.prototype.ExecuteInternal=function(){try{this.Reset(),this.m_SortedEdges=null,this.m_Maxima=null;var s={},y={};if(!this.PopScanbeam(s))return!1;for(this.InsertLocalMinimaIntoAEL(s.v);this.PopScanbeam(y)||this.LocalMinimaPending();){if(this.ProcessHorizontals(),this.m_GhostJoins.length=0,!this.ProcessIntersections(y.v))return!1;this.ProcessEdgesAtTopOfScanbeam(y.v),s.v=y.v,this.InsertLocalMinimaIntoAEL(s.v);}var I,N,z;for(N=0,z=this.m_PolyOuts.length;N<z;N++)I=this.m_PolyOuts[N],!(I.Pts===null||I.IsOpen)&&(I.IsHole^this.ReverseSolution)==this.Area$1(I)>0&&this.ReversePolyPtLinks(I.Pts);for(this.JoinCommonEdges(),N=0,z=this.m_PolyOuts.length;N<z;N++)I=this.m_PolyOuts[N],I.Pts!==null&&(I.IsOpen?this.FixupOutPolyline(I):this.FixupOutPolygon(I));return this.StrictlySimple&&this.DoSimplePolygons(),!0;}finally{this.m_Joins.length=0,this.m_GhostJoins.length=0;}},e.Clipper.prototype.DisposeAllPolyPts=function(){for(var s=0,y=this.m_PolyOuts.length;s<y;++s)this.DisposeOutRec(s);e.Clear(this.m_PolyOuts);},e.Clipper.prototype.AddJoin=function(s,y,I){var N=new e.Join();N.OutPt1=s,N.OutPt2=y,N.OffPt.X=I.X,N.OffPt.Y=I.Y,e.use_xyz&&(N.OffPt.Z=I.Z),this.m_Joins.push(N);},e.Clipper.prototype.AddGhostJoin=function(s,y){var I=new e.Join();I.OutPt1=s,I.OffPt.X=y.X,I.OffPt.Y=y.Y,e.use_xyz&&(I.OffPt.Z=y.Z),this.m_GhostJoins.push(I);},e.Clipper.prototype.SetZ=function(s,y,I){if(this.ZFillFunction!==null){if(s.Z!==0||this.ZFillFunction===null)return;e.IntPoint.op_Equality(s,y.Bot)?s.Z=y.Bot.Z:e.IntPoint.op_Equality(s,y.Top)?s.Z=y.Top.Z:e.IntPoint.op_Equality(s,I.Bot)?s.Z=I.Bot.Z:e.IntPoint.op_Equality(s,I.Top)?s.Z=I.Top.Z:this.ZFillFunction(y.Bot,y.Top,I.Bot,I.Top,s);}},e.Clipper.prototype.InsertLocalMinimaIntoAEL=function(s){for(var y={},I,N;this.PopLocalMinima(s,y);){I=y.v.LeftBound,N=y.v.RightBound;var z=null;if(I===null?(this.InsertEdgeIntoAEL(N,null),this.SetWindingCount(N),this.IsContributing(N)&&(z=this.AddOutPt(N,N.Bot))):N===null?(this.InsertEdgeIntoAEL(I,null),this.SetWindingCount(I),this.IsContributing(I)&&(z=this.AddOutPt(I,I.Bot)),this.InsertScanbeam(I.Top.Y)):(this.InsertEdgeIntoAEL(I,null),this.InsertEdgeIntoAEL(N,I),this.SetWindingCount(I),N.WindCnt=I.WindCnt,N.WindCnt2=I.WindCnt2,this.IsContributing(I)&&(z=this.AddLocalMinPoly(I,N,I.Bot)),this.InsertScanbeam(I.Top.Y)),N!==null&&(e.ClipperBase.IsHorizontal(N)?(N.NextInLML!==null&&this.InsertScanbeam(N.NextInLML.Top.Y),this.AddEdgeToSEL(N)):this.InsertScanbeam(N.Top.Y)),!(I===null||N===null)){if(z!==null&&e.ClipperBase.IsHorizontal(N)&&this.m_GhostJoins.length>0&&N.WindDelta!==0)for(var Z=0,tt=this.m_GhostJoins.length;Z<tt;Z++){var ft=this.m_GhostJoins[Z];this.HorzSegmentsOverlap(ft.OutPt1.Pt.X,ft.OffPt.X,N.Bot.X,N.Top.X)&&this.AddJoin(ft.OutPt1,z,ft.OffPt);}if(I.OutIdx>=0&&I.PrevInAEL!==null&&I.PrevInAEL.Curr.X===I.Bot.X&&I.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(I.PrevInAEL.Curr,I.PrevInAEL.Top,I.Curr,I.Top,this.m_UseFullRange)&&I.WindDelta!==0&&I.PrevInAEL.WindDelta!==0){var ht=this.AddOutPt(I.PrevInAEL,I.Bot);this.AddJoin(z,ht,I.Top);}if(I.NextInAEL!==N){if(N.OutIdx>=0&&N.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(N.PrevInAEL.Curr,N.PrevInAEL.Top,N.Curr,N.Top,this.m_UseFullRange)&&N.WindDelta!==0&&N.PrevInAEL.WindDelta!==0){var ht=this.AddOutPt(N.PrevInAEL,N.Bot);this.AddJoin(z,ht,N.Top);}var It=I.NextInAEL;if(It!==null)for(;It!==N;)this.IntersectEdges(N,It,I.Curr),It=It.NextInAEL;}}}},e.Clipper.prototype.InsertEdgeIntoAEL=function(s,y){if(this.m_ActiveEdges===null)s.PrevInAEL=null,s.NextInAEL=null,this.m_ActiveEdges=s;else if(y===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,s))s.PrevInAEL=null,s.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=s,this.m_ActiveEdges=s;else{for(y===null&&(y=this.m_ActiveEdges);y.NextInAEL!==null&&!this.E2InsertsBeforeE1(y.NextInAEL,s);)y=y.NextInAEL;s.NextInAEL=y.NextInAEL,y.NextInAEL!==null&&(y.NextInAEL.PrevInAEL=s),s.PrevInAEL=y,y.NextInAEL=s;}},e.Clipper.prototype.E2InsertsBeforeE1=function(s,y){return y.Curr.X===s.Curr.X?y.Top.Y>s.Top.Y?y.Top.X<e.Clipper.TopX(s,y.Top.Y):s.Top.X>e.Clipper.TopX(y,s.Top.Y):y.Curr.X<s.Curr.X;},e.Clipper.prototype.IsEvenOddFillType=function(s){return s.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType===e.PolyFillType.pftEvenOdd:this.m_ClipFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsEvenOddAltFillType=function(s){return s.PolyTyp===e.PolyType.ptSubject?this.m_ClipFillType===e.PolyFillType.pftEvenOdd:this.m_SubjFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsContributing=function(s){var y,I;switch(s.PolyTyp===e.PolyType.ptSubject?(y=this.m_SubjFillType,I=this.m_ClipFillType):(y=this.m_ClipFillType,I=this.m_SubjFillType),y){case e.PolyFillType.pftEvenOdd:if(s.WindDelta===0&&s.WindCnt!==1)return!1;break;case e.PolyFillType.pftNonZero:if(Math.abs(s.WindCnt)!==1)return!1;break;case e.PolyFillType.pftPositive:if(s.WindCnt!==1)return!1;break;default:if(s.WindCnt!==-1)return!1;break;}switch(this.m_ClipType){case e.ClipType.ctIntersection:switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2!==0;case e.PolyFillType.pftPositive:return s.WindCnt2>0;default:return s.WindCnt2<0;}case e.ClipType.ctUnion:switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2===0;case e.PolyFillType.pftPositive:return s.WindCnt2<=0;default:return s.WindCnt2>=0;}case e.ClipType.ctDifference:if(s.PolyTyp===e.PolyType.ptSubject)switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2===0;case e.PolyFillType.pftPositive:return s.WindCnt2<=0;default:return s.WindCnt2>=0;}else switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2!==0;case e.PolyFillType.pftPositive:return s.WindCnt2>0;default:return s.WindCnt2<0;}case e.ClipType.ctXor:if(s.WindDelta===0)switch(I){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return s.WindCnt2===0;case e.PolyFillType.pftPositive:return s.WindCnt2<=0;default:return s.WindCnt2>=0;}else return!0;}return!0;},e.Clipper.prototype.SetWindingCount=function(s){for(var y=s.PrevInAEL;y!==null&&(y.PolyTyp!==s.PolyTyp||y.WindDelta===0);)y=y.PrevInAEL;if(y===null){var I=s.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType:this.m_ClipFillType;s.WindDelta===0?s.WindCnt=I===e.PolyFillType.pftNegative?-1:1:s.WindCnt=s.WindDelta,s.WindCnt2=0,y=this.m_ActiveEdges;}else if(s.WindDelta===0&&this.m_ClipType!==e.ClipType.ctUnion)s.WindCnt=1,s.WindCnt2=y.WindCnt2,y=y.NextInAEL;else if(this.IsEvenOddFillType(s)){if(s.WindDelta===0){for(var N=!0,z=y.PrevInAEL;z!==null;)z.PolyTyp===y.PolyTyp&&z.WindDelta!==0&&(N=!N),z=z.PrevInAEL;s.WindCnt=N?0:1;}else s.WindCnt=s.WindDelta;s.WindCnt2=y.WindCnt2,y=y.NextInAEL;}else y.WindCnt*y.WindDelta<0?Math.abs(y.WindCnt)>1?y.WindDelta*s.WindDelta<0?s.WindCnt=y.WindCnt:s.WindCnt=y.WindCnt+s.WindDelta:s.WindCnt=s.WindDelta===0?1:s.WindDelta:s.WindDelta===0?s.WindCnt=y.WindCnt<0?y.WindCnt-1:y.WindCnt+1:y.WindDelta*s.WindDelta<0?s.WindCnt=y.WindCnt:s.WindCnt=y.WindCnt+s.WindDelta,s.WindCnt2=y.WindCnt2,y=y.NextInAEL;if(this.IsEvenOddAltFillType(s))for(;y!==s;)y.WindDelta!==0&&(s.WindCnt2=s.WindCnt2===0?1:0),y=y.NextInAEL;else for(;y!==s;)s.WindCnt2+=y.WindDelta,y=y.NextInAEL;},e.Clipper.prototype.AddEdgeToSEL=function(s){this.m_SortedEdges===null?(this.m_SortedEdges=s,s.PrevInSEL=null,s.NextInSEL=null):(s.NextInSEL=this.m_SortedEdges,s.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=s,this.m_SortedEdges=s);},e.Clipper.prototype.PopEdgeFromSEL=function(s){if(s.v=this.m_SortedEdges,s.v===null)return!1;var y=s.v;return this.m_SortedEdges=s.v.NextInSEL,this.m_SortedEdges!==null&&(this.m_SortedEdges.PrevInSEL=null),y.NextInSEL=null,y.PrevInSEL=null,!0;},e.Clipper.prototype.CopyAELToSEL=function(){var s=this.m_ActiveEdges;for(this.m_SortedEdges=s;s!==null;)s.PrevInSEL=s.PrevInAEL,s.NextInSEL=s.NextInAEL,s=s.NextInAEL;},e.Clipper.prototype.SwapPositionsInSEL=function(s,y){if(!(s.NextInSEL===null&&s.PrevInSEL===null)&&!(y.NextInSEL===null&&y.PrevInSEL===null)){if(s.NextInSEL===y){var I=y.NextInSEL;I!==null&&(I.PrevInSEL=s);var N=s.PrevInSEL;N!==null&&(N.NextInSEL=y),y.PrevInSEL=N,y.NextInSEL=s,s.PrevInSEL=y,s.NextInSEL=I;}else if(y.NextInSEL===s){var I=s.NextInSEL;I!==null&&(I.PrevInSEL=y);var N=y.PrevInSEL;N!==null&&(N.NextInSEL=s),s.PrevInSEL=N,s.NextInSEL=y,y.PrevInSEL=s,y.NextInSEL=I;}else{var I=s.NextInSEL,N=s.PrevInSEL;s.NextInSEL=y.NextInSEL,s.NextInSEL!==null&&(s.NextInSEL.PrevInSEL=s),s.PrevInSEL=y.PrevInSEL,s.PrevInSEL!==null&&(s.PrevInSEL.NextInSEL=s),y.NextInSEL=I,y.NextInSEL!==null&&(y.NextInSEL.PrevInSEL=y),y.PrevInSEL=N,y.PrevInSEL!==null&&(y.PrevInSEL.NextInSEL=y);}s.PrevInSEL===null?this.m_SortedEdges=s:y.PrevInSEL===null&&(this.m_SortedEdges=y);}},e.Clipper.prototype.AddLocalMaxPoly=function(s,y,I){this.AddOutPt(s,I),y.WindDelta===0&&this.AddOutPt(y,I),s.OutIdx===y.OutIdx?(s.OutIdx=-1,y.OutIdx=-1):s.OutIdx<y.OutIdx?this.AppendPolygon(s,y):this.AppendPolygon(y,s);},e.Clipper.prototype.AddLocalMinPoly=function(s,y,I){var N,z,Z;if(e.ClipperBase.IsHorizontal(y)||s.Dx>y.Dx?(N=this.AddOutPt(s,I),y.OutIdx=s.OutIdx,s.Side=e.EdgeSide.esLeft,y.Side=e.EdgeSide.esRight,z=s,z.PrevInAEL===y?Z=y.PrevInAEL:Z=z.PrevInAEL):(N=this.AddOutPt(y,I),s.OutIdx=y.OutIdx,s.Side=e.EdgeSide.esRight,y.Side=e.EdgeSide.esLeft,z=y,z.PrevInAEL===s?Z=s.PrevInAEL:Z=z.PrevInAEL),Z!==null&&Z.OutIdx>=0&&Z.Top.Y<I.Y&&z.Top.Y<I.Y){var tt=e.Clipper.TopX(Z,I.Y),ft=e.Clipper.TopX(z,I.Y);if(tt===ft&&z.WindDelta!==0&&Z.WindDelta!==0&&e.ClipperBase.SlopesEqual5(new e.IntPoint2(tt,I.Y),Z.Top,new e.IntPoint2(ft,I.Y),z.Top,this.m_UseFullRange)){var ht=this.AddOutPt(Z,I);this.AddJoin(N,ht,z.Top);}}return N;},e.Clipper.prototype.AddOutPt=function(s,y){if(s.OutIdx<0){var I=this.CreateOutRec();I.IsOpen=s.WindDelta===0;var N=new e.OutPt();return I.Pts=N,N.Idx=I.Idx,N.Pt.X=y.X,N.Pt.Y=y.Y,e.use_xyz&&(N.Pt.Z=y.Z),N.Next=N,N.Prev=N,I.IsOpen||this.SetHoleState(s,I),s.OutIdx=I.Idx,N;}else{var I=this.m_PolyOuts[s.OutIdx],z=I.Pts,Z=s.Side===e.EdgeSide.esLeft;if(Z&&e.IntPoint.op_Equality(y,z.Pt))return z;if(!Z&&e.IntPoint.op_Equality(y,z.Prev.Pt))return z.Prev;var N=new e.OutPt();return N.Idx=I.Idx,N.Pt.X=y.X,N.Pt.Y=y.Y,e.use_xyz&&(N.Pt.Z=y.Z),N.Next=z,N.Prev=z.Prev,N.Prev.Next=N,z.Prev=N,Z&&(I.Pts=N),N;}},e.Clipper.prototype.GetLastOutPt=function(s){var y=this.m_PolyOuts[s.OutIdx];return s.Side===e.EdgeSide.esLeft?y.Pts:y.Pts.Prev;},e.Clipper.prototype.SwapPoints=function(s,y){var I=new e.IntPoint1(s.Value);s.Value.X=y.Value.X,s.Value.Y=y.Value.Y,e.use_xyz&&(s.Value.Z=y.Value.Z),y.Value.X=I.X,y.Value.Y=I.Y,e.use_xyz&&(y.Value.Z=I.Z);},e.Clipper.prototype.HorzSegmentsOverlap=function(s,y,I,N){var z;return s>y&&(z=s,s=y,y=z),I>N&&(z=I,I=N,N=z),s<N&&I<y;},e.Clipper.prototype.SetHoleState=function(s,y){for(var I=s.PrevInAEL,N=null;I!==null;)I.OutIdx>=0&&I.WindDelta!==0&&(N===null?N=I:N.OutIdx===I.OutIdx&&(N=null)),I=I.PrevInAEL;N===null?(y.FirstLeft=null,y.IsHole=!1):(y.FirstLeft=this.m_PolyOuts[N.OutIdx],y.IsHole=!y.FirstLeft.IsHole);},e.Clipper.prototype.GetDx=function(s,y){return s.Y===y.Y?e.ClipperBase.horizontal:(y.X-s.X)/(y.Y-s.Y);},e.Clipper.prototype.FirstIsBottomPt=function(s,y){for(var I=s.Prev;e.IntPoint.op_Equality(I.Pt,s.Pt)&&I!==s;)I=I.Prev;var N=Math.abs(this.GetDx(s.Pt,I.Pt));for(I=s.Next;e.IntPoint.op_Equality(I.Pt,s.Pt)&&I!==s;)I=I.Next;var z=Math.abs(this.GetDx(s.Pt,I.Pt));for(I=y.Prev;e.IntPoint.op_Equality(I.Pt,y.Pt)&&I!==y;)I=I.Prev;var Z=Math.abs(this.GetDx(y.Pt,I.Pt));for(I=y.Next;e.IntPoint.op_Equality(I.Pt,y.Pt)&&I!==y;)I=I.Next;var tt=Math.abs(this.GetDx(y.Pt,I.Pt));return Math.max(N,z)===Math.max(Z,tt)&&Math.min(N,z)===Math.min(Z,tt)?this.Area(s)>0:N>=Z&&N>=tt||z>=Z&&z>=tt;},e.Clipper.prototype.GetBottomPt=function(s){for(var y=null,I=s.Next;I!==s;)I.Pt.Y>s.Pt.Y?(s=I,y=null):I.Pt.Y===s.Pt.Y&&I.Pt.X<=s.Pt.X&&(I.Pt.X<s.Pt.X?(y=null,s=I):I.Next!==s&&I.Prev!==s&&(y=I)),I=I.Next;if(y!==null)for(;y!==I;)for(this.FirstIsBottomPt(I,y)||(s=y),y=y.Next;e.IntPoint.op_Inequality(y.Pt,s.Pt);)y=y.Next;return s;},e.Clipper.prototype.GetLowermostRec=function(s,y){s.BottomPt===null&&(s.BottomPt=this.GetBottomPt(s.Pts)),y.BottomPt===null&&(y.BottomPt=this.GetBottomPt(y.Pts));var I=s.BottomPt,N=y.BottomPt;return I.Pt.Y>N.Pt.Y?s:I.Pt.Y<N.Pt.Y?y:I.Pt.X<N.Pt.X?s:I.Pt.X>N.Pt.X||I.Next===I?y:N.Next===N||this.FirstIsBottomPt(I,N)?s:y;},e.Clipper.prototype.OutRec1RightOfOutRec2=function(s,y){do if(s=s.FirstLeft,s===y)return!0;while(s!==null);return!1;},e.Clipper.prototype.GetOutRec=function(s){for(var y=this.m_PolyOuts[s];y!==this.m_PolyOuts[y.Idx];)y=this.m_PolyOuts[y.Idx];return y;},e.Clipper.prototype.AppendPolygon=function(s,y){var I=this.m_PolyOuts[s.OutIdx],N=this.m_PolyOuts[y.OutIdx],z;this.OutRec1RightOfOutRec2(I,N)?z=N:this.OutRec1RightOfOutRec2(N,I)?z=I:z=this.GetLowermostRec(I,N);var Z=I.Pts,tt=Z.Prev,ft=N.Pts,ht=ft.Prev;s.Side===e.EdgeSide.esLeft?y.Side===e.EdgeSide.esLeft?(this.ReversePolyPtLinks(ft),ft.Next=Z,Z.Prev=ft,tt.Next=ht,ht.Prev=tt,I.Pts=ht):(ht.Next=Z,Z.Prev=ht,ft.Prev=tt,tt.Next=ft,I.Pts=ft):y.Side===e.EdgeSide.esRight?(this.ReversePolyPtLinks(ft),tt.Next=ht,ht.Prev=tt,ft.Next=Z,Z.Prev=ft):(tt.Next=ft,ft.Prev=tt,Z.Prev=ht,ht.Next=Z),I.BottomPt=null,z===N&&(N.FirstLeft!==I&&(I.FirstLeft=N.FirstLeft),I.IsHole=N.IsHole),N.Pts=null,N.BottomPt=null,N.FirstLeft=I;var It=s.OutIdx,Rt=y.OutIdx;s.OutIdx=-1,y.OutIdx=-1;for(var Lt=this.m_ActiveEdges;Lt!==null;){if(Lt.OutIdx===Rt){Lt.OutIdx=It,Lt.Side=s.Side;break;}Lt=Lt.NextInAEL;}N.Idx=I.Idx;},e.Clipper.prototype.ReversePolyPtLinks=function(s){if(s!==null){var y,I;y=s;do I=y.Next,y.Next=y.Prev,y.Prev=I,y=I;while(y!==s);}},e.Clipper.SwapSides=function(s,y){var I=s.Side;s.Side=y.Side,y.Side=I;},e.Clipper.SwapPolyIndexes=function(s,y){var I=s.OutIdx;s.OutIdx=y.OutIdx,y.OutIdx=I;},e.Clipper.prototype.IntersectEdges=function(s,y,I){var N=s.OutIdx>=0,z=y.OutIdx>=0;if(e.use_xyz&&this.SetZ(I,s,y),e.use_lines&&(s.WindDelta===0||y.WindDelta===0)){if(s.WindDelta===0&&y.WindDelta===0)return;s.PolyTyp===y.PolyTyp&&s.WindDelta!==y.WindDelta&&this.m_ClipType===e.ClipType.ctUnion?s.WindDelta===0?z&&(this.AddOutPt(s,I),N&&(s.OutIdx=-1)):N&&(this.AddOutPt(y,I),z&&(y.OutIdx=-1)):s.PolyTyp!==y.PolyTyp&&(s.WindDelta===0&&Math.abs(y.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||y.WindCnt2===0)?(this.AddOutPt(s,I),N&&(s.OutIdx=-1)):y.WindDelta===0&&Math.abs(s.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||s.WindCnt2===0)&&(this.AddOutPt(y,I),z&&(y.OutIdx=-1)));return;}if(s.PolyTyp===y.PolyTyp){if(this.IsEvenOddFillType(s)){var Z=s.WindCnt;s.WindCnt=y.WindCnt,y.WindCnt=Z;}else s.WindCnt+y.WindDelta===0?s.WindCnt=-s.WindCnt:s.WindCnt+=y.WindDelta,y.WindCnt-s.WindDelta===0?y.WindCnt=-y.WindCnt:y.WindCnt-=s.WindDelta;}else this.IsEvenOddFillType(y)?s.WindCnt2=s.WindCnt2===0?1:0:s.WindCnt2+=y.WindDelta,this.IsEvenOddFillType(s)?y.WindCnt2=y.WindCnt2===0?1:0:y.WindCnt2-=s.WindDelta;var tt,ft,ht,It;s.PolyTyp===e.PolyType.ptSubject?(tt=this.m_SubjFillType,ht=this.m_ClipFillType):(tt=this.m_ClipFillType,ht=this.m_SubjFillType),y.PolyTyp===e.PolyType.ptSubject?(ft=this.m_SubjFillType,It=this.m_ClipFillType):(ft=this.m_ClipFillType,It=this.m_SubjFillType);var Rt,Lt;switch(tt){case e.PolyFillType.pftPositive:Rt=s.WindCnt;break;case e.PolyFillType.pftNegative:Rt=-s.WindCnt;break;default:Rt=Math.abs(s.WindCnt);break;}switch(ft){case e.PolyFillType.pftPositive:Lt=y.WindCnt;break;case e.PolyFillType.pftNegative:Lt=-y.WindCnt;break;default:Lt=Math.abs(y.WindCnt);break;}if(N&&z)Rt!==0&&Rt!==1||Lt!==0&&Lt!==1||s.PolyTyp!==y.PolyTyp&&this.m_ClipType!==e.ClipType.ctXor?this.AddLocalMaxPoly(s,y,I):(this.AddOutPt(s,I),this.AddOutPt(y,I),e.Clipper.SwapSides(s,y),e.Clipper.SwapPolyIndexes(s,y));else if(N)(Lt===0||Lt===1)&&(this.AddOutPt(s,I),e.Clipper.SwapSides(s,y),e.Clipper.SwapPolyIndexes(s,y));else if(z)(Rt===0||Rt===1)&&(this.AddOutPt(y,I),e.Clipper.SwapSides(s,y),e.Clipper.SwapPolyIndexes(s,y));else if((Rt===0||Rt===1)&&(Lt===0||Lt===1)){var Wt,Yt;switch(ht){case e.PolyFillType.pftPositive:Wt=s.WindCnt2;break;case e.PolyFillType.pftNegative:Wt=-s.WindCnt2;break;default:Wt=Math.abs(s.WindCnt2);break;}switch(It){case e.PolyFillType.pftPositive:Yt=y.WindCnt2;break;case e.PolyFillType.pftNegative:Yt=-y.WindCnt2;break;default:Yt=Math.abs(y.WindCnt2);break;}if(s.PolyTyp!==y.PolyTyp)this.AddLocalMinPoly(s,y,I);else if(Rt===1&&Lt===1)switch(this.m_ClipType){case e.ClipType.ctIntersection:Wt>0&&Yt>0&&this.AddLocalMinPoly(s,y,I);break;case e.ClipType.ctUnion:Wt<=0&&Yt<=0&&this.AddLocalMinPoly(s,y,I);break;case e.ClipType.ctDifference:(s.PolyTyp===e.PolyType.ptClip&&Wt>0&&Yt>0||s.PolyTyp===e.PolyType.ptSubject&&Wt<=0&&Yt<=0)&&this.AddLocalMinPoly(s,y,I);break;case e.ClipType.ctXor:this.AddLocalMinPoly(s,y,I);break;}else e.Clipper.SwapSides(s,y);}},e.Clipper.prototype.DeleteFromSEL=function(s){var y=s.PrevInSEL,I=s.NextInSEL;y===null&&I===null&&s!==this.m_SortedEdges||(y!==null?y.NextInSEL=I:this.m_SortedEdges=I,I!==null&&(I.PrevInSEL=y),s.NextInSEL=null,s.PrevInSEL=null);},e.Clipper.prototype.ProcessHorizontals=function(){for(var s={};this.PopEdgeFromSEL(s);)this.ProcessHorizontal(s.v);},e.Clipper.prototype.GetHorzDirection=function(s,y){s.Bot.X<s.Top.X?(y.Left=s.Bot.X,y.Right=s.Top.X,y.Dir=e.Direction.dLeftToRight):(y.Left=s.Top.X,y.Right=s.Bot.X,y.Dir=e.Direction.dRightToLeft);},e.Clipper.prototype.ProcessHorizontal=function(s){var y={Dir:null,Left:null,Right:null};this.GetHorzDirection(s,y);for(var I=y.Dir,N=y.Left,z=y.Right,Z=s.WindDelta===0,tt=s,ft=null;tt.NextInLML!==null&&e.ClipperBase.IsHorizontal(tt.NextInLML);)tt=tt.NextInLML;tt.NextInLML===null&&(ft=this.GetMaximaPair(tt));var ht=this.m_Maxima;if(ht!==null)if(I===e.Direction.dLeftToRight){for(;ht!==null&&ht.X<=s.Bot.X;)ht=ht.Next;ht!==null&&ht.X>=tt.Top.X&&(ht=null);}else{for(;ht.Next!==null&&ht.Next.X<s.Bot.X;)ht=ht.Next;ht.X<=tt.Top.X&&(ht=null);}for(var It=null;;){for(var Rt=s===tt,Lt=this.GetNextInAEL(s,I);Lt!==null;){if(ht!==null)if(I===e.Direction.dLeftToRight)for(;ht!==null&&ht.X<Lt.Curr.X;)s.OutIdx>=0&&!Z&&this.AddOutPt(s,new e.IntPoint2(ht.X,s.Bot.Y)),ht=ht.Next;else for(;ht!==null&&ht.X>Lt.Curr.X;)s.OutIdx>=0&&!Z&&this.AddOutPt(s,new e.IntPoint2(ht.X,s.Bot.Y)),ht=ht.Prev;if(I===e.Direction.dLeftToRight&&Lt.Curr.X>z||I===e.Direction.dRightToLeft&&Lt.Curr.X<N||Lt.Curr.X===s.Top.X&&s.NextInLML!==null&&Lt.Dx<s.NextInLML.Dx)break;if(s.OutIdx>=0&&!Z){e.use_xyz&&(I===e.Direction.dLeftToRight?this.SetZ(Lt.Curr,s,Lt):this.SetZ(Lt.Curr,Lt,s)),It=this.AddOutPt(s,Lt.Curr);for(var Wt=this.m_SortedEdges;Wt!==null;){if(Wt.OutIdx>=0&&this.HorzSegmentsOverlap(s.Bot.X,s.Top.X,Wt.Bot.X,Wt.Top.X)){var Yt=this.GetLastOutPt(Wt);this.AddJoin(Yt,It,Wt.Top);}Wt=Wt.NextInSEL;}this.AddGhostJoin(It,s.Bot);}if(Lt===ft&&Rt){s.OutIdx>=0&&this.AddLocalMaxPoly(s,ft,s.Top),this.DeleteFromAEL(s),this.DeleteFromAEL(ft);return;}if(I===e.Direction.dLeftToRight){var Vt=new e.IntPoint2(Lt.Curr.X,s.Curr.Y);this.IntersectEdges(s,Lt,Vt);}else{var Vt=new e.IntPoint2(Lt.Curr.X,s.Curr.Y);this.IntersectEdges(Lt,s,Vt);}var Kt=this.GetNextInAEL(Lt,I);this.SwapPositionsInAEL(s,Lt),Lt=Kt;}if(s.NextInLML===null||!e.ClipperBase.IsHorizontal(s.NextInLML))break;s=this.UpdateEdgeIntoAEL(s),s.OutIdx>=0&&this.AddOutPt(s,s.Bot),y={Dir:I,Left:N,Right:z},this.GetHorzDirection(s,y),I=y.Dir,N=y.Left,z=y.Right;}if(s.OutIdx>=0&&It===null){It=this.GetLastOutPt(s);for(var Wt=this.m_SortedEdges;Wt!==null;){if(Wt.OutIdx>=0&&this.HorzSegmentsOverlap(s.Bot.X,s.Top.X,Wt.Bot.X,Wt.Top.X)){var Yt=this.GetLastOutPt(Wt);this.AddJoin(Yt,It,Wt.Top);}Wt=Wt.NextInSEL;}this.AddGhostJoin(It,s.Top);}if(s.NextInLML!==null){if(s.OutIdx>=0){if(It=this.AddOutPt(s,s.Top),s=this.UpdateEdgeIntoAEL(s),s.WindDelta===0)return;var ee=s.PrevInAEL,Kt=s.NextInAEL;if(ee!==null&&ee.Curr.X===s.Bot.X&&ee.Curr.Y===s.Bot.Y&&ee.WindDelta===0&&ee.OutIdx>=0&&ee.Curr.Y>ee.Top.Y&&e.ClipperBase.SlopesEqual3(s,ee,this.m_UseFullRange)){var Yt=this.AddOutPt(ee,s.Bot);this.AddJoin(It,Yt,s.Top);}else if(Kt!==null&&Kt.Curr.X===s.Bot.X&&Kt.Curr.Y===s.Bot.Y&&Kt.WindDelta!==0&&Kt.OutIdx>=0&&Kt.Curr.Y>Kt.Top.Y&&e.ClipperBase.SlopesEqual3(s,Kt,this.m_UseFullRange)){var Yt=this.AddOutPt(Kt,s.Bot);this.AddJoin(It,Yt,s.Top);}}else s=this.UpdateEdgeIntoAEL(s);}else s.OutIdx>=0&&this.AddOutPt(s,s.Top),this.DeleteFromAEL(s);},e.Clipper.prototype.GetNextInAEL=function(s,y){return y===e.Direction.dLeftToRight?s.NextInAEL:s.PrevInAEL;},e.Clipper.prototype.IsMinima=function(s){return s!==null&&s.Prev.NextInLML!==s&&s.Next.NextInLML!==s;},e.Clipper.prototype.IsMaxima=function(s,y){return s!==null&&s.Top.Y===y&&s.NextInLML===null;},e.Clipper.prototype.IsIntermediate=function(s,y){return s.Top.Y===y&&s.NextInLML!==null;},e.Clipper.prototype.GetMaximaPair=function(s){return e.IntPoint.op_Equality(s.Next.Top,s.Top)&&s.Next.NextInLML===null?s.Next:e.IntPoint.op_Equality(s.Prev.Top,s.Top)&&s.Prev.NextInLML===null?s.Prev:null;},e.Clipper.prototype.GetMaximaPairEx=function(s){var y=this.GetMaximaPair(s);return y===null||y.OutIdx===e.ClipperBase.Skip||y.NextInAEL===y.PrevInAEL&&!e.ClipperBase.IsHorizontal(y)?null:y;},e.Clipper.prototype.ProcessIntersections=function(s){if(this.m_ActiveEdges===null)return!0;try{if(this.BuildIntersectList(s),this.m_IntersectList.length===0)return!0;if(this.m_IntersectList.length===1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1;}catch(_unused23){this.m_SortedEdges=null,this.m_IntersectList.length=0,e.Error("ProcessIntersections error");}return this.m_SortedEdges=null,!0;},e.Clipper.prototype.BuildIntersectList=function(s){if(this.m_ActiveEdges!==null){var y=this.m_ActiveEdges;for(this.m_SortedEdges=y;y!==null;)y.PrevInSEL=y.PrevInAEL,y.NextInSEL=y.NextInAEL,y.Curr.X=e.Clipper.TopX(y,s),y=y.NextInAEL;for(var I=!0;I&&this.m_SortedEdges!==null;){for(I=!1,y=this.m_SortedEdges;y.NextInSEL!==null;){var N=y.NextInSEL,z=new e.IntPoint0();if(y.Curr.X>N.Curr.X){this.IntersectPoint(y,N,z),z.Y<s&&(z=new e.IntPoint2(e.Clipper.TopX(y,s),s));var Z=new e.IntersectNode();Z.Edge1=y,Z.Edge2=N,Z.Pt.X=z.X,Z.Pt.Y=z.Y,e.use_xyz&&(Z.Pt.Z=z.Z),this.m_IntersectList.push(Z),this.SwapPositionsInSEL(y,N),I=!0;}else y=N;}if(y.PrevInSEL!==null)y.PrevInSEL.NextInSEL=null;else break;}this.m_SortedEdges=null;}},e.Clipper.prototype.EdgesAdjacent=function(s){return s.Edge1.NextInSEL===s.Edge2||s.Edge1.PrevInSEL===s.Edge2;},e.Clipper.IntersectNodeSort=function(s,y){return y.Pt.Y-s.Pt.Y;},e.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var s=this.m_IntersectList.length,y=0;y<s;y++){if(!this.EdgesAdjacent(this.m_IntersectList[y])){for(var I=y+1;I<s&&!this.EdgesAdjacent(this.m_IntersectList[I]);)I++;if(I===s)return!1;var N=this.m_IntersectList[y];this.m_IntersectList[y]=this.m_IntersectList[I],this.m_IntersectList[I]=N;}this.SwapPositionsInSEL(this.m_IntersectList[y].Edge1,this.m_IntersectList[y].Edge2);}return!0;},e.Clipper.prototype.ProcessIntersectList=function(){for(var s=0,y=this.m_IntersectList.length;s<y;s++){var I=this.m_IntersectList[s];this.IntersectEdges(I.Edge1,I.Edge2,I.Pt),this.SwapPositionsInAEL(I.Edge1,I.Edge2);}this.m_IntersectList.length=0;};var Js=function Js(s){return s<0?Math.ceil(s-0.5):Math.round(s);},Qs=function Qs(s){return s<0?Math.ceil(s-0.5):Math.floor(s+0.5);},qs=function qs(s){return s<0?-Math.round(Math.abs(s)):Math.round(s);},_s=function _s(s){return s<0?(s-=0.5,s<-2147483648?Math.ceil(s):s|0):(s+=0.5,s>2147483647?Math.floor(s):s|0);};i.msie?e.Clipper.Round=Js:i.chromium?e.Clipper.Round=qs:i.safari?e.Clipper.Round=_s:e.Clipper.Round=Qs,e.Clipper.TopX=function(s,y){return y===s.Top.Y?s.Top.X:s.Bot.X+e.Clipper.Round(s.Dx*(y-s.Bot.Y));},e.Clipper.prototype.IntersectPoint=function(s,y,I){I.X=0,I.Y=0;var N,z;if(s.Dx===y.Dx){I.Y=s.Curr.Y,I.X=e.Clipper.TopX(s,I.Y);return;}if(s.Delta.X===0)I.X=s.Bot.X,e.ClipperBase.IsHorizontal(y)?I.Y=y.Bot.Y:(z=y.Bot.Y-y.Bot.X/y.Dx,I.Y=e.Clipper.Round(I.X/y.Dx+z));else if(y.Delta.X===0)I.X=y.Bot.X,e.ClipperBase.IsHorizontal(s)?I.Y=s.Bot.Y:(N=s.Bot.Y-s.Bot.X/s.Dx,I.Y=e.Clipper.Round(I.X/s.Dx+N));else{N=s.Bot.X-s.Bot.Y*s.Dx,z=y.Bot.X-y.Bot.Y*y.Dx;var Z=(z-N)/(s.Dx-y.Dx);I.Y=e.Clipper.Round(Z),Math.abs(s.Dx)<Math.abs(y.Dx)?I.X=e.Clipper.Round(s.Dx*Z+N):I.X=e.Clipper.Round(y.Dx*Z+z);}if(I.Y<s.Top.Y||I.Y<y.Top.Y){if(s.Top.Y>y.Top.Y)return I.Y=s.Top.Y,I.X=e.Clipper.TopX(y,s.Top.Y),I.X<s.Top.X;I.Y=y.Top.Y,Math.abs(s.Dx)<Math.abs(y.Dx)?I.X=e.Clipper.TopX(s,I.Y):I.X=e.Clipper.TopX(y,I.Y);}I.Y>s.Curr.Y&&(I.Y=s.Curr.Y,Math.abs(s.Dx)>Math.abs(y.Dx)?I.X=e.Clipper.TopX(y,I.Y):I.X=e.Clipper.TopX(s,I.Y));},e.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(s){for(var y=this.m_ActiveEdges;y!==null;){var I=this.IsMaxima(y,s);if(I){var N=this.GetMaximaPairEx(y);I=N===null||!e.ClipperBase.IsHorizontal(N);}if(I){this.StrictlySimple&&this.InsertMaxima(y.Top.X);var z=y.PrevInAEL;this.DoMaxima(y),z===null?y=this.m_ActiveEdges:y=z.NextInAEL;}else{if(this.IsIntermediate(y,s)&&e.ClipperBase.IsHorizontal(y.NextInLML)?(y=this.UpdateEdgeIntoAEL(y),y.OutIdx>=0&&this.AddOutPt(y,y.Bot),this.AddEdgeToSEL(y)):(y.Curr.X=e.Clipper.TopX(y,s),y.Curr.Y=s),e.use_xyz&&(y.Top.Y===s?y.Curr.Z=y.Top.Z:y.Bot.Y===s?y.Curr.Z=y.Bot.Z:y.Curr.Z=0),this.StrictlySimple){var z=y.PrevInAEL;if(y.OutIdx>=0&&y.WindDelta!==0&&z!==null&&z.OutIdx>=0&&z.Curr.X===y.Curr.X&&z.WindDelta!==0){var Z=new e.IntPoint1(y.Curr);e.use_xyz&&this.SetZ(Z,z,y);var tt=this.AddOutPt(z,Z),ft=this.AddOutPt(y,Z);this.AddJoin(tt,ft,Z);}}y=y.NextInAEL;}}for(this.ProcessHorizontals(),this.m_Maxima=null,y=this.m_ActiveEdges;y!==null;){if(this.IsIntermediate(y,s)){var tt=null;y.OutIdx>=0&&(tt=this.AddOutPt(y,y.Top)),y=this.UpdateEdgeIntoAEL(y);var z=y.PrevInAEL,ht=y.NextInAEL;if(z!==null&&z.Curr.X===y.Bot.X&&z.Curr.Y===y.Bot.Y&&tt!==null&&z.OutIdx>=0&&z.Curr.Y===z.Top.Y&&e.ClipperBase.SlopesEqual5(y.Curr,y.Top,z.Curr,z.Top,this.m_UseFullRange)&&y.WindDelta!==0&&z.WindDelta!==0){var ft=this.AddOutPt(ePrev2,y.Bot);this.AddJoin(tt,ft,y.Top);}else if(ht!==null&&ht.Curr.X===y.Bot.X&&ht.Curr.Y===y.Bot.Y&&tt!==null&&ht.OutIdx>=0&&ht.Curr.Y===ht.Top.Y&&e.ClipperBase.SlopesEqual5(y.Curr,y.Top,ht.Curr,ht.Top,this.m_UseFullRange)&&y.WindDelta!==0&&ht.WindDelta!==0){var ft=this.AddOutPt(ht,y.Bot);this.AddJoin(tt,ft,y.Top);}}y=y.NextInAEL;}},e.Clipper.prototype.DoMaxima=function(s){var y=this.GetMaximaPairEx(s);if(y===null){s.OutIdx>=0&&this.AddOutPt(s,s.Top),this.DeleteFromAEL(s);return;}for(var I=s.NextInAEL;I!==null&&I!==y;)this.IntersectEdges(s,I,s.Top),this.SwapPositionsInAEL(s,I),I=s.NextInAEL;s.OutIdx===-1&&y.OutIdx===-1?(this.DeleteFromAEL(s),this.DeleteFromAEL(y)):s.OutIdx>=0&&y.OutIdx>=0?(s.OutIdx>=0&&this.AddLocalMaxPoly(s,y,s.Top),this.DeleteFromAEL(s),this.DeleteFromAEL(y)):e.use_lines&&s.WindDelta===0?(s.OutIdx>=0&&(this.AddOutPt(s,s.Top),s.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(s),y.OutIdx>=0&&(this.AddOutPt(y,s.Top),y.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(y)):e.Error("DoMaxima error");},e.Clipper.ReversePaths=function(s){for(var y=0,I=s.length;y<I;y++)s[y].reverse();},e.Clipper.Orientation=function(s){return e.Clipper.Area(s)>=0;},e.Clipper.prototype.PointCount=function(s){if(s===null)return 0;var y=0,I=s;do y++,I=I.Next;while(I!==s);return y;},e.Clipper.prototype.BuildResult=function(s){e.Clear(s);for(var y=0,I=this.m_PolyOuts.length;y<I;y++){var N=this.m_PolyOuts[y];if(N.Pts!==null){var z=N.Pts.Prev,Z=this.PointCount(z);if(!(Z<2)){for(var tt=new Array(Z),ft=0;ft<Z;ft++)tt[ft]=z.Pt,z=z.Prev;s.push(tt);}}}},e.Clipper.prototype.BuildResult2=function(s){s.Clear();for(var y=0,I=this.m_PolyOuts.length;y<I;y++){var N=this.m_PolyOuts[y],z=this.PointCount(N.Pts);if(!(N.IsOpen&&z<2||!N.IsOpen&&z<3)){this.FixHoleLinkage(N);var Z=new e.PolyNode();s.m_AllPolys.push(Z),N.PolyNode=Z,Z.m_polygon.length=z;for(var tt=N.Pts.Prev,ft=0;ft<z;ft++)Z.m_polygon[ft]=tt.Pt,tt=tt.Prev;}}for(var y=0,I=this.m_PolyOuts.length;y<I;y++){var N=this.m_PolyOuts[y];N.PolyNode!==null&&(N.IsOpen?(N.PolyNode.IsOpen=!0,s.AddChild(N.PolyNode)):N.FirstLeft!==null&&N.FirstLeft.PolyNode!==null?N.FirstLeft.PolyNode.AddChild(N.PolyNode):s.AddChild(N.PolyNode));}},e.Clipper.prototype.FixupOutPolyline=function(s){for(var y=s.Pts,I=y.Prev;y!==I;)if(y=y.Next,e.IntPoint.op_Equality(y.Pt,y.Prev.Pt)){y===I&&(I=y.Prev);var N=y.Prev;N.Next=y.Next,y.Next.Prev=N,y=N;}y===y.Prev&&(s.Pts=null);},e.Clipper.prototype.FixupOutPolygon=function(s){var y=null;s.BottomPt=null;for(var I=s.Pts,N=this.PreserveCollinear||this.StrictlySimple;;){if(I.Prev===I||I.Prev===I.Next){s.Pts=null;return;}if(e.IntPoint.op_Equality(I.Pt,I.Next.Pt)||e.IntPoint.op_Equality(I.Pt,I.Prev.Pt)||e.ClipperBase.SlopesEqual4(I.Prev.Pt,I.Pt,I.Next.Pt,this.m_UseFullRange)&&(!N||!this.Pt2IsBetweenPt1AndPt3(I.Prev.Pt,I.Pt,I.Next.Pt)))y=null,I.Prev.Next=I.Next,I.Next.Prev=I.Prev,I=I.Prev;else{if(I===y)break;y===null&&(y=I),I=I.Next;}}s.Pts=I;},e.Clipper.prototype.DupOutPt=function(s,y){var I=new e.OutPt();return I.Pt.X=s.Pt.X,I.Pt.Y=s.Pt.Y,e.use_xyz&&(I.Pt.Z=s.Pt.Z),I.Idx=s.Idx,y?(I.Next=s.Next,I.Prev=s,s.Next.Prev=I,s.Next=I):(I.Prev=s.Prev,I.Next=s,s.Prev.Next=I,s.Prev=I),I;},e.Clipper.prototype.GetOverlap=function(s,y,I,N,z){return s<y?I<N?(z.Left=Math.max(s,I),z.Right=Math.min(y,N)):(z.Left=Math.max(s,N),z.Right=Math.min(y,I)):I<N?(z.Left=Math.max(y,I),z.Right=Math.min(s,N)):(z.Left=Math.max(y,N),z.Right=Math.min(s,I)),z.Left<z.Right;},e.Clipper.prototype.JoinHorz=function(s,y,I,N,z,Z){var tt=s.Pt.X>y.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight,ft=I.Pt.X>N.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight;if(tt===ft)return!1;if(tt===e.Direction.dLeftToRight){for(;s.Next.Pt.X<=z.X&&s.Next.Pt.X>=s.Pt.X&&s.Next.Pt.Y===z.Y;)s=s.Next;Z&&s.Pt.X!==z.X&&(s=s.Next),y=this.DupOutPt(s,!Z),e.IntPoint.op_Inequality(y.Pt,z)&&(s=y,s.Pt.X=z.X,s.Pt.Y=z.Y,e.use_xyz&&(s.Pt.Z=z.Z),y=this.DupOutPt(s,!Z));}else{for(;s.Next.Pt.X>=z.X&&s.Next.Pt.X<=s.Pt.X&&s.Next.Pt.Y===z.Y;)s=s.Next;!Z&&s.Pt.X!==z.X&&(s=s.Next),y=this.DupOutPt(s,Z),e.IntPoint.op_Inequality(y.Pt,z)&&(s=y,s.Pt.X=z.X,s.Pt.Y=z.Y,e.use_xyz&&(s.Pt.Z=z.Z),y=this.DupOutPt(s,Z));}if(ft===e.Direction.dLeftToRight){for(;I.Next.Pt.X<=z.X&&I.Next.Pt.X>=I.Pt.X&&I.Next.Pt.Y===z.Y;)I=I.Next;Z&&I.Pt.X!==z.X&&(I=I.Next),N=this.DupOutPt(I,!Z),e.IntPoint.op_Inequality(N.Pt,z)&&(I=N,I.Pt.X=z.X,I.Pt.Y=z.Y,e.use_xyz&&(I.Pt.Z=z.Z),N=this.DupOutPt(I,!Z));}else{for(;I.Next.Pt.X>=z.X&&I.Next.Pt.X<=I.Pt.X&&I.Next.Pt.Y===z.Y;)I=I.Next;!Z&&I.Pt.X!==z.X&&(I=I.Next),N=this.DupOutPt(I,Z),e.IntPoint.op_Inequality(N.Pt,z)&&(I=N,I.Pt.X=z.X,I.Pt.Y=z.Y,e.use_xyz&&(I.Pt.Z=z.Z),N=this.DupOutPt(I,Z));}return tt===e.Direction.dLeftToRight===Z?(s.Prev=I,I.Next=s,y.Next=N,N.Prev=y):(s.Next=I,I.Prev=s,y.Prev=N,N.Next=y),!0;},e.Clipper.prototype.JoinPoints=function(s,y,I){var N=s.OutPt1,z=new e.OutPt(),Z=s.OutPt2,tt=new e.OutPt(),ft=s.OutPt1.Pt.Y===s.OffPt.Y;if(ft&&e.IntPoint.op_Equality(s.OffPt,s.OutPt1.Pt)&&e.IntPoint.op_Equality(s.OffPt,s.OutPt2.Pt)){if(y!==I)return!1;for(z=s.OutPt1.Next;z!==N&&e.IntPoint.op_Equality(z.Pt,s.OffPt);)z=z.Next;var ht=z.Pt.Y>s.OffPt.Y;for(tt=s.OutPt2.Next;tt!==Z&&e.IntPoint.op_Equality(tt.Pt,s.OffPt);)tt=tt.Next;var It=tt.Pt.Y>s.OffPt.Y;return ht===It?!1:ht?(z=this.DupOutPt(N,!1),tt=this.DupOutPt(Z,!0),N.Prev=Z,Z.Next=N,z.Next=tt,tt.Prev=z,s.OutPt1=N,s.OutPt2=z,!0):(z=this.DupOutPt(N,!0),tt=this.DupOutPt(Z,!1),N.Next=Z,Z.Prev=N,z.Prev=tt,tt.Next=z,s.OutPt1=N,s.OutPt2=z,!0);}else if(ft){for(z=N;N.Prev.Pt.Y===N.Pt.Y&&N.Prev!==z&&N.Prev!==Z;)N=N.Prev;for(;z.Next.Pt.Y===z.Pt.Y&&z.Next!==N&&z.Next!==Z;)z=z.Next;if(z.Next===N||z.Next===Z)return!1;for(tt=Z;Z.Prev.Pt.Y===Z.Pt.Y&&Z.Prev!==tt&&Z.Prev!==z;)Z=Z.Prev;for(;tt.Next.Pt.Y===tt.Pt.Y&&tt.Next!==Z&&tt.Next!==N;)tt=tt.Next;if(tt.Next===Z||tt.Next===N)return!1;var Rt={Left:null,Right:null};if(!this.GetOverlap(N.Pt.X,z.Pt.X,Z.Pt.X,tt.Pt.X,Rt))return!1;var Lt=Rt.Left,Wt=Rt.Right,Yt=new e.IntPoint0(),Vt;return N.Pt.X>=Lt&&N.Pt.X<=Wt?(Yt.X=N.Pt.X,Yt.Y=N.Pt.Y,e.use_xyz&&(Yt.Z=N.Pt.Z),Vt=N.Pt.X>z.Pt.X):Z.Pt.X>=Lt&&Z.Pt.X<=Wt?(Yt.X=Z.Pt.X,Yt.Y=Z.Pt.Y,e.use_xyz&&(Yt.Z=Z.Pt.Z),Vt=Z.Pt.X>tt.Pt.X):z.Pt.X>=Lt&&z.Pt.X<=Wt?(Yt.X=z.Pt.X,Yt.Y=z.Pt.Y,e.use_xyz&&(Yt.Z=z.Pt.Z),Vt=z.Pt.X>N.Pt.X):(Yt.X=tt.Pt.X,Yt.Y=tt.Pt.Y,e.use_xyz&&(Yt.Z=tt.Pt.Z),Vt=tt.Pt.X>Z.Pt.X),s.OutPt1=N,s.OutPt2=Z,this.JoinHorz(N,z,Z,tt,Yt,Vt);}else{for(z=N.Next;e.IntPoint.op_Equality(z.Pt,N.Pt)&&z!==N;)z=z.Next;var Kt=z.Pt.Y>N.Pt.Y||!e.ClipperBase.SlopesEqual4(N.Pt,z.Pt,s.OffPt,this.m_UseFullRange);if(Kt){for(z=N.Prev;e.IntPoint.op_Equality(z.Pt,N.Pt)&&z!==N;)z=z.Prev;if(z.Pt.Y>N.Pt.Y||!e.ClipperBase.SlopesEqual4(N.Pt,z.Pt,s.OffPt,this.m_UseFullRange))return!1;}for(tt=Z.Next;e.IntPoint.op_Equality(tt.Pt,Z.Pt)&&tt!==Z;)tt=tt.Next;var ee=tt.Pt.Y>Z.Pt.Y||!e.ClipperBase.SlopesEqual4(Z.Pt,tt.Pt,s.OffPt,this.m_UseFullRange);if(ee){for(tt=Z.Prev;e.IntPoint.op_Equality(tt.Pt,Z.Pt)&&tt!==Z;)tt=tt.Prev;if(tt.Pt.Y>Z.Pt.Y||!e.ClipperBase.SlopesEqual4(Z.Pt,tt.Pt,s.OffPt,this.m_UseFullRange))return!1;}return z===N||tt===Z||z===tt||y===I&&Kt===ee?!1:Kt?(z=this.DupOutPt(N,!1),tt=this.DupOutPt(Z,!0),N.Prev=Z,Z.Next=N,z.Next=tt,tt.Prev=z,s.OutPt1=N,s.OutPt2=z,!0):(z=this.DupOutPt(N,!0),tt=this.DupOutPt(Z,!1),N.Next=Z,Z.Prev=N,z.Prev=tt,tt.Next=z,s.OutPt1=N,s.OutPt2=z,!0);}},e.Clipper.GetBounds=function(s){for(var y=0,I=s.length;y<I&&s[y].length===0;)y++;if(y===I)return new e.IntRect(0,0,0,0);var N=new e.IntRect();for(N.left=s[y][0].X,N.right=N.left,N.top=s[y][0].Y,N.bottom=N.top;y<I;y++)for(var z=0,Z=s[y].length;z<Z;z++)s[y][z].X<N.left?N.left=s[y][z].X:s[y][z].X>N.right&&(N.right=s[y][z].X),s[y][z].Y<N.top?N.top=s[y][z].Y:s[y][z].Y>N.bottom&&(N.bottom=s[y][z].Y);return N;},e.Clipper.prototype.GetBounds2=function(s){var y=s,I=new e.IntRect();for(I.left=s.Pt.X,I.right=s.Pt.X,I.top=s.Pt.Y,I.bottom=s.Pt.Y,s=s.Next;s!==y;)s.Pt.X<I.left&&(I.left=s.Pt.X),s.Pt.X>I.right&&(I.right=s.Pt.X),s.Pt.Y<I.top&&(I.top=s.Pt.Y),s.Pt.Y>I.bottom&&(I.bottom=s.Pt.Y),s=s.Next;return I;},e.Clipper.PointInPolygon=function(s,y){var I=0,N=y.length;if(N<3)return 0;for(var z=y[0],Z=1;Z<=N;++Z){var tt=Z===N?y[0]:y[Z];if(tt.Y===s.Y&&(tt.X===s.X||z.Y===s.Y&&tt.X>s.X==z.X<s.X))return-1;if(z.Y<s.Y!=tt.Y<s.Y){if(z.X>=s.X){if(tt.X>s.X)I=1-I;else{var ft=(z.X-s.X)*(tt.Y-s.Y)-(tt.X-s.X)*(z.Y-s.Y);if(ft===0)return-1;ft>0==tt.Y>z.Y&&(I=1-I);}}else if(tt.X>s.X){var ft=(z.X-s.X)*(tt.Y-s.Y)-(tt.X-s.X)*(z.Y-s.Y);if(ft===0)return-1;ft>0==tt.Y>z.Y&&(I=1-I);}}z=tt;}return I;},e.Clipper.prototype.PointInPolygon=function(s,y){var I=0,N=y,z=s.X,Z=s.Y,tt=y.Pt.X,ft=y.Pt.Y;do{y=y.Next;var ht=y.Pt.X,It=y.Pt.Y;if(It===Z&&(ht===z||ft===Z&&ht>z==tt<z))return-1;if(ft<Z!=It<Z){if(tt>=z){if(ht>z)I=1-I;else{var Rt=(tt-z)*(It-Z)-(ht-z)*(ft-Z);if(Rt===0)return-1;Rt>0==It>ft&&(I=1-I);}}else if(ht>z){var Rt=(tt-z)*(It-Z)-(ht-z)*(ft-Z);if(Rt===0)return-1;Rt>0==It>ft&&(I=1-I);}}tt=ht,ft=It;}while(N!==y);return I;},e.Clipper.prototype.Poly2ContainsPoly1=function(s,y){var I=s;do{var N=this.PointInPolygon(I.Pt,y);if(N>=0)return N>0;I=I.Next;}while(I!==s);return!0;},e.Clipper.prototype.FixupFirstLefts1=function(s,y){for(var I,N,z=0,Z=this.m_PolyOuts.length;z<Z;z++)I=this.m_PolyOuts[z],N=e.Clipper.ParseFirstLeft(I.FirstLeft),I.Pts!==null&&N===s&&this.Poly2ContainsPoly1(I.Pts,y.Pts)&&(I.FirstLeft=y);},e.Clipper.prototype.FixupFirstLefts2=function(s,y){for(var I=y.FirstLeft,N,z,Z=0,tt=this.m_PolyOuts.length;Z<tt;Z++)N=this.m_PolyOuts[Z],!(N.Pts===null||N===y||N===s)&&(z=e.Clipper.ParseFirstLeft(N.FirstLeft),!(z!==I&&z!==s&&z!==y)&&(this.Poly2ContainsPoly1(N.Pts,s.Pts)?N.FirstLeft=s:this.Poly2ContainsPoly1(N.Pts,y.Pts)?N.FirstLeft=y:(N.FirstLeft===s||N.FirstLeft===y)&&(N.FirstLeft=I)));},e.Clipper.prototype.FixupFirstLefts3=function(s,y){for(var I,N,z=0,Z=this.m_PolyOuts.length;z<Z;z++)I=this.m_PolyOuts[z],N=e.Clipper.ParseFirstLeft(I.FirstLeft),I.Pts!==null&&N===s&&(I.FirstLeft=y);},e.Clipper.ParseFirstLeft=function(s){for(;s!==null&&s.Pts===null;)s=s.FirstLeft;return s;},e.Clipper.prototype.JoinCommonEdges=function(){for(var s=0,y=this.m_Joins.length;s<y;s++){var I=this.m_Joins[s],N=this.GetOutRec(I.OutPt1.Idx),z=this.GetOutRec(I.OutPt2.Idx);if(!(N.Pts===null||z.Pts===null)&&!(N.IsOpen||z.IsOpen)){var Z;N===z?Z=N:this.OutRec1RightOfOutRec2(N,z)?Z=z:this.OutRec1RightOfOutRec2(z,N)?Z=N:Z=this.GetLowermostRec(N,z),this.JoinPoints(I,N,z)&&(N===z?(N.Pts=I.OutPt1,N.BottomPt=null,z=this.CreateOutRec(),z.Pts=I.OutPt2,this.UpdateOutPtIdxs(z),this.Poly2ContainsPoly1(z.Pts,N.Pts)?(z.IsHole=!N.IsHole,z.FirstLeft=N,this.m_UsingPolyTree&&this.FixupFirstLefts2(z,N),(z.IsHole^this.ReverseSolution)==this.Area$1(z)>0&&this.ReversePolyPtLinks(z.Pts)):this.Poly2ContainsPoly1(N.Pts,z.Pts)?(z.IsHole=N.IsHole,N.IsHole=!z.IsHole,z.FirstLeft=N.FirstLeft,N.FirstLeft=z,this.m_UsingPolyTree&&this.FixupFirstLefts2(N,z),(N.IsHole^this.ReverseSolution)==this.Area$1(N)>0&&this.ReversePolyPtLinks(N.Pts)):(z.IsHole=N.IsHole,z.FirstLeft=N.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(N,z))):(z.Pts=null,z.BottomPt=null,z.Idx=N.Idx,N.IsHole=Z.IsHole,Z===z&&(N.FirstLeft=z.FirstLeft),z.FirstLeft=N,this.m_UsingPolyTree&&this.FixupFirstLefts3(z,N)));}}},e.Clipper.prototype.UpdateOutPtIdxs=function(s){var y=s.Pts;do y.Idx=s.Idx,y=y.Prev;while(y!==s.Pts);},e.Clipper.prototype.DoSimplePolygons=function(){for(var s=0;s<this.m_PolyOuts.length;){var y=this.m_PolyOuts[s++],I=y.Pts;if(!(I===null||y.IsOpen))do{for(var N=I.Next;N!==y.Pts;){if(e.IntPoint.op_Equality(I.Pt,N.Pt)&&N.Next!==I&&N.Prev!==I){var z=I.Prev,Z=N.Prev;I.Prev=Z,Z.Next=I,N.Prev=z,z.Next=N,y.Pts=I;var tt=this.CreateOutRec();tt.Pts=N,this.UpdateOutPtIdxs(tt),this.Poly2ContainsPoly1(tt.Pts,y.Pts)?(tt.IsHole=!y.IsHole,tt.FirstLeft=y,this.m_UsingPolyTree&&this.FixupFirstLefts2(tt,y)):this.Poly2ContainsPoly1(y.Pts,tt.Pts)?(tt.IsHole=y.IsHole,y.IsHole=!tt.IsHole,tt.FirstLeft=y.FirstLeft,y.FirstLeft=tt,this.m_UsingPolyTree&&this.FixupFirstLefts2(y,tt)):(tt.IsHole=y.IsHole,tt.FirstLeft=y.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(y,tt)),N=I;}N=N.Next;}I=I.Next;}while(I!==y.Pts);}},e.Clipper.Area=function(s){if(!Array.isArray(s))return 0;var y=s.length;if(y<3)return 0;for(var I=0,N=0,z=y-1;N<y;++N)I+=(s[z].X+s[N].X)*(s[z].Y-s[N].Y),z=N;return-I*0.5;},e.Clipper.prototype.Area=function(s){var y=s;if(s===null)return 0;var I=0;do I=I+(s.Prev.Pt.X+s.Pt.X)*(s.Prev.Pt.Y-s.Pt.Y),s=s.Next;while(s!==y);return I*0.5;},e.Clipper.prototype.Area$1=function(s){return this.Area(s.Pts);},e.Clipper.SimplifyPolygon=function(s,y){var I=new Array(),N=new e.Clipper(0);return N.StrictlySimple=!0,N.AddPath(s,e.PolyType.ptSubject,!0),N.Execute(e.ClipType.ctUnion,I,y,y),I;},e.Clipper.SimplifyPolygons=function(s,y){_typeof(y)>"u"&&(y=e.PolyFillType.pftEvenOdd);var I=new Array(),N=new e.Clipper(0);return N.StrictlySimple=!0,N.AddPaths(s,e.PolyType.ptSubject,!0),N.Execute(e.ClipType.ctUnion,I,y,y),I;},e.Clipper.DistanceSqrd=function(s,y){var I=s.X-y.X,N=s.Y-y.Y;return I*I+N*N;},e.Clipper.DistanceFromLineSqrd=function(s,y,I){var N=y.Y-I.Y,z=I.X-y.X,Z=N*y.X+z*y.Y;return Z=N*s.X+z*s.Y-Z,Z*Z/(N*N+z*z);},e.Clipper.SlopesNearCollinear=function(s,y,I,N){return Math.abs(s.X-y.X)>Math.abs(s.Y-y.Y)?s.X>y.X==s.X<I.X?e.Clipper.DistanceFromLineSqrd(s,y,I)<N:y.X>s.X==y.X<I.X?e.Clipper.DistanceFromLineSqrd(y,s,I)<N:e.Clipper.DistanceFromLineSqrd(I,s,y)<N:s.Y>y.Y==s.Y<I.Y?e.Clipper.DistanceFromLineSqrd(s,y,I)<N:y.Y>s.Y==y.Y<I.Y?e.Clipper.DistanceFromLineSqrd(y,s,I)<N:e.Clipper.DistanceFromLineSqrd(I,s,y)<N;},e.Clipper.PointsAreClose=function(s,y,I){var N=s.X-y.X,z=s.Y-y.Y;return N*N+z*z<=I;},e.Clipper.ExcludeOp=function(s){var y=s.Prev;return y.Next=s.Next,s.Next.Prev=y,y.Idx=0,y;},e.Clipper.CleanPolygon=function(s,y){_typeof(y)>"u"&&(y=1.415);var I=s.length;if(I===0)return new Array();for(var N=new Array(I),z=0;z<I;++z)N[z]=new e.OutPt();for(var z=0;z<I;++z)N[z].Pt=s[z],N[z].Next=N[(z+1)%I],N[z].Next.Prev=N[z],N[z].Idx=0;for(var Z=y*y,tt=N[0];tt.Idx===0&&tt.Next!==tt.Prev;)e.Clipper.PointsAreClose(tt.Pt,tt.Prev.Pt,Z)?(tt=e.Clipper.ExcludeOp(tt),I--):e.Clipper.PointsAreClose(tt.Prev.Pt,tt.Next.Pt,Z)?(e.Clipper.ExcludeOp(tt.Next),tt=e.Clipper.ExcludeOp(tt),I-=2):e.Clipper.SlopesNearCollinear(tt.Prev.Pt,tt.Pt,tt.Next.Pt,Z)?(tt=e.Clipper.ExcludeOp(tt),I--):(tt.Idx=1,tt=tt.Next);I<3&&(I=0);for(var ft=new Array(I),z=0;z<I;++z)ft[z]=new e.IntPoint1(tt.Pt),tt=tt.Next;return N=null,ft;},e.Clipper.CleanPolygons=function(s,y){for(var I=new Array(s.length),N=0,z=s.length;N<z;N++)I[N]=e.Clipper.CleanPolygon(s[N],y);return I;},e.Clipper.Minkowski=function(s,y,I,N){var z=N?1:0,Z=s.length,tt=y.length,ft=new Array();if(I)for(var ht=0;ht<tt;ht++){for(var It=new Array(Z),Rt=0,Lt=s.length,Wt=s[Rt];Rt<Lt;Rt++,Wt=s[Rt])It[Rt]=new e.IntPoint2(y[ht].X+Wt.X,y[ht].Y+Wt.Y);ft.push(It);}else for(var ht=0;ht<tt;ht++){for(var It=new Array(Z),Rt=0,Lt=s.length,Wt=s[Rt];Rt<Lt;Rt++,Wt=s[Rt])It[Rt]=new e.IntPoint2(y[ht].X-Wt.X,y[ht].Y-Wt.Y);ft.push(It);}for(var Yt=new Array(),ht=0;ht<tt-1+z;ht++)for(var Rt=0;Rt<Z;Rt++){var Vt=new Array();Vt.push(ft[ht%tt][Rt%Z]),Vt.push(ft[(ht+1)%tt][Rt%Z]),Vt.push(ft[(ht+1)%tt][(Rt+1)%Z]),Vt.push(ft[ht%tt][(Rt+1)%Z]),e.Clipper.Orientation(Vt)||Vt.reverse(),Yt.push(Vt);}return Yt;},e.Clipper.MinkowskiSum=function(s,y,I){if(y[0]instanceof Array){for(var z=y,tt=new e.Paths(),Z=new e.Clipper(),ft=0;ft<z.length;++ft){var ht=e.Clipper.Minkowski(s,z[ft],!0,I);if(Z.AddPaths(ht,e.PolyType.ptSubject,!0),I){var N=e.Clipper.TranslatePath(z[ft],s[0]);Z.AddPath(N,e.PolyType.ptClip,!0);}}return Z.Execute(e.ClipType.ctUnion,tt,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),tt;}else{var N=y,z=e.Clipper.Minkowski(s,N,!0,I),Z=new e.Clipper();return Z.AddPaths(z,e.PolyType.ptSubject,!0),Z.Execute(e.ClipType.ctUnion,z,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),z;}},e.Clipper.TranslatePath=function(s,y){for(var I=new e.Path(),N=0;N<s.length;N++)I.push(new e.IntPoint2(s[N].X+y.X,s[N].Y+y.Y));return I;},e.Clipper.MinkowskiDiff=function(s,y){var I=e.Clipper.Minkowski(s,y,!1,!0),N=new e.Clipper();return N.AddPaths(I,e.PolyType.ptSubject,!0),N.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),I;},e.Clipper.PolyTreeToPaths=function(s){var y=new Array();return e.Clipper.AddPolyNodeToPaths(s,e.Clipper.NodeType.ntAny,y),y;},e.Clipper.AddPolyNodeToPaths=function(s,y,I){var N=!0;switch(y){case e.Clipper.NodeType.ntOpen:return;case e.Clipper.NodeType.ntClosed:N=!s.IsOpen;break;}s.m_polygon.length>0&&N&&I.push(s.m_polygon);for(var z=0,Z=s.Childs(),tt=Z.length,ft=Z[z];z<tt;z++,ft=Z[z])e.Clipper.AddPolyNodeToPaths(ft,y,I);},e.Clipper.OpenPathsFromPolyTree=function(s){for(var y=new e.Paths(),I=0,N=s.ChildCount();I<N;I++)s.Childs()[I].IsOpen&&y.push(s.Childs()[I].m_polygon);return y;},e.Clipper.ClosedPathsFromPolyTree=function(s){var y=new e.Paths();return e.Clipper.AddPolyNodeToPaths(s,e.Clipper.NodeType.ntClosed,y),y;},Sn(e.Clipper,e.ClipperBase),e.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2},e.ClipperOffset=function(s,y){_typeof(s)>"u"&&(s=2),_typeof(y)>"u"&&(y=e.ClipperOffset.def_arc_tolerance),this.m_destPolys=new e.Paths(),this.m_srcPoly=new e.Path(),this.m_destPoly=new e.Path(),this.m_normals=new Array(),this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new e.IntPoint0(),this.m_polyNodes=new e.PolyNode(),this.MiterLimit=s,this.ArcTolerance=y,this.m_lowest.X=-1;},e.ClipperOffset.two_pi=6.28318530717959,e.ClipperOffset.def_arc_tolerance=0.25,e.ClipperOffset.prototype.Clear=function(){e.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1;},e.ClipperOffset.Round=e.Clipper.Round,e.ClipperOffset.prototype.AddPath=function(s,y,I){var N=s.length-1;if(!(N<0)){var z=new e.PolyNode();if(z.m_jointype=y,z.m_endtype=I,I===e.EndType.etClosedLine||I===e.EndType.etClosedPolygon)for(;N>0&&e.IntPoint.op_Equality(s[0],s[N]);)N--;z.m_polygon.push(s[0]);for(var Z=0,tt=0,ft=1;ft<=N;ft++)e.IntPoint.op_Inequality(z.m_polygon[Z],s[ft])&&(Z++,z.m_polygon.push(s[ft]),(s[ft].Y>z.m_polygon[tt].Y||s[ft].Y===z.m_polygon[tt].Y&&s[ft].X<z.m_polygon[tt].X)&&(tt=Z));if(!(I===e.EndType.etClosedPolygon&&Z<2)&&(this.m_polyNodes.AddChild(z),I===e.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,tt);else{var ht=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(z.m_polygon[tt].Y>ht.Y||z.m_polygon[tt].Y===ht.Y&&z.m_polygon[tt].X<ht.X)&&(this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,tt));}}},e.ClipperOffset.prototype.AddPaths=function(s,y,I){for(var N=0,z=s.length;N<z;N++)this.AddPath(s[N],y,I);},e.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!e.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var s=0;s<this.m_polyNodes.ChildCount();s++){var y=this.m_polyNodes.Childs()[s];(y.m_endtype===e.EndType.etClosedPolygon||y.m_endtype===e.EndType.etClosedLine&&e.Clipper.Orientation(y.m_polygon))&&y.m_polygon.reverse();}else for(var s=0;s<this.m_polyNodes.ChildCount();s++){var y=this.m_polyNodes.Childs()[s];y.m_endtype===e.EndType.etClosedLine&&!e.Clipper.Orientation(y.m_polygon)&&y.m_polygon.reverse();}},e.ClipperOffset.GetUnitNormal=function(s,y){var I=y.X-s.X,N=y.Y-s.Y;if(I===0&&N===0)return new e.DoublePoint2(0,0);var z=1/Math.sqrt(I*I+N*N);return I*=z,N*=z,new e.DoublePoint2(N,-I);},e.ClipperOffset.prototype.DoOffset=function(s){if(this.m_destPolys=new Array(),this.m_delta=s,e.ClipperBase.near_zero(s)){for(var y=0;y<this.m_polyNodes.ChildCount();y++){var I=this.m_polyNodes.Childs()[y];I.m_endtype===e.EndType.etClosedPolygon&&this.m_destPolys.push(I.m_polygon);}return;}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=0.5;var N;this.ArcTolerance<=0?N=e.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(s)*e.ClipperOffset.def_arc_tolerance?N=Math.abs(s)*e.ClipperOffset.def_arc_tolerance:N=this.ArcTolerance;var z=3.14159265358979/Math.acos(1-N/Math.abs(s));this.m_sin=Math.sin(e.ClipperOffset.two_pi/z),this.m_cos=Math.cos(e.ClipperOffset.two_pi/z),this.m_StepsPerRad=z/e.ClipperOffset.two_pi,s<0&&(this.m_sin=-this.m_sin);for(var y=0;y<this.m_polyNodes.ChildCount();y++){var I=this.m_polyNodes.Childs()[y];this.m_srcPoly=I.m_polygon;var Z=this.m_srcPoly.length;if(!(Z===0||s<=0&&(Z<3||I.m_endtype!==e.EndType.etClosedPolygon))){if(this.m_destPoly=new Array(),Z===1){if(I.m_jointype===e.JoinType.jtRound)for(var tt=1,ft=0,ht=1;ht<=z;ht++){this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+tt*s),e.ClipperOffset.Round(this.m_srcPoly[0].Y+ft*s)));var It=tt;tt=tt*this.m_cos-this.m_sin*ft,ft=It*this.m_sin+ft*this.m_cos;}else for(var tt=-1,ft=-1,ht=0;ht<4;++ht)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+tt*s),e.ClipperOffset.Round(this.m_srcPoly[0].Y+ft*s))),tt<0?tt=1:ft<0?ft=1:tt=-1;this.m_destPolys.push(this.m_destPoly);continue;}this.m_normals.length=0;for(var ht=0;ht<Z-1;ht++)this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[ht],this.m_srcPoly[ht+1]));if(I.m_endtype===e.EndType.etClosedLine||I.m_endtype===e.EndType.etClosedPolygon?this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[Z-1],this.m_srcPoly[0])):this.m_normals.push(new e.DoublePoint1(this.m_normals[Z-2])),I.m_endtype===e.EndType.etClosedPolygon){for(var Rt=Z-1,ht=0;ht<Z;ht++)Rt=this.OffsetPoint(ht,Rt,I.m_jointype);this.m_destPolys.push(this.m_destPoly);}else if(I.m_endtype===e.EndType.etClosedLine){for(var Rt=Z-1,ht=0;ht<Z;ht++)Rt=this.OffsetPoint(ht,Rt,I.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array();for(var Lt=this.m_normals[Z-1],ht=Z-1;ht>0;ht--)this.m_normals[ht]=new e.DoublePoint2(-this.m_normals[ht-1].X,-this.m_normals[ht-1].Y);this.m_normals[0]=new e.DoublePoint2(-Lt.X,-Lt.Y),Rt=0;for(var ht=Z-1;ht>=0;ht--)Rt=this.OffsetPoint(ht,Rt,I.m_jointype);this.m_destPolys.push(this.m_destPoly);}else{for(var Rt=0,ht=1;ht<Z-1;++ht)Rt=this.OffsetPoint(ht,Rt,I.m_jointype);var Wt;if(I.m_endtype===e.EndType.etOpenButt){var ht=Z-1;Wt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[ht].X+this.m_normals[ht].X*s),e.ClipperOffset.Round(this.m_srcPoly[ht].Y+this.m_normals[ht].Y*s)),this.m_destPoly.push(Wt),Wt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[ht].X-this.m_normals[ht].X*s),e.ClipperOffset.Round(this.m_srcPoly[ht].Y-this.m_normals[ht].Y*s)),this.m_destPoly.push(Wt);}else{var ht=Z-1;Rt=Z-2,this.m_sinA=0,this.m_normals[ht]=new e.DoublePoint2(-this.m_normals[ht].X,-this.m_normals[ht].Y),I.m_endtype===e.EndType.etOpenSquare?this.DoSquare(ht,Rt):this.DoRound(ht,Rt);}for(var ht=Z-1;ht>0;ht--)this.m_normals[ht]=new e.DoublePoint2(-this.m_normals[ht-1].X,-this.m_normals[ht-1].Y);this.m_normals[0]=new e.DoublePoint2(-this.m_normals[1].X,-this.m_normals[1].Y),Rt=Z-1;for(var ht=Rt-1;ht>0;--ht)Rt=this.OffsetPoint(ht,Rt,I.m_jointype);I.m_endtype===e.EndType.etOpenButt?(Wt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*s),e.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*s)),this.m_destPoly.push(Wt),Wt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*s),e.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*s)),this.m_destPoly.push(Wt)):(Rt=1,this.m_sinA=0,I.m_endtype===e.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly);}}}},e.ClipperOffset.prototype.Execute=function(){var s=arguments,y=s[0]instanceof e.PolyTree;if(y){var I=s[0],N=s[1];I.Clear(),this.FixOrientations(),this.DoOffset(N);var z=new e.Clipper(0);if(z.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),N>0)z.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var Z=e.Clipper.GetBounds(this.m_destPolys),tt=new e.Path();if(tt.push(new e.IntPoint2(Z.left-10,Z.bottom+10)),tt.push(new e.IntPoint2(Z.right+10,Z.bottom+10)),tt.push(new e.IntPoint2(Z.right+10,Z.top-10)),tt.push(new e.IntPoint2(Z.left-10,Z.top-10)),z.AddPath(tt,e.PolyType.ptSubject,!0),z.ReverseSolution=!0,z.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),I.ChildCount()===1&&I.Childs()[0].ChildCount()>0){var ft=I.Childs()[0];I.Childs()[0]=ft.Childs()[0],I.Childs()[0].m_Parent=I;for(var ht=1;ht<ft.ChildCount();ht++)I.AddChild(ft.Childs()[ht]);}else I.Clear();}}else{var I=s[0],N=s[1];e.Clear(I),this.FixOrientations(),this.DoOffset(N);var z=new e.Clipper(0);if(z.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),N>0)z.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var Z=e.Clipper.GetBounds(this.m_destPolys),tt=new e.Path();tt.push(new e.IntPoint2(Z.left-10,Z.bottom+10)),tt.push(new e.IntPoint2(Z.right+10,Z.bottom+10)),tt.push(new e.IntPoint2(Z.right+10,Z.top-10)),tt.push(new e.IntPoint2(Z.left-10,Z.top-10)),z.AddPath(tt,e.PolyType.ptSubject,!0),z.ReverseSolution=!0,z.Execute(e.ClipType.ctUnion,I,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),I.length>0&&I.splice(0,1);}}},e.ClipperOffset.prototype.OffsetPoint=function(s,y,I){if(this.m_sinA=this.m_normals[y].X*this.m_normals[s].Y-this.m_normals[s].X*this.m_normals[y].Y,Math.abs(this.m_sinA*this.m_delta)<1){var N=this.m_normals[y].X*this.m_normals[s].X+this.m_normals[s].Y*this.m_normals[y].Y;if(N>0)return this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_normals[y].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_normals[y].Y*this.m_delta))),y;}else this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1);if(this.m_sinA*this.m_delta<0)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_normals[y].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_normals[y].Y*this.m_delta))),this.m_destPoly.push(new e.IntPoint1(this.m_srcPoly[s])),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_normals[s].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_normals[s].Y*this.m_delta)));else switch(I){case e.JoinType.jtMiter:{var z=1+(this.m_normals[s].X*this.m_normals[y].X+this.m_normals[s].Y*this.m_normals[y].Y);z>=this.m_miterLim?this.DoMiter(s,y,z):this.DoSquare(s,y);break;}case e.JoinType.jtSquare:this.DoSquare(s,y);break;case e.JoinType.jtRound:this.DoRound(s,y);break;}return y=s,y;},e.ClipperOffset.prototype.DoSquare=function(s,y){var I=Math.tan(Math.atan2(this.m_sinA,this.m_normals[y].X*this.m_normals[s].X+this.m_normals[y].Y*this.m_normals[s].Y)/4);this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_delta*(this.m_normals[y].X-this.m_normals[y].Y*I)),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_delta*(this.m_normals[y].Y+this.m_normals[y].X*I)))),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_delta*(this.m_normals[s].X+this.m_normals[s].Y*I)),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_delta*(this.m_normals[s].Y-this.m_normals[s].X*I))));},e.ClipperOffset.prototype.DoMiter=function(s,y,I){var N=this.m_delta/I;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+(this.m_normals[y].X+this.m_normals[s].X)*N),e.ClipperOffset.Round(this.m_srcPoly[s].Y+(this.m_normals[y].Y+this.m_normals[s].Y)*N)));},e.ClipperOffset.prototype.DoRound=function(s,y){for(var I=Math.atan2(this.m_sinA,this.m_normals[y].X*this.m_normals[s].X+this.m_normals[y].Y*this.m_normals[s].Y),N=Math.max(e.Cast_Int32(e.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(I))),1),z=this.m_normals[y].X,Z=this.m_normals[y].Y,tt,ft=0;ft<N;++ft)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+z*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+Z*this.m_delta))),tt=z,z=z*this.m_cos-this.m_sin*Z,Z=tt*this.m_sin+Z*this.m_cos;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[s].X+this.m_normals[s].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[s].Y+this.m_normals[s].Y*this.m_delta)));},e.Error=function(s){try{throw new Error(s);}catch(y){alert(y.message);}},e.JS={},e.JS.AreaOfPolygon=function(s,y){return y||(y=1),e.Clipper.Area(s)/(y*y);},e.JS.AreaOfPolygons=function(s,y){y||(y=1);for(var I=0,N=0;N<s.length;N++)I+=e.Clipper.Area(s[N]);return I/(y*y);},e.JS.BoundsOfPath=function(s,y){return e.JS.BoundsOfPaths([s],y);},e.JS.BoundsOfPaths=function(s,y){y||(y=1);var I=e.Clipper.GetBounds(s);return I.left/=y,I.bottom/=y,I.right/=y,I.top/=y,I;},e.JS.Clean=function(N,y){if(!(N instanceof Array))return[];var I=N[0]instanceof Array,N=e.JS.Clone(N);if(typeof y!="number"||y===null)return e.Error("Delta is not a number in Clean()."),N;if(N.length===0||N.length===1&&N[0].length===0||y<0)return N;I||(N=[N]);for(var z=N.length,Z,tt,ft,ht,It,Rt,Lt,Wt=[],Yt=0;Yt<z;Yt++)if(tt=N[Yt],Z=tt.length,Z!==0){if(Z<3){ft=tt,Wt.push(ft);continue;}for(ft=tt,ht=y*y,It=tt[0],Rt=1,Lt=1;Lt<Z;Lt++)(tt[Lt].X-It.X)*(tt[Lt].X-It.X)+(tt[Lt].Y-It.Y)*(tt[Lt].Y-It.Y)<=ht||(ft[Rt]=tt[Lt],It=tt[Lt],Rt++);It=tt[Rt-1],(tt[0].X-It.X)*(tt[0].X-It.X)+(tt[0].Y-It.Y)*(tt[0].Y-It.Y)<=ht&&Rt--,Rt<Z&&ft.splice(Rt,Z-Rt),ft.length&&Wt.push(ft);}return!I&&Wt.length?Wt=Wt[0]:!I&&Wt.length===0?Wt=[]:I&&Wt.length===0&&(Wt=[[]]),Wt;},e.JS.Clone=function(s){if(!(s instanceof Array))return[];if(s.length===0)return[];if(s.length===1&&s[0].length===0)return[[]];var y=s[0]instanceof Array;y||(s=[s]);var I=s.length,N,z,Z,tt,ft=new Array(I);for(z=0;z<I;z++){for(N=s[z].length,tt=new Array(N),Z=0;Z<N;Z++)tt[Z]={X:s[z][Z].X,Y:s[z][Z].Y};ft[z]=tt;}return y||(ft=ft[0]),ft;},e.JS.Lighten=function(s,y){if(!(s instanceof Array))return[];if(typeof y!="number"||y===null)return e.Error("Tolerance is not a number in Lighten()."),e.JS.Clone(s);if(s.length===0||s.length===1&&s[0].length===0||y<0)return e.JS.Clone(s);var I=s[0]instanceof Array;I||(s=[s]);var N,z,Z,tt,ft,ht,It,Rt,Lt,Wt,Yt,Vt,Kt,ee,ge,Oe,Ye,to=s.length,eo=y*y,Xe=[];for(N=0;N<to;N++)if(Z=s[N],ht=Z.length,ht!==0){for(tt=0;tt<1e6;tt++){for(ft=[],ht=Z.length,Z[ht-1].X!==Z[0].X||Z[ht-1].Y!==Z[0].Y?(Vt=1,Z.push({X:Z[0].X,Y:Z[0].Y}),ht=Z.length):Vt=0,Yt=[],z=0;z<ht-2;z++)It=Z[z],Lt=Z[z+1],Rt=Z[z+2],Oe=It.X,Ye=It.Y,Kt=Rt.X-Oe,ee=Rt.Y-Ye,(Kt!==0||ee!==0)&&(ge=((Lt.X-Oe)*Kt+(Lt.Y-Ye)*ee)/(Kt*Kt+ee*ee),ge>1?(Oe=Rt.X,Ye=Rt.Y):ge>0&&(Oe+=Kt*ge,Ye+=ee*ge)),Kt=Lt.X-Oe,ee=Lt.Y-Ye,Wt=Kt*Kt+ee*ee,Wt<=eo&&(Yt[z+1]=1,z++);for(ft.push({X:Z[0].X,Y:Z[0].Y}),z=1;z<ht-1;z++)Yt[z]||ft.push({X:Z[z].X,Y:Z[z].Y});if(ft.push({X:Z[ht-1].X,Y:Z[ht-1].Y}),Vt&&Z.pop(),Yt.length)Z=ft;else break;}ht=ft.length,ft[ht-1].X===ft[0].X&&ft[ht-1].Y===ft[0].Y&&ft.pop(),ft.length>2&&Xe.push(ft);}return I||(Xe=Xe[0]),_typeof(Xe)>"u"&&(Xe=[]),Xe;},e.JS.PerimeterOfPath=function(s,y,I){if(_typeof(s)>"u")return 0;var N=Math.sqrt,z=0,Z,tt,ft=0,ht=0,It=0,Rt=0,Lt=s.length;if(Lt<2)return 0;for(y&&(s[Lt]=s[0],Lt++);--Lt;)Z=s[Lt],ft=Z.X,ht=Z.Y,tt=s[Lt-1],It=tt.X,Rt=tt.Y,z+=N((ft-It)*(ft-It)+(ht-Rt)*(ht-Rt));return y&&s.pop(),z/I;},e.JS.PerimeterOfPaths=function(s,y,I){I||(I=1);for(var N=0,z=0;z<s.length;z++)N+=e.JS.PerimeterOfPath(s[z],y,I);return N;},e.JS.ScaleDownPath=function(s,y){var I,N;for(y||(y=1),I=s.length;I--;)N=s[I],N.X=N.X/y,N.Y=N.Y/y;},e.JS.ScaleDownPaths=function(s,y){var I,N,z;for(y||(y=1),I=s.length;I--;)for(N=s[I].length;N--;)z=s[I][N],z.X=z.X/y,z.Y=z.Y/y;},e.JS.ScaleUpPath=function(s,y){var I,N,z=Math.round;for(y||(y=1),I=s.length;I--;)N=s[I],N.X=z(N.X*y),N.Y=z(N.Y*y);},e.JS.ScaleUpPaths=function(s,y){var I,N,z,Z=Math.round;for(y||(y=1),I=s.length;I--;)for(N=s[I].length;N--;)z=s[I][N],z.X=Z(z.X*y),z.Y=Z(z.Y*y);},e.ExPolygons=function(){return[];},e.ExPolygon=function(){this.outer=null,this.holes=null;},e.JS.AddOuterPolyNodeToExPolygons=function(s,y){var I=new e.ExPolygon();I.outer=s.Contour();var N=s.Childs(),z=N.length;I.holes=new Array(z);var Z,tt,ft,ht,It,Rt;for(ft=0;ft<z;ft++)for(Z=N[ft],I.holes[ft]=Z.Contour(),ht=0,It=Z.Childs(),Rt=It.length;ht<Rt;ht++)tt=It[ht],e.JS.AddOuterPolyNodeToExPolygons(tt,y);y.push(I);},e.JS.ExPolygonsToPaths=function(s){var y,I,N,z,Z=new e.Paths();for(y=0,N=s.length;y<N;y++)for(Z.push(s[y].outer),I=0,z=s[y].holes.length;I<z;I++)Z.push(s[y].holes[I]);return Z;},e.JS.PolyTreeToExPolygons=function(s){var y=new e.ExPolygons(),I,N,z,Z;for(N=0,z=s.Childs(),Z=z.length;N<Z;N++)I=z[N],e.JS.AddOuterPolyNodeToExPolygons(I,y);return y;};})();})(Hi);var Zp=Hi.exports,Ee=/* @__PURE__ */Ne(Zp);function Vi(u,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;return Math.abs(u[0]-e[0])<t&&Math.abs(u[1]-e[1])<t;}function Jp(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(u.length===0)return[];var t=[[u[0][0],u[0][1]]];for(var r=1;r<u.length;r++)Vi([u[r][0],u[r][1]],t[t.length-1],e)||t.push([u[r][0],u[r][1]]);return t;}function Qp(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(u.length<=2)return u;var t=u[0],r=u[u.length-1];return Vi(t,r,e)?u.slice(0,-1):u;}function qp(u){var e=u.reduce(function(r,n){return r+n[0];},0)/u.length,t=u.reduce(function(r,n){return r+n[1];},0)/u.length;return[e,t];}function Vn(u,e){return Math.atan2(e[1]-u[1],e[0]-u[0]);}function _p(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(u.length<=2)return u;var t=[];var _iterator16=_createForOfIteratorHelper(u),_step16;try{var _loop3=function _loop3(){var n=_step16.value;t.some(function(l){return Math.abs(l[0]-n[0])<e&&Math.abs(l[1]-n[1])<e;})||t.push([n[0],n[1]]);};for(_iterator16.s();!(_step16=_iterator16.n()).done;){_loop3();}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}var r=qp(t);return t.sort(function(n,i){var l=Vn(r,n),o=Vn(r,i);return l-o;});}function t0(u,e){var t=e[0].x<e[e.length-1].x;return u.map(function(n){var l=n.map(function(o){var a=-1,c=1/0,m=0;for(var f=0;f<e.length;f++){var v=e[f],S=Math.sqrt(Math.pow(v.x-o[0],2)+Math.pow(v.y-o[1],2));S<c&&(c=S,a=f,m=v.z);}return{point:o,index:a,bestZ:m};}).sort(function(o,a){return o.index-a.index;}).map(function(o){return[].concat(_toConsumableArray(o.point),[o.bestZ]);});return t&&l[0][0]>l[l.length-1][0]||!t&&l[0][0]<l[l.length-1][0]?l.reverse():l;}).sort(function(n,i){var l=n[0][0],o=i[0][0];return t?l-o:o-l;});}function e0(u,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;var n=u.map(function(f){return[f.x,f.y];}),i=function i(f,v){return f.map(function(_ref166){var _ref167=_slicedToArray(_ref166,2),S=_ref167[0],E=_ref167[1];return{X:Math.round(S*v),Y:Math.round(E*v)};});},l=new Ee.ClipperOffset();l.AddPath(i(n,1e3),Ee.JoinType.jtRound,Ee.EndType.etOpenButt);var o=[];l.Execute(o,1);var a=new Ee.Clipper();a.AddPaths(o,Ee.PolyType.ptSubject,!0),e.forEach(function(f){a.AddPath(i(f,1e3),Ee.PolyType.ptClip,!0);});var c=new Ee.Paths();a.Execute(Ee.ClipType.ctDifference,c,Ee.PolyFillType.pftNonZero,Ee.PolyFillType.pftNonZero);var m=c.map(function(f){return Qp(_p(Jp(f.map(function(v){return[v.X/1e3,v.Y/1e3];}),t),t),t);}).filter(function(f){return f.length>=2;});return t0(m,u);}var Ki=/*#__PURE__*/function(_At){function Ki(t){var _this62;_classCallCheck(this,Ki);_this62=_callSuper(this,Ki,[t]);ot(_this62,"canRotate",!0);ot(_this62,"scaleType",Qt.all);ot(_this62,"toolsType",pt.Pencil);ot(_this62,"syncTimestamp");ot(_this62,"syncIndex",0);ot(_this62,"tmpPoints",[]);ot(_this62,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */ot(_this62,"uniThickness");ot(_this62,"workOptions");ot(_this62,"centerPos",[0,0]);_this62.workOptions=t.toolsOpt,_this62.uniThickness=_this62.MAX_REPEAR/_this62.workOptions.thickness/10,_this62.syncTimestamp=0;return _this62;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Ki,_At);return _createClass(Ki,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.toString();if(this.tmpPoints.length<2)return{type:dt.None};var r=this.transformDataAll(!0),n={name:t};var i;var l=this.drawLayer||this.fullLayer;return r.length&&(i=this.draw({attrs:n,tasks:r,replaceId:t,layer:l})),{rect:i,type:dt.DrawWork,dataType:Dt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Ki,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this63=this;var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.drawCount,a=t.removeDrawCount,c=t.isSimpleWorker,m=r.workId,f=r.syncUnitTime;f&&(this.syncUnitTime=f);var _this$transformData=this.transformData(r,!1),v=_this$transformData.tasks,S=_this$transformData.effects,E=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,E,Math.max(0,this.tmpPoints.length-2));var T={name:m,id:he(o)&&o.toString()||void 0};var P,x=!1;var h=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),v.length&&(v[0].taskId-this.syncTimestamp>this.syncUnitTime&&(x=!0,this.syncTimestamp=v[0].taskId,this.syncIndex=this.tmpPoints.length),i||l||c)){var d=n?this.fullLayer:this.drawLayer||this.fullLayer;P=this.draw({attrs:T,tasks:v,effects:S,layer:d,removeDrawCount:a});}if(c){var _d14=[];return this.tmpPoints.slice(h).forEach(function(g){_d14.push(g.x,g.y,_this63.computRadius(g.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:Dt.Local,op:x?_d14:void 0,index:x?h*3:void 0,rect:P,updateNodeOpt:{useAnimation:!0}});}if(i)return E>10&&this.tmpPoints.splice(0,E-10),{rect:P,type:dt.DrawWork,dataType:Dt.Local};var p=[];return this.tmpPoints.slice(h).forEach(function(d){p.push(d.x,d.y,_this63.computRadius(d.z,_this63.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:Dt.Local,rect:P,op:x?p:void 0,index:x?h*3:void 0,updateNodeOpt:{useAnimation:!0}});}},{key:"consumeAll",value:function consumeAll(t){var m;var r=this.workId;if(t.data){var _t$data=t.data,f=_t$data.op,v=_t$data.workState;f!=null&&f.length&&v===Ft.Done&&this.workOptions.strokeType===Zt.Stroke&&this.updateTempPointsWithPressureWhenDone(f);}var n=this.transformDataAll(!0),i={name:r};var l;var o=this.fullLayer;if(n.length&&(l=this.draw({attrs:i,tasks:n,replaceId:r,layer:o})),this.tmpPoints.length<2)return this.replace(o,r),{type:dt.RemoveNode,removeIds:[r],rect:l};var a=[];this.tmpPoints.map(function(f){a.push(f.x,f.y,f.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var c=ve(a);return(m=this.vNodes)==null||m.setInfo(r,{rect:l,op:a,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:l&&At.getCenterPos(l,o)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:l,type:dt.FullWork,dataType:Dt.Local,ops:c,updateNodeOpt:{pos:this.centerPos,useAnimation:!0}});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var f,v;var r=t.op,n=t.isFullWork,i=t.replaceId,_t$workState=t.workState,l=_t$workState===void 0?Ft.Done:_t$workState;this.tmpPoints.length=0;for(var S=0;S<r.length;S+=3){var E=new Nt(r[S],r[S+1],r[S+2]);if(this.tmpPoints.length>0){var T=this.tmpPoints[this.tmpPoints.length-1],P=at.Sub(E,T).uni();E.setv(P);}this.tmpPoints.push(E);}if(this.tmpPoints.length<2)return;var o=this.transformDataAll(!0),a=(f=this.workId)==null?void 0:f.toString(),c={name:a};var m;if(a&&o.length){var _S8=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({attrs:c,tasks:o,replaceId:i,layer:_S8,isDrawEraserlines:l===Ft.Done}),(v=this.vNodes)==null||v.setInfo(a,{rect:m,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&At.getCenterPos(m,_S8)});}return m;}},{key:"computPencilPoints",value:function computPencilPoints(t){var _this64=this;var r=[],n=t.op,i=t.eraserPolylines,l=t.eraserThickness;this.tmpPoints.length=0;for(var a=0;a<n.length;a+=3){var c=new Nt(n[a],n[a+1],n[a+2]);if(this.tmpPoints.length>0){var m=this.tmpPoints[this.tmpPoints.length-1],f=at.Sub(c,m).uni();c.setv(f);}this.tmpPoints.push(c);}if(this.tmpPoints.length<2)return;var o=this.transformDataAll(!0);if(o.length){var _loop4=function _loop4(){var _o$_a=o[_a5],c=_o$_a.pos,m=_o$_a.points,f=m.map(function(E){return E.point.addXY(c[0],c[1]);}),v=[];var _iterator17=_createForOfIteratorHelper(i),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var E=_step17.value;var T=[];for(var _x54=0;_x54<E.length;_x54+=2){var _h29=new Nt(E[_x54],E[_x54+1]);if(T.length>0){var p=T[T.length-1].point,d=at.Sub(_h29,p).uni();_h29.setv(d);}T.push({point:_h29,radius:l});}var _this64$computStroke=_this64.computStroke(T,!1),P=_this64$computStroke.ps;v.push(P.map(function(x){return x.XY;}));}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}e0(f,v,0.01).forEach(function(E){r.push(E.map(function(T){return[T[0],T[1],T[2]];}).flat(1));});};for(var _a5=0;_a5<o.length;_a5++){_loop4();}}return r;}},{key:"transformDataAll",value:function transformDataAll(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.getTaskPoints(this.tmpPoints,t&&this.workOptions.thickness||void 0);}},{key:"draw",value:function draw(t){var _this65=this;var r=t.attrs,n=t.tasks,i=t.replaceId,l=t.effects,o=t.layer,a=t.removeDrawCount,_t$isDrawEraserlines=t.isDrawEraserlines,c=_t$isDrawEraserlines===void 0?!0:_t$isDrawEraserlines,_this$workOptions=this.workOptions,m=_this$workOptions.strokeColor,f=_this$workOptions.strokeType,v=_this$workOptions.thickness,S=_this$workOptions.zIndex,E=_this$workOptions.scale,T=_this$workOptions.rotate,P=_this$workOptions.translate,x=_this$workOptions.eraserlines;l!=null&&l.size&&(l.forEach(function(w){var L;(L=o.getElementById(w+""))==null||L.remove();}),l.clear()),a&&this.removeDrawCountNodes(o,a);var h;var p=[],d=o.worldPosition,g=o.worldScaling;for(var w=0;w<n.length;w++){var _n$w=n[w],L=_n$w.pos,B=_n$w.points,_this$computDrawPoint=this.computDrawPoints(B),A=_this$computDrawPoint.ps,b=_this$computDrawPoint.rect;var W=void 0;var D=B.length===1;f===Zt.Stroke||D?W=De(A,!0):W=De(A,!1);var R={pos:L,d:W,fillColor:f===Zt.Stroke||D?m:void 0,lineDash:f===Zt.Dotted&&!D?[1,v*2]:f===Zt.LongDotted&&!D?[v,v*2]:void 0,strokeColor:m,lineCap:f===Zt.Stroke||D?void 0:"round",lineWidth:f===Zt.Stroke||D?0:v};h=bt(h,{x:Math.floor((b.x+L[0])*g[0]+d[0]-At.SafeBorderPadding),y:Math.floor((b.y+L[1])*g[1]+d[1]-At.SafeBorderPadding),w:Math.floor(b.w*g[0]+2*At.SafeBorderPadding),h:Math.floor(b.h*g[1]+2*At.SafeBorderPadding)}),p.push(R);}E&&(r.scale=E),T&&(r.rotate=T),P&&(r.translate=P);var O=new ye();if(h){this.centerPos=At.getCenterPos(h,o);var _w4=f===Zt.Stroke&&!x;O.attr(_objectSpread(_objectSpread({},r),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_w4?m:void 0,pos:this.centerPos,size:[(h.w-2*At.SafeBorderPadding)/g[0],(h.h-2*At.SafeBorderPadding)/g[1]],zIndex:S}));var _L5=p.map(function(B){return B.pos=[B.pos[0]-_this65.centerPos[0],B.pos[1]-_this65.centerPos[1]],new be(B);});O.append.apply(O,_toConsumableArray(_L5)),_w4&&O.seal(),x&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:O,eraserlines:x,pos:this.centerPos,layer:o},c)),this.replace(o,i,O);}if(E||T||P){var _w5=O==null?void 0:O.getBoundingClientRect();_w5&&(h={x:Math.floor(_w5.x-At.SafeBorderPadding),y:Math.floor(_w5.y-At.SafeBorderPadding),w:Math.floor(_w5.width+At.SafeBorderPadding*2),h:Math.floor(_w5.height+At.SafeBorderPadding*2)});}return this.isDelete&&O.setAttribute("opacity",0),h;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Zt.Stroke||t.length===1?this.computStroke(t):this.computNomal(t);}},{key:"computNomal",value:function computNomal(t){var r=this.workOptions.thickness;var n=t.map(function(i){return r=Math.max(r,i.radius),i.point;});return{ps:n,rect:_t(n,r)};}},{key:"computStroke",value:function computStroke(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return t.length===1?this.computDotStroke(t[0]):this.computLineStroke(t,r);}},{key:"computLineStroke",value:function computLineStroke(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var n=[],i=[];for(var a=0;a<t.length;a++){var _t$a=t[a],c=_t$a.point,m=_t$a.radius;var f=c.v;a===0&&t.length>1&&(f=t[a+1].point.v);var v=at.Per(f).mul(m);n.push(Nt.Sub(c,v)),i.push(Nt.Add(c,v));}var l=t[t.length-1];if(r){var _a6=Nt.GetSemicircleStroke(l.point,n[n.length-1],-1,8),_c4=Nt.GetSemicircleStroke(t[0].point,i[0],-1,8),_m7=n.concat(_a6,i.reverse(),_c4);return{ps:_m7,rect:_t(_m7)};}var o=n.concat(i.reverse());return{ps:o,rect:_t(o)};}},{key:"computDotStroke",value:function computDotStroke(t){var r=t.point,n=t.radius,i={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Nt.GetDotStroke(r,n,8),rect:i};}},{key:"transformData",value:function transformData(t,r){var n=t.op,i=t.workState;var l=this.tmpPoints.length-1,o=[];if(n!=null&&n.length&&i){var _this$workOptions2=this.workOptions,a=_this$workOptions2.strokeType,c=_this$workOptions2.thickness,m=/* @__PURE__ */new Set();l=a===Zt.Stroke?this.updateTempPointsWithPressure(n,c,m):this.updateTempPoints(n,c,m);var f=r?this.tmpPoints:this.tmpPoints.slice(l);return o=this.getTaskPoints(f,c),{tasks:o,effects:m,consumeIndex:l};}return{tasks:o,consumeIndex:l};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(t,r){return t*0.03*r+r*0.5;}},{key:"getMinZ",value:function getMinZ(t,r){return((r||Math.max(1,Math.floor(t*0.3)))-t*0.5)*100/t/3;}},{key:"getTaskPoints",value:function getTaskPoints(t,r){var f;var n=[];if(t.length===0)return[];var i=0,l=t[0].x,o=t[0].y,a=[l,o],c=[],m=t[0].t;for(;i<t.length;){var v=t[i],S=v.x-l,E=v.y-o,T=v.z,P=r?this.computRadius(T,r):T;if(c.push({point:new Nt(S,E,T,t[i].v),radius:P}),i>0&&i<t.length-1){var _x55=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_x55<60||_x55>300){var _h30=(f=c.pop())==null?void 0:f.point.clone();_h30&&n.push({taskId:m,pos:a,points:[].concat(_toConsumableArray(c),[{point:_h30,radius:P}])}),l=t[i].x,o=t[i].y,a=[l,o];var p=v.x-l,d=v.y-o;c=[{point:new Nt(p,d,T),radius:P}],m=Date.now();}}i++;}return n.push({taskId:m,pos:a,points:c}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,r,n){var i=Date.now(),l=this.tmpPoints.length;var o=l;for(var c=0;c<t.length;c+=2){o=Math.min(o,l);var m=this.tmpPoints.length,f=new Nt(t[c],t[c+1]);if(m===0){this.tmpPoints.push(f);continue;}var v=m-1,S=this.tmpPoints[v],E=at.Sub(f,S).uni();if(f.isNear(S,r)){if(S.z<this.MAX_REPEAR){if(S.setz(Math.min(S.z+1,this.MAX_REPEAR)),o=Math.min(o,v),m>1){var _x56=m-1;for(;_x56>0;){var _h31=this.tmpPoints[_x56].distance(this.tmpPoints[_x56-1]),p=Math.max(this.tmpPoints[_x56].z-this.uniThickness*_h31,0);if(this.tmpPoints[_x56-1].z>=p)break;this.tmpPoints[_x56-1].setz(p),o=Math.min(o,_x56-1),_x56--;}}}else o=1/0;continue;}f.setv(E);var T=f.distance(S),P=Math.max(S.z-this.uniThickness*T,0);m>1&&at.Equals(E,S.v,0.02)&&(P>0||S.z<=0)&&(n&&S.t&&n.add(S.t),this.tmpPoints.pop(),o=Math.min(v,o)),f.setz(P),this.tmpPoints.push(f);}if(o===1/0)return this.tmpPoints.length;var a=l;if(o===l){a=Math.max(a-1,0);var _c5=this.tmpPoints[a].t;_c5&&(n==null||n.add(_c5));}else{var _c6=l-1;for(a=o;_c6>=0;){var _m8=this.tmpPoints[_c6].t;if(_m8&&(n==null||n.add(_m8),_c6<=o)){a=_c6,_c6=-1;break;}_c6--;}}return this.tmpPoints[a].setT(i),a;}},{key:"updateTempPoints",value:function updateTempPoints(t,r,n){var c;var i=Date.now(),l=this.tmpPoints.length;var o=l;for(var m=0;m<t.length;m+=2){var f=this.tmpPoints.length,v=new Nt(t[m],t[m+1]);if(f===0){this.tmpPoints.push(v);continue;}var S=f-1,E=this.tmpPoints[S],T=at.Sub(v,E).uni();if(v.isNear(E,r/2)){o=Math.min(S,o);continue;}at.Equals(T,E.v,0.02)&&(n&&E.t&&n.add(E.t),this.tmpPoints.pop(),o=Math.min(S,o)),v.setv(T),this.tmpPoints.push(v);}var a=l;if(o===l){a=Math.max(a-1,0);var _m9=this.tmpPoints[a].t;_m9&&(n==null||n.add(_m9));}else{var _m10=Math.min(l-1,o);for(a=o;_m10>=0;){var _f4=(c=this.tmpPoints[_m10])==null?void 0:c.t;if(_f4&&(n==null||n.add(_f4),_m10<=o)){a=_m10,_m10=-1;break;}_m10--;}}return this.tmpPoints[a].setT(i),a;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var r=this.workOptions.thickness,n=t.length,i=this.getMinZ(r);for(var l=0;l<n;l+=2){var o=this.tmpPoints.length,a=new Nt(t[l],t[l+1]);if(o===0){this.tmpPoints.push(a);continue;}var c=o-1,m=this.tmpPoints[c],f=at.Sub(a,m).uni(),v=a.distance(m);if(o>1&&m.z===i)break;if(a.isNear(m,r/2)){if(n<3&&m.z<this.MAX_REPEAR&&(m.setz(Math.min(m.z+1,this.MAX_REPEAR)),o>1)){var E=o-1;for(;E>0;){var T=this.tmpPoints[E].distance(this.tmpPoints[E-1]),P=Math.max(this.tmpPoints[E].z-this.uniThickness*T,-r/4);if(this.tmpPoints[E-1].z>=P)break;this.tmpPoints[E-1].setz(P),E--;}}continue;}a.setv(f);var S=Math.max(m.z-this.uniThickness*v,i);o>1&&at.Equals(f,m.v,0.02)&&m.z<=0&&this.tmpPoints.pop(),a.setz(S),this.tmpPoints.push(a);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,m;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.strokeType,a=i.get(r.name);return l&&(r.tagName==="GROUP"?xm(r)?r.setAttribute("bgcolor",l):r.children.forEach(function(f){f.setAttribute("strokeColor",l),f.getAttribute("fillColor")&&f.setAttribute("fillColor",l);}):(r.setAttribute("strokeColor",l),r.setAttribute("fillColor",l)),(c=a==null?void 0:a.opt)!=null&&c.strokeColor&&(a.opt.strokeColor=l)),o&&a!=null&&a.opt&&(m=a.opt)!=null&&m.strokeType&&(a.opt.strokeType=o),a&&i.setInfo(r.name,a),At.updateNodeOpt(t);}}]);}(At);var Zi=/*#__PURE__*/function(_At2){function Zi(t){var _this66;_classCallCheck(this,Zi);_this66=_callSuper(this,Zi,[t]);ot(_this66,"toolsType",pt.LaserPen);ot(_this66,"canRotate",!1);ot(_this66,"scaleType",Qt.none);ot(_this66,"syncTimestamp");ot(_this66,"syncIndex",0);ot(_this66,"tmpPoints",[]);ot(_this66,"workOptions");ot(_this66,"consumeIndex",0);_this66.workOptions=t.toolsOpt,_this66.syncTimestamp=0;return _this66;}_inherits(Zi,_At2);return _createClass(Zi,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Zi,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var r=t.data,n=t.isSubWorker,i=r.workId,l=r.op,o=r.syncUnitTime;if((l==null?void 0:l.length)===0)return{type:dt.None};if(o&&(this.syncUnitTime=o),this.updateTempPoints(l||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:dt.None};var _this$workOptions3=this.workOptions,a=_this$workOptions3.strokeColor,c=_this$workOptions3.thickness,m=_this$workOptions3.strokeType,f=_t(this.tmpPoints,c);var v=!1;var S=this.syncIndex,E=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var T={name:i==null?void 0:i.toString(),opacity:1,lineDash:m===Zt.Dotted?[1,c*2]:m===Zt.LongDotted?[c,c*2]:void 0,strokeColor:a,lineCap:"round",lineWidth:c,anchor:[0.5,0.5]},P=this.getTaskPoints(E);if(P.length){var _h32=Date.now();_h32-this.syncTimestamp>this.syncUnitTime&&(v=!0,this.syncTimestamp=_h32,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:T,tasks:P,isDot:!1,layer:this.drawLayer||this.fullLayer});}var x=[];return this.tmpPoints.slice(S).forEach(function(h){x.push(h.x,h.y);}),_objectSpread({rect:{x:f.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:f.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:f.w*this.fullLayer.worldScaling[0],h:f.h*this.fullLayer.worldScaling[1]},type:dt.DrawWork,dataType:Dt.Local,op:v?x:void 0,index:v?S*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=(l=this.workId)==null?void 0:l.toString();var r;if(this.tmpPoints.length-1>this.consumeIndex){var o=this.tmpPoints.slice(this.consumeIndex);var a=o.length===1,_this$workOptions4=this.workOptions,c=_this$workOptions4.strokeColor,m=_this$workOptions4.thickness,f=_this$workOptions4.strokeType;if(a){var E=this.computDotStroke({point:o[0],radius:m/2});o=E.ps,r=E.rect;}else r=_t(this.tmpPoints,m);var v={name:t==null?void 0:t.toString(),fillColor:a?c:void 0,opacity:1,lineDash:f===Zt.Dotted&&!a?[1,m*2]:f===Zt.LongDotted&&!a?[m,m*2]:void 0,strokeColor:c,lineCap:a?void 0:"round",lineWidth:a?0:m,anchor:[0.5,0.5]},S=this.getTaskPoints(o);S.length&&this.draw({attrs:v,tasks:S,isDot:a,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(o){n.push(o.x,o.y);});var i=ve(n);return _objectSpread({rect:r&&{x:r.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:r.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:r.w*this.fullLayer.worldScaling[0],h:r.h*this.fullLayer.worldScaling[1]},type:dt.FullWork,dataType:Dt.Local,ops:i,index:this.syncIndex*2},this.baseConsumeResult);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var T;var r=t.op,n=t.replaceId,i=t.isFullWork,_this$workOptions5=this.workOptions,l=_this$workOptions5.strokeColor,o=_this$workOptions5.thickness,a=_this$workOptions5.strokeType;if(!r.length){var P=_t(this.tmpPoints,o);return{x:P.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:P.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:P.w*this.fullLayer.worldScaling[0],h:P.h*this.fullLayer.worldScaling[1]};}var c=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var m,f=this.tmpPoints.slice(c);var v=f.length===1;if(v){var _P6=this.computDotStroke({point:f[0],radius:o/2});f=_P6.ps,m=_P6.rect;}else m=_t(this.tmpPoints,o);var S={name:(T=this.workId)==null?void 0:T.toString(),fillColor:v?l:void 0,opacity:1,lineDash:a===Zt.Dotted&&!v?[1,o*2]:a===Zt.LongDotted&&!v?[o,o*2]:void 0,strokeColor:l,lineCap:v?void 0:"round",lineWidth:v?0:o,anchor:[0.5,0.5]},E=this.getTaskPoints(f);if(E.length){var _P7=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:S,tasks:E,isDot:v,replaceId:n,layer:_P7});}return{x:m.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:m.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:m.w*this.fullLayer.worldScaling[0],h:m.h*this.fullLayer.worldScaling[1]};}},{key:"computDotStroke",value:function computDotStroke(t){var r=t.point,n=t.radius,i={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Nt.GetDotStroke(r,n,8),rect:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(r){var i=this.tmpPoints.slice(-1)[0];i&&i.x===t[n]&&i.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new Nt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var _this67=this;var r,n,i,l,o,_iterator18,_step18,_loop5;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:r=t.attrs,n=t.tasks,i=t.isDot,l=t.layer,o=this.workOptions.duration;_iterator18=_createForOfIteratorHelper(n);_context23.prev=2;_loop5=/*#__PURE__*/_regeneratorRuntime().mark(function _loop5(){var a,c,m,f,v,_this67$workOptions,S,E,T,_l$getResolution,P,_x58;return _regeneratorRuntime().wrap(function _loop5$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:a=_step18.value;c=new be(),m=a.pos,f=a.points;i?v=De(f,!0):v=De(f,!1),c.attr(_objectSpread(_objectSpread({},r),{},{pos:m,d:v}));_this67$workOptions=_this67.workOptions,S=_this67$workOptions.vertex,E=_this67$workOptions.fragment;if(S&&E){T=l.renderer.createProgram({vertex:S,fragment:E}),_l$getResolution=l.getResolution(),P=_l$getResolution.width,_x58=_l$getResolution.height;c.setUniforms({u_time:0,u_resolution:[P,_x58]}),c.setProgram(T);}l.appendChild(c),c.transition(o).attr({scale:i?[0.1,0.1]:[1,1],lineWidth:i?0:1}).then(function(){c.remove();});case 6:case"end":return _context22.stop();}},_loop5);});_iterator18.s();case 5:if((_step18=_iterator18.n()).done){_context23.next=9;break;}return _context23.delegateYield(_loop5(),"t0",7);case 7:_context23.next=5;break;case 9:_context23.next=14;break;case 11:_context23.prev=11;_context23.t1=_context23["catch"](2);_iterator18.e(_context23.t1);case 14:_context23.prev=14;_iterator18.f();return _context23.finish(14);case 17:case"end":return _context23.stop();}},_callee21,this,[[2,11,14,17]]);}));function draw(_x57){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var c;var r=[];if(t.length===0)return[];var n=0,i=t[0].x,l=t[0].y,o=[i,l],a=[];for(;n<t.length;){var m=t[n],f=m.x-i,v=m.y-l;if(a.push(new Nt(f,v)),n>0&&n<t.length-1){var S=t[n].getAngleByPoints(t[n-1],t[n+1]);if(S<60||S>300){var E=(c=a.pop())==null?void 0:c.clone();E&&r.push({pos:o,points:[].concat(_toConsumableArray(a),[E])}),i=t[n].x,l=t[n].y,o=[i,l];var T=m.x-i,P=m.y-l;a=[new Nt(T,P)];}}n++;}return r.push({pos:o,points:a}),r;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var r;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(i){if(i.name===t){var l=i.getBoundingClientRect();r=bt(r,{x:l.x,y:l.y,w:l.width,h:l.height}),n.push(i);}}),n.length&&n.forEach(function(i){return i.remove();}),r;}}]);}(At);var r0=Cr;Cr.polyline=Cr;Cr.polygon=n0;function Cr(u,e,t){var r=u.length,n=Ge(u[0],e),i=[],l,o,a,c,m;for(t||(t=[]),l=1;l<r;l++){for(o=u[l-1],a=u[l],c=m=Ge(a,e);;)if(n|c){if(n&c)break;n?(o=Zr(o,a,n,e),n=Ge(o,e)):(a=Zr(o,a,c,e),c=Ge(a,e));}else{i.push(o),c!==m?(i.push(a),l<r-1&&(t.push(i),i=[])):l===r-1&&i.push(a);break;}n=m;}return i.length&&t.push(i),t;}function n0(u,e){var t,r,n,i,l,o,a;for(r=1;r<=8;r*=2){for(t=[],n=u[u.length-1],i=!(Ge(n,e)&r),l=0;l<u.length;l++)o=u[l],a=!(Ge(o,e)&r),a!==i&&t.push(Zr(n,o,r,e)),a&&t.push(o),n=o,i=a;if(u=t,!u.length)break;}return t;}function Zr(u,e,t,r){return t&8?[u[0]+(e[0]-u[0])*(r[3]-u[1])/(e[1]-u[1]),r[3]]:// top
404
- t&4?[u[0]+(e[0]-u[0])*(r[1]-u[1])/(e[1]-u[1]),r[1]]:// bottom
405
- t&2?[r[2],u[1]+(e[1]-u[1])*(r[2]-u[0])/(e[0]-u[0])]:// right
406
- t&1?[r[0],u[1]+(e[1]-u[1])*(r[0]-u[0])/(e[0]-u[0])]:// left
407
- null;}function Ge(u,e){var t=0;return u[0]<e[0]?t|=1:u[0]>e[2]&&(t|=2),u[1]<e[1]?t|=4:u[1]>e[3]&&(t|=8),t;}var un=/* @__PURE__ */Ne(r0);var Ve=/*#__PURE__*/function(_At3){function Ve(t,r){var _this68;_classCallCheck(this,Ve);_this68=_callSuper(this,Ve,[t]);ot(_this68,"canRotate",!1);ot(_this68,"scaleType",Qt.none);ot(_this68,"toolsType",pt.Eraser);ot(_this68,"serviceWork");ot(_this68,"tmpPoints",[]);ot(_this68,"workOptions");ot(_this68,"worldPosition");ot(_this68,"worldScaling");ot(_this68,"eraserRect");ot(_this68,"eraserPolyline");_this68.serviceWork=r,_this68.workOptions=t.toolsOpt,_this68.worldPosition=_this68.fullLayer.worldPosition,_this68.worldScaling=_this68.fullLayer.worldScaling;return _this68;}_inherits(Ve,_At3);return _createClass(Ve,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Ve,"setWorkOptions",this,3)([t]);}},{key:"createEraserRect",value:function createEraserRect(t){var r=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],_Ve$eraserSizes$this$=Ve.eraserSizes[this.workOptions.thickness],i=_Ve$eraserSizes$this$.width,l=_Ve$eraserSizes$this$.height;this.eraserRect={x:r-i*0.5,y:n-l*0.5,w:i,h:l},this.eraserPolyline=[this.eraserRect.x,this.eraserRect.y,this.eraserRect.x+this.eraserRect.w,this.eraserRect.y+this.eraserRect.h];}},{key:"computRectCenterPoints",value:function computRectCenterPoints(){var t=this.tmpPoints.slice(-2);if(this.tmpPoints.length===4){var r=new at(this.tmpPoints[0],this.tmpPoints[1]),n=new at(this.tmpPoints[2],this.tmpPoints[3]),i=at.Sub(n,r).uni(),l=at.Dist(r,n),_Ve$eraserSizes$this$2=Ve.eraserSizes[this.workOptions.thickness],o=_Ve$eraserSizes$this$2.width,a=_Ve$eraserSizes$this$2.height,c=Math.min(o,a),m=Math.round(l/c);if(m>1){var f=[];for(var v=0;v<m;v++){var S=at.Mul(i,v*c);f.push(this.tmpPoints[0]+S.x,this.tmpPoints[1]+S.y);}return f.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,r){var n=new at(t[0],t[1]),i=new at(r[0],r[1]),_Ve$eraserSizes$this$3=Ve.eraserSizes[this.workOptions.thickness],l=_Ve$eraserSizes$this$3.width,o=_Ve$eraserSizes$this$3.height;return at.Dist(n,i)<Math.hypot(l,o)*0.5;}},{key:"remove",value:function remove(t){var _this69=this;var r=t.curNodeMap,n=t.removeIds;var i;var _iterator19=_createForOfIteratorHelper(r.values()),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var l=_step19.value;if(l.rect&&this.eraserRect&&this.eraserPolyline&&Jr(this.eraserRect,l.rect)){var o=l.op,a=[],c=[];for(var f=0;f<o.length;f+=3){var v=new at(o[f]*this.worldScaling[0]+this.worldPosition[0],o[f+1]*this.worldScaling[1]+this.worldPosition[1],o[f+2]);c.push(v),a.push(new Nt(v.x,v.y));}var m=a.length&&_t(a)||l.rect;Jr(m,this.eraserRect)&&(c.length>1?un.polyline(c.map(function(v){return v.XY;}),this.eraserPolyline).length&&n.add(l.name):n.add(l.name),i=bt(i,l.rect||m));}}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return n.forEach(function(l){var a;var o=_this69.fullLayer.getElementsByName(l);o[0]&&(o[0].remove(),_pe(o[0],_this69.fullLayer.parent),(a=_this69.vNodes)==null||a["delete"](l));}),i&&(i.x-=At.SafeBorderPadding,i.y-=At.SafeBorderPadding,i.w+=At.SafeBorderPadding*2,i.h+=At.SafeBorderPadding*2),i;}},{key:"consume",value:function consume(t){var _t$data2=t.data,r=_t$data2.op,n=_t$data2.disableEraseImage,i=_t$data2.disableEraseText;if(!r||r.length===0)return _objectSpread({type:dt.None},this.baseConsumeResult);var l=this.tmpPoints.length;if(l>1&&this.isNear([r[0],r[1]],[this.tmpPoints[l-2],this.tmpPoints[l-1]]))return _objectSpread({type:dt.None},this.baseConsumeResult);l<3?this.tmpPoints.push(r[0],r[1]):this.tmpPoints.splice(2,2,r[0],r[1]);var o=this.computRectCenterPoints();var a;var c=/* @__PURE__ */new Set();if(!this.vNodes)return _objectSpread({type:dt.None},this.baseConsumeResult);var m=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap,{disableEraseImage:n,disableEraseText:i}));for(var f=0;f<o.length-1;f+=2){this.createEraserRect(o.slice(f,f+2));var v=this.remove({curNodeMap:m,removeIds:c});a=bt(a,v);}return a&&c.size?{type:dt.RemoveNode,rect:a,removeIds:_toConsumableArray(c)}:_objectSpread({type:dt.None},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getCanEraserNodeMap",value:function getCanEraserNodeMap(t){var r;if(this.serviceWork){var n=new Map(t),i=this.serviceWork.selectorWorkShapes,l=this.serviceWork.workShapes;var _iterator20=_createForOfIteratorHelper(i.values()),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var o=_step20.value;if((r=o.selectIds)!=null&&r.length){var _iterator22=_createForOfIteratorHelper(o.selectIds),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var a=_step22.value;n["delete"](a);}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}var _iterator21=_createForOfIteratorHelper(l.keys()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _o4=_step21.value;n["delete"](_o4);}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}return n;}return t;}}]);}(At);// 来源于white-sdk
408
- ot(Ve,"eraserSizes",fn);var Ir=Ve;var i0="__lodash_hash_undefined__";function s0(u){return this.__data__.set(u,i0),this;}var o0=s0;function a0(u){return this.__data__.has(u);}var l0=a0,c0=Si,f0=o0,h0=l0;function Or(u){var e=-1,t=u==null?0:u.length;for(this.__data__=new c0();++e<t;)this.add(u[e]);}Or.prototype.add=Or.prototype.push=f0;Or.prototype.has=h0;var dn=Or;function u0(u,e){for(var t=-1,r=u==null?0:u.length;++t<r;)if(e(u[t],t,u))return!0;return!1;}var d0=u0;function p0(u,e){return u.has(e);}var pn=p0,m0=dn,v0=d0,y0=pn,g0=1,P0=2;function S0(u,e,t,r,n,i){var l=t&g0,o=u.length,a=e.length;if(o!=a&&!(l&&a>o))return!1;var c=i.get(u),m=i.get(e);if(c&&m)return c==e&&m==u;var f=-1,v=!0,S=t&P0?new m0():void 0;for(i.set(u,e),i.set(e,u);++f<o;){var E=u[f],T=e[f];if(r)var P=l?r(T,E,f,e,u,i):r(E,T,f,u,e,i);if(P!==void 0){if(P)continue;v=!1;break;}if(S){if(!v0(e,function(x,h){if(!y0(S,h)&&(E===x||n(E,x,t,r,i)))return S.push(h);})){v=!1;break;}}else if(!(E===T||n(E,T,t,r,i))){v=!1;break;}}return i["delete"](u),i["delete"](e),v;}var Ji=S0;function x0(u){var e=-1,t=Array(u.size);return u.forEach(function(r,n){t[++e]=[n,r];}),t;}var T0=x0;function C0(u){var e=-1,t=Array(u.size);return u.forEach(function(r){t[++e]=r;}),t;}var mn=C0,Kn=ur,Zn=ji,I0=qr,O0=Ji,E0=T0,M0=mn,A0=1,w0=2,L0="[object Boolean]",R0="[object Date]",D0="[object Error]",b0="[object Map]",N0="[object Number]",B0="[object RegExp]",W0="[object Set]",F0="[object String]",U0="[object Symbol]",j0="[object ArrayBuffer]",Y0="[object DataView]",Jn=Kn?Kn.prototype:void 0,Yr=Jn?Jn.valueOf:void 0;function X0(u,e,t,r,n,i,l){switch(t){case Y0:if(u.byteLength!=e.byteLength||u.byteOffset!=e.byteOffset)return!1;u=u.buffer,e=e.buffer;case j0:return!(u.byteLength!=e.byteLength||!i(new Zn(u),new Zn(e)));case L0:case R0:case N0:return I0(+u,+e);case D0:return u.name==e.name&&u.message==e.message;case B0:case F0:return u==e+"";case b0:var o=E0;case W0:var a=r&A0;if(o||(o=M0),u.size!=e.size&&!a)return!1;var c=l.get(u);if(c)return c==e;r|=w0,l.set(u,e);var m=O0(o(u),o(e),r,n,i,l);return l["delete"](u),m;case U0:if(Yr)return Yr.call(u)==Yr.call(e);}return!1;}var z0=X0,Qn=Wi,$0=1,G0=Object.prototype,k0=G0.hasOwnProperty;function H0(u,e,t,r,n,i){var l=t&$0,o=Qn(u),a=o.length,c=Qn(e),m=c.length;if(a!=m&&!l)return!1;for(var f=a;f--;){var v=o[f];if(!(l?v in e:k0.call(e,v)))return!1;}var S=i.get(u),E=i.get(e);if(S&&E)return S==e&&E==u;var T=!0;i.set(u,e),i.set(e,u);for(var P=l;++f<a;){v=o[f];var x=u[v],h=e[v];if(r)var p=l?r(h,x,v,e,u,i):r(x,h,v,u,e,i);if(!(p===void 0?x===h||n(x,h,t,r,i):p)){T=!1;break;}P||(P=v=="constructor");}if(T&&!P){var d=u.constructor,g=e.constructor;d!=g&&"constructor"in u&&"constructor"in e&&!(typeof d=="function"&&d instanceof d&&typeof g=="function"&&g instanceof g)&&(T=!1);}return i["delete"](u),i["delete"](e),T;}var V0=H0,Xr=xi,K0=Ji,Z0=z0,J0=V0,qn=Fr,_n=pr,ti=tn,Q0=Ai,q0=1,ei="[object Arguments]",ri="[object Array]",gr="[object Object]",_0=Object.prototype,ni=_0.hasOwnProperty;function tm(u,e,t,r,n,i){var l=_n(u),o=_n(e),a=l?ri:qn(u),c=o?ri:qn(e);a=a==ei?gr:a,c=c==ei?gr:c;var m=a==gr,f=c==gr,v=a==c;if(v&&ti(u)){if(!ti(e))return!1;l=!0,m=!1;}if(v&&!m)return i||(i=new Xr()),l||Q0(u)?K0(u,e,t,r,n,i):Z0(u,e,a,t,r,n,i);if(!(t&q0)){var S=m&&ni.call(u,"__wrapped__"),E=f&&ni.call(e,"__wrapped__");if(S||E){var T=S?u.value():u,P=E?e.value():e;return i||(i=new Xr()),n(T,P,t,r,i);}}return v?(i||(i=new Xr()),J0(u,e,t,r,n,i)):!1;}var em=tm,rm=em,ii=Le;function Qi(u,e,t,r,n){return u===e?!0:u==null||e==null||!ii(u)&&!ii(e)?u!==u&&e!==e:rm(u,e,t,r,Qi,n);}var nm=Qi,im=nm;function sm(u,e){return im(u,e);}var om=sm,Me=/* @__PURE__ */Ne(om);function si(u,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;return"rgba(".concat(u,",").concat(e,",").concat(t,",").concat(r,")");}function am(u){var e=u.split(","),t=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),n=parseInt(e[2]),i=Number(e[3].split(")")[0]);return[t,r,n,i];}var Lr=/*#__PURE__*/function(_At4){function Lr(t){var _this70;_classCallCheck(this,Lr);_this70=_callSuper(this,Lr,[t]);ot(_this70,"toolsType",pt.Selector);ot(_this70,"tmpPoints",[]);ot(_this70,"subTmpPoints",[]);ot(_this70,"workOptions");ot(_this70,"vNodes");ot(_this70,"selectIds");ot(_this70,"selectorColor");ot(_this70,"strokeColor");ot(_this70,"fillColor");ot(_this70,"oldSelectRect");ot(_this70,"oldSubSelectRect");ot(_this70,"canRotate",!1);ot(_this70,"canTextEdit",!1);ot(_this70,"canLock",!1);ot(_this70,"scaleType",Qt.all);ot(_this70,"toolsTypes");ot(_this70,"shapeOpt");ot(_this70,"textOpt");ot(_this70,"isLocked");ot(_this70,"thickness");ot(_this70,"strokeType");ot(_this70,"useStroke");_this70.workOptions=t.toolsOpt,_this70.vNodes=t.vNodes;return _this70;}_inherits(Lr,_At4);return _createClass(Lr,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var r=_t(this.tmpPoints);if(r.w===0||r.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(r,t),n=_this$vNodes$getRectI.rectRange,i=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(i.keys()),intersectRect:n,subNodeMap:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length,n=t.length;if(n>1){var i=new Nt(t[n-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[n-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);r===2?this.tmpPoints.splice(1,1,i):this.tmpPoints.push(i);}}},{key:"drawSelector",value:function drawSelector(t){var _this71=this;var r=t.drawRect,n=t.subNodeMap,i=t.selectorId,l=t.layer,o=t.isService,a=new ye({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:i,name:i,zIndex:9999}),c=[];if(o){var m=new xn({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:Lr.selectorBorderId});c.push(m);}n.forEach(function(m,f){var v=[m.rect.x+m.rect.w/2-r.x,m.rect.y+m.rect.h/2-r.y],S=new xn({normalize:!0,pos:v,lineWidth:1,strokeColor:n.size>1?_this71.selectorColor||_this71.workOptions.strokeColor:void 0,width:m.rect.w,height:m.rect.h,id:"selector-".concat(f),name:"selector-".concat(f)});c.push(S);}),c&&a.append.apply(a,c),(l==null?void 0:l.parent).appendChild(a);}},{key:"draw",value:function draw(t,r,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var a,c;var l=n.intersectRect,o=n.subNodeMap;(c=(a=r.parent)==null?void 0:a.getElementById(t))==null||c.remove(),l&&this.drawSelector({drawRect:l,subNodeMap:o,selectorId:t,layer:r,isService:i});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=Qt.all,this.canRotate=!1,this.textOpt=void 0,this.strokeColor=void 0,this.fillColor=void 0,this.canTextEdit=!1,this.canLock=!1,this.isLocked=!1,this.toolsTypes=void 0,this.shapeOpt=void 0,this.thickness=void 0,this.strokeType=void 0,this.useStroke=!1;var r=/* @__PURE__ */new Set();var n,i=!0;var _iterator23=_createForOfIteratorHelper(t.values()),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var l=_step23.value;var o=l.opt,a=l.canRotate,c=l.scaleType,m=l.toolsType;this.selectorColor=this.workOptions.strokeColor,o.strokeColor&&(this.strokeColor=o.strokeColor),o.fillColor&&(this.fillColor=o.fillColor),o.textOpt&&(this.textOpt=o.textOpt),o.thickness&&(this.thickness=o.thickness),m!==pt.Pencil&&(i=!1),o.strokeType&&(this.strokeType=o.strokeType),m===pt.SpeechBalloon&&(r.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=o.placement),m===pt.Polygon&&(r.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices),m===pt.Star&&(r.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=o.vertices,this.shapeOpt.innerRatio=o.innerRatio,this.shapeOpt.innerVerticeStep=o.innerVerticeStep),m===pt.Text&&(this.textOpt=o),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=a,this.scaleType=c),m===pt.Image&&(n=l),(c===Qt.proportional&&this.scaleType!==Qt.none||c===Qt.none)&&(this.scaleType=c);}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}i&&(this.useStroke=!0),r.size&&(this.toolsTypes=_toConsumableArray(r)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=Qt.none,this.canRotate=!1,this.textOpt=void 0,this.fillColor=void 0,this.selectorColor="rgb(177,177,177)",this.strokeColor=void 0,this.canTextEdit=!1,this.thickness=void 0,this.strokeType=void 0,this.useStroke=void 0)):t.size>1&&!n.opt.locked&&(this.canLock=!1,this.canRotate=!1));}},{key:"getChildrenPoints",value:function getChildrenPoints(){var t,r;if(this.scaleType===Qt.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],i=(r=this.vNodes.get(n))==null?void 0:r.op;if(i){var l=[];for(var o=0;o<i.length;o+=3)l.push([i[o],i[o+1]]);return l;}}}},{key:"consume",value:function consume(t){if(t.isSubWorker)return this.subWorkerConsume(t);var r=_objectSpread({type:dt.Select,dataType:Dt.Local},this.baseConsumeResult);if(t.isSimpleWorker){var m=this.subWorkerConsume(t);r.subRect=m.rect;}var _t$data3=t.data,n=_t$data3.op,i=_t$data3.workState;var l=this.oldSelectRect;if(i===Ft.Start&&(l=this.unSelectedAllIds()),!(n!=null&&n.length)||!this.vNodes.curNodeMap.size)return t.isSimpleWorker?r:{type:dt.None};this.updateTempPoints(n);var o=this.computSelector();if(this.selectIds&&Me(this.selectIds,o.selectIds))return t.isSimpleWorker?r:{type:dt.None};this.selectIds=o.selectIds;var a=o.intersectRect;this.getSelecteorInfo(o.subNodeMap),this.draw(qt,this.fullLayer,o),this.oldSelectRect=a;var c=this.getChildrenPoints();return r=_objectSpread(_objectSpread({},r),{},{rect:bt(a,l),selectIds:o.selectIds,selectRect:a,selectorColor:this.selectorColor,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:c,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType}),r;}},{key:"consumeAll",value:function consumeAll(){var r,n;var t=this.oldSelectRect;if(!((r=this.selectIds)!=null&&r.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,qt,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var i=this.getChildrenPoints();return _objectSpread({type:dt.Select,dataType:Dt.Local,rect:this.oldSelectRect,selectIds:this.selectIds,selectorColor:this.selectorColor,selectRect:this.oldSelectRect,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:i,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}return{type:dt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPointsForSubWorker",value:function updateTempPointsForSubWorker(t){var r=t.slice(-2),n=new Nt(r[0],r[1]);if(this.subTmpPoints[0].isNear(n,1))return!1;if(this.subTmpPoints.length===2){if(n.isNear(this.subTmpPoints[1],1))return!1;this.subTmpPoints[1]=n;}else this.subTmpPoints.push(n);return!0;}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=this.workOptions.thickness,n=[];var _iterator24=_createForOfIteratorHelper(t),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var o=_step24.value;n.push(_construct(at,_toConsumableArray(o)));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}var i=_t(n,r),l=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:l,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"drawForSubWorker",value:function drawForSubWorker(t){var r=t.workId,n=t.layer,i=t.ps,_this$workOptions6=this.workOptions,l=_this$workOptions6.strokeColor,o=_this$workOptions6.scale,a=_this$workOptions6.rotate,c=_this$workOptions6.translate,m=n.worldPosition,f=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(i),v=_this$computDrawPoint2.points,S=_this$computDrawPoint2.rect,E=_this$computDrawPoint2.pos,T=1/n.worldScaling[0],P=l&&am(l)||[0,0,0,0],x={close:!0,normalize:!0,points:v,lineWidth:T,fillColor:si(P[0],P[1],P[2],0.1),strokeColor:si(P[0],P[1],P[2],1),lineJoin:"round",lineCap:"round"};var h={x:Math.floor(S.x*f[0]+m[0]-At.SafeBorderPadding),y:Math.floor(S.y*f[1]+m[1]-At.SafeBorderPadding),w:Math.floor(S.w*f[0]+2*At.SafeBorderPadding),h:Math.floor(S.h*f[0]+2*At.SafeBorderPadding)};var p=new ye({name:r,id:r,pos:E,anchor:[0.5,0.5],size:[S.w,S.h],scale:o,rotate:a,translate:c}),d=new we(_objectSpread(_objectSpread({},x),{},{pos:[0,0]}));if(p.appendChild(d),this.replace(n,r,p),o||a||c){var g=p.getBoundingClientRect();h={x:Math.floor(g.x-At.SafeBorderPadding),y:Math.floor(g.y-At.SafeBorderPadding),w:Math.floor(g.width+2*At.SafeBorderPadding),h:Math.floor(g.height+2*At.SafeBorderPadding)};}return h;}},{key:"transformData",value:function transformData(t){var r=_t(t);return[[r.x,r.y,0],[r.x+r.w,r.y,0],[r.x+r.w,r.y+r.h,0],[r.x,r.y+r.h,0]];}},{key:"subWorkerConsume",value:function subWorkerConsume(t){var r=t.data,n=t.isFullWork,i=r.op,l=r.syncUnitTime;l&&(this.syncUnitTime=l);var o=i==null?void 0:i.length;if(!o||o<2)return{type:dt.None,rect:void 0};var a;if(this.subTmpPoints.length===0?(this.subTmpPoints=[new Nt(i[0],i[1])],a=!1):a=this.updateTempPointsForSubWorker(i),!a)return{type:dt.None,rect:void 0};var c=this.transformData(this.subTmpPoints),m=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.drawForSubWorker({ps:c,workId:this.workId,layer:m}),v=bt(f,this.oldSubSelectRect);return this.oldSubSelectRect=f,_objectSpread({rect:v,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);}},{key:"subWorkerConsumeAll",value:function subWorkerConsumeAll(t){var r=t.isFullWork,n=r?this.fullLayer:this.drawLayer||this.fullLayer;return this.replace(n,this.workId),_objectSpread({rect:this.oldSelectRect,type:dt.FullWork,dataType:Dt.Local},this.baseConsumeResult);}},{key:"clearSubTmpPoints",value:function clearSubTmpPoints(){this.subTmpPoints.length=0;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.clearSubTmpPoints();}},{key:"clearSubSelectData",value:function clearSubSelectData(){this.oldSubSelectRect=void 0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0,this.clearSubSelectData();}},{key:"selectSingleTool",value:function selectSingleTool(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:qt;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var i=t[0],l=t[1];var o;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:i,y:l,w:0,h:0},!1),a=_this$vNodes$getRectI2.nodeRange,c=_toConsumableArray(a.values()).sort(function(m,f){return(f.opt.zIndex||0)-(m.opt.zIndex||0);});var _iterator25=_createForOfIteratorHelper(c),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _m11=_step25.value;var _f5=this.fullLayer.getElementsByName(_m11.name);if(os(_f5).find(function(S){return S.isPointCollision(i,l);})){o=_m11;break;}}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}if(o){var m=o.name;if(!Me(this.oldSelectRect,o.rect)){var f=/* @__PURE__ */new Map([[m,o]]);this.getSelecteorInfo(f),this.draw(r,this.fullLayer,{intersectRect:o.rect,subNodeMap:f,selectIds:this.selectIds||[]},n);}this.selectIds=[m],this.oldSelectRect=o.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator26=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _step26$value=_slicedToArray(_step26.value,2),r=_step26$value[0],n=_step26$value[1];n.isSelected&&(t=bt(t,n.rect),this.vNodes.unSelected(r));}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var r;var _iterator27=_createForOfIteratorHelper(t),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var n=_step27.value;var i=this.vNodes.get(n);i&&i.isSelected&&(r=bt(r,i.rect),this.vNodes.unSelected(n));}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return r;}},{key:"selectedByIds",value:function selectedByIds(t){var r;var _iterator28=_createForOfIteratorHelper(t),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var n=_step28.value;var i=this.vNodes.get(n);i&&(r=bt(r,i.rect),this.vNodes.selected(n));}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"getSelectorRect",value:function getSelectorRect(t,r){var o;var n;var i=(o=t.parent)==null?void 0:o.getElementById(r),l=i==null?void 0:i.getBoundingClientRect();return l&&(n=bt(n,{x:Math.floor(l.x),y:Math.floor(l.y),w:Math.floor(l.width+1),h:Math.floor(l.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===pt.Ellipse||t===pt.Triangle||t===pt.Rectangle||t===pt.Polygon||t===pt.Star||t===pt.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var r,n,i,l,o,a,c,m,f,v,S,E,T,P,x,h,_iterator29,_step29,g,O,w,L,B,A,b,W,D,R,X,p,_g12,_O8,_w6,d;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:r=t.updateSelectorOpt,n=t.selectIds,i=t.vNodes,l=t.willSerializeData,o=t.worker,a=t.offset,c=this.fullLayer;if(c){_context24.next=3;break;}return _context24.abrupt("return");case 3:f=/* @__PURE__ */new Map(),v=r.originPoint,S=r.workState,E=r.angle,T=r.translate,P=r.dir,x=r.scale;a&&(T?r.translate=[T[0]+a[0],T[1]+a[1]]:r.translate=a);if(!(v||T||he(E))){_context24.next=10;break;}if(!(S===Ft.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(i.setTargetAssignKeys(n),{type:dt.Select,dataType:Dt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:if(!(h=i.getLastTarget(),!h)){_context24.next=10;break;}return _context24.abrupt("return");case 10:if(!n){_context24.next=62;break;}_iterator29=_createForOfIteratorHelper(n);_context24.prev=12;_iterator29.s();case 14:if((_step29=_iterator29.n()).done){_context24.next=54;break;}g=_step29.value;O=i.get(g);if(!O){_context24.next=52;break;}w=O.toolsType,L=O.opt,B=(c==null?void 0:c.getElementsByName(g))[0];if(!B){_context24.next=52;break;}A=_objectSpread({},r);b=void 0;W=At.isWillRefresh({toolsType:w,opt:L,updateOpt:A,vNodes:i,node:B,willSerializeData:l});if(!w){_context24.next=52;break;}b=h==null?void 0:h.get(g);D=ss(w);if(!(D==null||D.updateNodeOpt({node:B,opt:A,vNodes:i,willSerializeData:l,targetNode:b}),O&&o&&W)){_context24.next=51;break;}R=o.createWorkShapeNode({workId:g,toolsType:w,toolsOpt:O.opt});R==null||R.setWorkId(g);X=void 0;if(!(w===pt.Image)){_context24.next=36;break;}_context24.next=33;return R.consumeServiceAsync({isFullWork:!0,replaceId:g,worker:o});case 33:X=_context24.sent;_context24.next=50;break;case 36:if(!(w===pt.Text)){_context24.next=42;break;}_context24.next=39;return R.consumeServiceAsync({isFullWork:!0,replaceId:g});case 39:X=_context24.sent;_context24.next=50;break;case 42:_context24.prev=42;X=R==null?void 0:R.consumeService({op:O.op,isFullWork:!0,replaceId:g,workState:S});_context24.next=50;break;case 46:_context24.prev=46;_context24.t0=_context24["catch"](42);console.error("consumeService error",_context24.t0);return _context24.abrupt("continue",52);case 50:X&&(O.rect=X);case 51:O&&(f.set(g,O),m=bt(m,O.rect));case 52:_context24.next=14;break;case 54:_context24.next=59;break;case 56:_context24.prev=56;_context24.t1=_context24["catch"](12);_iterator29.e(_context24.t1);case 59:_context24.prev=59;_iterator29.f();return _context24.finish(59);case 62:h&&S===Ft.Done&&(i.deleteLastTarget(),h=void 0);p=m;if(!(v&&T&&x&&P&&p&&!a)){_context24.next=82;break;}_g12=[[p.x,p.y],[p.x+p.w,p.y],[p.x+p.w,p.y+p.h],[p.x,p.y+p.h]];_context24.t2=P;_context24.next=_context24.t2==="top"?69:_context24.t2==="topLeft"?69:_context24.t2==="left"?69:_context24.t2==="topRight"?71:_context24.t2==="right"?73:_context24.t2==="bottomRight"?73:_context24.t2==="bottom"?73:_context24.t2==="bottomLeft"?75:77;break;case 69:T[0]>0&&T[1]>0?_O8=_g12[0]:T[0]>0?_O8=_g12[3]:T[1]>0?_O8=_g12[1]:_O8=_g12[2];return _context24.abrupt("break",77);case 71:T[0]<0&&T[1]>0?_O8=_g12[1]:T[0]<0?_O8=_g12[2]:T[1]>0?_O8=_g12[0]:_O8=_g12[3];return _context24.abrupt("break",77);case 73:T[0]<0&&T[1]<0?_O8=_g12[2]:T[0]<0?_O8=_g12[1]:T[1]<0?_O8=_g12[3]:_O8=_g12[0];return _context24.abrupt("break",77);case 75:T[0]>0&&T[1]<0?_O8=_g12[3]:T[0]>0?_O8=_g12[0]:T[1]<0?_O8=_g12[2]:_O8=_g12[1];return _context24.abrupt("break",77);case 77:_w6=_O8&&[v[0]-_O8[0],v[1]-_O8[1]]||[0,0];if(Me(_w6,[0,0])){_context24.next=82;break;}_context24.next=81;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{workState:S},offset:_w6}));case 81:return _context24.abrupt("return",_context24.sent);case 82:this.getSelecteorInfo(f),this.draw(qt,c,{selectIds:n||[],subNodeMap:f,intersectRect:p});d=bt(this.oldSelectRect,p);return _context24.abrupt("return",(this.oldSelectRect=p,{type:dt.Select,dataType:Dt.Local,selectRect:p,renderRect:m,rect:bt(d,p),selectIds:n}));case 85:case"end":return _context24.stop();}},_callee22,this,[[12,56,59,62],[42,46]]);}));function updateSelector(_x59){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:dt.Select,dataType:Dt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(Je,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,r,n){var _this72=this;var i=r.selectIds,l=this.getRightServiceId(t),o=this.getSelectorRect(this.fullLayer,l);var a;var c=/* @__PURE__ */new Map();return i==null||i.forEach(function(m){var f=_this72.vNodes.get(m);f&&(a=bt(a,f.rect),c.set(m,f));}),this.getSelecteorInfo(c),this.draw(l,this.fullLayer,{intersectRect:a,selectIds:i||[],subNodeMap:c},n),bt(a,o);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this73=this;var n;var t;var r=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(i){var l=_this73.vNodes.get(i);l&&(t=bt(t,l.rect),r.set(i,l));},this),this.getSelecteorInfo(r),this.draw(qt,this.fullLayer,{intersectRect:t,subNodeMap:r,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var l;var r;var n=(l=this.selectIds)==null?void 0:l.filter(function(o){return!t.includes(o);});if(n!=null&&n.length&&(r=this.unSelectedByIds(n)),t.length){var o=this.selectedByIds(t);r=bt(r,o);}this.selectIds=t;var i=this.reRenderSelector();return{bgRect:r,selectRect:i};}},{key:"cursorHover",value:function cursorHover(t){var l,o;var r=this.oldSelectRect;this.selectIds=[];var n=(l=this.workId)==null?void 0:l.toString(),i=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(i,n,!0),this.oldSelectRect&&!Me(r,this.oldSelectRect))return{type:dt.CursorHover,dataType:Dt.Local,rect:bt(r,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((o=this.selectIds)!=null&&o.length||(this.oldSelectRect=void 0),r&&!this.oldSelectRect)return this.cursorBlur(),{type:dt.CursorHover,dataType:Dt.Local,rect:r,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var r,n;this.selectIds=[];var t=(r=this.workId)==null?void 0:r.toString();((n=this.fullLayer)==null?void 0:n.parent).children.forEach(function(i){i.name===t&&i.remove();});}}]);}(At);ot(Lr,"selectorBorderId","selector-border");var ar=Lr;var qi=/*#__PURE__*/function(_At5){function qi(t){var _this74;_classCallCheck(this,qi);_this74=_callSuper(this,qi,[t]);ot(_this74,"canRotate",!1);ot(_this74,"scaleType",Qt.both);ot(_this74,"toolsType",pt.Arrow);ot(_this74,"tmpPoints",[]);ot(_this74,"workOptions");ot(_this74,"oldRect");ot(_this74,"arrowTipWidth");ot(_this74,"syncTimestamp");_this74.workOptions=t.toolsOpt,_this74.arrowTipWidth=_this74.workOptions.thickness*4,_this74.syncTimestamp=0,_this74.syncUnitTime=50;return _this74;}_inherits(qi,_At5);return _createClass(qi,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=t.isSimpleWorker,c=this.workId,m=r.op,f=r.syncUnitTime;f&&(this.syncUnitTime=f);var v=m==null?void 0:m.length;if(!v||v<2)return{type:dt.None};var S;if(this.tmpPoints.length===0?(this.tmpPoints=[new Nt(m[0],m[1])],S=!1):S=this.updateTempPoints(m),!S)return{type:dt.None};var E;if(i||l||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:c,layer:P});}if(a){var _P8=bt(E,this.oldRect);this.oldRect=E;var _x60=_objectSpread({rect:_P8,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);if(o){var _h33=Date.now();_h33-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_h33,_x60.op=this.tmpPoints.map(function(p){return[].concat(_toConsumableArray(p.XY),[0]);}).flat(1),_x60.index=0,_x60.isSync=!0);}return _x60;}if(!i&&o){var _P9=Date.now();return _P9-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P9,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:Dt.Local,op:this.tmpPoints.map(function(x){return[].concat(_toConsumableArray(x.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:dt.None};}var T=bt(E,this.oldRect);return this.oldRect=E,_objectSpread(_objectSpread({rect:T},this.baseConsumeResult),{},{type:dt.DrawWork,dataType:Dt.Local});}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ve(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:At.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:dt.FullWork,dataType:Dt.Local,ops:l,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawEraserlines,_this$workOptions7=this.workOptions,l=_this$workOptions7.strokeColor,o=_this$workOptions7.thickness,a=_this$workOptions7.zIndex,c=_this$workOptions7.scale,m=_this$workOptions7.rotate,f=_this$workOptions7.translate,v=_this$workOptions7.strokeType,S=_this$workOptions7.eraserlines,E=n.worldPosition,T=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(o),P=_this$computDrawPoint3.points,x=_this$computDrawPoint3.pos,h=_this$computDrawPoint3.rect,p=_this$computDrawPoint3.isTriangle,d=_this$computDrawPoint3.trianglePoints,g=_this$computDrawPoint3.trianglePos,O=[h.x+h.w/2,h.y+h.h/2],w={pos:O,name:r,id:r,zIndex:a,anchor:[0.5,0.5],size:[h.w,h.h]};c&&(w.scale=c),m&&(w.rotate=m),f&&(w.translate=f);var L=new ye(w),B={points:d,pos:[g[0]-O[0],g[1]-O[1]],fillColor:l,strokeColor:l,lineWidth:0,normalize:!1},A=new we(B);if(L.append(A),!p&&P&&x){var W={points:P,pos:[x[0]-O[0],x[1]-O[1]],fillColor:l,strokeColor:l,lineDash:v===Zt.Dotted&&!p?[1,o*2]:v===Zt.LongDotted&&!p?[o,o*2]:void 0,lineCap:v===Zt.Normal?void 0:"round",lineWidth:o,normalize:!1},D=new we(W);L.append(D);}S&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:L,eraserlines:S,pos:O,layer:n},i)),this.replace(n,r,L);var b={x:Math.floor(h.x*T[0]+E[0]-At.SafeBorderPadding),y:Math.floor(h.y*T[1]+E[1]-At.SafeBorderPadding),w:Math.floor(h.w*T[0]+2*At.SafeBorderPadding),h:Math.floor(h.h*T[1]+2*At.SafeBorderPadding)};if(c||m||f){var _W9=L.getBoundingClientRect();b={x:Math.floor(_W9.x-At.SafeBorderPadding),y:Math.floor(_W9.y-At.SafeBorderPadding),w:Math.floor(_W9.width+At.SafeBorderPadding*2),h:Math.floor(_W9.height+At.SafeBorderPadding*2)};}return this.isDelete&&L.setAttribute("opacity",0),b;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.arrowTipWidth?this.computFullArrowPoints(t):this.computTrianglePoints();}},{key:"computFullArrowPoints",value:function computFullArrowPoints(t){var _this75=this;var r=at.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=at.Per(r).mul(t/2),i=Nt.Sub(this.tmpPoints[0],n),l=Nt.Add(this.tmpPoints[0],n),o=at.Mul(r,this.arrowTipWidth),a=at.Sub(this.tmpPoints[1],o),c=Nt.Sub(a,n),m=Nt.Add(a,n),f=at.Per(r).mul(t*1.5),v=Nt.Sub(a,f),S=Nt.Add(a,f),E=[this.tmpPoints[0],a],T=[v,this.tmpPoints[1],S],P=[i,l].concat(T,[c,m]);return{trianglePoints:T.map(function(x){return Nt.Sub(x,_this75.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:E.map(function(x){return Nt.Sub(x,_this75.tmpPoints[0]).XY;}).flat(1),rect:_t(P),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this76=this;var t=at.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=at.Per(t).mul(Math.floor(r*3/8)),i=Nt.Sub(this.tmpPoints[0],n),l=Nt.Add(this.tmpPoints[0],n),o=[i,this.tmpPoints[1],l];return{trianglePoints:o.map(function(a){return Nt.Sub(a,_this76.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:_t(o),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Nt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var c,m;var r=t.op,n=t.isFullWork,_t$workState2=t.workState,i=_t$workState2===void 0?Ft.Done:_t$workState2,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Nt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(m=this.vNodes)==null||m.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:At.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,m;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.strokeType,a=i.get(r.name);return l&&(r.tagName==="GROUP"?r.children.forEach(function(f){f.setAttribute("strokeColor",l),f.getAttribute("fillColor")&&f.setAttribute("fillColor",l);}):(r.setAttribute("strokeColor",l),r.setAttribute("fillColor",l)),(c=a==null?void 0:a.opt)!=null&&c.strokeColor&&(a.opt.strokeColor=l)),o&&a!=null&&a.opt&&(m=a.opt)!=null&&m.strokeType&&(a.opt.strokeType=o),a&&i.setInfo(r.name,a),At.updateNodeOpt(t);}}]);}(At);var _i=/*#__PURE__*/function(_At6){function _i(t){var _this77;_classCallCheck(this,_i);_this77=_callSuper(this,_i,[t]);ot(_this77,"canRotate",!1);ot(_this77,"scaleType",Qt.all);ot(_this77,"toolsType",pt.Ellipse);ot(_this77,"tmpPoints",[]);ot(_this77,"workOptions");ot(_this77,"oldRect");ot(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(_i,_At6);return _createClass(_i,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=t.isSimpleWorker,c=this.workId,m=r.op,f=r.syncUnitTime;f&&(this.syncUnitTime=f);var v=m==null?void 0:m.length;if(!v||v<2)return{type:dt.None};var S;if(this.tmpPoints.length===0?(this.tmpPoints=[new Nt(m[0],m[1])],S=!1):S=this.updateTempPoints(m),!S)return{type:dt.None};var E;if(i||l||a){var T=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:c,layer:T,isDrawing:!0});var P=T.parent.parent,_x61={x:0,y:0,w:Math.floor(P.width),h:Math.floor(P.height)},_h34=_objectSpread({type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);if(or(E,_x61)!==Pe.outside){var d=bt(E,this.oldRect);if(this.oldRect=E,_h34.rect=d,!a)return _h34;}if(a){var _d15=Date.now();return _d15-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d15,_h34.op=this.tmpPoints.map(function(g){return[].concat(_toConsumableArray(g.XY),[0]);}).flat(1),_h34.index=0,_h34.isSync=!0),_h34;}return{type:dt.None};}if(!i&&!l&&!a&&o){var _T3=Date.now();return _T3-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_T3,_objectSpread(_objectSpread({type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(P){return[].concat(_toConsumableArray(P.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:dt.None};}return{type:dt.None};}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ve(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&At.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:Dt.Local},this.baseConsumeResult),{},{ops:l,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawing,l=t.isDrawEraserlines,_this$workOptions8=this.workOptions,o=_this$workOptions8.strokeColor,a=_this$workOptions8.fillColor,c=_this$workOptions8.thickness,m=_this$workOptions8.zIndex,f=_this$workOptions8.scale,v=_this$workOptions8.rotate,S=_this$workOptions8.translate,E=_this$workOptions8.strokeType,T=_this$workOptions8.eraserlines,P=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(c),x=_this$computDrawPoint4.radius,h=_this$computDrawPoint4.rect,p=_this$computDrawPoint4.pos,d={closeType:"normal",radius:x,lineWidth:c,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:E===Zt.Dotted?[1,c*2]:E===Zt.LongDotted?[c,c*2]:void 0},g={name:r,id:r,zIndex:m,pos:p,anchor:[0.5,0.5],size:[h.w,h.h]};f&&(g.scale=f),v&&(g.rotate=v),S&&(g.translate=S);var O=new ye(g);if(i){var B=new be({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/P[0],1/P[1]]});O.append(B);}var w=new io(_objectSpread(_objectSpread({},d),{},{pos:[0,0]}));O.append(w),T&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:O,eraserlines:T,pos:p,layer:n},l)),this.replace(n,r,O);var L=O.getBoundingClientRect();return this.isDelete&&O.setAttribute("opacity",0),{x:Math.floor(L.x-At.SafeBorderPadding),y:Math.floor(L.y-At.SafeBorderPadding),w:Math.floor(L.width+At.SafeBorderPadding*2),h:Math.floor(L.height+At.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=_t(this.tmpPoints),n=_t(this.tmpPoints,t),i=[Math.floor(r.x+r.w/2),Math.floor(r.y+r.h/2)];return{rect:n,pos:i,radius:[Math.floor(r.w/2),Math.floor(r.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Nt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var c,m;var r=t.op,n=t.isFullWork,_t$workState3=t.workState,i=_t$workState3===void 0?Ft.Done:_t$workState3,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Nt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(m=this.vNodes)==null||m.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:At.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var f,v,S;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.strokeType,c=i.get(r.name);var m=r;return r.tagName==="GROUP"&&(m=r.children[0]),l&&(m.setAttribute("strokeColor",l),(f=c==null?void 0:c.opt)!=null&&f.strokeColor&&(c.opt.strokeColor=l)),o&&(o==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",o),(v=c==null?void 0:c.opt)!=null&&v.fillColor&&(c.opt.fillColor=o)),a&&c!=null&&c.opt&&(S=c.opt)!=null&&S.strokeType&&(c.opt.strokeType=a),c&&i.setInfo(r.name,c),At.updateNodeOpt(t);}}]);}(At);var ts=/*#__PURE__*/function(_At7){function ts(t){var _this78;_classCallCheck(this,ts);_this78=_callSuper(this,ts,[t]);ot(_this78,"canRotate",!0);ot(_this78,"scaleType",Qt.all);ot(_this78,"toolsType",pt.Rectangle);ot(_this78,"tmpPoints",[]);ot(_this78,"workOptions");ot(_this78,"oldRect");ot(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(ts,_At7);return _createClass(ts,[{key:"transformData",value:function transformData(){var t=_t(this.tmpPoints);return[[t.x,t.y,0],[t.x+t.w,t.y,0],[t.x+t.w,t.y+t.h,0],[t.x,t.y+t.h,0]];}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=this.workOptions.thickness,n=[];var _iterator30=_createForOfIteratorHelper(t),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var o=_step30.value;n.push(_construct(at,_toConsumableArray(o)));}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}var i=_t(n,r),l=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:l,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=t.isSimpleWorker,c=this.workId,m=r.op,f=m==null?void 0:m.length;if(!f||f<2)return{type:dt.None};var v;if(this.tmpPoints.length===0?(this.tmpPoints=[new Nt(m[0],m[1])],v=!1):v=this.updateTempPoints(m),!v)return{type:dt.None};var S=this.transformData();var E;if(i||l||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({ps:S,workId:c,layer:P,isDrawing:!0});}if(a){var _P10=bt(E,this.oldRect);this.oldRect=E;var _x62=_objectSpread({rect:_P10,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);if(o){var _h35=Date.now();_h35-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_h35,_x62.op=S.flat(1),_x62.index=0,_x62.isSync=!0);}return _x62;}if(!i&&o){var _P11=Date.now();return _P11-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P11,_objectSpread({type:dt.DrawWork,dataType:Dt.Local,op:S.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var T=bt(E,this.oldRect);return this.oldRect=E,_objectSpread({rect:T,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var a;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.transformData(),n=this.fullLayer,i=this.draw({ps:r,workId:t,layer:n,isDrawing:!1});this.oldRect=i;var l=r.flat(1),o=ve(l);return(a=this.vNodes)==null||a.setInfo(t,{rect:i,op:l,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:i&&At.getCenterPos(i,n)}),_objectSpread(_objectSpread({rect:i,type:dt.FullWork,dataType:Dt.Local,ops:o,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawing,l=t.ps,o=t.replaceId,_t$isDrawEraserlines2=t.isDrawEraserlines,a=_t$isDrawEraserlines2===void 0?!0:_t$isDrawEraserlines2,_this$workOptions9=this.workOptions,c=_this$workOptions9.strokeColor,m=_this$workOptions9.fillColor,f=_this$workOptions9.thickness,v=_this$workOptions9.zIndex,S=_this$workOptions9.scale,E=_this$workOptions9.rotate,T=_this$workOptions9.translate,P=_this$workOptions9.strokeType,x=_this$workOptions9.eraserlines,h=n.worldPosition,p=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(l),d=_this$computDrawPoint5.points,g=_this$computDrawPoint5.rect,O=_this$computDrawPoint5.pos,w={close:!0,normalize:!0,points:d,lineWidth:f,fillColor:m!=="transparent"&&m||void 0,strokeColor:c,lineJoin:"round",lineCap:"round",lineDash:P===Zt.Dotted?[1,f*2]:P===Zt.LongDotted?[f,f*2]:void 0};var L={x:Math.floor(g.x*p[0]+h[0]-At.SafeBorderPadding),y:Math.floor(g.y*p[1]+h[1]-At.SafeBorderPadding),w:Math.floor(g.w*p[0]+2*At.SafeBorderPadding),h:Math.floor(g.h*p[0]+2*At.SafeBorderPadding)};var B=new ye({name:r,id:r,zIndex:v,pos:O,anchor:[0.5,0.5],size:[g.w,g.h],scale:S,rotate:E,translate:T}),A=new we(_objectSpread(_objectSpread({},w),{},{pos:[0,0]}));if(B.appendChild(A),i){var b=new be({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:c,lineWidth:1,scale:[1/p[0],1/p[1]]});B.appendChild(b);}if(x&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:B,eraserlines:x,pos:O,layer:n},a)),this.replace(n,o||r,B),S||E||T){var _b8=B.getBoundingClientRect();L={x:Math.floor(_b8.x-At.SafeBorderPadding),y:Math.floor(_b8.y-At.SafeBorderPadding),w:Math.floor(_b8.width+2*At.SafeBorderPadding),h:Math.floor(_b8.height+2*At.SafeBorderPadding)};}return this.isDelete&&B.setAttribute("opacity",0),L;}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Nt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var f,v;var r=t.op,n=t.isFullWork,i=t.replaceId,_t$workState4=t.workState,l=_t$workState4===void 0?Ft.Done:_t$workState4,o=(f=this.workId)==null?void 0:f.toString();if(!o)return;var a=[];for(var S=0;S<r.length;S+=3)a.push([r[S],r[S+1],r[S+2]]);var c=n?this.fullLayer:this.drawLayer||this.fullLayer,m=this.draw({ps:a,workId:o,layer:c,isDrawing:!1,replaceId:i,isDrawEraserlines:l===Ft.Done});return this.oldRect=m,(v=this.vNodes)==null||v.setInfo(o,{rect:m,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&At.getCenterPos(m,c)}),m;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var f,v,S;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.strokeType,c=i.get(r.name);var m=r;return r.tagName==="GROUP"&&(m=r.children[0]),l&&(m.setAttribute("strokeColor",l),(f=c==null?void 0:c.opt)!=null&&f.strokeColor&&(c.opt.strokeColor=l)),o&&(o==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",o),(v=c==null?void 0:c.opt)!=null&&v.fillColor&&(c.opt.fillColor=o)),a&&c!=null&&c.opt&&(S=c.opt)!=null&&S.strokeType&&(c.opt.strokeType=a),c&&i.setInfo(r.name,c),At.updateNodeOpt(t);}}]);}(At);var es=/*#__PURE__*/function(_At8){function es(t){var _this79;_classCallCheck(this,es);_this79=_callSuper(this,es,[t]);ot(_this79,"canRotate",!1);ot(_this79,"scaleType",Qt.all);ot(_this79,"toolsType",pt.Star);ot(_this79,"tmpPoints",[]);ot(_this79,"workOptions");ot(_this79,"oldRect");ot(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(es,_At8);return _createClass(es,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=t.isSimpleWorker,c=this.workId,m=r.op,f=r.syncUnitTime,v=m==null?void 0:m.length;if(!v||v<2)return{type:dt.None};f&&(this.syncUnitTime=f);var S;if(this.tmpPoints.length===0?(this.tmpPoints=[new Nt(m[0],m[1])],S=!1):S=this.updateTempPoints(m),!S)return{type:dt.None};var E;if(i||l||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:c,layer:P,isDrawing:!0});}if(a){var _P12=bt(E,this.oldRect);this.oldRect=E;var _x63=_objectSpread({rect:_P12,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);if(o){var _h36=Date.now();_h36-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_h36,_x63.op=this.tmpPoints.map(function(p){return[].concat(_toConsumableArray(p.XY),[0]);}).flat(1),_x63.index=0,_x63.isSync=!0);}return _x63;}if(!i&&o){var _P13=Date.now();return _P13-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P13,_objectSpread({type:dt.DrawWork,dataType:Dt.Local,op:this.tmpPoints.map(function(x){return[].concat(_toConsumableArray(x.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var T=bt(E,this.oldRect);return this.oldRect=E,_objectSpread({rect:T,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ve(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&At.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:Dt.Local,ops:l,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawing,_t$isDrawEraserlines3=t.isDrawEraserlines,l=_t$isDrawEraserlines3===void 0?!0:_t$isDrawEraserlines3,_this$workOptions10=this.workOptions,o=_this$workOptions10.strokeColor,a=_this$workOptions10.fillColor,c=_this$workOptions10.thickness,m=_this$workOptions10.zIndex,f=_this$workOptions10.vertices,v=_this$workOptions10.innerVerticeStep,S=_this$workOptions10.innerRatio,E=_this$workOptions10.scale,T=_this$workOptions10.rotate,P=_this$workOptions10.translate,x=_this$workOptions10.strokeType,h=_this$workOptions10.eraserlines,p=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(c,f,v,S),d=_this$computDrawPoint6.rect,g=_this$computDrawPoint6.pos,O=_this$computDrawPoint6.points,w={close:!0,points:O,lineWidth:c,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:x===Zt.Dotted?[1,c*2]:x===Zt.LongDotted?[c,c*2]:void 0},L={name:r,id:r,zIndex:m,pos:g,anchor:[0.5,0.5],size:[d.w,d.h]};E&&(L.scale=E),T&&(L.rotate=T),P&&(L.translate=P);var B=new ye(L);if(i){var W=new be({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/p[0],1/p[1]]});B.append(W);}var A=new we(_objectSpread(_objectSpread({},w),{},{pos:[0,0]}));B.append(A),h&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:B,eraserlines:h,pos:g,layer:n},l)),this.replace(n,r,B);var b=B.getBoundingClientRect();return this.isDelete&&B.setAttribute("opacity",0),{x:Math.floor(b.x-At.SafeBorderPadding),y:Math.floor(b.y-At.SafeBorderPadding),w:Math.floor(b.width+At.SafeBorderPadding*2),h:Math.floor(b.height+At.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r,n,i){var l=_t(this.tmpPoints),o=[Math.floor(l.x+l.w/2),Math.floor(l.y+l.h/2)],a=cs(l.w,l.h),c=Math.floor(Math.min(l.w,l.h)/2),m=i*c,f=[],v=2*Math.PI/r;for(var E=0;E<r;E++){var T=E*v-0.5*Math.PI;var P=void 0,_x64=void 0;E%n===1?(P=m*a[0]*Math.cos(T),_x64=m*a[1]*Math.sin(T)):(P=c*a[0]*Math.cos(T),_x64=c*a[1]*Math.sin(T),f.push(P,_x64)),f.push(P,_x64);}return{rect:_t(this.tmpPoints,t),pos:o,points:f};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Nt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l)||Nt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var c,m;var r=t.op,n=t.isFullWork,_t$workState5=t.workState,i=_t$workState5===void 0?Ft.Done:_t$workState5,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Nt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(m=this.vNodes)==null||m.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&At.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var P;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.toolsType,c=n.vertices,m=n.innerVerticeStep,f=n.innerRatio,v=n.strokeType,S=i.get(r.name),E=S==null?void 0:S.opt;var T=r;return r.tagName==="GROUP"&&(T=r.children[0]),l&&(T.setAttribute("strokeColor",l),E!=null&&E.strokeColor&&(E.strokeColor=l)),o&&(o==="transparent"?T.setAttribute("fillColor","rgba(0,0,0,0)"):T.setAttribute("fillColor",o),E!=null&&E.fillColor&&(E.fillColor=o)),a===pt.Star&&(c&&(E.vertices=c),m&&(E.innerVerticeStep=m),f&&(E.innerRatio=f)),v&&S!=null&&S.opt&&(P=S.opt)!=null&&P.strokeType&&(S.opt.strokeType=v),S&&i.setInfo(r.name,_objectSpread(_objectSpread({},S),{},{opt:E})),At.updateNodeOpt(t);}}]);}(At);var rs=/*#__PURE__*/function(_At9){function rs(t){var _this80;_classCallCheck(this,rs);_this80=_callSuper(this,rs,[t]);ot(_this80,"canRotate",!1);ot(_this80,"scaleType",Qt.all);ot(_this80,"toolsType",pt.Polygon);ot(_this80,"tmpPoints",[]);ot(_this80,"workOptions");ot(_this80,"oldRect");ot(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(rs,_At9);return _createClass(rs,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=t.isSimpleWorker,c=r.op,m=r.syncUnitTime;m&&(this.syncUnitTime=m);var f=this.workId,v=c==null?void 0:c.length;if(!v||v<2)return{type:dt.None};var S;if(this.tmpPoints.length===0?(this.tmpPoints=[new Nt(c[0],c[1])],S=!1):S=this.updateTempPoints(c),!S)return{type:dt.None};var E;if(i||l||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:f,layer:P,isDrawing:!0});}if(a){var _P14=bt(E,this.oldRect);this.oldRect=E;var _x65=_objectSpread({type:dt.DrawWork,rect:_P14,dataType:Dt.Local},this.baseConsumeResult);if(o){var _h37=Date.now();_h37-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_h37,_x65.op=this.tmpPoints.map(function(p){return[].concat(_toConsumableArray(p.XY),[0]);}).flat(1),_x65.index=0,_x65.isSync=!0);}return _x65;}if(!i&&o){var _P15=Date.now();return _P15-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P15,_objectSpread({type:dt.DrawWork,dataType:Dt.Local,op:this.tmpPoints.map(function(x){return[].concat(_toConsumableArray(x.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var T=bt(E,this.oldRect);return this.oldRect=E,_objectSpread({rect:T,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ve(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&At.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:Dt.Local,ops:l,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,i=t.isDrawing,_t$isDrawEraserlines4=t.isDrawEraserlines,l=_t$isDrawEraserlines4===void 0?!0:_t$isDrawEraserlines4,_this$workOptions11=this.workOptions,o=_this$workOptions11.strokeColor,a=_this$workOptions11.fillColor,c=_this$workOptions11.thickness,m=_this$workOptions11.zIndex,f=_this$workOptions11.vertices,v=_this$workOptions11.scale,S=_this$workOptions11.rotate,E=_this$workOptions11.translate,T=_this$workOptions11.strokeType,P=_this$workOptions11.eraserlines,x=n.worldScaling,_this$computDrawPoint7=this.computDrawPoints(c,f),h=_this$computDrawPoint7.rect,p=_this$computDrawPoint7.pos,d=_this$computDrawPoint7.points,g={close:!0,points:d,lineWidth:c,fillColor:a!=="transparent"&&a||void 0,strokeColor:o,normalize:!0,lineJoin:"round",lineCap:"round",lineDash:T===Zt.Dotted?[1,c*2]:T===Zt.LongDotted?[c,c*2]:void 0},O={name:r,id:r,zIndex:m,pos:p,anchor:[0.5,0.5],size:[h.w,h.h]};v&&(O.scale=v),S&&(O.rotate=S),E&&(O.translate=E);var w=new ye(O);if(i){var A=new be({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/x[0],1/x[1]]});w.append(A);}var L=new we(_objectSpread(_objectSpread({},g),{},{pos:[0,0]}));w.append(L),P&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:w,eraserlines:P,pos:p,layer:n},l)),this.replace(n,r,w);var B=w.getBoundingClientRect();return this.isDelete&&w.setAttribute("opacity",0),{x:Math.floor(B.x-At.SafeBorderPadding),y:Math.floor(B.y-At.SafeBorderPadding),w:Math.floor(B.width+At.SafeBorderPadding*2),h:Math.floor(B.height+At.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=_t(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],l=cs(n.w,n.h),o=Math.floor(Math.min(n.w,n.h)/2),a=[],c=2*Math.PI/r;for(var f=0;f<r;f++){var v=f*c-0.5*Math.PI,S=o*l[0]*Math.cos(v),E=o*l[1]*Math.sin(v);a.push(S,E);}return{rect:_t(this.tmpPoints,t),pos:i,points:a};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Nt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l)||Nt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var c,m;var r=t.op,n=t.isFullWork,_t$workState6=t.workState,i=_t$workState6===void 0?Ft.Done:_t$workState6,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Nt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(m=this.vNodes)==null||m.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&At.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var E;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.toolsType,c=n.vertices,m=n.strokeType,f=i.get(r.name),v=f==null?void 0:f.opt;var S=r;return r.tagName==="GROUP"&&(S=r.children[0]),l&&(S.setAttribute("strokeColor",l),v!=null&&v.strokeColor&&(v.strokeColor=l)),o&&(o==="transparent"?S.setAttribute("fillColor","rgba(0,0,0,0)"):S.setAttribute("fillColor",o),v!=null&&v.fillColor&&(v.fillColor=o)),a===pt.Polygon&&c&&(v.vertices=c),m&&f!=null&&f.opt&&(E=f.opt)!=null&&E.strokeType&&(f.opt.strokeType=m),f&&i.setInfo(r.name,_objectSpread(_objectSpread({},f),{},{opt:v})),At.updateNodeOpt(t);}}]);}(At);var Ce=/*#__PURE__*/function(){function Ce(){_classCallCheck(this,Ce);}return _createClass(Ce,null,[{key:"bezier",value:function bezier(e,t){var r=[];for(var n=0;n<t.length;n+=4){var i=t[n],l=t[n+1],o=t[n+2],a=t[n+3];i&&l&&o&&a?r.push.apply(r,_toConsumableArray(Ce.getBezierPoints(e,i,l,o,a))):i&&l&&o?r.push.apply(r,_toConsumableArray(Ce.getBezierPoints(e,i,l,o))):i&&l?r.push.apply(r,_toConsumableArray(Ce.getBezierPoints(e,i,l))):i&&r.push(i);}return r;}/**
409
- * @desc 获取点,这里可以设置点的个数
410
- * @param {number} num 点个数
411
- * @param {Vec2d} p1 点坐标
412
- * @param {Vec2d} p2 点坐标
413
- * @param {Vec2d} p3 点坐标
414
- * @param {Vec2d} p4 点坐标
415
- * 如果参数是 num, p1, p2 为一阶贝塞尔
416
- * 如果参数是 num, p1, c1, p2 为二阶贝塞尔
417
- * 如果参数是 num, p1, c1, c2, p2 为三阶贝塞尔
418
- */},{key:"getBezierPoints",value:function getBezierPoints(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:10;var t=arguments.length>1?arguments[1]:undefined;var r=arguments.length>2?arguments[2]:undefined;var n=arguments.length>3?arguments[3]:undefined;var i=arguments.length>4?arguments[4]:undefined;var l=null;var o=[];!n&&!i?l=Ce.oneBezier:n&&!i?l=Ce.twoBezier:n&&i&&(l=Ce.threeBezier);for(var a=0;a<e;a++)l&&o.push(l(a/e,t,r,n,i));return i?o.push(i):n&&o.push(n),o;}/**
419
- * @desc 一阶贝塞尔
420
- * @param {number} t 当前百分比
421
- * @param {Vec2d} p1 起点坐标
422
- * @param {Vec2d} p2 终点坐标
423
- */},{key:"oneBezier",value:function oneBezier(e,t,r){var n=t.x+(r.x-t.x)*e,i=t.y+(r.y-t.y)*e;return new at(n,i);}/**
424
- * @desc 二阶贝塞尔
425
- * @param {number} t 当前百分比
426
- * @param {Array} p1 起点坐标
427
- * @param {Array} p2 终点坐标
428
- * @param {Array} cp 控制点
429
- */},{key:"twoBezier",value:function twoBezier(e,t,r,n){var i=(1-e)*(1-e)*t.x+2*e*(1-e)*r.x+e*e*n.x,l=(1-e)*(1-e)*t.y+2*e*(1-e)*r.y+e*e*n.y;return new at(i,l);}/**
430
- * @desc 三阶贝塞尔
431
- * @param {number} t 当前百分比
432
- * @param {Array} p1 起点坐标
433
- * @param {Array} p2 终点坐标
434
- * @param {Array} cp1 控制点1
435
- * @param {Array} cp2 控制点2
436
- */},{key:"threeBezier",value:function threeBezier(e,t,r,n,i){var l=t.x*(1-e)*(1-e)*(1-e)+3*r.x*e*(1-e)*(1-e)+3*n.x*e*e*(1-e)+i.x*e*e*e,o=t.y*(1-e)*(1-e)*(1-e)+3*r.y*e*(1-e)*(1-e)+3*n.y*e*e*(1-e)+i.y*e*e*e;return new at(l,o);}}]);}();var ns=/*#__PURE__*/function(_At10){function ns(t){var _this81;_classCallCheck(this,ns);_this81=_callSuper(this,ns,[t]);ot(_this81,"canRotate",!1);ot(_this81,"scaleType",Qt.all);ot(_this81,"toolsType",pt.SpeechBalloon);ot(_this81,"ratio",0.8);ot(_this81,"tmpPoints",[]);ot(_this81,"workOptions");ot(_this81,"oldRect");ot(_this81,"syncTimestamp");_this81.workOptions=t.toolsOpt,_this81.syncTimestamp=0,_this81.syncUnitTime=50;return _this81;}_inherits(ns,_At10);return _createClass(ns,[{key:"consume",value:function consume(t){var T;var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=t.isSimpleWorker,c=(T=r==null?void 0:r.workId)==null?void 0:T.toString();if(!c)return{type:dt.None};var m=r.op,f=m==null?void 0:m.length;if(!f||f<2)return{type:dt.None};var v;if(this.tmpPoints.length===0?(this.tmpPoints=[new Nt(m[0],m[1])],v=!1):v=this.updateTempPoints(m),!v)return{type:dt.None};var S;if(i||l||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;S=this.draw({workId:c,layer:P,isDrawing:!0});}if(a){var _P16=bt(S,this.oldRect);this.oldRect=S;var _x66=_objectSpread({rect:_P16,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);if(o){var _h38=Date.now();_h38-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_h38,_x66.op=this.tmpPoints.map(function(p){return[].concat(_toConsumableArray(p.XY),[0]);}).flat(1),_x66.index=0,_x66.isSync=!0);}return _x66;}if(!i&&o){var _P17=Date.now();return _P17-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P17,_objectSpread({type:dt.DrawWork,dataType:Dt.Local,op:this.tmpPoints.map(function(x){return[].concat(_toConsumableArray(x.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var E=bt(S,this.oldRect);return this.oldRect=S,_objectSpread({rect:E,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ve(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&At.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:Dt.Local,ops:l,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines5=t.isDrawEraserlines,i=_t$isDrawEraserlines5===void 0?!0:_t$isDrawEraserlines5,_this$workOptions12=this.workOptions,l=_this$workOptions12.strokeColor,o=_this$workOptions12.fillColor,a=_this$workOptions12.thickness,c=_this$workOptions12.zIndex,m=_this$workOptions12.placement,f=_this$workOptions12.scale,v=_this$workOptions12.rotate,S=_this$workOptions12.translate,E=_this$workOptions12.strokeType,T=_this$workOptions12.eraserlines,_this$computDrawPoint8=this.computDrawPoints(a,m),P=_this$computDrawPoint8.rect,x=_this$computDrawPoint8.pos,h=_this$computDrawPoint8.points,p={points:h.map(function(L){return L.XY;}),lineWidth:a,fillColor:o!=="transparent"&&o||void 0,strokeColor:l,normalize:!0,className:"".concat(x[0],",").concat(x[1]),close:!0,lineJoin:"round",lineCap:"round",lineDash:E===Zt.Dotted?[1,a*2]:E===Zt.LongDotted?[a,a*2]:void 0},d={name:r,id:r,zIndex:c,pos:x,anchor:[0.5,0.5],size:[P.w,P.h]};f&&(d.scale=f),v&&(d.rotate=v),S&&(d.translate=S);var g=new ye(d),O=new we(_objectSpread(_objectSpread({},p),{},{pos:[0,0]}));g.append(O),T&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:g,eraserlines:T,pos:x,layer:n},i)),this.replace(n,r,g);var w=g.getBoundingClientRect();return this.isDelete&&g.setAttribute("opacity",0),{x:Math.floor(w.x-At.SafeBorderPadding),y:Math.floor(w.y-At.SafeBorderPadding),w:Math.floor(w.width+At.SafeBorderPadding*2),h:Math.floor(w.height+At.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var r=_t(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=r.y+r.h*this.ratio;return[new at(r.x,r.y,0),new at(r.x+r.w,r.y,0),new at(r.x+r.w,n,0),new at(r.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=r.y+r.h*(1-this.ratio);return[new at(r.x,_n4,0),new at(r.x+r.w,_n4,0),new at(r.x+r.w,r.y+r.h,0),new at(r.x,r.y+r.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=r.x+r.w*(1-this.ratio);return[new at(_n5,r.y,0),new at(r.x+r.w,r.y,0),new at(r.x+r.w,r.y+r.h,0),new at(_n5,r.y+r.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=r.x+r.w*this.ratio;return[new at(r.x,r.y,0),new at(_n6,r.y,0),new at(_n6,r.y+r.h,0),new at(r.x,r.y+r.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=_t(this.tmpPoints),i=this.transformControlPoints(r),l=Math.floor(n.w*0.1),o=Math.floor(n.h*0.1),a=[],c=at.Add(i[0],new at(0,o,0)),m=at.Add(i[0],new at(l,0,0)),f=Ce.getBezierPoints(10,c,i[0],m),v=at.Sub(i[1],new at(l,0,0)),S=at.Add(i[1],new at(0,o,0)),E=Ce.getBezierPoints(10,v,i[1],S),T=at.Sub(i[2],new at(0,o,0)),P=at.Sub(i[2],new at(l,0,0)),x=Ce.getBezierPoints(10,T,i[2],P),h=at.Add(i[3],new at(l,0,0)),p=at.Sub(i[3],new at(0,o,0)),d=Ce.getBezierPoints(10,h,i[3],p),g=l*(1-this.ratio)*10,O=o*(1-this.ratio)*10;switch(r){case"bottom":{var B=at.Sub(i[2],new at(l*5-g/2,0,0)),A=at.Sub(i[2],new at(l*5,-O,0)),b=at.Sub(i[2],new at(l*5+g/2,0,0));a.push.apply(a,[A,b].concat(_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(E),_toConsumableArray(x),[B]));break;}case"bottomRight":{var _B11=at.Sub(i[2],new at(l*1.1,0,0)),_A9=at.Sub(i[2],new at(l*1.1+g/2,-O,0)),_b9=at.Sub(i[2],new at(l*1.1+g,0,0));a.push.apply(a,[_A9,_b9].concat(_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(E),_toConsumableArray(x),[_B11]));break;}case"bottomLeft":{var _B12=at.Add(i[3],new at(l*1.1+g,0,0)),_A10=at.Add(i[3],new at(l*1.1+g/2,O,0)),_b10=at.Add(i[3],new at(l*1.1,0,0));a.push.apply(a,[_A10,_b10].concat(_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(E),_toConsumableArray(x),[_B12]));break;}case"top":{var _B13=at.Sub(i[1],new at(l*5-g/2,0,0)),_A11=at.Sub(i[1],new at(l*5,O,0)),_b11=at.Sub(i[1],new at(l*5+g/2,0,0));a.push.apply(a,[_A11,_B13].concat(_toConsumableArray(E),_toConsumableArray(x),_toConsumableArray(d),_toConsumableArray(f),[_b11]));break;}case"topRight":{var _B14=at.Sub(i[1],new at(l*1.1,0,0)),_A12=at.Sub(i[1],new at(l*1.1+g/2,O,0)),_b12=at.Sub(i[1],new at(l*1.1+g,0,0));a.push.apply(a,[_A12,_B14].concat(_toConsumableArray(E),_toConsumableArray(x),_toConsumableArray(d),_toConsumableArray(f),[_b12]));break;}case"topLeft":{var _B15=at.Add(i[0],new at(l*1.1+g,0,0)),_A13=at.Add(i[0],new at(l*1.1+g/2,-O,0)),_b13=at.Add(i[0],new at(l*1.1,0,0));a.push.apply(a,[_A13,_B15].concat(_toConsumableArray(E),_toConsumableArray(x),_toConsumableArray(d),_toConsumableArray(f),[_b13]));break;}case"left":{var _B16=at.Add(i[0],new at(0,o*5-O/2,0)),_A14=at.Add(i[0],new at(-g,o*5,0)),_b14=at.Add(i[0],new at(0,o*5+O/2,0));a.push.apply(a,[_A14,_B16].concat(_toConsumableArray(f),_toConsumableArray(E),_toConsumableArray(x),_toConsumableArray(d),[_b14]));break;}case"leftTop":{var _B17=at.Add(i[0],new at(0,o*1.1,0)),_A15=at.Add(i[0],new at(-g,o*1.1+O/2,0)),_b15=at.Add(i[0],new at(0,o*1.1+O,0));a.push.apply(a,[_A15,_B17].concat(_toConsumableArray(f),_toConsumableArray(E),_toConsumableArray(x),_toConsumableArray(d),[_b15]));break;}case"leftBottom":{var _B18=at.Sub(i[3],new at(0,o*1.1+O,0)),_A16=at.Sub(i[3],new at(g,o*1.1+O/2,0)),_b16=at.Sub(i[3],new at(0,o*1.1,0));a.push.apply(a,[_A16,_B18].concat(_toConsumableArray(f),_toConsumableArray(E),_toConsumableArray(x),_toConsumableArray(d),[_b16]));break;}case"right":{var _B19=at.Add(i[1],new at(0,o*5-O/2,0)),_A17=at.Add(i[1],new at(g,o*5,0)),_b17=at.Add(i[1],new at(0,o*5+O/2,0));a.push.apply(a,[_A17,_b17].concat(_toConsumableArray(x),_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(E),[_B19]));break;}case"rightTop":{var _B20=at.Add(i[1],new at(0,o*1.1,0)),_A18=at.Add(i[1],new at(g,o*1.1+O/2,0)),_b18=at.Add(i[1],new at(0,o*1.1+O,0));a.push.apply(a,[_A18,_b18].concat(_toConsumableArray(x),_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(E),[_B20]));break;}case"rightBottom":{var _B21=at.Sub(i[2],new at(0,o*1.1+O,0)),_A19=at.Sub(i[2],new at(-g,o*1.1+O/2,0)),_b19=at.Sub(i[2],new at(0,o*1.1,0));a.push.apply(a,[_A19,_b19].concat(_toConsumableArray(x),_toConsumableArray(d),_toConsumableArray(f),_toConsumableArray(E),[_B21]));break;}}var w=_t(this.tmpPoints,t),L=[Math.floor(w.x+w.w/2),Math.floor(w.y+w.h/2)];return{rect:w,pos:L,points:a};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Nt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l)||Nt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var c,m;var r=t.op,n=t.isFullWork,_t$workState7=t.workState,i=_t$workState7===void 0?Ft.Done:_t$workState7,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Nt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawing:!1,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(m=this.vNodes)==null||m.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&At.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var E;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.fillColor,a=n.toolsType,c=n.placement,m=n.strokeType,f=i.get(r.name),v=f==null?void 0:f.opt;var S=r;return r.tagName==="GROUP"&&(S=r.children[0]),l&&(S.setAttribute("strokeColor",l),v!=null&&v.strokeColor&&(v.strokeColor=l)),o&&(o==="transparent"?S.setAttribute("fillColor","rgba(0,0,0,0)"):S.setAttribute("fillColor",o),v!=null&&v.fillColor&&(v.fillColor=o)),a===pt.SpeechBalloon&&c&&(v.placement=c),m&&f!=null&&f.opt&&(E=f.opt)!=null&&E.strokeType&&(f.opt.strokeType=m),f&&i.setInfo(r.name,_objectSpread(_objectSpread({},f),{},{opt:v})),At.updateNodeOpt(t);}}]);}(At);var lm=qe,cm=Le,fm="[object Boolean]";function hm(u){return u===!0||u===!1||cm(u)&&lm(u)==fm;}var um=hm,ke=/* @__PURE__ */Ne(um);var lr=/*#__PURE__*/function(_At11){function lr(t){var _this82;_classCallCheck(this,lr);_this82=_callSuper(this,lr,[t]);ot(_this82,"canRotate",!0);ot(_this82,"scaleType",Qt.all);ot(_this82,"toolsType",pt.Image);ot(_this82,"tmpPoints",[]);ot(_this82,"workOptions");ot(_this82,"oldRect");_this82.workOptions=t.toolsOpt,_this82.scaleType=lr.getScaleType(_this82.workOptions);return _this82;}_inherits(lr,_At11);return _createClass(lr,[{key:"consume",value:function consume(){return{type:dt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:dt.None};}},{key:"draw",value:function draw(t){var r=t.layer,n=t.workId,i=t.replaceId,l=t.imageBitmap,_this$workOptions13=this.workOptions,o=_this$workOptions13.centerX,a=_this$workOptions13.centerY,c=_this$workOptions13.width,m=_this$workOptions13.height,f=_this$workOptions13.rotate,v=_this$workOptions13.zIndex,S=_this$workOptions13.eraserlines,E=new ye({anchor:[0.5,0.5],pos:[o,a],name:n,size:[c,m],zIndex:v,rotate:f}),T={anchor:[0.5,0.5],pos:[0,0],size:[c,m],texture:l};l||(T.bgcolor="rgba(0,0,0,0.3)");var P=new pi(T);E.append(P),S&&this.drawEraserlines({group:E,eraserlines:S,pos:[o,a],layer:r}),this.replace(r,i||n,E);var x=E.getBoundingClientRect();if(x)return{x:Math.floor(x.x-At.SafeBorderPadding),y:Math.floor(x.y-At.SafeBorderPadding),w:Math.floor(x.width+At.SafeBorderPadding*2),h:Math.floor(x.height+At.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var m,f,v,S,r,n,i,_this$workOptions14,l,o,a,c,E,T;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:r=t.isFullWork,n=t.replaceId,i=t.worker,_this$workOptions14=this.workOptions,l=_this$workOptions14.src,o=_this$workOptions14.uuid,a=((m=this.workId)==null?void 0:m.toString())||o,c=r?this.fullLayer:this.drawLayer||this.fullLayer;if(!l){_context25.next=8;break;}_context25.next=4;return i.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:a,isSubWorker:i instanceof Ps});case 4:E=_context25.sent;if(!E){_context25.next=8;break;}T=this.draw({workId:a,layer:c,replaceId:n,imageBitmap:E});return _context25.abrupt("return",(this.oldRect=a&&((v=(f=this.vNodes)==null?void 0:f.get(a))==null?void 0:v.rect)||void 0,(S=this.vNodes)==null||S.setInfo(a,{rect:T,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:T&&At.getCenterPos(T,c)}),T));case 8:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x67){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getScaleType",value:function getScaleType(t){var r=t.uniformScale,n=t.rotate;return r!==!1||n&&Math.abs(n)%90>0?Qt.proportional:Qt.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,i=t.vNodes,l=t.targetNode,o=n.translate,a=n.originPoint,c=n.scenePoint,m=n.scale,f=n.angle,v=n.isLocked,S=n.zIndex,E=n.strokeColor,T=l&&ue(l)||i.get(r.name);if(!T)return;var P=r.parent;if(P){if(E&&(T.opt.strokeColor=E),he(S)&&(r.setAttribute("zIndex",S),T.opt.zIndex=S),ke(v)&&(T.opt.locked=v),a&&c&&m&&o){var _T$opt=T.opt,_x68=_T$opt.centerX,_h39=_T$opt.centerY,p=_T$opt.width,d=_T$opt.height,g=_T$opt.uniformScale,O=g!==!1?[m[0],m[0]]:m,w=[_x68,_h39],L=[_x68,_h39];vn(L,c,O,o);var B=[L[0]-w[0],L[1]-w[1]];if(T.centerPos=[T.centerPos[0]+B[0],T.centerPos[1]+B[1]],T.opt.width=Math.round(p*O[0]),T.opt.height=Math.round(d*O[1]),T.opt.centerX=L[0],T.opt.centerY=L[1],T.opt.eraserlines){var _iterator31=_createForOfIteratorHelper(T.opt.eraserlines),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var A=_step31.value;var b=A.op,W=A.thickness;A.thickness=Math.round(W*Math.max(m[0],m[1]));for(var D=0;D<b.length;D++)yn(b[D],c,m,o);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}}else if(o){if(T.opt.centerX=T.opt.centerX+o[0],T.opt.centerY=T.opt.centerY+o[1],T.centerPos=[T.centerPos[0]+o[0],T.centerPos[1]+o[1]],T.opt.eraserlines){var _iterator32=_createForOfIteratorHelper(T.opt.eraserlines),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _x69=_step32.value;var _h40=_x69.op;for(var _p12=0;_p12<_h40.length;_p12++){var _d16=_h40[_p12].map(function(g,O){return O%2?g+o[1]:g+o[0];});_x69.op[_p12]=_d16;}}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}}}else if(he(f))if(T.opt.rotate=f,T.scaleType=lr.getScaleType(T.opt),l){var _x70=as(T.rect,f);T.rect=_x70;}else{var _x71=At.getRectFromLayer(P,r.name);T.rect=_x71||T.rect;}return T&&i.setInfo(r.name,T),T==null?void 0:T.rect;}}}]);}(At);var is=/*#__PURE__*/function(_At12){function is(t){var _this83;_classCallCheck(this,is);_this83=_callSuper(this,is,[t]);ot(_this83,"canRotate",!1);ot(_this83,"scaleType",Qt.both);ot(_this83,"toolsType",pt.Straight);ot(_this83,"tmpPoints",[]);ot(_this83,"workOptions");ot(_this83,"oldRect");ot(_this83,"straightTipWidth");ot(_this83,"syncTimestamp");_this83.workOptions=t.toolsOpt,_this83.straightTipWidth=_this83.workOptions.thickness/2,_this83.syncTimestamp=0,_this83.syncUnitTime=50;return _this83;}_inherits(is,_At12);return _createClass(is,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,i=t.isSubWorker,l=t.isMainThread,o=t.smoothSync,a=t.isSimpleWorker,c=this.workId,m=r.op,f=r.syncUnitTime,v=m==null?void 0:m.length;if(!v||v<2)return{type:dt.None};f&&(this.syncUnitTime=f);var S;if(this.tmpPoints.length===0?(this.tmpPoints=[new Nt(m[0],m[1])],S=!1):S=this.updateTempPoints(m),!S)return{type:dt.None};var E;if(i||l||a){var P=n?this.fullLayer:this.drawLayer||this.fullLayer;E=this.draw({workId:c,layer:P});}if(a){var _P18=bt(E,this.oldRect);this.oldRect=E;var _x72=_objectSpread({rect:_P18,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);if(o){var _h41=Date.now();_h41-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_h41,_x72.op=this.tmpPoints.map(function(p){return[].concat(_toConsumableArray(p.XY),[0]);}).flat(1),_x72.index=0,_x72.isSync=!0);}return _x72;}if(!i&&o){var _P19=Date.now();return _P19-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_P19,_objectSpread({type:dt.DrawWork,dataType:Dt.Local,op:this.tmpPoints.map(function(x){return[].concat(_toConsumableArray(x.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:dt.None};}var T=bt(E,this.oldRect);return this.oldRect=E,_objectSpread({rect:T,type:dt.DrawWork,dataType:Dt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var o;var t=this.workId;if(this.tmpPoints.length<2)return{type:dt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var i=this.tmpPoints.map(function(a){return[].concat(_toConsumableArray(a.XY),[0]);}).flat(1),l=ve(i);return(o=this.vNodes)==null||o.setInfo(t,{rect:n,op:i,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&At.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:dt.FullWork,dataType:Dt.Local,ops:l,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines6=t.isDrawEraserlines,i=_t$isDrawEraserlines6===void 0?!0:_t$isDrawEraserlines6,_this$workOptions15=this.workOptions,l=_this$workOptions15.strokeColor,o=_this$workOptions15.thickness,a=_this$workOptions15.zIndex,c=_this$workOptions15.scale,m=_this$workOptions15.rotate,f=_this$workOptions15.translate,v=_this$workOptions15.strokeType,S=_this$workOptions15.eraserlines,E=n.worldPosition,T=n.worldScaling,_this$computDrawPoint9=this.computDrawPoints(o,v),P=_this$computDrawPoint9.d,x=_this$computDrawPoint9.rect,h=_this$computDrawPoint9.isDot,p=[x.x+x.w/2,x.y+x.h/2],d=new ye({pos:p,anchor:[0.5,0.5],size:[x.w,x.h],name:r,id:r,normalize:!0,zIndex:a}),g={pos:[0,0],normalize:!0,d:P,fillColor:l,strokeColor:l,lineDash:v===Zt.Dotted&&!h?[1,o*2]:v===Zt.LongDotted&&!h?[o,o*2]:void 0,lineCap:v===Zt.Normal||h?void 0:"round",lineWidth:v===Zt.Normal||h?0:o};c&&(g.scale=c),m&&(g.rotate=m),f&&(g.translate=f);var O=new be(g);d.append(O),S&&(this.scaleType=Qt.proportional,this.drawEraserlines({group:d,eraserlines:S,pos:p,layer:n},i)),this.replace(n,r,d);var w={x:Math.floor(x.x*T[0]+E[0]-At.SafeBorderPadding),y:Math.floor(x.y*T[1]+E[1]-At.SafeBorderPadding),w:Math.floor(x.w*T[0]+2*At.SafeBorderPadding),h:Math.floor(x.h*T[1]+2*At.SafeBorderPadding)};if(m||c||f){var L=O.getBoundingClientRect();w={x:Math.floor(L.x-At.SafeBorderPadding),y:Math.floor(L.y-At.SafeBorderPadding),w:Math.floor(L.width+At.SafeBorderPadding*2),h:Math.floor(L.height+At.SafeBorderPadding*2)};}return this.isDelete&&d.setAttribute("opacity",0),w;}},{key:"computDrawPoints",value:function computDrawPoints(t,r){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t,r):this.computDotPoints(t);}},{key:"computFullPoints",value:function computFullPoints(t,r){var n=at.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),i=at.Per(n).mul(t/2),l=Nt.Sub(this.tmpPoints[0],i),o=Nt.Add(this.tmpPoints[0],i),a=Nt.Sub(this.tmpPoints[1],i),c=Nt.Add(this.tmpPoints[1],i),m=Nt.GetSemicircleStroke(this.tmpPoints[1],a,-1,8),f=Nt.GetSemicircleStroke(this.tmpPoints[0],o,-1,8),v=[l,a].concat(_toConsumableArray(m),[c,o],_toConsumableArray(f));var S;return r!==Zt.Normal?S=De(this.tmpPoints,!1):S=De(v,!0),{d:S,rect:_t(v),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var r=Nt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:De(r,!0),rect:_t(r),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Nt(r[0],r[1]),i=this.tmpPoints[0],l=this.workOptions.thickness;if(i.isNear(n,l))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var c,m;var r=t.op,n=t.isFullWork,_t$workState8=t.workState,i=_t$workState8===void 0?Ft.Done:_t$workState8,l=(c=this.workId)==null?void 0:c.toString();if(!l)return;this.tmpPoints.length=0;for(var f=0;f<r.length;f+=3)this.tmpPoints.push(new Nt(r[f],r[f+1],r[f+2]));var o=n?this.fullLayer:this.drawLayer||this.fullLayer,a=this.draw({workId:l,layer:o,isDrawEraserlines:i===Ft.Done});return this.oldRect=a,(m=this.vNodes)==null||m.setInfo(l,{rect:a,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&At.getCenterPos(a,o)}),a;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var c,m;var r=t.node,n=t.opt,i=t.vNodes,l=n.strokeColor,o=n.strokeType,a=i.get(r.name);return l&&(r.tagName==="GROUP"?r.children.forEach(function(f){f.setAttribute("strokeColor",l),f.getAttribute("fillColor")&&f.setAttribute("fillColor",l);}):(r.setAttribute("strokeColor",l),r.setAttribute("fillColor",l)),(c=a==null?void 0:a.opt)!=null&&c.strokeColor&&(a.opt.strokeColor=l)),o&&a!=null&&a.opt&&(m=a.opt)!=null&&m.strokeType&&(a.opt.strokeType=o),a&&i.setInfo(r.name,a),At.updateNodeOpt(t);}}]);}(At);var Re=/*#__PURE__*/function(_At13){function Re(t){var _this84;_classCallCheck(this,Re);_this84=_callSuper(this,Re,[t]);ot(_this84,"canRotate",!1);ot(_this84,"scaleType",Qt.proportional);ot(_this84,"toolsType",pt.Text);ot(_this84,"tmpPoints",[]);ot(_this84,"workOptions");ot(_this84,"oldRect");_this84.workOptions=t.toolsOpt;return _this84;}_inherits(Re,_At13);return _createClass(Re,[{key:"consume",value:function consume(){return{type:dt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:dt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var r,n,i,_this$workOptions16,l,o,a,c,m,f,v,S,E,T,P,_x74;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:r=t.workId,n=t.layer,i=t.isDrawLabel,_this$workOptions16=this.workOptions,l=_this$workOptions16.boxSize,o=_this$workOptions16.boxPoint,a=_this$workOptions16.zIndex,c=n.worldPosition,m=n.worldScaling;if(!(!o||!l)){_context26.next=3;break;}return _context26.abrupt("return");case 3:f={name:r,id:r,pos:[o[0],o[1]],anchor:[0,0],size:l,zIndex:a},v=new ye(f),S={x:o[0],y:o[1],w:l[0],h:l[1]},E={x:Math.floor(S.x*m[0]+c[0]),y:Math.floor(S.y*m[1]+c[1]),w:Math.floor(S.w*m[0])+2,h:Math.floor(S.h*m[1])+2};if(!(this.replace(n,r,v),i&&n&&this.workOptions.text)){_context26.next=11;break;}_context26.next=7;return Re.createLabels(this.workOptions,n,E);case 7:T=_context26.sent;P=T.labels;_x74=T.maxWidth;v.append.apply(v,_toConsumableArray(P)),E.w=Math.ceil(Math.max(_x74*n.worldScaling[0],E.w));case 11:return _context26.abrupt("return",E);case 12:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x73){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var c,m,f,v,r,n,i,l,o,a;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:r=(c=this.workId)==null?void 0:c.toString();if(r){_context27.next=3;break;}return _context27.abrupt("return");case 3:n=t.isFullWork,i=t.replaceId,l=t.isDrawLabel;this.oldRect=i&&((f=(m=this.vNodes)==null?void 0:m.get(i))==null?void 0:f.rect)||void 0;o=n?this.fullLayer:this.drawLayer||this.fullLayer;_context27.next=8;return this.draw({workId:r,layer:o,isDrawLabel:_typeof(l)>"u"&&this.workOptions.workState===Ft.Done||l});case 8:a=_context27.sent;return _context27.abrupt("return",((v=this.vNodes)==null||v.setInfo(r,{rect:a,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&At.getCenterPos(a,o)}),a));case 10:case"end":return _context27.stop();}},_callee25,this);}));function consumeServiceAsync(_x75){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(t,r){var E,T,n,i,l,o,a,c,m,f,v,S;return _regeneratorRuntime().wrap(function _callee26$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:if(this.workId){_context28.next=2;break;}return _context28.abrupt("return");case 2:n=this.workId.toString(),i=t.fontColor,l=t.fontBgColor,o=t.bold,a=t.italic,c=t.lineThrough,m=t.underline,f=t.zIndex,v=(E=this.vNodes)==null?void 0:E.get(n);if(v){_context28.next=5;break;}return _context28.abrupt("return");case 5:i&&(v.opt.fontColor=i),l&&(v.opt.fontBgColor=l),o&&(v.opt.bold=o),a&&(v.opt.italic=a),ke(c)&&(v.opt.lineThrough=c),ke(m)&&(v.opt.underline=m),he(f)&&(v.opt.zIndex=f),this.oldRect=v.rect;_context28.next=8;return this.draw({workId:n,layer:this.fullLayer,isDrawLabel:_typeof(r)>"u"&&this.workOptions.workState===Ft.Done||r});case 8:S=_context28.sent;return _context28.abrupt("return",((T=this.vNodes)==null||T.setInfo(n,{rect:S,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:S&&At.getCenterPos(S,this.fullLayer)}),S));case 10:case"end":return _context28.stop();}},_callee26,this);}));function updataOptServiceAsync(_x76,_x77){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getSafetySnippetRatio",value:function getSafetySnippetRatio(t){var r=(t==null?void 0:t.parent).displayRatio||1,n=Math.ceil(t.worldScaling[0]*10)/10;var i=n;return n>=0.2&&n<1?i=n*r:n<=2&&n>=1?i=n*r*1.6:n>2&&n<=3?i=n*r*1.4:n>3&&n<=4?i=n*r*0.8:n>4&&(i=n*r*0.6),Math.floor(i*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(Re.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t,r,n){var b,i,l,o,_ref168,a,c,m,f,v,S,E,T,P,x,h,p,d,g,O,w,L,B,A,W,D,R,X,H,J,et,it,$,V,rt,ct,gt,st,Ct,xt,F,U,K,q,lt,_st2,_Ct,_xt,_st3,_Ct2,_ct3,_gt2;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:i=[],l=n.x,o=n.y,_ref168=(b=r.parent)==null?void 0:b.parent,a=_ref168.width,c=_ref168.height,m=Qe(t.text),f=m.length,v=t.fontSize,S=t.lineHeight,E=t.bold,T=t.textAlign,P=t.italic,x=t.fontFamily,h=t.verticalAlign,p=t.fontColor,d=t.fontBgColor,g=t.underline,O=t.lineThrough,w=Re.getSafetySnippetRatio(r)||1,L=Math.floor(v*w),B=Re.getSafetySnippetFontLength(L);A=0;W=0;case 3:if(!(W<f)){_context29.next=33;break;}D=m[W],R=S||L*1.5;if(!D){_context29.next=30;break;}X=Cm(D),H=[0,0],J=[0,v*1.2];h==="middle"&&(H[1]=W*v*1.2+5);et=[0,-v*0.15];H[0]=5;it=Math.sin(Math.PI/180*20);$=0;V=[];rt=0;case 14:if(!(rt<X)){_context29.next=27;break;}T==="left"&&(et[0]=$),rt===0&&P==="italic"&&(et[0]=et[0]-it/2*v);ct=D.slice(rt,rt+B);gt={anchor:[0,0],pos:et,text:ct,fontFamily:x,fontSize:L,lineHeight:R,strokeColor:p,fontWeight:E,fillColor:p,textAlign:T,fontStyle:P,scale:[1/w,1/w]};st=new so(gt);_context29.next=21;return st.textImageReady;case 21:Ct=_context29.sent;xt=!0;if(Ct){F=Ct.rect&&Ct.rect[2],U=Ct.rect&&Ct.rect[3];if(F&&U){K=F/w,q=U/w;$=K+$,P==="italic"&&(E==="bold"?$=$-it*v*1.2:$=$-it*v),((et[0]+H[0]+K)*r.worldScaling[0]+l<=0||(et[0]+H[0])*r.worldScaling[0]+l>=a||(et[1]+H[1]+q)*r.worldScaling[1]+o<=0||(et[1]+H[1])*r.worldScaling[1]+o>=c)&&(st.disconnect(),xt=!1),xt&&V.push(st);}}rt+=B;case 25:_context29.next=14;break;case 27:J[0]=$,P==="italic"&&(J[0]=J[0]+it*v),A=Math.max(A,J[0]);lt=!0;if(((H[0]+J[0])*r.worldScaling[0]+l<=0||H[0]*r.worldScaling[0]+l>=a||(H[1]+J[1])*r.worldScaling[0]+o<=0||H[1]*r.worldScaling[1]+o>=c)&&(lt=!1),lt){if(g){_st2=Math.floor(v/10),_Ct={normalize:!1,pos:[0,v*1.1+_st2/2],lineWidth:_st2,points:[0,0,Math.ceil(J[0]),0],strokeColor:p,className:"underline"},_xt=new we(_Ct);V.push(_xt);}if(O){_st3={normalize:!1,pos:[0,v*1.2/2],lineWidth:Math.floor(v/10),points:[0,0,Math.ceil(J[0]),0],strokeColor:p,className:"lineThrough"},_Ct2=new we(_st3);V.push(_Ct2);}_ct3={pos:H,anchor:[0,0],size:J,bgcolor:d},_gt2=new ye(_ct3);_gt2.append.apply(_gt2,V),i.push(_gt2);}case 30:W++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:i,maxWidth:A});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x78,_x79,_x80){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,i=t.vNodes,l=t.targetNode,o=n.fontBgColor,a=n.fontColor,c=n.translate,m=n.originPoint,f=n.scenePoint,v=n.scale,S=n.bold,E=n.italic,T=n.lineThrough,P=n.underline,x=n.fontSize,h=n.textInfos,p=n.zIndex,d=l&&ue(l)||i.get(r.name);if(!d||!r.parent)return;var O=d.opt;if(he(p)&&(r.setAttribute("zIndex",p),d.opt.zIndex=p),a&&O.fontColor&&(O.fontColor=a,r.children.forEach(function(w){w.tagName==="GROUP"&&w.children.forEach(function(L){L.tagName==="LABEL"?(L.setAttribute("fillColor",a),L.setAttribute("strokeColor",a)):L.tagName==="POLYLINE"&&L.setAttribute("strokeColor",a);});})),o&&O.fontBgColor&&(O.fontBgColor=o,r.children.forEach(function(w){w.tagName==="GROUP"&&w.setAttribute("bgcolor",o);})),S&&(O.bold=S),E&&(O.italic=E),ke(T)&&(O.lineThrough=T),ke(P)&&(O.underline=P),x&&(O.fontSize=x),m&&f&&v&&l&&O.boxPoint){var w=h==null?void 0:h.get(r.name);if(w){var b=w.fontSize,W=w.boxSize;O.boxSize=W||O.boxSize,O.fontSize=b||O.fontSize;}var L=[O.boxPoint[0],O.boxPoint[1]];vn(O.boxPoint,f,v,c);var B=[d.op[0],d.op[1]],A=[B[0]-L[0],B[1]-L[1]];if(d.centerPos=[d.centerPos[0]+A[0],d.centerPos[1]+A[1]],d.opt.eraserlines){var _iterator33=_createForOfIteratorHelper(d.opt.eraserlines),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _b20=_step33.value;var _W10=_b20.op,D=_b20.thickness;_b20.thickness=Math.round(D*Math.max(v[0],v[1]));for(var R=0;R<_W10.length;R++)yn(_W10[R],f,v,c);}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}}}else if(c&&O.boxPoint&&(O.boxPoint=[O.boxPoint[0]+c[0],O.boxPoint[1]+c[1]],d.centerPos=[d.centerPos[0]+c[0],d.centerPos[1]+c[1]],d.opt.eraserlines)){var _iterator34=_createForOfIteratorHelper(d.opt.eraserlines),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _w7=_step34.value;var _L6=_w7.op;for(var _B22=0;_B22<_L6.length;_B22++){var _A20=_L6[_B22].map(function(b,W){return W%2?b+c[1]:b+c[0];});_w7.op[_B22]=_A20;}}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}}return d&&i.setInfo(r.name,d),d==null?void 0:d.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,r){var n=t.getElementsByName(r)[0];if(n){var i=n.getBoundingClientRect();var l={x:Math.floor(i.x),y:Math.floor(i.y),w:Math.floor(i.width+2),h:Math.floor(i.height+2)};return n.children.forEach(function(o){if(o.tagName==="GROUP"){var a=n.getBoundingClientRect();l=bt(l,{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.floor(a.width+2),h:Math.floor(a.height+2)});}}),l;}}}]);}(At);// 4k
437
- ot(Re,"textImageSnippetSize",1024*4),ot(Re,"SafeBorderPadding",30);var cr=Re;var Ke=/*#__PURE__*/function(_At14){function Ke(t){var _this85;_classCallCheck(this,Ke);_this85=_callSuper(this,Ke,[t]);ot(_this85,"canRotate",!1);ot(_this85,"scaleType",Qt.none);ot(_this85,"toolsType",pt.PencilEraser);ot(_this85,"tmpPoints",[]);ot(_this85,"workOptions");ot(_this85,"worldPosition");ot(_this85,"worldScaling");ot(_this85,"eraserRect");ot(_this85,"eraserPolyline");_this85.workOptions=t.toolsOpt,_this85.worldPosition=_this85.fullLayer.worldPosition,_this85.worldScaling=_this85.fullLayer.worldScaling;return _this85;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Ke,_At14);return _createClass(Ke,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:dt.None};var n=this.workOptions.thickness,_Ke$eraserSizes$n=Ke.eraserSizes[n],i=_Ke$eraserSizes$n.width,l=_Ke$eraserSizes$n.height,o=Math.round(Math.max(i,l)/this.worldScaling[0]),_this$getChangeNodes=this.getChangeNodes(o,r),a=_this$getChangeNodes.rect,c=_this$getChangeNodes.willNewNodes,m=_this$getChangeNodes.willDeleteNodes;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,rect:a,willNewNodes:c,willDeleteNodes:m});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var i=Date.now();for(var l=0;l<t.length;l+=2){var o=this.tmpPoints.length,a=new Nt(t[l],t[l+1]);if(o===0){this.tmpPoints.push(a);continue;}var c=o-1,m=this.tmpPoints[c],f=at.Sub(a,m).uni();a.isNear(m,r/2)||(at.Equals(f,m.v,0.02)&&(this.tmpPoints.pop(),n--),a.setv(f),a.setT(i),this.tmpPoints.push(a));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var n=/* @__PURE__ */new Map(),i=/* @__PURE__ */new Set();var l;if(!this.vNodes)return{willDeleteNodes:i,willNewNodes:n,rect:l};var o=this.worldPosition;var a=_t(this.tmpPoints,t);a=fr(a,o),a=ls(a,this.worldScaling,o);var _this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(a),c=_this$vNodes$getRectI3.nodeRange;if(!c.size)return{willDeleteNodes:i,willNewNodes:n,rect:l};var m=this.computEraserPointLines(this.tmpPoints,90);var _iterator35=_createForOfIteratorHelper(c.entries()),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _step35$value=_slicedToArray(_step35.value,2),f=_step35$value[0],v=_step35$value[1];if(v.toolsType!==pt.Pencil)continue;var S=fr(v.rect,[-o[0],-o[1]]);S={x:S.x/this.worldScaling[0],y:S.y/this.worldScaling[1],w:S.w/this.worldScaling[0],h:S.h/this.worldScaling[1]};var E=[S.x,S.y,S.x+S.w,S.y+S.h],T=[],P=[];var _iterator36=_createForOfIteratorHelper(m),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _x83=_step36.value;un.polyline(_x83,E,T);}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}if(T.length&&v.opt){var _iterator37=_createForOfIteratorHelper(T),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _x81=_step37.value;var _h42=[];for(var p=0;p<_x81.length;p++)p!==0&&Me(_x81[p],_x81[p-1])||_h42.push.apply(_h42,_toConsumableArray(_x81[p]));P.push(_h42);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}if(P.length&&r){var _x82=r.createWorkShapeNode({workId:f,toolsType:pt.Pencil,toolsOpt:v.opt});_x82.setWorkId(f);var _h43=_x82==null?void 0:_x82.computPencilPoints({op:v.op,eraserPolylines:P,eraserThickness:t});if(l=bt(l,v.rect),i.add(f),r.removeNode(f),_h43.length)for(var _p13=0;_p13<_h43.length;_p13++){var d="".concat(f,"_").concat(Date.now(),"_").concat(_p13),g=d,w=r.setFullWork({workId:g,opt:v.opt,toolsType:pt.Pencil}).consumeService({op:_h43[_p13],isFullWork:!0,replaceId:g});r.clearWorkShapeNodeCache(g),l=bt(l,w),n.set(d,_objectSpread(_objectSpread({},v),{},{toolsType:pt.Pencil,rect:w!==null&&w!==void 0?w:v.rect,name:d,op:_h43[_p13]}));}}}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}return{willNewNodes:n,willDeleteNodes:i,rect:l};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:dt.None},this.baseConsumeResult);var i=this.workOptions.thickness,_Ke$eraserSizes$i=Ke.eraserSizes[i],l=_Ke$eraserSizes$i.width,o=_Ke$eraserSizes$i.height,a=Math.max(l,o)/this.worldScaling[0];return this.updateTempPoints(n,a),_objectSpread({type:dt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var i=0;var l=360-r;for(var o=1;o<t.length;o++){var a=t[o-1],c=t[o];if(o===1&&i===0&&(n[i]=[a.XY]),n[i].push(c.XY),o<t.length-1){var m=c.getAngleByPoints(a,t[o+1]);(m<r||m>l)&&(i++,n[i]=[c.XY]);}}return t.length===1&&n.length===0&&n.push([t[0].XY,t[0].XY]),n;}},{key:"consumeAll",value:function consumeAll(t){var r=t.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:dt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_Ke$eraserSizes$n2=Ke.eraserSizes[n],i=_Ke$eraserSizes$n2.width,l=_Ke$eraserSizes$n2.height,o=Math.max(i,l)/this.worldScaling[0],_this$getChangeNodes2=this.getChangeNodes(o,r),a=_this$getChangeNodes2.willDeleteNodes,c=_this$getChangeNodes2.willNewNodes,m=_this$getChangeNodes2.rect;if(a.size===0&&c.size===0)return _objectSpread(_objectSpread({type:dt.FullWork},this.baseConsumeResult),{},{rect:m});var f=[];this.tmpPoints.map(function(S){f.push(S.x,S.y,o/2);});var v=ve(f);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.FullWork,dataType:Dt.Local,rect:m,ops:v,willNewNodes:c,willDeleteNodes:a});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(At);// 来源于white-sdk
438
- ot(Ke,"eraserSizes",fn);var Er=Ke;var Ze=/*#__PURE__*/function(_At15){function Ze(t){var _this86;_classCallCheck(this,Ze);_this86=_callSuper(this,Ze,[t]);ot(_this86,"canRotate",!1);ot(_this86,"scaleType",Qt.none);ot(_this86,"toolsType",pt.BitMapEraser);ot(_this86,"tmpPoints",[]);ot(_this86,"workOptions");ot(_this86,"worldPosition");ot(_this86,"worldScaling");ot(_this86,"eraserRect");ot(_this86,"eraserPolyline");ot(_this86,"oldRect");_this86.workOptions=t.toolsOpt,_this86.worldPosition=_this86.fullLayer.worldPosition,_this86.worldScaling=_this86.fullLayer.worldScaling;return _this86;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Ze,_At15);return _createClass(Ze,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:dt.None};var n=this.workOptions.thickness,_Ze$eraserSizes$n=Ze.eraserSizes[n],i=_Ze$eraserSizes$n.width,l=_Ze$eraserSizes$n.height,o=Math.round(Math.max(i,l)/this.worldScaling[0]),_this$getChangeNodes3=this.getChangeNodes(o,r),a=_this$getChangeNodes3.willDeleteNodes,c=_this$getChangeNodes3.rect;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.DrawWork,rect:c,willDeleteNodes:a});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var i=Date.now();for(var l=0;l<t.length;l+=2){var o=this.tmpPoints.length,a=new Nt(t[l],t[l+1]);if(o===0){this.tmpPoints.push(a);continue;}var c=o-1,m=this.tmpPoints[c],f=at.Sub(a,m).uni();a.isNear(m,r/2)||(at.Equals(f,m.v,0.02)&&(this.tmpPoints.pop(),n--),a.setv(f),a.setT(i),this.tmpPoints.push(a));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var _this87=this;var n=/* @__PURE__ */new Map(),i=/* @__PURE__ */new Set();var l;if(!this.vNodes)return{willDeleteNodes:i,willUpdateNodes:n,rect:l};var o=this.worldPosition;var a=_t(this.tmpPoints,t);a=fr(a,o),a=ls(a,this.worldScaling,o);var _this$vNodes$getRectI4=this.vNodes.getRectIntersectRange(a),c=_this$vNodes$getRectI4.nodeRange;if(!c.size)return{willDeleteNodes:i,willUpdateNodes:n,rect:l};var m=this.computEraserPointLines(this.tmpPoints,120);var _iterator38=_createForOfIteratorHelper(c.entries()),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _step38$value=_slicedToArray(_step38.value,2),f=_step38$value[0],v=_step38$value[1];if(v.toolsType===pt.Text||v.toolsType===pt.Image)continue;var S=fr(v.rect,[-o[0],-o[1]]);S={x:S.x/this.worldScaling[0],y:S.y/this.worldScaling[1],w:S.w/this.worldScaling[0],h:S.h/this.worldScaling[1]};var E=[S.x,S.y,S.x+S.w,S.y+S.h],T=[],P=[];var _iterator39=_createForOfIteratorHelper(m),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _p15=_step39.value;un.polyline(_p15,E,T);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}if(T.length&&v.opt){var _iterator40=_createForOfIteratorHelper(T),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var p=_step40.value;var d=[];for(var g=0;g<p.length&&!(isNaN(p[g][0])||isNaN(p[g][1]));g++){var O=p[g].map(function(w){return Math.round(w*100)/100;});if(g!==0){var w=p[g-1].map(function(L){return Math.round(L*100)/100;});if(Me(O,w))continue;}d.push.apply(d,_toConsumableArray(O));}d.length!==0&&P.push(d);}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}}if(!P.length)continue;var _x84=v.opt.eraserlines?v.opt.eraserlines:[],_h44=_x84.find(function(p){return p.workId===_this87.workId;});if(_h44?_h44.op=P:_x84.push({workId:this.workId,op:P,thickness:t}),v.opt.eraserlines=_x84,r){var _p14=v.toolsType,_d17=r.createWorkShapeNode({workId:f,toolsType:_p14,toolsOpt:v.opt});_d17==null||_d17.setWorkId(f);var _g13=_d17==null?void 0:_d17.consumeService({op:v.op,isFullWork:!0,replaceId:f});if(l=bt(l,_g13),_d17!=null&&_d17.isDelete){r.removeNode(f),i.add(f);continue;}}n.set(f,v);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return{willUpdateNodes:n,willDeleteNodes:i,rect:l};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:dt.None},this.baseConsumeResult);var i=this.workOptions.thickness,_Ze$eraserSizes$i=Ze.eraserSizes[i],l=_Ze$eraserSizes$i.width,o=_Ze$eraserSizes$i.height,a=Math.round(Math.max(l,o)/this.worldScaling[0]);return this.updateTempPoints(n,a),_objectSpread({type:dt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var i=0;var l=360-r;for(var o=1;o<t.length;o++){var a=t[o-1],c=t[o];if(o===1&&i===0&&(n[i]=[a.XY]),n[i].push(c.XY),o<t.length-1){var m=c.getAngleByPoints(a,t[o+1]);(m<r||m>l)&&(i++,n[i]=[c.XY]);}}return t.length===1&&n.length===0&&n.push([t[0].XY,t[0].XY]),n;}},{key:"consumeAll",value:function consumeAll(t){var r=t.workerEngine;if(this.replace(this.fullLayer,this.workId),!this.tmpPoints.length)return _objectSpread({type:dt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_Ze$eraserSizes$n2=Ze.eraserSizes[n],i=_Ze$eraserSizes$n2.width,l=_Ze$eraserSizes$n2.height,o=Math.round(Math.max(i,l)/this.worldScaling[0]),_this$getChangeNodes4=this.getChangeNodes(o,r),a=_this$getChangeNodes4.willDeleteNodes,c=_this$getChangeNodes4.willUpdateNodes,m=_this$getChangeNodes4.rect;if(a.size===0&&c.size===0)return _objectSpread(_objectSpread({type:dt.FullWork},this.baseConsumeResult),{},{rect:m});var f=[];this.tmpPoints.map(function(S){f.push(S.x,S.y,o/2);});var v=ve(f);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:dt.FullWork,dataType:Dt.Local,rect:m,ops:v,willUpdateNodes:c,willDeleteNodes:a});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(At);// 来源于white-sdk
439
- ot(Ze,"eraserSizes",fn);var Mr=Ze;function ss(u){switch(u){case pt.Arrow:return qi;case pt.Pencil:return Ki;case pt.Straight:return is;case pt.Ellipse:return _i;case pt.Polygon:case pt.Triangle:return rs;case pt.Star:case pt.Rhombus:return es;case pt.Rectangle:return ts;case pt.SpeechBalloon:return ns;case pt.Text:return cr;case pt.LaserPen:return Zi;case pt.Eraser:return Ir;case pt.PencilEraser:return Er;case pt.BitMapEraser:return Mr;case pt.Selector:return ar;case pt.Image:return lr;}}function Ur(u,e){var t=u.toolsType,r=_objectWithoutProperties(u,_excluded);switch(t){case pt.Arrow:return new qi(r);case pt.Pencil:return new Ki(r);case pt.Straight:return new is(r);case pt.Ellipse:return new _i(r);case pt.Polygon:case pt.Triangle:return new rs(r);case pt.Star:case pt.Rhombus:return new es(r);case pt.Rectangle:return new ts(r);case pt.SpeechBalloon:return new ns(r);case pt.Text:return new cr(r);case pt.LaserPen:return new Zi(r);case pt.Eraser:return new Ir(r,e);case pt.BitMapEraser:return new Mr(r);case pt.PencilEraser:return new Er(r);case pt.Selector:return r.vNodes?new ar(_objectSpread(_objectSpread({},r),{},{vNodes:r.vNodes,drawLayer:r.fullLayer})):void 0;case pt.Image:return new lr(r);default:return;}}function os(u){var e=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL"];var _iterator41=_createForOfIteratorHelper(u),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var r=_step41.value;if(r.tagName==="GROUP"&&r.children.length){var n=os(r.children);e.push.apply(e,_toConsumableArray(n));}r.tagName&&t.includes(r.tagName)&&e.push(r);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}return e;}function bt(u,e){if(u&&e){var t=Math.min(u.x,e.x),r=Math.min(u.y,e.y),n=Math.max(u.x+u.w,e.x+e.w),i=Math.max(u.y+u.h,e.y+e.h),l=n-t,o=i-r;return{x:t,y:r,w:l,h:o};}return e||u;}function _t(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var t={x:0,y:0,w:0,h:0};var r=1/0,n=1/0,i=-1/0,l=-1/0;return u.forEach(function(o){var _o$XY=_slicedToArray(o.XY,2),a=_o$XY[0],c=_o$XY[1];r=Math.min(r,a-e),n=Math.min(n,c-e),i=Math.max(i,a+e),l=Math.max(l,c+e);}),t.x=r,t.y=n,t.w=i-r,t.h=l-n,t;}function Jr(u,e){return!(u.x+u.w<e.x||u.x>e.x+e.w||u.y+u.h<e.y||u.y>e.y+e.h);}function kt(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(u.x-e),y:Math.floor(u.y-e),w:Math.ceil(u.w+e*2),h:Math.ceil(u.h+e*2)};}function fr(u,e){return{x:u.x+e[0],y:u.y+e[1],w:u.w,h:u.h};}function dm(u,e){var t=new at(u.x,u.y),r=new at(u.x+u.w,u.y),n=new at(u.x+u.w,u.y+u.h),i=new at(u.x,u.y+u.h),l=new at(u.x+u.w/2,u.y+u.h/2),o=Math.PI*e/180,a=at.RotWith(t,l,o),c=at.RotWith(r,l,o),m=at.RotWith(n,l,o),f=at.RotWith(i,l,o);return[a,c,m,f];}function as(u,e){var t=dm(u,e);return _t(t);}function ls(u,e,t){var r=new at(u.x,u.y),n=new at(u.x+u.w,u.y),i=new at(u.x+u.w,u.y+u.h),l=new at(u.x,u.y+u.h),o=new at(t[0],t[1]),a=new at(e[0],e[1]),c=at.ScaleWOrigin(r,a,o),m=at.ScaleWOrigin(n,a,o),f=at.ScaleWOrigin(i,a,o),v=at.ScaleWOrigin(l,a,o);return _t([c,m,f,v]);}function pm(u,e,t){var r=new at(e[0],e[1]);for(var n=0;n<u.length;n+=3){var i=new at(u[n],u[n+1]),l=Math.PI*t/180,o=at.RotWith(i,r,l);u[n]=o.x,u[n+1]=o.y;}}function mm(u,e,t){var r=new at(e[0],e[1]);for(var n=0;n<u.length;n+=2){var i=new at(u[n],u[n+1]),l=Math.PI*t/180,o=at.RotWith(i,r,l);u[n]=o.x,u[n+1]=o.y;}}function vn(u,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new at(e[0],e[1]);for(var i=0;i<u.length;i+=3){var l=new at(u[i],u[i+1]),o=new at(t[0],t[1]),a=at.ScaleWOrigin(l,o,n);u[i]=a.x+r[0],u[i+1]=a.y+r[1];}}function yn(u,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new at(e[0],e[1]);for(var i=0;i<u.length;i+=2){var l=new at(u[i],u[i+1]),o=new at(t[0],t[1]),a=at.ScaleWOrigin(l,o,n);u[i]=a.x+r[0],u[i+1]=a.y+r[1];}}function vm(u,e){return u[0]>=e.x&&u[0]<=e.x+e.w&&u[1]>=e.y&&u[1]<=e.y+e.h;}function cs(u,e){var t=u<=e?1:u/e,r=e<=u?1:e/u;return[t,r];}function ym(u){var _iterator42=_createForOfIteratorHelper(u),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var _e3=_step42.value;if(isNaN(_e3)||_e3===1/0||_e3===-1/0)return!1;}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}return!0;}function gm(u){return u!==Math.floor(u);}function Pm(u){var e=u.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0;}function Sm(u,e){for(;e!==0;){var _ref169=[e,u%e];u=_ref169[0];e=_ref169[1];}return u;}var xm=function xm(u){if(u.tagName==="GROUP"){var _e4=Object.getOwnPropertySymbols(u).find(function(t){return t.toString()==="Symbol(sealed)";});if(_e4&&u[_e4])return!0;}return!1;},_pe=function pe(u,e){if(u.mesh&&u.mesh.texture&&u.name==="eraserTexture"){var t=u.mesh.texture.image;e.deleteTexture(t);}else if(u.tagName==="GROUP"&&u&&u.children){var _iterator43=_createForOfIteratorHelper(u.children),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _t3=_step43.value;_pe(_t3,e);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}},Te=function Te(u,e){_pe(u,e),u.removeAllChildren();},Tm=function Tm(u,e,t){var r=t.parent;if(e){var n=e.children;if(n){var _iterator44=_createForOfIteratorHelper(n),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var i=_step44.value;if(_pe(i,r),i.tagName==="GROUP"){var _iterator45=_createForOfIteratorHelper(i.children),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var l=_step45.value;_pe(l,r);}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}}e.parent.replaceChild(u,e);},fs=function fs(u,e,t){if(u.w+u.x<=0||u.h+u.y<=0||u.w<=0||u.h<=0)return;var r=e.width,n=e.height,i={x:Math.floor(Math.max(0,u.x)),y:Math.floor(Math.max(0,u.y)),w:Math.floor(Math.min(r,u.w)),h:Math.floor(Math.min(n,u.h))};if(i.x+i.w>r&&(i.w=Math.floor(r-i.x)),i.y+i.h>n&&(i.h=Math.floor(n-i.y)),gm(t)){var l=Pm(t),o=Math.pow(10,l),a=Sm(o,t*o),c=i.x%a,m=i.x-c;m>=0?(i.x=m,i.w=i.w+c):(i.x=0,i.w=i.w+c-m);var f=i.y%a,v=i.y-f;v>=0?(i.y=v,i.h=i.h+f):(i.y=0,i.h=i.h+f-v);}return i;};function ze(u){return"".concat(Ar(u.x),",").concat(Ar(u.y)," ");}function $e(u,e){return"".concat(Ar((u.x+e.x)/2),",").concat(Ar((u.y+e.y)/2)," ");}function Ar(u){return+u.toFixed(4);}var or=function or(u,e){return u.x+u.w<e.x||u.x>e.x+e.w||u.y+u.h<e.y||u.y>e.y+e.h?Pe.outside:u.x>=e.x&&u.y>=e.y&&u.x+u.w<=e.x+e.w&&u.y+u.h<=e.y+e.h?Pe.inside:Pe.intersect;};function Cm(u){var e=0;for(var t=0;t<u.length;t++){var r=u.charCodeAt(t);r>=1&&r<=126||65376<=r&&r<=65439?e++:e+=2;}return e;}var He="cursorhover",oi=20,hr="mainView";var Im=/*#__PURE__*/function(){function Im(e,t){_classCallCheck(this,Im);ot(this,"viewId");ot(this,"scene");ot(this,"fullLayer");ot(this,"curNodeMap",/* @__PURE__ */new Map());ot(this,"targetNodeMap",[]);ot(this,"highLevelIds");ot(this,"canClearUids");ot(this,"localUid");this.viewId=e,this.scene=t;}return _createClass(Im,[{key:"init",value:function init(e){this.fullLayer=e;}},{key:"get",value:function get(e){return this.curNodeMap.get(e);}},{key:"setLocalUid",value:function setLocalUid(e){this.localUid=e;}},{key:"getLocalUid",value:function getLocalUid(){return this.localUid;}},{key:"setCanClearUids",value:function setCanClearUids(e){this.canClearUids=e;}},{key:"getCanClearUids",value:function getCanClearUids(){return this.canClearUids;}},{key:"getCanEraserNodes",value:function getCanEraserNodes(e,t){var r=/* @__PURE__ */new Map();var _iterator46=_createForOfIteratorHelper(e.entries()),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var _step46$value=_slicedToArray(_step46.value,2),n=_step46$value[0],i=_step46$value[1];i.toolsType===pt.Image&&(i.opt.locked||t&&t.disableEraseImage)||i.toolsType===pt.Text&&(i.opt.workState===Ft.Doing||i.opt.workState===Ft.Start||t&&t.disableEraseText)||this.isCanClearWorkId(n)&&r.set(n,i);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}return r;}},{key:"getNodesByType",value:function getNodesByType(e){var t=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(r,n){r.toolsType===e&&t.set(n,r);}),t;}},{key:"gethasEraserNodes",value:function gethasEraserNodes(){var e=/* @__PURE__ */new Map();return this.curNodeMap.forEach(function(t,r){var n;(n=t.opt.eraserlines)!=null&&n.length&&e.set(r,t);}),e;}},{key:"hasRenderNodes",value:function hasRenderNodes(){return!0;}},{key:"has",value:function has(e){return this.curNodeMap.has(e);}},{key:"setInfo",value:function setInfo(e,t){var r=this.curNodeMap.get(e)||{name:e,rect:t.rect};t.rect&&(r.rect=ue(t.rect)),t.op&&ym(t.op)&&(r.op=ue(t.op)),t.canRotate&&(r.canRotate=t.canRotate),t.scaleType&&(r.scaleType=t.scaleType),t.opt&&(r.opt=ue(t.opt)),t.toolsType&&(r.toolsType=t.toolsType),t.centerPos&&(r.centerPos=ue(t.centerPos)),ke(t.isSelected)&&(r.isSelected=t.isSelected),r.rect?this.curNodeMap.set(e,r):this.curNodeMap["delete"](e);}},{key:"selected",value:function selected(e){this.setInfo(e,{isSelected:!0});}},{key:"unSelected",value:function unSelected(e){this.setInfo(e,{isSelected:!1});}},{key:"delete",value:function _delete(e){this.curNodeMap["delete"](e);}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.targetNodeMap.length=0;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var n;var i=/* @__PURE__ */new Map();var _iterator47=_createForOfIteratorHelper(this.curNodeMap.entries()),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _step47$value=_slicedToArray(_step47.value,2),l=_step47$value[0],o=_step47$value[1];if(Jr(e,o.rect)){if(t&&o.toolsType===pt.Image&&o.opt.locked||r&&o.toolsType===pt.Text&&(o.opt.workState===Ft.Doing||o.opt.workState===Ft.Start))continue;n=bt(n,o.rect),i.set(l,o);}}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}return{rectRange:n,nodeRange:i};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(e,t){var r=ss(t.toolsType);return this.fullLayer&&(r==null?void 0:r.getRectFromLayer(this.fullLayer,e));}},{key:"updateNodeRect",value:function updateNodeRect(e){var t=this.curNodeMap.get(e);if(t){var r=this.getNodeRectFormShape(e,t);if(!r){this.curNodeMap["delete"](e);return;}t.rect=r,this.curNodeMap.set(e,t);}}},{key:"updateHighLevelNodesRect",value:function updateHighLevelNodesRect(e){this.highLevelIds=e;var _iterator48=_createForOfIteratorHelper(this.highLevelIds.keys()),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var t=_step48.value;this.updateNodeRect(t);}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var e;var _iterator49=_createForOfIteratorHelper(this.curNodeMap.keys()),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var t=_step49.value;(e=this.highLevelIds)!=null&&e.has(t)||this.updateNodeRect(t);}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(e){var t=/* @__PURE__ */new Map();var _iterator50=_createForOfIteratorHelper(e),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var r=_step50.value;var n=this.curNodeMap.get(r);n&&t.set(r,ue(n));}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}return this.targetNodeMap.push(ue(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(ue(this.curNodeMap)),this.targetNodeMap.length-1;}},{key:"getLastTarget",value:function getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1];}},{key:"deleteLastTarget",value:function deleteLastTarget(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1);}},{key:"getTarget",value:function getTarget(e){return this.targetNodeMap[e];}},{key:"deleteTarget",value:function deleteTarget(e){this.targetNodeMap.length=e;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}},{key:"isLocalWorkId",value:function isLocalWorkId(e){return e.split(Je).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(e){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if(Vd(this.canClearUids)){var t=e.split(Je);if(t.length===1)return this.canClearUids.has("localSelf")||this.localUid&&this.canClearUids.has(this.localUid);if(t.length===2)return this.canClearUids.has(t[0]);}return!1;}}]);}();var hs=/*#__PURE__*/function(){function hs(e,t,r){_classCallCheck(this,hs);ot(this,"viewId");ot(this,"type");ot(this,"scene");ot(this,"fullLayer");ot(this,"vNodes");ot(this,"dpr");ot(this,"contextType");ot(this,"opt");ot(this,"cameraOpt");ot(this,"isSafari",!1);ot(this,"combinePostMsg",/* @__PURE__ */new Set());ot(this,"workerTaskId");ot(this,"protectedTask");// protected hasPriorityDraw: boolean = true;
440
- ot(this,"delayPostDoneResolve");ot(this,"cacheImages",/* @__PURE__ */new Map());ot(this,"imageResolveMap",/* @__PURE__ */new Map());ot(this,"taskUpdateCameraId");ot(this,"debounceUpdateCameraId");var n,i;if(this.viewId=e,this.type=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(r,(n=t==null?void 0:t.offscreenCanvasOpt)==null?void 0:n.contextType),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");try{this.scene=this.createScene(t),this.createRenderLayer(this.scene,t);}catch(l){if(this.contextType!=="2d")this.contextType="2d",(i=this.scene)==null||i.disconnect(),this.scene=this.createScene(t),this.createRenderLayer(this.scene,t);else throw l;}this.vNodes=new Im(e,this.scene);}return _createClass(hs,[{key:"createRenderLayer",value:function createRenderLayer(e,t){var r=me.bufferSize.full,n=me.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",e,_objectSpread(_objectSpread({},t.layerOpt),{},{bufferSize:this.viewId===hr?r:n*2}));}},{key:"updateDpr",value:function(){var _updateDpr=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e){return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:this.dpr=e,this.scene.displayRatio=e;case 1:case"end":return _context30.stop();}},_callee28,this);}));function updateDpr(_x85){return _updateDpr.apply(this,arguments);}return updateDpr;}()},{key:"getCachedImages",value:function getCachedImages(e){var t;return(t=this.cacheImages.get(e))==null?void 0:t.imageBitmap;}},{key:"getCachedImagesByWorkId",value:function getCachedImagesByWorkId(e){var _iterator51=_createForOfIteratorHelper(this.cacheImages.entries()),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var _step51$value=_slicedToArray(_step51.value,2),t=_step51$value[0],r=_step51$value[1];if(t===e&&r.imageBitmap)return r.imageBitmap;}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(e,t){var _iterator52=_createForOfIteratorHelper(this.cacheImages.entries()),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var _step52$value=_slicedToArray(_step52.value,2),r=_step52$value[0],n=_step52$value[1];t&&r===t||n.workId===e&&(n.imageBitmap.close(),this.cacheImages["delete"](r));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}}},{key:"clearCacheImages",value:function clearCacheImages(){this.cacheImages.forEach(function(e){return e.imageBitmap.close();}),this.cacheImages.clear();}},{key:"clearImageResolveMap",value:function clearImageResolveMap(){this.imageResolveMap.forEach(function(_ref170){var e=_ref170.timer;e&&clearTimeout(e);}),this.imageResolveMap.clear();}},{key:"setIsSafari",value:function setIsSafari(e){this.isSafari=e;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e){var t,r,n,i,l,o,a,c,_c7,m,f,v;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:t=e.msgType,r=e.toolsType,n=e.opt,i=e.imageSrc,l=e.imageBitmap,o=e.workId,a=e.dpr;_context31.t0=t;_context31.next=_context31.t0===dt.UpdateDpr?4:_context31.t0===dt.UpdateCamera?9:_context31.t0===dt.Destroy?12:_context31.t0===dt.Clear?14:_context31.t0===dt.UpdateTools?17:_context31.t0===dt.GetImageBitMap?19:21;break;case 4:_context31.t1=he(a);if(!_context31.t1){_context31.next=8;break;}_context31.next=8;return this.updateDpr(a);case 8:return _context31.abrupt("break",21);case 9:_context31.next=11;return this.updateCamera(e);case 11:return _context31.abrupt("break",21);case 12:this.destroy();return _context31.abrupt("break",21);case 14:_context31.next=16;return this.clearAll();case 16:return _context31.abrupt("break",21);case 17:if(r&&n){c={toolsType:r,toolsOpt:n,combineUnitTime:e.combineUnitTime,maxCombineEraserTime:e.maxCombineEraserTime};this.localWork.setToolsOpt(c);}return _context31.abrupt("break",21);case 19:if(i&&l&&o){_c7=o.toString();this.cacheImages.set(i,{imageBitmap:l,workId:_c7});m=this.imageResolveMap.get(i);if(m){f=m.resolve,v=m.timer;v&&clearTimeout(v),f&&f(i);}this.deleteCachedImagesByWorkId(_c7,i);}return _context31.abrupt("break",21);case 21:case"end":return _context31.stop();}},_callee29,this);}));function on(_x86){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(e,t,r){var n=e*r,i=t*r;return n<=50||i<=50?[50,50]:n<=100||i<=100?[100,100]:n<=200||i<=200?[200,200]:n<=400||i<=400?[400,400]:n<=800||i<=800?[800,800]:[1600,1600];}},{key:"loadImageBitMap",value:function(){var _loadImageBitMap=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e){var _this88=this;var t,r,n,i,l,o,a,c,m,f,v,_this$getIconSize,_this$getIconSize2,P,_x88,_P20,_P21,T;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:t=e.toolsType,r=e.opt,n=e.workId,i=e.isSubWorker;if(!(t===pt.Image&&r&&n)){_context32.next=19;break;}l=n.toString(),o=r.src,a=r.type,c=r.width,m=r.height,f=r.strokeColor;if(!(!o||!a||!c||!m)){_context32.next=5;break;}return _context32.abrupt("return");case 5:v=o;if(a===Qr.Iconify){_this$getIconSize=this.getIconSize(c,m,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),P=_this$getIconSize2[0],_x88=_this$getIconSize2[1];v="".concat(o,"?width=").concat(P,"&height=").concat(_x88,"&color=").concat(f);}if(!this.cacheImages.has(v)){_context32.next=11;break;}_P20=this.getCachedImages(v);if(!_P20){_context32.next=11;break;}return _context32.abrupt("return",_P20);case 11:if(!this.imageResolveMap.has(v)){_context32.next=15;break;}_P21=this.getCachedImagesByWorkId(l);if(!_P21){_context32.next=15;break;}return _context32.abrupt("return",_P21);case 15:_context32.next=17;return new Promise(function(P){var x=_this88.imageResolveMap.get(v)||{resolve:void 0,timer:void 0};x.timer&&clearTimeout(x.timer),x.resolve=P,x.timer=setTimeout(function(){var h=_this88.imageResolveMap.get(v);h!=null&&h.resolve&&h.resolve(v);},5e3),_this88.imageResolveMap.set(v,x),_this88._post({sp:[{imageSrc:v,workId:l,viewId:_this88.viewId,isgl:!!_this88.fullLayer.parent.gl,isSubWorker:i,type:dt.GetImageBitMap}]});});case 17:T=_context32.sent;return _context32.abrupt("return",(this.imageResolveMap["delete"](T),this.getCachedImages(v)));case 19:case"end":return _context32.stop();}},_callee30,this);}));function loadImageBitMap(_x87){return _loadImageBitMap.apply(this,arguments);}return loadImageBitMap;}()},{key:"createLocalWork",value:function createLocalWork(e){var t=e.workId,r=e.opt,n=e.toolsType;t&&r&&(!this.localWork.getToolsOpt()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:r}),this.setWorkOpt({workId:t,toolsOpt:r}));}},{key:"updateScene",value:function updateScene(e,t,r){e.attr(_objectSpread({},t));var n=t.width,i=t.height;e.container.width=n,e.container.height=i,e.width=n,e.height=i,this.updateLayer({width:n,height:i},r);}},{key:"updateLayer",value:function updateLayer(e,t){var r=e.width,n=e.height,i=t||this.fullLayer;i&&(i.parent.setAttribute("width",r),i.parent.setAttribute("height",n),i.setAttribute("size",[r,n]),i.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"getSupportContextType",value:function getSupportContextType(e,t){var r=new OffscreenCanvas(100,100);var n=["2d"];e===wr.Full&&this.viewId===hr&&(n=["webgl2","webgl","2d"],t&&n.unshift(t));for(var _i3=0,_n7=n;_i3<_n7.length;_i3++){var i=_n7[_i3];try{if(r.getContext(i))return i;}catch(l){throw l;}}}},{key:"createScene",value:function createScene(e){var t=e.offscreenCanvasOpt,r=t.width,n=t.height,i=new OffscreenCanvas(r,n);t.contextType&&delete t.contextType;var l=new di(_objectSpread(_objectSpread({container:i,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},t),{},{contextType:this.contextType,id:this.viewId}));return l.setAttribute("id",this.viewId),l;}},{key:"createLayer",value:function createLayer(e,t,r,n){var i="offscreen-".concat(e),l=r.width,o=r.height;n&&(r.offscreen=!0,r.canvas=n);var a=t.layer(i,r),c=new ye({anchor:[0.5,0.5],pos:[l*0.5,o*0.5],size:[l,o],name:"viewport",id:e});return a.append(c),c;}},{key:"clearAll",value:function(){var _clearAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(){var e;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:this.fullLayer&&(this.fullLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Te(this.fullLayer,this.fullLayer.parent)),this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0),this.debounceUpdateCameraId&&(clearTimeout(this.debounceUpdateCameraId),this.debounceUpdateCameraId=void 0),this.clearCacheImages(),this.clearImageResolveMap(),this.localWork.destroy(),(e=this.serviceWork)==null||e.destroy();case 1:case"end":return _context33.stop();}},_callee31,this);}));function clearAll(){return _clearAll.apply(this,arguments);}return clearAll;}()},{key:"setToolsOpt",value:function setToolsOpt(e){this.localWork.setToolsOpt(e);}},{key:"setWorkOpt",value:function setWorkOpt(e){var t=e.workId,r=e.toolsOpt;t&&r&&this.localWork.setWorkOptions(t.toString(),r);}},{key:"destroy",value:function destroy(){var e;this.vNodes.clear(),this.fullLayer.remove(),_pe(this.fullLayer,this.fullLayer.parent),this.clearCacheImages(),this.clearImageResolveMap(),this.scene.remove(),this.localWork.destroy(),(e=this.serviceWork)==null||e.destroy();}},{key:"post",value:function(){var _post=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e){return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:this.combinePostMsg.add(e);_context34.next=3;return this.runBatchPostData();case 3:case"end":return _context34.stop();}},_callee32,this);}));function post(_x89){return _post.apply(this,arguments);}return post;}()},{key:"runBatchPostData",value:function(){var _runBatchPostData=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(){var _this89=this;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:this.workerTaskId||(this.workerTaskId=setTimeout(function(){_this89.workerTaskId=void 0,_this89.combinePost();},16));_context35.t0=this.type===wr.Full&&!this.delayPostDoneResolve;if(!_context35.t0){_context35.next=6;break;}_context35.next=5;return new Promise(function(t){_this89.delayPostDoneResolve=t;});case 5:_context35.t0=_context35.sent;case 6:_context35.t1=_context35.t0;if(!_context35.t1){_context35.next=9;break;}this.delayPostDoneResolve=void 0;case 9:case"end":return _context35.stop();}},_callee33,this);}));function runBatchPostData(){return _runBatchPostData.apply(this,arguments);}return runBatchPostData;}()},{key:"combinePostData",value:function combinePostData(){var o,a;this.workerTaskId=void 0;var e=[],t=[];var r,n,i;var l=/* @__PURE__ */new Set();var _iterator53=_createForOfIteratorHelper(this.combinePostMsg.values()),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var c=_step53.value;if((o=c.render)!=null&&o.length){var _iterator54=_createForOfIteratorHelper(c.render),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var m=_step54.value;var f=!1;if(m.workId&&l.add(m.workId),m.isClearAll&&(m.rect=this.getSceneRect(),m.isClear=!0,delete m.isClearAll),m.drawCanvas){var v=this.getLayer(m.drawCanvas);if(!v||!(v.parent instanceof $r))continue;if(v.parent.render(),m.isDrawAll){var S=this.getSceneRect();m.rect=S,delete m.isDrawAll;}}var _iterator55=_createForOfIteratorHelper(e),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var _v3=_step55.value;if(m.viewId===_v3.viewId){m.isClear&&_v3.clearCanvas&&_v3.isClear&&_v3.clearCanvas===m.clearCanvas&&(_v3.rect=bt(_v3.rect,m.rect),f=!0),_v3.drawCanvas&&_v3.drawCanvas===m.drawCanvas&&(_v3.rect=bt(_v3.rect,m.rect),f=!0);continue;}}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}f||(m.isClear&&!m.drawCanvas?e.unshift(m):e.push(m));}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}}if((a=c.sp)!=null&&a.length){var _iterator56=_createForOfIteratorHelper(c.sp),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var _m12=_step56.value;var _f6=!1;var _iterator57=_createForOfIteratorHelper(t),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _v4=_step57.value;if(Me(_m12,_v4)){_f6=!0;break;}}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}_f6||t.push(_m12);}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}}he(c.fullWorkerDrawCount)&&(r=c.fullWorkerDrawCount),he(c.subWorkerDrawCount)&&(n=c.subWorkerDrawCount),he(c.consumeCount)&&(i=c.consumeCount);}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}return this.combinePostMsg.clear(),{render:e,sp:t,fullWorkerDrawCount:r,subWorkerDrawCount:n,consumeCount:i,workIds:l,viewId:this.viewId};}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,e=_this$scene.width,t=_this$scene.height;return{x:0,y:0,w:Math.floor(e),h:Math.floor(t)};}}]);}();var gn=/*#__PURE__*/function(){function gn(e){_classCallCheck(this,gn);ot(this,"viewId");ot(this,"vNodes");ot(this,"thread");ot(this,"fullLayer");ot(this,"drawLayer");ot(this,"_post");ot(this,"tmpOpt");ot(this,"workShapes",/* @__PURE__ */new Map());ot(this,"drawCount",0);ot(this,"consumeCount",0);ot(this,"syncUnitTime",me.syncOpt.interval);ot(this,"combineUnitTime",me.bezier.combineUnitTime);ot(this,"maxCombineEraserTime",me.pencilEraser.maxCombineTime);this.thread=e.thread,this.viewId=e.viewId,this.vNodes=e.vNodes,this.fullLayer=e.fullLayer,this.drawLayer=e.drawLayer,this._post=this.thread.post.bind(e.thread);}return _createClass(gn,[{key:"setmaxCombineEraserTime",value:function setmaxCombineEraserTime(e){this.maxCombineEraserTime=e;}},{key:"setCombineUnitTime",value:function setCombineUnitTime(e){this.combineUnitTime=e;}},{key:"setSyncUnitTime",value:function setSyncUnitTime(e){this.syncUnitTime=e;}},{key:"destroy",value:function destroy(){this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{key:"getWorkShape",value:function getWorkShape(e){return this.workShapes.get(e);}},{key:"createWorkShape",value:function createWorkShape(e,t){if(e&&this.tmpOpt){var r={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},r),{},{workId:e}));n&&this.workShapes.set(e,n);}}},{key:"setWorkOptions",value:function setWorkOptions(e,t){var r=this.getWorkShape(e);r||this.createWorkShape(e,t),r==null||r.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(e){var t;return Ur(_objectSpread(_objectSpread({},e),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(t=this.thread)==null?void 0:t.serviceWork);}},{key:"setToolsOpt",value:function setToolsOpt(e){var t,r,n;((t=this.tmpOpt)==null?void 0:t.toolsType)!==e.toolsType&&(r=this.tmpOpt)!=null&&r.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=e,(n=e.toolsOpt)!=null&&n.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime),e.combineUnitTime&&(this.combineUnitTime=e.combineUnitTime),e.maxCombineEraserTime&&(this.maxCombineEraserTime=e.maxCombineEraserTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(e){var t;(t=this.getWorkShape(e))==null||t.clearTmpPoints(),this.workShapes["delete"](e);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.workShapes.forEach(function(e){return e.clearTmpPoints();}),this.workShapes.clear();}},{key:"setFullWork",value:function setFullWork(e){var t=e.workId,r=e.opt,n=e.toolsType;if(t&&r&&n){var i=t.toString();var l;return t&&this.workShapes.has(i)?(l=this.workShapes.get(i),l==null||l.setWorkOptions(r)):l=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:i}),l?(this.workShapes.set(i,l),l):void 0;}}}]);}();function Om(u){return u;}var us=Om;function Em(u,e,t){switch(t.length){case 0:return u.call(e);case 1:return u.call(e,t[0]);case 2:return u.call(e,t[0],t[1]);case 3:return u.call(e,t[0],t[1],t[2]);}return u.apply(e,t);}var Mm=Em,Am=Mm,ai=Math.max;function wm(u,e,t){return e=ai(e===void 0?u.length-1:e,0),function(){for(var r=arguments,n=-1,i=ai(r.length-e,0),l=Array(i);++n<i;)l[n]=r[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=r[n];return o[e]=t(l),Am(u,this,o);};}var Lm=wm;function Rm(u){return function(){return u;};}var Dm=Rm,bm=Dm,li=Ti,Nm=us,Bm=li?function(u,e){return li(u,"toString",{configurable:!0,enumerable:!1,value:bm(e),writable:!0});}:Nm,Wm=Bm,Fm=800,Um=16,jm=Date.now;function Ym(u){var e=0,t=0;return function(){var r=jm(),n=Um-(r-t);if(t=r,n>0){if(++e>=Fm)return arguments[0];}else e=0;return u.apply(void 0,arguments);};}var Xm=Ym,zm=Wm,$m=Xm,Gm=$m(zm),km=Gm,Hm=us,Vm=Lm,Km=km;function Zm(u,e){return Km(Vm(u,e,Hm),u+"");}var Jm=Zm;function Qm(u,e,t,r){for(var n=u.length,i=t+(r?1:-1);r?i--:++i<n;)if(e(u[i],i,u))return i;return-1;}var qm=Qm;function _m(u){return u!==u;}var tv=_m;function ev(u,e,t){for(var r=t-1,n=u.length;++r<n;)if(u[r]===e)return r;return-1;}var rv=ev,nv=qm,iv=tv,sv=rv;function ov(u,e,t){return e===e?sv(u,e,t):nv(u,iv,t);}var av=ov,lv=av;function cv(u,e){var t=u==null?0:u.length;return!!t&&lv(u,e,0)>-1;}var ds=cv;function fv(u,e,t){for(var r=-1,n=u==null?0:u.length;++r<n;)if(t(e,u[r]))return!0;return!1;}var ps=fv;function hv(u,e){for(var t=-1,r=u==null?0:u.length,n=Array(r);++t<r;)n[t]=e(u[t],t,u);return n;}var uv=hv,dv=dn,pv=ds,mv=ps,vv=uv,yv=Wr,gv=pn,Pv=200;function Sv(u,e,t,r){var n=-1,i=pv,l=!0,o=u.length,a=[],c=e.length;if(!o)return a;t&&(e=vv(e,yv(t))),r?(i=mv,l=!1):e.length>=Pv&&(i=gv,l=!1,e=new dv(e));t:for(;++n<o;){var m=u[n],f=t==null?m:t(m);if(m=r||m!==0?m:0,l&&f===f){for(var v=c;v--;)if(e[v]===f)continue t;a.push(m);}else i(e,f,r)||a.push(m);}return a;}var xv=Sv,ci=ur,Tv=Ei,Cv=pr,fi=ci?ci.isConcatSpreadable:void 0;function Iv(u){return Cv(u)||Tv(u)||!!(fi&&u&&u[fi]);}var Ov=Iv,Ev=ln,Mv=Ov;function ms(u,e,t,r,n){var i=-1,l=u.length;for(t||(t=Mv),n||(n=[]);++i<l;){var o=u[i];e>0&&t(o)?e>1?ms(o,e-1,t,r,n):Ev(n,o):r||(n[n.length]=o);}return n;}var Av=ms;function wv(){}var Lv=wv,zr=Fi,Rv=Lv,Dv=mn,bv=1/0,Nv=zr&&1/Dv(new zr([,-0]))[1]==bv?function(u){return new zr(u);}:Rv,Bv=Nv,Wv=dn,Fv=ds,Uv=ps,jv=pn,Yv=Bv,Xv=mn,zv=200;function $v(u,e,t){var r=-1,n=Fv,i=u.length,l=!0,o=[],a=o;if(t)l=!1,n=Uv;else if(i>=zv){var c=e?null:Yv(u);if(c)return Xv(c);l=!1,n=jv,a=new Wv();}else a=e?[]:o;t:for(;++r<i;){var m=u[r],f=e?e(m):m;if(m=t||m!==0?m:0,l&&f===f){for(var v=a.length;v--;)if(a[v]===f)continue t;e&&a.push(f),o.push(m);}else n(a,f,t)||(a!==o&&a.push(f),o.push(m));}return o;}var Gv=$v,kv=xv,Hv=Av,hi=Gv;function Vv(u,e,t){var r=u.length;if(r<2)return r?hi(u[0]):[];for(var n=-1,i=Array(r);++n<r;)for(var l=u[n],o=-1;++o<r;)o!=n&&(i[n]=kv(i[n]||l,u[o],e,t));return hi(Hv(i,1),e,t);}var Kv=Vv,Zv=nn,Jv=Le;function Qv(u){return Jv(u)&&Zv(u);}var qv=Qv,_v=Ri,ty=Jm,ey=Kv,ry=qv,ny=ty(function(u){return ey(_v(u,ry));}),iy=ny,sy=/* @__PURE__ */Ne(iy);var vs=/*#__PURE__*/function(_gn){function vs(t){var _this90;_classCallCheck(this,vs);_this90=_callSuper(this,vs,[t]);ot(_this90,"_type","full");ot(_this90,"combineTimerId");ot(_this90,"combineDrawResolve");ot(_this90,"combineDrawActiveId");ot(_this90,"drawWorkActiveId");ot(_this90,"effectSelectNodeData",/* @__PURE__ */new Set());return _this90;}_inherits(vs,_gn);return _createClass(vs,[{key:"loadImageBitMap",value:function(){var _loadImageBitMap2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(t){return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:_context36.next=2;return this.thread.loadImageBitMap(t);case 2:return _context36.abrupt("return",_context36.sent);case 3:case"end":return _context36.stop();}},_callee34,this);}));function loadImageBitMap(_x90){return _loadImageBitMap2.apply(this,arguments);}return loadImageBitMap;}()},{key:"consumeDraw",value:function(){var _consumeDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t,r){var _this91=this;var n,i,l,o,a,c,m,f,v;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:n=t.op,i=t.workId,l=t.scenePath,o=t.postCount,a=t.smoothSync;if(!(n!=null&&n.length&&i)){_context37.next=48;break;}c=i.toString(),m=this.getWorkShape(c);if(m){_context37.next=5;break;}return _context37.abrupt("return");case 5:f=m.toolsType;if(!(f===pt.LaserPen)){_context37.next=8;break;}return _context37.abrupt("return");case 8:_context37.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==c;if(!_context37.t0){_context37.next=13;break;}this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);_context37.next=13;return this.consumeDrawAll({workId:this.combineDrawActiveId,scenePath:l,viewId:this.viewId,msgType:dt.DrawWork,dataType:Dt.Local},r);case 13:_context37.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==c;if(!_context37.t1){_context37.next=18;break;}_context37.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:l,viewId:this.viewId,msgType:dt.DrawWork,dataType:Dt.Local},r);case 17:this.drawWorkActiveId=void 0;case 18:!this.drawWorkActiveId&&c!==qt&&(this.drawWorkActiveId=c);he(o)&&(this.consumeCount=o);v=m.consume({data:t,isFullWork:!0,smoothSync:a});_context37.t2=f;_context37.next=_context37.t2===pt.Selector?24:_context37.t2===pt.PencilEraser?30:_context37.t2===pt.BitMapEraser?30:_context37.t2===pt.Eraser?32:_context37.t2===pt.Arrow?35:_context37.t2===pt.Straight?35:_context37.t2===pt.Ellipse?35:_context37.t2===pt.Rectangle?35:_context37.t2===pt.Star?35:_context37.t2===pt.Polygon?35:_context37.t2===pt.SpeechBalloon?35:_context37.t2===pt.Pencil?41:48;break;case 24:_context37.t3=v.type===dt.Select;if(!_context37.t3){_context37.next=29;break;}v.selectIds&&r.runReverseSelectWork(v.selectIds);_context37.next=29;return this.drawSelector(v);case 29:return _context37.abrupt("break",48);case 30:this.drawCount++,this.combineTimerId||(this.combineTimerId=1,this.combineDrawActiveId=c,this.drawEraserCombine(c,this.drawCount).then(function(){_this91.combineTimerId=void 0;}));return _context37.abrupt("break",48);case 32:_context37.next=34;return this.drawEraser(v);case 34:return _context37.abrupt("break",48);case 35:_context37.t4=v;if(!_context37.t4){_context37.next=40;break;}this.drawCount++;_context37.next=40;return this.drawShape(v);case 40:return _context37.abrupt("break",48);case 41:this.drawCount++;!this.combineTimerId&&this.combineUnitTime!==1/0&&new Promise(function(S){_this91.combineDrawActiveId=c,_this91.combineDrawResolve=S,_this91.combineTimerId=setTimeout(function(){_this91.combineTimerId=void 0,_this91.combineDrawResolve&&_this91.combineDrawResolve(!0);},_this91.combineUnitTime);}).then(function(S){S&&_this91.drawPencilCombine(c,_this91.drawCount),_this91.combineDrawResolve=void 0;});_context37.t5=v;if(!_context37.t5){_context37.next=47;break;}_context37.next=47;return this.drawPencil(v);case 47:return _context37.abrupt("break",48);case 48:case"end":return _context37.stop();}},_callee35,this);}));function consumeDraw(_x91,_x92){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t,r){var o,a,c,n,i,l,m,f,v,S,E,T;return _regeneratorRuntime().wrap(function _callee36$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);n=t.workId,i=t.scenePath,l=t.isLockSentEventCursor;if(!n){_context38.next=38;break;}m=n.toString();this.drawWorkActiveId===m&&(this.drawWorkActiveId=void 0);f=this.workShapes.get(m);if(f){_context38.next=8;break;}return _context38.abrupt("return");case 8:v=f.toolsType;if(!(v===pt.LaserPen)){_context38.next=11;break;}return _context38.abrupt("return");case 11:S=this.workShapes.get(He),E=(o=S==null?void 0:S.selectIds)==null?void 0:o[0],T=f.consumeAll({data:t,workerEngine:this});_context38.t0=v;_context38.next=_context38.t0===pt.Selector?15:_context38.t0===pt.PencilEraser?21:_context38.t0===pt.BitMapEraser?21:_context38.t0===pt.Eraser?26:_context38.t0===pt.Arrow?28:_context38.t0===pt.Straight?28:_context38.t0===pt.Ellipse?28:_context38.t0===pt.Rectangle?28:_context38.t0===pt.Star?28:_context38.t0===pt.Polygon?28:_context38.t0===pt.SpeechBalloon?28:_context38.t0===pt.Pencil?33:38;break;case 15:T.selectIds&&E&&(a=T.selectIds)!=null&&a.includes(E)&&S.cursorBlur();T.selectIds&&r.runReverseSelectWork(T.selectIds);_context38.next=19;return this.drawSelector(_objectSpread(_objectSpread({},T),{},{scenePath:i}),l);case 19:(c=f.selectIds)!=null&&c.length?f.clearTmpPoints():this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 21:_context38.next=23;return this.drawEraserFull(f,_objectSpread(_objectSpread({},T),{},{scenePath:i}),l);case 23:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 26:this.drawEraser(_objectSpread(_objectSpread({},T),{},{scenePath:i}),l),f.clearTmpPoints();return _context38.abrupt("break",38);case 28:_context38.next=30;return this.drawPencilFull(_objectSpread(_objectSpread({},T),{},{scenePath:i}),l);case 30:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 33:_context38.next=35;return this.drawPencilFull(_objectSpread(_objectSpread({},T),{},{scenePath:i}),l);case 35:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 38:case"end":return _context38.stop();}},_callee36,this);}));function consumeDrawAll(_x93,_x94){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t,r){var _iterator58,_step58,n;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:_iterator58=_createForOfIteratorHelper(this.workShapes.keys());_context39.prev=1;_iterator58.s();case 3:if((_step58=_iterator58.n()).done){_context39.next=9;break;}n=_step58.value;_context39.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:dt.DrawWork,dataType:Dt.Local},r);case 7:_context39.next=3;break;case 9:_context39.next=14;break;case 11:_context39.prev=11;_context39.t0=_context39["catch"](1);_iterator58.e(_context39.t0);case 14:_context39.prev=14;_iterator58.f();return _context39.finish(14);case 17:case"end":return _context39.stop();}},_callee37,this,[[1,11,14,17]]);}));function workShapesDone(_x95,_x96){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var i,l,r,n,o,a,c,m,f,v,S;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:r=this.setFullWork(t),n=t.ops&&Qe(t.ops)||t.op;if(!r){_context40.next=26;break;}o=(i=t.workId)==null?void 0:i.toString();if(o){_context40.next=5;break;}return _context40.abrupt("return");case 5:a=(l=this.vNodes.get(o))==null?void 0:l.rect;if(!(r.toolsType===pt.Image)){_context40.next=13;break;}_context40.next=9;return r.consumeServiceAsync({isFullWork:!0,replaceId:o,worker:this});case 9:c=_context40.sent;m=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);_context40.next=20;break;case 13:if(!(r.toolsType===pt.Text)){_context40.next=19;break;}_context40.next=16;return r.consumeServiceAsync({isFullWork:!0,replaceId:o});case 16:c=_context40.sent;_context40.next=20;break;case 19:c=r.consumeService({op:n,isFullWork:!0,replaceId:o}),m=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 20:c=bt(c,m);f=[],v=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),c&&t.willRefresh&&(a&&(f.push({rect:kt(a),isClear:!0,clearCanvas:Et.Bg,viewId:this.viewId}),c=bt(c,a)),f.push({rect:kt(c),drawCanvas:Et.Bg,viewId:this.viewId})),t.willSyncService&&v.push({opt:t.opt,toolsType:t.toolsType,type:dt.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),f.length||v.length)){_context40.next=26;break;}S={render:f,sp:v};_context40.next=26;return this._post(S);case 26:case"end":return _context40.stop();}},_callee38,this);}));function consumeFull(_x97){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"commandDeleteText",value:function commandDeleteText(t){var r=this.vNodes.get(t);if(r&&r.toolsType===pt.Text)return{type:dt.TextUpdate,toolsType:pt.Text,workId:t,dataType:Dt.Local};}},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t,r){var n,i,l,o,a,c,_iterator59,_step59,m,S,v;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:n=t.willSyncService,i=[],l=[],o=[],a=this.workShapes.get(qt);if(a){_context41.next=3;break;}return _context41.abrupt("return");case 3:c=a.selectIds&&_toConsumableArray(a.selectIds)||[];_iterator59=_createForOfIteratorHelper(c);try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){m=_step59.value;if(this.vNodes.get(m)){S=this.commandDeleteText(m);S&&i.push(S);}v=this._removeWork(m);v.length&&l.push.apply(l,_toConsumableArray(v)),r==null||r.deleteCachedImagesByWorkId(m),o.push(m);}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}o.length&&i.push({type:dt.RemoveNode,removeIds:o});i.push({type:dt.Select,selectIds:[],willSyncService:n});_context41.next=10;return this.blurSelector();case 10:_context41.t0=l.length||i.length;if(!_context41.t0){_context41.next=14;break;}_context41.next=14;return this._post({render:l,sp:i});case 14:case"end":return _context41.stop();}},_callee39,this);}));function removeSelector(_x98,_x99){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var r,n,i;return _regeneratorRuntime().wrap(function _callee40$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:r=t.workId,n=r==null?void 0:r.toString();if(!n){_context42.next=7;break;}i=this._removeWork(n);_context42.t0=i.length;if(!_context42.t0){_context42.next=7;break;}_context42.next=7;return this._post({render:i});case 7:case"end":return _context42.stop();}},_callee40,this);}));function removeWork(_x100){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this92=this;var i,l,o;var r=this.vNodes.get(t);r&&((i=this.fullLayer)==null||i.getElementsByName(t).forEach(function(a){a.remove(),_pe(a,_this92.fullLayer.parent);}),this.vNodes["delete"](t));var n=this.drawLayer&&At.getRectFromLayer(this.drawLayer,t);if(n){var a=(l=this.drawLayer)==null?void 0:l.getElementsByName(t)[0];a&&(a.remove(),_pe(a,(o=this.drawLayer)==null?void 0:o.parent));}return this.getWorkShape(t)&&this.clearWorkShapeNodeCache(t),{fullRect:r==null?void 0:r.rect,drawRect:n};}},{key:"_removeWork",value:function _removeWork(t){var _this$removeNode=this.removeNode(t),r=_this$removeNode.fullRect,n=_this$removeNode.drawRect,i=[];return r&&i.push({rect:kt(r),clearCanvas:Et.Bg,isClear:!0,viewId:this.viewId},{rect:kt(r),drawCanvas:Et.Bg,viewId:this.viewId}),n&&i.push({rect:kt(n),clearCanvas:Et.Float,isClear:!0,viewId:this.viewId},{rect:kt(n),drawCanvas:Et.Float,viewId:this.viewId}),i;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var r,n,i,l,o,a,c,_iterator60,_step60,m,f,v,S,E;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:r=t.op,n=t.viewId,i=t.dataType;if(!(r!=null&&r.length)){_context43.next=32;break;}a=r[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],c=r[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator60=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context43.prev=4;_iterator60.s();case 6:if((_step60=_iterator60.n()).done){_context43.next=14;break;}m=_step60.value;f=m.rect,v=m.name,S=m.toolsType,E=m.opt;if(!(S===pt.Text&&E.workState===Ft.Done&&vm([a,c],f))){_context43.next=12;break;}l=v,o=this.setFullWork({workId:v,toolsType:S,opt:E});return _context43.abrupt("break",14);case 12:_context43.next=6;break;case 14:_context43.next=19;break;case 16:_context43.prev=16;_context43.t0=_context43["catch"](4);_iterator60.e(_context43.t0);case 19:_context43.prev=19;_iterator60.f();return _context43.finish(19);case 22:_context43.t1=l;if(!_context43.t1){_context43.next=32;break;}_context43.t2=o;if(!_context43.t2){_context43.next=28;break;}_context43.next=28;return o.consumeServiceAsync({isFullWork:!0,replaceId:o.getWorkId(),isDrawLabel:!1});case 28:_context43.next=30;return this.blurSelector({viewId:n,msgType:dt.Select,dataType:i,isSync:!0});case 30:_context43.next=32;return this._post({sp:[{type:dt.GetTextActive,toolsType:pt.Text,workId:l}]});case 32:case"end":return _context43.stop();}},_callee41,this,[[4,16,19,22]]);}));function checkTextActive(_x101){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(t){var _this93=this;var r,n,i;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:r=this.workShapes.get(qt),n=t.workId,i=t.msgType;if(!(r&&n&&r.selectIds&&r.selectIds.includes(n.toString()))){_context44.next=6;break;}i===dt.RemoveNode?r.selectIds=r.selectIds.filter(function(l){return l!==n.toString();}):this.effectSelectNodeData.add(t);_context44.next=5;return this.runEffectSelectWork(!0).then(function(){var l;(l=_this93.effectSelectNodeData)==null||l.clear();});case 5:return _context44.abrupt("return");case 6:return _context44.abrupt("return",t);case 7:case"end":return _context44.stop();}},_callee42,this);}));function colloctEffectSelectWork(_x102){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var _this94=this;var T,r,n,i,l,o,a,c,m,f,v,S,E;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:r=this.workShapes.get(qt);if((T=r==null?void 0:r.selectIds)!=null&&T.length){_context45.next=3;break;}return _context45.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);l=i.updateSelectorOpt;o=i.willSerializeData;a=i.smoothSync;_context45.next=10;return r==null?void 0:r.updateSelector({updateSelectorOpt:l,selectIds:ue(r.selectIds),vNodes:this.vNodes,willSerializeData:o,worker:this});case 10:c=_context45.sent;m=/* @__PURE__ */new Map();c!=null&&c.selectIds&&(f=sy(r.selectIds,c.selectIds),c.selectIds.forEach(function(P){var x=_this94.vNodes.get(P);if(x){var _h45=x.toolsType,p=x.op,d=x.opt;m.set(P,{opt:d,toolsType:_h45,ops:(p==null?void 0:p.length)&&ve(p)||void 0});}}),r.selectIds=c.selectIds);v=[],S=[];c!=null&&c.rect&&v.push({rect:kt(c.rect),clearCanvas:Et.Bg,isClear:!0,viewId:this.viewId},{rect:kt(c.rect),drawCanvas:Et.Bg,viewId:this.viewId});E=n&&n({res:c,workShapeNode:r,param:i,postData:{render:v,sp:S},newServiceStore:m,smoothSync:a})||{render:v,sp:S};f&&E.sp.push({type:dt.RemoveNode,removeIds:f,viewId:this.viewId});_context45.t0=E.render.length||E.sp.length;if(!_context45.t0){_context45.next=21;break;}_context45.next=21;return this._post(E);case 21:case"end":return _context45.stop();}},_callee43,this);}));function updateSelector(_x103){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var i,r,n,l;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:r=this.workShapes.get(qt),n=r==null?void 0:r.blurSelector();if(!(this.clearWorkShapeNodeCache(qt),((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(l){l.name===qt&&l.remove();}),n)){_context46.next=6;break;}l=[];l.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync}));_context46.next=6;return this._post({render:(n==null?void 0:n.rect)&&[{rect:kt(n.rect),clearCanvas:Et.Bg,isClear:!0,viewId:this.viewId},{rect:kt(n.rect),drawCanvas:Et.Bg,viewId:this.viewId}],sp:l});case 6:case"end":return _context46.stop();}},_callee44,this);}));function blurSelector(_x104){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(qt);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(qt);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(){var t,l,r,n,i,o,_args47=arguments;return _regeneratorRuntime().wrap(function _callee45$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:t=_args47.length>0&&_args47[0]!==undefined?_args47[0]:!1;r=this.workShapes.get(qt);if(r){_context47.next=4;break;}return _context47.abrupt("return");case 4:if(!(r&&!((l=r.selectIds)!=null&&l.length))){_context47.next=8;break;}_context47.next=7;return this.blurSelector();case 7:return _context47.abrupt("return");case 8:n=r.oldSelectRect,i=r.reRenderSelector();if(!i){_context47.next=13;break;}o=bt(n,i)||i;_context47.next=13;return this._post({render:[{rect:kt(o),clearCanvas:Et.Bg,isClear:!0,viewId:this.viewId},{rect:kt(o),drawCanvas:Et.Bg,viewId:this.viewId}],sp:[{type:dt.Select,selectIds:r.selectIds,selectRect:i,willSyncService:t,viewId:this.viewId,points:r.getChildrenPoints(),textOpt:r.textOpt,selectorColor:r.selectorColor,strokeColor:r.strokeColor,fillColor:r.fillColor,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,opt:r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt,thickness:r.thickness,useStroke:r.useStroke,strokeType:r.strokeType}]});case 13:case"end":return _context47.stop();}},_callee45,this);}));function reRenderSelector(){return _reRenderSelector.apply(this,arguments);}return reRenderSelector;}()},{key:"updateFullSelectWork",value:function(){var _updateFullSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(t){var i,l,o,a,c,m,f,r,n,_r$updateSelectIds,v,S,E;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:r=this.workShapes.get(qt),n=t.selectIds;if(n!=null&&n.length){_context48.next=5;break;}_context48.next=4;return this.blurSelector(t);case 4:return _context48.abrupt("return");case 5:if(r){_context48.next=10;break;}!this.setFullWork(t)&&t.workId&&((i=this.tmpOpt)==null?void 0:i.toolsType)===pt.Selector&&this.createWorkShape(t.workId.toString());_context48.next=9;return this.updateFullSelectWork(t);case 9:return _context48.abrupt("return");case 10:if(!(r&&n!=null&&n.length)){_context48.next=16;break;}_r$updateSelectIds=r.updateSelectIds(n),v=_r$updateSelectIds.bgRect,S=_r$updateSelectIds.selectRect,E={render:[],sp:[]};v&&((l=E.render)==null||l.push({rect:kt(v),clearCanvas:Et.Bg,isClear:!0,viewId:this.viewId},{rect:kt(v),drawCanvas:Et.Bg,viewId:this.viewId}));(f=E.sp)==null||f.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((o=t.opt)==null?void 0:o.strokeColor)||r.selectorColor,strokeColor:((a=t.opt)==null?void 0:a.strokeColor)||r.strokeColor,fillColor:((c=t.opt)==null?void 0:c.fillColor)||r.fillColor,textOpt:((m=t.opt)==null?void 0:m.textOpt)||r.textOpt,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,type:dt.Select,selectRect:S,points:r.getChildrenPoints(),willSyncService:(t==null?void 0:t.willSyncService)||!1,opt:(t==null?void 0:t.willSyncService)&&r.getWorkOptions()||void 0,canLock:r.canLock,isLocked:r.isLocked,toolsTypes:r.toolsTypes,shapeOpt:r.shapeOpt,thickness:r.thickness,useStroke:r.useStroke,strokeType:r.strokeType}));_context48.next=16;return this._post(E);case 16:case"end":return _context48.stop();}},_callee46,this);}));function updateFullSelectWork(_x105){return _updateFullSelectWork.apply(this,arguments);}return updateFullSelectWork;}()},{key:"destroy",value:function destroy(){this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1)),_superPropGet(vs,"destroy",this,3)([]),this.effectSelectNodeData.clear();}},{key:"drawEraserCombine",value:function(){var _drawEraserCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t,r){var i,l,o,a,n,c,m,f,v,_iterator61,_step61,_step61$value,_v5,S;return _regeneratorRuntime().wrap(function _callee47$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:n=(i=this.workShapes.get(t))==null?void 0:i.combineConsume({workerEngine:this});if(!n){_context49.next=7;break;}c=n.willDeleteNodes,m=n.willNewNodes,f={render:[],fullWorkerDrawCount:r,sp:[]};if(n!=null&&n.rect){v=kt(n.rect);(l=f.render)==null||l.push({rect:v,isClear:!0,clearCanvas:Et.Bg,viewId:this.viewId},{rect:v,drawCanvas:Et.Bg,viewId:this.viewId});}if(c!=null&&c.size&&((o=f.sp)==null||o.push({type:dt.RemoveNode,removeIds:_toConsumableArray(c),viewId:this.thread.viewId})),m!=null&&m.size){_iterator61=_createForOfIteratorHelper(m);try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){_step61$value=_slicedToArray(_step61.value,2),_v5=_step61$value[0],S=_step61$value[1];(a=f.sp)==null||a.push({type:dt.FullWork,dataType:Dt.Local,toolsType:pt.Pencil,ops:ve(S.op),opt:S.opt,workId:_v5,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}}_context49.next=7;return this._post(f);case 7:case"end":return _context49.stop();}},_callee47,this);}));function drawEraserCombine(_x106,_x107){return _drawEraserCombine.apply(this,arguments);}return drawEraserCombine;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t,r){var i,l,o,n,a,c;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:n=(i=this.workShapes.get(t))==null?void 0:i.combineConsume();if(!n){_context50.next=6;break;}a={render:[],fullWorkerDrawCount:r};if(n!=null&&n.rect){c=kt(n.rect);(l=a.render)==null||l.push({rect:c,isClear:!0,clearCanvas:Et.Float,viewId:this.viewId}),(o=a.render)==null||o.push({rect:c,drawCanvas:Et.Float,viewId:this.viewId});}_context50.next=6;return this._post(a);case 6:case"end":return _context50.stop();}},_callee48,this);}));function drawPencilCombine(_x108,_x109){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t,r){var i,l,n;return _regeneratorRuntime().wrap(function _callee49$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:n={render:[],sp:[t]};r&&((i=n.sp)==null||i.push({type:dt.None,isLockSentEventCursor:r}));t.rect&&((l=n.render)==null||l.push({rect:kt(t.rect),clearCanvas:Et.Bg,isClear:!0,viewId:this.viewId},{rect:kt(t.rect),drawCanvas:Et.Bg,viewId:this.viewId}));_context51.next=5;return this._post(n);case 5:case"end":return _context51.stop();}},_callee49,this);}));function drawSelector(_x110,_x111){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t,r){var i,l,n;return _regeneratorRuntime().wrap(function _callee50$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:n={fullWorkerDrawCount:1/0,render:[],sp:[t]};r&&((i=n.sp)==null||i.push({type:dt.None,isLockSentEventCursor:r}));t!=null&&t.rect&&((l=n.render)==null||l.push({isClearAll:!0,clearCanvas:Et.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:Et.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Et.Bg,viewId:this.viewId}));_context52.next=5;return this._post(n);case 5:case"end":return _context52.stop();}},_callee50,this);}));function drawPencilFull(_x112,_x113){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"drawEraserFull",value:function(){var _drawEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t,r,n){var i,l,o,a,c,m,_iterator62,_step62,_step62$value,v,S,_iterator63,_step63,_step63$value,_v6,_S9,f;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:i=r.rect,l=r.willUpdateNodes,o=r.willDeleteNodes,a=r.willNewNodes,c=t.getWorkId(),m=[{type:dt.RemoveNode,removeIds:[c],viewId:this.viewId}];if(n&&m.push({type:dt.None,isLockSentEventCursor:n}),l!=null&&l.size||o!=null&&o.size||a!=null&&a.size){if(l!=null&&l.size){_iterator62=_createForOfIteratorHelper(l);try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){_step62$value=_slicedToArray(_step62.value,2),v=_step62$value[0],S=_step62$value[1];m.push({type:dt.UpdateNode,dataType:Dt.Local,opt:S.opt,workId:v,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}}if(o!=null&&o.size&&m.push({type:dt.RemoveNode,removeIds:_toConsumableArray(o),viewId:this.thread.viewId}),a!=null&&a.size){_iterator63=_createForOfIteratorHelper(a);try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){_step63$value=_slicedToArray(_step63.value,2),_v6=_step63$value[0],_S9=_step63$value[1];m.push({type:dt.FullWork,dataType:Dt.Local,toolsType:_S9.toolsType,ops:ve(_S9.op),opt:_S9.opt,workId:_v6,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}}}f=[{isClearAll:!0,clearCanvas:Et.Float,viewId:this.viewId}];i&&f.push({rect:i,isClear:!0,clearCanvas:Et.Bg,viewId:this.viewId},{rect:i,drawCanvas:Et.Bg,viewId:this.viewId});_context53.next=6;return this._post({sp:m,render:f,fullWorkerDrawCount:1/0});case 6:case"end":return _context53.stop();}},_callee51,this);}));function drawEraserFull(_x114,_x115,_x116){return _drawEraserFull.apply(this,arguments);}return drawEraserFull;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t,r){var n,i;return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:n=[],i=[];r&&n.push({type:dt.None,isLockSentEventCursor:r});t.removeIds&&n.push(t);t.rect&&i.push({rect:t.rect,isClear:!0,clearCanvas:Et.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Et.Bg,viewId:this.viewId});_context54.next=6;return this._post({sp:n,render:i,consumeCount:this.consumeCount});case 6:case"end":return _context54.stop();}},_callee52,this);}));function drawEraser(_x117,_x118){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawShape",value:function(){var _drawShape=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53(t){return _regeneratorRuntime().wrap(function _callee53$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:_context55.next=2;return this._post({fullWorkerDrawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context55.stop();}},_callee53,this);}));function drawShape(_x119){return _drawShape.apply(this,arguments);}return drawShape;}()},{key:"drawPencil",value:function(){var _drawPencil=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54(t){return _regeneratorRuntime().wrap(function _callee54$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:_context56.next=2;return this._post({sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context56.stop();}},_callee54,this);}));function drawPencil(_x120){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(t){var r,_iterator64,_step64,n,i,l,o;return _regeneratorRuntime().wrap(function _callee55$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:_iterator64=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context57.prev=1;_iterator64.s();case 3:if((_step64=_iterator64.n()).done){_context57.next=23;break;}n=_step64.value;i=this.setFullWork(n);if(!i){_context57.next=21;break;}l=(r=i.getWorkId())==null?void 0:r.toString();if(!(i.toolsType===pt.Image)){_context57.next=13;break;}_context57.next=11;return i.consumeServiceAsync({isFullWork:!0,replaceId:l,worker:this});case 11:_context57.next=20;break;case 13:if(!(i.toolsType===pt.Text)){_context57.next=18;break;}_context57.next=16;return i.consumeServiceAsync({isFullWork:!0,replaceId:l});case 16:_context57.next=20;break;case 18:o=n.ops&&Qe(n.ops);i.consumeService({op:o,isFullWork:!0,replaceId:l}),n!=null&&n.updateNodeOpt&&i.updataOptService(n.updateNodeOpt);case 20:n.workId&&this.workShapes["delete"](n.workId.toString());case 21:_context57.next=3;break;case 23:_context57.next=28;break;case 25:_context57.prev=25;_context57.t0=_context57["catch"](1);_iterator64.e(_context57.t0);case 28:_context57.prev=28;_iterator64.f();return _context57.finish(28);case 31:_context57.next=33;return this.reRenderSelector(t);case 33:case"end":return _context57.stop();}},_callee55,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x121){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(t){var o,r,n,i,l,a,c;return _regeneratorRuntime().wrap(function _callee56$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:r=t.opt,n=t.toolsType,i=t.point,l=this.setFullWork({workId:He,toolsType:n,opt:r});if(!(l&&i)){_context58.next=8;break;}a=l.cursorHover(i),c={render:[]};_context58.t0=a&&a.type===dt.CursorHover&&a.rect;if(!_context58.t0){_context58.next=8;break;}(o=c.render)==null||o.push({rect:kt(a.rect),clearCanvas:Et.Bg,isClear:!0,viewId:this.viewId},{rect:kt(a.rect),drawCanvas:Et.Bg,viewId:this.viewId});_context58.next=8;return this._post(c);case 8:case"end":return _context58.stop();}},_callee56,this);}));function cursorHover(_x122){return _cursorHover.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee57(){var n,t,r;return _regeneratorRuntime().wrap(function _callee57$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:t=this.getWorkShape(He);_context59.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context59.t0){_context59.next=10;break;}r=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(He);_context59.t1=r;if(!_context59.t1){_context59.next=10;break;}_context59.next=10;return this._post({render:[{rect:kt(r),clearCanvas:Et.Bg,isClear:!0,viewId:this.viewId},{rect:kt(r),drawCanvas:Et.Bg,viewId:this.viewId}]});case 10:this.fullLayer.parent.children.forEach(function(i){i.name==="Cursor_Hover_Id"&&i.remove();});case 11:case"end":return _context59.stop();}},_callee57,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(gn);var ys=/*#__PURE__*/function(){function ys(e){_classCallCheck(this,ys);ot(this,"viewId");ot(this,"vNodes");ot(this,"fullLayer");ot(this,"drawLayer");ot(this,"workShapes",/* @__PURE__ */new Map());ot(this,"selectorWorkShapes",/* @__PURE__ */new Map());ot(this,"thread");ot(this,"animationId");ot(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());ot(this,"runEffectId");ot(this,"noAnimationRect");ot(this,"syncUnitTime",me.syncOpt.interval);ot(this,"post");this.viewId=e.viewId,this.vNodes=e.vNodes,this.fullLayer=e.fullLayer,this.drawLayer=e.drawLayer,this.thread=e.thread,this.post=e.thread.post.bind(e.thread);}return _createClass(ys,[{key:"destroy",value:function destroy(){this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear();}},{key:"consumeDraw",value:function(){var _consumeDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e){return _regeneratorRuntime().wrap(function _callee58$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:this.activeWorkShape(e),this.runAnimation();case 1:case"end":return _context60.stop();}},_callee58,this);}));function consumeDraw(_x123){return _consumeDraw2.apply(this,arguments);}return consumeDraw;}()},{key:"consumeFull",value:function consumeFull(e){this.activeWorkShape(e),this.runAnimation();}},{key:"runSelectWork",value:function runSelectWork(e){this.activeSelectorShape(e);var t=e.workId,r=t==null?void 0:t.toString();r&&this.willRunEffectSelectorIds.add(r),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(e,t,r,n){return t.toolsType=r,t.node=Ur({workId:e,toolsType:r,toolsOpt:n,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),t;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(e){var _this95=this;e.forEach(function(t){_this95.selectorWorkShapes.forEach(function(r,n){var i;if((i=r.selectIds)!=null&&i.length){var l=r.selectIds.indexOf(t);l>-1&&(r.selectIds.splice(l,1),_this95.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function(){var _removeWork3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e){var t,r,n;return _regeneratorRuntime().wrap(function _callee59$(_context61){while(1)switch(_context61.prev=_context61.next){case 0:t=e.workId,r=t==null?void 0:t.toString();if(!r){_context61.next=10;break;}n=this.workShapes.get(r);if(!n){_context61.next=8;break;}this.workShapes["delete"](r);_context61.next=7;return this.removeNode(r,e,n==null?void 0:n.totalRect,!1);case 7:return _context61.abrupt("return");case 8:_context61.next=10;return this.removeNode(r,e);case 10:case"end":return _context61.stop();}},_callee59,this);}));function removeWork(_x124){return _removeWork3.apply(this,arguments);}return removeWork;}()},{key:"removeSelectWork",value:function removeSelectWork(e){var t=e.workId,r=t==null?void 0:t.toString();r&&(this.activeSelectorShape(e),this.willRunEffectSelectorIds.add(r)),this.runEffect();}},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e,t,r){var _this96=this;var n,c,i,l,o,a,_args62=arguments;return _regeneratorRuntime().wrap(function _callee60$(_context62){while(1)switch(_context62.prev=_context62.next){case 0:n=_args62.length>3&&_args62[3]!==undefined?_args62[3]:!0;e.indexOf(qt)>-1&&this.removeSelectWork(t);i=r;l=(c=this.vNodes.get(e))==null?void 0:c.rect;l&&(i=bt(l,i));o=this.fullLayer&&At.getRectFromLayer(this.fullLayer,e);i=bt(i,o);a=this.drawLayer&&At.getRectFromLayer(this.drawLayer,e);i=bt(i,a);this.fullLayer.getElementsByName(e).forEach(function(m){m.remove(),_pe(m,_this96.fullLayer.parent);});this.drawLayer.getElementsByName(e).forEach(function(m){m.remove(),_pe(m,_this96.drawLayer.parent);});this.vNodes["delete"](e);_context62.t0=i;if(!_context62.t0){_context62.next=16;break;}_context62.next=16;return this.post({render:[{rect:kt(i),isClear:!0,clearCanvas:n?Et.Bg:Et.ServiceFloat,workerType:n?void 0:Dt.Service,viewId:this.viewId},{rect:kt(i),drawCanvas:n?Et.Bg:Et.ServiceFloat,workerType:n?void 0:Dt.Service,viewId:this.viewId}]});case 16:case"end":return _context62.stop();}},_callee60,this);}));function removeNode(_x125,_x126,_x127){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(e){var E,T,P,x;var t=e.workId,r=e.opt,n=e.toolsType,i=e.type,l=e.updateNodeOpt,o=e.ops,a=e.op,c=e.useAnimation,m=e.isEnableCursor;if(!t)return;var f=t.toString(),v=(E=this.vNodes.get(f))==null?void 0:E.rect;if(!((T=this.workShapes)!=null&&T.has(f))){var _h46={toolsType:n,animationWorkData:a||[],animationIndex:0,type:i,updateNodeOpt:l,ops:o,useAnimation:_typeof(c)<"u"?c:_typeof(l==null?void 0:l.useAnimation)<"u"?l==null?void 0:l.useAnimation:!0,oldRect:v,isDiff:!1,isEnableCursor:m};n&&r&&(_h46=this.setNodeKey(f,_h46,n,r)),(P=this.workShapes)==null||P.set(f,_h46);}var S=(x=this.workShapes)==null?void 0:x.get(f);S.isEnableCursor=m,i&&(S.type=i),o&&(S.animationWorkData=Qe(o),S.ops=o),l&&(S.updateNodeOpt=l),a&&(S.isDiff=this.hasDiffData(S.animationWorkData||[],a,S.toolsType),S.animationWorkData=a),S.node&&S.node.getWorkId()!==f&&S.node.setWorkId(f),v&&(S.oldRect=v),n&&r&&(r.syncUnitTime&&(this.syncUnitTime=r.syncUnitTime),S.toolsType!==n&&n&&r&&this.setNodeKey(f,S,n,r),S.node&&S.node.setWorkOptions(r));}},{key:"hasDiffData",value:function hasDiffData(e,t,r){var n=e.length;if(t.length<n)return!0;switch(r){case pt.Pencil:{for(var i=0;i<n;i+=3)if(t[i]!==e[i]||t[i+1]!==e[i+1])return!0;break;}case pt.LaserPen:{for(var _i4=0;_i4<n;_i4+=2)if(t[_i4]!==e[_i4]||t[_i4+1]!==e[_i4+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee61(){var _this97=this;var n,i,l,o,a,c,m,f,v,S,E,T,P,x,h,p,d,g,O,w,L,B,A,b,W,D,R,X,H,J,et,it,$,V,rt,lt,ct,gt,st,Ct,e,t,r,_iterator65,_step65,_loop6;return _regeneratorRuntime().wrap(function _callee61$(_context64){while(1)switch(_context64.prev=_context64.next){case 0:this.animationId=void 0;e=!1;t={render:[]},r=/* @__PURE__ */new Map();_iterator65=_createForOfIteratorHelper(this.workShapes.entries());_context64.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step65$value,xt,F,U,K,_U,_K,_U2,_K2,q,Y,_U3,_K3,_q,_Y2,k,C,M,_C,_U4,_K4,_q2,_Y3;return _regeneratorRuntime().wrap(function _loop6$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:_step65$value=_slicedToArray(_step65.value,2),xt=_step65$value[0],F=_step65$value[1];_context63.t0=F.toolsType;_context63.next=_context63.t0===pt.Image?4:_context63.t0===pt.Text?11:_context63.t0===pt.Arrow?19:_context63.t0===pt.Straight?19:_context63.t0===pt.Rectangle?19:_context63.t0===pt.Ellipse?19:_context63.t0===pt.Star?19:_context63.t0===pt.Polygon?19:_context63.t0===pt.SpeechBalloon?19:_context63.t0===pt.Pencil?22:38;break;case 4:U=F.oldRect;U&&((n=t.render)==null||n.push({rect:U,isClear:!0,clearCanvas:Et.Bg,viewId:_this97.viewId}),(i=t.render)==null||i.push({rect:U,drawCanvas:Et.Bg,viewId:_this97.viewId}));_context63.next=8;return(l=F.node)==null?void 0:l.consumeServiceAsync({isFullWork:!0,worker:_this97.thread});case 8:K=_context63.sent;_this97.selectorWorkShapes.forEach(function(q,Y){var k;(k=q.selectIds)!=null&&k.includes(xt)&&(_this97.willRunEffectSelectorIds.add(Y),_this97.noAnimationRect=bt(_this97.noAnimationRect,U),_this97.noAnimationRect=bt(_this97.noAnimationRect,K),_this97.runEffect());}),_this97.workShapes["delete"](xt),(o=t.render)==null||o.push({rect:K,drawCanvas:Et.Bg,viewId:_this97.viewId});return _context63.abrupt("break",38);case 11:if(!F.node){_context63.next=18;break;}_U=F.oldRect;_U&&((a=t.render)==null||a.push({rect:_U,isClear:!0,clearCanvas:Et.Bg,viewId:_this97.viewId}),(c=t.render)==null||c.push({rect:_U,drawCanvas:Et.Bg,viewId:_this97.viewId}));_context63.next=16;return F.node.consumeServiceAsync({isFullWork:!0,replaceId:xt});case 16:_K=_context63.sent;_this97.selectorWorkShapes.forEach(function(q,Y){var k;(k=q.selectIds)!=null&&k.includes(xt)&&(_this97.willRunEffectSelectorIds.add(Y),_this97.noAnimationRect=bt(_this97.noAnimationRect,_U),_this97.noAnimationRect=bt(_this97.noAnimationRect,_K),_this97.runEffect());}),(m=F.node)==null||m.clearTmpPoints(),_this97.workShapes["delete"](xt),(f=t.render)==null||f.push({rect:_K,drawCanvas:Et.Bg,viewId:_this97.viewId});case 18:return _context63.abrupt("break",38);case 19:_U2=!!F.ops;if((v=F.animationWorkData)!=null&&v.length){_K2=F.oldRect,q=F.node.oldRect;_K2&&((S=t.render)==null||S.push({rect:_K2,isClear:!0,clearCanvas:Et.Bg,viewId:_this97.viewId}),(E=t.render)==null||E.push({rect:_K2,drawCanvas:Et.Bg,viewId:_this97.viewId})),q&&((T=t.render)==null||T.push({rect:q,isClear:!0,clearCanvas:Et.ServiceFloat,viewId:_this97.viewId}));Y=(P=F.node)==null?void 0:P.consumeService({op:F.animationWorkData,isFullWork:_U2});F.isEnableCursor?r.set(xt,{workState:_K2?F.ops?Ft.Done:Ft.Doing:Ft.Start,op:F.animationWorkData.slice(-3,-1)}):_U2&&!F.useAnimation&&(x=F.updateNodeOpt)!=null&&x.useAnimation&&r.set(xt,{workState:Ft.Done,op:F.animationWorkData.slice(-3,-1),uid:(h=F.updateNodeOpt)==null?void 0:h.uid}),_U2?(_this97.selectorWorkShapes.forEach(function(k,C){var M;(M=k.selectIds)!=null&&M.includes(xt)&&(_this97.willRunEffectSelectorIds.add(C),_this97.noAnimationRect=bt(_this97.noAnimationRect,_K2),_this97.noAnimationRect=bt(_this97.noAnimationRect,q),_this97.noAnimationRect=bt(_this97.noAnimationRect,Y),_this97.runEffect());}),(p=F.node)==null||p.clearTmpPoints(),_this97.workShapes["delete"](xt),(d=t.render)==null||d.push({rect:Y,drawCanvas:Et.Bg,viewId:_this97.viewId})):(g=t.render)==null||g.push({rect:Y,drawCanvas:Et.ServiceFloat,workerType:_U2?void 0:Dt.Service,viewId:_this97.viewId}),F.animationWorkData.length=0;}return _context63.abrupt("break",38);case 22:if(!F.useAnimation){_context63.next=33;break;}if(!F.useAnimation){_context63.next=31;break;}if(!F.isDel){_context63.next=27;break;}(et=F.node)==null||et.clearTmpPoints(),_this97.workShapes["delete"](xt);return _context63.abrupt("break",38);case 27:_U3=3,_K3=_this97.computNextAnimationIndex(F,_U3),_q=F.isDiff?0:Math.max(0,(F.animationIndex||0)-_U3),_Y2=(F.animationWorkData||[]).slice(0,_K3),k=($=(it=F.node)==null?void 0:it.getWorkId())==null?void 0:$.toString();if((F.animationIndex||0)<_K3||F.isDiff){C=(V=F.node)==null?void 0:V.consumeService({op:_Y2,isFullWork:!1,replaceId:k});if((rt=t.render)==null||rt.push({isClear:!0,rect:C,clearCanvas:Et.ServiceFloat,viewId:_this97.viewId}),(lt=t.render)==null||lt.push({rect:C,drawCanvas:Et.ServiceFloat,viewId:_this97.viewId}),F.animationIndex=_K3,F.isDiff&&(F.isDiff=!1),_Y2.length&&F.isEnableCursor){M=_Y2.slice(-3,-1);r.set(xt,{workState:_q===0?Ft.Start:_K3===((ct=F.animationWorkData)==null?void 0:ct.length)?Ft.Done:Ft.Doing,op:M});}}else if(F.ops){_C=(gt=F.node)==null?void 0:gt.consumeService({op:F.animationWorkData||[],isFullWork:!0,replaceId:k});F.isDel=!0,(st=t.render)==null||st.push({isClear:!0,rect:_C,clearCanvas:Et.ServiceFloat,viewId:_this97.viewId},{rect:_C,drawCanvas:Et.ServiceFloat,viewId:_this97.viewId},{isClear:!0,rect:_C,clearCanvas:Et.Bg,viewId:_this97.viewId},{rect:_C,drawCanvas:Et.Bg,viewId:_this97.viewId}),F.isEnableCursor&&r.set(xt,{workState:Ft.Done,op:_Y2.slice(-3,-1)});}e=!0;return _context63.abrupt("break",38);case 31:_context63.next=37;break;case 33:_U4=!!F.ops;_K4=(O=F.node)==null?void 0:O.consumeService({op:F.animationWorkData||[],isFullWork:_U4,replaceId:xt});_q2=(w=F.node)==null?void 0:w.updataOptService(F.updateNodeOpt);if(_U4){if(_K4=bt(_K4,_q2),(L=t.render)==null||L.push({isClear:!0,rect:bt(F.oldRect,_K4),clearCanvas:Et.Bg,viewId:_this97.viewId}),(B=t.render)==null||B.push({rect:bt(F.oldRect,_K4),drawCanvas:Et.Bg,viewId:_this97.viewId}),(A=F.updateNodeOpt)!=null&&A.useAnimation&&((b=t.render)==null||b.push({isClear:!0,rect:bt(F.oldRect,_K4),clearCanvas:Et.ServiceFloat,viewId:_this97.viewId}),(W=t.render)==null||W.push({rect:bt(F.oldRect,_K4),drawCanvas:Et.ServiceFloat,viewId:_this97.viewId}),!F.isEnableCursor&&(D=F.animationWorkData)!=null&&D.length)){_Y3=F.animationWorkData.slice(-3,-1);r.set(xt,{workState:Ft.Done,op:_Y3,uid:(R=F.updateNodeOpt)==null?void 0:R.uid});}_this97.selectorWorkShapes.forEach(function(Y,k){var C;(C=Y.selectIds)!=null&&C.includes(xt)&&(_this97.willRunEffectSelectorIds.add(k),_this97.noAnimationRect=bt(_this97.noAnimationRect,_K4),_this97.runEffect());}),(X=F.node)==null||X.clearTmpPoints(),_this97.workShapes["delete"](xt);}else _K4=bt(_K4,_q2),(H=t.render)==null||H.push({isClear:!0,rect:bt(F.oldRect,_K4),clearCanvas:Et.ServiceFloat,viewId:_this97.viewId}),(J=t.render)==null||J.push({rect:bt(F.oldRect,_K4),drawCanvas:Et.ServiceFloat,viewId:_this97.viewId});case 37:return _context63.abrupt("break",38);case 38:case"end":return _context63.stop();}},_loop6);});_iterator65.s();case 7:if((_step65=_iterator65.n()).done){_context64.next=11;break;}return _context64.delegateYield(_loop6(),"t0",9);case 9:_context64.next=7;break;case 11:_context64.next=16;break;case 13:_context64.prev=13;_context64.t1=_context64["catch"](4);_iterator65.e(_context64.t1);case 16:_context64.prev=16;_iterator65.f();return _context64.finish(16);case 19:e&&this.runAnimation();r.size&&(t.sp=[],r.forEach(function(xt,F){var U;(U=t.sp)==null||U.push({type:dt.Cursor,uid:xt.uid||F.split(Je)[0],op:xt.op,workState:xt.workState,viewId:_this97.viewId});}));_context64.t2=(Ct=t.render)!=null&&Ct.length;if(!_context64.t2){_context64.next=25;break;}_context64.next=25;return this.post(t);case 25:case"end":return _context64.stop();}},_callee61,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this98=this;this.animationId||(this.animationId=setTimeout(function(){_this98.animationId=void 0,_this98.animationDraw();},16));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(e,t){var r=Math.floor((e.animationWorkData||[]).slice(e.animationIndex).length*48/t/this.syncUnitTime)*t;return Math.min((e.animationIndex||0)+(r||t),(e.animationWorkData||[]).length);}},{key:"runEffect",value:function runEffect(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0));}},{key:"effectRunSelector",value:function(){var _effectRunSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee62(){var _this99=this;var e;return _regeneratorRuntime().wrap(function _callee62$(_context65){while(1)switch(_context65.prev=_context65.next){case 0:this.runEffectId=void 0;e=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var i,l;var r=_this99.selectorWorkShapes.get(t),n=r&&r.selectIds&&((i=r.node)==null?void 0:i.selectServiceNode(t,r,!0));e=bt(e,n),(l=r==null?void 0:r.selectIds)!=null&&l.length||_this99.selectorWorkShapes["delete"](t);});_context65.t0=e;if(!_context65.t0){_context65.next=7;break;}_context65.next=7;return this.post({render:[{rect:kt(e),isClear:!0,clearCanvas:Et.Bg,viewId:this.viewId},{rect:kt(e),drawCanvas:Et.Bg,viewId:this.viewId}]});case 7:this.willRunEffectSelectorIds.clear();this.noAnimationRect=void 0;case 9:case"end":return _context65.stop();}},_callee62,this);}));function effectRunSelector(){return _effectRunSelector.apply(this,arguments);}return effectRunSelector;}()},{key:"activeSelectorShape",value:function activeSelectorShape(e){var m,f,v;var t=e.workId,r=e.opt,n=e.toolsType,i=e.type,l=e.selectIds,o=e.imageBitmap;if(!t)return;var a=t.toString();if(!((m=this.selectorWorkShapes)!=null&&m.has(a))){var S={toolsType:n,selectIds:l,type:i,opt:r,imageBitmap:o};n&&r&&(S=this.setNodeKey(a,S,n,r)),(f=this.selectorWorkShapes)==null||f.set(a,S);}var c=(v=this.selectorWorkShapes)==null?void 0:v.get(a);i&&(c.type=i),c.node&&c.node.getWorkId()!==a&&c.node.setWorkId(a),o&&(c.imageBitmap=o),c.selectIds=l||[];}}]);}();var oy=/*#__PURE__*/function(_gn2){function oy(t){var _this100;_classCallCheck(this,oy);_this100=_callSuper(this,oy,[t]);ot(_this100,"drawWorkActiveId");return _this100;}// async runFullWork(data: IWorkerMessage): Promise<IRectType | undefined> {
441
- // const workShape = this.setFullWork(data);
442
- // const op = data.ops && transformToNormalData(data.ops);
443
- // if (workShape) {
444
- // let rect: IRectType | undefined;
445
- // let updataOptRect: IRectType | undefined;
446
- // const replaceId = workShape.getWorkId()?.toString();
447
- // if (workShape.toolsType === EToolsKey.Image) {
448
- // rect = await (workShape as ImageShape).consumeServiceAsync({
449
- // isFullWork: true,
450
- // worker: this.thread,
451
- // });
452
- // } else if (workShape.toolsType === EToolsKey.Text) {
453
- // rect = await (workShape as TextShape).consumeServiceAsync({
454
- // isFullWork: true,
455
- // replaceId,
456
- // isDrawLabel: true,
457
- // });
458
- // } else {
459
- // rect = workShape.consumeService({
460
- // op,
461
- // isFullWork: true,
462
- // replaceId,
463
- // });
464
- // updataOptRect =
465
- // data?.updateNodeOpt && workShape.updataOptService(data.updateNodeOpt);
466
- // }
467
- // data.workId && this.workShapes.delete(data.workId.toString());
468
- // return computRect(rect, updataOptRect);
469
- // }
470
- // }
471
- _inherits(oy,_gn2);return _createClass(oy,[{key:"runSelectWork",value:function runSelectWork(t){var n;var r=this.setFullWork(t);r&&(n=t.selectIds)!=null&&n.length&&t.workId&&r.selectServiceNode(t.workId.toString(),{selectIds:t.selectIds},!1);}},{key:"workShapesDone",value:function workShapesDone(){var _iterator66=_createForOfIteratorHelper(this.workShapes.keys()),_step66;try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){var t=_step66.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}Te(this.fullLayer,this.fullLayer.parent);}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(t){var r,n,i,l,o,a,c;return _regeneratorRuntime().wrap(function _callee63$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:r=t.workId,n=t.fullWorkerDrawCount,i=t.postCount,l=r==null?void 0:r.toString(),o=l&&this.workShapes.get(l);if(o){_context66.next=3;break;}return _context66.abrupt("return");case 3:_context66.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==l;if(!_context66.t0){_context66.next=8;break;}_context66.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:dt.DrawWork,dataType:Dt.Local});case 7:this.drawWorkActiveId=void 0;case 8:!this.drawWorkActiveId&&l!==qt&&(this.drawWorkActiveId=l);a=o.toolsType;he(i)&&(this.consumeCount=i);c=o.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0,removeDrawCount:n});_context66.t1=a;_context66.next=_context66.t1===pt.Selector?15:_context66.t1===pt.Ellipse?21:_context66.t1===pt.Arrow?21:_context66.t1===pt.Straight?21:_context66.t1===pt.Rectangle?21:_context66.t1===pt.Star?21:_context66.t1===pt.Polygon?21:_context66.t1===pt.SpeechBalloon?21:_context66.t1===pt.Pencil?27:_context66.t1===pt.BitMapEraser?33:_context66.t1===pt.PencilEraser?33:39;break;case 15:_context66.t2=c;if(!_context66.t2){_context66.next=20;break;}this.drawCount++;_context66.next=20;return this.drawSelector(c);case 20:return _context66.abrupt("break",39);case 21:_context66.t3=c;if(!_context66.t3){_context66.next=26;break;}this.drawCount++;_context66.next=26;return this.drawShape(c);case 26:return _context66.abrupt("break",39);case 27:_context66.t4=c;if(!_context66.t4){_context66.next=32;break;}this.drawCount++;_context66.next=32;return this.drawPencil(c,r==null?void 0:r.toString());case 32:return _context66.abrupt("break",39);case 33:_context66.t5=c;if(!_context66.t5){_context66.next=38;break;}this.drawCount++;_context66.next=38;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount});case 38:return _context66.abrupt("break",39);case 39:case"end":return _context66.stop();}},_callee63,this);}));function consumeDraw(_x128){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(t){var r,n,i;return _regeneratorRuntime().wrap(function _callee64$(_context67){while(1)switch(_context67.prev=_context67.next){case 0:r=t.workId;if(!r){_context67.next=14;break;}n=r.toString();this.drawWorkActiveId===n&&(this.drawWorkActiveId=void 0);i=this.workShapes.get(n);if(i){_context67.next=7;break;}return _context67.abrupt("return");case 7:_context67.t0=i.toolsType;_context67.next=_context67.t0===pt.Selector?10:_context67.t0===pt.Arrow?12:_context67.t0===pt.Straight?12:_context67.t0===pt.Ellipse?12:_context67.t0===pt.Pencil?12:_context67.t0===pt.Rectangle?12:_context67.t0===pt.Star?12:_context67.t0===pt.Polygon?12:_context67.t0===pt.SpeechBalloon?12:_context67.t0===pt.BitMapEraser?12:_context67.t0===pt.PencilEraser?12:14;break;case 10:this.drawCount=0,Te(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n),this._post({render:[{isClearAll:!0,clearCanvas:Et.Float,viewId:this.viewId}]});return _context67.abrupt("break",14);case 12:this.drawCount=0,Te(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n);return _context67.abrupt("break",14);case 14:case"end":return _context67.stop();}},_callee64,this);}));function consumeDrawAll(_x129){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(t){var r,n,i,l;return _regeneratorRuntime().wrap(function _callee65$(_context68){while(1)switch(_context68.prev=_context68.next){case 0:r=t.workId,n=r==null?void 0:r.toString();if(!n){_context68.next=8;break;}i=this.removeNode(n);if(!i){_context68.next=8;break;}l=[];l.push({rect:kt(i),clearCanvas:Et.Float,isClear:!0,viewId:this.viewId},{rect:kt(i),drawCanvas:Et.Float,viewId:this.viewId});_context68.next=8;return this._post({render:l});case 8:case"end":return _context68.stop();}},_callee65,this);}));function removeWork(_x130){return _removeWork4.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this101=this;var r=this.workShapes.has(t);var n;return r&&(this.fullLayer.getElementsByName(t).forEach(function(i){var l=i.getBoundingClientRect();n=bt(n,{x:l.x-At.SafeBorderPadding,y:l.y-At.SafeBorderPadding,w:l.width+At.SafeBorderPadding*2,h:l.height+At.SafeBorderPadding*2}),i.remove(),_pe(i,_this101.fullLayer.parent);}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function(){var _drawPencil2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee66(t,r){return _regeneratorRuntime().wrap(function _callee66$(_context69){while(1)switch(_context69.prev=_context69.next){case 0:_context69.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:t==null?void 0:t.rect,workId:r,drawCanvas:Et.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context69.stop();}},_callee66,this);}));function drawPencil(_x131,_x132){return _drawPencil2.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee67(t){return _regeneratorRuntime().wrap(function _callee67$(_context70){while(1)switch(_context70.prev=_context70.next){case 0:_context70.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&kt(t.rect),isClear:!0,clearCanvas:Et.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&kt(t.rect),drawCanvas:Et.Float,viewId:this.viewId}]});case 2:case"end":return _context70.stop();}},_callee67,this);}));function drawShape(_x133){return _drawShape2.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee68(t){return _regeneratorRuntime().wrap(function _callee68$(_context71){while(1)switch(_context71.prev=_context71.next){case 0:_context71.next=2;return this._post({subWorkerDrawCount:this.drawCount,consumeCount:this.consumeCount,render:[{rect:(t==null?void 0:t.rect)&&kt(t.rect),isClear:!0,clearCanvas:Et.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&kt(t.rect),drawCanvas:Et.Float,viewId:this.viewId}]});case 2:case"end":return _context71.stop();}},_callee68,this);}));function drawSelector(_x134){return _drawSelector2.apply(this,arguments);}return drawSelector;}()}]);}(gn);var ay=/*#__PURE__*/function(){function ay(e){_classCallCheck(this,ay);ot(this,"viewId");ot(this,"vNodes");ot(this,"topLayer");ot(this,"thread");ot(this,"post");ot(this,"serviceWorkShapes",/* @__PURE__ */new Map());ot(this,"localWorkShapes",/* @__PURE__ */new Map());ot(this,"tmpOpt");ot(this,"syncUnitTime",me.syncOpt.interval);ot(this,"animationId");this.viewId=e.viewId,this.vNodes=e.vNodes,this.topLayer=e.topLayer,this.thread=e.thread,this.post=e.thread.post.bind(e.thread);}return _createClass(ay,[{key:"canUseTopLayer",value:function canUseTopLayer(e){return e===pt.LaserPen;}},{key:"getWorkShape",value:function getWorkShape(e){return this.localWorkShapes.get(e);}},{key:"createWorkShape",value:function createWorkShape(e,t){if(e&&this.tmpOpt){var r={toolsType:this.tmpOpt.toolsType,toolsOpt:t||this.tmpOpt.toolsOpt},n=this.createWorkShapeNode(_objectSpread(_objectSpread({},r),{},{workId:e}));return n&&this.localWorkShapes.set(e,{node:n,toolsType:n.toolsType,workState:Ft.Start}),n;}}},{key:"setWorkOptions",value:function setWorkOptions(e,t){var n;var r=(n=this.localWorkShapes.get(e))==null?void 0:n.node;r||this.createWorkShape(e,t),r==null||r.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(e){var t=e.toolsType;if(t===pt.LaserPen)return Ur(_objectSpread(_objectSpread({},e),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(e){var t;return(t=e.node)==null?void 0:t.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(e){var t;this.tmpOpt=e,(t=e.toolsOpt)!=null&&t.syncUnitTime&&(this.syncUnitTime=e.toolsOpt.syncUnitTime);}},{key:"getToolsOpt",value:function getToolsOpt(){return this.tmpOpt;}},{key:"consumeDraw",value:function consumeDraw(e){var t=e.workId,r=e.dataType;if(r===Dt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var l=i.node.consume({data:e,isFullWork:!1,isSubWorker:!0});l.rect&&(i.totalRect=bt(l.rect,i.totalRect),i.result=l,i.workState=Ft.Doing,n&&this.localWorkShapes.set(n,i));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(e){var t=e.workId,r=e.dataType;if(r===Dt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var l=i.node.consumeAll({data:e});i.totalRect=bt(l.rect,i.totalRect),i.result=l,i.workState=Ft.Done,n&&this.localWorkShapes.set(n,i);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(e,t,r,n){return t.toolsType=r,t.node=this.createWorkShapeNode({workId:e,toolsType:r,toolsOpt:n}),t;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(e){var v,S;var t=e.workId,r=e.opt,n=e.toolsType,i=e.type,l=e.updateNodeOpt,o=e.ops,a=e.op;if(!t)return;var c=t.toString(),m=(v=this.vNodes.get(c))==null?void 0:v.rect;if(!((S=this.serviceWorkShapes)!=null&&S.has(c))){var E={toolsType:n,animationWorkData:a||[],animationIndex:0,type:i,updateNodeOpt:l,ops:o,oldRect:m};n&&r&&(E=this.setNodeKey(c,E,n,r)),this.serviceWorkShapes.set(c,E);}var f=this.serviceWorkShapes.get(c);i&&(f.type=i),o&&(f.animationWorkData=Qe(o),f.ops=o),l&&(f.updateNodeOpt=l),a&&(f.animationWorkData=a),f.node&&f.node.getWorkId()!==c&&f.node.setWorkId(c),m&&(f.oldRect=m),n&&r&&(f.toolsType!==n&&n&&r&&this.setNodeKey(c,f,n,r),f.node&&f.node.setWorkOptions(r));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(e,t){var r=Math.floor((e.animationWorkData||[]).slice(e.animationIndex).length*32/t/this.syncUnitTime)*t;return Math.min((e.animationIndex||0)+(r||t),(e.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee69(){var _this102=this;var l,o,a,c,e,t,r,n,i,_iterator67,_step67,_step67$value,m,f,S,E,T,P,_iterator68,_step68,_step68$value,_m13,_f7,v,_S10,_E2,_T4,_P22;return _regeneratorRuntime().wrap(function _callee69$(_context72){while(1)switch(_context72.prev=_context72.next){case 0:this.animationId=void 0;e=!1;t=/* @__PURE__ */new Map(),r=[],n=[],i=[];_iterator67=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context72.prev=4;_iterator67.s();case 6:if((_step67=_iterator67.n()).done){_context72.next=20;break;}_step67$value=_slicedToArray(_step67.value,2),m=_step67$value[0],f=_step67$value[1];_context72.t0=f.toolsType;_context72.next=_context72.t0===pt.LaserPen?11:18;break;case 11:S=this.computNextAnimationIndex(f,8),E=Math.max(0,f.animationIndex||0),T=(f.animationWorkData||[]).slice(E,S);if((f.animationIndex||0)<S){P=(l=f.node)==null?void 0:l.consumeService({op:T,isFullWork:!1});f.totalRect=bt(f.totalRect,P),f.animationIndex=S,T.length&&t.set(m,{workState:E===0?Ft.Start:S===((o=f.animationWorkData)==null?void 0:o.length)?Ft.Done:Ft.Doing,op:T.slice(-2)});}if(!(n.push({isClear:!0,rect:f.totalRect,clearCanvas:Et.TopFloat,viewId:this.viewId}),r.push({rect:f.totalRect,drawCanvas:Et.TopFloat,viewId:this.viewId}),f.isDel)){_context72.next=16;break;}(a=f.node)==null||a.clearTmpPoints(),this.serviceWorkShapes["delete"](m);return _context72.abrupt("break",18);case 16:f.ops&&f.animationIndex===((c=f.animationWorkData)==null?void 0:c.length)&&!f.isDel&&(this.topLayer.getElementsByName(m.toString())[0]||(f.isDel=!0,this.serviceWorkShapes.set(m,f))),e=!0;return _context72.abrupt("break",18);case 18:_context72.next=6;break;case 20:_context72.next=25;break;case 22:_context72.prev=22;_context72.t1=_context72["catch"](4);_iterator67.e(_context72.t1);case 25:_context72.prev=25;_iterator67.f();return _context72.finish(25);case 28:_iterator68=_createForOfIteratorHelper(this.localWorkShapes.entries());_context72.prev=29;_iterator68.s();case 31:if((_step68=_iterator68.n()).done){_context72.next=44;break;}_step68$value=_slicedToArray(_step68.value,2),_m13=_step68$value[0],_f7=_step68$value[1];v=_f7.result,_S10=_f7.toolsType,_E2=_f7.totalRect,_T4=_f7.isDel,_P22=_f7.workState;_context72.t2=_S10;_context72.next=_context72.t2===pt.LaserPen?37:42;break;case 37:if(!(_E2&&(n.push({isClear:!0,rect:_E2,clearCanvas:Et.TopFloat,viewId:this.viewId}),r.push({rect:_E2,drawCanvas:Et.TopFloat,viewId:this.viewId})),_T4)){_context72.next=40;break;}_f7.node.clearTmpPoints(),this.localWorkShapes["delete"](_m13),i.push({removeIds:[_m13.toString()],viewId:this.viewId,type:dt.RemoveNode});return _context72.abrupt("break",42);case 40:v&&((v.op||v.ops)&&i.push(v),_f7.result=void 0),!this.topLayer.getElementsByName(_m13.toString())[0]&&_P22===Ft.Done&&(_f7.isDel=!0,this.localWorkShapes.set(_m13,_f7)),e=!0;return _context72.abrupt("break",42);case 42:_context72.next=31;break;case 44:_context72.next=49;break;case 46:_context72.prev=46;_context72.t3=_context72["catch"](29);_iterator68.e(_context72.t3);case 49:_context72.prev=49;_iterator68.f();return _context72.finish(49);case 52:e&&this.runAnimation(),t.size&&t.forEach(function(m,f){i.push({type:dt.Cursor,uid:f.split(Je)[0],op:m.op,workState:m.workState,viewId:_this102.viewId});}),(r.length||n.length||i.length)&&this.post({render:[].concat(n,r),sp:i});case 53:case"end":return _context72.stop();}},_callee69,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){var _this103=this;this.animationId||(this.animationId=setTimeout(function(){_this103.animationId=void 0,_this103.animationDraw();},16));}}]);}();var ly=/*#__PURE__*/function(_vs){function ly(t){var _this104;_classCallCheck(this,ly);_this104=_callSuper(this,ly,[t]);ot(_this104,"_type","simple");return _this104;}_inherits(ly,_vs);return _createClass(ly,[{key:"createWorkShapeNode",value:function createWorkShapeNode(t){var n;var r=t.toolsType;return r===pt.Selector?this.vNodes?new ar(_objectSpread(_objectSpread({},t),{},{fullLayer:this.fullLayer,vNodes:this.vNodes,drawLayer:this.drawLayer})):void 0:Ur(_objectSpread(_objectSpread({},t),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(n=this.thread)==null?void 0:n.serviceWork);}},{key:"drawPencil",value:function(){var _drawPencil3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70(t,r){return _regeneratorRuntime().wrap(function _callee70$(_context73){while(1)switch(_context73.prev=_context73.next){case 0:_context73.next=2;return this._post({consumeCount:this.consumeCount,render:[{rect:t==null?void 0:t.rect,workId:r,drawCanvas:Et.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context73.stop();}},_callee70,this);}));function drawPencil(_x135,_x136){return _drawPencil3.apply(this,arguments);}return drawPencil;}()},{key:"drawShape",value:function(){var _drawShape3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee71(t){return _regeneratorRuntime().wrap(function _callee71$(_context74){while(1)switch(_context74.prev=_context74.next){case 0:_context74.next=2;return this._post({consumeCount:this.consumeCount,sp:(t==null?void 0:t.op)&&[t],render:[{rect:(t==null?void 0:t.rect)&&kt(t.rect),isClear:!0,clearCanvas:Et.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&kt(t.rect),drawCanvas:Et.Float,viewId:this.viewId}]});case 2:case"end":return _context74.stop();}},_callee71,this);}));function drawShape(_x137){return _drawShape3.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(t,r){var n,l,o,a,i,_args75=arguments;return _regeneratorRuntime().wrap(function _callee72$(_context75){while(1)switch(_context75.prev=_context75.next){case 0:n=_args75.length>2&&_args75[2]!==undefined?_args75[2]:[];i={render:n,sp:[t],consumeCount:this.consumeCount};r&&((l=i.sp)==null||l.push({type:dt.None,isLockSentEventCursor:r}));t.subRect&&((o=i.render)==null||o.push({rect:kt(t.subRect),isClear:!0,clearCanvas:Et.Float,viewId:this.viewId},{rect:kt(t.subRect),drawCanvas:Et.Float,viewId:this.viewId}));t.rect&&((a=i.render)==null||a.push({rect:kt(t.rect),clearCanvas:Et.Bg,isClear:!0,viewId:this.viewId},{rect:kt(t.rect),drawCanvas:Et.Bg,viewId:this.viewId}));_context75.next=7;return this._post(i);case 7:case"end":return _context75.stop();}},_callee72,this);}));function drawSelector(_x138,_x139){return _drawSelector3.apply(this,arguments);}return drawSelector;}()},{key:"drawEraserCombine",value:function(){var _drawEraserCombine2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(t){var n,i,l,o,r,a,c,m,f,_iterator69,_step69,_step69$value,_f8,v;return _regeneratorRuntime().wrap(function _callee73$(_context76){while(1)switch(_context76.prev=_context76.next){case 0:r=(n=this.workShapes.get(t))==null?void 0:n.combineConsume({workerEngine:this});if(!r){_context76.next=7;break;}a=r.willDeleteNodes,c=r.willNewNodes,m={render:[],sp:[]};if(r!=null&&r.rect){f=kt(r.rect);(i=m.render)==null||i.push({rect:f,isClear:!0,clearCanvas:Et.Bg,viewId:this.viewId},{rect:f,drawCanvas:Et.Bg,viewId:this.viewId});}if(a!=null&&a.size&&((l=m.sp)==null||l.push({type:dt.RemoveNode,removeIds:_toConsumableArray(a),viewId:this.thread.viewId})),c!=null&&c.size){_iterator69=_createForOfIteratorHelper(c);try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){_step69$value=_slicedToArray(_step69.value,2),_f8=_step69$value[0],v=_step69$value[1];(o=m.sp)==null||o.push({type:dt.FullWork,dataType:Dt.Local,toolsType:pt.Pencil,ops:ve(v.op),opt:v.opt,workId:_f8,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}}_context76.next=7;return this._post(m);case 7:case"end":return _context76.stop();}},_callee73,this);}));function drawEraserCombine(_x140){return _drawEraserCombine2.apply(this,arguments);}return drawEraserCombine;}()},{key:"consumeDraw",value:function(){var _consumeDraw4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee74(t,r){var _this105=this;var n,i,l,o,a,c,m,f,v;return _regeneratorRuntime().wrap(function _callee74$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:n=t.op,i=t.workId,l=t.scenePath,o=t.postCount,a=t.smoothSync;if(!(n!=null&&n.length&&i)){_context77.next=42;break;}c=i.toString(),m=this.getWorkShape(c);if(m){_context77.next=5;break;}return _context77.abrupt("return");case 5:f=m.toolsType;if(!(f===pt.LaserPen)){_context77.next=8;break;}return _context77.abrupt("return");case 8:_context77.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==c;if(!_context77.t0){_context77.next=13;break;}_context77.next=12;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:l,viewId:this.viewId,msgType:dt.DrawWork,dataType:Dt.Local},r);case 12:this.drawWorkActiveId=void 0;case 13:!this.drawWorkActiveId&&c!==qt&&(this.drawWorkActiveId=c);he(o)&&(this.consumeCount=o);v=m.consume({data:t,isSimpleWorker:!0,smoothSync:a});_context77.t1=f;_context77.next=_context77.t1===pt.Selector?19:_context77.t1===pt.PencilEraser?24:_context77.t1===pt.BitMapEraser?24:_context77.t1===pt.Eraser?29:_context77.t1===pt.Arrow?32:_context77.t1===pt.Straight?32:_context77.t1===pt.Ellipse?32:_context77.t1===pt.Rectangle?32:_context77.t1===pt.Star?32:_context77.t1===pt.Polygon?32:_context77.t1===pt.SpeechBalloon?32:_context77.t1===pt.Pencil?38:42;break;case 19:this.drawCount++;v.type===dt.Select&&v.selectIds&&r.runReverseSelectWork(v.selectIds);_context77.next=23;return this.drawSelector(v);case 23:return _context77.abrupt("break",42);case 24:this.drawCount++;this.combineTimerId||(this.combineTimerId=1,this.combineDrawActiveId=c,this.drawEraserCombine(c).then(function(){_this105.combineTimerId=void 0;}));_context77.next=28;return this._post({consumeCount:this.consumeCount});case 28:return _context77.abrupt("break",42);case 29:_context77.next=31;return this.drawEraser(v);case 31:return _context77.abrupt("break",42);case 32:_context77.t2=v;if(!_context77.t2){_context77.next=37;break;}this.drawCount++;_context77.next=37;return this.drawShape(v);case 37:return _context77.abrupt("break",42);case 38:this.drawCount++;_context77.next=41;return this.drawPencil(v,c);case 41:return _context77.abrupt("break",42);case 42:case"end":return _context77.stop();}},_callee74,this);}));function consumeDraw(_x141,_x142){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(t,r){var o,a,c,n,i,l,m,f,v,S,E,T,P;return _regeneratorRuntime().wrap(function _callee75$(_context78){while(1)switch(_context78.prev=_context78.next){case 0:this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0,this.combineDrawResolve&&this.combineDrawResolve(!1),this.combineDrawActiveId=void 0);n=t.workId,i=t.scenePath,l=t.isLockSentEventCursor;if(!n){_context78.next=40;break;}m=n.toString();this.drawWorkActiveId===m&&(this.drawWorkActiveId=void 0);f=this.workShapes.get(m);if(f){_context78.next=8;break;}return _context78.abrupt("return");case 8:v=f.toolsType;if(!(v===pt.LaserPen)){_context78.next=11;break;}return _context78.abrupt("return");case 11:S=this.workShapes.get(He),E=(o=S==null?void 0:S.selectIds)==null?void 0:o[0],T=f.consumeAll({data:t,workerEngine:this});_context78.t0=v;_context78.next=_context78.t0===pt.Selector?15:_context78.t0===pt.PencilEraser?23:_context78.t0===pt.BitMapEraser?23:_context78.t0===pt.Eraser?28:_context78.t0===pt.Arrow?30:_context78.t0===pt.Straight?30:_context78.t0===pt.Ellipse?30:_context78.t0===pt.Rectangle?30:_context78.t0===pt.Star?30:_context78.t0===pt.Polygon?30:_context78.t0===pt.SpeechBalloon?30:_context78.t0===pt.Pencil?35:40;break;case 15:P=[];this.drawLayer&&(this.drawCount=0,Te(this.drawLayer,this.drawLayer.parent),this.getWorkShape(m).clearSubTmpPoints(),P.push({isClearAll:!0,clearCanvas:Et.Float,viewId:this.viewId}));T.selectIds&&E&&(a=T.selectIds)!=null&&a.includes(E)&&S.cursorBlur();T.selectIds&&r.runReverseSelectWork(T.selectIds);_context78.next=21;return this.drawSelector(_objectSpread(_objectSpread({},T),{},{scenePath:i}),l,P);case 21:(c=f.selectIds)!=null&&c.length?f.clearTmpPoints():this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",40);case 23:_context78.next=25;return this.drawEraserFull(f,_objectSpread(_objectSpread({},T),{},{scenePath:i}),l);case 25:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",40);case 28:this.drawEraser(_objectSpread(_objectSpread({},T),{},{scenePath:i}),l),f.clearTmpPoints();return _context78.abrupt("break",40);case 30:_context78.next=32;return this.drawPencilFull(_objectSpread(_objectSpread({},T),{},{scenePath:i}),l);case 32:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",40);case 35:_context78.next=37;return this.drawPencilFull(_objectSpread(_objectSpread({},T),{},{scenePath:i}),l);case 37:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",40);case 40:case"end":return _context78.stop();}},_callee75,this);}));function consumeDrawAll(_x143,_x144){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()}]);}(vs);var cy=/*#__PURE__*/function(_ys){function cy(t){var _this106;_classCallCheck(this,cy);_this106=_callSuper(this,cy,[t]);ot(_this106,"_type","simple");return _this106;}_inherits(cy,_ys);return _createClass(cy,[{key:"animationDraw",value:function(){var _animationDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(){var _this107=this;var i,l,o,a,c,m,f,v,S,E,T,P,x,h,p,d,g,O,w,L,B,A,b,W,D,R,X,H,J,et,it,$,V,rt,lt,ct,gt,st,Ct,xt,t,r,n,_iterator70,_step70,_loop7;return _regeneratorRuntime().wrap(function _callee76$(_context80){while(1)switch(_context80.prev=_context80.next){case 0:this.animationId=void 0;t=!1;r={render:[]},n=/* @__PURE__ */new Map();_iterator70=_createForOfIteratorHelper(this.workShapes.entries());_context80.prev=4;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var _step70$value,F,U,K,q,_K5,_q3,_K6,_q4,Y,k,_K7,_q5,_Y4,_k3,C,M,j,_M,_K8,_q6,_Y5,_k4;return _regeneratorRuntime().wrap(function _loop7$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:_step70$value=_slicedToArray(_step70.value,2),F=_step70$value[0],U=_step70$value[1];_context79.t0=U.toolsType;_context79.next=_context79.t0===pt.Image?4:_context79.t0===pt.Text?11:_context79.t0===pt.Arrow?19:_context79.t0===pt.Straight?19:_context79.t0===pt.Rectangle?19:_context79.t0===pt.Ellipse?19:_context79.t0===pt.Star?19:_context79.t0===pt.Polygon?19:_context79.t0===pt.SpeechBalloon?19:_context79.t0===pt.Pencil?22:38;break;case 4:K=U.oldRect;K&&((i=r.render)==null||i.push({rect:K,isClear:!0,clearCanvas:Et.Bg,viewId:_this107.viewId}),(l=r.render)==null||l.push({rect:K,drawCanvas:Et.Bg,viewId:_this107.viewId}));_context79.next=8;return(o=U.node)==null?void 0:o.consumeServiceAsync({isFullWork:!0,worker:_this107.thread});case 8:q=_context79.sent;_this107.selectorWorkShapes.forEach(function(Y,k){var C;(C=Y.selectIds)!=null&&C.includes(F)&&(_this107.willRunEffectSelectorIds.add(k),_this107.noAnimationRect=bt(_this107.noAnimationRect,K),_this107.noAnimationRect=bt(_this107.noAnimationRect,q),_this107.runEffect());}),_this107.workShapes["delete"](F),(a=r.render)==null||a.push({rect:q,drawCanvas:Et.Bg,viewId:_this107.viewId});return _context79.abrupt("break",38);case 11:if(!U.node){_context79.next=18;break;}_K5=U.oldRect;_K5&&((c=r.render)==null||c.push({rect:_K5,isClear:!0,clearCanvas:Et.Bg,viewId:_this107.viewId}),(m=r.render)==null||m.push({rect:_K5,drawCanvas:Et.Bg,viewId:_this107.viewId}));_context79.next=16;return U.node.consumeServiceAsync({isFullWork:!0,replaceId:F});case 16:_q3=_context79.sent;_this107.selectorWorkShapes.forEach(function(Y,k){var C;(C=Y.selectIds)!=null&&C.includes(F)&&(_this107.willRunEffectSelectorIds.add(k),_this107.noAnimationRect=bt(_this107.noAnimationRect,_K5),_this107.noAnimationRect=bt(_this107.noAnimationRect,_q3),_this107.runEffect());}),(f=U.node)==null||f.clearTmpPoints(),_this107.workShapes["delete"](F),(v=r.render)==null||v.push({rect:_q3,drawCanvas:Et.Bg,viewId:_this107.viewId});case 18:return _context79.abrupt("break",38);case 19:_K6=!!U.ops;if((S=U.animationWorkData)!=null&&S.length){_q4=U.oldRect,Y=U.node.oldRect;_q4&&((E=r.render)==null||E.push({rect:_q4,isClear:!0,clearCanvas:Et.Bg,viewId:_this107.viewId}),(T=r.render)==null||T.push({rect:_q4,drawCanvas:Et.Bg,viewId:_this107.viewId})),Y&&((P=r.render)==null||P.push({rect:Y,isClear:!0,clearCanvas:Et.ServiceFloat,viewId:_this107.viewId}));k=(x=U.node)==null?void 0:x.consumeService({op:U.animationWorkData,isFullWork:_K6});U.isEnableCursor?n.set(F,{workState:_q4?U.ops?Ft.Done:Ft.Doing:Ft.Start,op:U.animationWorkData.slice(-3,-1)}):_K6&&!U.useAnimation&&(h=U.updateNodeOpt)!=null&&h.useAnimation&&n.set(F,{workState:Ft.Done,op:U.animationWorkData.slice(-3,-1),uid:(p=U.updateNodeOpt)==null?void 0:p.uid}),_K6?(_this107.selectorWorkShapes.forEach(function(C,M){var j;(j=C.selectIds)!=null&&j.includes(F)&&(_this107.willRunEffectSelectorIds.add(M),_this107.noAnimationRect=bt(_this107.noAnimationRect,_q4),_this107.noAnimationRect=bt(_this107.noAnimationRect,Y),_this107.noAnimationRect=bt(_this107.noAnimationRect,k),_this107.runEffect());}),(d=U.node)==null||d.clearTmpPoints(),_this107.workShapes["delete"](F),(g=r.render)==null||g.push({rect:k,drawCanvas:Et.Bg,viewId:_this107.viewId})):(O=r.render)==null||O.push({rect:k,drawCanvas:Et.ServiceFloat,workerType:_K6?void 0:Dt.Service,viewId:_this107.viewId}),U.animationWorkData.length=0;}return _context79.abrupt("break",38);case 22:if(!U.useAnimation){_context79.next=33;break;}if(!U.useAnimation){_context79.next=31;break;}if(!U.isDel){_context79.next=27;break;}(it=U.node)==null||it.clearTmpPoints(),_this107.workShapes["delete"](F);return _context79.abrupt("break",38);case 27:_K7=3,_q5=_this107.computNextAnimationIndex(U,_K7),_Y4=U.isDiff?0:Math.max(0,(U.animationIndex||0)-_K7),_k3=(U.animationWorkData||[]).slice(0,_q5),C=(V=($=U.node)==null?void 0:$.getWorkId())==null?void 0:V.toString();if((U.animationIndex||0)<_q5||U.isDiff){M=(rt=U.node)==null?void 0:rt.consumeService({op:_k3,isFullWork:!1,replaceId:C});if((lt=r.render)==null||lt.push({isClear:!0,rect:M,clearCanvas:Et.ServiceFloat,viewId:_this107.viewId}),(ct=r.render)==null||ct.push({rect:M,drawCanvas:Et.ServiceFloat,viewId:_this107.viewId}),U.animationIndex=_q5,U.isDiff&&(U.isDiff=!1),_k3.length&&U.isEnableCursor){j=_k3.slice(-3,-1);n.set(F,{workState:_Y4===0?Ft.Start:_q5===((gt=U.animationWorkData)==null?void 0:gt.length)?Ft.Done:Ft.Doing,op:j});}}else if(U.ops){_M=(st=U.node)==null?void 0:st.consumeService({op:U.animationWorkData||[],isFullWork:!0,replaceId:C});U.isDel=!0,(Ct=r.render)==null||Ct.push({isClear:!0,rect:_M,clearCanvas:Et.ServiceFloat,viewId:_this107.viewId},{rect:_M,drawCanvas:Et.ServiceFloat,viewId:_this107.viewId},{isClear:!0,rect:_M,clearCanvas:Et.Bg,viewId:_this107.viewId},{rect:_M,drawCanvas:Et.Bg,viewId:_this107.viewId}),U.isEnableCursor&&n.set(F,{workState:Ft.Done,op:_k3.slice(-3,-1)});}t=!0;return _context79.abrupt("break",38);case 31:_context79.next=37;break;case 33:_K8=!!U.ops;_q6=(w=U.node)==null?void 0:w.consumeService({op:U.animationWorkData||[],isFullWork:_K8,replaceId:F});_Y5=(L=U.node)==null?void 0:L.updataOptService(U.updateNodeOpt);if(_K8){if(_q6=bt(_q6,_Y5),(B=r.render)==null||B.push({isClear:!0,rect:bt(U.oldRect,_q6),clearCanvas:Et.Bg,viewId:_this107.viewId}),(A=r.render)==null||A.push({rect:bt(U.oldRect,_q6),drawCanvas:Et.Bg,viewId:_this107.viewId}),(b=U.updateNodeOpt)!=null&&b.useAnimation&&((W=r.render)==null||W.push({isClear:!0,rect:bt(U.oldRect,_q6),clearCanvas:Et.ServiceFloat,viewId:_this107.viewId}),(D=r.render)==null||D.push({rect:bt(U.oldRect,_q6),drawCanvas:Et.ServiceFloat,viewId:_this107.viewId}),!U.isEnableCursor&&(R=U.animationWorkData)!=null&&R.length)){_k4=U.animationWorkData.slice(-3,-1);n.set(F,{workState:Ft.Done,op:_k4,uid:(X=U.updateNodeOpt)==null?void 0:X.uid});}_this107.selectorWorkShapes.forEach(function(k,C){var M;(M=k.selectIds)!=null&&M.includes(F)&&(_this107.willRunEffectSelectorIds.add(C),_this107.noAnimationRect=bt(_this107.noAnimationRect,_q6),_this107.runEffect());}),(H=U.node)==null||H.clearTmpPoints(),_this107.workShapes["delete"](F);}else _q6=bt(_q6,_Y5),(J=r.render)==null||J.push({isClear:!0,rect:bt(U.oldRect,_q6),clearCanvas:Et.ServiceFloat,viewId:_this107.viewId}),(et=r.render)==null||et.push({rect:bt(U.oldRect,_q6),drawCanvas:Et.ServiceFloat,viewId:_this107.viewId});case 37:return _context79.abrupt("break",38);case 38:case"end":return _context79.stop();}},_loop7);});_iterator70.s();case 7:if((_step70=_iterator70.n()).done){_context80.next=11;break;}return _context80.delegateYield(_loop7(),"t0",9);case 9:_context80.next=7;break;case 11:_context80.next=16;break;case 13:_context80.prev=13;_context80.t1=_context80["catch"](4);_iterator70.e(_context80.t1);case 16:_context80.prev=16;_iterator70.f();return _context80.finish(16);case 19:t&&this.runAnimation();n.size&&(r.sp=[],n.forEach(function(F,U){var K;(K=r.sp)==null||K.push({type:dt.Cursor,uid:F.uid||U.split(Je)[0],op:F.op,workState:F.workState,viewId:_this107.viewId});}));_context80.t2=(xt=r.render)!=null&&xt.length;if(!_context80.t2){_context80.next=25;break;}_context80.next=25;return this.post(r);case 25:case"end":return _context80.stop();}},_callee76,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw3.apply(this,arguments);}return animationDraw;}()}]);}(ys);var gs=/*#__PURE__*/function(_gn3){function gs(t){var _this108;_classCallCheck(this,gs);_this108=_callSuper(this,gs,[t]);ot(_this108,"opt");ot(_this108,"scene");ot(_this108,"cameraOpt");ot(_this108,"vNodes");_this108.opt=t,_this108.vNodes=void 0;return _this108;}_inherits(gs,_gn3);return _createClass(gs,[{key:"createSnapshotFullLayer",value:function createSnapshotFullLayer(t,r){this.scene=this.opt.createScene(t),this.fullLayer=this.opt.createLayer("snapshotFullLayer",this.scene,r);}},{key:"destroySnapshotFullLayer",value:function destroySnapshotFullLayer(){var t,r,n;Te(this.fullLayer,this.fullLayer.parent),(t=this.fullLayer)==null||t.disconnect(),(r=this.fullLayer)==null||r.remove(),(n=this.scene)==null||n.remove(),this.scene=void 0;}},{key:"updateScene",value:function updateScene(t){if(!this.scene)throw new Error("SnapshotWork scene is not initialized");this.scene.attr(_objectSpread({},t));var r=t.width,n=t.height;this.scene.width=r,this.scene.height=n,this.updateLayer({width:r,height:n});}},{key:"updateLayer",value:function updateLayer(t){if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");var r=t.width,n=t.height;this.fullLayer.parent.setAttribute("width",r),this.fullLayer.parent.setAttribute("height",n),this.fullLayer.setAttribute("size",[r,n]),this.fullLayer.setAttribute("pos",[r*0.5,n*0.5]);}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var r=t.scale,n=t.centerX,i=t.centerY,l=t.width,o=t.height;if(!this.scene)throw new Error("SnapshotWork scene is not initialized");if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");(l!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:l,height:o}),this.fullLayer.setAttribute("scale",[r,r]),this.fullLayer.setAttribute("translate",[-n,-i]);}},{key:"getOffscreen",value:function getOffscreen(){var r;return((r=this.fullLayer)==null?void 0:r.parent).canvas;}},{key:"getRectImageBitmap",value:function getRectImageBitmap(t,r){var n=t.rect,i=this.thread.dpr,l=Math.floor(n.x*i),o=Math.floor(n.y*i),a=Math.floor(n.w*i),c=Math.floor(n.h*i);return createImageBitmap(this.getOffscreen(),l,o,a,c,r);}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(t){var r,n,i,l,o,a,_i5,_Object$entries,_Object$entries$_i,m,f,v,S,E,c;return _regeneratorRuntime().wrap(function _callee77$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:r=t.scenePath,n=t.scenes,i=t.cameraOpt,l=t.w,o=t.h;if(!(r&&n&&i&&this.fullLayer)){_context81.next=23;break;}this.setCameraOpt(i);_i5=0,_Object$entries=Object.entries(n);case 4:if(!(_i5<_Object$entries.length)){_context81.next=20;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i5],2),m=_Object$entries$_i[0],f=_Object$entries$_i[1];if(!(f!=null&&f.type)){_context81.next=17;break;}_context81.t0=f==null?void 0:f.type;_context81.next=_context81.t0===dt.UpdateNode?10:_context81.t0===dt.FullWork?10:17;break;case 10:v=f.opt;S=_objectSpread(_objectSpread({},f),{},{opt:v,workId:m,msgType:dt.FullWork,dataType:Dt.Service,viewId:this.viewId});_context81.next=14;return this.runFullWork(S);case 14:E=_context81.sent;a=bt(a,E);return _context81.abrupt("break",17);case 17:_i5++;_context81.next=4;break;case 20:l&&o&&(c={resizeWidth:l,resizeHeight:o});_context81.next=23;return this.getSnapshotRender({scenePath:r,options:c});case 23:case"end":return _context81.stop();}},_callee77,this);}));function getSnapshot(_x145){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t){var i,r,n,l,o,a;return _regeneratorRuntime().wrap(function _callee78$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:r=this.setFullWork(t),n=t.ops&&Qe(t.ops);if(!r){_context82.next=18;break;}a=(i=r.getWorkId())==null?void 0:i.toString();if(!(r.toolsType===pt.Image)){_context82.next=9;break;}_context82.next=6;return r.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 6:l=_context82.sent;_context82.next=16;break;case 9:if(!(r.toolsType===pt.Text)){_context82.next=15;break;}_context82.next=12;return r.consumeServiceAsync({isFullWork:!0,replaceId:a,isDrawLabel:!0});case 12:l=_context82.sent;_context82.next=16;break;case 15:l=r.consumeService({op:n,isFullWork:!0,replaceId:a}),o=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context82.abrupt("return",bt(l,o));case 18:case"end":return _context82.stop();}},_callee78,this);}));function runFullWork(_x146){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{key:"getSceneRect",value:function getSceneRect(){if(!this.scene)throw new Error("SnapshotWork scene is not initialized");var _this$scene2=this.scene,t=_this$scene2.width,r=_this$scene2.height;return{x:0,y:0,w:Math.floor(t),h:Math.floor(r)};}},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee79(t){var l,r,n,i;return _regeneratorRuntime().wrap(function _callee79$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:r=t.scenePath,n=t.options;((l=this.fullLayer)==null?void 0:l.parent).render();_context83.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Et.None},n);case 4:i=_context83.sent;i&&(this.thread._post({sp:[{type:dt.Snapshot,scenePath:r,imageBitmap:i,viewId:this.viewId}]},[i]),i.close());case 6:case"end":return _context83.stop();}},_callee79,this);}));function getSnapshotRender(_x147){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t){var r,n,i,l,_i6,_Object$entries2,_Object$entries2$_i,o,a,c;return _regeneratorRuntime().wrap(function _callee80$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:r=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(r&&n&&i&&this.fullLayer)){_context84.next=19;break;}this.setCameraOpt(i);_i6=0,_Object$entries2=Object.entries(n);case 4:if(!(_i6<_Object$entries2.length)){_context84.next=18;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i6],2),o=_Object$entries2$_i[0],a=_Object$entries2$_i[1];if(!(a!=null&&a.type)){_context84.next=15;break;}_context84.t0=a==null?void 0:a.type;_context84.next=_context84.t0===dt.UpdateNode?10:_context84.t0===dt.FullWork?10:15;break;case 10:_context84.next=12;return this.runFullWork(_objectSpread(_objectSpread({},a),{},{workId:o,msgType:dt.FullWork,dataType:Dt.Service,viewId:this.viewId}));case 12:c=_context84.sent;l=bt(l,c);return _context84.abrupt("break",15);case 15:_i6++;_context84.next=4;break;case 18:l&&this.thread._post({sp:[{type:dt.BoundingBox,scenePath:r,rect:l,viewId:this.viewId}]});case 19:case"end":return _context84.stop();}},_callee80,this);}));function getBoundingRect(_x148){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(gn);var wr=/* @__PURE__ */function(u){return u.Full="full",u.Sub="sub",u;}(wr||{});var fy=/*#__PURE__*/function(){function fy(e,t){var _this109=this;_classCallCheck(this,fy);ot(this,"_self");ot(this,"version",Gi);ot(this,"type");// protected hasPriorityDraw: boolean = true;
472
- ot(this,"workThreadMap",/* @__PURE__ */new Map());ot(this,"post",function(e,t){t?_this109._self.postMessage(e,t):_this109._self.postMessage(e);});this._self=e,this.type=t,this.register();}return _createClass(fy,[{key:"init",value:function init(e){var t=e.viewId,r=e.dpr,n=e.offscreenCanvasOpt,i=e.layerOpt,l=e.isSafari,o=e.combineUnitTime,a=e.syncUnitTime,c=e.maxCombineEraserTime,m=e.offscreenCanvas,f=e.isUseSimple;if(!r||!n||!i)return;var v;this.type==="full"&&(f?v=new hy(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:i,combineUnitTime:o,syncUnitTime:a,maxCombineEraserTime:c,offscreenCanvas:m},this.post):v=new Ss(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:i,combineUnitTime:o,syncUnitTime:a,maxCombineEraserTime:c},this.post)),this.type==="sub"&&!f&&(v=new Ps(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:i,isUseSimple:f},this.post)),v&&l&&v.setIsSafari(l),v&&e.cameraOpt&&v.setCameraOpt(e.cameraOpt),v&&this.workThreadMap.set(t,v);}},{key:"setFontFaces",value:function(){var _setFontFaces=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(e){var _this110=this;var t,r,_iterator71,_step71,_loop8;return _regeneratorRuntime().wrap(function _callee81$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:t=[],r=[];_iterator71=_createForOfIteratorHelper(e);_context86.prev=2;_loop8=/*#__PURE__*/_regeneratorRuntime().mark(function _loop8(){var n,i,l,o,a,c,m,f,v;return _regeneratorRuntime().wrap(function _loop8$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:n=_step71.value;i=n.fontFamily,l=n.buffer;_context85.prev=2;if(!(!l||l.byteLength===0)){_context85.next=5;break;}throw new Error("Invalid font data for ".concat(i,": empty buffer"));case 5:try{o=new FontFace(i,l);}catch(_unused24){a=new Uint8Array(l);o=new FontFace(i,a);}_context85.next=8;return _this110._self.fonts.add(o);case 8:_context85.prev=8;_context85.next=11;return o.loaded;case 11:t.push(i);_context85.next=49;break;case 14:_context85.prev=14;_context85.t0=_context85["catch"](8);c=_this110._self.fonts;if(!(c&&typeof c.load=="function")){_context85.next=42;break;}_context85.prev=18;m=c.load(i);f=new Promise(function(S,E){return setTimeout(function(){return E(new Error("Font load timeout for ".concat(i)));},5e3);});_context85.next=23;return Promise.race([m,f]);case 23:v=_context85.sent;if(!(v&&v.length>0)){_context85.next=28;break;}t.push(i);_context85.next=29;break;case 28:throw new Error("Font ".concat(i," load returned empty result"));case 29:_context85.next=40;break;case 31:_context85.prev=31;_context85.t1=_context85["catch"](18);_context85.next=35;return _this110.isFontAvailable(i);case 35:if(!_context85.sent){_context85.next=39;break;}t.push(i);_context85.next=40;break;case 39:throw _context85.t1;case 40:_context85.next=49;break;case 42:_context85.next=44;return _this110.isFontAvailable(i);case 44:if(!_context85.sent){_context85.next=48;break;}t.push(i);_context85.next=49;break;case 48:throw _context85.t0;case 49:_context85.next=54;break;case 51:_context85.prev=51;_context85.t2=_context85["catch"](2);console.error("Font ".concat(i," load error: ").concat(_context85.t2)),r.push(i);case 54:case"end":return _context85.stop();}},_loop8,null,[[2,51],[8,14],[18,31]]);});_iterator71.s();case 5:if((_step71=_iterator71.n()).done){_context86.next=9;break;}return _context86.delegateYield(_loop8(),"t0",7);case 7:_context86.next=5;break;case 9:_context86.next=14;break;case 11:_context86.prev=11;_context86.t1=_context86["catch"](2);_iterator71.e(_context86.t1);case 14:_context86.prev=14;_iterator71.f();return _context86.finish(14);case 17:this.post({sp:[{type:dt.SetFontFace,setFontFaceResult:!0,failedFonts:r.length>0?r:void 0}]});case 18:case"end":return _context86.stop();}},_callee81,this,[[2,11,14,17]]);}));function setFontFaces(_x149){return _setFontFaces.apply(this,arguments);}return setFontFaces;}()// 检查字体是否可用
473
- },{key:"isFontAvailable",value:function(){var _isFontAvailable=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(e){var t,r,n,_iterator72,_step72,_i7,i;return _regeneratorRuntime().wrap(function _callee82$(_context87){while(1)switch(_context87.prev=_context87.next){case 0:_context87.prev=0;t=this._self.fonts;if(t){_context87.next=4;break;}return _context87.abrupt("return",!1);case 4:r=!1,n=null;_iterator72=_createForOfIteratorHelper(t);_context87.prev=6;_iterator72.s();case 8:if((_step72=_iterator72.n()).done){_context87.next=15;break;}_i7=_step72.value;if(!(_i7.family===e)){_context87.next=13;break;}r=!0,n=_i7;return _context87.abrupt("break",15);case 13:_context87.next=8;break;case 15:_context87.next=20;break;case 17:_context87.prev=17;_context87.t0=_context87["catch"](6);_iterator72.e(_context87.t0);case 20:_context87.prev=20;_iterator72.f();return _context87.finish(20);case 23:if(!(!r||!n)){_context87.next=25;break;}return _context87.abrupt("return",!1);case 25:if(!(n.status==="loaded")){_context87.next=27;break;}return _context87.abrupt("return",!0);case 27:_context87.prev=27;_context87.next=30;return n.loaded;case 30:return _context87.abrupt("return",!0);case 33:_context87.prev=33;_context87.t1=_context87["catch"](27);if(!(t&&typeof t.load=="function")){_context87.next=48;break;}_context87.prev=36;_context87.next=39;return t.load(e);case 39:i=_context87.sent;return _context87.abrupt("return",i&&i.length>0);case 43:_context87.prev=43;_context87.t2=_context87["catch"](36);return _context87.abrupt("return",!1);case 46:_context87.next=49;break;case 48:return _context87.abrupt("return",!0);case 49:_context87.next=54;break;case 51:_context87.prev=51;_context87.t3=_context87["catch"](0);return _context87.abrupt("return",!1);case 54:case"end":return _context87.stop();}},_callee82,this,[[0,51],[6,17,20,23],[27,33],[36,43]]);}));function isFontAvailable(_x150){return _isFontAvailable.apply(this,arguments);}return isFontAvailable;}()},{key:"register",value:function register(){var _this111=this;onmessage=/*#__PURE__*/function(){var _ref171=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(e){var t,_iteratorAbruptCompletion,_didIteratorError,_iteratorError,_iterator,_step,r,n,i,l,o,a,_iterator73,_step73,_step73$value,m,f,v,_iterator74,_step74,_m14,c;return _regeneratorRuntime().wrap(function _callee83$(_context88){while(1)switch(_context88.prev=_context88.next){case 0:t=e.data;if(!t){_context88.next=54;break;}_iteratorAbruptCompletion=false;_didIteratorError=false;_context88.prev=4;_iterator=_asyncIterator(t.values());case 6:_context88.next=8;return _iterator.next();case 8:if(!(_iteratorAbruptCompletion=!(_step=_context88.sent).done)){_context88.next=38;break;}r=_step.value;n=r.msgType,i=r.viewId,l=r.tasksqueue,o=r.mainTasksqueueCount,a=r.fontBuffers;if(!a){_context88.next=14;break;}_this111.setFontFaces(a);return _context88.abrupt("continue",35);case 14:if(!(n===dt.Console)){_context88.next=17;break;}console.log(_this111);return _context88.abrupt("continue",35);case 17:if(!(n===dt.Init)){_context88.next=20;break;}_this111.init(r);return _context88.abrupt("continue",35);case 20:if(!(n===dt.TasksQueue&&l!=null&&l.size)){_context88.next=25;break;}_iterator73=_createForOfIteratorHelper(_this111.workThreadMap.entries());try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){_step73$value=_slicedToArray(_step73.value,2),m=_step73$value[0],f=_step73$value[1];v=l.get(m);v&&f.on(v);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}_this111.type==="full"&&he(o)&&_this111.post({workerTasksqueueCount:o});return _context88.abrupt("continue",35);case 25:if(!(i===ao)){_context88.next=29;break;}_iterator74=_createForOfIteratorHelper(_this111.workThreadMap.values());try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){_m14=_step74.value;_m14.on(r),n===dt.Destroy&&_this111.workThreadMap["delete"](i);}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}return _context88.abrupt("continue",35);case 29:c=_this111.workThreadMap.get(i);_context88.t0=c;if(!_context88.t0){_context88.next=35;break;}_context88.next=34;return c.on(r);case 34:n===dt.Destroy&&_this111.workThreadMap["delete"](i);case 35:_iteratorAbruptCompletion=false;_context88.next=6;break;case 38:_context88.next=44;break;case 40:_context88.prev=40;_context88.t1=_context88["catch"](4);_didIteratorError=true;_iteratorError=_context88.t1;case 44:_context88.prev=44;_context88.prev=45;if(!(_iteratorAbruptCompletion&&_iterator["return"]!=null)){_context88.next=49;break;}_context88.next=49;return _iterator["return"]();case 49:_context88.prev=49;if(!_didIteratorError){_context88.next=52;break;}throw _iteratorError;case 52:return _context88.finish(49);case 53:return _context88.finish(44);case 54:case"end":return _context88.stop();}},_callee83,null,[[4,40,44,54],[45,,49,53]]);}));return function onmessage(_x151){return _ref171.apply(this,arguments);};}();}}]);}();var Ps=/*#__PURE__*/function(_hs){function Ps(t,r,n){var _this112;_classCallCheck(this,Ps);_this112=_callSuper(this,Ps,[t,r,"sub"/* Sub */]);ot(_this112,"type","sub");ot(_this112,"_post");ot(_this112,"topLayer");ot(_this112,"serviceWork");ot(_this112,"localWork");ot(_this112,"topLayerWork");ot(_this112,"snapshotWork");_this112._post=n;var i=me.bufferSize.sub;_this112.topLayer=r.isUseSimple?void 0:_this112.createLayer("topLayer",_this112.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:i,contextType:"2d"}));var l={thread:_this112,viewId:_this112.viewId,vNodes:_this112.vNodes,fullLayer:_this112.fullLayer,topLayer:_this112.topLayer,isUseSimple:r.isUseSimple};_this112.localWork=new oy(l),r.isUseSimple||(_this112.topLayerWork=new ay(l)),_this112.snapshotWork=new gs(_objectSpread(_objectSpread({},l),{},{createScene:_this112.createScene.bind(_this112),createLayer:_this112.createLayer.bind(_this112)})),_this112.vNodes.init(_this112.fullLayer);return _this112;}_inherits(Ps,_hs);return _createClass(Ps,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(){var _this113=this;var l,o,_this$combinePostData,t,r,n,a,_iterator75,_step75,c,m,i;return _regeneratorRuntime().wrap(function _callee84$(_context89){while(1)switch(_context89.prev=_context89.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,r=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context89.next=28;break;}a=[];_iterator75=_createForOfIteratorHelper(t);_context89.prev=4;_iterator75.s();case 6:if((_step75=_iterator75.n()).done){_context89.next=19;break;}c=_step75.value;if(!c.rect){_context89.next=17;break;}if(!(c.rect=fs(ue(c.rect),this.scene,this.dpr),!c.rect)){_context89.next=11;break;}return _context89.abrupt("continue",17);case 11:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context89.next=16;break;}_context89.next=14;return this.getRectImageBitmap(c);case 14:m=_context89.sent;c.imageBitmap=m,n||(n=[]),n.push(m);case 16:a.push(c);case 17:_context89.next=6;break;case 19:_context89.next=24;break;case 21:_context89.prev=21;_context89.t0=_context89["catch"](4);_iterator75.e(_context89.t0);case 24:_context89.prev=24;_iterator75.f();return _context89.finish(24);case 27:r.render=a;case 28:i=(l=r.sp)==null?void 0:l.filter(function(a){return a.type!==dt.None||a.isLockSentEventCursor;});i!=null&&i.length?r.sp=i.map(function(a){return _objectSpread(_objectSpread({},a),{},{viewId:_this113.viewId});}):delete r.sp,r.consumeCount===void 0&&delete r.consumeCount,r.subWorkerDrawCount===void 0&&delete r.subWorkerDrawCount,(i!=null&&i.length||r.consumeCount||r.subWorkerDrawCount||(o=r==null?void 0:r.render)!=null&&o.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context89.stop();}},_callee84,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee85(t){var c,m,r,n,i,l,o,a,f;return _regeneratorRuntime().wrap(function _callee85$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:r=t.msgType,n=t.toolsType,i=t.opt,l=t.dataType,o=t.workState,a=t.isLockSentEventCursor;_context90.t0=r;_context90.next=_context90.t0===dt.UpdateTools?4:_context90.t0===dt.CreateWork?9:_context90.t0===dt.DrawWork?11:_context90.t0===dt.RemoveNode?19:_context90.t0===dt.FullWork?22:_context90.t0===dt.Snapshot?27:_context90.t0===dt.BoundingBox?32:37;break;case 4:if(!(n&&(c=this.topLayerWork)!=null&&c.canUseTopLayer(n)&&i)){_context90.next=8;break;}f={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(f);return _context90.abrupt("return");case 8:return _context90.abrupt("break",37);case 9:this.createLocalWork(t);return _context90.abrupt("return");case 11:if(!(o===Ft.Done&&l===Dt.Local)){_context90.next=17;break;}_context90.next=14;return this.consumeDrawAll(l,t);case 14:n===pt.LaserPen&&a&&this.post({sp:[{type:dt.None,isLockSentEventCursor:a}]});_context90.next=18;break;case 17:this.consumeDraw(l,t);case 18:return _context90.abrupt("return");case 19:_context90.next=21;return this.removeNode(t);case 21:return _context90.abrupt("return");case 22:_context90.t1=n&&(m=this.topLayerWork)!=null&&m.canUseTopLayer(n);if(!_context90.t1){_context90.next=26;break;}_context90.next=26;return this.consumeDrawAll(l,t);case 26:return _context90.abrupt("return");case 27:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===hr?6e3:3e3,contextType:"2d"}));_context90.next=30;return this.snapshotWork.getSnapshot(t);case 30:this.snapshotWork.destroySnapshotFullLayer();return _context90.abrupt("return");case 32:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===hr?6e3:3e3,contextType:"2d"}));_context90.next=35;return this.snapshotWork.getBoundingRect(t);case 35:this.snapshotWork.destroySnapshotFullLayer();return _context90.abrupt("return");case 37:_context90.next=39;return _superPropGet(Ps,"on",this,3)([t]);case 39:case"end":return _context90.stop();}},_callee85,this);}));function on(_x152){return _on2.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var l;var r=t.workId,n=t.toolsType,i=t.opt;if(n&&(l=this.topLayerWork)!=null&&l.canUseTopLayer(n)&&r&&i){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(r.toString(),i);return;}n&&_superPropGet(Ps,"createLocalWork",this,3)([t]);}},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(t){var r;return _regeneratorRuntime().wrap(function _callee86$(_context91){while(1)switch(_context91.prev=_context91.next){case 0:r=t.dataType;_context91.t0=r===Dt.Local;if(!_context91.t0){_context91.next=5;break;}_context91.next=5;return this.localWork.removeWork(t);case 5:case"end":return _context91.stop();}},_callee86,this);}));function removeNode(_x153){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"getLayer",value:function getLayer(t){switch(t){case Et.TopFloat:return this.topLayer||this.fullLayer;default:return this.fullLayer;}}},{key:"getOffscreen",value:function getOffscreen(t){var n;return((n=this.getLayer(t))==null?void 0:n.parent).canvas;}},{key:"consumeDraw",value:function(){var _consumeDraw5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee87(t,r){var l,n,i;return _regeneratorRuntime().wrap(function _callee87$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:n=r.workId,i=r.toolsType;if(!n){_context92.next=11;break;}if(!(i&&(l=this.topLayerWork)!=null&&l.canUseTopLayer(i))){_context92.next=5;break;}t===Dt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(r)),this.topLayerWork.consumeDraw(r);return _context92.abrupt("return");case 5:_context92.t0=i;if(!_context92.t0){_context92.next=10;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context92.next=10;return this.localWork.consumeDraw(r);case 10:return _context92.abrupt("return");case 11:case"end":return _context92.stop();}},_callee87,this);}));function consumeDraw(_x154,_x155){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(t,r){var o,n,i,l,a;return _regeneratorRuntime().wrap(function _callee88$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:n=r.workId,i=r.toolsType,l=r.dataType;if(!n){_context93.next=8;break;}a=n.toString();if(!(i&&(o=this.topLayerWork)!=null&&o.canUseTopLayer(i))){_context93.next=6;break;}l===Dt.Local&&(this.topLayerWork.getWorkShape(a)||this.createLocalWork(r)),this.topLayerWork.consumeDrawAll(r);return _context93.abrupt("return");case 6:i&&(this.localWork.getWorkShape(a)||_superPropGet(Ps,"createLocalWork",this,3)([r]),this.localWork.consumeDrawAll(r));return _context93.abrupt("return");case 8:case"end":return _context93.stop();}},_callee88,this);}));function consumeDrawAll(_x156,_x157){return _consumeDrawAll4.apply(this,arguments);}return consumeDrawAll;}()},{key:"clearAll",value:function(){var _clearAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee89(){return _regeneratorRuntime().wrap(function _callee89$(_context94){while(1)switch(_context94.prev=_context94.next){case 0:this.vNodes.clear();_superPropGet(Ps,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Te(this.topLayer,this.topLayer.parent));_context94.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:Et.TopFloat,viewId:this.viewId}],sp:[{type:dt.Clear}]});case 5:case"end":return _context94.stop();}},_callee89,this);}));function clearAll(){return _clearAll2.apply(this,arguments);}return clearAll;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t,r){var n=t.rect,i=t.drawCanvas,l=Math.floor(n.x*this.dpr),o=Math.floor(n.y*this.dpr),a=Math.floor(n.w*this.dpr||1),c=Math.floor(n.h*this.dpr||1);return createImageBitmap(this.getOffscreen(i),l,o,a,c,r);}},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(Ps,"updateLayer",this,3)([t]),this.topLayer&&(this.topLayer.parent.setAttribute("width",r),this.topLayer.parent.setAttribute("height",n),this.topLayer.setAttribute("size",[r,n]),this.topLayer.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"updateDpr",value:function(){var _updateDpr2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee90(t){var r,n,i;return _regeneratorRuntime().wrap(function _callee90$(_context95){while(1)switch(_context95.prev=_context95.next){case 0:_superPropGet(Ps,"updateDpr",this,3)([t]);r=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,n=!!this.localWork.getWorkShapes().size,i=[];n&&i.push({isClearAll:!0,clearCanvas:Et.Float,viewId:this.viewId});r&&i.push({isClearAll:!0,clearCanvas:Et.TopFloat,viewId:this.viewId});_context95.t0=i.length;if(!_context95.t0){_context95.next=8;break;}_context95.next=8;return this.post({render:i});case 8:case"end":return _context95.stop();}},_callee90,this);}));function updateDpr(_x158){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(t){var _this114=this;var i,r,n,l,o,_iterator76,_step76,_loop9;return _regeneratorRuntime().wrap(function _callee91$(_context97){while(1)switch(_context97.prev=_context97.next){case 0:r=[],n=t.cameraOpt;if(!(n&&!Me(this.cameraOpt,n))){_context97.next=25;break;}l=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,o=!!this.localWork.getWorkShapes().size;if(!(o&&this.localWork.workShapesDone(),this.setCameraOpt(n),o&&r.push({isClearAll:!0,clearCanvas:Et.Float,viewId:this.viewId}),l&&this.topLayerWork)){_context97.next=21;break;}r.push({isClearAll:!0,clearCanvas:Et.TopFloat,viewId:this.viewId});_iterator76=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries()||[]);_context97.prev=6;_loop9=/*#__PURE__*/_regeneratorRuntime().mark(function _loop9(){var _step76$value,a,c,m;return _regeneratorRuntime().wrap(function _loop9$(_context96){while(1)switch(_context96.prev=_context96.next){case 0:_step76$value=_slicedToArray(_step76.value,2),a=_step76$value[0],c=_step76$value[1];if(c.totalRect){(i=_this114.topLayer)==null||i.getElementsByName(a.toString()).forEach(function(f){var v=f.getBoundingClientRect(),S=kt({x:v.x,y:v.y,w:v.width,h:v.height});m=bt(m,S);}),c.totalRect=m,_this114.topLayerWork.localWorkShapes.set(a,c);}case 2:case"end":return _context96.stop();}},_loop9);});_iterator76.s();case 9:if((_step76=_iterator76.n()).done){_context97.next=13;break;}return _context97.delegateYield(_loop9(),"t0",11);case 11:_context97.next=9;break;case 13:_context97.next=18;break;case 15:_context97.prev=15;_context97.t1=_context97["catch"](6);_iterator76.e(_context97.t1);case 18:_context97.prev=18;_iterator76.f();return _context97.finish(18);case 21:_context97.t2=r.length;if(!_context97.t2){_context97.next=25;break;}_context97.next=25;return this.post({render:r});case 25:case"end":return _context97.stop();}},_callee91,this,[[6,15,18,21]]);}));function updateCamera(_x159){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,r){var c,m;this.cameraOpt=t;var n=t.scale,i=t.centerX,l=t.centerY,o=t.width,a=t.height;(o!==this.scene.width||a!==this.scene.height)&&this.updateScene(this.scene,{width:o,height:a}),r?(r.setAttribute("scale",[n,n]),r.setAttribute("translate",[-i,-l])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-l]),(c=this.topLayer)==null||c.setAttribute("scale",[n,n]),(m=this.topLayer)==null||m.setAttribute("translate",[-i,-l]));}}]);}(hs);var Ss=/*#__PURE__*/function(_hs2){function Ss(t,r,n){var _this115;_classCallCheck(this,Ss);_this115=_callSuper(this,Ss,[t,r,"full"/* Full */]);ot(_this115,"serviceDrawLayer");ot(_this115,"localDrawLayer");ot(_this115,"snapshotFullLayer");ot(_this115,"methodBuilder");ot(_this115,"localWork");ot(_this115,"serviceWork");ot(_this115,"_post");ot(_this115,"debounceUpdateCache",/* @__PURE__ */new Set());_this115._post=n;var i=me.bufferSize.sub;_this115.serviceDrawLayer=_this115.createLayer("serviceDrawLayer",_this115.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:i,contextType:"2d"})),_this115.localDrawLayer=_this115.createLayer("localDrawLayer",_this115.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:i,contextType:"2d"}));var l={thread:_this115,viewId:_this115.viewId,vNodes:_this115.vNodes,fullLayer:_this115.fullLayer};_this115.localWork=new vs(_objectSpread(_objectSpread({},l),{},{drawLayer:_this115.localDrawLayer})),r.combineUnitTime&&_this115.localWork.setCombineUnitTime(r.combineUnitTime),r.maxCombineEraserTime&&_this115.localWork.setmaxCombineEraserTime(r.maxCombineEraserTime),r.syncUnitTime&&_this115.localWork.setSyncUnitTime(r.syncUnitTime),_this115.serviceWork=new ys(_objectSpread(_objectSpread({},l),{},{drawLayer:_this115.serviceDrawLayer})),_this115.methodBuilder=new mi([$t.CopyNode,$t.SetColorNode,$t.DeleteNode,$t.RotateNode,$t.ScaleNode,$t.TranslateNode,$t.ZIndexNode,$t.SetFontStyle,$t.SetPoint,$t.SetLock,$t.SetShapeOpt]).registerForWorker(_this115),_this115.vNodes.init(_this115.fullLayer);return _this115;}_inherits(Ss,_hs2);return _createClass(Ss,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92(){var _this116=this;var l,o,_this$combinePostData2,t,r,n,a,_iterator77,_step77,c,m,i;return _regeneratorRuntime().wrap(function _callee92$(_context98){while(1)switch(_context98.prev=_context98.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,r=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context98.next=28;break;}a=[];_iterator77=_createForOfIteratorHelper(t);_context98.prev=4;_iterator77.s();case 6:if((_step77=_iterator77.n()).done){_context98.next=19;break;}c=_step77.value;if(!c.rect){_context98.next=17;break;}if(!(c.rect=fs(ue(c.rect),this.scene,this.dpr),!c.rect)){_context98.next=11;break;}return _context98.abrupt("continue",17);case 11:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context98.next=16;break;}_context98.next=14;return this.getRectImageBitmap(c);case 14:m=_context98.sent;c.imageBitmap=m,n||(n=[]),n.push(m);case 16:a.push(c);case 17:_context98.next=6;break;case 19:_context98.next=24;break;case 21:_context98.prev=21;_context98.t0=_context98["catch"](4);_iterator77.e(_context98.t0);case 24:_context98.prev=24;_iterator77.f();return _context98.finish(24);case 27:r.render=a;case 28:i=(l=r.sp)==null?void 0:l.filter(function(a){return a.type!==dt.None||a.isLockSentEventCursor;});i!=null&&i.length?r.sp=i.map(function(a){return _objectSpread(_objectSpread({},a),{},{viewId:_this116.viewId});}):delete r.sp,r.fullWorkerDrawCount===void 0&&delete r.fullWorkerDrawCount,r.consumeCount===void 0&&delete r.consumeCount,(r!=null&&r.fullWorkerDrawCount||r.consumeCount||i!=null&&i.length||(o=r.render)!=null&&o.length)&&this._post(r,n),this.delayPostDoneResolve&&this.delayPostDoneResolve(!0);case 30:case"end":return _context98.stop();}},_callee92,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee93(t){var _this117=this;var r,n,i,l,o,a,c,m,_c8;return _regeneratorRuntime().wrap(function _callee93$(_context99){while(1)switch(_context99.prev=_context99.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context99.next=2;break;}return _context99.abrupt("return");case 2:r=t.msgType,n=t.dataType,i=t.workId,l=t.toolsType,o=t.workState,a=t.workIds;_context99.t0=r;_context99.next=_context99.t0===dt.AuthClear?6:_context99.t0===dt.CreateWork?9:_context99.t0===dt.DrawWork?11:_context99.t0===dt.Select?20:_context99.t0===dt.UpdateNode?27:_context99.t0===dt.FullWork?27:_context99.t0===dt.RemoveNode?29:_context99.t0===dt.GetTextActive?32:_context99.t0===dt.CursorHover?35:_context99.t0===dt.CursorBlur?38:_context99.t0===dt.GetVNodeInfo?41:43;break;case 6:c=t.clearUids,m=t.localUid;this.vNodes.setCanClearUids(c),this.vNodes.setLocalUid(m);return _context99.abrupt("break",43);case 9:l!==pt.LaserPen&&this.createLocalWork(t);return _context99.abrupt("break",43);case 11:_context99.t1=l!==pt.LaserPen;if(!_context99.t1){_context99.next=19;break;}if(!(o===Ft.Done&&n===Dt.Local)){_context99.next=18;break;}_context99.next=16;return this.consumeDrawAll(n,t);case 16:_context99.next=19;break;case 18:this.consumeDraw(n,t);case 19:return _context99.abrupt("break",43);case 20:if(!(i===qt)){_context99.next=25;break;}_context99.next=23;return this.localWork.updateFullSelectWork(t);case 23:_context99.next=26;break;case 25:this.serviceWork.runSelectWork(t);case 26:return _context99.abrupt("return");case 27:this.consumeFull(n,t);return _context99.abrupt("return");case 29:_context99.next=31;return this.removeNode(t);case 31:return _context99.abrupt("return");case 32:_context99.next=34;return this.checkTextActive(t);case 34:return _context99.abrupt("return");case 35:_context99.next=37;return this.cursorHover(t);case 37:return _context99.abrupt("return");case 38:_context99.next=40;return this.cursorBlur();case 40:return _context99.abrupt("return");case 41:if(i&&a){_c8=a.map(function(m){return _this117.vNodes.get(m);});this.post({sp:[{type:dt.GetVNodeInfo,dataType:Dt.Worker,workId:i,vInfo:_c8}]});}return _context99.abrupt("break",43);case 43:_context99.next=45;return _superPropGet(Ss,"on",this,3)([t]);case 45:case"end":return _context99.stop();}},_callee93,this);}));function on(_x160){return _on3.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee94(t){var _this118=this;var r,n,i,l,o,_iterator78,_step78,_loop10;return _regeneratorRuntime().wrap(function _callee94$(_context101){while(1)switch(_context101.prev=_context101.next){case 0:r=t.dataType,n=t.workId,i=t.removeIds,l=[],o=i||[];if(!(n&&o.push(n.toString()),o.length)){_context101.next=20;break;}_iterator78=_createForOfIteratorHelper(o);_context101.prev=3;_loop10=/*#__PURE__*/_regeneratorRuntime().mark(function _loop10(){var a;return _regeneratorRuntime().wrap(function _loop10$(_context100){while(1)switch(_context100.prev=_context100.next){case 0:a=_step78.value;a===qt?l.push(_this118.localWork.removeSelector(t,_this118)):r===Dt.Local?l.push(_this118.localWork.removeWork(t).then(function(){_this118.localWork.colloctEffectSelectWork(t),_this118.deleteCachedImagesByWorkId(a);})):r===Dt.Service&&l.push(_this118.serviceWork.removeWork(t).then(function(){_this118.localWork.colloctEffectSelectWork(t),_this118.deleteCachedImagesByWorkId(a);}));case 2:case"end":return _context100.stop();}},_loop10);});_iterator78.s();case 6:if((_step78=_iterator78.n()).done){_context101.next=10;break;}return _context101.delegateYield(_loop10(),"t0",8);case 8:_context101.next=6;break;case 10:_context101.next=15;break;case 12:_context101.prev=12;_context101.t1=_context101["catch"](3);_iterator78.e(_context101.t1);case 15:_context101.prev=15;_iterator78.f();return _context101.finish(15);case 18:_context101.next=20;return Promise.all(l);case 20:case"end":return _context101.stop();}},_callee94,null,[[3,12,15,18]]);}));function removeNode(_x161){return _removeNode3.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function(){var _checkTextActive2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee95(t){var r;return _regeneratorRuntime().wrap(function _callee95$(_context102){while(1)switch(_context102.prev=_context102.next){case 0:r=t.dataType;_context102.t0=r===Dt.Local;if(!_context102.t0){_context102.next=5;break;}_context102.next=5;return this.localWork.checkTextActive(t);case 5:case"end":return _context102.stop();}},_callee95,this);}));function checkTextActive(_x162){return _checkTextActive2.apply(this,arguments);}return checkTextActive;}()},{key:"clearAll",value:function(){var _clearAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee96(){return _regeneratorRuntime().wrap(function _callee96$(_context103){while(1)switch(_context103.prev=_context103.next){case 0:this.vNodes.clear();_superPropGet(Ss,"clearAll",this,3)([]);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Te(this.localDrawLayer,this.localDrawLayer.parent));this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Te(this.serviceDrawLayer,this.serviceDrawLayer.parent));_context103.next=6;return this.post({render:[{isClearAll:!0,clearCanvas:Et.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Et.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Et.Float,viewId:this.viewId}],sp:[{type:dt.Clear}]});case 6:case"end":return _context103.stop();}},_callee96,this);}));function clearAll(){return _clearAll3.apply(this,arguments);}return clearAll;}()},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(Ss,"updateLayer",this,3)([t]),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",r),this.localDrawLayer.parent.setAttribute("height",n),this.localDrawLayer.setAttribute("size",[r,n]),this.localDrawLayer.setAttribute("pos",[r*0.5,n*0.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",r),this.serviceDrawLayer.parent.setAttribute("height",n),this.serviceDrawLayer.setAttribute("size",[r,n]),this.serviceDrawLayer.setAttribute("pos",[r*0.5,n*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var r=t.scale,n=t.centerX,i=t.centerY,l=t.width,o=t.height;(l!==this.scene.width||o!==this.scene.height)&&this.updateScene(this.scene,{width:l,height:o}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[r,r]),this.fullLayer.setAttribute("translate",[-n,-i])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[r,r]),this.localDrawLayer.setAttribute("translate",[-n,-i])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[r,r]),this.serviceDrawLayer.setAttribute("translate",[-n,-i]));}},{key:"getLayer",value:function getLayer(t){switch(t){case Et.Bg:return this.fullLayer;case Et.ServiceFloat:return this.serviceDrawLayer;case Et.Float:return this.localDrawLayer;}}},{key:"getOffscreen",value:function getOffscreen(t){return this.getLayer(t).parent.canvas;}},{key:"consumeFull",value:function(){var _consumeFull2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee97(t,r){var n;return _regeneratorRuntime().wrap(function _callee97$(_context104){while(1)switch(_context104.prev=_context104.next){case 0:_context104.next=2;return this.localWork.colloctEffectSelectWork(r);case 2:n=_context104.sent;_context104.t0=n&&t===Dt.Local;if(!_context104.t0){_context104.next=7;break;}_context104.next=7;return this.localWork.consumeFull(n);case 7:n&&t===Dt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context104.stop();}},_callee97,this);}));function consumeFull(_x163,_x164){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function(){var _consumeDraw6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee98(t,r){var n;return _regeneratorRuntime().wrap(function _callee98$(_context105){while(1)switch(_context105.prev=_context105.next){case 0:n=r.workId;_context105.t0=t===Dt.Local&&n;if(!_context105.t0){_context105.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context105.next=6;return this.localWork.consumeDraw(r,this.serviceWork);case 6:t===Dt.Service&&this.serviceWork.consumeDraw(r);case 7:case"end":return _context105.stop();}},_callee98,this);}));function consumeDraw(_x165,_x166){return _consumeDraw6.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee99(t,r){var n;return _regeneratorRuntime().wrap(function _callee99$(_context106){while(1)switch(_context106.prev=_context106.next){case 0:n=r.workId;_context106.t0=t===Dt.Local&&n;if(!_context106.t0){_context106.next=6;break;}this.localWork.getWorkShape(n.toString())||this.createLocalWork(r);_context106.next=6;return this.localWork.consumeDrawAll(r,this.serviceWork);case 6:case"end":return _context106.stop();}},_callee99,this);}));function consumeDrawAll(_x167,_x168){return _consumeDrawAll5.apply(this,arguments);}return consumeDrawAll;}()},{key:"updateDpr",value:function(){var _updateDpr3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee100(t){return _regeneratorRuntime().wrap(function _callee100$(_context107){while(1)switch(_context107.prev=_context107.next){case 0:_superPropGet(Ss,"updateDpr",this,3)([t]);_context107.next=3;return this.post({render:[{isClearAll:!0,clearCanvas:Et.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Et.Bg,viewId:this.viewId}]});case 3:case"end":return _context107.stop();}},_callee100,this);}));function updateDpr(_x169){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee101(t){var _this119=this;var l,o,a,c,m,r,n,i,f,P,_iterator79,_step79,_step79$value,_x171,_h47,v,_iterator80,_step80,_step80$value,_P27,_x176,_h50,_iterator81,_step81,_step81$value,_P28,_x177,_h51,S,E,_P23,_iterator82,_step82,_x172,T,_iterator83,_step83,_P24,_x173,_iterator84,_step84,_h48,_iterator85,_step85,_step85$value,_P26,_step85$value$,_x175,_h49,p,d,g,O,w,L,B,A,b,W,_iterator86,_step86,_step86$value,_P25,_x174;return _regeneratorRuntime().wrap(function _callee101$(_context108){while(1)switch(_context108.prev=_context108.next){case 0:r=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!Me(this.cameraOpt,n))){_context108.next=42;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);f=!!this.serviceDrawLayer.children.length;if(!i){_context108.next=30;break;}P=!1;_iterator79=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context108.prev=7;_iterator79.s();case 9:if((_step79=_iterator79.n()).done){_context108.next=19;break;}_step79$value=_slicedToArray(_step79.value,2),_x171=_step79$value[0],_h47=_step79$value[1];_context108.t0=_h47.toolsType;_context108.next=_context108.t0===pt.Text?14:_context108.t0===pt.PencilEraser?14:_context108.t0===pt.Eraser?14:_context108.t0===pt.Selector?14:_context108.t0===pt.LaserPen?14:15;break;case 14:return _context108.abrupt("break",17);case 15:_x171!==He&&_x171!==qt&&(P=!0);return _context108.abrupt("break",17);case 17:_context108.next=9;break;case 19:_context108.next=24;break;case 21:_context108.prev=21;_context108.t1=_context108["catch"](7);_iterator79.e(_context108.t1);case 24:_context108.prev=24;_iterator79.f();return _context108.finish(24);case 27:if(!P){_context108.next=30;break;}this.taskUpdateCameraId=setTimeout(function(){_this119.taskUpdateCameraId=void 0,_this119.updateCamera(t);},oi);return _context108.abrupt("return");case 30:v=/* @__PURE__ */new Map();_iterator80=_createForOfIteratorHelper(this.vNodes.getNodesByType(pt.Text).entries());try{for(_iterator80.s();!(_step80=_iterator80.n()).done;){_step80$value=_slicedToArray(_step80.value,2),_P27=_step80$value[0],_x176=_step80$value[1];_h50=_x176.rect;v.set(_P27,{rect:ue(_h50),scale:(l=this.cameraOpt)==null?void 0:l.scale});}}catch(err){_iterator80.e(err);}finally{_iterator80.f();}_iterator81=_createForOfIteratorHelper(this.vNodes.gethasEraserNodes().entries());try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){_step81$value=_slicedToArray(_step81.value,2),_P28=_step81$value[0],_x177=_step81$value[1];_h51=_x177.rect;v.set(_P28,{rect:ue(_h51),scale:(o=this.cameraOpt)==null?void 0:o.scale});}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}S=new Set(v.keys());E=!1;if(this.localWork.hasSelector()){_P23=(a=this.localWork.getSelector())==null?void 0:a.selectIds;if(_P23){E=!0;_iterator82=_createForOfIteratorHelper(_P23);try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){_x172=_step82.value;S.add(_x172);}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}}}T=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator83=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){_P24=_step83.value;_x173=_P24.selectIds;if(_x173){T=!0;_iterator84=_createForOfIteratorHelper(_x173);try{for(_iterator84.s();!(_step84=_iterator84.n()).done;){_h48=_step84.value;S.add(_h48);}}catch(err){_iterator84.e(err);}finally{_iterator84.f();}}}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(S),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator85=_createForOfIteratorHelper(v.entries());try{for(_iterator85.s();!(_step85=_iterator85.n()).done;){_step85$value=_slicedToArray(_step85.value,2),_P26=_step85$value[0],_step85$value$=_step85$value[1],_x175=_step85$value$.rect,_h49=_step85$value$.scale;p=this.vNodes.get(_P26);if(p){d=_x175,g=p.rect,O=this.getSceneRect(),w=or(d,O),L=or(g,O),B=p.toolsType,A=p.opt;b=!1;(w!==L||d.w!==g.w||d.h!==g.h||L===Pe.intersect)&&(b=!0),B===pt.Text&&A.workState===Ft.Done&&b&&this.debounceUpdateCache.add(_P26);W=!1;_h49&&(c=this.cameraOpt)!=null&&c.scale&&_h49>this.cameraOpt.scale?L!==Pe.outside&&w!==Pe.inside&&(W=!0):_h49&&(m=this.cameraOpt)!=null&&m.scale&&_h49===this.cameraOpt.scale&&(d.x!==g.x||d.y!==g.y)&&(L===Pe.inside&&w!==Pe.inside||L===Pe.intersect&&w===Pe.intersect)&&(W=!0),A.eraserlines&&A.eraserlines.length&&W&&!this.debounceUpdateCache.has(_P26)&&this.debounceUpdateCache.add(_P26);}}}catch(err){_iterator85.e(err);}finally{_iterator85.f();}if(E&&this.localWork.reRenderSelector(),T){_iterator86=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){_step86$value=_slicedToArray(_step86.value,2),_P25=_step86$value[0],_x174=_step86$value[1];this.serviceWork.runSelectWork({workId:_P25,selectIds:_x174.selectIds,msgType:dt.Select,dataType:Dt.Service,viewId:this.viewId});}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}}this.debounceUpdateCameraId=setTimeout(function(){var x;_this119.debounceUpdateCameraId=void 0;var P=[];var _iterator87=_createForOfIteratorHelper(_this119.debounceUpdateCache.values()),_step87;try{var _loop11=function _loop11(){var h=_step87.value;var p=_this119.vNodes.get(h);if(p){var d=p.toolsType,g=p.opt,O=p.rect,w=p.op,L=_this119.localWork.setFullWork({toolsType:d,opt:g,workId:h});if(L){var B=_this119.getSceneRect(),A=or(O,B);d===pt.Text?(x=_this119.fullLayer)!=null&&x.getElementsByName(h)[0]&&L instanceof cr&&P.push(L.consumeServiceAsync({isFullWork:!0,replaceId:h,isDrawLabel:A!==Pe.outside})):g.eraserlines&&g.eraserlines.length&&P.push(new Promise(function(b){var W=L.consumeService({op:w,isFullWork:!0,replaceId:h,workState:Ft.Done});_this119.localWork.clearWorkShapeNodeCache(h),b(W);}));}}_this119.debounceUpdateCache["delete"](h);};for(_iterator87.s();!(_step87=_iterator87.n()).done;){_loop11();}}catch(err){_iterator87.e(err);}finally{_iterator87.f();}P.length?Promise.all(P).then(function(){var h=[];h.push({isClearAll:!0,clearCanvas:Et.Bg,viewId:_this119.viewId},{isDrawAll:!0,drawCanvas:Et.Bg,viewId:_this119.viewId}),h.length&&_this119.post({render:h}),_this119.vNodes.updateLowLevelNodesRect(),_this119.vNodes.clearHighLevelIds();}):(_this119.vNodes.updateLowLevelNodesRect(),_this119.vNodes.clearHighLevelIds());},oi*10);}f&&r.push({isClearAll:!0,clearCanvas:Et.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&r.push({isClearAll:!0,clearCanvas:Et.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Et.Bg,viewId:this.viewId}),r.length&&this.post({render:r});case 42:case"end":return _context108.stop();}},_callee101,this,[[7,21,24,27]]);}));function updateCamera(_x170){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var r=t.rect,n=t.drawCanvas,i=Math.floor(r.x*this.dpr),l=Math.floor(r.y*this.dpr),o=Math.floor(r.w*this.dpr||1),a=Math.floor(r.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),i,l,o,a,{resizeQuality:"low"});}},{key:"cursorHover",value:function(){var _cursorHover2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee102(t){return _regeneratorRuntime().wrap(function _callee102$(_context109){while(1)switch(_context109.prev=_context109.next){case 0:_context109.next=2;return this.localWork.cursorHover(t);case 2:case"end":return _context109.stop();}},_callee102,this);}));function cursorHover(_x178){return _cursorHover2.apply(this,arguments);}return cursorHover;}()},{key:"cursorBlur",value:function(){var _cursorBlur2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee103(){return _regeneratorRuntime().wrap(function _callee103$(_context110){while(1)switch(_context110.prev=_context110.next){case 0:_context110.next=2;return this.localWork.cursorBlur();case 2:case"end":return _context110.stop();}},_callee103,this);}));function cursorBlur(){return _cursorBlur2.apply(this,arguments);}return cursorBlur;}()},{key:"destroy",value:function destroy(){_superPropGet(Ss,"destroy",this,3)([]);}}]);}(hs);var hy=/*#__PURE__*/function(_Ss){function hy(t,r,n){var _this120;_classCallCheck(this,hy);var l,o,a,c;_this120=_callSuper(this,hy,[t,r,n]);ot(_this120,"snapshotWork");ot(_this120,"localDrawScene");ot(_this120,"serviceDrawScene");ot(_this120,"offscreenCanvas");ot(_this120,"localWork");ot(_this120,"serviceWork");if(_this120._post=n,r.offscreenCanvas){_this120.offscreenCanvas=r.offscreenCanvas,_this120.localDrawScene=_this120.createScene(r,(l=_this120.offscreenCanvas)==null?void 0:l.localCanvas),_this120.serviceDrawScene=_this120.createScene(r,(o=_this120.offscreenCanvas)==null?void 0:o.serviceCanvas);var m=me.bufferSize.sub;_this120.serviceDrawLayer=_this120.createLayer("serviceDrawLayer",_this120.serviceDrawScene||_this120.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:m,contextType:"2d"}),(a=_this120.offscreenCanvas)==null?void 0:a.serviceCanvas),_this120.localDrawLayer=_this120.createLayer("localDrawLayer",_this120.localDrawScene||_this120.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:m,contextType:"2d"}),(c=_this120.offscreenCanvas)==null?void 0:c.localCanvas);}var i={thread:_this120,viewId:_this120.viewId,vNodes:_this120.vNodes,fullLayer:_this120.fullLayer};_this120.localWork=new ly(_objectSpread(_objectSpread({},i),{},{drawLayer:_this120.localDrawLayer})),r.combineUnitTime&&_this120.localWork.setCombineUnitTime(r.combineUnitTime),r.maxCombineEraserTime&&_this120.localWork.setmaxCombineEraserTime(r.maxCombineEraserTime),r.syncUnitTime&&_this120.localWork.setSyncUnitTime(r.syncUnitTime),_this120.serviceWork=new cy(_objectSpread(_objectSpread({},i),{},{drawLayer:_this120.serviceDrawLayer})),_this120.snapshotWork=new gs(_objectSpread(_objectSpread({},i),{},{createScene:_this120.createScene.bind(_this120),createLayer:_this120.createLayer.bind(_this120)})),_this120.methodBuilder=new mi([$t.CopyNode,$t.SetColorNode,$t.DeleteNode,$t.RotateNode,$t.ScaleNode,$t.TranslateNode,$t.ZIndexNode,$t.SetFontStyle,$t.SetPoint,$t.SetLock,$t.SetShapeOpt]).registerForWorker(_this120);return _this120;}_inherits(hy,_Ss);return _createClass(hy,[{key:"createRenderLayer",value:function createRenderLayer(t,r,n){var o;var i=me.bufferSize.full,l=me.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",t,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:this.viewId===hr?i:l*2}),n||((o=r.offscreenCanvas)==null?void 0:o.bgCanvas));}},{key:"createScene",value:function createScene(t,r){var n=t.offscreenCanvas,i=t.offscreenCanvasOpt,l=i.width,o=i.height,a=r||(n==null?void 0:n.bgCanvas)||new OffscreenCanvas(l,o);i.contextType&&delete i.contextType;var c=new di(_objectSpread(_objectSpread({container:a,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},i),{},{contextType:this.contextType,id:this.viewId}));return c.setAttribute("id",this.viewId),c;}},{key:"combinePostData",value:function combinePostData(){var l,o;this.workerTaskId=void 0;var t=[],r=[];var n;var i=/* @__PURE__ */new Set();var _iterator88=_createForOfIteratorHelper(this.combinePostMsg.values()),_step88;try{for(_iterator88.s();!(_step88=_iterator88.n()).done;){var a=_step88.value;if((l=a.render)!=null&&l.length)if(this.offscreenCanvas){var _iterator89=_createForOfIteratorHelper(a.render),_step89;try{for(_iterator89.s();!(_step89=_iterator89.n()).done;){var c=_step89.value;c.workId&&i.add(c.workId);var m=c.drawCanvas||c.clearCanvas;if(m){var f=this.getLayer(m);if(!f||!(f.parent instanceof $r))continue;f.parent.render();}}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}}else{var _iterator90=_createForOfIteratorHelper(a.render),_step90;try{for(_iterator90.s();!(_step90=_iterator90.n()).done;){var _c9=_step90.value;var _m15=!1;if(_c9.workId&&i.add(_c9.workId),_c9.isClearAll&&(_c9.rect=this.getSceneRect(),_c9.isClear=!0,delete _c9.isClearAll),_c9.drawCanvas){var _f9=this.getLayer(_c9.drawCanvas);if(!_f9||!(_f9.parent instanceof $r))continue;if(_f9.parent.render(),_c9.isDrawAll){var v=this.getSceneRect();_c9.rect=v,delete _c9.isDrawAll;}}var _iterator91=_createForOfIteratorHelper(t),_step91;try{for(_iterator91.s();!(_step91=_iterator91.n()).done;){var _f10=_step91.value;if(_c9.viewId===_f10.viewId){_c9.isClear&&_f10.clearCanvas&&_f10.isClear&&_f10.clearCanvas===_c9.clearCanvas&&(_f10.rect=bt(_f10.rect,_c9.rect),_m15=!0),_f10.drawCanvas&&_f10.drawCanvas===_c9.drawCanvas&&(_f10.rect=bt(_f10.rect,_c9.rect),_m15=!0);continue;}}}catch(err){_iterator91.e(err);}finally{_iterator91.f();}_m15||(_c9.isClear&&!_c9.drawCanvas?t.unshift(_c9):t.push(_c9));}}catch(err){_iterator90.e(err);}finally{_iterator90.f();}}if((o=a.sp)!=null&&o.length){var _iterator92=_createForOfIteratorHelper(a.sp),_step92;try{for(_iterator92.s();!(_step92=_iterator92.n()).done;){var _c10=_step92.value;var _m16=!1;var _iterator93=_createForOfIteratorHelper(r),_step93;try{for(_iterator93.s();!(_step93=_iterator93.n()).done;){var _f11=_step93.value;if(Me(_c10,_f11)){_m16=!0;break;}}}catch(err){_iterator93.e(err);}finally{_iterator93.f();}_m16||r.push(_c10);}}catch(err){_iterator92.e(err);}finally{_iterator92.f();}}he(a.consumeCount)&&(n=a.consumeCount);}}catch(err){_iterator88.e(err);}finally{_iterator88.f();}return this.combinePostMsg.clear(),{render:t,sp:r,consumeCount:n,workIds:i,viewId:this.viewId};}},{key:"on",value:function(){var _on4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee104(t){var r;return _regeneratorRuntime().wrap(function _callee104$(_context111){while(1)switch(_context111.prev=_context111.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context111.next=2;break;}return _context111.abrupt("return");case 2:r=t.msgType;_context111.t0=r;_context111.next=_context111.t0===dt.Snapshot?6:_context111.t0===dt.BoundingBox?11:16;break;case 6:this.snapshotWork.createSnapshotFullLayer(this.opt,this.opt.layerOpt);_context111.next=9;return this.snapshotWork.getSnapshot(t);case 9:this.snapshotWork.destroySnapshotFullLayer();return _context111.abrupt("return");case 11:this.snapshotWork.createSnapshotFullLayer(this.opt,this.opt.layerOpt);_context111.next=14;return this.snapshotWork.getBoundingRect(t);case 14:this.snapshotWork.destroySnapshotFullLayer();return _context111.abrupt("return");case 16:_context111.next=18;return _superPropGet(hy,"on",this,3)([t]);case 18:case"end":return _context111.stop();}},_callee104,this);}));function on(_x179){return _on4.apply(this,arguments);}return on;}()},{key:"setCameraOpt",value:function setCameraOpt(t){if(this.localDrawScene&&this.serviceDrawScene){var r=t.width,n=t.height;(r!==this.localDrawScene.width||n!==this.localDrawScene.height)&&this.updateScene(this.localDrawScene,{width:r,height:n},this.localDrawLayer),(r!==this.serviceDrawScene.width||n!==this.serviceDrawScene.height)&&this.updateScene(this.serviceDrawScene,{width:r,height:n},this.serviceDrawLayer);}_superPropGet(hy,"setCameraOpt",this,3)([t]);}},{key:"updateDpr",value:function(){var _updateDpr4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee105(t){return _regeneratorRuntime().wrap(function _callee105$(_context112){while(1)switch(_context112.prev=_context112.next){case 0:this.localDrawScene&&this.serviceDrawScene&&(this.localDrawScene.displayRatio=t,this.serviceDrawScene.displayRatio=t),_superPropGet(hy,"updateDpr",this,3)([t]);case 1:case"end":return _context112.stop();}},_callee105,this);}));function updateDpr(_x180){return _updateDpr4.apply(this,arguments);}return updateDpr;}()}]);}(Ss);var ui=self;ui.full=new fy(ui,wr.Full);