@netless/appliance-plugin 1.1.29 → 1.1.30-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-CWzLC1.js +486 -0
- package/cdn/subWorker-Bb5WAj.js +486 -0
- package/dist/ObserverMap-BudneEfB.mjs +58 -0
- package/dist/ObserverMap-DTz9zucn.js +1 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +19 -18
- package/dist/collector/collector.d.ts +6 -0
- package/dist/component/svg/base.d.ts +30 -0
- package/dist/component/svg/manager.d.ts +44 -0
- package/dist/component/svg/markmap.d.ts +41 -0
- package/dist/component/svg/mermaid-check.d.ts +18 -0
- package/dist/component/svg/mermaid-loader.d.ts +29 -0
- package/dist/component/svg/mermaid.d.ts +109 -0
- package/dist/component/svg/snapshot.d.ts +31 -0
- package/dist/component/svg/svgElemt.d.ts +43 -0
- package/dist/component/svg/svgToImageLoader.d.ts +25 -0
- package/dist/component/svg/types.d.ts +10 -0
- package/dist/component/svg/utils.d.ts +9 -0
- package/dist/component/svg/vNodeManager.d.ts +28 -0
- package/dist/core/backGroundThread/index.d.ts +35 -0
- package/dist/core/backGroundThread/types.d.ts +12 -0
- package/dist/core/enum.d.ts +12 -2
- package/dist/core/mainEngine.d.ts +11 -3
- package/dist/core/mainThread/snapshotThread.d.ts +2 -1
- package/dist/core/mainThread/subLocalThread.d.ts +1 -2
- package/dist/core/mainThread/subTopThread.d.ts +2 -2
- package/dist/core/msgEvent/baseForBackgroundThread.d.ts +9 -0
- package/dist/core/msgEvent/copyNode/forBackgroundThread.d.ts +8 -0
- package/dist/core/msgEvent/forBackgroundThread.d.ts +12 -0
- package/dist/core/msgEvent/setZIndex/forMain.d.ts +7 -0
- package/dist/core/tools/base.d.ts +5 -1
- package/dist/core/tools/shadowSvg.d.ts +36 -0
- package/dist/core/tools/svg.d.ts +0 -0
- package/dist/core/tools/utils.d.ts +9 -8
- package/dist/core/types.d.ts +36 -1
- package/dist/core/utils/ObserverMap.d.ts +19 -0
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/core/vNodeManager.d.ts +6 -5
- package/dist/core/worker/base.d.ts +1 -1
- package/dist/core/worker/fullWorkerLocal.d.ts +1 -7
- package/dist/core/worker/simpleWorker.d.ts +2 -1
- package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
- package/dist/fullWorker.js +127 -158
- package/dist/index-CaGxVP6U.mjs +1256 -0
- package/dist/{index-R6pW4VdG.mjs → index-Cp4iDsa1.mjs} +1253 -1097
- package/dist/index-DIJe5ta7.js +1 -0
- package/dist/index-ELCL_4SK.js +3 -0
- package/dist/index-GdF83s93.js +1 -0
- package/dist/{index-DELSIerV.mjs → index-OkrVupZ5.mjs} +6540 -6088
- package/dist/plugin/baseApplianceManager.d.ts +7 -2
- package/dist/plugin/baseViewContainerManager.d.ts +2 -0
- package/dist/plugin/displayerView.d.ts +2 -0
- package/dist/plugin/multi/displayer/appViewDisplayerManager.d.ts +1 -0
- package/dist/plugin/multi/displayer/mainViewDisplayerManager.d.ts +2 -0
- package/dist/plugin/single/displayer/mainViewDisplayerManager.d.ts +2 -0
- package/dist/plugin/types.d.ts +70 -2
- package/dist/style.css +1 -1
- package/dist/subWorker.js +127 -158
- package/dist/svgToImageLoader-DPRAAhwW.js +1 -0
- package/dist/svgToImageLoader-mXH53h-l.mjs +18 -0
- package/package.json +6 -1
- package/cdn/fullWorker-DutDhB.js +0 -517
- package/cdn/subWorker-D52EcC.js +0 -517
- package/dist/core/msgEvent/deleteNode/forMainThread.d.ts +0 -6
- package/dist/core/msgEvent/deleteNode/forWorker.d.ts +0 -6
- package/dist/index-BVAZlFjO.js +0 -1
- package/dist/index-CcD-F3bG.js +0 -1
|
@@ -0,0 +1,486 @@
|
|
|
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 qy=Object.defineProperty;var _y=function _y(i,e,t){return e in i?qy(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;};var dt=function dt(i,e,t){return _y(i,_typeof(e)!="symbol"?e+"":e,t);};var be=/******/function(i){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={/******/i:r,/******/l:!1,/******/exports:{}/******/};return i[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=i,t.c=e,t.d=function(r,n,s){t.o(r,n)||Object.defineProperty(r,n,{enumerable:!0,get:s});},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 s=/* @__PURE__ */Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:r}),n&2&&typeof r!="string")for(var c in r)t.d(s,c,function(l){return r[l];}.bind(null,c));return s;},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(i,e,t){t.r(e),t.d(e,"version",function(){return tt;}),t.d(e,"helpers",function(){return $;}),t.d(e,"createElement",function(){return X;}),t.d(e,"isSpriteNode",function(){return B;}),t.d(e,"registerNode",function(){return N;});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 s=t(70);t.d(e,"Node",function(){return s["default"];});var c=t(217);t.d(e,"Cloud",function(){return c["default"];});var l=t(219);t.d(e,"Block",function(){return l["default"];});var f=t(224);t.d(e,"Sprite",function(){return f["default"];});var h=t(226);t.d(e,"Path",function(){return h["default"];});var m=t(229);t.d(e,"Rect",function(){return m["default"];});var u=t(231);t.d(e,"Triangle",function(){return u["default"];});var y=t(236);t.d(e,"Parallel",function(){return y["default"];});var T=t(238);t.d(e,"Regular",function(){return T["default"];});var w=t(240);t.d(e,"Star",function(){return w["default"];});var I=t(242);t.d(e,"Ellipse",function(){return I["default"];});var S=t(244);t.d(e,"Arc",function(){return S["default"];});var O=t(246);t.d(e,"Ring",function(){return O["default"];});var d=t(232);t.d(e,"Polyline",function(){return d["default"];});var v=t(248);t.d(e,"Label",function(){return v["default"];});var p=t(250);t.d(e,"Group",function(){return p["default"];});var x=t(286);t.d(e,"Layer",function(){return x["default"];});var E=t(287);t.d(e,"SpriteSvg",function(){return E["default"];});var R=t(289);t.d(e,"LayerWorker",function(){return R["default"];});var D=t(290);t.d(e,"Scene",function(){return D["default"];});var U=t(213),M=t(221);t.d(e,"Color",function(){return M.Color;}),t.d(e,"Gradient",function(){return M.Gradient;});var W=t(72);t(1).glMatrix.setMatrixArrayType(Array);var X=U["default"].createElement,B=U["default"].isSpriteNode,N=U["default"].registerNode,$={parseColor:M.parseColor,sizeToPixel:W.sizeToPixel,toArray:W.toArray,toString:W.toString,toNumber:W.toNumber};var J;J="3.8.3";var tt=J;},/* 1 *//***/function(i,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 s=t(4);t.d(e,"mat2d",function(){return s;});var c=t(5);t.d(e,"mat3",function(){return c;});var l=t(6);t.d(e,"mat4",function(){return l;});var f=t(7);t.d(e,"quat",function(){return f;});var h=t(10);t.d(e,"quat2",function(){return h;});var m=t(11);t.d(e,"vec2",function(){return m;});var u=t(8);t.d(e,"vec3",function(){return u;});var y=t(9);t.d(e,"vec4",function(){return y;});},/* 2 *//***/function(i,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 s;}),t.d(e,"setMatrixArrayType",function(){return c;}),t.d(e,"toRadian",function(){return f;}),t.d(e,"equals",function(){return h;});var r=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,s=Math.random;function c(m){n=m;}var l=Math.PI/180;function f(m){return m*l;}function h(m,u){return Math.abs(m-u)<=r*Math.max(1,Math.abs(m),Math.abs(u));}Math.hypot||(Math.hypot=function(){for(var m=0,u=arguments.length;u--;)m+=arguments[u]*arguments[u];return Math.sqrt(m);});},/* 3 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"copy",function(){return c;}),t.d(e,"identity",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"set",function(){return h;}),t.d(e,"transpose",function(){return m;}),t.d(e,"invert",function(){return u;}),t.d(e,"adjoint",function(){return y;}),t.d(e,"determinant",function(){return T;}),t.d(e,"multiply",function(){return w;}),t.d(e,"rotate",function(){return I;}),t.d(e,"scale",function(){return S;}),t.d(e,"fromRotation",function(){return O;}),t.d(e,"fromScaling",function(){return d;}),t.d(e,"str",function(){return v;}),t.d(e,"frob",function(){return p;}),t.d(e,"LDU",function(){return x;}),t.d(e,"add",function(){return E;}),t.d(e,"subtract",function(){return R;}),t.d(e,"exactEquals",function(){return D;}),t.d(e,"equals",function(){return U;}),t.d(e,"multiplyScalar",function(){return M;}),t.d(e,"multiplyScalarAndAdd",function(){return W;}),t.d(e,"mul",function(){return X;}),t.d(e,"sub",function(){return B;});var r=t(2);function n(){var N=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(N[1]=0,N[2]=0),N[0]=1,N[3]=1,N;}function s(N){var $=new r.ARRAY_TYPE(4);return $[0]=N[0],$[1]=N[1],$[2]=N[2],$[3]=N[3],$;}function c(N,$){return N[0]=$[0],N[1]=$[1],N[2]=$[2],N[3]=$[3],N;}function l(N){return N[0]=1,N[1]=0,N[2]=0,N[3]=1,N;}function f(N,$,J,tt){var at=new r.ARRAY_TYPE(4);return at[0]=N,at[1]=$,at[2]=J,at[3]=tt,at;}function h(N,$,J,tt,at){return N[0]=$,N[1]=J,N[2]=tt,N[3]=at,N;}function m(N,$){if(N===$){var J=$[1];N[1]=$[2],N[2]=J;}else N[0]=$[0],N[1]=$[2],N[2]=$[1],N[3]=$[3];return N;}function u(N,$){var J=$[0],tt=$[1],at=$[2],ut=$[3],V=J*ut-at*tt;return V?(V=1/V,N[0]=ut*V,N[1]=-tt*V,N[2]=-at*V,N[3]=J*V,N):null;}function y(N,$){var J=$[0];return N[0]=$[3],N[1]=-$[1],N[2]=-$[2],N[3]=J,N;}function T(N){return N[0]*N[3]-N[2]*N[1];}function w(N,$,J){var tt=$[0],at=$[1],ut=$[2],V=$[3],Q=J[0],ft=J[1],mt=J[2],yt=J[3];return N[0]=tt*Q+ut*ft,N[1]=at*Q+V*ft,N[2]=tt*mt+ut*yt,N[3]=at*mt+V*yt,N;}function I(N,$,J){var tt=$[0],at=$[1],ut=$[2],V=$[3],Q=Math.sin(J),ft=Math.cos(J);return N[0]=tt*ft+ut*Q,N[1]=at*ft+V*Q,N[2]=tt*-Q+ut*ft,N[3]=at*-Q+V*ft,N;}function S(N,$,J){var tt=$[0],at=$[1],ut=$[2],V=$[3],Q=J[0],ft=J[1];return N[0]=tt*Q,N[1]=at*Q,N[2]=ut*ft,N[3]=V*ft,N;}function O(N,$){var J=Math.sin($),tt=Math.cos($);return N[0]=tt,N[1]=J,N[2]=-J,N[3]=tt,N;}function d(N,$){return N[0]=$[0],N[1]=0,N[2]=0,N[3]=$[1],N;}function v(N){return"mat2("+N[0]+", "+N[1]+", "+N[2]+", "+N[3]+")";}function p(N){return Math.hypot(N[0],N[1],N[2],N[3]);}function x(N,$,J,tt){return N[2]=tt[2]/tt[0],J[0]=tt[0],J[1]=tt[1],J[3]=tt[3]-N[2]*J[1],[N,$,J];}function E(N,$,J){return N[0]=$[0]+J[0],N[1]=$[1]+J[1],N[2]=$[2]+J[2],N[3]=$[3]+J[3],N;}function R(N,$,J){return N[0]=$[0]-J[0],N[1]=$[1]-J[1],N[2]=$[2]-J[2],N[3]=$[3]-J[3],N;}function D(N,$){return N[0]===$[0]&&N[1]===$[1]&&N[2]===$[2]&&N[3]===$[3];}function U(N,$){var J=N[0],tt=N[1],at=N[2],ut=N[3],V=$[0],Q=$[1],ft=$[2],mt=$[3];return Math.abs(J-V)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(V))&&Math.abs(tt-Q)<=r.EPSILON*Math.max(1,Math.abs(tt),Math.abs(Q))&&Math.abs(at-ft)<=r.EPSILON*Math.max(1,Math.abs(at),Math.abs(ft))&&Math.abs(ut-mt)<=r.EPSILON*Math.max(1,Math.abs(ut),Math.abs(mt));}function M(N,$,J){return N[0]=$[0]*J,N[1]=$[1]*J,N[2]=$[2]*J,N[3]=$[3]*J,N;}function W(N,$,J,tt){return N[0]=$[0]+J[0]*tt,N[1]=$[1]+J[1]*tt,N[2]=$[2]+J[2]*tt,N[3]=$[3]+J[3]*tt,N;}var X=w,B=R;},/* 4 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"copy",function(){return c;}),t.d(e,"identity",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"set",function(){return h;}),t.d(e,"invert",function(){return m;}),t.d(e,"determinant",function(){return u;}),t.d(e,"multiply",function(){return y;}),t.d(e,"rotate",function(){return T;}),t.d(e,"scale",function(){return w;}),t.d(e,"translate",function(){return I;}),t.d(e,"fromRotation",function(){return S;}),t.d(e,"fromScaling",function(){return O;}),t.d(e,"fromTranslation",function(){return d;}),t.d(e,"str",function(){return v;}),t.d(e,"frob",function(){return p;}),t.d(e,"add",function(){return x;}),t.d(e,"subtract",function(){return E;}),t.d(e,"multiplyScalar",function(){return R;}),t.d(e,"multiplyScalarAndAdd",function(){return D;}),t.d(e,"exactEquals",function(){return U;}),t.d(e,"equals",function(){return M;}),t.d(e,"mul",function(){return W;}),t.d(e,"sub",function(){return X;});var r=t(2);function n(){var B=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(B[1]=0,B[2]=0,B[4]=0,B[5]=0),B[0]=1,B[3]=1,B;}function s(B){var N=new r.ARRAY_TYPE(6);return N[0]=B[0],N[1]=B[1],N[2]=B[2],N[3]=B[3],N[4]=B[4],N[5]=B[5],N;}function c(B,N){return B[0]=N[0],B[1]=N[1],B[2]=N[2],B[3]=N[3],B[4]=N[4],B[5]=N[5],B;}function l(B){return B[0]=1,B[1]=0,B[2]=0,B[3]=1,B[4]=0,B[5]=0,B;}function f(B,N,$,J,tt,at){var ut=new r.ARRAY_TYPE(6);return ut[0]=B,ut[1]=N,ut[2]=$,ut[3]=J,ut[4]=tt,ut[5]=at,ut;}function h(B,N,$,J,tt,at,ut){return B[0]=N,B[1]=$,B[2]=J,B[3]=tt,B[4]=at,B[5]=ut,B;}function m(B,N){var $=N[0],J=N[1],tt=N[2],at=N[3],ut=N[4],V=N[5],Q=$*at-J*tt;return Q?(Q=1/Q,B[0]=at*Q,B[1]=-J*Q,B[2]=-tt*Q,B[3]=$*Q,B[4]=(tt*V-at*ut)*Q,B[5]=(J*ut-$*V)*Q,B):null;}function u(B){return B[0]*B[3]-B[1]*B[2];}function y(B,N,$){var J=N[0],tt=N[1],at=N[2],ut=N[3],V=N[4],Q=N[5],ft=$[0],mt=$[1],yt=$[2],wt=$[3],ht=$[4],Nt=$[5];return B[0]=J*ft+at*mt,B[1]=tt*ft+ut*mt,B[2]=J*yt+at*wt,B[3]=tt*yt+ut*wt,B[4]=J*ht+at*Nt+V,B[5]=tt*ht+ut*Nt+Q,B;}function T(B,N,$){var J=N[0],tt=N[1],at=N[2],ut=N[3],V=N[4],Q=N[5],ft=Math.sin($),mt=Math.cos($);return B[0]=J*mt+at*ft,B[1]=tt*mt+ut*ft,B[2]=J*-ft+at*mt,B[3]=tt*-ft+ut*mt,B[4]=V,B[5]=Q,B;}function w(B,N,$){var J=N[0],tt=N[1],at=N[2],ut=N[3],V=N[4],Q=N[5],ft=$[0],mt=$[1];return B[0]=J*ft,B[1]=tt*ft,B[2]=at*mt,B[3]=ut*mt,B[4]=V,B[5]=Q,B;}function I(B,N,$){var J=N[0],tt=N[1],at=N[2],ut=N[3],V=N[4],Q=N[5],ft=$[0],mt=$[1];return B[0]=J,B[1]=tt,B[2]=at,B[3]=ut,B[4]=J*ft+at*mt+V,B[5]=tt*ft+ut*mt+Q,B;}function S(B,N){var $=Math.sin(N),J=Math.cos(N);return B[0]=J,B[1]=$,B[2]=-$,B[3]=J,B[4]=0,B[5]=0,B;}function O(B,N){return B[0]=N[0],B[1]=0,B[2]=0,B[3]=N[1],B[4]=0,B[5]=0,B;}function d(B,N){return B[0]=1,B[1]=0,B[2]=0,B[3]=1,B[4]=N[0],B[5]=N[1],B;}function v(B){return"mat2d("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+")";}function p(B){return Math.hypot(B[0],B[1],B[2],B[3],B[4],B[5],1);}function x(B,N,$){return B[0]=N[0]+$[0],B[1]=N[1]+$[1],B[2]=N[2]+$[2],B[3]=N[3]+$[3],B[4]=N[4]+$[4],B[5]=N[5]+$[5],B;}function E(B,N,$){return B[0]=N[0]-$[0],B[1]=N[1]-$[1],B[2]=N[2]-$[2],B[3]=N[3]-$[3],B[4]=N[4]-$[4],B[5]=N[5]-$[5],B;}function R(B,N,$){return B[0]=N[0]*$,B[1]=N[1]*$,B[2]=N[2]*$,B[3]=N[3]*$,B[4]=N[4]*$,B[5]=N[5]*$,B;}function D(B,N,$,J){return B[0]=N[0]+$[0]*J,B[1]=N[1]+$[1]*J,B[2]=N[2]+$[2]*J,B[3]=N[3]+$[3]*J,B[4]=N[4]+$[4]*J,B[5]=N[5]+$[5]*J,B;}function U(B,N){return B[0]===N[0]&&B[1]===N[1]&&B[2]===N[2]&&B[3]===N[3]&&B[4]===N[4]&&B[5]===N[5];}function M(B,N){var $=B[0],J=B[1],tt=B[2],at=B[3],ut=B[4],V=B[5],Q=N[0],ft=N[1],mt=N[2],yt=N[3],wt=N[4],ht=N[5];return Math.abs($-Q)<=r.EPSILON*Math.max(1,Math.abs($),Math.abs(Q))&&Math.abs(J-ft)<=r.EPSILON*Math.max(1,Math.abs(J),Math.abs(ft))&&Math.abs(tt-mt)<=r.EPSILON*Math.max(1,Math.abs(tt),Math.abs(mt))&&Math.abs(at-yt)<=r.EPSILON*Math.max(1,Math.abs(at),Math.abs(yt))&&Math.abs(ut-wt)<=r.EPSILON*Math.max(1,Math.abs(ut),Math.abs(wt))&&Math.abs(V-ht)<=r.EPSILON*Math.max(1,Math.abs(V),Math.abs(ht));}var W=y,X=E;},/* 5 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"fromMat4",function(){return s;}),t.d(e,"clone",function(){return c;}),t.d(e,"copy",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"set",function(){return h;}),t.d(e,"identity",function(){return m;}),t.d(e,"transpose",function(){return u;}),t.d(e,"invert",function(){return y;}),t.d(e,"adjoint",function(){return T;}),t.d(e,"determinant",function(){return w;}),t.d(e,"multiply",function(){return I;}),t.d(e,"translate",function(){return S;}),t.d(e,"rotate",function(){return O;}),t.d(e,"scale",function(){return d;}),t.d(e,"fromTranslation",function(){return v;}),t.d(e,"fromRotation",function(){return p;}),t.d(e,"fromScaling",function(){return x;}),t.d(e,"fromMat2d",function(){return E;}),t.d(e,"fromQuat",function(){return R;}),t.d(e,"normalFromMat4",function(){return D;}),t.d(e,"projection",function(){return U;}),t.d(e,"str",function(){return M;}),t.d(e,"frob",function(){return W;}),t.d(e,"add",function(){return X;}),t.d(e,"subtract",function(){return B;}),t.d(e,"multiplyScalar",function(){return N;}),t.d(e,"multiplyScalarAndAdd",function(){return $;}),t.d(e,"exactEquals",function(){return J;}),t.d(e,"equals",function(){return tt;}),t.d(e,"mul",function(){return at;}),t.d(e,"sub",function(){return ut;});var r=t(2);function n(){var V=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(V[1]=0,V[2]=0,V[3]=0,V[5]=0,V[6]=0,V[7]=0),V[0]=1,V[4]=1,V[8]=1,V;}function s(V,Q){return V[0]=Q[0],V[1]=Q[1],V[2]=Q[2],V[3]=Q[4],V[4]=Q[5],V[5]=Q[6],V[6]=Q[8],V[7]=Q[9],V[8]=Q[10],V;}function c(V){var Q=new r.ARRAY_TYPE(9);return Q[0]=V[0],Q[1]=V[1],Q[2]=V[2],Q[3]=V[3],Q[4]=V[4],Q[5]=V[5],Q[6]=V[6],Q[7]=V[7],Q[8]=V[8],Q;}function l(V,Q){return V[0]=Q[0],V[1]=Q[1],V[2]=Q[2],V[3]=Q[3],V[4]=Q[4],V[5]=Q[5],V[6]=Q[6],V[7]=Q[7],V[8]=Q[8],V;}function f(V,Q,ft,mt,yt,wt,ht,Nt,Dt){var G=new r.ARRAY_TYPE(9);return G[0]=V,G[1]=Q,G[2]=ft,G[3]=mt,G[4]=yt,G[5]=wt,G[6]=ht,G[7]=Nt,G[8]=Dt,G;}function h(V,Q,ft,mt,yt,wt,ht,Nt,Dt,G){return V[0]=Q,V[1]=ft,V[2]=mt,V[3]=yt,V[4]=wt,V[5]=ht,V[6]=Nt,V[7]=Dt,V[8]=G,V;}function m(V){return V[0]=1,V[1]=0,V[2]=0,V[3]=0,V[4]=1,V[5]=0,V[6]=0,V[7]=0,V[8]=1,V;}function u(V,Q){if(V===Q){var ft=Q[1],mt=Q[2],yt=Q[5];V[1]=Q[3],V[2]=Q[6],V[3]=ft,V[5]=Q[7],V[6]=mt,V[7]=yt;}else V[0]=Q[0],V[1]=Q[3],V[2]=Q[6],V[3]=Q[1],V[4]=Q[4],V[5]=Q[7],V[6]=Q[2],V[7]=Q[5],V[8]=Q[8];return V;}function y(V,Q){var ft=Q[0],mt=Q[1],yt=Q[2],wt=Q[3],ht=Q[4],Nt=Q[5],Dt=Q[6],G=Q[7],k=Q[8],rt=k*ht-Nt*G,nt=-k*wt+Nt*Dt,Y=G*wt-ht*Dt,Z=ft*rt+mt*nt+yt*Y;return Z?(Z=1/Z,V[0]=rt*Z,V[1]=(-k*mt+yt*G)*Z,V[2]=(Nt*mt-yt*ht)*Z,V[3]=nt*Z,V[4]=(k*ft-yt*Dt)*Z,V[5]=(-Nt*ft+yt*wt)*Z,V[6]=Y*Z,V[7]=(-G*ft+mt*Dt)*Z,V[8]=(ht*ft-mt*wt)*Z,V):null;}function T(V,Q){var ft=Q[0],mt=Q[1],yt=Q[2],wt=Q[3],ht=Q[4],Nt=Q[5],Dt=Q[6],G=Q[7],k=Q[8];return V[0]=ht*k-Nt*G,V[1]=yt*G-mt*k,V[2]=mt*Nt-yt*ht,V[3]=Nt*Dt-wt*k,V[4]=ft*k-yt*Dt,V[5]=yt*wt-ft*Nt,V[6]=wt*G-ht*Dt,V[7]=mt*Dt-ft*G,V[8]=ft*ht-mt*wt,V;}function w(V){var Q=V[0],ft=V[1],mt=V[2],yt=V[3],wt=V[4],ht=V[5],Nt=V[6],Dt=V[7],G=V[8];return Q*(G*wt-ht*Dt)+ft*(-G*yt+ht*Nt)+mt*(Dt*yt-wt*Nt);}function I(V,Q,ft){var mt=Q[0],yt=Q[1],wt=Q[2],ht=Q[3],Nt=Q[4],Dt=Q[5],G=Q[6],k=Q[7],rt=Q[8],nt=ft[0],Y=ft[1],Z=ft[2],C=ft[3],L=ft[4],z=ft[5],K=ft[6],q=ft[7],it=ft[8];return V[0]=nt*mt+Y*ht+Z*G,V[1]=nt*yt+Y*Nt+Z*k,V[2]=nt*wt+Y*Dt+Z*rt,V[3]=C*mt+L*ht+z*G,V[4]=C*yt+L*Nt+z*k,V[5]=C*wt+L*Dt+z*rt,V[6]=K*mt+q*ht+it*G,V[7]=K*yt+q*Nt+it*k,V[8]=K*wt+q*Dt+it*rt,V;}function S(V,Q,ft){var mt=Q[0],yt=Q[1],wt=Q[2],ht=Q[3],Nt=Q[4],Dt=Q[5],G=Q[6],k=Q[7],rt=Q[8],nt=ft[0],Y=ft[1];return V[0]=mt,V[1]=yt,V[2]=wt,V[3]=ht,V[4]=Nt,V[5]=Dt,V[6]=nt*mt+Y*ht+G,V[7]=nt*yt+Y*Nt+k,V[8]=nt*wt+Y*Dt+rt,V;}function O(V,Q,ft){var mt=Q[0],yt=Q[1],wt=Q[2],ht=Q[3],Nt=Q[4],Dt=Q[5],G=Q[6],k=Q[7],rt=Q[8],nt=Math.sin(ft),Y=Math.cos(ft);return V[0]=Y*mt+nt*ht,V[1]=Y*yt+nt*Nt,V[2]=Y*wt+nt*Dt,V[3]=Y*ht-nt*mt,V[4]=Y*Nt-nt*yt,V[5]=Y*Dt-nt*wt,V[6]=G,V[7]=k,V[8]=rt,V;}function d(V,Q,ft){var mt=ft[0],yt=ft[1];return V[0]=mt*Q[0],V[1]=mt*Q[1],V[2]=mt*Q[2],V[3]=yt*Q[3],V[4]=yt*Q[4],V[5]=yt*Q[5],V[6]=Q[6],V[7]=Q[7],V[8]=Q[8],V;}function v(V,Q){return V[0]=1,V[1]=0,V[2]=0,V[3]=0,V[4]=1,V[5]=0,V[6]=Q[0],V[7]=Q[1],V[8]=1,V;}function p(V,Q){var ft=Math.sin(Q),mt=Math.cos(Q);return V[0]=mt,V[1]=ft,V[2]=0,V[3]=-ft,V[4]=mt,V[5]=0,V[6]=0,V[7]=0,V[8]=1,V;}function x(V,Q){return V[0]=Q[0],V[1]=0,V[2]=0,V[3]=0,V[4]=Q[1],V[5]=0,V[6]=0,V[7]=0,V[8]=1,V;}function E(V,Q){return V[0]=Q[0],V[1]=Q[1],V[2]=0,V[3]=Q[2],V[4]=Q[3],V[5]=0,V[6]=Q[4],V[7]=Q[5],V[8]=1,V;}function R(V,Q){var ft=Q[0],mt=Q[1],yt=Q[2],wt=Q[3],ht=ft+ft,Nt=mt+mt,Dt=yt+yt,G=ft*ht,k=mt*ht,rt=mt*Nt,nt=yt*ht,Y=yt*Nt,Z=yt*Dt,C=wt*ht,L=wt*Nt,z=wt*Dt;return V[0]=1-rt-Z,V[3]=k-z,V[6]=nt+L,V[1]=k+z,V[4]=1-G-Z,V[7]=Y-C,V[2]=nt-L,V[5]=Y+C,V[8]=1-G-rt,V;}function D(V,Q){var ft=Q[0],mt=Q[1],yt=Q[2],wt=Q[3],ht=Q[4],Nt=Q[5],Dt=Q[6],G=Q[7],k=Q[8],rt=Q[9],nt=Q[10],Y=Q[11],Z=Q[12],C=Q[13],L=Q[14],z=Q[15],K=ft*Nt-mt*ht,q=ft*Dt-yt*ht,it=ft*G-wt*ht,ct=mt*Dt-yt*Nt,xt=mt*G-wt*Nt,Ct=yt*G-wt*Dt,Mt=k*C-rt*Z,bt=k*L-nt*Z,At=k*z-Y*Z,Ot=rt*L-nt*C,Lt=rt*z-Y*C,Yt=nt*z-Y*L,$t=K*Yt-q*Lt+it*Ot+ct*At-xt*bt+Ct*Mt;return $t?($t=1/$t,V[0]=(Nt*Yt-Dt*Lt+G*Ot)*$t,V[1]=(Dt*At-ht*Yt-G*bt)*$t,V[2]=(ht*Lt-Nt*At+G*Mt)*$t,V[3]=(yt*Lt-mt*Yt-wt*Ot)*$t,V[4]=(ft*Yt-yt*At+wt*bt)*$t,V[5]=(mt*At-ft*Lt-wt*Mt)*$t,V[6]=(C*Ct-L*xt+z*ct)*$t,V[7]=(L*it-Z*Ct-z*q)*$t,V[8]=(Z*xt-C*it+z*K)*$t,V):null;}function U(V,Q,ft){return V[0]=2/Q,V[1]=0,V[2]=0,V[3]=0,V[4]=-2/ft,V[5]=0,V[6]=-1,V[7]=1,V[8]=1,V;}function M(V){return"mat3("+V[0]+", "+V[1]+", "+V[2]+", "+V[3]+", "+V[4]+", "+V[5]+", "+V[6]+", "+V[7]+", "+V[8]+")";}function W(V){return Math.hypot(V[0],V[1],V[2],V[3],V[4],V[5],V[6],V[7],V[8]);}function X(V,Q,ft){return V[0]=Q[0]+ft[0],V[1]=Q[1]+ft[1],V[2]=Q[2]+ft[2],V[3]=Q[3]+ft[3],V[4]=Q[4]+ft[4],V[5]=Q[5]+ft[5],V[6]=Q[6]+ft[6],V[7]=Q[7]+ft[7],V[8]=Q[8]+ft[8],V;}function B(V,Q,ft){return V[0]=Q[0]-ft[0],V[1]=Q[1]-ft[1],V[2]=Q[2]-ft[2],V[3]=Q[3]-ft[3],V[4]=Q[4]-ft[4],V[5]=Q[5]-ft[5],V[6]=Q[6]-ft[6],V[7]=Q[7]-ft[7],V[8]=Q[8]-ft[8],V;}function N(V,Q,ft){return V[0]=Q[0]*ft,V[1]=Q[1]*ft,V[2]=Q[2]*ft,V[3]=Q[3]*ft,V[4]=Q[4]*ft,V[5]=Q[5]*ft,V[6]=Q[6]*ft,V[7]=Q[7]*ft,V[8]=Q[8]*ft,V;}function $(V,Q,ft,mt){return V[0]=Q[0]+ft[0]*mt,V[1]=Q[1]+ft[1]*mt,V[2]=Q[2]+ft[2]*mt,V[3]=Q[3]+ft[3]*mt,V[4]=Q[4]+ft[4]*mt,V[5]=Q[5]+ft[5]*mt,V[6]=Q[6]+ft[6]*mt,V[7]=Q[7]+ft[7]*mt,V[8]=Q[8]+ft[8]*mt,V;}function J(V,Q){return V[0]===Q[0]&&V[1]===Q[1]&&V[2]===Q[2]&&V[3]===Q[3]&&V[4]===Q[4]&&V[5]===Q[5]&&V[6]===Q[6]&&V[7]===Q[7]&&V[8]===Q[8];}function tt(V,Q){var ft=V[0],mt=V[1],yt=V[2],wt=V[3],ht=V[4],Nt=V[5],Dt=V[6],G=V[7],k=V[8],rt=Q[0],nt=Q[1],Y=Q[2],Z=Q[3],C=Q[4],L=Q[5],z=Q[6],K=Q[7],q=Q[8];return Math.abs(ft-rt)<=r.EPSILON*Math.max(1,Math.abs(ft),Math.abs(rt))&&Math.abs(mt-nt)<=r.EPSILON*Math.max(1,Math.abs(mt),Math.abs(nt))&&Math.abs(yt-Y)<=r.EPSILON*Math.max(1,Math.abs(yt),Math.abs(Y))&&Math.abs(wt-Z)<=r.EPSILON*Math.max(1,Math.abs(wt),Math.abs(Z))&&Math.abs(ht-C)<=r.EPSILON*Math.max(1,Math.abs(ht),Math.abs(C))&&Math.abs(Nt-L)<=r.EPSILON*Math.max(1,Math.abs(Nt),Math.abs(L))&&Math.abs(Dt-z)<=r.EPSILON*Math.max(1,Math.abs(Dt),Math.abs(z))&&Math.abs(G-K)<=r.EPSILON*Math.max(1,Math.abs(G),Math.abs(K))&&Math.abs(k-q)<=r.EPSILON*Math.max(1,Math.abs(k),Math.abs(q));}var at=I,ut=B;},/* 6 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"copy",function(){return c;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"set",function(){return f;}),t.d(e,"identity",function(){return h;}),t.d(e,"transpose",function(){return m;}),t.d(e,"invert",function(){return u;}),t.d(e,"adjoint",function(){return y;}),t.d(e,"determinant",function(){return T;}),t.d(e,"multiply",function(){return w;}),t.d(e,"translate",function(){return I;}),t.d(e,"scale",function(){return S;}),t.d(e,"rotate",function(){return O;}),t.d(e,"rotateX",function(){return d;}),t.d(e,"rotateY",function(){return v;}),t.d(e,"rotateZ",function(){return p;}),t.d(e,"fromTranslation",function(){return x;}),t.d(e,"fromScaling",function(){return E;}),t.d(e,"fromRotation",function(){return R;}),t.d(e,"fromXRotation",function(){return D;}),t.d(e,"fromYRotation",function(){return U;}),t.d(e,"fromZRotation",function(){return M;}),t.d(e,"fromRotationTranslation",function(){return W;}),t.d(e,"fromQuat2",function(){return X;}),t.d(e,"getTranslation",function(){return B;}),t.d(e,"getScaling",function(){return N;}),t.d(e,"getRotation",function(){return $;}),t.d(e,"fromRotationTranslationScale",function(){return J;}),t.d(e,"fromRotationTranslationScaleOrigin",function(){return tt;}),t.d(e,"fromQuat",function(){return at;}),t.d(e,"frustum",function(){return ut;}),t.d(e,"perspective",function(){return V;}),t.d(e,"perspectiveFromFieldOfView",function(){return Q;}),t.d(e,"ortho",function(){return ft;}),t.d(e,"lookAt",function(){return mt;}),t.d(e,"targetTo",function(){return yt;}),t.d(e,"str",function(){return wt;}),t.d(e,"frob",function(){return ht;}),t.d(e,"add",function(){return Nt;}),t.d(e,"subtract",function(){return Dt;}),t.d(e,"multiplyScalar",function(){return G;}),t.d(e,"multiplyScalarAndAdd",function(){return k;}),t.d(e,"exactEquals",function(){return rt;}),t.d(e,"equals",function(){return nt;}),t.d(e,"mul",function(){return Y;}),t.d(e,"sub",function(){return Z;});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 s(C){var L=new r.ARRAY_TYPE(16);return L[0]=C[0],L[1]=C[1],L[2]=C[2],L[3]=C[3],L[4]=C[4],L[5]=C[5],L[6]=C[6],L[7]=C[7],L[8]=C[8],L[9]=C[9],L[10]=C[10],L[11]=C[11],L[12]=C[12],L[13]=C[13],L[14]=C[14],L[15]=C[15],L;}function c(C,L){return C[0]=L[0],C[1]=L[1],C[2]=L[2],C[3]=L[3],C[4]=L[4],C[5]=L[5],C[6]=L[6],C[7]=L[7],C[8]=L[8],C[9]=L[9],C[10]=L[10],C[11]=L[11],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15],C;}function l(C,L,z,K,q,it,ct,xt,Ct,Mt,bt,At,Ot,Lt,Yt,$t){var Wt=new r.ARRAY_TYPE(16);return Wt[0]=C,Wt[1]=L,Wt[2]=z,Wt[3]=K,Wt[4]=q,Wt[5]=it,Wt[6]=ct,Wt[7]=xt,Wt[8]=Ct,Wt[9]=Mt,Wt[10]=bt,Wt[11]=At,Wt[12]=Ot,Wt[13]=Lt,Wt[14]=Yt,Wt[15]=$t,Wt;}function f(C,L,z,K,q,it,ct,xt,Ct,Mt,bt,At,Ot,Lt,Yt,$t,Wt){return C[0]=L,C[1]=z,C[2]=K,C[3]=q,C[4]=it,C[5]=ct,C[6]=xt,C[7]=Ct,C[8]=Mt,C[9]=bt,C[10]=At,C[11]=Ot,C[12]=Lt,C[13]=Yt,C[14]=$t,C[15]=Wt,C;}function h(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,L){if(C===L){var z=L[1],K=L[2],q=L[3],it=L[6],ct=L[7],xt=L[11];C[1]=L[4],C[2]=L[8],C[3]=L[12],C[4]=z,C[6]=L[9],C[7]=L[13],C[8]=K,C[9]=it,C[11]=L[14],C[12]=q,C[13]=ct,C[14]=xt;}else C[0]=L[0],C[1]=L[4],C[2]=L[8],C[3]=L[12],C[4]=L[1],C[5]=L[5],C[6]=L[9],C[7]=L[13],C[8]=L[2],C[9]=L[6],C[10]=L[10],C[11]=L[14],C[12]=L[3],C[13]=L[7],C[14]=L[11],C[15]=L[15];return C;}function u(C,L){var z=L[0],K=L[1],q=L[2],it=L[3],ct=L[4],xt=L[5],Ct=L[6],Mt=L[7],bt=L[8],At=L[9],Ot=L[10],Lt=L[11],Yt=L[12],$t=L[13],Wt=L[14],Qt=L[15],ue=z*xt-K*ct,ie=z*Ct-q*ct,ne=z*Mt-it*ct,ae=K*Ct-q*xt,se=K*Mt-it*xt,je=q*Mt-it*Ct,We=bt*$t-At*Yt,Xe=bt*Wt-Ot*Yt,Fe=bt*Qt-Lt*Yt,Ge=At*Wt-Ot*$t,Ve=At*Qt-Lt*$t,Je=Ot*Qt-Lt*Wt,Oe=ue*Je-ie*Ve+ne*Ge+ae*Fe-se*Xe+je*We;return Oe?(Oe=1/Oe,C[0]=(xt*Je-Ct*Ve+Mt*Ge)*Oe,C[1]=(q*Ve-K*Je-it*Ge)*Oe,C[2]=($t*je-Wt*se+Qt*ae)*Oe,C[3]=(Ot*se-At*je-Lt*ae)*Oe,C[4]=(Ct*Fe-ct*Je-Mt*Xe)*Oe,C[5]=(z*Je-q*Fe+it*Xe)*Oe,C[6]=(Wt*ne-Yt*je-Qt*ie)*Oe,C[7]=(bt*je-Ot*ne+Lt*ie)*Oe,C[8]=(ct*Ve-xt*Fe+Mt*We)*Oe,C[9]=(K*Fe-z*Ve-it*We)*Oe,C[10]=(Yt*se-$t*ne+Qt*ue)*Oe,C[11]=(At*ne-bt*se-Lt*ue)*Oe,C[12]=(xt*Xe-ct*Ge-Ct*We)*Oe,C[13]=(z*Ge-K*Xe+q*We)*Oe,C[14]=($t*ie-Yt*ae-Wt*ue)*Oe,C[15]=(bt*ae-At*ie+Ot*ue)*Oe,C):null;}function y(C,L){var z=L[0],K=L[1],q=L[2],it=L[3],ct=L[4],xt=L[5],Ct=L[6],Mt=L[7],bt=L[8],At=L[9],Ot=L[10],Lt=L[11],Yt=L[12],$t=L[13],Wt=L[14],Qt=L[15];return C[0]=xt*(Ot*Qt-Lt*Wt)-At*(Ct*Qt-Mt*Wt)+$t*(Ct*Lt-Mt*Ot),C[1]=-(K*(Ot*Qt-Lt*Wt)-At*(q*Qt-it*Wt)+$t*(q*Lt-it*Ot)),C[2]=K*(Ct*Qt-Mt*Wt)-xt*(q*Qt-it*Wt)+$t*(q*Mt-it*Ct),C[3]=-(K*(Ct*Lt-Mt*Ot)-xt*(q*Lt-it*Ot)+At*(q*Mt-it*Ct)),C[4]=-(ct*(Ot*Qt-Lt*Wt)-bt*(Ct*Qt-Mt*Wt)+Yt*(Ct*Lt-Mt*Ot)),C[5]=z*(Ot*Qt-Lt*Wt)-bt*(q*Qt-it*Wt)+Yt*(q*Lt-it*Ot),C[6]=-(z*(Ct*Qt-Mt*Wt)-ct*(q*Qt-it*Wt)+Yt*(q*Mt-it*Ct)),C[7]=z*(Ct*Lt-Mt*Ot)-ct*(q*Lt-it*Ot)+bt*(q*Mt-it*Ct),C[8]=ct*(At*Qt-Lt*$t)-bt*(xt*Qt-Mt*$t)+Yt*(xt*Lt-Mt*At),C[9]=-(z*(At*Qt-Lt*$t)-bt*(K*Qt-it*$t)+Yt*(K*Lt-it*At)),C[10]=z*(xt*Qt-Mt*$t)-ct*(K*Qt-it*$t)+Yt*(K*Mt-it*xt),C[11]=-(z*(xt*Lt-Mt*At)-ct*(K*Lt-it*At)+bt*(K*Mt-it*xt)),C[12]=-(ct*(At*Wt-Ot*$t)-bt*(xt*Wt-Ct*$t)+Yt*(xt*Ot-Ct*At)),C[13]=z*(At*Wt-Ot*$t)-bt*(K*Wt-q*$t)+Yt*(K*Ot-q*At),C[14]=-(z*(xt*Wt-Ct*$t)-ct*(K*Wt-q*$t)+Yt*(K*Ct-q*xt)),C[15]=z*(xt*Ot-Ct*At)-ct*(K*Ot-q*At)+bt*(K*Ct-q*xt),C;}function T(C){var L=C[0],z=C[1],K=C[2],q=C[3],it=C[4],ct=C[5],xt=C[6],Ct=C[7],Mt=C[8],bt=C[9],At=C[10],Ot=C[11],Lt=C[12],Yt=C[13],$t=C[14],Wt=C[15],Qt=L*ct-z*it,ue=L*xt-K*it,ie=L*Ct-q*it,ne=z*xt-K*ct,ae=z*Ct-q*ct,se=K*Ct-q*xt,je=Mt*Yt-bt*Lt,We=Mt*$t-At*Lt,Xe=Mt*Wt-Ot*Lt,Fe=bt*$t-At*Yt,Ge=bt*Wt-Ot*Yt,Ve=At*Wt-Ot*$t;return Qt*Ve-ue*Ge+ie*Fe+ne*Xe-ae*We+se*je;}function w(C,L,z){var K=L[0],q=L[1],it=L[2],ct=L[3],xt=L[4],Ct=L[5],Mt=L[6],bt=L[7],At=L[8],Ot=L[9],Lt=L[10],Yt=L[11],$t=L[12],Wt=L[13],Qt=L[14],ue=L[15],ie=z[0],ne=z[1],ae=z[2],se=z[3];return C[0]=ie*K+ne*xt+ae*At+se*$t,C[1]=ie*q+ne*Ct+ae*Ot+se*Wt,C[2]=ie*it+ne*Mt+ae*Lt+se*Qt,C[3]=ie*ct+ne*bt+ae*Yt+se*ue,ie=z[4],ne=z[5],ae=z[6],se=z[7],C[4]=ie*K+ne*xt+ae*At+se*$t,C[5]=ie*q+ne*Ct+ae*Ot+se*Wt,C[6]=ie*it+ne*Mt+ae*Lt+se*Qt,C[7]=ie*ct+ne*bt+ae*Yt+se*ue,ie=z[8],ne=z[9],ae=z[10],se=z[11],C[8]=ie*K+ne*xt+ae*At+se*$t,C[9]=ie*q+ne*Ct+ae*Ot+se*Wt,C[10]=ie*it+ne*Mt+ae*Lt+se*Qt,C[11]=ie*ct+ne*bt+ae*Yt+se*ue,ie=z[12],ne=z[13],ae=z[14],se=z[15],C[12]=ie*K+ne*xt+ae*At+se*$t,C[13]=ie*q+ne*Ct+ae*Ot+se*Wt,C[14]=ie*it+ne*Mt+ae*Lt+se*Qt,C[15]=ie*ct+ne*bt+ae*Yt+se*ue,C;}function I(C,L,z){var K=z[0],q=z[1],it=z[2],ct,xt,Ct,Mt,bt,At,Ot,Lt,Yt,$t,Wt,Qt;return L===C?(C[12]=L[0]*K+L[4]*q+L[8]*it+L[12],C[13]=L[1]*K+L[5]*q+L[9]*it+L[13],C[14]=L[2]*K+L[6]*q+L[10]*it+L[14],C[15]=L[3]*K+L[7]*q+L[11]*it+L[15]):(ct=L[0],xt=L[1],Ct=L[2],Mt=L[3],bt=L[4],At=L[5],Ot=L[6],Lt=L[7],Yt=L[8],$t=L[9],Wt=L[10],Qt=L[11],C[0]=ct,C[1]=xt,C[2]=Ct,C[3]=Mt,C[4]=bt,C[5]=At,C[6]=Ot,C[7]=Lt,C[8]=Yt,C[9]=$t,C[10]=Wt,C[11]=Qt,C[12]=ct*K+bt*q+Yt*it+L[12],C[13]=xt*K+At*q+$t*it+L[13],C[14]=Ct*K+Ot*q+Wt*it+L[14],C[15]=Mt*K+Lt*q+Qt*it+L[15]),C;}function S(C,L,z){var K=z[0],q=z[1],it=z[2];return C[0]=L[0]*K,C[1]=L[1]*K,C[2]=L[2]*K,C[3]=L[3]*K,C[4]=L[4]*q,C[5]=L[5]*q,C[6]=L[6]*q,C[7]=L[7]*q,C[8]=L[8]*it,C[9]=L[9]*it,C[10]=L[10]*it,C[11]=L[11]*it,C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15],C;}function O(C,L,z,K){var q=K[0],it=K[1],ct=K[2],xt=Math.hypot(q,it,ct),Ct,Mt,bt,At,Ot,Lt,Yt,$t,Wt,Qt,ue,ie,ne,ae,se,je,We,Xe,Fe,Ge,Ve,Je,Oe,ur;return xt<r.EPSILON?null:(xt=1/xt,q*=xt,it*=xt,ct*=xt,Ct=Math.sin(z),Mt=Math.cos(z),bt=1-Mt,At=L[0],Ot=L[1],Lt=L[2],Yt=L[3],$t=L[4],Wt=L[5],Qt=L[6],ue=L[7],ie=L[8],ne=L[9],ae=L[10],se=L[11],je=q*q*bt+Mt,We=it*q*bt+ct*Ct,Xe=ct*q*bt-it*Ct,Fe=q*it*bt-ct*Ct,Ge=it*it*bt+Mt,Ve=ct*it*bt+q*Ct,Je=q*ct*bt+it*Ct,Oe=it*ct*bt-q*Ct,ur=ct*ct*bt+Mt,C[0]=At*je+$t*We+ie*Xe,C[1]=Ot*je+Wt*We+ne*Xe,C[2]=Lt*je+Qt*We+ae*Xe,C[3]=Yt*je+ue*We+se*Xe,C[4]=At*Fe+$t*Ge+ie*Ve,C[5]=Ot*Fe+Wt*Ge+ne*Ve,C[6]=Lt*Fe+Qt*Ge+ae*Ve,C[7]=Yt*Fe+ue*Ge+se*Ve,C[8]=At*Je+$t*Oe+ie*ur,C[9]=Ot*Je+Wt*Oe+ne*ur,C[10]=Lt*Je+Qt*Oe+ae*ur,C[11]=Yt*Je+ue*Oe+se*ur,L!==C&&(C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C);}function d(C,L,z){var K=Math.sin(z),q=Math.cos(z),it=L[4],ct=L[5],xt=L[6],Ct=L[7],Mt=L[8],bt=L[9],At=L[10],Ot=L[11];return L!==C&&(C[0]=L[0],C[1]=L[1],C[2]=L[2],C[3]=L[3],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C[4]=it*q+Mt*K,C[5]=ct*q+bt*K,C[6]=xt*q+At*K,C[7]=Ct*q+Ot*K,C[8]=Mt*q-it*K,C[9]=bt*q-ct*K,C[10]=At*q-xt*K,C[11]=Ot*q-Ct*K,C;}function v(C,L,z){var K=Math.sin(z),q=Math.cos(z),it=L[0],ct=L[1],xt=L[2],Ct=L[3],Mt=L[8],bt=L[9],At=L[10],Ot=L[11];return L!==C&&(C[4]=L[4],C[5]=L[5],C[6]=L[6],C[7]=L[7],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C[0]=it*q-Mt*K,C[1]=ct*q-bt*K,C[2]=xt*q-At*K,C[3]=Ct*q-Ot*K,C[8]=it*K+Mt*q,C[9]=ct*K+bt*q,C[10]=xt*K+At*q,C[11]=Ct*K+Ot*q,C;}function p(C,L,z){var K=Math.sin(z),q=Math.cos(z),it=L[0],ct=L[1],xt=L[2],Ct=L[3],Mt=L[4],bt=L[5],At=L[6],Ot=L[7];return L!==C&&(C[8]=L[8],C[9]=L[9],C[10]=L[10],C[11]=L[11],C[12]=L[12],C[13]=L[13],C[14]=L[14],C[15]=L[15]),C[0]=it*q+Mt*K,C[1]=ct*q+bt*K,C[2]=xt*q+At*K,C[3]=Ct*q+Ot*K,C[4]=Mt*q-it*K,C[5]=bt*q-ct*K,C[6]=At*q-xt*K,C[7]=Ot*q-Ct*K,C;}function x(C,L){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]=L[0],C[13]=L[1],C[14]=L[2],C[15]=1,C;}function E(C,L){return C[0]=L[0],C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=L[1],C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=L[2],C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function R(C,L,z){var K=z[0],q=z[1],it=z[2],ct=Math.hypot(K,q,it),xt,Ct,Mt;return ct<r.EPSILON?null:(ct=1/ct,K*=ct,q*=ct,it*=ct,xt=Math.sin(L),Ct=Math.cos(L),Mt=1-Ct,C[0]=K*K*Mt+Ct,C[1]=q*K*Mt+it*xt,C[2]=it*K*Mt-q*xt,C[3]=0,C[4]=K*q*Mt-it*xt,C[5]=q*q*Mt+Ct,C[6]=it*q*Mt+K*xt,C[7]=0,C[8]=K*it*Mt+q*xt,C[9]=q*it*Mt-K*xt,C[10]=it*it*Mt+Ct,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C);}function D(C,L){var z=Math.sin(L),K=Math.cos(L);return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=K,C[6]=z,C[7]=0,C[8]=0,C[9]=-z,C[10]=K,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function U(C,L){var z=Math.sin(L),K=Math.cos(L);return C[0]=K,C[1]=0,C[2]=-z,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=z,C[9]=0,C[10]=K,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function M(C,L){var z=Math.sin(L),K=Math.cos(L);return C[0]=K,C[1]=z,C[2]=0,C[3]=0,C[4]=-z,C[5]=K,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 W(C,L,z){var K=L[0],q=L[1],it=L[2],ct=L[3],xt=K+K,Ct=q+q,Mt=it+it,bt=K*xt,At=K*Ct,Ot=K*Mt,Lt=q*Ct,Yt=q*Mt,$t=it*Mt,Wt=ct*xt,Qt=ct*Ct,ue=ct*Mt;return C[0]=1-(Lt+$t),C[1]=At+ue,C[2]=Ot-Qt,C[3]=0,C[4]=At-ue,C[5]=1-(bt+$t),C[6]=Yt+Wt,C[7]=0,C[8]=Ot+Qt,C[9]=Yt-Wt,C[10]=1-(bt+Lt),C[11]=0,C[12]=z[0],C[13]=z[1],C[14]=z[2],C[15]=1,C;}function X(C,L){var z=new r.ARRAY_TYPE(3),K=-L[0],q=-L[1],it=-L[2],ct=L[3],xt=L[4],Ct=L[5],Mt=L[6],bt=L[7],At=K*K+q*q+it*it+ct*ct;return At>0?(z[0]=(xt*ct+bt*K+Ct*it-Mt*q)*2/At,z[1]=(Ct*ct+bt*q+Mt*K-xt*it)*2/At,z[2]=(Mt*ct+bt*it+xt*q-Ct*K)*2/At):(z[0]=(xt*ct+bt*K+Ct*it-Mt*q)*2,z[1]=(Ct*ct+bt*q+Mt*K-xt*it)*2,z[2]=(Mt*ct+bt*it+xt*q-Ct*K)*2),W(C,L,z),C;}function B(C,L){return C[0]=L[12],C[1]=L[13],C[2]=L[14],C;}function N(C,L){var z=L[0],K=L[1],q=L[2],it=L[4],ct=L[5],xt=L[6],Ct=L[8],Mt=L[9],bt=L[10];return C[0]=Math.hypot(z,K,q),C[1]=Math.hypot(it,ct,xt),C[2]=Math.hypot(Ct,Mt,bt),C;}function $(C,L){var z=new r.ARRAY_TYPE(3);N(z,L);var K=1/z[0],q=1/z[1],it=1/z[2],ct=L[0]*K,xt=L[1]*q,Ct=L[2]*it,Mt=L[4]*K,bt=L[5]*q,At=L[6]*it,Ot=L[8]*K,Lt=L[9]*q,Yt=L[10]*it,$t=ct+bt+Yt,Wt=0;return $t>0?(Wt=Math.sqrt($t+1)*2,C[3]=0.25*Wt,C[0]=(At-Lt)/Wt,C[1]=(Ot-Ct)/Wt,C[2]=(xt-Mt)/Wt):ct>bt&&ct>Yt?(Wt=Math.sqrt(1+ct-bt-Yt)*2,C[3]=(At-Lt)/Wt,C[0]=0.25*Wt,C[1]=(xt+Mt)/Wt,C[2]=(Ot+Ct)/Wt):bt>Yt?(Wt=Math.sqrt(1+bt-ct-Yt)*2,C[3]=(Ot-Ct)/Wt,C[0]=(xt+Mt)/Wt,C[1]=0.25*Wt,C[2]=(At+Lt)/Wt):(Wt=Math.sqrt(1+Yt-ct-bt)*2,C[3]=(xt-Mt)/Wt,C[0]=(Ot+Ct)/Wt,C[1]=(At+Lt)/Wt,C[2]=0.25*Wt),C;}function J(C,L,z,K){var q=L[0],it=L[1],ct=L[2],xt=L[3],Ct=q+q,Mt=it+it,bt=ct+ct,At=q*Ct,Ot=q*Mt,Lt=q*bt,Yt=it*Mt,$t=it*bt,Wt=ct*bt,Qt=xt*Ct,ue=xt*Mt,ie=xt*bt,ne=K[0],ae=K[1],se=K[2];return C[0]=(1-(Yt+Wt))*ne,C[1]=(Ot+ie)*ne,C[2]=(Lt-ue)*ne,C[3]=0,C[4]=(Ot-ie)*ae,C[5]=(1-(At+Wt))*ae,C[6]=($t+Qt)*ae,C[7]=0,C[8]=(Lt+ue)*se,C[9]=($t-Qt)*se,C[10]=(1-(At+Yt))*se,C[11]=0,C[12]=z[0],C[13]=z[1],C[14]=z[2],C[15]=1,C;}function tt(C,L,z,K,q){var it=L[0],ct=L[1],xt=L[2],Ct=L[3],Mt=it+it,bt=ct+ct,At=xt+xt,Ot=it*Mt,Lt=it*bt,Yt=it*At,$t=ct*bt,Wt=ct*At,Qt=xt*At,ue=Ct*Mt,ie=Ct*bt,ne=Ct*At,ae=K[0],se=K[1],je=K[2],We=q[0],Xe=q[1],Fe=q[2],Ge=(1-($t+Qt))*ae,Ve=(Lt+ne)*ae,Je=(Yt-ie)*ae,Oe=(Lt-ne)*se,ur=(1-(Ot+Qt))*se,Hr=(Wt+ue)*se,tn=(Yt+ie)*je,Hn=(Wt-ue)*je,Vn=(1-(Ot+$t))*je;return C[0]=Ge,C[1]=Ve,C[2]=Je,C[3]=0,C[4]=Oe,C[5]=ur,C[6]=Hr,C[7]=0,C[8]=tn,C[9]=Hn,C[10]=Vn,C[11]=0,C[12]=z[0]+We-(Ge*We+Oe*Xe+tn*Fe),C[13]=z[1]+Xe-(Ve*We+ur*Xe+Hn*Fe),C[14]=z[2]+Fe-(Je*We+Hr*Xe+Vn*Fe),C[15]=1,C;}function at(C,L){var z=L[0],K=L[1],q=L[2],it=L[3],ct=z+z,xt=K+K,Ct=q+q,Mt=z*ct,bt=K*ct,At=K*xt,Ot=q*ct,Lt=q*xt,Yt=q*Ct,$t=it*ct,Wt=it*xt,Qt=it*Ct;return C[0]=1-At-Yt,C[1]=bt+Qt,C[2]=Ot-Wt,C[3]=0,C[4]=bt-Qt,C[5]=1-Mt-Yt,C[6]=Lt+$t,C[7]=0,C[8]=Ot+Wt,C[9]=Lt-$t,C[10]=1-Mt-At,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C;}function ut(C,L,z,K,q,it,ct){var xt=1/(z-L),Ct=1/(q-K),Mt=1/(it-ct);return C[0]=it*2*xt,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=it*2*Ct,C[6]=0,C[7]=0,C[8]=(z+L)*xt,C[9]=(q+K)*Ct,C[10]=(ct+it)*Mt,C[11]=-1,C[12]=0,C[13]=0,C[14]=ct*it*2*Mt,C[15]=0,C;}function V(C,L,z,K,q){var it=1/Math.tan(L/2),ct;return C[0]=it/z,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=it,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?(ct=1/(K-q),C[10]=(q+K)*ct,C[14]=2*q*K*ct):(C[10]=-1,C[14]=-2*K),C;}function Q(C,L,z,K){var q=Math.tan(L.upDegrees*Math.PI/180),it=Math.tan(L.downDegrees*Math.PI/180),ct=Math.tan(L.leftDegrees*Math.PI/180),xt=Math.tan(L.rightDegrees*Math.PI/180),Ct=2/(ct+xt),Mt=2/(q+it);return C[0]=Ct,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=Mt,C[6]=0,C[7]=0,C[8]=-((ct-xt)*Ct*0.5),C[9]=(q-it)*Mt*0.5,C[10]=K/(z-K),C[11]=-1,C[12]=0,C[13]=0,C[14]=K*z/(z-K),C[15]=0,C;}function ft(C,L,z,K,q,it,ct){var xt=1/(L-z),Ct=1/(K-q),Mt=1/(it-ct);return C[0]=-2*xt,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=-2*Ct,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=2*Mt,C[11]=0,C[12]=(L+z)*xt,C[13]=(q+K)*Ct,C[14]=(ct+it)*Mt,C[15]=1,C;}function mt(C,L,z,K){var q,it,ct,xt,Ct,Mt,bt,At,Ot,Lt,Yt=L[0],$t=L[1],Wt=L[2],Qt=K[0],ue=K[1],ie=K[2],ne=z[0],ae=z[1],se=z[2];return Math.abs(Yt-ne)<r.EPSILON&&Math.abs($t-ae)<r.EPSILON&&Math.abs(Wt-se)<r.EPSILON?h(C):(bt=Yt-ne,At=$t-ae,Ot=Wt-se,Lt=1/Math.hypot(bt,At,Ot),bt*=Lt,At*=Lt,Ot*=Lt,q=ue*Ot-ie*At,it=ie*bt-Qt*Ot,ct=Qt*At-ue*bt,Lt=Math.hypot(q,it,ct),Lt?(Lt=1/Lt,q*=Lt,it*=Lt,ct*=Lt):(q=0,it=0,ct=0),xt=At*ct-Ot*it,Ct=Ot*q-bt*ct,Mt=bt*it-At*q,Lt=Math.hypot(xt,Ct,Mt),Lt?(Lt=1/Lt,xt*=Lt,Ct*=Lt,Mt*=Lt):(xt=0,Ct=0,Mt=0),C[0]=q,C[1]=xt,C[2]=bt,C[3]=0,C[4]=it,C[5]=Ct,C[6]=At,C[7]=0,C[8]=ct,C[9]=Mt,C[10]=Ot,C[11]=0,C[12]=-(q*Yt+it*$t+ct*Wt),C[13]=-(xt*Yt+Ct*$t+Mt*Wt),C[14]=-(bt*Yt+At*$t+Ot*Wt),C[15]=1,C);}function yt(C,L,z,K){var q=L[0],it=L[1],ct=L[2],xt=K[0],Ct=K[1],Mt=K[2],bt=q-z[0],At=it-z[1],Ot=ct-z[2],Lt=bt*bt+At*At+Ot*Ot;Lt>0&&(Lt=1/Math.sqrt(Lt),bt*=Lt,At*=Lt,Ot*=Lt);var Yt=Ct*Ot-Mt*At,$t=Mt*bt-xt*Ot,Wt=xt*At-Ct*bt;return Lt=Yt*Yt+$t*$t+Wt*Wt,Lt>0&&(Lt=1/Math.sqrt(Lt),Yt*=Lt,$t*=Lt,Wt*=Lt),C[0]=Yt,C[1]=$t,C[2]=Wt,C[3]=0,C[4]=At*Wt-Ot*$t,C[5]=Ot*Yt-bt*Wt,C[6]=bt*$t-At*Yt,C[7]=0,C[8]=bt,C[9]=At,C[10]=Ot,C[11]=0,C[12]=q,C[13]=it,C[14]=ct,C[15]=1,C;}function wt(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 ht(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 Nt(C,L,z){return C[0]=L[0]+z[0],C[1]=L[1]+z[1],C[2]=L[2]+z[2],C[3]=L[3]+z[3],C[4]=L[4]+z[4],C[5]=L[5]+z[5],C[6]=L[6]+z[6],C[7]=L[7]+z[7],C[8]=L[8]+z[8],C[9]=L[9]+z[9],C[10]=L[10]+z[10],C[11]=L[11]+z[11],C[12]=L[12]+z[12],C[13]=L[13]+z[13],C[14]=L[14]+z[14],C[15]=L[15]+z[15],C;}function Dt(C,L,z){return C[0]=L[0]-z[0],C[1]=L[1]-z[1],C[2]=L[2]-z[2],C[3]=L[3]-z[3],C[4]=L[4]-z[4],C[5]=L[5]-z[5],C[6]=L[6]-z[6],C[7]=L[7]-z[7],C[8]=L[8]-z[8],C[9]=L[9]-z[9],C[10]=L[10]-z[10],C[11]=L[11]-z[11],C[12]=L[12]-z[12],C[13]=L[13]-z[13],C[14]=L[14]-z[14],C[15]=L[15]-z[15],C;}function G(C,L,z){return C[0]=L[0]*z,C[1]=L[1]*z,C[2]=L[2]*z,C[3]=L[3]*z,C[4]=L[4]*z,C[5]=L[5]*z,C[6]=L[6]*z,C[7]=L[7]*z,C[8]=L[8]*z,C[9]=L[9]*z,C[10]=L[10]*z,C[11]=L[11]*z,C[12]=L[12]*z,C[13]=L[13]*z,C[14]=L[14]*z,C[15]=L[15]*z,C;}function k(C,L,z,K){return C[0]=L[0]+z[0]*K,C[1]=L[1]+z[1]*K,C[2]=L[2]+z[2]*K,C[3]=L[3]+z[3]*K,C[4]=L[4]+z[4]*K,C[5]=L[5]+z[5]*K,C[6]=L[6]+z[6]*K,C[7]=L[7]+z[7]*K,C[8]=L[8]+z[8]*K,C[9]=L[9]+z[9]*K,C[10]=L[10]+z[10]*K,C[11]=L[11]+z[11]*K,C[12]=L[12]+z[12]*K,C[13]=L[13]+z[13]*K,C[14]=L[14]+z[14]*K,C[15]=L[15]+z[15]*K,C;}function rt(C,L){return C[0]===L[0]&&C[1]===L[1]&&C[2]===L[2]&&C[3]===L[3]&&C[4]===L[4]&&C[5]===L[5]&&C[6]===L[6]&&C[7]===L[7]&&C[8]===L[8]&&C[9]===L[9]&&C[10]===L[10]&&C[11]===L[11]&&C[12]===L[12]&&C[13]===L[13]&&C[14]===L[14]&&C[15]===L[15];}function nt(C,L){var z=C[0],K=C[1],q=C[2],it=C[3],ct=C[4],xt=C[5],Ct=C[6],Mt=C[7],bt=C[8],At=C[9],Ot=C[10],Lt=C[11],Yt=C[12],$t=C[13],Wt=C[14],Qt=C[15],ue=L[0],ie=L[1],ne=L[2],ae=L[3],se=L[4],je=L[5],We=L[6],Xe=L[7],Fe=L[8],Ge=L[9],Ve=L[10],Je=L[11],Oe=L[12],ur=L[13],Hr=L[14],tn=L[15];return Math.abs(z-ue)<=r.EPSILON*Math.max(1,Math.abs(z),Math.abs(ue))&&Math.abs(K-ie)<=r.EPSILON*Math.max(1,Math.abs(K),Math.abs(ie))&&Math.abs(q-ne)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(ne))&&Math.abs(it-ae)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(ae))&&Math.abs(ct-se)<=r.EPSILON*Math.max(1,Math.abs(ct),Math.abs(se))&&Math.abs(xt-je)<=r.EPSILON*Math.max(1,Math.abs(xt),Math.abs(je))&&Math.abs(Ct-We)<=r.EPSILON*Math.max(1,Math.abs(Ct),Math.abs(We))&&Math.abs(Mt-Xe)<=r.EPSILON*Math.max(1,Math.abs(Mt),Math.abs(Xe))&&Math.abs(bt-Fe)<=r.EPSILON*Math.max(1,Math.abs(bt),Math.abs(Fe))&&Math.abs(At-Ge)<=r.EPSILON*Math.max(1,Math.abs(At),Math.abs(Ge))&&Math.abs(Ot-Ve)<=r.EPSILON*Math.max(1,Math.abs(Ot),Math.abs(Ve))&&Math.abs(Lt-Je)<=r.EPSILON*Math.max(1,Math.abs(Lt),Math.abs(Je))&&Math.abs(Yt-Oe)<=r.EPSILON*Math.max(1,Math.abs(Yt),Math.abs(Oe))&&Math.abs($t-ur)<=r.EPSILON*Math.max(1,Math.abs($t),Math.abs(ur))&&Math.abs(Wt-Hr)<=r.EPSILON*Math.max(1,Math.abs(Wt),Math.abs(Hr))&&Math.abs(Qt-tn)<=r.EPSILON*Math.max(1,Math.abs(Qt),Math.abs(tn));}var Y=w,Z=Dt;},/* 7 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return l;}),t.d(e,"identity",function(){return f;}),t.d(e,"setAxisAngle",function(){return h;}),t.d(e,"getAxisAngle",function(){return m;}),t.d(e,"getAngle",function(){return u;}),t.d(e,"multiply",function(){return y;}),t.d(e,"rotateX",function(){return T;}),t.d(e,"rotateY",function(){return w;}),t.d(e,"rotateZ",function(){return I;}),t.d(e,"calculateW",function(){return S;}),t.d(e,"exp",function(){return O;}),t.d(e,"ln",function(){return d;}),t.d(e,"pow",function(){return v;}),t.d(e,"slerp",function(){return p;}),t.d(e,"random",function(){return x;}),t.d(e,"invert",function(){return E;}),t.d(e,"conjugate",function(){return R;}),t.d(e,"fromMat3",function(){return D;}),t.d(e,"fromEuler",function(){return U;}),t.d(e,"str",function(){return M;}),t.d(e,"clone",function(){return W;}),t.d(e,"fromValues",function(){return X;}),t.d(e,"copy",function(){return B;}),t.d(e,"set",function(){return N;}),t.d(e,"add",function(){return $;}),t.d(e,"mul",function(){return J;}),t.d(e,"scale",function(){return tt;}),t.d(e,"dot",function(){return at;}),t.d(e,"lerp",function(){return ut;}),t.d(e,"length",function(){return V;}),t.d(e,"len",function(){return Q;}),t.d(e,"squaredLength",function(){return ft;}),t.d(e,"sqrLen",function(){return mt;}),t.d(e,"normalize",function(){return yt;}),t.d(e,"exactEquals",function(){return wt;}),t.d(e,"equals",function(){return ht;}),t.d(e,"rotationTo",function(){return Nt;}),t.d(e,"sqlerp",function(){return Dt;}),t.d(e,"setAxes",function(){return G;});var r=t(2),n=t(5),s=t(8),c=t(9);function l(){var k=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(k[0]=0,k[1]=0,k[2]=0),k[3]=1,k;}function f(k){return k[0]=0,k[1]=0,k[2]=0,k[3]=1,k;}function h(k,rt,nt){nt=nt*0.5;var Y=Math.sin(nt);return k[0]=Y*rt[0],k[1]=Y*rt[1],k[2]=Y*rt[2],k[3]=Math.cos(nt),k;}function m(k,rt){var nt=Math.acos(rt[3])*2,Y=Math.sin(nt/2);return Y>r.EPSILON?(k[0]=rt[0]/Y,k[1]=rt[1]/Y,k[2]=rt[2]/Y):(k[0]=1,k[1]=0,k[2]=0),nt;}function u(k,rt){var nt=at(k,rt);return Math.acos(2*nt*nt-1);}function y(k,rt,nt){var Y=rt[0],Z=rt[1],C=rt[2],L=rt[3],z=nt[0],K=nt[1],q=nt[2],it=nt[3];return k[0]=Y*it+L*z+Z*q-C*K,k[1]=Z*it+L*K+C*z-Y*q,k[2]=C*it+L*q+Y*K-Z*z,k[3]=L*it-Y*z-Z*K-C*q,k;}function T(k,rt,nt){nt*=0.5;var Y=rt[0],Z=rt[1],C=rt[2],L=rt[3],z=Math.sin(nt),K=Math.cos(nt);return k[0]=Y*K+L*z,k[1]=Z*K+C*z,k[2]=C*K-Z*z,k[3]=L*K-Y*z,k;}function w(k,rt,nt){nt*=0.5;var Y=rt[0],Z=rt[1],C=rt[2],L=rt[3],z=Math.sin(nt),K=Math.cos(nt);return k[0]=Y*K-C*z,k[1]=Z*K+L*z,k[2]=C*K+Y*z,k[3]=L*K-Z*z,k;}function I(k,rt,nt){nt*=0.5;var Y=rt[0],Z=rt[1],C=rt[2],L=rt[3],z=Math.sin(nt),K=Math.cos(nt);return k[0]=Y*K+Z*z,k[1]=Z*K-Y*z,k[2]=C*K+L*z,k[3]=L*K-C*z,k;}function S(k,rt){var nt=rt[0],Y=rt[1],Z=rt[2];return k[0]=nt,k[1]=Y,k[2]=Z,k[3]=Math.sqrt(Math.abs(1-nt*nt-Y*Y-Z*Z)),k;}function O(k,rt){var nt=rt[0],Y=rt[1],Z=rt[2],C=rt[3],L=Math.sqrt(nt*nt+Y*Y+Z*Z),z=Math.exp(C),K=L>0?z*Math.sin(L)/L:0;return k[0]=nt*K,k[1]=Y*K,k[2]=Z*K,k[3]=z*Math.cos(L),k;}function d(k,rt){var nt=rt[0],Y=rt[1],Z=rt[2],C=rt[3],L=Math.sqrt(nt*nt+Y*Y+Z*Z),z=L>0?Math.atan2(L,C)/L:0;return k[0]=nt*z,k[1]=Y*z,k[2]=Z*z,k[3]=0.5*Math.log(nt*nt+Y*Y+Z*Z+C*C),k;}function v(k,rt,nt){return d(k,rt),tt(k,k,nt),O(k,k),k;}function p(k,rt,nt,Y){var Z=rt[0],C=rt[1],L=rt[2],z=rt[3],K=nt[0],q=nt[1],it=nt[2],ct=nt[3],xt,Ct,Mt,bt,At;return Ct=Z*K+C*q+L*it+z*ct,Ct<0&&(Ct=-Ct,K=-K,q=-q,it=-it,ct=-ct),1-Ct>r.EPSILON?(xt=Math.acos(Ct),Mt=Math.sin(xt),bt=Math.sin((1-Y)*xt)/Mt,At=Math.sin(Y*xt)/Mt):(bt=1-Y,At=Y),k[0]=bt*Z+At*K,k[1]=bt*C+At*q,k[2]=bt*L+At*it,k[3]=bt*z+At*ct,k;}function x(k){var rt=r.RANDOM(),nt=r.RANDOM(),Y=r.RANDOM(),Z=Math.sqrt(1-rt),C=Math.sqrt(rt);return k[0]=Z*Math.sin(2*Math.PI*nt),k[1]=Z*Math.cos(2*Math.PI*nt),k[2]=C*Math.sin(2*Math.PI*Y),k[3]=C*Math.cos(2*Math.PI*Y),k;}function E(k,rt){var nt=rt[0],Y=rt[1],Z=rt[2],C=rt[3],L=nt*nt+Y*Y+Z*Z+C*C,z=L?1/L:0;return k[0]=-nt*z,k[1]=-Y*z,k[2]=-Z*z,k[3]=C*z,k;}function R(k,rt){return k[0]=-rt[0],k[1]=-rt[1],k[2]=-rt[2],k[3]=rt[3],k;}function D(k,rt){var nt=rt[0]+rt[4]+rt[8],Y;if(nt>0)Y=Math.sqrt(nt+1),k[3]=0.5*Y,Y=0.5/Y,k[0]=(rt[5]-rt[7])*Y,k[1]=(rt[6]-rt[2])*Y,k[2]=(rt[1]-rt[3])*Y;else{var Z=0;rt[4]>rt[0]&&(Z=1),rt[8]>rt[Z*3+Z]&&(Z=2);var C=(Z+1)%3,L=(Z+2)%3;Y=Math.sqrt(rt[Z*3+Z]-rt[C*3+C]-rt[L*3+L]+1),k[Z]=0.5*Y,Y=0.5/Y,k[3]=(rt[C*3+L]-rt[L*3+C])*Y,k[C]=(rt[C*3+Z]+rt[Z*3+C])*Y,k[L]=(rt[L*3+Z]+rt[Z*3+L])*Y;}return k;}function U(k,rt,nt,Y){var Z=0.5*Math.PI/180;rt*=Z,nt*=Z,Y*=Z;var C=Math.sin(rt),L=Math.cos(rt),z=Math.sin(nt),K=Math.cos(nt),q=Math.sin(Y),it=Math.cos(Y);return k[0]=C*K*it-L*z*q,k[1]=L*z*it+C*K*q,k[2]=L*K*q-C*z*it,k[3]=L*K*it+C*z*q,k;}function M(k){return"quat("+k[0]+", "+k[1]+", "+k[2]+", "+k[3]+")";}var W=c.clone,X=c.fromValues,B=c.copy,N=c.set,$=c.add,J=y,tt=c.scale,at=c.dot,ut=c.lerp,V=c.length,Q=V,ft=c.squaredLength,mt=ft,yt=c.normalize,wt=c.exactEquals,ht=c.equals,Nt=function(){var k=s.create(),rt=s.fromValues(1,0,0),nt=s.fromValues(0,1,0);return function(Y,Z,C){var L=s.dot(Z,C);return L<-0.999999?(s.cross(k,rt,Z),s.len(k)<1e-6&&s.cross(k,nt,Z),s.normalize(k,k),h(Y,k,Math.PI),Y):L>0.999999?(Y[0]=0,Y[1]=0,Y[2]=0,Y[3]=1,Y):(s.cross(k,Z,C),Y[0]=k[0],Y[1]=k[1],Y[2]=k[2],Y[3]=1+L,yt(Y,Y));};}(),Dt=function(){var k=l(),rt=l();return function(nt,Y,Z,C,L,z){return p(k,Y,L,z),p(rt,Z,C,z),p(nt,k,rt,2*z*(1-z)),nt;};}(),G=function(){var k=n.create();return function(rt,nt,Y,Z){return k[0]=Y[0],k[3]=Y[1],k[6]=Y[2],k[1]=Z[0],k[4]=Z[1],k[7]=Z[2],k[2]=-nt[0],k[5]=-nt[1],k[8]=-nt[2],yt(rt,D(rt,k));};}();},/* 8 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"length",function(){return c;}),t.d(e,"fromValues",function(){return l;}),t.d(e,"copy",function(){return f;}),t.d(e,"set",function(){return h;}),t.d(e,"add",function(){return m;}),t.d(e,"subtract",function(){return u;}),t.d(e,"multiply",function(){return y;}),t.d(e,"divide",function(){return T;}),t.d(e,"ceil",function(){return w;}),t.d(e,"floor",function(){return I;}),t.d(e,"min",function(){return S;}),t.d(e,"max",function(){return O;}),t.d(e,"round",function(){return d;}),t.d(e,"scale",function(){return v;}),t.d(e,"scaleAndAdd",function(){return p;}),t.d(e,"distance",function(){return x;}),t.d(e,"squaredDistance",function(){return E;}),t.d(e,"squaredLength",function(){return R;}),t.d(e,"negate",function(){return D;}),t.d(e,"inverse",function(){return U;}),t.d(e,"normalize",function(){return M;}),t.d(e,"dot",function(){return W;}),t.d(e,"cross",function(){return X;}),t.d(e,"lerp",function(){return B;}),t.d(e,"hermite",function(){return N;}),t.d(e,"bezier",function(){return $;}),t.d(e,"random",function(){return J;}),t.d(e,"transformMat4",function(){return tt;}),t.d(e,"transformMat3",function(){return at;}),t.d(e,"transformQuat",function(){return ut;}),t.d(e,"rotateX",function(){return V;}),t.d(e,"rotateY",function(){return Q;}),t.d(e,"rotateZ",function(){return ft;}),t.d(e,"angle",function(){return mt;}),t.d(e,"zero",function(){return yt;}),t.d(e,"str",function(){return wt;}),t.d(e,"exactEquals",function(){return ht;}),t.d(e,"equals",function(){return Nt;}),t.d(e,"sub",function(){return Dt;}),t.d(e,"mul",function(){return G;}),t.d(e,"div",function(){return k;}),t.d(e,"dist",function(){return rt;}),t.d(e,"sqrDist",function(){return nt;}),t.d(e,"len",function(){return Y;}),t.d(e,"sqrLen",function(){return Z;}),t.d(e,"forEach",function(){return C;});var r=t(2);function n(){var L=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(L[0]=0,L[1]=0,L[2]=0),L;}function s(L){var z=new r.ARRAY_TYPE(3);return z[0]=L[0],z[1]=L[1],z[2]=L[2],z;}function c(L){var z=L[0],K=L[1],q=L[2];return Math.hypot(z,K,q);}function l(L,z,K){var q=new r.ARRAY_TYPE(3);return q[0]=L,q[1]=z,q[2]=K,q;}function f(L,z){return L[0]=z[0],L[1]=z[1],L[2]=z[2],L;}function h(L,z,K,q){return L[0]=z,L[1]=K,L[2]=q,L;}function m(L,z,K){return L[0]=z[0]+K[0],L[1]=z[1]+K[1],L[2]=z[2]+K[2],L;}function u(L,z,K){return L[0]=z[0]-K[0],L[1]=z[1]-K[1],L[2]=z[2]-K[2],L;}function y(L,z,K){return L[0]=z[0]*K[0],L[1]=z[1]*K[1],L[2]=z[2]*K[2],L;}function T(L,z,K){return L[0]=z[0]/K[0],L[1]=z[1]/K[1],L[2]=z[2]/K[2],L;}function w(L,z){return L[0]=Math.ceil(z[0]),L[1]=Math.ceil(z[1]),L[2]=Math.ceil(z[2]),L;}function I(L,z){return L[0]=Math.floor(z[0]),L[1]=Math.floor(z[1]),L[2]=Math.floor(z[2]),L;}function S(L,z,K){return L[0]=Math.min(z[0],K[0]),L[1]=Math.min(z[1],K[1]),L[2]=Math.min(z[2],K[2]),L;}function O(L,z,K){return L[0]=Math.max(z[0],K[0]),L[1]=Math.max(z[1],K[1]),L[2]=Math.max(z[2],K[2]),L;}function d(L,z){return L[0]=Math.round(z[0]),L[1]=Math.round(z[1]),L[2]=Math.round(z[2]),L;}function v(L,z,K){return L[0]=z[0]*K,L[1]=z[1]*K,L[2]=z[2]*K,L;}function p(L,z,K,q){return L[0]=z[0]+K[0]*q,L[1]=z[1]+K[1]*q,L[2]=z[2]+K[2]*q,L;}function x(L,z){var K=z[0]-L[0],q=z[1]-L[1],it=z[2]-L[2];return Math.hypot(K,q,it);}function E(L,z){var K=z[0]-L[0],q=z[1]-L[1],it=z[2]-L[2];return K*K+q*q+it*it;}function R(L){var z=L[0],K=L[1],q=L[2];return z*z+K*K+q*q;}function D(L,z){return L[0]=-z[0],L[1]=-z[1],L[2]=-z[2],L;}function U(L,z){return L[0]=1/z[0],L[1]=1/z[1],L[2]=1/z[2],L;}function M(L,z){var K=z[0],q=z[1],it=z[2],ct=K*K+q*q+it*it;return ct>0&&(ct=1/Math.sqrt(ct)),L[0]=z[0]*ct,L[1]=z[1]*ct,L[2]=z[2]*ct,L;}function W(L,z){return L[0]*z[0]+L[1]*z[1]+L[2]*z[2];}function X(L,z,K){var q=z[0],it=z[1],ct=z[2],xt=K[0],Ct=K[1],Mt=K[2];return L[0]=it*Mt-ct*Ct,L[1]=ct*xt-q*Mt,L[2]=q*Ct-it*xt,L;}function B(L,z,K,q){var it=z[0],ct=z[1],xt=z[2];return L[0]=it+q*(K[0]-it),L[1]=ct+q*(K[1]-ct),L[2]=xt+q*(K[2]-xt),L;}function N(L,z,K,q,it,ct){var xt=ct*ct,Ct=xt*(2*ct-3)+1,Mt=xt*(ct-2)+ct,bt=xt*(ct-1),At=xt*(3-2*ct);return L[0]=z[0]*Ct+K[0]*Mt+q[0]*bt+it[0]*At,L[1]=z[1]*Ct+K[1]*Mt+q[1]*bt+it[1]*At,L[2]=z[2]*Ct+K[2]*Mt+q[2]*bt+it[2]*At,L;}function $(L,z,K,q,it,ct){var xt=1-ct,Ct=xt*xt,Mt=ct*ct,bt=Ct*xt,At=3*ct*Ct,Ot=3*Mt*xt,Lt=Mt*ct;return L[0]=z[0]*bt+K[0]*At+q[0]*Ot+it[0]*Lt,L[1]=z[1]*bt+K[1]*At+q[1]*Ot+it[1]*Lt,L[2]=z[2]*bt+K[2]*At+q[2]*Ot+it[2]*Lt,L;}function J(L,z){z=z||1;var K=r.RANDOM()*2*Math.PI,q=r.RANDOM()*2-1,it=Math.sqrt(1-q*q)*z;return L[0]=Math.cos(K)*it,L[1]=Math.sin(K)*it,L[2]=q*z,L;}function tt(L,z,K){var q=z[0],it=z[1],ct=z[2],xt=K[3]*q+K[7]*it+K[11]*ct+K[15];return xt=xt||1,L[0]=(K[0]*q+K[4]*it+K[8]*ct+K[12])/xt,L[1]=(K[1]*q+K[5]*it+K[9]*ct+K[13])/xt,L[2]=(K[2]*q+K[6]*it+K[10]*ct+K[14])/xt,L;}function at(L,z,K){var q=z[0],it=z[1],ct=z[2];return L[0]=q*K[0]+it*K[3]+ct*K[6],L[1]=q*K[1]+it*K[4]+ct*K[7],L[2]=q*K[2]+it*K[5]+ct*K[8],L;}function ut(L,z,K){var q=K[0],it=K[1],ct=K[2],xt=K[3],Ct=z[0],Mt=z[1],bt=z[2],At=it*bt-ct*Mt,Ot=ct*Ct-q*bt,Lt=q*Mt-it*Ct,Yt=it*Lt-ct*Ot,$t=ct*At-q*Lt,Wt=q*Ot-it*At,Qt=xt*2;return At*=Qt,Ot*=Qt,Lt*=Qt,Yt*=2,$t*=2,Wt*=2,L[0]=Ct+At+Yt,L[1]=Mt+Ot+$t,L[2]=bt+Lt+Wt,L;}function V(L,z,K,q){var it=[],ct=[];return it[0]=z[0]-K[0],it[1]=z[1]-K[1],it[2]=z[2]-K[2],ct[0]=it[0],ct[1]=it[1]*Math.cos(q)-it[2]*Math.sin(q),ct[2]=it[1]*Math.sin(q)+it[2]*Math.cos(q),L[0]=ct[0]+K[0],L[1]=ct[1]+K[1],L[2]=ct[2]+K[2],L;}function Q(L,z,K,q){var it=[],ct=[];return it[0]=z[0]-K[0],it[1]=z[1]-K[1],it[2]=z[2]-K[2],ct[0]=it[2]*Math.sin(q)+it[0]*Math.cos(q),ct[1]=it[1],ct[2]=it[2]*Math.cos(q)-it[0]*Math.sin(q),L[0]=ct[0]+K[0],L[1]=ct[1]+K[1],L[2]=ct[2]+K[2],L;}function ft(L,z,K,q){var it=[],ct=[];return it[0]=z[0]-K[0],it[1]=z[1]-K[1],it[2]=z[2]-K[2],ct[0]=it[0]*Math.cos(q)-it[1]*Math.sin(q),ct[1]=it[0]*Math.sin(q)+it[1]*Math.cos(q),ct[2]=it[2],L[0]=ct[0]+K[0],L[1]=ct[1]+K[1],L[2]=ct[2]+K[2],L;}function mt(L,z){var K=L[0],q=L[1],it=L[2],ct=z[0],xt=z[1],Ct=z[2],Mt=Math.sqrt(K*K+q*q+it*it),bt=Math.sqrt(ct*ct+xt*xt+Ct*Ct),At=Mt*bt,Ot=At&&W(L,z)/At;return Math.acos(Math.min(Math.max(Ot,-1),1));}function yt(L){return L[0]=0,L[1]=0,L[2]=0,L;}function wt(L){return"vec3("+L[0]+", "+L[1]+", "+L[2]+")";}function ht(L,z){return L[0]===z[0]&&L[1]===z[1]&&L[2]===z[2];}function Nt(L,z){var K=L[0],q=L[1],it=L[2],ct=z[0],xt=z[1],Ct=z[2];return Math.abs(K-ct)<=r.EPSILON*Math.max(1,Math.abs(K),Math.abs(ct))&&Math.abs(q-xt)<=r.EPSILON*Math.max(1,Math.abs(q),Math.abs(xt))&&Math.abs(it-Ct)<=r.EPSILON*Math.max(1,Math.abs(it),Math.abs(Ct));}var Dt=u,G=y,k=T,rt=x,nt=E,Y=c,Z=R,C=function(){var L=n();return function(z,K,q,it,ct,xt){var Ct,Mt;for(K||(K=3),q||(q=0),it?Mt=Math.min(it*K+q,z.length):Mt=z.length,Ct=q;Ct<Mt;Ct+=K)L[0]=z[Ct],L[1]=z[Ct+1],L[2]=z[Ct+2],ct(L,L,xt),z[Ct]=L[0],z[Ct+1]=L[1],z[Ct+2]=L[2];return z;};}();},/* 9 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"fromValues",function(){return c;}),t.d(e,"copy",function(){return l;}),t.d(e,"set",function(){return f;}),t.d(e,"add",function(){return h;}),t.d(e,"subtract",function(){return m;}),t.d(e,"multiply",function(){return u;}),t.d(e,"divide",function(){return y;}),t.d(e,"ceil",function(){return T;}),t.d(e,"floor",function(){return w;}),t.d(e,"min",function(){return I;}),t.d(e,"max",function(){return S;}),t.d(e,"round",function(){return O;}),t.d(e,"scale",function(){return d;}),t.d(e,"scaleAndAdd",function(){return v;}),t.d(e,"distance",function(){return p;}),t.d(e,"squaredDistance",function(){return x;}),t.d(e,"length",function(){return E;}),t.d(e,"squaredLength",function(){return R;}),t.d(e,"negate",function(){return D;}),t.d(e,"inverse",function(){return U;}),t.d(e,"normalize",function(){return M;}),t.d(e,"dot",function(){return W;}),t.d(e,"cross",function(){return X;}),t.d(e,"lerp",function(){return B;}),t.d(e,"random",function(){return N;}),t.d(e,"transformMat4",function(){return $;}),t.d(e,"transformQuat",function(){return J;}),t.d(e,"zero",function(){return tt;}),t.d(e,"str",function(){return at;}),t.d(e,"exactEquals",function(){return ut;}),t.d(e,"equals",function(){return V;}),t.d(e,"sub",function(){return Q;}),t.d(e,"mul",function(){return ft;}),t.d(e,"div",function(){return mt;}),t.d(e,"dist",function(){return yt;}),t.d(e,"sqrDist",function(){return wt;}),t.d(e,"len",function(){return ht;}),t.d(e,"sqrLen",function(){return Nt;}),t.d(e,"forEach",function(){return Dt;});var r=t(2);function n(){var G=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(G[0]=0,G[1]=0,G[2]=0,G[3]=0),G;}function s(G){var k=new r.ARRAY_TYPE(4);return k[0]=G[0],k[1]=G[1],k[2]=G[2],k[3]=G[3],k;}function c(G,k,rt,nt){var Y=new r.ARRAY_TYPE(4);return Y[0]=G,Y[1]=k,Y[2]=rt,Y[3]=nt,Y;}function l(G,k){return G[0]=k[0],G[1]=k[1],G[2]=k[2],G[3]=k[3],G;}function f(G,k,rt,nt,Y){return G[0]=k,G[1]=rt,G[2]=nt,G[3]=Y,G;}function h(G,k,rt){return G[0]=k[0]+rt[0],G[1]=k[1]+rt[1],G[2]=k[2]+rt[2],G[3]=k[3]+rt[3],G;}function m(G,k,rt){return G[0]=k[0]-rt[0],G[1]=k[1]-rt[1],G[2]=k[2]-rt[2],G[3]=k[3]-rt[3],G;}function u(G,k,rt){return G[0]=k[0]*rt[0],G[1]=k[1]*rt[1],G[2]=k[2]*rt[2],G[3]=k[3]*rt[3],G;}function y(G,k,rt){return G[0]=k[0]/rt[0],G[1]=k[1]/rt[1],G[2]=k[2]/rt[2],G[3]=k[3]/rt[3],G;}function T(G,k){return G[0]=Math.ceil(k[0]),G[1]=Math.ceil(k[1]),G[2]=Math.ceil(k[2]),G[3]=Math.ceil(k[3]),G;}function w(G,k){return G[0]=Math.floor(k[0]),G[1]=Math.floor(k[1]),G[2]=Math.floor(k[2]),G[3]=Math.floor(k[3]),G;}function I(G,k,rt){return G[0]=Math.min(k[0],rt[0]),G[1]=Math.min(k[1],rt[1]),G[2]=Math.min(k[2],rt[2]),G[3]=Math.min(k[3],rt[3]),G;}function S(G,k,rt){return G[0]=Math.max(k[0],rt[0]),G[1]=Math.max(k[1],rt[1]),G[2]=Math.max(k[2],rt[2]),G[3]=Math.max(k[3],rt[3]),G;}function O(G,k){return G[0]=Math.round(k[0]),G[1]=Math.round(k[1]),G[2]=Math.round(k[2]),G[3]=Math.round(k[3]),G;}function d(G,k,rt){return G[0]=k[0]*rt,G[1]=k[1]*rt,G[2]=k[2]*rt,G[3]=k[3]*rt,G;}function v(G,k,rt,nt){return G[0]=k[0]+rt[0]*nt,G[1]=k[1]+rt[1]*nt,G[2]=k[2]+rt[2]*nt,G[3]=k[3]+rt[3]*nt,G;}function p(G,k){var rt=k[0]-G[0],nt=k[1]-G[1],Y=k[2]-G[2],Z=k[3]-G[3];return Math.hypot(rt,nt,Y,Z);}function x(G,k){var rt=k[0]-G[0],nt=k[1]-G[1],Y=k[2]-G[2],Z=k[3]-G[3];return rt*rt+nt*nt+Y*Y+Z*Z;}function E(G){var k=G[0],rt=G[1],nt=G[2],Y=G[3];return Math.hypot(k,rt,nt,Y);}function R(G){var k=G[0],rt=G[1],nt=G[2],Y=G[3];return k*k+rt*rt+nt*nt+Y*Y;}function D(G,k){return G[0]=-k[0],G[1]=-k[1],G[2]=-k[2],G[3]=-k[3],G;}function U(G,k){return G[0]=1/k[0],G[1]=1/k[1],G[2]=1/k[2],G[3]=1/k[3],G;}function M(G,k){var rt=k[0],nt=k[1],Y=k[2],Z=k[3],C=rt*rt+nt*nt+Y*Y+Z*Z;return C>0&&(C=1/Math.sqrt(C)),G[0]=rt*C,G[1]=nt*C,G[2]=Y*C,G[3]=Z*C,G;}function W(G,k){return G[0]*k[0]+G[1]*k[1]+G[2]*k[2]+G[3]*k[3];}function X(G,k,rt,nt){var Y=rt[0]*nt[1]-rt[1]*nt[0],Z=rt[0]*nt[2]-rt[2]*nt[0],C=rt[0]*nt[3]-rt[3]*nt[0],L=rt[1]*nt[2]-rt[2]*nt[1],z=rt[1]*nt[3]-rt[3]*nt[1],K=rt[2]*nt[3]-rt[3]*nt[2],q=k[0],it=k[1],ct=k[2],xt=k[3];return G[0]=it*K-ct*z+xt*L,G[1]=-(q*K)+ct*C-xt*Z,G[2]=q*z-it*C+xt*Y,G[3]=-(q*L)+it*Z-ct*Y,G;}function B(G,k,rt,nt){var Y=k[0],Z=k[1],C=k[2],L=k[3];return G[0]=Y+nt*(rt[0]-Y),G[1]=Z+nt*(rt[1]-Z),G[2]=C+nt*(rt[2]-C),G[3]=L+nt*(rt[3]-L),G;}function N(G,k){k=k||1;var rt,nt,Y,Z,C,L;do rt=r.RANDOM()*2-1,nt=r.RANDOM()*2-1,C=rt*rt+nt*nt;while(C>=1);do Y=r.RANDOM()*2-1,Z=r.RANDOM()*2-1,L=Y*Y+Z*Z;while(L>=1);var z=Math.sqrt((1-C)/L);return G[0]=k*rt,G[1]=k*nt,G[2]=k*Y*z,G[3]=k*Z*z,G;}function $(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=k[3];return G[0]=rt[0]*nt+rt[4]*Y+rt[8]*Z+rt[12]*C,G[1]=rt[1]*nt+rt[5]*Y+rt[9]*Z+rt[13]*C,G[2]=rt[2]*nt+rt[6]*Y+rt[10]*Z+rt[14]*C,G[3]=rt[3]*nt+rt[7]*Y+rt[11]*Z+rt[15]*C,G;}function J(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=rt[0],L=rt[1],z=rt[2],K=rt[3],q=K*nt+L*Z-z*Y,it=K*Y+z*nt-C*Z,ct=K*Z+C*Y-L*nt,xt=-C*nt-L*Y-z*Z;return G[0]=q*K+xt*-C+it*-z-ct*-L,G[1]=it*K+xt*-L+ct*-C-q*-z,G[2]=ct*K+xt*-z+q*-L-it*-C,G[3]=k[3],G;}function tt(G){return G[0]=0,G[1]=0,G[2]=0,G[3]=0,G;}function at(G){return"vec4("+G[0]+", "+G[1]+", "+G[2]+", "+G[3]+")";}function ut(G,k){return G[0]===k[0]&&G[1]===k[1]&&G[2]===k[2]&&G[3]===k[3];}function V(G,k){var rt=G[0],nt=G[1],Y=G[2],Z=G[3],C=k[0],L=k[1],z=k[2],K=k[3];return Math.abs(rt-C)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(C))&&Math.abs(nt-L)<=r.EPSILON*Math.max(1,Math.abs(nt),Math.abs(L))&&Math.abs(Y-z)<=r.EPSILON*Math.max(1,Math.abs(Y),Math.abs(z))&&Math.abs(Z-K)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(K));}var Q=m,ft=u,mt=y,yt=p,wt=x,ht=E,Nt=R,Dt=function(){var G=n();return function(k,rt,nt,Y,Z,C){var L,z;for(rt||(rt=4),nt||(nt=0),Y?z=Math.min(Y*rt+nt,k.length):z=k.length,L=nt;L<z;L+=rt)G[0]=k[L],G[1]=k[L+1],G[2]=k[L+2],G[3]=k[L+3],Z(G,G,C),k[L]=G[0],k[L+1]=G[1],k[L+2]=G[2],k[L+3]=G[3];return k;};}();},/* 10 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return c;}),t.d(e,"clone",function(){return l;}),t.d(e,"fromValues",function(){return f;}),t.d(e,"fromRotationTranslationValues",function(){return h;}),t.d(e,"fromRotationTranslation",function(){return m;}),t.d(e,"fromTranslation",function(){return u;}),t.d(e,"fromRotation",function(){return y;}),t.d(e,"fromMat4",function(){return T;}),t.d(e,"copy",function(){return w;}),t.d(e,"identity",function(){return I;}),t.d(e,"set",function(){return S;}),t.d(e,"getReal",function(){return O;}),t.d(e,"getDual",function(){return d;}),t.d(e,"setReal",function(){return v;}),t.d(e,"setDual",function(){return p;}),t.d(e,"getTranslation",function(){return x;}),t.d(e,"translate",function(){return E;}),t.d(e,"rotateX",function(){return R;}),t.d(e,"rotateY",function(){return D;}),t.d(e,"rotateZ",function(){return U;}),t.d(e,"rotateByQuatAppend",function(){return M;}),t.d(e,"rotateByQuatPrepend",function(){return W;}),t.d(e,"rotateAroundAxis",function(){return X;}),t.d(e,"add",function(){return B;}),t.d(e,"multiply",function(){return N;}),t.d(e,"mul",function(){return $;}),t.d(e,"scale",function(){return J;}),t.d(e,"dot",function(){return tt;}),t.d(e,"lerp",function(){return at;}),t.d(e,"invert",function(){return ut;}),t.d(e,"conjugate",function(){return V;}),t.d(e,"length",function(){return Q;}),t.d(e,"len",function(){return ft;}),t.d(e,"squaredLength",function(){return mt;}),t.d(e,"sqrLen",function(){return yt;}),t.d(e,"normalize",function(){return wt;}),t.d(e,"str",function(){return ht;}),t.d(e,"exactEquals",function(){return Nt;}),t.d(e,"equals",function(){return Dt;});var r=t(2),n=t(7),s=t(6);function c(){var G=new r.ARRAY_TYPE(8);return r.ARRAY_TYPE!=Float32Array&&(G[0]=0,G[1]=0,G[2]=0,G[4]=0,G[5]=0,G[6]=0,G[7]=0),G[3]=1,G;}function l(G){var k=new r.ARRAY_TYPE(8);return k[0]=G[0],k[1]=G[1],k[2]=G[2],k[3]=G[3],k[4]=G[4],k[5]=G[5],k[6]=G[6],k[7]=G[7],k;}function f(G,k,rt,nt,Y,Z,C,L){var z=new r.ARRAY_TYPE(8);return z[0]=G,z[1]=k,z[2]=rt,z[3]=nt,z[4]=Y,z[5]=Z,z[6]=C,z[7]=L,z;}function h(G,k,rt,nt,Y,Z,C){var L=new r.ARRAY_TYPE(8);L[0]=G,L[1]=k,L[2]=rt,L[3]=nt;var z=Y*0.5,K=Z*0.5,q=C*0.5;return L[4]=z*nt+K*rt-q*k,L[5]=K*nt+q*G-z*rt,L[6]=q*nt+z*k-K*G,L[7]=-z*G-K*k-q*rt,L;}function m(G,k,rt){var nt=rt[0]*0.5,Y=rt[1]*0.5,Z=rt[2]*0.5,C=k[0],L=k[1],z=k[2],K=k[3];return G[0]=C,G[1]=L,G[2]=z,G[3]=K,G[4]=nt*K+Y*z-Z*L,G[5]=Y*K+Z*C-nt*z,G[6]=Z*K+nt*L-Y*C,G[7]=-nt*C-Y*L-Z*z,G;}function u(G,k){return G[0]=0,G[1]=0,G[2]=0,G[3]=1,G[4]=k[0]*0.5,G[5]=k[1]*0.5,G[6]=k[2]*0.5,G[7]=0,G;}function y(G,k){return G[0]=k[0],G[1]=k[1],G[2]=k[2],G[3]=k[3],G[4]=0,G[5]=0,G[6]=0,G[7]=0,G;}function T(G,k){var rt=n.create();s.getRotation(rt,k);var nt=new r.ARRAY_TYPE(3);return s.getTranslation(nt,k),m(G,rt,nt),G;}function w(G,k){return G[0]=k[0],G[1]=k[1],G[2]=k[2],G[3]=k[3],G[4]=k[4],G[5]=k[5],G[6]=k[6],G[7]=k[7],G;}function I(G){return G[0]=0,G[1]=0,G[2]=0,G[3]=1,G[4]=0,G[5]=0,G[6]=0,G[7]=0,G;}function S(G,k,rt,nt,Y,Z,C,L,z){return G[0]=k,G[1]=rt,G[2]=nt,G[3]=Y,G[4]=Z,G[5]=C,G[6]=L,G[7]=z,G;}var O=n.copy;function d(G,k){return G[0]=k[4],G[1]=k[5],G[2]=k[6],G[3]=k[7],G;}var v=n.copy;function p(G,k){return G[4]=k[0],G[5]=k[1],G[6]=k[2],G[7]=k[3],G;}function x(G,k){var rt=k[4],nt=k[5],Y=k[6],Z=k[7],C=-k[0],L=-k[1],z=-k[2],K=k[3];return G[0]=(rt*K+Z*C+nt*z-Y*L)*2,G[1]=(nt*K+Z*L+Y*C-rt*z)*2,G[2]=(Y*K+Z*z+rt*L-nt*C)*2,G;}function E(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=k[3],L=rt[0]*0.5,z=rt[1]*0.5,K=rt[2]*0.5,q=k[4],it=k[5],ct=k[6],xt=k[7];return G[0]=nt,G[1]=Y,G[2]=Z,G[3]=C,G[4]=C*L+Y*K-Z*z+q,G[5]=C*z+Z*L-nt*K+it,G[6]=C*K+nt*z-Y*L+ct,G[7]=-nt*L-Y*z-Z*K+xt,G;}function R(G,k,rt){var nt=-k[0],Y=-k[1],Z=-k[2],C=k[3],L=k[4],z=k[5],K=k[6],q=k[7],it=L*C+q*nt+z*Z-K*Y,ct=z*C+q*Y+K*nt-L*Z,xt=K*C+q*Z+L*Y-z*nt,Ct=q*C-L*nt-z*Y-K*Z;return n.rotateX(G,k,rt),nt=G[0],Y=G[1],Z=G[2],C=G[3],G[4]=it*C+Ct*nt+ct*Z-xt*Y,G[5]=ct*C+Ct*Y+xt*nt-it*Z,G[6]=xt*C+Ct*Z+it*Y-ct*nt,G[7]=Ct*C-it*nt-ct*Y-xt*Z,G;}function D(G,k,rt){var nt=-k[0],Y=-k[1],Z=-k[2],C=k[3],L=k[4],z=k[5],K=k[6],q=k[7],it=L*C+q*nt+z*Z-K*Y,ct=z*C+q*Y+K*nt-L*Z,xt=K*C+q*Z+L*Y-z*nt,Ct=q*C-L*nt-z*Y-K*Z;return n.rotateY(G,k,rt),nt=G[0],Y=G[1],Z=G[2],C=G[3],G[4]=it*C+Ct*nt+ct*Z-xt*Y,G[5]=ct*C+Ct*Y+xt*nt-it*Z,G[6]=xt*C+Ct*Z+it*Y-ct*nt,G[7]=Ct*C-it*nt-ct*Y-xt*Z,G;}function U(G,k,rt){var nt=-k[0],Y=-k[1],Z=-k[2],C=k[3],L=k[4],z=k[5],K=k[6],q=k[7],it=L*C+q*nt+z*Z-K*Y,ct=z*C+q*Y+K*nt-L*Z,xt=K*C+q*Z+L*Y-z*nt,Ct=q*C-L*nt-z*Y-K*Z;return n.rotateZ(G,k,rt),nt=G[0],Y=G[1],Z=G[2],C=G[3],G[4]=it*C+Ct*nt+ct*Z-xt*Y,G[5]=ct*C+Ct*Y+xt*nt-it*Z,G[6]=xt*C+Ct*Z+it*Y-ct*nt,G[7]=Ct*C-it*nt-ct*Y-xt*Z,G;}function M(G,k,rt){var nt=rt[0],Y=rt[1],Z=rt[2],C=rt[3],L=k[0],z=k[1],K=k[2],q=k[3];return G[0]=L*C+q*nt+z*Z-K*Y,G[1]=z*C+q*Y+K*nt-L*Z,G[2]=K*C+q*Z+L*Y-z*nt,G[3]=q*C-L*nt-z*Y-K*Z,L=k[4],z=k[5],K=k[6],q=k[7],G[4]=L*C+q*nt+z*Z-K*Y,G[5]=z*C+q*Y+K*nt-L*Z,G[6]=K*C+q*Z+L*Y-z*nt,G[7]=q*C-L*nt-z*Y-K*Z,G;}function W(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=k[3],L=rt[0],z=rt[1],K=rt[2],q=rt[3];return G[0]=nt*q+C*L+Y*K-Z*z,G[1]=Y*q+C*z+Z*L-nt*K,G[2]=Z*q+C*K+nt*z-Y*L,G[3]=C*q-nt*L-Y*z-Z*K,L=rt[4],z=rt[5],K=rt[6],q=rt[7],G[4]=nt*q+C*L+Y*K-Z*z,G[5]=Y*q+C*z+Z*L-nt*K,G[6]=Z*q+C*K+nt*z-Y*L,G[7]=C*q-nt*L-Y*z-Z*K,G;}function X(G,k,rt,nt){if(Math.abs(nt)<r.EPSILON)return w(G,k);var Y=Math.hypot(rt[0],rt[1],rt[2]);nt=nt*0.5;var Z=Math.sin(nt),C=Z*rt[0]/Y,L=Z*rt[1]/Y,z=Z*rt[2]/Y,K=Math.cos(nt),q=k[0],it=k[1],ct=k[2],xt=k[3];G[0]=q*K+xt*C+it*z-ct*L,G[1]=it*K+xt*L+ct*C-q*z,G[2]=ct*K+xt*z+q*L-it*C,G[3]=xt*K-q*C-it*L-ct*z;var Ct=k[4],Mt=k[5],bt=k[6],At=k[7];return G[4]=Ct*K+At*C+Mt*z-bt*L,G[5]=Mt*K+At*L+bt*C-Ct*z,G[6]=bt*K+At*z+Ct*L-Mt*C,G[7]=At*K-Ct*C-Mt*L-bt*z,G;}function B(G,k,rt){return G[0]=k[0]+rt[0],G[1]=k[1]+rt[1],G[2]=k[2]+rt[2],G[3]=k[3]+rt[3],G[4]=k[4]+rt[4],G[5]=k[5]+rt[5],G[6]=k[6]+rt[6],G[7]=k[7]+rt[7],G;}function N(G,k,rt){var nt=k[0],Y=k[1],Z=k[2],C=k[3],L=rt[4],z=rt[5],K=rt[6],q=rt[7],it=k[4],ct=k[5],xt=k[6],Ct=k[7],Mt=rt[0],bt=rt[1],At=rt[2],Ot=rt[3];return G[0]=nt*Ot+C*Mt+Y*At-Z*bt,G[1]=Y*Ot+C*bt+Z*Mt-nt*At,G[2]=Z*Ot+C*At+nt*bt-Y*Mt,G[3]=C*Ot-nt*Mt-Y*bt-Z*At,G[4]=nt*q+C*L+Y*K-Z*z+it*Ot+Ct*Mt+ct*At-xt*bt,G[5]=Y*q+C*z+Z*L-nt*K+ct*Ot+Ct*bt+xt*Mt-it*At,G[6]=Z*q+C*K+nt*z-Y*L+xt*Ot+Ct*At+it*bt-ct*Mt,G[7]=C*q-nt*L-Y*z-Z*K+Ct*Ot-it*Mt-ct*bt-xt*At,G;}var $=N;function J(G,k,rt){return G[0]=k[0]*rt,G[1]=k[1]*rt,G[2]=k[2]*rt,G[3]=k[3]*rt,G[4]=k[4]*rt,G[5]=k[5]*rt,G[6]=k[6]*rt,G[7]=k[7]*rt,G;}var tt=n.dot;function at(G,k,rt,nt){var Y=1-nt;return tt(k,rt)<0&&(nt=-nt),G[0]=k[0]*Y+rt[0]*nt,G[1]=k[1]*Y+rt[1]*nt,G[2]=k[2]*Y+rt[2]*nt,G[3]=k[3]*Y+rt[3]*nt,G[4]=k[4]*Y+rt[4]*nt,G[5]=k[5]*Y+rt[5]*nt,G[6]=k[6]*Y+rt[6]*nt,G[7]=k[7]*Y+rt[7]*nt,G;}function ut(G,k){var rt=mt(k);return G[0]=-k[0]/rt,G[1]=-k[1]/rt,G[2]=-k[2]/rt,G[3]=k[3]/rt,G[4]=-k[4]/rt,G[5]=-k[5]/rt,G[6]=-k[6]/rt,G[7]=k[7]/rt,G;}function V(G,k){return G[0]=-k[0],G[1]=-k[1],G[2]=-k[2],G[3]=k[3],G[4]=-k[4],G[5]=-k[5],G[6]=-k[6],G[7]=k[7],G;}var Q=n.length,ft=Q,mt=n.squaredLength,yt=mt;function wt(G,k){var rt=mt(k);if(rt>0){rt=Math.sqrt(rt);var nt=k[0]/rt,Y=k[1]/rt,Z=k[2]/rt,C=k[3]/rt,L=k[4],z=k[5],K=k[6],q=k[7],it=nt*L+Y*z+Z*K+C*q;G[0]=nt,G[1]=Y,G[2]=Z,G[3]=C,G[4]=(L-nt*it)/rt,G[5]=(z-Y*it)/rt,G[6]=(K-Z*it)/rt,G[7]=(q-C*it)/rt;}return G;}function ht(G){return"quat2("+G[0]+", "+G[1]+", "+G[2]+", "+G[3]+", "+G[4]+", "+G[5]+", "+G[6]+", "+G[7]+")";}function Nt(G,k){return G[0]===k[0]&&G[1]===k[1]&&G[2]===k[2]&&G[3]===k[3]&&G[4]===k[4]&&G[5]===k[5]&&G[6]===k[6]&&G[7]===k[7];}function Dt(G,k){var rt=G[0],nt=G[1],Y=G[2],Z=G[3],C=G[4],L=G[5],z=G[6],K=G[7],q=k[0],it=k[1],ct=k[2],xt=k[3],Ct=k[4],Mt=k[5],bt=k[6],At=k[7];return Math.abs(rt-q)<=r.EPSILON*Math.max(1,Math.abs(rt),Math.abs(q))&&Math.abs(nt-it)<=r.EPSILON*Math.max(1,Math.abs(nt),Math.abs(it))&&Math.abs(Y-ct)<=r.EPSILON*Math.max(1,Math.abs(Y),Math.abs(ct))&&Math.abs(Z-xt)<=r.EPSILON*Math.max(1,Math.abs(Z),Math.abs(xt))&&Math.abs(C-Ct)<=r.EPSILON*Math.max(1,Math.abs(C),Math.abs(Ct))&&Math.abs(L-Mt)<=r.EPSILON*Math.max(1,Math.abs(L),Math.abs(Mt))&&Math.abs(z-bt)<=r.EPSILON*Math.max(1,Math.abs(z),Math.abs(bt))&&Math.abs(K-At)<=r.EPSILON*Math.max(1,Math.abs(K),Math.abs(At));}},/* 11 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return n;}),t.d(e,"clone",function(){return s;}),t.d(e,"fromValues",function(){return c;}),t.d(e,"copy",function(){return l;}),t.d(e,"set",function(){return f;}),t.d(e,"add",function(){return h;}),t.d(e,"subtract",function(){return m;}),t.d(e,"multiply",function(){return u;}),t.d(e,"divide",function(){return y;}),t.d(e,"ceil",function(){return T;}),t.d(e,"floor",function(){return w;}),t.d(e,"min",function(){return I;}),t.d(e,"max",function(){return S;}),t.d(e,"round",function(){return O;}),t.d(e,"scale",function(){return d;}),t.d(e,"scaleAndAdd",function(){return v;}),t.d(e,"distance",function(){return p;}),t.d(e,"squaredDistance",function(){return x;}),t.d(e,"length",function(){return E;}),t.d(e,"squaredLength",function(){return R;}),t.d(e,"negate",function(){return D;}),t.d(e,"inverse",function(){return U;}),t.d(e,"normalize",function(){return M;}),t.d(e,"dot",function(){return W;}),t.d(e,"cross",function(){return X;}),t.d(e,"lerp",function(){return B;}),t.d(e,"random",function(){return N;}),t.d(e,"transformMat2",function(){return $;}),t.d(e,"transformMat2d",function(){return J;}),t.d(e,"transformMat3",function(){return tt;}),t.d(e,"transformMat4",function(){return at;}),t.d(e,"rotate",function(){return ut;}),t.d(e,"angle",function(){return V;}),t.d(e,"zero",function(){return Q;}),t.d(e,"str",function(){return ft;}),t.d(e,"exactEquals",function(){return mt;}),t.d(e,"equals",function(){return yt;}),t.d(e,"len",function(){return wt;}),t.d(e,"sub",function(){return ht;}),t.d(e,"mul",function(){return Nt;}),t.d(e,"div",function(){return Dt;}),t.d(e,"dist",function(){return G;}),t.d(e,"sqrDist",function(){return k;}),t.d(e,"sqrLen",function(){return rt;}),t.d(e,"forEach",function(){return nt;});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 s(Y){var Z=new r.ARRAY_TYPE(2);return Z[0]=Y[0],Z[1]=Y[1],Z;}function c(Y,Z){var C=new r.ARRAY_TYPE(2);return C[0]=Y,C[1]=Z,C;}function l(Y,Z){return Y[0]=Z[0],Y[1]=Z[1],Y;}function f(Y,Z,C){return Y[0]=Z,Y[1]=C,Y;}function h(Y,Z,C){return Y[0]=Z[0]+C[0],Y[1]=Z[1]+C[1],Y;}function m(Y,Z,C){return Y[0]=Z[0]-C[0],Y[1]=Z[1]-C[1],Y;}function u(Y,Z,C){return Y[0]=Z[0]*C[0],Y[1]=Z[1]*C[1],Y;}function y(Y,Z,C){return Y[0]=Z[0]/C[0],Y[1]=Z[1]/C[1],Y;}function T(Y,Z){return Y[0]=Math.ceil(Z[0]),Y[1]=Math.ceil(Z[1]),Y;}function w(Y,Z){return Y[0]=Math.floor(Z[0]),Y[1]=Math.floor(Z[1]),Y;}function I(Y,Z,C){return Y[0]=Math.min(Z[0],C[0]),Y[1]=Math.min(Z[1],C[1]),Y;}function S(Y,Z,C){return Y[0]=Math.max(Z[0],C[0]),Y[1]=Math.max(Z[1],C[1]),Y;}function O(Y,Z){return Y[0]=Math.round(Z[0]),Y[1]=Math.round(Z[1]),Y;}function d(Y,Z,C){return Y[0]=Z[0]*C,Y[1]=Z[1]*C,Y;}function v(Y,Z,C,L){return Y[0]=Z[0]+C[0]*L,Y[1]=Z[1]+C[1]*L,Y;}function p(Y,Z){var C=Z[0]-Y[0],L=Z[1]-Y[1];return Math.hypot(C,L);}function x(Y,Z){var C=Z[0]-Y[0],L=Z[1]-Y[1];return C*C+L*L;}function E(Y){var Z=Y[0],C=Y[1];return Math.hypot(Z,C);}function R(Y){var Z=Y[0],C=Y[1];return Z*Z+C*C;}function D(Y,Z){return Y[0]=-Z[0],Y[1]=-Z[1],Y;}function U(Y,Z){return Y[0]=1/Z[0],Y[1]=1/Z[1],Y;}function M(Y,Z){var C=Z[0],L=Z[1],z=C*C+L*L;return z>0&&(z=1/Math.sqrt(z)),Y[0]=Z[0]*z,Y[1]=Z[1]*z,Y;}function W(Y,Z){return Y[0]*Z[0]+Y[1]*Z[1];}function X(Y,Z,C){var L=Z[0]*C[1]-Z[1]*C[0];return Y[0]=Y[1]=0,Y[2]=L,Y;}function B(Y,Z,C,L){var z=Z[0],K=Z[1];return Y[0]=z+L*(C[0]-z),Y[1]=K+L*(C[1]-K),Y;}function N(Y,Z){Z=Z||1;var C=r.RANDOM()*2*Math.PI;return Y[0]=Math.cos(C)*Z,Y[1]=Math.sin(C)*Z,Y;}function $(Y,Z,C){var L=Z[0],z=Z[1];return Y[0]=C[0]*L+C[2]*z,Y[1]=C[1]*L+C[3]*z,Y;}function J(Y,Z,C){var L=Z[0],z=Z[1];return Y[0]=C[0]*L+C[2]*z+C[4],Y[1]=C[1]*L+C[3]*z+C[5],Y;}function tt(Y,Z,C){var L=Z[0],z=Z[1];return Y[0]=C[0]*L+C[3]*z+C[6],Y[1]=C[1]*L+C[4]*z+C[7],Y;}function at(Y,Z,C){var L=Z[0],z=Z[1];return Y[0]=C[0]*L+C[4]*z+C[12],Y[1]=C[1]*L+C[5]*z+C[13],Y;}function ut(Y,Z,C,L){var z=Z[0]-C[0],K=Z[1]-C[1],q=Math.sin(L),it=Math.cos(L);return Y[0]=z*it-K*q+C[0],Y[1]=z*q+K*it+C[1],Y;}function V(Y,Z){var C=Y[0],L=Y[1],z=Z[0],K=Z[1],q=Math.sqrt(C*C+L*L)*Math.sqrt(z*z+K*K),it=q&&(C*z+L*K)/q;return Math.acos(Math.min(Math.max(it,-1),1));}function Q(Y){return Y[0]=0,Y[1]=0,Y;}function ft(Y){return"vec2("+Y[0]+", "+Y[1]+")";}function mt(Y,Z){return Y[0]===Z[0]&&Y[1]===Z[1];}function yt(Y,Z){var C=Y[0],L=Y[1],z=Z[0],K=Z[1];return Math.abs(C-z)<=r.EPSILON*Math.max(1,Math.abs(C),Math.abs(z))&&Math.abs(L-K)<=r.EPSILON*Math.max(1,Math.abs(L),Math.abs(K));}var wt=E,ht=m,Nt=u,Dt=y,G=p,k=x,rt=R,nt=function(){var Y=n();return function(Z,C,L,z,K,q){var it,ct;for(C||(C=2),L||(L=0),z?ct=Math.min(z*C+L,Z.length):ct=Z.length,it=L;it<ct;it+=C)Y[0]=Z[it],Y[1]=Z[it+1],K(Y,Y,q),Z[it]=Y[0],Z[it+1]=Y[1];return Z;};}();},/* 12 *//***/function(i,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 s=t(56);t.d(e,"Mesh2D",function(){return s["default"];});var c=t(29);t.d(e,"MeshCloud",function(){return c["default"];});var l=t(23);t.d(e,"parseFont",function(){return l["default"];});var f=t(31);t.d(e,"parseColor",function(){return f["default"];});var h=t(21);t.d(e,"ENV",function(){return h["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return U;});var r=t(14),n=t(1),s=t(20),c=t(27),l=t(25),f=t(40),h=t(56),m=t(29),u=t(59),y=t(21),T=t(63);t(1).glMatrix.setMatrixArrayType(Array);var w={autoUpdate:!1,// premultipliedAlpha: true,
|
|
2
|
+
preserveDrawingBuffer:!1,// depth: false,
|
|
3
|
+
// antialias: false,
|
|
4
|
+
bufferSize:1500},I="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",S="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",O=Symbol("glRenderer"),d=Symbol("canvasRenderer"),v=Symbol("options"),p=Symbol("globalTransform"),x=Symbol("applyGlobalTransform"),E=Symbol("canvas");function R(M){var W=M.gl,X=M.fbo;X&&W.bindFramebuffer(W.FRAMEBUFFER,X),M._draw(),X&&W.bindFramebuffer(W.FRAMEBUFFER,null);}function D(M,W,X,B){var N=M.createTexture(W.canvas),$=[[[0,0],[X,0],[X,B],[0,B],[0,0]]];$.closed=!0;var J=new h["default"]({contours:$});J.setTexture(N),M.setMeshData([J.meshData]),R(M),N["delete"](),W.clearRect(0,0,X,B),delete W._filter;}var U=/*#__PURE__*/function(){function U(W){var X=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,U);var B=X.contextType;if(B||(typeof WebGL2RenderingContext=="function"?B="webgl2":typeof WebGLRenderingContext=="function"?B="webgl":B="2d"),!W.getContext){var N=W;W={getContext:function getContext(){return N;},width:X.width,height:X.height},N.canvas=W,B="2d";}if(this[E]=W,B!=="webgl"&&B!=="webgl2"&&B!=="2d")throw new Error("Unknown context type ".concat(B));if(X.contextType=B,this[v]=Object.assign({},w,X),B==="webgl"||B==="webgl2"){B==="webgl2"&&(this[v].webgl2=!0);var _N=new r["default"](W,this[v]);B==="webgl2"&&!_N.isWebGL2&&(X.contextType="webgl"),Object(T.createShaders)(_N),Object(T.applyShader)(_N),Object(T.createCloudShaders)(_N);var $=_N.gl;$.clearColor(0,0,0,0),$.blendFuncSeparate($.SRC_ALPHA,$.ONE_MINUS_SRC_ALPHA,$.ONE,$.ONE_MINUS_SRC_ALPHA),this[O]=_N;}else this[d]=new s["default"](W,this[v]);this[p]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(U,[{key:"canvas",get:function get(){return this[E];}},{key:"canvasRenderer",get:function get(){return this[d];}},{key:"glRenderer",get:function get(){return this[O];}},{key:"isWebGL2",get:function get(){return this[O]&&this[O].isWebGL2;}},{key:"options",get:function get(){return this[v];}},{key:"globalTransformMatrix",get:function get(){var W=this[p];return[W[0],W[1],W[3],W[4],W[6],W[7]];}},{key:"viewMatrix",get:function get(){return this[p];}},{key:x,value:function value(){var W=this[O]||this[d];if(this[O]){var _this$canvas=this.canvas,X=_this$canvas.width,B=_this$canvas.height;W.uniforms.viewMatrix=this.viewMatrix,W.uniforms.projectionMatrix=this.projectionMatrix,W.uniforms.u_resolution=[X,B];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,W=_this$canvas2.width,X=_this$canvas2.height,B=[// translation
|
|
5
|
+
1,0,0,0,1,0,-W/2,-X/2,1],N=[// scale
|
|
6
|
+
2/W,0,0,0,-2/X,0,0,0,1],$=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),N,B);this.projectionMatrix=$,this[O]&&this[O].gl.viewport(0,0,W,X);}},{key:"createTexture",value:function createTexture(W,X){return(this[O]||this[d]).createTexture(W,X);}/* async */},{key:"loadTexture",value:function loadTexture(W){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref$useImageBitmap=_ref.useImageBitmap,X=_ref$useImageBitmap===void 0?!1:_ref$useImageBitmap;return(this[O]||this[d]).loadTexture(W,{useImageBitmap:X});}},{key:"createText",value:function createText(W){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref2$font=_ref2.font,X=_ref2$font===void 0?"16px arial":_ref2$font,_ref2$fillColor=_ref2.fillColor,B=_ref2$fillColor===void 0?null:_ref2$fillColor,_ref2$strokeColor=_ref2.strokeColor,N=_ref2$strokeColor===void 0?null:_ref2$strokeColor,_ref2$strokeWidth=_ref2.strokeWidth,$=_ref2$strokeWidth===void 0?1:_ref2$strokeWidth;if(this[O]){var J=y["default"].createText(W,{font:X,fillColor:B,strokeColor:N,strokeWidth:$});return{image:this.createTexture(J.image),rect:J.rect};}return{_img:{font:X,fillColor:B,strokeColor:N,strokeWidth:$,text:W}};}},{key:"createProgram",value:function createProgram(){var _ref3=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},W=_ref3.vertex,X=_ref3.fragment,B=_ref3.options;if(this[O]){var N=this[O].compileSync(X,W);return N._attribOpts=B,N;}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,W=_ref4$vertex===void 0?I:_ref4$vertex,_ref4$fragment=_ref4.fragment,X=_ref4$fragment===void 0?S:_ref4$fragment,B=_ref4.options;return this.createProgram({vertex:W,fragment:X,options:B});}},{key:"useProgram",value:function useProgram(W){var X=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[O]){var B=Object.assign({},W._attribOpts,X);return this[O].useProgram(W,B);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(W){return(this[O]||this[d]).deleteTexture(W);}},{key:"clear",value:function clear(){var _this$d;if(this[O]){var X=this[O].gl;X.clear(X.COLOR_BUFFER_BIT);}else(_this$d=this[d]).clear.apply(_this$d,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(W){var _ref5=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref5$clear=_ref5.clear,X=_ref5$clear===void 0?!1:_ref5$clear,_ref5$program=_ref5.program,B=_ref5$program===void 0?null:_ref5$program;var N=this[O]||this[d],$=B||W.program;if(this[O]){var J=N.gl;if(X&&J.clear(J.COLOR_BUFFER_BIT),$)N.program!==$&&this.useProgram($,{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 tt=W.mesh.meshData,at=!!tt.uniforms.u_texSampler,ut=!!tt.uniforms.u_filterFlag,V=!!tt.uniforms.u_radialGradientVector,Q=W.hasCloudColor,ft=W.hasCloudFilter,mt=!!tt.uniforms.u_clipSampler;Object(T.applyCloudShader)(N,{hasTexture:at,hasFilter:ut,hasGradient:V,hasCloudColor:Q,hasCloudFilter:ft,hasClipPath:mt});}this[x](),N.setMeshData([W.meshData]),W.beforeRender&&W.beforeRender(J,W),R(N),W.afterRender&&W.afterRender(J,W);}else N.setTransform(this.globalTransformMatrix),N.drawMeshCloud(W,{clear:X,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(W){var _this=this;var _ref6=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref6$clear=_ref6.clear,X=_ref6$clear===void 0?!1:_ref6$clear,_ref6$program=_ref6.program,B=_ref6$program===void 0?null:_ref6$program;var N=this[O]||this[d];if(this[O]){var $=N.fbo,J=Object(c["default"])(this,W,B==null),tt=N.gl;X&&tt.clear(tt.COLOR_BUFFER_BIT);var at=!Object(u.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator2=_createForOfIteratorHelper(J),_step2;try{var _loop=function _loop(){var ut=_step2.value;_this._drawCalls++;var V=B||ut.program;if(ut instanceof m["default"])_this.drawMeshCloud(ut,{clear:X,program:V});else{var _this$canvas3=_this.canvas,Q=_this$canvas3.width,ft=_this$canvas3.height;if(ut.beforeRender&&ut.beforeRender(tt,ut),ut.pass.length&&((!_this.fbo||_this.fbo.width!==Q||_this.fbo.height!==ft)&&(_this.fbo={width:Q,height:ft,target:N.createFBO(),buffer:N.createFBO(),swap:function swap(){var _ref7=[this.buffer,this.target];this.target=_ref7[0];this.buffer=_ref7[1];}}),N.bindFBO(_this.fbo.target)),!V&&ut.filterCanvas){Object(T.applyShader)(N,{hasTexture:!0});var mt=_this.filterContext;mt||(mt=y["default"].createCanvas(Q,ft).getContext("2d"),_this.filterContext=mt);var yt=W[ut.packIndex],wt=yt.filter,ht=W[ut.packIndex+1],Nt=W[ut.packIndex-1];(!Nt||!Nt.filterCanvas||Nt.filter!==wt)&&(!ht||!ht.filterCanvas||ht.filter!==wt)?(at?(mt.save(),Object(l.drawMesh2D)(yt,mt,!1),mt.restore(),Object(l.applyFilter)(mt,wt)):Object(l.drawMesh2D)(yt,mt,!0),_this[x](),D(N,mt,Q,ft)):(at&&mt.save(),Object(l.drawMesh2D)(yt,mt,!1),at&&mt.restore(),(!ht||!ht.filterCanvas||yt.filter!==ht.filter)&&(Object(l.applyFilter)(mt,wt),_this[x](),D(N,mt,Q,ft)));}else{if(V)N.program!==V&&_this.useProgram(V,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _mt=!!ut.uniforms.u_texSampler,_yt=!!ut.uniforms.u_filterFlag,_wt=!!ut.uniforms.u_radialGradientVector,_ht=!!ut.uniforms.u_clipSampler;Object(T.applyShader)(N,{hasTexture:_mt,hasFilter:_yt,hasGradient:_wt,hasClipPath:_ht});}ut.filterCanvas&&console.warn("User program ignored some filter effects."),_this[x](),N.setMeshData([ut]),R(N);}if(ut.pass.length){var _mt2=ut.pass.length;ut.pass.forEach(function(yt,wt){yt.blend=ut.enableBlend,yt.setTexture(N.fbo.texture),wt===_mt2-1?N.bindFBO($):(_this.fbo.swap(),N.bindFBO(_this.fbo.target)),yt.program?N.useProgram(yt.program):(_this.defaultPassProgram=_this.defaultPassProgram||_this.createPassProgram(),N.useProgram(_this.defaultPassProgram)),N.setMeshData([yt.meshData]),tt.clear(tt.COLOR_BUFFER_BIT),R(N);});}ut.afterRender&&ut.afterRender(tt,ut);}};for(_iterator2.s();!(_step2=_iterator2.n()).done;){_loop();}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}else N.setTransform(this.globalTransformMatrix),N.drawMeshes(W,{clear:X});}},{key:"drawImage",value:function drawImage(W){for(var _len=arguments.length,X=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){X[_key-1]=arguments[_key];}var B=X.length;if(B<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(X.length+1," present."));if(B!==2&&B!==4&&B!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat(X.length+1," arguments provided."));var N=null,$=null;B===2?N=[X[0],X[1],W.width,W.height]:B===4?N=X:B===8&&($=X.slice(0,4),N=X.slice(4));var J=this.createTexture(W),_this$canvas4=this.canvas,tt=_this$canvas4.width,at=_this$canvas4.height,ut=new f["default"]();ut.rect(N[0],N[1],tt,at);var V=new h["default"](ut,{width:tt,height:at});V.setTexture(J,{rect:N,srcRect:$}),this.drawMeshes([V]),this.deleteTexture(J);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[p]=[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 X=this[p];for(var _len2=arguments.length,W=new Array(_len2),_key2=0;_key2<_len2;_key2++){W[_key2]=arguments[_key2];}return this[p]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),X,W),this;}},{key:"globalTranslate",value:function globalTranslate(W,X){var B=n.mat3.create();return B=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),B,[W,X]),this.globalTransform.apply(this,_toConsumableArray(B));}},{key:"globalRotate",value:function globalRotate(W){var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref9=_slicedToArray(_ref8,2),X=_ref9[0],B=_ref9[1];var N=n.mat3.create();return N=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),N,[X,B]),N=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),N,W),N=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),N,[-X,-B]),this.globalTransform.apply(this,_toConsumableArray(N));}},{key:"globalScale",value:function globalScale(W){var X=arguments.length>1&&arguments[1]!==undefined?arguments[1]:W;var _ref10=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref11=_slicedToArray(_ref10,2),B=_ref11[0],N=_ref11[1];var $=n.mat3.create();return $=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),$,[B,N]),$=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),$,[W,X]),$=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),$,[-B,-N]),this.globalTransform.apply(this,_toConsumableArray($));}},{key:"globalSkew",value:function globalSkew(W){var X=arguments.length>1&&arguments[1]!==undefined?arguments[1]:W;var _ref12=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref13=_slicedToArray(_ref12,2),B=_ref13[0],N=_ref13[1];var $=n.mat3.create();return $=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),$,[B,N]),$=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),$,n.mat3.fromValues(1,Math.tan(X),Math.tan(W),1,0,0)),$=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),$,[-B,-N]),this.globalTransform.apply(this,_toConsumableArray($));}},{key:"transformPoint",value:function transformPoint(W,X,B){var N=this.globalTransformMatrix;B&&(N=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),N,B));var $=W*N[0]+X*N[2]+N[4],J=W*N[1]+X*N[3]+N[5];return[$,J];}}]);}();},/* 14 *//***/function(i,e,t){t.r(e);var r=t(15);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r["default"];},/* 15 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return T;});var r=t(16),n=t(17),s=t(18),c=t(19);t(1).glMatrix.setMatrixArrayType(Array);function l(w,I,S){return I in w?Object.defineProperty(w,I,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[I]=S,w;}var f={};function h(w){var I=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var S=[],O=w.length;for(var d=0;d<O;d++)d%I<2&&S.push(0.5*(w[d]+1));return S;}function m(w,I){var S=I._buffers;Object.values(S).forEach(function(O){w.deleteBuffer(O);}),I._buffers={};}function u(w,I,S){return w.activeTexture(w.TEXTURE0+S),Array.isArray(I._img)?w.bindTexture(w.TEXTURE_CUBE_MAP,I):w.bindTexture(w.TEXTURE_2D,I),I;}var y={"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 T=/*#__PURE__*/function(){function T(I){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,T);this.options=Object.assign({},T.defaultOptions,S),this.canvas=I;var O;this.options.webgl2&&(O=I.getContext("webgl2",this.options)),O==null&&(O=Object(r.setupWebGL)(I,this.options),this.aia_ext=O.getExtension("ANGLE_instanced_arrays")),this.gl=O,O.viewport(0,0,I.width,I.height),O.clearColor(0,0,0,0),O.blendFuncSeparate(O.SRC_ALPHA,O.ONE_MINUS_SRC_ALPHA,O.ONE,O.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(T,[{key:"program",get:function get(){var I=this.gl;return I.getParameter(I.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
|
|
7
|
+
// WebGLRenderingContext.uniformMatrix[234]fv()
|
|
8
|
+
},{key:"_declareUniform",value:function _declareUniform(I,S){var O=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var d=this.gl,v=d.getUniformLocation(I,S);var p;var x=this;if(/^sampler/.test(O)){var E=I._samplerMap,R=I._bindTextures;Object.defineProperty(I.uniforms,S,{get:function get(){return p;},set:function set(D){p=D;var U=E[S]!=null?E[S]:R.length;R[U]=D,u(d,D,U),E[S]||(E[S]=U,d.uniform1i(v,U)),x.options.autoUpdate&&x.update();},configurable:!1,enumerable:!0});}else{var _E2=O.indexOf("Matrix")===0,_R=!_E2&&/v$/.test(O),D=d["uniform".concat(O)].bind(d);Object.defineProperty(I.uniforms,S,{get:function get(){return p;},set:function set(U){p=U,typeof U=="number"&&(U=[U]),_E2?D(v,!1,U):_R?D(v,U):D.apply(void 0,[v].concat(_toConsumableArray(U))),x.options.autoUpdate&&x.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this2=this;var I=this.program;I.meshData.forEach(function(S,O){var d=S.positions,v=S.cells,p=S.instanceCount,x=S.cellsCount,E=S.attributes,R=S.uniforms,D=S.textureCoord,U=S.enableBlend,M=_this2.gl;var W=S.mode!=null?S.mode:M.TRIANGLES;typeof W=="string"&&(W=M[W]),U?M.enable(M.BLEND):M.disable(M.BLEND),M.bindBuffer(M.ARRAY_BUFFER,I._buffers.verticesBuffer),M.bufferData(M.ARRAY_BUFFER,d,M.STATIC_DRAW),v&&(M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,I._buffers.cellsBuffer),M.bufferData(M.ELEMENT_ARRAY_BUFFER,v,M.STATIC_DRAW));var X=[];E&&Object.values(E).forEach(function(_ref14){var N=_ref14.name,$=_ref14.data,J=_ref14.divisor;if(M.bindBuffer(M.ARRAY_BUFFER,I._buffers[N]),M.bufferData(M.ARRAY_BUFFER,$,M.STATIC_DRAW),J!=null){var tt=M.getAttribLocation(I,N);tt>=0&&(M.enableVertexAttribArray(tt),X.push(tt),M.vertexAttribDivisor?M.vertexAttribDivisor(tt,J):_this2.aia_ext&&_this2.aia_ext.vertexAttribDivisorANGLE(tt,J));}}),R&&Object.entries(R).forEach(function(_ref15){var _ref16=_slicedToArray(_ref15,2),N=_ref16[0],$=_ref16[1];_this2.uniforms[N]=$;});var B;if(!v){var N=I._dimension;B=d.length/N;}if(I._enableTextures&&I._buffers.texCoordBuffer){var _N2=D||h(d,I._dimension);M.bindBuffer(M.ARRAY_BUFFER,I._buffers.texCoordBuffer),M.bufferData(M.ARRAY_BUFFER,T.FLOAT(_N2),M.STATIC_DRAW);}p!=null?(v?M.drawElementsInstanced?M.drawElementsInstanced(W,x,M.UNSIGNED_SHORT,0,p):_this2.aia_ext&&_this2.aia_ext.drawElementsInstancedANGLE(W,x,M.UNSIGNED_SHORT,0,p):M.drawArraysInstanced?M.drawArraysInstanced(W,0,B,p):_this2.aia_ext.drawArraysInstancedANGLE(W,0,B,p),X.forEach(function(N){M.vertexAttribDivisor?M.vertexAttribDivisor(N,null):_this2.aia_ext&&_this2.aia_ext.vertexAttribDivisorANGLE(N,null);})):v?M.drawElements(W,x,M.UNSIGNED_SHORT,0):M.drawArrays(W,0,B);});}},{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 I=this.program;if(!I||!I.uniforms)throw Error("No avaliable program.");return I.uniforms;}},{key:"deleteProgram",value:function deleteProgram(I){var S=this.gl;this.program===I&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),S.useProgram(null));var O=this.programs.indexOf(I);O>=0&&this.programs.splice(O,1),m(S,I),S.deleteProgram(I);}/**
|
|
9
|
+
[{
|
|
10
|
+
positions: ...
|
|
11
|
+
cells: ...
|
|
12
|
+
textureCoord: ...
|
|
13
|
+
attributes: {name: {data:..., normalize: true}},
|
|
14
|
+
uniforms: ...
|
|
15
|
+
}]
|
|
16
|
+
*/},{key:"setMeshData",value:function setMeshData(I){var _this3=this;Array.isArray(I)||(I=[I]);var S=this.program;S.meshData=I.map(function(_ref17){var O=_ref17.mode,d=_ref17.positions,v=_ref17.instanceCount,p=_ref17.cells,x=_ref17.cellsCount,E=_ref17.attributes,R=_ref17.uniforms,D=_ref17.textureCoord,U=_ref17.enableBlend;var M={positions:T.FLOAT(d),uniforms:R,enableBlend:!!U,textureCoord:T.FLOAT(D)};if(p&&(M.cells=T.USHORT(p),M.cellsCount=x||M.cells.length),O!=null&&(M.mode=O),v!=null){if(!_this3.isWebGL2&&!_this3.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");M.instanceCount=v;}if(E){var W={};Object.entries(E).forEach(function(_ref18){var _ref19=_slicedToArray(_ref18,2),X=_ref19[0],B=_ref19[1];if(!S._attribute[X])S._attribute[X]="ignored";else if(S._attribute[X]!=="ignored"){var _S$_attribute$X=S._attribute[X],N=_S$_attribute$X.name,$=_S$_attribute$X.type;var J=B.data||B;if(Array.isArray(J)&&(J=T[$](J)),W[X]={name:N,data:J},B.divisor!=null){if(!_this3.isWebGL2&&!_this3.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");W[X].divisor=B.divisor;}}}),M.attributes=W;}return M;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(I,S){var _this4=this;var O=/^\s*uniform\s+sampler/mg.test(I);I==null&&(I=s["default"]),S==null&&(S=O?c["default"]:n["default"]);var d=this.gl,v=Object(r.createProgram)(d,S,I);v.shaderText={vertexShader:S,fragmentShader:I},v._buffers={},v._attribute={},v.uniforms={},v._samplerMap={},v._bindTextures=[];var p=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var x=S.match(p);x&&(v._dimension=Number(x[1]));var E=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");x=S.match(E),x&&(v._texCoordSize=Number(x[1]));var R=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(x=S.match(R),x)for(var M=0;M<x.length;M++){var W=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,X=x[M].match(W);if(X&&X[3]!==this.options.vertexPosition&&X[3]!==this.options.vertexTextureCoord){var _X=_slicedToArray(X,4),B=_X[1],N=_X[2],$=_X[3];B==="mat"&&(N=Math.pow(N,2)),v._buffers[$]=d.createBuffer(),v._attribute[$]={name:$,type:B,size:Number(N)||1};}}var D=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;x=S.match(D)||[],x=x.concat(I.match(D)||[]),x.forEach(function(M){var W=M.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _W$slice=W.slice(1),_W$slice2=_slicedToArray(_W$slice,3),X=_W$slice2[0],B=_W$slice2[1],N=_W$slice2[2];X=y[X],N=!!N,X.indexOf("Matrix")!==0&&N&&(X+="v"),_this4._declareUniform(v,B,X);}),v._buffers.verticesBuffer=d.createBuffer(),v._buffers.cellsBuffer=d.createBuffer();var U=d.getAttribLocation(v,this.options.vertexTextureCoord);return v._enableTextures=U>=0,v._enableTextures&&(v._buffers.texCoordBuffer=d.createBuffer()),this.programs.push(v),v;}},{key:"useProgram",value:function useProgram(I){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var O=this.gl;O.useProgram(I);var d=I._dimension;O.bindBuffer(O.ARRAY_BUFFER,I._buffers.verticesBuffer);var v=O.getAttribLocation(I,this.options.vertexPosition);if(O.vertexAttribPointer(v,d,O.FLOAT,!1,0,0),O.enableVertexAttribArray(v),I._enableTextures){O.bindBuffer(O.ARRAY_BUFFER,I._buffers.texCoordBuffer);var p=O.getAttribLocation(I,this.options.vertexTextureCoord);O.vertexAttribPointer(p,I._texCoordSize||2,O.FLOAT,!1,0,0),O.enableVertexAttribArray(p);}if(Object.entries(I._attribute).forEach(function(_ref20){var _ref21=_slicedToArray(_ref20,2),p=_ref21[0],x=_ref21[1];if(x!=="ignored"){var E=x.size,R=S[p]||{},D=!!R.normalize;var U=R.type||"FLOAT";var M=R.key||p;U==="UBYTE"&&(U="UNSIGNED_BYTE"),U==="USHORT"&&(U="UNSIGNED_SHORT"),x.type=U,M&&M!==p&&(I._attribute[M]=x),O.bindBuffer(O.ARRAY_BUFFER,I._buffers[p]);var W=O.getAttribLocation(I,p);W>=0&&(O.vertexAttribPointer(W,E,O[U],D,0,0),O.enableVertexAttribArray(W));}}),!I.meshData){var _p2=[[-1,-1,0,1].slice(0,d),[1,-1,0,1].slice(0,d),[1,1,0,1].slice(0,d),[-1,1,0,1].slice(0,d)],x=[[0,1,3],[3,1,2]];this.setMeshData({positions:_p2,cells:x});}return I;}},{key:"compileSync",value:function compileSync(I,S){I=I||s["default"];var O={};function d(E){E=E.replace(/^\s*/mg,"");var R=[],D=E.match(/^#pragma\s+include\s+.*/mg);if(D){for(var U=0;U<D.length;U++){var W=D[U].match(/(?:<|")(.*)(?:>|")/);if(W){var X=W[0].indexOf("<")===0?"lib":"link";var B=W[1];if(B==="graph"&&(B="graphics"),O[B])R.push("/* included ".concat(B," */"));else if(O[B]=!0,X==="lib"){var N=d(f[B]);R.push(N);}else if(X==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}R.forEach(function(U){E=E.replace(/^#pragma\s+include\s+.*/m,U);});}return E;}var v=d(I),p=S?d(S):null;return this.createProgram(v,p);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(I,S){var O,d,_d2,v,p;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_d2=function _d4(){_d2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(E){var R,D,U,W,X,B,N,_N3;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:E=E.replace(/^\s*/mg,"");R=[],D=E.match(/^#pragma\s+include\s+.*/mg);if(!D){_context.next=32;break;}U=0;case 4:if(!(U<D.length)){_context.next=31;break;}W=D[U].match(/(?:<|")(.*)(?:>|")/);if(!W){_context.next=28;break;}X=W[0].indexOf("<")===0?"lib":"link";B=W[1];if(!(B==="graph"&&(B="graphics"),O[B])){_context.next=13;break;}R.push("/* included ".concat(B," */"));_context.next=28;break;case 13:if(!(O[B]=!0,X==="lib")){_context.next=20;break;}_context.next=16;return d(f[B]);case 16:N=_context.sent;R.push(N);_context.next=28;break;case 20:if(!(X==="link")){_context.next=28;break;}_context.next=23;return T.fetchShader(B);case 23:_N3=_context.sent;_context.next=26;return d(_N3);case 26:_N3=_context.sent;R.push(_N3);case 28:U++;_context.next=4;break;case 31:R.forEach(function(U){E=E.replace(/^#pragma\s+include\s+.*/m,U);});case 32:return _context.abrupt("return",E);case 33:case"end":return _context.stop();}},_callee);}));return _d2.apply(this,arguments);};d=function _d3(_x4){return _d2.apply(this,arguments);};I=I||s["default"];O={};_context2.next=6;return d(I);case 6:v=_context2.sent;if(!S){_context2.next=13;break;}_context2.next=10;return d(S);case 10:_context2.t0=_context2.sent;_context2.next=14;break;case 13:_context2.t0=null;case 14:p=_context2.t0;return _context2.abrupt("return",this.createProgram(v,p));case 16:case"end":return _context2.stop();}},_callee2,this);}));function compile(_x2,_x3){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(I){var S,_args3=arguments;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:S=_args3.length>1&&_args3[1]!==undefined?_args3[1]:null;_context3.next=3;return T.fetchShader(I);case 3:I=_context3.sent;_context3.t0=S;if(!_context3.t0){_context3.next=9;break;}_context3.next=8;return T.fetchShader(S);case 8:S=_context3.sent;case 9:return _context3.abrupt("return",this.compile(I,S));case 10:case"end":return _context3.stop();}},_callee3,this);}));function load(_x5){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this5=this;var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref22=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref22$wrapS=_ref22.wrapS,S=_ref22$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref22$wrapS,_ref22$wrapT=_ref22.wrapT,O=_ref22$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref22$wrapT,_ref22$minFilter=_ref22.minFilter,d=_ref22$minFilter===void 0?this.gl.LINEAR:_ref22$minFilter,_ref22$magFilter=_ref22.magFilter,v=_ref22$magFilter===void 0?this.gl.LINEAR:_ref22$magFilter;var p=this.gl,x=Array.isArray(I)?p.TEXTURE_CUBE_MAP:p.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||p.getParameter(p.MAX_COMBINED_TEXTURE_IMAGE_UNITS),p.activeTexture(p.TEXTURE0+this._max_texture_image_units-1);var E=p.createTexture();p.bindTexture(x,E),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas5=this.canvas,R=_this$canvas5.width,D=_this$canvas5.height;if(I){if(x===p.TEXTURE_CUBE_MAP)for(var U=0;U<6;U++)p.texImage2D(p.TEXTURE_CUBE_MAP_POSITIVE_X+U,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,I[U]);else p.texImage2D(x,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,I);}else if(x===p.TEXTURE_CUBE_MAP)for(var _U=0;_U<6;_U++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_U,0,p.RGBA,R,D,0,p.RGBA,p.UNSIGNED_BYTE,null);else p.texImage2D(x,0,p.RGBA,R,D,0,p.RGBA,p.UNSIGNED_BYTE,null);return p.texParameteri(x,p.TEXTURE_MIN_FILTER,d),p.texParameteri(x,p.TEXTURE_MAG_FILTER,v),p.texParameteri(x,p.TEXTURE_WRAP_S,S),p.texParameteri(x,p.TEXTURE_WRAP_T,O),x===p.TEXTURE_CUBE_MAP&&(I.width=I[0].width,I.height=I[0].height),p.bindTexture(x,null),E._img=I||{width:R,height:D},E["delete"]=function(){_this5.deleteTexture(E);},E;}},{key:"deleteTexture",value:function deleteTexture(I){var S=I._img;this.gl.deleteTexture(I),typeof S.close=="function"&&S.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(I){var _ref23,_ref23$useImageBitmap,S,O,_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,S=_ref23$useImageBitmap===void 0?!0:_ref23$useImageBitmap;_context4.next=3;return T.loadImage(I,{useImageBitmap:S});case 3:O=_context4.sent;return _context4.abrupt("return",this.createTexture(O));case 5:case"end":return _context4.stop();}},_callee4,this);}));function loadTexture(_x6){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,I=_ref24$color===void 0?1:_ref24$color,_ref24$blend=_ref24.blend,S=_ref24$blend===void 0?!1:_ref24$blend,_ref24$depth=_ref24.depth,O=_ref24$depth===void 0?this.options.depth!==!1:_ref24$depth,_ref24$stencil=_ref24.stencil,d=_ref24$stencil===void 0?!!this.options.stencil:_ref24$stencil;var v=this.gl,p=v.createFramebuffer();v.bindFramebuffer(v.FRAMEBUFFER,p);var x=[];for(var D=0;D<I;D++){var U=this.createTexture();v.framebufferTexture2D(v.FRAMEBUFFER,v.COLOR_ATTACHMENT0+D,v.TEXTURE_2D,U,0/* level */),x.push(U);}p.textures=x,p.texture=x[0],p.blend=S;var _this$canvas6=this.canvas,E=_this$canvas6.width,R=_this$canvas6.height;return O&&!d&&(p.depthBuffer=v.createRenderbuffer(),v.bindRenderbuffer(v.RENDERBUFFER,p.depthBuffer),v.renderbufferStorage(v.RENDERBUFFER,v.DEPTH_COMPONENT16,E,R),v.framebufferRenderbuffer(v.FRAMEBUFFER,v.DEPTH_ATTACHMENT,v.RENDERBUFFER,p.depthBuffer)),d&&!O&&(p.stencilBuffer=v.createRenderbuffer(),v.bindRenderbuffer(v.RENDERBUFFER,p.stencilBuffer),v.renderbufferStorage(v.RENDERBUFFER,v.STENCIL_INDEX8,E,R),v.framebufferRenderbuffer(v.FRAMEBUFFER,v.STENCIL_ATTACHMENT,v.RENDERBUFFER,p.stencilBuffer)),O&&d&&(p.depthStencilBuffer=v.createRenderbuffer(),v.bindRenderbuffer(v.RENDERBUFFER,p.depthStencilBuffer),v.renderbufferStorage(v.RENDERBUFFER,v.DEPTH_STENCIL,E,R),v.framebufferRenderbuffer(v.FRAMEBUFFER,v.DEPTH_STENCIL_ATTACHMENT,v.RENDERBUFFER,p.depthStencilBuffer)),v.bindFramebuffer(v.FRAMEBUFFER,null),p;}},{key:"bindFBO",value:function bindFBO(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=I;}},{key:"render",value:function render(){var _ref25=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref25$clearBuffer=_ref25.clearBuffer,I=_ref25$clearBuffer===void 0?!0:_ref25$clearBuffer;this.startRender=!0;var S=this.gl;var O=this.program;O||(O=this.createProgram(),this.useProgram(O)),this.fbo&&S.bindFramebuffer(S.FRAMEBUFFER,this.fbo);var d=this.options.depth;d&&S.enable(S.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(d?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var v=this._renderFrameID;this._draw(),this.fbo&&S.bindFramebuffer(S.FRAMEBUFFER,null),this._renderFrameID===v&&(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 I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(f,I);}},{key:"FLOAT",value:function FLOAT(I,S){return Object(r.pointsToBuffer)(I,Float32Array,S);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(I,S){return Object(r.pointsToBuffer)(I,Uint8Array,S);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(I,S){return Object(r.pointsToBuffer)(I,Uint16Array,S);}},{key:"BYTE",value:function BYTE(I,S){return Object(r.pointsToBuffer)(I,Int8Array,S);}},{key:"SHORT",value:function SHORT(I,S){return Object(r.pointsToBuffer)(I,Int16Array,S);}}]);}();l(T,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),l(T,"UBYTE",T.UNSIGNED_BYTE),l(T,"USHORT",T.UNSIGNED_SHORT),l(T,"fetchShader",r.fetchShader),l(T,"loadImage",r.loadImage);},/* 16 *//***/function(i,e,t){t.r(e),t.d(e,"setupWebGL",function(){return n;}),t.d(e,"createProgram",function(){return s;}),t.d(e,"pointsToBuffer",function(){return c;}),t.d(e,"loadImage",function(){return f;}),t.d(e,"fetchShader",function(){return m;}),t(1).glMatrix.setMatrixArrayType(Array);function r(u,y){var T=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var w=null;for(var I=0;I<T.length;++I){try{w=u.getContext(T[I],y);}catch(_unused){}if(w)break;}return w;}function n(u,y){var T=r(u,y);if(!T)throw new Error("Sorry, your browser doesn't support WebGL.");return T;}function s(u,y,T){var w=u.createShader(u.VERTEX_SHADER);if(u.shaderSource(w,y),u.compileShader(w),!u.getShaderParameter(w,u.COMPILE_STATUS)){var _O2="Vertex shader failed to compile. The error log is:".concat(u.getShaderInfoLog(w));throw new Error(_O2);}var I=u.createShader(u.FRAGMENT_SHADER);if(u.shaderSource(I,T),u.compileShader(I),!u.getShaderParameter(I,u.COMPILE_STATUS)){var _O3="Fragment shader failed to compile. The error log is:".concat(u.getShaderInfoLog(I));throw new Error(_O3);}var S=u.createProgram();if(u.attachShader(S,w),u.attachShader(S,I),u.linkProgram(S),!u.getProgramParameter(S,u.LINK_STATUS)){var _O4="Shader program failed to link. The error log is:".concat(u.getProgramInfoLog(S));throw new Error(_O4);}return u.deleteShader(w),u.deleteShader(I),S;}function c(u){var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(T&&!(T instanceof y))throw new TypeError("Wrong buffer type.");if(u==null||u instanceof y)return u;if(u[0]==null||u[0].length==null)return T?(T.set(u,0),T):new y(u);var w=u[0].length,I=u.length;T||(T=new y(w*I));var S=0;for(var _O5=0;_O5<I;_O5++)for(var _d5=0;_d5<w;_d5++)T[S++]=u[_O5][_d5];return T;}var l={};function f(u){var _ref26=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref26$useImageBitmap=_ref26.useImageBitmap,y=_ref26$useImageBitmap===void 0?!0:_ref26$useImageBitmap,_ref26$alias=_ref26.alias,T=_ref26$alias===void 0?null:_ref26$alias;if(!l[u]){if(typeof Image=="function"){var w=new Image();typeof u=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(u)&&(w.crossOrigin="anonymous"),l[u]=new Promise(function(I){w.onload=function(){y&&typeof createImageBitmap=="function"?createImageBitmap(w,{imageOrientation:"flipY"}).then(function(S){l[u]=S,T&&(l[T]=S),I(S);}):(l[u]=w,T&&(l[T]=w),I(w));},w.src=u;}),T&&(l[T]=l[u]);}else if(typeof fetch=="function")return fetch(u,{method:"GET",mode:"cors",cache:"default"}).then(function(w){return w.blob();}).then(function(w){return createImageBitmap(w,{imageOrientation:"flipY"}).then(function(I){return l[u]=I,T&&(l[T]=I),I;});});}return l[u];}var h={};function m(_x7){return _m2.apply(this,arguments);}function _m2(){_m2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(u){var y,T;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!h[u]){_context5.next=2;break;}return _context5.abrupt("return",h[u]);case 2:_context5.next=4;return fetch(u);case 4:y=_context5.sent;if(!(y.status>=200&&y.status<300)){_context5.next=10;break;}_context5.next=8;return y.text();case 8:T=_context5.sent;return _context5.abrupt("return",(h[u]=T,T));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context5.stop();}},_callee5);}));return _m2.apply(this,arguments);}},/* 17 *//***/function(i,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(i,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(i,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(i,e,t){t.r(e),t.d(e,"default",function(){return c;});var r=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol("transform");var c=/*#__PURE__*/function(){function c(f,h){_classCallCheck(this,c);this.context=f.getContext("2d"),this.options=h,this[s]=[1,0,0,1,0,0];}return _createClass(c,[{key:"createTexture",value:function createTexture(f){return{_img:f};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(f){var h;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return r["default"].loadImage(f,{useImageBitmap:!1});case 2:h=_context6.sent;return _context6.abrupt("return",this.createTexture(h));case 4:case"end":return _context6.stop();}},_callee6,this);}));function loadTexture(_x8){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(f){return f;}},{key:"clear",value:function clear(f,h,m,u){var y=this.context;f=f||0,h=h||0,m=m||y.canvas.width-f,u=u||y.canvas.height-h,y.clearRect(f,h,m,u);}},{key:"drawMeshCloud",value:function drawMeshCloud(f){var _ref27=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref27$clear=_ref27.clear,h=_ref27$clear===void 0?!1:_ref27$clear;var m=[];for(var u=0;u<f.amount;u++){var y=f.getTransform(u);var T=f.getTextureFrame(u);T&&(T=T._img);var w=f.getFilter(u),_f$getCloudRGBA=f.getCloudRGBA(u),I=_f$getCloudRGBA.fill,S=_f$getCloudRGBA.stroke;m.push({mesh:f.mesh,_cloudOptions:[I,S,T,y,w]});}f.beforeRender&&f.beforeRender(this.context,f),this.drawMeshes(m,{clear:h,hook:!1}),f.afterRender&&f.afterRender(this.context,f);}},{key:"drawMeshes",value:function drawMeshes(f){var _this6=this;var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$clear=_ref28.clear,h=_ref28$clear===void 0?!1:_ref28$clear,_ref28$hook=_ref28.hook,m=_ref28$hook===void 0?!0:_ref28$hook;var u=this.context;h&&u.clearRect(0,0,u.canvas.width,u.canvas.height);var y=null;var _u$canvas=u.canvas,T=_u$canvas.width,w=_u$canvas.height,I=f.length;f.forEach(function(S,O){var _S$_cloudOptions,_this6$filterBuffer;var d,v,p,x,E;m&&S.beforeRender&&S.beforeRender(u,S),S._cloudOptions&&(_S$_cloudOptions=_slicedToArray(S._cloudOptions,5),d=_S$_cloudOptions[0],v=_S$_cloudOptions[1],p=_S$_cloudOptions[2],x=_S$_cloudOptions[3],E=_S$_cloudOptions[4],S=S.mesh);var R=S.filter;if(E&&(R=R?"".concat(R," ").concat(E):E),R&&!_this6.filterBuffer&&_this6.filterBuffer!==!1){var D=r["default"].createCanvas(T,w);D?_this6.filterBuffer=D.getContext("2d"):_this6.filterBuffer=!1;}y&&y!==R&&(Object(n.applyFilter)(_this6.filterBuffer,y),u.drawImage(_this6.filterBuffer.canvas,0,0,T,w),_this6.filterBuffer.clearRect(0,0,T,w),y=null),R&&_this6.filterBuffer?(_this6.filterBuffer.save(),(_this6$filterBuffer=_this6.filterBuffer).transform.apply(_this6$filterBuffer,_toConsumableArray(_this6[s])),Object(n.drawMesh2D)(S,_this6.filterBuffer,!1,d,v,p,x),_this6.filterBuffer.restore(),O===I-1?(Object(n.applyFilter)(_this6.filterBuffer,R),u.drawImage(_this6.filterBuffer.canvas,0,0,T,w),_this6.filterBuffer.clearRect(0,0,T,w)):y=R):(u.save(),u.transform.apply(u,_toConsumableArray(_this6[s])),Object(n.drawMesh2D)(S,u,!1,d,v,p,x),u.restore()),m&&S.afterRender&&S.afterRender(u,S);});}},{key:"setTransform",value:function setTransform(f){this[s]=f;}}]);}();},/* 21 *//***/function(i,e,t){t.r(e),function(r){var n=t(14),s=t(23),c=t(24);t(1).glMatrix.setMatrixArrayType(Array);var l={};function f(T,w){var I=T.style,S=T.variant,O=T.weight,d=T.stretch,v=T.size,p=T.pxLineHeight,x=T.family;return d==="normal"?"".concat(I," ").concat(S," ").concat(O," ").concat(v*w,"px/").concat(p*w,"px ").concat(x):"".concat(I," ").concat(S," ").concat(O," ").concat(d," ").concat(v*w,"px/").concat(p*w,"px ").concat(x);}function h(T,_ref29){var w=_ref29.font,I=_ref29.fillColor,S=_ref29.strokeColor,O=_ref29.strokeWidth,_ref29$ratio=_ref29.ratio,d=_ref29$ratio===void 0?1:_ref29$ratio,v=_ref29.textCanvas,_ref29$cachable=_ref29.cachable,p=_ref29$cachable===void 0?!1:_ref29$cachable;var x;if(p){x=[T,w,String(I),String(S),String(O)].join("###");var J=l[x];if(J)return J;}v||(v=u(1,1));var E=v.getContext("2d");E.save(),E.font=w;var _E$measureText=E.measureText(T),R=_E$measureText.width;E.restore();var D=Object(s["default"])(w),U=Math.max(D.pxLineHeight,D.pxHeight*1.13);/italic|oblique/.test(w)&&(R+=U*Math.tan(15*Math.PI/180)),!I&&!S&&(I="#000");var M=E.canvas,W=Math.ceil(R),X=Math.ceil(U);M.width=Math.round(W*d),M.height=Math.round(X*d),E.save(),E.font=f(D,d),E.textAlign="center",E.textBaseline="middle";var B=M.height*0.5+D.pxHeight*0.05*d,N=M.width*0.5;if(I){if(Array.isArray(I))I=Object(c["default"])(I);else if(I.vector){var _J;var _I2=I,tt=_I2.vector,at=_I2.colors;tt.length===6?_J=E.createRadialGradient.apply(E,_toConsumableArray(tt)):_J=E.createLinearGradient.apply(E,_toConsumableArray(tt)),at.forEach(function(_ref30){var ut=_ref30.offset,V=_ref30.color;_J.addColorStop(ut,V);}),I=_J;}E.fillStyle=I,E.fillText(T,N,B);}if(S){if(E.lineWidth=O*d,Array.isArray(S))S=Object(c["default"])(S);else if(S.vector){var _J2;var _S2=S,_tt=_S2.vector,_at=_S2.colors;_tt.length===6?_J2=E.createRadialGradient.apply(E,_toConsumableArray(_tt)):_J2=E.createLinearGradient.apply(E,_toConsumableArray(_tt)),_at.forEach(function(_ref31){var ut=_ref31.offset,V=_ref31.color;_J2.addColorStop(ut,V);}),S=_J2;}E.strokeStyle=S,E.strokeText(T,N,B);}E.restore();var $={image:v,rect:[0,0,W,X]};return p&&(l[x]=$),$;}var m=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var T=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);T&&(m=Number(T[1])<70);}function u(T,w){var I=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var S=I.offscreen||!m&&I.offscreen!==!1;var O;return _typeof(r)<"u"&&typeof r.createCanvas=="function"?O=r.createCanvas(T,w,I):S&&typeof OffscreenCanvas=="function"?O=new OffscreenCanvas(T,w):(O=document.createElement("canvas"),O.width=T,O.height=w),O;}var y={createCanvas:u,createText:h,loadImage:n["default"].loadImage};e["default"]=y;}.call(this,t(22));},/* 22 *//***/function(i,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);}i.exports=t;},/* 23 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return I;}),t(1).glMatrix.setMatrixArrayType(Array);function r(S,O){if(typeof S=="string"){var p=S.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);p?S={size:parseFloat(p[1]),unit:p[2]}:S={size:parseInt(S,10),unit:"px"};}var _S3=S,d=_S3.size,v=_S3.unit;if(v==="pt")d/=0.75;else if(v==="pc")d*=16;else if(v==="in")d*=96;else if(v==="cm")d*=37.79527559055118;else if(v==="mm")d*=3.7795275590551185;else if(v==="em"||v==="rem"||v==="ex"){if(!O&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _p3=getComputedStyle(document.documentElement).fontSize;O=r(_p3,16);}d*=O,v==="ex"&&(d/=2);}else if(v==="q")d*=0.9448818897637796;else if(v==="vw"||v==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _p4=v==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;d*=_p4/100;}}else if((v==="vmax"||v==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _p5=document.documentElement.clientWidth,x=document.documentElement.clientHeight;v==="vmax"?d*=Math.max(_p5,x)/100:d*=Math.min(_p5,x)/100;}return d;}var n="bold|bolder|lighter|[1-9]00",s="italic|oblique",c="small-caps",l="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",f="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",h="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",m=new RegExp("(".concat(n,") +"),"i"),u=new RegExp("(".concat(s,") +"),"i"),y=new RegExp("(".concat(c,") +"),"i"),T=new RegExp("(".concat(l,") +"),"i"),w=new RegExp("([\\d\\.]+)("+f+")(?:\\/([\\d\\.]+)("+f+"))? *((?:"+h+")( *, *(?:"+h+"))*)");function I(S,O){var d=w.exec(S);if(!d)return;var v=parseFloat(d[3]),p={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(d[1]),unit:d[2],lineHeight:Number.isFinite(v)?v:void 0,lineHeightUnit:d[4],family:d[5].replace(/ *, */g,",")},x=S.substring(0,d.index),E=m.exec(x),R=u.exec(x),D=y.exec(x),U=T.exec(x);return E&&(p.weight=E[1]),R&&(p.style=R[1]),D&&(p.variant=D[1]),U&&(p.stretch=U[1]),p.pxHeight=r({size:p.size,unit:p.unit},O),p.pxLineHeight=r({size:p.lineHeight||p.size,unit:p.lineHeightUnit||p.unit},O),p;}},/* 24 *//***/function(i,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(s,c){return c<3?Math.round(s*255):s;}).join(),")");}},/* 25 *//***/function(i,e,t){t.r(e),t.d(e,"applyFilter",function(){return l;}),t.d(e,"drawMesh2D",function(){return h;});var r=t(1),n=t(24),s=t(23),c=t(26);t(1).glMatrix.setMatrixArrayType(Array);function l(m,u){var y=m.canvas;m.save(),m.filter=u,m.drawImage(y,0,0,y.width,y.height),m.restore();}function f(m,u){var y=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;m=m.match(y).slice(1,5).map(Number),u=u.match(y).slice(1,5).map(Number);var T=[],w=u[3];for(var I=0;I<4;I++)T[I]=Object(c.mix)(m[I],u[I],w);return"rgba(".concat(T.join(),")");}function h(m,u){var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var T=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var w=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var I=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var S=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;u.save();var O=!1,d=!1;if(u.globalAlpha=m.getOpacity(),m._updateMatrix&&m.transformScale/m.contours.scale>1.5&&m.accurate(m.transformScale),m.lineWidth){var x=m.gradient&&m.gradient.stroke;if(x){var _x9=x,E=_x9.vector,R=_x9.colors;if(E.length===6)x=u.createRadialGradient.apply(u,_toConsumableArray(E));else if(E.length===4)x=u.createLinearGradient.apply(u,_toConsumableArray(E));else if(E.length===3)x=u.createCircularGradient.apply(u,_toConsumableArray(E));else throw new TypeError("Invalid vector dimension.");R.forEach(function(_ref32){var D=_ref32.offset,U=_ref32.color;var M=Object(n["default"])(U);w&&(M=f(M,w)),x.addColorStop(D,M);}),u.strokeStyle=x,O=!0;}else m.strokeStyle&&(w?u.strokeStyle=f(m.strokeStyle,w):u.strokeStyle=m.strokeStyle,O=!0);}O&&(u.lineWidth=m.lineWidth,u.lineJoin=m.lineJoin,u.lineCap=m.lineCap,u.miterLimit=m.miterLimit,m.lineDash&&(u.setLineDash(m.lineDash),m.lineDashOffset&&(u.lineDashOffset=m.lineDashOffset)));var v=m.gradient&&m.gradient.fill;if(v){var _v2=v,_x10=_v2.vector,_E3=_v2.colors;if(_x10.length===6)v=u.createRadialGradient.apply(u,_toConsumableArray(_x10));else if(_x10.length===4)v=u.createLinearGradient.apply(u,_toConsumableArray(_x10));else if(_x10.length===3)v=u.createCircularGradient.apply(u,_toConsumableArray(_x10));else throw new TypeError("Invalid vector dimension.");_E3.forEach(function(_ref33){var R=_ref33.offset,D=_ref33.color;var U=Object(n["default"])(D);w&&(U=f(U,w)),v.addColorStop(R,U);}),u.fillStyle=v,d=!0;}else m.fillStyle&&(T?u.fillStyle=f(m.fillStyle,T):u.fillStyle=m.fillStyle,d=!0);if(S&&u.transform.apply(u,_toConsumableArray(S)),u.transform.apply(u,_toConsumableArray(m.transformMatrix)),m.clipPath){var _x11=m.clipPath,_E4=new Path2D(_x11);u.clip(_E4);}var p=m.contours.length;if(m.contours.forEach(function(x,E){var R=x.length,D=R>1&&r.vec2.equals(x[0],x[R-1]),U=E===p-1&&m.texture;if(x&&R>0){if(d||O||U){u.beginPath(),u.moveTo.apply(u,_toConsumableArray(x[0]));for(var M=1;M<R;M++)M===R-1&&D?u.closePath():u.lineTo.apply(u,_toConsumableArray(x[M]));}if(d&&u.fill(m.fillRule),U){u.save(),u.clip();var _m$texture=m.texture,_M=_m$texture.image,W=_m$texture.options;if(I&&(_M=I),W.repeat&&console.warn("Context 2D not supported image repeat yet."),_M.font){W.scale&&console.warn("Context 2D not supported text scale yet."),W.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _M2=_M,X=_M2.font,B=_M2.fillColor,N=_M2.strokeColor,$=_M2.strokeWidth,J=_M2.text;!B&&!N&&(B="#000"),Array.isArray(B)&&(B=Object(n["default"])(B)),Array.isArray(N)&&(N=Object(n["default"])(N)),u.font=X;var _u$measureText=u.measureText(J),tt=_u$measureText.width,at=Object(s["default"])(X),ut=Math.max(at.pxLineHeight,at.pxHeight*1.13);u.textAlign="center",u.textBaseline="middle";var V=W.rect,Q=V[0]+ut*0.5+at.pxHeight*0.06,ft=V[1]+tt*0.5;V[2]!=null&&u.scale(V[2]/tt,V[3]/ut),B&&(u.fillStyle=B,u.fillText(J,ft,Q)),N&&(u.lineWidth=$,u.strokeStyle=N,u.strokeText(J,ft,Q));}else{var _X2=W.rect;var _B=W.srcRect;W.scale&&(_X2=[0,0,u.canvas.width,u.canvas.height]),W.rotated&&_X2&&(_X2=[-_X2[1],_X2[0],_X2[3],_X2[2]]),_B&&(_X2=_X2||[0,0,_B[2],_B[3]]),W.rotated&&(u.translate(0,_X2?_X2[2]:_M.width),u.rotate(-0.5*Math.PI)),_B?u.drawImage.apply(u,[_M].concat(_toConsumableArray(_B),_toConsumableArray(_X2))):_X2?u.drawImage.apply(u,[_M].concat(_toConsumableArray(_X2))):u.drawImage(_M,0,0);}u.restore();}O&&u.stroke();}}),u.restore(),y){var _x12=m.filter;_x12&&l(u,_x12);}}},/* 26 *//***/function(i,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 s;}),t(1).glMatrix.setMatrixArrayType(Array);function r(c,l,f){var _ref34;return l>f&&(_ref34=[f,l],l=_ref34[0],f=_ref34[1],_ref34),c<l?l:c>f?f:c;}function n(c,l,f){return c*(1-f)+l*f;}function s(c,l){var _c2=_slicedToArray(c,2),f=_c2[0],h=_c2[1];return[f*l[0]+h*l[2]+l[4],f*l[1]+h*l[3]+l[5]];}},/* 27 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return f;});var r=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function s(h,m,u){var y=h.uniforms||{},T=m.uniforms||{};if(y.u_texSampler&&T.u_texSampler&&y.u_texSampler!==T.u_texSampler)return!1;var w=Object.keys(y),I=Object.keys(T),S=w.indexOf("u_texSampler"),O=I.indexOf("u_texSampler");if(S>=0&&w.splice(S,1),O>=0&&I.splice(O,1),w.length!==I.length)return!1;var d=w.every(function(v){var p=y[v],x=T[v];if(p===x)return!0;if(p.length&&x.length&&p.length===x.length){for(var E=0;E<p.length;E++)if(p[E]!==x[E])return!1;return!0;}return!1;});if(d){if(y.u_texSampler&&!T.u_texSampler)m.setTexture(y.u_texSampler,{hidden:!0});else if(!y.u_texSampler&&T.u_texSampler)for(var v=0;v<u.length;v++)u[v].setTexture(T.u_texSampler,{hidden:!0});}return d;}var c={};function l(h,m){if(h.length){var u=Object(r["default"])(h,c);return u.enableBlend=m,h[0].filterCanvas&&(u.filterCanvas=!0),u.packIndex=h[0].packIndex,u.packLength=h.length,u.beforeRender=h[0].beforeRender,u.pass=h[0].pass,u.afterRender=h[h.length-1].afterRender,h.length=0,u;}}function f(h,m){var u=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var y,T,w,I,S,_O6,_d6,p,v,_p6,x;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:y=[],T=h.options.bufferSize;w=0,I=!1;S=0;case 3:if(!(S<m.length)){_context7.next=47;break;}_O6=m[S];if(!(_O6 instanceof n["default"])){_context7.next=16;break;}_context7.t0=y.length;if(!_context7.t0){_context7.next=10;break;}_context7.next=10;return l(y,I);case 10:w=0;I=!1;_context7.next=14;return _O6;case 14:_context7.next=44;break;case 16:_d6=_O6.meshData;if(_d6.clipPath&&!_d6.uniforms.u_clipSampler){p=h.createTexture(_d6.clipPath);_d6.uniforms.u_clipSampler=p;}v=0;if(!((!u||!_O6.canIgnore())&&_d6&&_d6.positions.length)){_context7.next=40;break;}_O6.packIndex=S;_p6=_O6.filterCanvas;if(!(v=_d6.positions.length,_p6||w+v>T)){_context7.next=31;break;}_context7.t1=y.length;if(!_context7.t1){_context7.next=27;break;}_context7.next=27;return l(y,I);case 27:w=0;I=!1;_context7.next=39;break;case 31:if(!w){_context7.next=39;break;}x=y[y.length-1];_context7.t2=x&&(x.filterCanvas||x.afterRender||_O6.beforeRender||x.pass.length||_O6.pass.length||x.program!==_O6.program||!s(x,_O6,y));if(!_context7.t2){_context7.next=39;break;}_context7.next=37;return l(y,I);case 37:w=0;I=!1;case 39:y.push(_O6),I=I||_O6.enableBlend,w+=v;case 40:_context7.t3=S===m.length-1&&y.length;if(!_context7.t3){_context7.next=44;break;}_context7.next=44;return l(y,I);case 44:S++;_context7.next=3;break;case 47:case"end":return _context7.stop();}},_callee7);})();}},/* 28 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return s;}),t(1).glMatrix.setMatrixArrayType(Array);var r={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(c,l){var f=0,h=0,m=0,u=0,y=0,T=0,w=0;var I=c[0].program;for(var S=0;S<c.length;S++){var _O7=c[S].meshData;if(_O7){w+=_O7.positions.length;var _d7=_O7.positions[0].length;f+=_O7.positions.length*_d7,h+=_O7.cells.length*3,T+=_O7.attributes.a_color.length*4;var v=_O7.textureCoord;v&&(m+=v.length*v[0].length);var p=_O7.attributes.a_sourceRect;p&&(u+=p.length*4);var x=_O7.attributes.a_clipUV;x&&(y+=x.length*2);}}if((!l.positions||l.positions.length<f)&&(l.positions=new Float32Array(f)),(!l.cells||l.cells.length<h)&&(l.cells=new Uint16Array(h)),m&&(!l.textureCoord||l.textureCoord.length<m)&&(l.textureCoord=new Float32Array(m)),(!l.a_color||l.a_color.length<T)&&(l.a_color=new Uint8Array(T)),u&&(!l.a_sourceRect||l.a_sourceRect.length<u)&&(l.a_sourceRect=new Float32Array(u)),y&&(!l.a_clipUV||l.a_clipUV.length<y)&&(l.a_clipUV=new Float32Array(y)),I){var _S4=Object.entries(I._attribute),_O8=I._attribOpts||{};for(var _d8=0;_d8<_S4.length;_d8++){var _S4$_d=_slicedToArray(_S4[_d8],2),_v3=_S4$_d[0],_p7=_S4$_d[1];if(_v3!=="a_color"&&_v3!=="a_sourceRect"&&_p7!=="ignored"){var _x13=_O8[_v3]?_O8[_v3].type:"FLOAT",E=r[_x13],R=_p7.size*w;(!l[_v3]||l[_v3].length<R)&&(l[_v3]=new E(R));}}}return l;}function s(c,l){var f=[],h=[],m=[],u=[],y=[],T=[],w=0,I=0;var S=c[0]?c[0].uniforms||{}:{},O=c[0]?c[0].program:null;l&&(n(c,l),h=l.cells,f=l.positions,m=l.textureCoord,u=l.a_color,y=l.a_sourceRect,T=l.a_clipUV);var d=!1,v=!1;var p={};for(var E=0;E<c.length;E++){var R=c[E];if(R){var _f2,_u2,_y2,_T2,_m3;if(R.meshData&&(R=R.meshData),l){var U=R.positions;for(var M=0;M<U.length;M++){var W=U[M],X=3*(w+M);for(var B=0;B<W.length;B++)f[X+B]=W[B];}}else(_f2=f).push.apply(_f2,_toConsumableArray(R.positions));var D=R.cells;for(var _U2=0;_U2<D.length;_U2++){var _M3=D[_U2];if(l){var _W=3*(I+_U2);h[_W]=_M3[0]+w,h[_W+1]=_M3[1]+w,h[_W+2]=_M3[2]+w;}else h.push([_M3[0]+w,_M3[1]+w,_M3[2]+w]);}if(l){var _U3=R.attributes.a_color;for(var _M4=0;_M4<_U3.length;_M4++){var _W2=_U3[_M4],_X3=4*(w+_M4);u[_X3]=_W2[0],u[_X3+1]=_W2[1],u[_X3+2]=_W2[2],u[_X3+3]=_W2[3];}}else(_u2=u).push.apply(_u2,_toConsumableArray(R.attributes.a_color));if(R.attributes.a_sourceRect)if(d=!0,l){var _U4=R.attributes.a_sourceRect;for(var _M5=0;_M5<_U4.length;_M5++){var _W3=_U4[_M5],_X4=4*(w+_M5);y[_X4]=_W3[0],y[_X4+1]=_W3[1],y[_X4+2]=_W3[2],y[_X4+3]=_W3[3];}}else(_y2=y).push.apply(_y2,_toConsumableArray(R.attributes.a_sourceRect));if(R.attributes.a_clipUV)if(v=!0,l){var _U5=R.attributes.a_clipUV;for(var _M6=0;_M6<_U5.length;_M6++){var _W4=_U5[_M6],_X5=2*(w+_M6);T[_X5]=_W4[0],T[_X5+1]=_W4[1];}}else(_T2=T).push.apply(_T2,_toConsumableArray(R.attributes.a_clipUV));if(R.textureCoord)if(l){var _U6=R.textureCoord;for(var _M7=0;_M7<_U6.length;_M7++){var _W5=_U6[_M7],_X6=3*(w+_M7);for(var _B2=0;_B2<_W5.length;_B2++)m[_X6+_B2]=_W5[_B2];}}else(_m3=m).push.apply(_m3,_toConsumableArray(R.textureCoord));if(O){var _U7=Object.entries(O._attribute);for(var _M8=0;_M8<_U7.length;_M8++){var _p$_W;var _U7$_M=_slicedToArray(_U7[_M8],2),_W6=_U7$_M[0],_X7=_U7$_M[1];if(_W6!=="a_color"&&_W6!=="a_sourceRect"&&_X7!=="ignored")if(p[_W6]=[],l){p[_W6]=l[_W6];var _B3=R.attributes[_W6],N=_B3[0].length;for(var $=0;$<_B3.length;$++){var J=_B3[$],tt=N*(w+$);for(var at=0;at<J.length;at++)p[_W6][tt+at]=J[at];}}else(_p$_W=p[_W6]).push.apply(_p$_W,_toConsumableArray(R.attributes[_W6]));}}w+=R.positions.length,I+=R.cells.length;}}p.a_color=u,d&&y&&y.length>0&&(p.a_sourceRect=y);var x={positions:f,cells:h,attributes:p,uniforms:S,cellsCount:I*3,program:O};return m&&m.length&&(x.textureCoord=m),v&&T.length>0&&(p.a_clipUV=T),x;}},/* 29 *//***/function(i,e,t){t.r(e);var r=t(1),n=t(30),s=t(26),c=t(31);t(1).glMatrix.setMatrixArrayType(Array);function l(p,x){var E=Object.keys(p);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(p);x&&(R=R.filter(function(D){return Object.getOwnPropertyDescriptor(p,D).enumerable;})),E.push.apply(E,R);}return E;}function f(p){for(var x=1;x<arguments.length;x++){var E=arguments[x]!=null?arguments[x]:{};x%2?l(Object(E),!0).forEach(function(R){h(p,R,E[R]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(E)):l(Object(E)).forEach(function(R){Object.defineProperty(p,R,Object.getOwnPropertyDescriptor(E,R));});}return p;}function h(p,x,E){return x in p?Object.defineProperty(p,x,{value:E,enumerable:!0,configurable:!0,writable:!0}):p[x]=E,p;}var m=Symbol("mesh"),u=Symbol("count"),y=Symbol("blend"),T=Symbol("filter"),w=Symbol("textures"),I=Symbol("textureOptions"),S=Symbol("cloudColor"),O=Symbol("cloudFilter"),d=Symbol("buffer");function v(p){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var E=new Float32Array(3*p),R=new Float32Array(3*p),D=new Float32Array(4*p),U=new Float32Array(4*p),M=new Float32Array(4*p),W=new Float32Array(4*p),X=new Float32Array(4*p),B=new Uint8Array(p),N=new Uint8Array(4*p),$=new Uint8Array(4*p);return x&&(E.set(x.transform0,0),R.set(x.transform1,0),D.set(x.color0,0),U.set(x.color1,0),M.set(x.color2,0),W.set(x.color3,0),X.set(x.color4,0),B.set(x.frameIndex,0),N.set(x.fillColor,0),$.set(x.strokeColor,0)),{bufferSize:p,transform0:E,transform1:R,color0:D,color1:U,color2:M,color3:W,color4:X,frameIndex:B,fillColor:N,strokeColor:$};}e["default"]=/*#__PURE__*/function(){function _class(p){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref35=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref35$buffer=_ref35.buffer,E=_ref35$buffer===void 0?1e3:_ref35$buffer;_classCallCheck(this,_class);E=Math.max(E,x),this[u]=x,this[m]=p,this[d]=v(E),this[w]=[],this[T]=[],this[S]=!1,this[O]=!1,this[y]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var p=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var x=this[u];for(var E=p;E<x;E++)this[d].transform0.set([1,0,0],E*3),this[d].transform1.set([0,1,0],E*3),this[d].frameIndex.set([-1],E),this[d].fillColor.set([0,0,0,0],E*4),this[d].strokeColor.set([0,0,0,0],E*4),this.setColorTransform(E,null);}},{key:"bufferSize",get:function get(){return this[d].bufferSize;}},{key:"mesh",get:function get(){return this[m];},set:function set(p){this[m]=p,this[w]&&this.setTextureFrames(this[w],this[I]);}},{key:"hasCloudColor",get:function get(){return this[S];}},{key:"hasCloudFilter",get:function get(){return this[O];}},{key:"_getFilter",value:function _getFilter(p){return this[T][p]=this[T][p]||[],this[T][p];}},{key:"getFilter",value:function getFilter(p){return this._getFilter(p).join(" ");}},{key:"enableBlend",get:function get(){return this[m].enableBlend||this[y];}},{key:"canIgnore",value:function canIgnore(){return this[m].canIgnore();}},{key:"delete",value:function _delete(p){if(p>=this[u]||p<0)throw new Error("Out of range.");var _this$d2=this[d],x=_this$d2.transform0,E=_this$d2.transform1,R=_this$d2.color0,D=_this$d2.color1,U=_this$d2.color2,M=_this$d2.color3,W=_this$d2.color4,X=_this$d2.frameIndex,B=_this$d2.fillColor,N=_this$d2.strokeColor;x.set(x.subarray(3*(p+1)),3*p),E.set(E.subarray(3*(p+1)),3*p),R.set(R.subarray(4*(p+1)),4*p),D.set(D.subarray(4*(p+1)),4*p),U.set(U.subarray(4*(p+1)),4*p),M.set(M.subarray(4*(p+1)),4*p),W.set(W.subarray(4*(p+1)),4*p),X.set(X.subarray(p+1),p),B.set(B.subarray(4*(p+1)),4*p),N.set(N.subarray(4*(p+1)),4*p);for(var $ in this[T])$===p?delete this[T][$]:$>p&&(this[T][$-1]=this[T][$],delete this[T][$]);this[u]--;}},{key:"setColorTransform",value:function setColorTransform(p,x){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=4;var _this$d3=this[d],E=_this$d3.color0,R=_this$d3.color1,D=_this$d3.color2,U=_this$d3.color3,M=_this$d3.color4;return x!=null?(E.set([x[0],x[5],x[10],x[15]],p),R.set([x[1],x[6],x[11],x[16]],p),D.set([x[2],x[7],x[12],x[17]],p),U.set([x[3],x[8],x[13],x[18]],p),M.set([x[4],x[9],x[14],x[19]],p),this[y]=this[y]||x[18]<1,this[O]=!0):(E.set([1,0,0,0],p),R.set([0,1,0,0],p),D.set([0,0,1,0],p),U.set([0,0,0,1],p),M.set([0,0,0,0],p)),this;}},{key:"getColorTransform",value:function getColorTransform(p){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=4;var _this$d4=this[d],x=_this$d4.color0,E=_this$d4.color1,R=_this$d4.color2,D=_this$d4.color3,U=_this$d4.color4;return[x[p],E[p],R[p],D[p],U[p],x[p+1],E[p+1],R[p+1],D[p+1],U[p+1],x[p+2],E[p+2],R[p+2],D[p+2],U[p+2],x[p+3],E[p+3],R[p+3],D[p+3],U[p+3]];}},{key:"transformColor",value:function transformColor(p,x){var E=this.getColorTransform(p);return E=Object(n.multiply)(E,x),this.setColorTransform(p,E),this;}},{key:"setFillColor",value:function setFillColor(p,x){if(p>=this[u]||p<0)throw new Error("Out of range.");typeof x=="string"&&(x=Object(c["default"])(x)),x[3]>0&&(this[S]=!0),this[d].fillColor.set(x.map(function(E){return Math.round(255*E);}),4*p);}},{key:"setStrokeColor",value:function setStrokeColor(p,x){if(p>=this[u]||p<0)throw new Error("Out of range.");typeof x=="string"&&(x=Object(c["default"])(x)),x[3]>0&&(this[S]=!0),this[d].strokeColor.set(x.map(function(E){return Math.round(255*E);}),4*p);}},{key:"getCloudRGBA",value:function getCloudRGBA(p){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=4;var _this$d5=this[d],x=_this$d5.fillColor,E=_this$d5.strokeColor,R=[x[p],x[p+1],x[p+2],x[p+3]],D=[E[p],E[p+1],E[p+2],E[p+3]];return R[3]/=255,D[3]/=255,{fill:"rgba(".concat(R.join(),")"),stroke:"rgba(".concat(D.join(),")")};}},{key:"grayscale",value:function grayscale(p,x){this.transformColor(p,Object(n.grayscale)(x)),this._getFilter(p).push("grayscale(".concat(100*x,"%)"));}},{key:"brightness",value:function brightness(p,x){this.transformColor(p,Object(n.brightness)(x)),this._getFilter(p).push("brightness(".concat(100*x,"%)"));}},{key:"saturate",value:function saturate(p,x){this.transformColor(p,Object(n.saturate)(x)),this._getFilter(p).push("saturate(".concat(100*x,"%)"));}},{key:"contrast",value:function contrast(p,x){this.transformColor(p,Object(n.contrast)(x)),this._getFilter(p).push("contrast(".concat(100*x,"%)"));}},{key:"invert",value:function invert(p,x){this.transformColor(p,Object(n.invert)(x)),this._getFilter(p).push("invert(".concat(100*x,"%)"));}},{key:"sepia",value:function sepia(p,x){this.transformColor(p,Object(n.sepia)(x)),this._getFilter(p).push("sepia(".concat(100*x,"%)"));}},{key:"opacity",value:function opacity(p,x){this.transformColor(p,Object(n.opacity)(x)),this._getFilter(p).push("opacity(".concat(100*x,"%)"));}},{key:"hueRotate",value:function hueRotate(p,x){this.transformColor(p,Object(n.hueRotate)(x)),this._getFilter(p).push("hue-rotate(".concat(x,"deg)"));}},{key:"setTransform",value:function setTransform(p,x){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=3,x==null&&(x=[1,0,0,1,0,0]);var _this$d6=this[d],E=_this$d6.transform0,R=_this$d6.transform1;return E.set([x[0],x[2],x[4]],p),R.set([x[1],x[3],x[5]],p),this;}},{key:"getTransform",value:function getTransform(p){if(p>=this[u]||p<0)throw new Error("Out of range.");p*=3;var _this$d7=this[d],x=_this$d7.transform0,E=_this$d7.transform1;return[x[p],E[p],x[p+1],E[p+1],x[p+2],E[p+2]];}},{key:"getTextureFrame",value:function getTextureFrame(p){return this[w][this[d].frameIndex[p]];}},{key:"setTextureFrames",value:function setTextureFrames(){var p=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(p.length>12)throw new Error("Max frames exceed. Allow 12 frames.");p.length&&this[m].setTexture(p[0],x),this[w]=p,this[I]=x;}},{key:"setFrameIndex",value:function setFrameIndex(p,x){if(p>=this[u]||p<0)throw new Error("Out of range.");var E=this[w].length;if(E<=0)throw new Error("No frames");this[d].frameIndex[p]=x%E;}},{key:"amount",get:function get(){return this[u];},set:function set(p){var x=this[u];p!==x&&(p>this[d].bufferSize&&(this[d]=v(Math.max(p,this[d].bufferSize+1e3),this[d])),this[u]=p,p>x&&this.initBuffer(x));}},{key:"meshData",get:function get(){var _this$m$meshData=this[m].meshData,p=_this$m$meshData.attributes,x=_this$m$meshData.cells,E=_this$m$meshData.positions,R=_this$m$meshData.textureCoord,D=_this$m$meshData.uniforms,U=this[w],M={attributes:f({},p),cells:x,positions:E,textureCoord:R,uniforms:f({},D),instanceCount:this[u],enableBlend:this.enableBlend};U.length&&U.forEach(function(Q,ft){M.uniforms["u_texFrame".concat(ft)]=Q;});var _this$d8=this[d],W=_this$d8.transform0,X=_this$d8.transform1,B=_this$d8.color0,N=_this$d8.color1,$=_this$d8.color2,J=_this$d8.color3,tt=_this$d8.color4,at=_this$d8.fillColor,ut=_this$d8.strokeColor,V=_this$d8.frameIndex;return this[m].uniforms.u_texSampler&&(M.attributes.a_frameIndex={data:V,divisor:1}),M.attributes.a_transform0={data:W,divisor:1},M.attributes.a_transform1={data:X,divisor:1},M.attributes.a_colorCloud0={data:B,divisor:1},M.attributes.a_colorCloud1={data:N,divisor:1},M.attributes.a_colorCloud2={data:$,divisor:1},M.attributes.a_colorCloud3={data:J,divisor:1},M.attributes.a_colorCloud4={data:tt,divisor:1},this.hasCloudColor&&(M.attributes.a_fillCloudColor={data:at,divisor:1},M.attributes.a_strokeCloudColor={data:ut,divisor:1}),M;}},{key:"setProgram",value:function setProgram(p){this[m].setProgram(p);}},{key:"program",get:function get(){return this[m].program;}},{key:"transform",value:function transform(p,x){var E=this.getTransform(p);return x=r.mat2d.multiply(Array.of(0,0,0,0,0,0),E,x),this.setTransform(p,x),this;}},{key:"translate",value:function translate(p,_ref36){var _ref37=_slicedToArray(_ref36,2),x=_ref37[0],E=_ref37[1];var R=r.mat2d.create();return R=r.mat2d.translate(Array.of(0,0,0,0,0,0),R,[x,E]),this.transform(p,R);}},{key:"rotate",value:function rotate(p,x){var _ref38=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref39=_slicedToArray(_ref38,2),E=_ref39[0],R=_ref39[1];var D=r.mat2d.create();return D=r.mat2d.translate(Array.of(0,0,0,0,0,0),D,[E,R]),D=r.mat2d.rotate(Array.of(0,0,0,0,0,0),D,x),D=r.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-E,-R]),this.transform(p,D);}},{key:"scale",value:function scale(p,_ref40){var _ref41=_slicedToArray(_ref40,2),x=_ref41[0],_ref41$=_ref41[1],E=_ref41$===void 0?x:_ref41$;var _ref42=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref43=_slicedToArray(_ref42,2),R=_ref43[0],D=_ref43[1];var U=r.mat2d.create();return U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[R,D]),U=r.mat2d.scale(Array.of(0,0,0,0,0,0),U,[x,E]),U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[-R,-D]),this.transform(p,U);}},{key:"skew",value:function skew(p,_ref44){var _ref45=_slicedToArray(_ref44,2),x=_ref45[0],_ref45$=_ref45[1],E=_ref45$===void 0?x:_ref45$;var _ref46=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref47=_slicedToArray(_ref46,2),R=_ref47[0],D=_ref47[1];var U=r.mat2d.create();return U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[R,D]),U=r.mat2d.multiply(Array.of(0,0,0,0,0,0),U,r.mat2d.fromValues(1,Math.tan(E),Math.tan(x),1,0,0)),U=r.mat2d.translate(Array.of(0,0,0,0,0,0),U,[-R,-D]),this.transform(p,U);}},{key:"isPointCollision",value:function isPointCollision(p,_ref48){var _this$m;var _ref49=_slicedToArray(_ref48,2),x=_ref49[0],E=_ref49[1];var R=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var D=this.getTransform(p),U=Object(s.transformPoint)([x,E],r.mat2d.invert(Array.of(0,0,0,0,0,0),D));return(_this$m=this[m]).isPointCollision.apply(_this$m,_toConsumableArray(U).concat([R]));}},{key:"isPointInFill",value:function isPointInFill(p,_ref50){var _ref51=_slicedToArray(_ref50,2),x=_ref51[0],E=_ref51[1];return this.isPointCollision(p,[x,E],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(p,_ref52){var _ref53=_slicedToArray(_ref52,2),x=_ref53[0],E=_ref53[1];return this.isPointCollision(p,[x,E],"stroke");}}]);}();},/* 30 *//***/function(i,e,t){t.r(e),t.d(e,"multiply",function(){return n;}),t.d(e,"grayscale",function(){return s;}),t.d(e,"brightness",function(){return c;}),t.d(e,"saturate",function(){return l;}),t.d(e,"contrast",function(){return f;}),t.d(e,"invert",function(){return h;}),t.d(e,"sepia",function(){return m;}),t.d(e,"opacity",function(){return u;}),t.d(e,"hueRotate",function(){return y;});var r=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(T,w){var I=[],S=T[0],O=T[1],d=T[2],v=T[3],p=T[4],x=T[5],E=T[6],R=T[7],D=T[8],U=T[9],M=T[10],W=T[11],X=T[12],B=T[13],N=T[14],$=T[15],J=T[16],tt=T[17],at=T[18],ut=T[19];var V=w[0],Q=w[1],ft=w[2],mt=w[3],yt=w[4];return I[0]=V*S+Q*x+ft*M+mt*$,I[1]=V*O+Q*E+ft*W+mt*J,I[2]=V*d+Q*R+ft*X+mt*tt,I[3]=V*v+Q*D+ft*B+mt*at,I[4]=V*p+Q*U+ft*N+mt*ut+yt,V=w[5],Q=w[6],ft=w[7],mt=w[8],yt=w[9],I[5]=V*S+Q*x+ft*M+mt*$,I[6]=V*O+Q*E+ft*W+mt*J,I[7]=V*d+Q*R+ft*X+mt*tt,I[8]=V*v+Q*D+ft*B+mt*at,I[9]=V*p+Q*U+ft*N+mt*ut+yt,V=w[10],Q=w[11],ft=w[12],mt=w[13],yt=w[14],I[10]=V*S+Q*x+ft*M+mt*$,I[11]=V*O+Q*E+ft*W+mt*J,I[12]=V*d+Q*R+ft*X+mt*tt,I[13]=V*v+Q*D+ft*B+mt*at,I[14]=V*p+Q*U+ft*N+mt*ut+yt,V=w[15],Q=w[16],ft=w[17],mt=w[18],yt=w[19],I[15]=V*S+Q*x+ft*M+mt*$,I[16]=V*O+Q*E+ft*W+mt*J,I[17]=V*d+Q*R+ft*X+mt*tt,I[18]=V*v+Q*D+ft*B+mt*at,I[19]=V*p+Q*U+ft*N+mt*ut+yt,I;}function s(T){T=Object(r.clamp)(0,1,T);var w=0.2126*T,I=0.7152*T,S=0.0722*T;return[w+1-T,I,S,0,0,w,I+1-T,S,0,0,w,I,S+1-T,0,0,0,0,0,1,0];}function c(T){return[T,0,0,0,0,0,T,0,0,0,0,0,T,0,0,0,0,0,1,0];}function l(T){var w=0.2126*(1-T),I=0.7152*(1-T),S=0.0722*(1-T);return[w+T,I,S,0,0,w,I+T,S,0,0,w,I,S+T,0,0,0,0,0,1,0];}function f(T){var w=0.5*(1-T);return[T,0,0,0,w,0,T,0,0,w,0,0,T,0,w,0,0,0,1,0];}function h(T){var w=1-2*T;return[w,0,0,0,T,0,w,0,0,T,0,0,w,0,T,0,0,0,1,0];}function m(T){return[1-0.607*T,0.769*T,0.189*T,0,0,0.349*T,1-0.314*T,0.168*T,0,0,0.272*T,0.534*T,1-0.869*T,0,0,0,0,0,1,0];}function u(T){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,T,0];}function y(T){var w=T/180*Math.PI,I=Math.cos(w),S=Math.sin(w),O=0.2126,d=0.7152,v=0.0722;return[O+I*(1-O)+S*-O,d+I*-d+S*-d,v+I*-v+S*(1-v),0,0,O+I*-O+S*0.143,d+I*(1-d)+S*0.14,v+I*-v+S*-0.283,0,0,O+I*-O+S*-(1-O),d+I*-d+S*d,v+I*(1-v)+S*v,0,0,0,0,0,1,0];}},/* 31 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return s;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);function s(c){var l=n()(c);if(!l||!l.length)throw new TypeError("Invalid color value.");return[l[0]/255,l[1]/255,l[2]/255,l[3]];}},/* 32 *//***/function(i,e,t){var r=t(33),n=t(37),s=t(39);i.exports=function(l){var f,h=r(l);return h.space?(f=Array(3),f[0]=s(h.values[0],0,255),f[1]=s(h.values[1],0,255),f[2]=s(h.values[2],0,255),h.space[0]==="h"&&(f=n.rgb(f)),f.push(s(h.alpha,0,1)),f):[];};},/* 33 *//***/function(i,e,t){(function(r){var n=t(34),s=t(35),c=t(36);i.exports=f;var l={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function f(h){var m,u=[],y=1,T;if(typeof h=="string"){if(n[h])u=n[h].slice(),T="rgb";else if(h==="transparent")y=0,T="rgb",u=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(h)){var w=h.slice(1),I=w.length,S=I<=4;y=1,S?(u=[parseInt(w[0]+w[0],16),parseInt(w[1]+w[1],16),parseInt(w[2]+w[2],16)],I===4&&(y=parseInt(w[3]+w[3],16)/255)):(u=[parseInt(w[0]+w[1],16),parseInt(w[2]+w[3],16),parseInt(w[4]+w[5],16)],I===8&&(y=parseInt(w[6]+w[7],16)/255)),u[0]||(u[0]=0),u[1]||(u[1]=0),u[2]||(u[2]=0),T="rgb";}else if(m=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(h)){var O=m[1],d=O==="rgb",w=O.replace(/a$/,"");T=w;var I=w==="cmyk"?4:w==="gray"?1:3;u=m[2].trim().split(/\s*,\s*/).map(function(E,R){if(/%$/.test(E))return R===I?parseFloat(E)/100:w==="rgb"?parseFloat(E)*255/100:parseFloat(E);if(w[R]==="h"){if(/deg$/.test(E))return parseFloat(E);if(l[E]!==void 0)return l[E];}return parseFloat(E);}),O===w&&u.push(1),y=d||u[I]===void 0?1:u[I],u=u.slice(0,I);}else h.length>10&&/[0-9](?:\s|\/)/.test(h)&&(u=h.match(/([0-9]+)/g).map(function(p){return parseFloat(p);}),T=h.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(h))T="rgb",u=[h>>>16,(h&65280)>>>8,h&255];else if(s(h)){var v=c(h.r,h.red,h.R,null);v!==null?(T="rgb",u=[v,c(h.g,h.green,h.G),c(h.b,h.blue,h.B)]):(T="hsl",u=[c(h.h,h.hue,h.H),c(h.s,h.saturation,h.S),c(h.l,h.lightness,h.L,h.b,h.brightness)]),y=c(h.a,h.alpha,h.opacity,1),h.opacity!=null&&(y/=100);}else(Array.isArray(h)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(h))&&(u=[h[0],h[1],h[2]],T="rgb",y=h.length===4?h[3]:1);return{space:T,values:u,alpha:y};}}).call(this,t(22));},/* 34 *//***/function(i,e,t){i.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(i,e,t){var r=Object.prototype.toString;i.exports=function(n){var s;return r.call(n)==="[object Object]"&&(s=Object.getPrototypeOf(n),s===null||s===Object.getPrototypeOf({}));};},/* 36 *//***/function(i,e){i.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 *//***/function(i,e,t){var r=t(38);i.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var s=n[0]/360,c=n[1]/100,l=n[2]/100,f,h,m,u,y;if(c===0)return y=l*255,[y,y,y];l<0.5?h=l*(1+c):h=l+c-l*c,f=2*l-h,u=[0,0,0];for(var T=0;T<3;T++)m=s+0.3333333333333333*-(T-1),m<0?m++:m>1&&m--,6*m<1?y=f+(h-f)*6*m:2*m<1?y=h:3*m<2?y=f+(h-f)*(0.6666666666666666-m)*6:y=f,u[T]=y*255;return u;}},r.hsl=function(n){var s=n[0]/255,c=n[1]/255,l=n[2]/255,f=Math.min(s,c,l),h=Math.max(s,c,l),m=h-f,u,y,T;return h===f?u=0:s===h?u=(c-l)/m:c===h?u=2+(l-s)/m:l===h&&(u=4+(s-c)/m),u=Math.min(u*60,360),u<0&&(u+=360),T=(f+h)/2,h===f?y=0:T<=0.5?y=m/(h+f):y=m/(2-h-f),[u,y*100,T*100];};},/* 38 *//***/function(i,e,t){i.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 *//***/function(i,e){i.exports=t;function t(r,n,s){return n<s?r<n?n:r>s?s:r:r<s?s:r>n?n:r;}},/* 40 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return v;});var r=t(41),n=/* @__PURE__ */t.n(r),s=t(42),c=/* @__PURE__ */t.n(s),l=t(43),f=/* @__PURE__ */t.n(l),h=t(44),m=t(46),u=/* @__PURE__ */t.n(m),y=t(53),T=t(55);t(1).glMatrix.setMatrixArrayType(Array);var w=Symbol("contours"),I=Symbol("path"),S=Symbol("simplify"),O=Symbol("scale"),d=2*Math.PI;var v=/*#__PURE__*/function(){function v(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,v);typeof x=="string"&&(x={path:x}),x.path?this[I]=n()(x.path):this[I]=[],this[w]=null,this[S]=x.simplify!=null?x.simplify:0,this[O]=x.scale!=null?x.scale:2;}return _createClass(v,[{key:"contours",get:function get(){var x=null;if(!this[w]&&this[I]){var E=Object(h["default"])(f()(this[I]));this[w]=u()(E,this[O],this[S]),this[w].path=E,this[w].simplify=this[S],this[w].scale=this[O];}return this[w]&&(x=this[w].map(function(E){return _toConsumableArray(E);}),x.path=this[w].path,x.simplify=this[w].simplify,x.scale=this[w].scale),x;}},{key:"path",get:function get(){return this[I];}},{key:"simplify",get:function get(){return this[S];}},{key:"boundingBox",get:function get(){var x=this.contours;if(x&&x.length){var E=x.reduce(function(R,D){return[].concat(_toConsumableArray(R),_toConsumableArray(D));});return c()(E);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var x=this.boundingBox;return x?[0.5*(x[0][0]+x[1][0]),0.5*(x[0][1]+x[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$I;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var E=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var R=Object(h["default"])(f()(this[I])).map(function(_ref54){var _ref55=_toArray(_ref54),D=_ref55[0],U=_ref55.slice(1);var M=[D];for(var W=0;W<U.length;W+=2){var X=U[W]-x,B=U[W+1]-E;M.push(X,B);}return M;});return this.beginPath(),(_this$I=this[I]).push.apply(_this$I,_toConsumableArray(R)),this;}},{key:"getPointAtLength",value:function getPointAtLength(x){return this.contours?Object(y.getPointAtLength)(this[w],x):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(y.getTotalLength)(this[w]):0;}},{key:"addPath",value:function addPath(x){var _this$I2;this[w]=null,typeof x=="string"&&(x=n()(x)),(_this$I2=this[I]).push.apply(_this$I2,_toConsumableArray(x));}},{key:"beginPath",value:function beginPath(){this[I]=[],this[w]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(x,E,R,D,U,M,W){var X=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(M+=U,W+=U,R<=0||D<=0||W===M)return;W<M&&(W=M+d+(W-M)%d),W-M>d&&(W=M+d);var B=W-M;B>=d&&(W-=1e-3);var N=this[I].length>0&&B<d?"L":"M";var $=Object(T.getPoint)(x,E,R,D,M),J=Object(T.getPoint)(x,E,R,D,W),tt=+!X;var at=B>Math.PI?1:0;X&&(at=1-at),N+=$.join(" "),N+="A".concat(R," ").concat(D," 0 ").concat(at," ").concat(tt," ").concat(J.join(" ")),B>=d&&(N+="Z"),this.addPath(N);}},{key:"arc",value:function arc(x,E,R,D,U){var M=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(x,E,R,R,0,D,U,M);}},{key:"arcTo",value:function arcTo(x,E,R,D,U,M,W){this[w]=null,this[I].push(["A",x,E,R,D,U,M,W]);}},{key:"moveTo",value:function moveTo(x,E){this[w]=null,this[I].push(["M",x,E]);}},{key:"lineTo",value:function lineTo(x,E){this[w]=null,this[I].push(["L",x,E]);}},{key:"bezierCurveTo",value:function bezierCurveTo(x,E,R,D,U,M){this[w]=null,this[I].push(["C",x,E,R,D,U,M]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(x,E,R,D){this[w]=null,this[I].push(["Q",x,E,R,D]);}},{key:"rect",value:function rect(x,E,R,D){var U="M".concat(x," ").concat(E,"L").concat(x+R," ").concat(E,"L").concat(x+R," ").concat(E+D,"L").concat(x," ").concat(E+D,"Z");this.addPath(U);}},{key:"closePath",value:function closePath(){this[w]=null;var x=[];var E=this[I].length;E>0&&(x=this[I][E-1]),x[0]!=="Z"&&x[0]!=="z"&&this[I].push(["Z"]);}}]);}();},/* 41 *//***/function(i,e){i.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(l){var f=[];return l.replace(r,function(h,m,u){var y=m.toLowerCase();for(u=c(u),y=="m"&&u.length>2&&(f.push([m].concat(u.splice(0,2))),y="l",m=m=="m"?"l":"L");;){if(u.length==t[y])return u.unshift(m),f.push(u);if(u.length<t[y])throw new Error("malformed path data");f.push([m].concat(u.splice(0,t[y])));}}),f;}var s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function c(l){var f=l.match(s);return f?f.map(Number):[];}},/* 42 *//***/function(i,e,t){i.exports=r;function r(n){var s=n.length;if(s===0)return[[],[]];for(var c=n[0].length,l=n[0].slice(),f=n[0].slice(),h=1;h<s;++h)for(var m=n[h],u=0;u<c;++u){var y=m[u];l[u]=Math.min(l[u],y),f[u]=Math.max(f[u],y);}return[l,f];}},/* 43 *//***/function(i,e){i.exports=t;function t(r){var n=0,s=0,c=0,l=0;return r.map(function(f){f=f.slice();var h=f[0],m=h.toUpperCase();if(h!=m)switch(f[0]=m,h){case"a":f[6]+=c,f[7]+=l;break;case"v":f[1]+=l;break;case"h":f[1]+=c;break;default:for(var u=1;u<f.length;)f[u++]+=c,f[u++]+=l;}switch(m){case"Z":c=n,l=s;break;case"H":c=f[1];break;case"V":l=f[1];break;case"M":c=n=f[1],l=s=f[2];break;default:c=f[f.length-2],l=f[f.length-1];}return f;});}},/* 44 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(l){for(var f,h=[],m=0,u=0,y=0,T=0,w=null,I=null,S=0,O=0,d=0,v=l.length;d<v;d++){var p=l[d],x=p[0];switch(x){case"M":y=p[1],T=p[2];break;case"A":var E=Object(r["default"])(S,O,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!E.length)continue;E=E.map(function(W){var _W7=_slicedToArray(W,8),X=_W7[0],B=_W7[1],N=_W7[2],$=_W7[3],J=_W7[4],tt=_W7[5],at=_W7[6],ut=_W7[7];return{x1:N,y1:$,x2:J,y2:tt,x:at,y:ut};});for(var R=0,D;R<E.length;R++)D=E[R],p=["C",D.x1,D.y1,D.x2,D.y2,D.x,D.y],R<E.length-1&&h.push(p);break;case"S":var U=S,M=O;(f=="C"||f=="S")&&(U+=U-m,M+=M-u),p=["C",U,M,p[1],p[2],p[3],p[4]];break;case"T":f=="Q"||f=="T"?(w=S*2-w,I=O*2-I):(w=S,I=O),p=c(S,O,w,I,p[1],p[2]);break;case"Q":w=p[1],I=p[2],p=c(S,O,p[1],p[2],p[3],p[4]);break;case"L":p=s(S,O,p[1],p[2]);break;case"H":p=s(S,O,p[1],O);break;case"V":p=s(S,O,S,p[1]);break;case"Z":p=s(S,O,y,T);break;}f=x,S=p[p.length-2],O=p[p.length-1],p.length>4?(m=p[p.length-4],u=p[p.length-3]):(m=S,u=O),h.push(p);}return h;}function s(l,f,h,m){return["C",l,f,h,m,h,m];}function c(l,f,h,m,u,y){return["C",l/3+0.6666666666666666*h,f/3+0.6666666666666666*m,u/3+0.6666666666666666*h,y/3+0.6666666666666666*m,u,y];}},/* 45 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(f,h,m,u){var y=f*u-h*m<0?-1:1;var T=f*m+h*u;return T>1&&(T=1),T<-1&&(T=-1),y*Math.acos(T);}function s(f,h,m,u,y,T,w,I,S,O){var d=O*(f-m)/2+S*(h-u)/2,v=-S*(f-m)/2+O*(h-u)/2,p=w*w,x=I*I,E=d*d,R=v*v;var D=p*x-p*R-x*E;D<0&&(D=0),D/=p*R+x*E,D=Math.sqrt(D)*(y===T?-1:1);var U=D*w/I*v,M=D*-I/w*d,W=O*U-S*M+(f+m)/2,X=S*U+O*M+(h+u)/2,B=(d-U)/w,N=(v-M)/I,$=(-d-U)/w,J=(-v-M)/I,tt=n(1,0,B,N);var at=n(B,N,$,J);return T===0&&at>0&&(at-=r),T===1&&at<0&&(at+=r),[W,X,tt,at];}function c(f,h){var m=1.3333333333333333*Math.tan(h/4),u=Math.cos(f),y=Math.sin(f),T=Math.cos(f+h),w=Math.sin(f+h);return[u,y,u-y*m,y+u*m,T+w*m,w-T*m,T,w];}function l(f,h,m,u,y,T,w,I,S){var O=Math.sin(S*r/360),d=Math.cos(S*r/360),v=d*(f-m)/2+O*(h-u)/2,p=-O*(f-m)/2+d*(h-u)/2;if(v===0&&p===0)return[];if(w===0||I===0)return[];w=Math.abs(w),I=Math.abs(I);var x=v*v/(w*w)+p*p/(I*I);x>1&&(w*=Math.sqrt(x),I*=Math.sqrt(x));var E=s(f,h,m,u,y,T,w,I,O,d),R=[];var D=E[2],U=E[3];var M=Math.max(Math.ceil(Math.abs(U)/(r/4)),1);U/=M;for(var W=0;W<M;W++)R.push(c(D,U)),D+=U;return R.map(function(W){for(var X=0;X<W.length;X+=2){var B=W[X+0],N=W[X+1];B*=w,N*=I;var $=d*B-O*N,J=O*B+d*N;W[X+0]=$+E[0],W[X+1]=J+E[1];}return W;});}},/* 46 *//***/function(i,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(47),_t2=t(49),n=_t2.copy,s=t(50);function c(u,y,T){return u[0]=y,u[1]=T,u;}var l=[0,0],f=[0,0],h=[0,0];function m(u,y,T,w){r(T,c(l,w[1],w[2]),c(f,w[3],w[4]),c(h,w[5],w[6]),y,u);}i.exports=function(y,T,w){var I=[],S=[],O=[0,0];return y.forEach(function(d,v,p){if(d[0]==="M")n(O,d.slice(1)),S.length>0&&(I.push(S),S=[]);else if(d[0]==="C")m(S,T,O,d),c(O,d[5],d[6]);else throw new Error("illegal type in SVG: "+d[0]);}),S.length>0&&I.push(S),I.map(function(d){return s(d,w||0);});};},/* 47 *//***/function(i,e,t){i.exports=t(48)();},/* 48 *//***/function(i,e){function t(n){return[n[0],n[1]];}function r(n,s){return[n,s];}i.exports=function(s){s=s||{};var c=typeof s.recursion=="number"?s.recursion:8,l=typeof s.epsilon=="number"?s.epsilon:11920929e-14,f=typeof s.pathEpsilon=="number"?s.pathEpsilon:1,h=typeof s.angleEpsilon=="number"?s.angleEpsilon:0.01,m=s.angleTolerance||0,u=s.cuspLimit||0;return function(I,S,O,d,v,p){p||(p=[]),v=typeof v=="number"?v:1;var x=f/v;return x*=x,y(I,S,O,d,p,x),p;};function y(w,I,S,O,d,v){d.push(t(w));var p=w[0],x=w[1],E=I[0],R=I[1],D=S[0],U=S[1],M=O[0],W=O[1];T(p,x,E,R,D,U,M,W,d,v,0),d.push(t(O));}function T(w,I,S,O,d,v,p,x,E,R,D){if(!(D>c)){var U=Math.PI,M=(w+S)/2,W=(I+O)/2,X=(S+d)/2,B=(O+v)/2,N=(d+p)/2,$=(v+x)/2,J=(M+X)/2,tt=(W+B)/2,at=(X+N)/2,ut=(B+$)/2,V=(J+at)/2,Q=(tt+ut)/2;if(D>0){var ft=p-w,mt=x-I,yt=Math.abs((S-p)*mt-(O-x)*ft),wt=Math.abs((d-p)*mt-(v-x)*ft),ht,Nt;if(yt>l&&wt>l){if((yt+wt)*(yt+wt)<=R*(ft*ft+mt*mt)){if(m<h){E.push(r(V,Q));return;}var Dt=Math.atan2(v-O,d-S);if(ht=Math.abs(Dt-Math.atan2(O-I,S-w)),Nt=Math.abs(Math.atan2(x-v,p-d)-Dt),ht>=U&&(ht=2*U-ht),Nt>=U&&(Nt=2*U-Nt),ht+Nt<m){E.push(r(V,Q));return;}if(u!==0){if(ht>u){E.push(r(S,O));return;}if(Nt>u){E.push(r(d,v));return;}}}}else if(yt>l){if(yt*yt<=R*(ft*ft+mt*mt)){if(m<h){E.push(r(V,Q));return;}if(ht=Math.abs(Math.atan2(v-O,d-S)-Math.atan2(O-I,S-w)),ht>=U&&(ht=2*U-ht),ht<m){E.push(r(S,O)),E.push(r(d,v));return;}if(u!==0&&ht>u){E.push(r(S,O));return;}}}else if(wt>l){if(wt*wt<=R*(ft*ft+mt*mt)){if(m<h){E.push(r(V,Q));return;}if(ht=Math.abs(Math.atan2(x-v,p-d)-Math.atan2(v-O,d-S)),ht>=U&&(ht=2*U-ht),ht<m){E.push(r(S,O)),E.push(r(d,v));return;}if(u!==0&&ht>u){E.push(r(d,v));return;}}}else if(ft=V-(w+p)/2,mt=Q-(I+x)/2,ft*ft+mt*mt<=R){E.push(r(V,Q));return;}}T(w,I,M,W,J,tt,V,Q,E,R,D+1),T(V,Q,at,ut,N,$,p,x,E,R,D+1);}}};},/* 49 *//***/function(i,e,t){t.r(e),t.d(e,"create",function(){return s;}),t.d(e,"clone",function(){return n;}),t.d(e,"copy",function(){return c;}),t.d(e,"scaleAndAdd",function(){return l;}),t.d(e,"dot",function(){return f;}),t.d(e,"rotate",function(){return h;}),t.d(e,"cross",function(){return m;}),t.d(e,"sub",function(){return u;}),t.d(e,"add",function(){return y;}),t.d(e,"computeMiter",function(){return S;}),t.d(e,"normal",function(){return O;}),t.d(e,"direction",function(){return d;});var r=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(v){return[v[0],v[1]];}function s(){return[0,0];}var c=r.vec2.copy,l=r.vec2.scaleAndAdd,f=r.vec2.dot,h=r.vec2.rotate,m=r.vec2.cross,u=r.vec2.sub,y=r.vec2.add,T=r.vec2.normalize,w=r.vec2.set,I=s();function S(v,p,x,E,R){y(v,x,E),T(v,v),w(p,-v[1],v[0]),w(I,-x[1],x[0]);var D=R/f(p,I);return Math.abs(D);}function O(v,p){return w(v,-p[1],p[0]),v;}function d(v,p,x){return u(v,p,x),T(v,v),v;}},/* 50 *//***/function(i,e,t){var r=t(51),n=t(52);i.exports=function(c,l){return c=r(c,l),c=n(c,l),c;},i.exports.radialDistance=r,i.exports.douglasPeucker=n;},/* 51 *//***/function(i,e){function t(r,n){var s=r[0]-n[0],c=r[1]-n[1];return s*s+c*c;}i.exports=function(n,s){if(n.length<=1)return n;s=typeof s=="number"?s:1;for(var c=s*s,l=n[0],f=[l],h,m=1,u=n.length;m<u;m++)h=n[m],t(h,l)>c&&(f.push(h),l=h);return l!==h&&f.push(h),f;};},/* 52 *//***/function(i,e){function t(n,s,c){var l=s[0],f=s[1],h=c[0]-l,m=c[1]-f;if(h!==0||m!==0){var u=((n[0]-l)*h+(n[1]-f)*m)/(h*h+m*m);u>1?(l=c[0],f=c[1]):u>0&&(l+=h*u,f+=m*u);}return h=n[0]-l,m=n[1]-f,h*h+m*m;}function r(n,s,c,l,f){for(var h=l,m,u=s+1;u<c;u++){var y=t(n[u],n[s],n[c]);y>h&&(m=u,h=y);}h>l&&(m-s>1&&r(n,s,m,l,f),f.push(n[m]),c-m>1&&r(n,m,c,l,f));}i.exports=function(s,c){if(s.length<=1)return s;c=typeof c=="number"?c:1;var l=c*c,f=s.length-1,h=[s[0]];return r(s,0,f,l,h),h.push(s[f]),h;};},/* 53 *//***/function(i,e,t){t.r(e),t.d(e,"getTotalLength",function(){return n;}),t.d(e,"getPointAtLength",function(){return c;}),t.d(e,"getDashContours",function(){return l;});var r=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(f){if(f.totalLength!=null)return f.totalLength;var h=0;return f.forEach(function(m){var u=m[0];for(var y=1;y<m.length;y++){var T=m[y];h+=Object(r.distance)(u,T),u=T;}}),f.totalLength=h,h;}function s(f,h){var m=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(h=Number(h),!Number.isFinite(h))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(h<=0)throw new TypeError("Length must > 0");var u=n(f);if(h>=u){var T=f[f.length-1],w=T[T.length-2],I=T[T.length-1],S=Math.atan2(I[1]-w[1],I[0]-w[0]);return{current:f.map(function(O){return _toConsumableArray(O);}),point:{x:I[0],y:I[1],angle:S}};}var y=[];for(var _T3=0;_T3<f.length;_T3++){y[_T3]=[];var _w2=f[_T3];var _I3=_w2[0];for(var _S5=1;_S5<_w2.length;_S5++){var _O9=_w2[_S5],_d9=Object(r.distance)(_I3,_O9);if(h<_d9){var v=h/_d9,p=Math.atan2(_O9[1]-_I3[1],_O9[0]-_I3[0]),x={x:_I3[0]*(1-v)+_O9[0]*v,y:_I3[1]*(1-v)+_O9[1]*v,angle:p};if(y[_T3].push(_I3),h>0&&y[_T3].push([x.x,x.y]),!m)return{current:y,point:x};var E=[],R=_T3;for(;_T3<f.length;_T3++){for(E[_T3-R]=[],_T3===R&&E[0].push([x.x,x.y]);_S5<_w2.length;_S5++)E[_T3-R].push(_w2[_S5]);_S5=0;}return{current:y,point:x,rest:E};}h-=_d9,y[_T3].push(_I3),_I3=_O9;}}}function c(f,h){if(h=Number(h),!Number.isFinite(h))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(f.length<=0)return{x:0,y:0,angle:0};if(h<=0){var m=f[0][0],u=f[0][1],y=Math.atan2(u[1]-m[1],u[0]-m[0]);return{x:m[0],y:m[1],angle:y};}return s(f,h,!1).point;}function l(f,h,m){var u=0,y=h[0],T=f;var w=[],I=h.length;if(m>0){do m-=h[u%I],u++;while(m>0);m<0&&(y=-m,u--);}else if(m<0){u=-1;do m+=h[u%I+I-1],u--;while(m<0);m>=0&&(u++,y=h[u%I+I-1]-m);}do{var S=s(T,y);T=S.rest,++u%2&&w.push.apply(w,_toConsumableArray(S.current));var _O10=u%I;_O10<0&&(_O10+=I),y=h[_O10];}while(T);return w;}},/* 54 *//***/function(i,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,f,h,m){var _ref57=_slicedToArray(_ref56,3),s=_ref57[0],c=_ref57[1],l=_ref57[2];return s=s*2/f-1,c=1-c*2/h,Number.isFinite(m)?(l=l*2/m-1,[s,c,l]):[s,c];}function n(_ref58,_ref59){var _ref60=_slicedToArray(_ref58,3),s=_ref60[0],c=_ref60[1],_ref60$=_ref60[2],l=_ref60$===void 0?0:_ref60$;var _ref61=_slicedToArray(_ref59,3),f=_ref61[0],h=_ref61[1],_ref61$=_ref61[2],m=_ref61$===void 0?0:_ref61$;return Math.hypot(f-s,h-c,m-l);}},/* 55 *//***/function(i,e,t){t.r(e),t.d(e,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Math.PI*2;function n(s,c,l,f,h){h%=r,h<0&&(h+=r);var m=Math.tan(h);if(Math.abs(m)<1e5){var u=c-m*s,y=1/Math.pow(l,2)+Math.pow(m,2)/Math.pow(f,2);var T=-1;(h<=Math.PI/2||h>3*Math.PI/2)&&(T=1);var w=T*Math.sqrt(1/y)+s,I=m*w+u;return[w,I];}return h<Math.PI?[s,c+f]:[s,c-f];}},/* 56 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return rt;});var r=t(1),n=t(42),s=/* @__PURE__ */t.n(n),c=t(57),l=t(28),f=t(24),h=t(30),m=t(59),u=t(53),y=t(60),T=/* @__PURE__ */t.n(y),w=t(46),I=/* @__PURE__ */t.n(w),S=t(31),O=t(40),d=t(21);t(1).glMatrix.setMatrixArrayType(Array);function v(nt,Y){if(nt==null)return{};var Z=p(nt,Y),C,L;if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(nt);for(L=0;L<z.length;L++)C=z[L],!(Y.indexOf(C)>=0)&&Object.prototype.propertyIsEnumerable.call(nt,C)&&(Z[C]=nt[C]);}return Z;}function p(nt,Y){if(nt==null)return{};var Z={},C=Object.keys(nt),L,z;for(z=0;z<C.length;z++)L=C[z],!(Y.indexOf(L)>=0)&&(Z[L]=nt[L]);return Z;}var x=Symbol("mesh"),E=Symbol("contours"),R=Symbol("stroke"),D=Symbol("fill"),U=Symbol("strokeColor"),M=Symbol("fillColor"),W=Symbol("transform"),X=Symbol("invertTransform"),B=Symbol("uniforms"),N=Symbol("texOptions"),$=Symbol("blend"),J=Symbol("applyTexture"),tt=Symbol("applyTransform"),at=Symbol("applyGradientTransform"),ut=Symbol("applyProgram"),V=Symbol("gradient"),Q=Symbol("filter"),ft=Symbol("opacity"),mt=Symbol("program"),yt=Symbol("attributes"),wt=Symbol("pass"),ht=Symbol("clipContext"),Nt=Symbol("applyClipPath");function Dt(nt,Y){var Z=nt[1][0]-nt[0][0],C=nt[1][1]-nt[0][1],L=[];for(var z=0;z<Y.length;z++){var K=Y[z],q=[(K[0]-nt[0][0])/Z,1-(K[1]-nt[0][1])/C];L.push(q);}return L;}function G(_ref62,_ref63,_ref64){var _ref65=_slicedToArray(_ref62,2),nt=_ref65[0],Y=_ref65[1];var _ref66=_slicedToArray(_ref63,4),Z=_ref66[0],C=_ref66[1],L=_ref66[2],z=_ref66[3];var K=_ref64.scale;return K||(nt/=L,Y=1-Y/z,nt-=Z,Y+=C),[nt,Y,0];}function k(nt,Y,Z){var C=I()(nt,Y,Z);return C.path=nt,C.simplify=Z,C.scale=Y,C;}var rt=/*#__PURE__*/function(){function rt(Y){_classCallCheck(this,rt);this[R]=null,this[D]=null,this[W]=[1,0,0,1,0,0],this[ft]=1,this[B]={},this[Q]=[],this[$]=null,this[N]={},this.contours=Y.contours,this[mt]=null,this[yt]={},this[wt]=[];}return _createClass(rt,[{key:"contours",get:function get(){return this[E];},set:function set(Y){this[x]=null,this[E]=Y;var Z=Y.scale;this.transformScale/Z>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(Y){this[mt]=Y,this[x]&&this[ut](Y);}},{key:"program",get:function get(){return this[mt];}},{key:"setAttribute",value:function setAttribute(Y,Z){Z==null?delete this[yt][Y]:this[yt][Y]=Z;}},{key:"getOpacity",value:function getOpacity(){return this[ft];}},{key:"setOpacity",value:function setOpacity(Y){if(Y<0||Y>1)throw new TypeError("Invalid opacity value.");this[x]&&this[x].positions.forEach(function(Z){Z[2]=1/Z[2]>0?Y:-Y;}),this[ft]=Y;}},{key:"setClipPath",value:function setClipPath(Y){this.clipPath=Y,this[B].u_clipSampler&&this[B].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[x]&&delete this[x].attributes.a_clipUV,Y&&this[x]&&this[Nt]();}},{key:Nt,value:function value(){if(this.clipPath){this[ht]||(this[ht]=d["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),Y=_this$boundingBox$[0],Z=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),C=_this$boundingBox$2[0],L=_this$boundingBox$2[1];C&&L&&(this[ht].width=C-Y,this[ht].height=L-Z);var z=this[ht].getContext("2d"),K=new Path2D(this.clipPath);z.clearRect(0,0,this[ht].width,this[ht].height),z.save(),z.translate(-Y,-Z),z.fillStyle="white",z.fill(K),z.restore(),this[x].clipPath=this[ht];var q=Dt(this.boundingBox,this[x].position0);this[x].attributes.a_clipUV=q;}}},{key:"getPointAtLength",value:function getPointAtLength(Y){return Object(u.getPointAtLength)(this[E],Y);}},{key:"getTotalLength",value:function getTotalLength(){return Object(u.getTotalLength)(this[E]);}},{key:"blend",get:function get(){return this[$]==null?"auto":this[$];},set:function set(Y){this[$]=Y,this[x]&&(this[x].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[x]&&this[x].boundingBox)return this[x].boundingBox;var Y=this.meshData;if(Y){var Z=Y.position0;if(Z.length)Y.boundingBox=s()(Z);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[D]?this[D].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[R]?this[R].lineWidth:0;}},{key:"lineCap",get:function get(){return this[R]?this[R].lineCap:"";}},{key:"lineJoin",get:function get(){return this[R]?this[R].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[R]?this[R].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[U]&&this[U][3]!==0?Object(f["default"])(this[U]):"";}},{key:"lineDash",get:function get(){return this[R]?this[R].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[R]?this[R].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[M]&&this[M][3]!==0?Object(f["default"])(this[M]):"";}},{key:"gradient",get:function get(){return this[V];}},{key:"texture",get:function get(){return this[B].u_texSampler?{image:this[B].u_texSampler._img,options:this[N]}:null;}},{key:"enableBlend",get:function get(){return this[$]===!0||this[$]===!1?this[$]:this[ft]<1||this[U]!=null&&this[U][3]<1||this[M]!=null&&this[M][3]<1||this[B].u_colorMatrix!=null&&this[B].u_colorMatrix[18]<1||this[B].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[Q].join(" ");}},{key:"transformMatrix",get:function get(){return this[W];}},{key:"invertMatrix",get:function get(){if(!this[X]){var Y=r.mat2d.invert(Array.of(0,0,0,0,0,0),this[W]);this[X]=Y;}return this[X];}},{key:"transformScale",get:function get(){var Y=this[W];return Math.max(Math.hypot(Y[0],Y[1]),Math.hypot(Y[2],Y[3]));}},{key:"uniforms",get:function get(){return this[B];}},{key:"pass",get:function get(){return this[wt];}},{key:ut,value:function value(Y){var Z=this[yt],C=this[x].position0,L=Object.entries(Y._attribute);for(var z=0;z<L.length;z++){var _L$z=_slicedToArray(L[z],2),K=_L$z[0],q=_L$z[1];if(K!=="a_color"&&K!=="a_sourceRect"&&q!=="ignored"){var it=Z[K];if(K==="uv"&&!it){var ct=this[x].boundingBox||s()(C);this[x].attributes[K]=Dt(ct,C);}else{this[x].attributes[K]=[];for(var _ct=0;_ct<C.length;_ct++){var xt=C[_ct];this[x].attributes[K].push(it?it(xt,z,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[x]){!this[D]&&!this[R]&&this.setFill();var Y=this[E],Z={};if(Y&&Y.length){if(this[D])try{var z=T()(Y,this[D]);z.positions=z.positions.map(function(K){return K.push(_this7[ft]),K;}),z.attributes={a_color:Array.from({length:z.positions.length}).map(function(){return _this7[M].map(function(K){return Math.round(255*K);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
|
|
18
|
+
},Z.fill=z;}catch(_unused3){}if(this[R]){var _z=this[R].lineDash;var K=Y;if(_z){var it=this[R].lineDashOffset;K=Object(u.getDashContours)(Y,_z,it);}var q=K.map(function(it,ct){var xt=it.length>1&&r.vec2.equals(it[0],it[it.length-1]),Ct=_this7[R].build(it,xt);return T()([Ct]);});q.forEach(function(it){it.positions=it.positions.map(function(ct){return ct.push(-_this7[ft]),ct;}),it.attributes={a_color:Array.from({length:it.positions.length}).map(function(){return _this7[U].map(function(ct){return Math.round(255*ct);});})};}),Z.stroke=Object(l["default"])(q);}}var C=Object(l["default"])([Z.fill,Z.stroke]);C.fillPointCount=Z.fill?Z.fill.positions.length:0,C.enableBlend=this.enableBlend,C.position0=C.positions.map(function(_ref67){var _ref68=_slicedToArray(_ref67,3),z=_ref68[0],K=_ref68[1],q=_ref68[2];return[z,K,q];}),C.uniforms=this[B],this[x]=C,this[B].u_texSampler&&this[J](C,this[N]);var L=this[W];Object(m.isUnitTransform)(L)||(this[tt](C,L),this[B].u_radialGradientVector&&this[at]()),this.clipPath&&this[Nt](),this[mt]&&this[ut](this[mt]);}return this._updateMatrix&&(this[x].matrix=this[W],this[tt](this[x],this[W]),this[B].u_radialGradientVector&&this[at]()),this[x];}},{key:tt,value:function value(Y,Z){var C=Y.positions,L=Y.position0;for(var z=0;z<C.length;z++){var _L$z2=_slicedToArray(L[z],2),K=_L$z2[0],q=_L$z2[1],it=C[z];it[0]=K*Z[0]+q*Z[2]+Z[4],it[1]=K*Z[1]+q*Z[3]+Z[5];}this._updateMatrix=!1;}},{key:at,value:function value(){var Y=this[W],Z=_toConsumableArray(this._radialGradientVector);if(Z){var _Z=_slicedToArray(Z,5),C=_Z[0],L=_Z[1],z=_Z[3],K=_Z[4];Z[0]=C*Y[0]+L*Y[2]+Y[4],Z[1]=C*Y[1]+L*Y[3]+Y[5],Z[3]=z*Y[0]+K*Y[2]+Y[4],Z[4]=z*Y[1]+K*Y[3]+Y[5],this[B].u_radialGradientVector=Z;}}},{key:J,value:function value(Y,Z){function C(ct,xt){return ct==null&&xt==null?!0:ct==null||xt==null?!1:ct[0]===xt[0]&&ct[1]===xt[1]&&ct[2]===xt[2]&&ct[3]===xt[3];}var L=this[B].u_texSampler;if(!L)return;var _L$_img=L._img,z=_L$_img.width,K=_L$_img.height,q=Z.srcRect;var it=Z.rect||[0,0];if(Z.rotated&&(it=[-it[1],it[0],it[3],it[2]]),it[2]==null&&(it[2]=q?q[2]:z),it[3]==null&&(it[3]=q?q[3]:K),Z.hidden)Y.textureCoord=Y.positions.map(function(){return[-1,-1,-1];});else if(!Y.textureCoord||!C(this[N].rect,Z.rect)||this[N].hidden!==Z.hidden||this[N].rotated!==Z.rotated){var ct=null;Z.rotated&&(ct=r.mat2d.rotate(Array.of(0,0,0,0,0,0),r.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),ct=r.mat2d.translate(Array.of(0,0,0,0,0,0),ct,[0,-it[2]])),Y.textureCoord=Y.position0.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),xt=_ref70[0],Ct=_ref70[1],Mt=_ref70[2];if(1/Mt>0){if(Z.rotated){var At=xt*ct[0]+Ct*ct[2]+ct[4],Ot=xt*ct[1]+Ct*ct[3]+ct[5];xt=At;Ct=Ot;}var bt=G([xt,Ct],[it[0]/it[2],it[1]/it[3],it[2],it[3]],Z);return Z.repeat&&(bt[2]=1),bt;}return[-1,-1,-1];});}if(q){var _ct2=[q[0]/z,q[1]/K,q[2]/z,q[3]/K];Y.attributes.a_sourceRect=Y.positions.map(function(){return[].concat(_ct2);});}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,L=k(this.contours.path,2*Y,C);this[x]=null,this[E]=L;}}},{key:"canIgnore",value:function canIgnore(){var Y=this[R]==null||this[R].lineWidth===0||this[U][3]===0,Z=this[D]==null||this[M][3]===0,C=this[B].u_radialGradientVector==null,L=this[B].u_texSampler==null;return this[ft]===0||this[mt]==null&&Y&&Z&&C&&L&&!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,Z=_ref71$cap===void 0?"butt":_ref71$cap,_ref71$join=_ref71.join,C=_ref71$join===void 0?"miter":_ref71$join,_ref71$miterLimit=_ref71.miterLimit,L=_ref71$miterLimit===void 0?10:_ref71$miterLimit,_ref71$color=_ref71.color,z=_ref71$color===void 0?[0,0,0,0]:_ref71$color,_ref71$lineDash=_ref71.lineDash,K=_ref71$lineDash===void 0?null:_ref71$lineDash,_ref71$lineDashOffset=_ref71.lineDashOffset,q=_ref71$lineDashOffset===void 0?0:_ref71$lineDashOffset,_ref71$roundSegments=_ref71.roundSegments,it=_ref71$roundSegments===void 0?20:_ref71$roundSegments;return this[x]=null,this[R]=new c["default"]({lineWidth:Y,lineCap:Z,lineJoin:C,miterLimit:L,roundSegments:it}),typeof z=="string"&&(z=Object(S["default"])(z)),this[U]=z,this[R].lineDash=K,this[R].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,Z=_ref72$color===void 0?[0,0,0,0]:_ref72$color;return this[x]=null,this[D]={rule:Y},typeof Z=="string"&&(Z=Object(S["default"])(Z)),this[M]=Z,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 Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(Y&&Y.image){var _Y=Y,C=_Y.image,L=_Y.rect;if(Y=C,Z.rect)for(var z=0;z<Z.rect.length;z++)L[z]=Z.rect[z];Z.rect=L;}return this[D]||this.setFill(),this.setUniforms({u_texSampler:Y}),this[x]&&this[J](this[x],Z),this[N]=Z,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref73.vector,Z=_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:Z,type:C});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref74.vector,Z=_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:Z,type:C});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},Y=_ref75.vector,Z=_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:Z,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,Z=_ref76.colors,_ref76$type=_ref76.type,C=_ref76$type===void 0?"fill":_ref76$type;Z=Z.map(function(_ref77){var K=_ref77.offset,q=_ref77.color;return typeof q=="string"&&(q=Object(S["default"])(q)),{offset:K,color:q};}),this[V]=this[V]||{},this[V][C]={vector:Y,colors:Z},Z.sort(function(K,q){return K.offset-q.offset;});var L=[];Z.forEach(function(_ref78){var K=_ref78.offset,q=_ref78.color;L.push.apply(L,[K].concat(_toConsumableArray(q)));});var z;if(Y.length===4?z=[Y[0],Y[1],0,Y[2],Y[3],0]:z=_toConsumableArray(Y),L.length<40&&L.push(-1),L.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=z,this[B].u_colorSteps=L,C==="fill"?this[B].u_gradientType=1:this[B].u_gradientType=0,this[at](),this;}},{key:"setUniforms",value:function setUniforms(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[B],Y),this;}},{key:"setTransform",value:function setTransform(){var Z=this[W];for(var _len3=arguments.length,Y=new Array(_len3),_key3=0;_key3<_len3;_key3++){Y[_key3]=arguments[_key3];}return r.mat2d.equals(Y,Z)||(this[W]=Y,delete this[X],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var Z=this[W];for(var _len4=arguments.length,Y=new Array(_len4),_key4=0;_key4<_len4;_key4++){Y[_key4]=arguments[_key4];}return this[W]=r.mat2d.multiply(Array.of(0,0,0,0,0,0),Z,Y),delete this[X],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(Y,Z){var C=r.mat2d.create();return C=r.mat2d.translate(Array.of(0,0,0,0,0,0),C,[Y,Z]),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),Z=_ref80[0],C=_ref80[1];var L=r.mat2d.create();return L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[Z,C]),L=r.mat2d.rotate(Array.of(0,0,0,0,0,0),L,Y),L=r.mat2d.translate(Array.of(0,0,0,0,0,0),L,[-Z,-C]),this.transform.apply(this,_toConsumableArray(L));}},{key:"scale",value:function scale(Y){var Z=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],L=_ref82[1];var z=r.mat2d.create();return z=r.mat2d.translate(Array.of(0,0,0,0,0,0),z,[C,L]),z=r.mat2d.scale(Array.of(0,0,0,0,0,0),z,[Y,Z]),z=r.mat2d.translate(Array.of(0,0,0,0,0,0),z,[-C,-L]),this.transform.apply(this,_toConsumableArray(z));}},{key:"skew",value:function skew(Y){var Z=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],L=_ref84[1];var z=r.mat2d.create();return z=r.mat2d.translate(Array.of(0,0,0,0,0,0),z,[C,L]),z=r.mat2d.multiply(Array.of(0,0,0,0,0,0),z,r.mat2d.fromValues(1,Math.tan(Z),Math.tan(Y),1,0,0)),z=r.mat2d.translate(Array.of(0,0,0,0,0,0),z,[-C,-L]),this.transform.apply(this,_toConsumableArray(z));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[Q].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 Z=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,Y=new Array(_len6),_key6=0;_key6<_len6;_key6++){Y[_key6]=arguments[_key6];}return Z?Z=Object(h.multiply)(Z,Y):Z=Y,this.setColorTransform.apply(this,_toConsumableArray(Z)),this;}},{key:"blur",value:function blur(Y){return this[Q].push("blur(".concat(Y,"px)")),this;}},{key:"brightness",value:function brightness(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("brightness(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.brightness)(Y)));}},{key:"contrast",value:function contrast(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("contrast(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.contrast)(Y)));}},{key:"dropShadow",value:function dropShadow(Y,Z){var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var L=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(L)&&(L=Object(f["default"])(L)),this[Q].push("drop-shadow(".concat(Y,"px ").concat(Z,"px ").concat(C,"px ").concat(L,")")),this;}},{key:"grayscale",value:function grayscale(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("grayscale(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.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[Q].push("hue-rotate(".concat(Y,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(h.hueRotate)(Y)));}},{key:"invert",value:function invert(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("invert(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.invert)(Y)));}},{key:"opacity",value:function opacity(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("opacity(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.opacity)(Y)));}},{key:"saturate",value:function saturate(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("saturate(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.saturate)(Y)));}},{key:"sepia",value:function sepia(){var Y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[Q].push("sepia(".concat(100*Y,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(h.sepia)(Y)));}},{key:"url",value:function url(Y){return this[Q].push("url(".concat(Y,")")),this;}},{key:"isPointCollision",value:function isPointCollision(Y,Z){var C=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var L=this.meshData,z=L.positions,K=L.cells,q=this.invertMatrix,it=q[0]*Y+q[2]*Z+q[4],ct=q[1]*Y+q[3]*Z+q[5],xt=this.boundingBox;if(it<xt[0][0]||it>xt[1][0]||ct<xt[0][1]||ct>xt[1][1])return!1;function Ct(_ref85,_ref86,_ref87){var _ref88=_slicedToArray(_ref85,2),Mt=_ref88[0],bt=_ref88[1];var _ref89=_slicedToArray(_ref86,2),At=_ref89[0],Ot=_ref89[1];var _ref90=_slicedToArray(_ref87,2),Lt=_ref90[0],Yt=_ref90[1];var $t=Lt-At,Wt=Yt-Ot,Qt=((Mt-At)*$t+(bt-Ot)*Wt)/(Math.pow($t,2)+Math.pow(Wt,2));return Qt>=0&&Qt<=1;}for(var Mt=0;Mt<K.length;Mt++){var bt=K[Mt];if(C==="fill"&&bt[0]>=L.fillPointCount)break;if(C==="stroke"&&bt[0]<L.fillPointCount)continue;var _bt$map=bt.map(function(ne){return z[ne];}),_bt$map2=_slicedToArray(_bt$map,3),_bt$map2$=_slicedToArray(_bt$map2[0],2),At=_bt$map2$[0],Ot=_bt$map2$[1],_bt$map2$2=_slicedToArray(_bt$map2[1],2),Lt=_bt$map2$2[0],Yt=_bt$map2$2[1],_bt$map2$3=_slicedToArray(_bt$map2[2],2),$t=_bt$map2$3[0],Wt=_bt$map2$3[1],Qt=Math.sign((Y-At)*(Yt-Ot)-(Lt-At)*(Z-Ot));if(Qt===0&&Ct([Y,Z],[At,Ot],[Lt,Yt]))return!0;var ue=Math.sign((Y-Lt)*(Wt-Yt)-($t-Lt)*(Z-Yt));if(ue===0&&Ct([Y,Z],[Lt,Yt],[$t,Wt]))return!0;var ie=Math.sign((Y-$t)*(Ot-Wt)-(At-$t)*(Z-Wt));if(ie===0&&Ct([Y,Z],[$t,Wt],[At,Ot])||Qt===1&&ue===1&&ie===1||Qt===-1&&ue===-1&&ie===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(Y,Z){return this.isPointCollision(Y,Z,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(Y,Z){return this.isPointCollision(Y,Z,"stroke");}},{key:"addPass",value:function addPass(Y){var Z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var C=Z.width,L=Z.height,z=v(Z,["width","height"]);var K=new O["default"]();K.rect(0,0,C,L);var q=new rt(K,{width:C,height:L});q.setUniforms(z),q.setProgram(Y),this[wt].push(q);}}]);}();},/* 57 *//***/function(i,e,t){t.r(e);var r=t(58);t(1).glMatrix.setMatrixArrayType(Array),e["default"]=r.Stroke;},/* 58 *//***/function(i,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)(),s=Object(r.create)(),c=Object(r.create)(),l=Object(r.create)(),f=Object(r.create)(),h=1e20;var m=/*#__PURE__*/function(){function m(){var _ref91=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref91$lineWidth=_ref91.lineWidth,I=_ref91$lineWidth===void 0?1:_ref91$lineWidth,_ref91$lineJoin=_ref91.lineJoin,S=_ref91$lineJoin===void 0?"miter":_ref91$lineJoin,_ref91$miterLimit=_ref91.miterLimit,O=_ref91$miterLimit===void 0?10:_ref91$miterLimit,_ref91$lineCap=_ref91.lineCap,d=_ref91$lineCap===void 0?"butt":_ref91$lineCap,_ref91$roundSegments=_ref91.roundSegments,v=_ref91$roundSegments===void 0?20:_ref91$roundSegments;_classCallCheck(this,m);this.lineWidth=I,this.lineJoin=S,this.miterLimit=O,this.lineCap=d,this.roundSegments=v,this._normal=null;}return _createClass(m,[{key:"build",value:function build(I){var S=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var O=I.length;if(I=_toConsumableArray(I),O<2)return I;S&&((I[0][0]!==I[O-1][0]||I[0][1]!==I[O-1][1])&&I.push(_toConsumableArray(I[0])),I.push(_toConsumableArray(I[1]))),O=I.length,this._normal=null;var d={left:[],right:[]},v=this.lineWidth/2,p=this.lineCap;if(!S&&p==="square"){Object(r.direction)(s,I[0],I[1]),Object(r.scaleAndAdd)(I[0],I[0],s,v);var E=I.length-1;Object(r.direction)(s,I[E],I[E-1]),Object(r.scaleAndAdd)(I[E],I[E],s,v);}for(var _E5=1;_E5<O;_E5++){var R=I[_E5-1],D=I[_E5],U=I[_E5+1];this._seg(d,R,D,U,v,S);}return!S&&p==="round"&&T(d,this.roundSegments),[].concat(_toConsumableArray(d.left),_toConsumableArray(d.right.reverse()));}},{key:"_seg",value:function _seg(I,S,O,d,v,p){var x=this.lineJoin==="bevel",E=this.lineJoin==="round";if(Object(r.direction)(s,O,S),this._normal||(this._normal=Object(r.create)(),Object(r.normal)(this._normal,s)),I.left.length||y(I,S,this._normal,v),!d)Object(r.normal)(this._normal,s),p?y(I,S,this._normal,v):y(I,O,this._normal,v);else{Object(r.direction)(c,d,O);var R=Object(r.computeMiter)(l,f,s,c,v);R=Math.min(R,h);var D=Object(r.dot)(l,this._normal)<0?-1:1;var U=x||E;if(!U&&this.lineJoin==="miter"&&R/v>this.miterLimit&&(U=!0),U){Object(r.scaleAndAdd)(n,O,this._normal,-v*D),u(I,n,D);var M=1/0;S&&(M=Math.min(M,Math.hypot(O[0]-S[0],O[1]-S[1]))),d&&(M=Math.min(M,Math.hypot(d[0]-O[0],d[1]-O[1])));var W=Math.max(v,Math.min(R,M));if(Object(r.scaleAndAdd)(n,O,f,W*D),u(I,n,-D),d)if(Object(r.normal)(n,c),Object(r.copy)(this._normal,n),Object(r.scaleAndAdd)(n,O,n,-v*D),E){var X=Object(r.clone)(n),B=D>0?I.left[I.left.length-1]:I.right[I.right.length-1],N=Object(r.clone)(O),$=Object(r.sub)(Object(r.create)(),B,N),J=Object(r.sub)(Object(r.create)(),X,N),tt=Math.PI/this.roundSegments;for(var at=0;at<this.roundSegments&&(Object(r.rotate)($,$,[0,0],D*tt),Math.sign(Object(r.cross)(n,$,J)[2])===D);at++)Object(r.add)(n,$,N),u(I,n,D);u(I,X,D);}else u(I,n,D);}else y(I,O,f,R),Object(r.copy)(this._normal,f);}}}]);}();function u(w,I,S){S>0?w.left.push(Object(r.clone)(I)):w.right.push(Object(r.clone)(I));}function y(w,I,S,O){var d=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(r.scaleAndAdd)(n,I,S,-O),u(w,n,-d),Object(r.scaleAndAdd)(n,I,S,O),u(w,n,d);}function T(_ref92,S){var w=_ref92.left,I=_ref92.right;var O=Object(r.create)(),d=Object(r.create)();var v=w[0],p=I[0],x=[0.5*(v[0]+p[0]),0.5*(v[1]+p[1])];Object(r.sub)(d,v,x);for(var E=1;E<=S;E++){var R=-1*Math.PI*E/S;Object(r.rotate)(O,d,[0,0],R),Object(r.add)(n,x,O),w.unshift(Object(r.clone)(n));}v=I[I.length-1],p=w[w.length-1],x=[0.5*(v[0]+p[0]),0.5*(v[1]+p[1])],Object(r.sub)(d,v,x);for(var _E6=1;_E6<=S;_E6++){var _R2=-1*Math.PI*_E6/S;Object(r.rotate)(O,d,[0,0],_R2),Object(r.add)(n,x,O),I.push(Object(r.clone)(n));}}},/* 59 *//***/function(i,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(i,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r=t(61),n=t(62);i.exports=function(s,c){if(c=c||{},s=s.filter(function(S){return S.length>2;}),s.length===0)return{positions:[],cells:[]};typeof c.vertexSize!="number"&&(c.vertexSize=s[0][0].length),s=s.map(function(S){return S.reduce(function(O,d){return O.concat(d);});});var l=c.rule==="evenodd"?r.WINDING_ODD:r.WINDING_NONZERO;for(var f=r.tesselate(n({contours:s,windingRule:l,elementType:r.POLYGONS,polySize:3,vertexSize:2},c)),h=[],m=0;m<f.vertices.length;m+=c.vertexSize){var u=f.vertices.slice(m,m+c.vertexSize);h.push(u);}var y=[];for(m=0;m<f.elements.length;m+=3){var T=f.elements[m],w=f.elements[m+1],I=f.elements[m+2];y.push([T,w,I]);}return{positions:h,cells:y};};},/* 61 *//***/function(i,e,t){t(1).glMatrix.setMatrixArrayType(Array);var r={},n={};i.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(d){for(var v=d.debug||!1,p=new O(),x=0;x<d.contours.length;x++)p.addContour(d.vertexSize||2,d.contours[x]);return p.tesselate(d.windingRule||r.WINDING_ODD,d.elementType||r.POLYGONS,d.polySize||3,d.vertexSize||2,d.normal||[0,0,1]),{vertices:p.vertices,vertexIndices:p.vertexIndices,vertexCount:p.vertexCount,elements:p.elements,elementCount:p.elementCount,mesh:v?p.mesh:void 0};};var s=function s(d){if(!d)throw"Assertion Failed!";};function c(){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 l(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function f(d){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=d;}f.prototype={get Rface(){return this.Sym.Lface;},set Rface(d){this.Sym.Lface=d;},get Dst(){return this.Sym.Org;},set Dst(d){this.Sym.Org=d;},get Oprev(){return this.Sym.Lnext;},set Oprev(d){this.Sym.Lnext=d;},get Lprev(){return this.Onext.Sym;},set Lprev(d){this.Onext.Sym=d;},get Dprev(){return this.Lnext.Sym;},set Dprev(d){this.Lnext.Sym=d;},get Rprev(){return this.Sym.Onext;},set Rprev(d){this.Sym.Onext=d;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(d){this.Sym.Onext.Sym=d;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(d){this.Sym.Lnext.Sym=d;}/* 3 pointers */};function h(){var d=new c(),v=new l(),p=new f(0),x=new f(1);d.next=d.prev=d,d.anEdge=null,v.next=v.prev=v,v.anEdge=null,v.trail=null,v.marked=!1,v.inside=!1,p.next=p,p.Sym=x,p.Onext=null,p.Lnext=null,p.Org=null,p.Lface=null,p.winding=0,p.activeRegion=null,x.next=x,x.Sym=p,x.Onext=null,x.Lnext=null,x.Org=null,x.Lface=null,x.winding=0,x.activeRegion=null,this.vHead=d,this.fHead=v,this.eHead=p,this.eHeadSym=x;}h.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_(d){var v=new f(0),p=new f(1);d.Sym.side<d.side&&(d=d.Sym);var x=d.Sym.next;return p.next=x,x.Sym.next=v,v.next=d,d.Sym.next=p,v.Sym=p,v.Onext=v,v.Lnext=p,v.Org=null,v.Lface=null,v.winding=0,v.activeRegion=null,p.Sym=v,p.Onext=p,p.Lnext=v,p.Org=null,p.Lface=null,p.winding=0,p.activeRegion=null,v;},/* 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_(d,v){var p=d.Onext,x=v.Onext;p.Sym.Lnext=v,x.Sym.Lnext=d,d.Onext=x,v.Onext=p;},/* 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_(d,v,p){var x=d;s(x!==null);var E=p.prev;x.prev=E,E.next=x,x.next=p,p.prev=x,x.anEdge=v;var R=v;do R.Org=x,R=R.Onext;while(R!==v);},/* 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_(d,v,p){var x=d;s(x!==null);var E=p.prev;x.prev=E,E.next=x,x.next=p,p.prev=x,x.anEdge=v,x.trail=null,x.marked=!1,x.inside=p.inside;var R=v;do R.Lface=x,R=R.Lnext;while(R!==v);},/* 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_(d){d.Sym.side<d.side&&(d=d.Sym);var v=d.next,p=d.Sym.next;v.Sym.next=p,p.Sym.next=v;},/* 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_(d,v){var p=d.anEdge,x=p;do x.Org=v,x=x.Onext;while(x!==p);var E=d.prev,R=d.next;R.prev=E,E.next=R;},/* 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_(d,v){var p=d.anEdge,x=p;do x.Lface=v,x=x.Lnext;while(x!==p);var E=d.prev,R=d.next;R.prev=E,E.next=R;},/****************** 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 d=new c(),v=new c(),p=new l(),x=this.makeEdge_(this.eHead);return this.makeVertex_(d,x,this.vHead),this.makeVertex_(v,x.Sym,this.vHead),this.makeFace_(p,x,this.fHead),x;},/* 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(d,v){var p=!1,x=!1;if(d!==v){if(v.Org!==d.Org&&(x=!0,this.killVertex_(v.Org,d.Org)),v.Lface!==d.Lface&&(p=!0,this.killFace_(v.Lface,d.Lface)),this.splice_(v,d),!x){var E=new c();this.makeVertex_(E,v,d.Org),d.Org.anEdge=d;}if(!p){var R=new l();this.makeFace_(R,v,d.Lface),d.Lface.anEdge=d;}}},/* 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(d){var v=d.Sym,p=!1;if(d.Lface!==d.Rface&&(p=!0,this.killFace_(d.Lface,d.Rface)),d.Onext===d)this.killVertex_(d.Org,null);else if(d.Rface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev),!p){var x=new l();this.makeFace_(x,d,d.Lface);}v.Onext===v?(this.killVertex_(v.Org,null),this.killFace_(v.Lface,null)):(d.Lface.anEdge=v.Oprev,v.Org.anEdge=v.Onext,this.splice_(v,v.Oprev)),this.killEdge_(d);},/******************** 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(d){var v=this.makeEdge_(d),p=v.Sym;this.splice_(v,d.Lnext),v.Org=d.Dst;var x=new c();return this.makeVertex_(x,p,v.Org),v.Lface=p.Lface=d.Lface,v;},/* 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(d,v){var p=this.addEdgeVertex(d),x=p.Sym;return this.splice_(d.Sym,d.Sym.Oprev),this.splice_(d.Sym,x),d.Dst=x.Org,x.Dst.anEdge=x.Sym,x.Rface=d.Rface,x.winding=d.winding,x.Sym.winding=d.Sym.winding,x;},/* 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(d,v){var p=!1,x=this.makeEdge_(d),E=x.Sym;if(v.Lface!==d.Lface&&(p=!0,this.killFace_(v.Lface,d.Lface)),this.splice_(x,d.Lnext),this.splice_(E,v),x.Org=d.Dst,E.Org=v.Org,x.Lface=E.Lface=d.Lface,d.Lface.anEdge=E,!p){var R=new l();this.makeFace_(R,x,d.Lface);}return x;},/* 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(d){var v=d.anEdge,p,x,E,R,D;x=v.Lnext;do p=x,x=p.Lnext,p.Lface=null,p.Rface===null&&(p.Onext===p?this.killVertex_(p.Org,null):(p.Org.anEdge=p.Onext,this.splice_(p,p.Oprev)),E=p.Sym,E.Onext===E?this.killVertex_(E.Org,null):(E.Org.anEdge=E.Onext,this.splice_(E,E.Oprev)),this.killEdge_(p));while(p!=v);R=d.prev,D=d.next,D.prev=R,R.next=D;},countFaceVerts_:function countFaceVerts_(d){var v=d.anEdge,p=0;do p++,v=v.Lnext;while(v!==d.anEdge);return p;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
|
|
130
|
+
mergeConvexFaces:function mergeConvexFaces(d){var v,p,x,E,R,D,U;for(v=this.fHead.next;v!==this.fHead;v=v.next)if(v.inside)for(p=v.anEdge,R=p.Org;x=p.Lnext,E=p.Sym,E&&E.Lface&&E.Lface.inside&&(D=this.countFaceVerts_(v),U=this.countFaceVerts_(E.Lface),D+U-2<=d&&n.vertCCW(p.Lprev.Org,p.Org,E.Lnext.Lnext.Org)&&n.vertCCW(E.Lprev.Org,E.Org,p.Lnext.Lnext.Org)&&(x=E.Lnext,this["delete"](E),p=null,E=null)),!(p&&p.Lnext.Org===R);)p=x;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
|
|
131
|
+
*/check:function check(){var d=this.fHead,v=this.vHead,p=this.eHead,x,E,R,D,U,M;for(E=d,E=d;(x=E.next)!==d;E=x){s(x.prev===E),U=x.anEdge;do s(U.Sym!==U),s(U.Sym.Sym===U),s(U.Lnext.Onext.Sym===U),s(U.Onext.Sym.Lnext===U),s(U.Lface===x),U=U.Lnext;while(U!==x.anEdge);}for(s(x.prev===E&&x.anEdge===null),D=v,D=v;(R=D.next)!==v;D=R){s(R.prev===D),U=R.anEdge;do s(U.Sym!==U),s(U.Sym.Sym===U),s(U.Lnext.Onext.Sym===U),s(U.Onext.Sym.Lnext===U),s(U.Org===R),U=U.Onext;while(U!==R.anEdge);}for(s(R.prev===D&&R.anEdge===null),M=p,M=p;(U=M.next)!==p;M=U)s(U.Sym.next===M.Sym),s(U.Sym!==U),s(U.Sym.Sym===U),s(U.Org!==null),s(U.Dst!==null),s(U.Lnext.Onext.Sym===U),s(U.Onext.Sym.Lnext===U);s(U.Sym.next===M.Sym&&U.Sym===this.eHeadSym&&U.Sym.Sym===U&&U.Org===null&&U.Dst===null&&U.Lface===null&&U.Rface===null);}},n.vertEq=function(d,v){return d.s===v.s&&d.t===v.t;},n.vertLeq=function(d,v){return d.s<v.s||d.s===v.s&&d.t<=v.t;},n.transLeq=function(d,v){return d.t<v.t||d.t===v.t&&d.s<=v.s;},n.edgeGoesLeft=function(d){return n.vertLeq(d.Dst,d.Org);},n.edgeGoesRight=function(d){return n.vertLeq(d.Org,d.Dst);},n.vertL1dist=function(d,v){return Math.abs(d.s-v.s)+Math.abs(d.t-v.t);},n.edgeEval=function(d,v,p){s(n.vertLeq(d,v)&&n.vertLeq(v,p));var x=v.s-d.s,E=p.s-v.s;return x+E>0?x<E?v.t-d.t+(d.t-p.t)*(x/(x+E)):v.t-p.t+(p.t-d.t)*(E/(x+E)):0;},n.edgeSign=function(d,v,p){s(n.vertLeq(d,v)&&n.vertLeq(v,p));var x=v.s-d.s,E=p.s-v.s;return x+E>0?(v.t-p.t)*x+(v.t-d.t)*E:0;},n.transEval=function(d,v,p){s(n.transLeq(d,v)&&n.transLeq(v,p));var x=v.t-d.t,E=p.t-v.t;return x+E>0?x<E?v.s-d.s+(d.s-p.s)*(x/(x+E)):v.s-p.s+(p.s-d.s)*(E/(x+E)):0;},n.transSign=function(d,v,p){s(n.transLeq(d,v)&&n.transLeq(v,p));var x=v.t-d.t,E=p.t-v.t;return x+E>0?(v.s-p.s)*x+(v.s-d.s)*E:0;},n.vertCCW=function(d,v,p){return d.s*(v.t-p.t)+v.s*(p.t-d.t)+p.s*(d.t-v.t)>=0;},n.interpolate=function(d,v,p,x){return d=d<0?0:d,p=p<0?0:p,d<=p?p===0?(v+x)/2:v+(x-v)*(d/(d+p)):x+(v-x)*(p/(d+p));},n.intersect=function(d,v,p,x,E){var R,D,U;n.vertLeq(d,v)||(U=d,d=v,v=U),n.vertLeq(p,x)||(U=p,p=x,x=U),n.vertLeq(d,p)||(U=d,d=p,p=U,U=v,v=x,x=U),n.vertLeq(p,v)?n.vertLeq(v,x)?(R=n.edgeEval(d,p,v),D=n.edgeEval(p,v,x),R+D<0&&(R=-R,D=-D),E.s=n.interpolate(R,p.s,D,v.s)):(R=n.edgeSign(d,p,v),D=-n.edgeSign(d,x,v),R+D<0&&(R=-R,D=-D),E.s=n.interpolate(R,p.s,D,x.s)):E.s=(p.s+v.s)/2,n.transLeq(d,v)||(U=d,d=v,v=U),n.transLeq(p,x)||(U=p,p=x,x=U),n.transLeq(d,p)||(U=d,d=p,p=U,U=v,v=x,x=U),n.transLeq(p,v)?n.transLeq(v,x)?(R=n.transEval(d,p,v),D=n.transEval(p,v,x),R+D<0&&(R=-R,D=-D),E.t=n.interpolate(R,p.t,D,v.t)):(R=n.transSign(d,p,v),D=-n.transSign(d,x,v),R+D<0&&(R=-R,D=-D),E.t=n.interpolate(R,p.t,D,x.t)):E.t=(p.t+v.t)/2;};function m(){this.key=null,this.next=null,this.prev=null;}function u(d,v){this.head=new m(),this.head.next=this.head,this.head.prev=this.head,this.frame=d,this.leq=v;}u.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(d){return this.insertBefore(this.head,d);},search:function search(d){var v=this.head;do v=v.next;while(v.key!==null&&!this.leq(this.frame,d,v.key));return v;},insertBefore:function insertBefore(d,v){do d=d.prev;while(d.key!==null&&!this.leq(this.frame,d.key,v));var p=new m();return p.key=v,p.next=d.next,d.next.prev=p,p.prev=d,d.next=p,p;},"delete":function _delete(d){d.next.prev=d.prev,d.prev.next=d.next;}};function y(){this.handle=null;}function T(){this.key=null,this.node=null;}function w(d,v){this.size=0,this.max=d,this.nodes=[],this.nodes.length=d+1;var p;for(p=0;p<this.nodes.length;p++)this.nodes[p]=new y();for(this.handles=[],this.handles.length=d+1,p=0;p<this.handles.length;p++)this.handles[p]=new T();this.initialized=!1,this.freeList=0,this.leq=v,this.nodes[1].handle=1,this.handles[1].key=null;}w.prototype={floatDown_:function floatDown_(d){var v=this.nodes,p=this.handles,x,E,R;for(x=v[d].handle;;){if(R=d<<1,R<this.size&&this.leq(p[v[R+1].handle].key,p[v[R].handle].key)&&++R,s(R<=this.max),E=v[R].handle,R>this.size||this.leq(p[x].key,p[E].key)){v[d].handle=x,p[x].node=d;break;}v[d].handle=E,p[E].node=d,d=R;}},floatUp_:function floatUp_(d){var v=this.nodes,p=this.handles,x,E,R;for(x=v[d].handle;;){if(R=d>>1,E=v[R].handle,R===0||this.leq(p[E].key,p[x].key)){v[d].handle=x,p[x].node=d;break;}v[d].handle=E,p[E].node=d,d=R;}},init:function init(){for(var d=this.size;d>=1;--d)this.floatDown_(d);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(d){var v,p;if(v=++this.size,v*2>this.max){this.max*=2;var x,E;for(E=this.nodes.length,this.nodes.length=this.max+1,x=E;x<this.nodes.length;x++)this.nodes[x]=new y();for(E=this.handles.length,this.handles.length=this.max+1,x=E;x<this.handles.length;x++)this.handles[x]=new T();}return this.freeList===0?p=v:(p=this.freeList,this.freeList=this.handles[p].node),this.nodes[v].handle=p,this.handles[p].node=v,this.handles[p].key=d,this.initialized&&this.floatUp_(v),p;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
|
|
133
|
+
extractMin:function extractMin(){var d=this.nodes,v=this.handles,p=d[1].handle,x=v[p].key;return this.size>0&&(d[1].handle=d[this.size].handle,v[d[1].handle].node=1,v[p].key=null,v[p].node=this.freeList,this.freeList=p,--this.size,this.size>0&&this.floatDown_(1)),x;},"delete":function _delete(d){var v=this.nodes,p=this.handles,x;s(d>=1&&d<=this.max&&p[d].key!==null),x=p[d].node,v[x].handle=v[this.size].handle,p[v[x].handle].node=x,--this.size,x<=this.size&&(x<=1||this.leq(p[v[x>>1].handle].key,p[v[x].handle].key)?this.floatDown_(x):this.floatUp_(x)),p[d].key=null,p[d].node=this.freeList,this.freeList=d;}};function I(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var S={};S.regionBelow=function(d){return d.nodeUp.prev.key;},S.regionAbove=function(d){return d.nodeUp.next.key;},S.debugEvent=function(d){},S.addWinding=function(d,v){d.winding+=v.winding,d.Sym.winding+=v.Sym.winding;},S.edgeLeq=function(d,v,p){var x=d.event,D,U,E=v.eUp,R=p.eUp;if(E.Dst===x)return R.Dst===x?n.vertLeq(E.Org,R.Org)?n.edgeSign(R.Dst,E.Org,R.Org)<=0:n.edgeSign(E.Dst,R.Org,E.Org)>=0:n.edgeSign(R.Dst,x,R.Org)<=0;if(R.Dst===x)return n.edgeSign(E.Dst,x,E.Org)>=0;var D=n.edgeEval(E.Dst,x,E.Org),U=n.edgeEval(R.Dst,x,R.Org);return D>=U;},S.deleteRegion=function(d,v){v.fixUpperEdge&&s(v.eUp.winding===0),v.eUp.activeRegion=null,d.dict["delete"](v.nodeUp);},S.fixUpperEdge=function(d,v,p){s(v.fixUpperEdge),d.mesh["delete"](v.eUp),v.fixUpperEdge=!1,v.eUp=p,p.activeRegion=v;},S.topLeftRegion=function(d,v){var p=v.eUp.Org,x;do v=S.regionAbove(v);while(v.eUp.Org===p);if(v.fixUpperEdge){if(x=d.mesh.connect(S.regionBelow(v).eUp.Sym,v.eUp.Lnext),x===null)return null;S.fixUpperEdge(d,v,x),v=S.regionAbove(v);}return v;},S.topRightRegion=function(d){var v=d.eUp.Dst;do d=S.regionAbove(d);while(d.eUp.Dst===v);return d;},S.addRegionBelow=function(d,v,p){var x=new I();return x.eUp=p,x.nodeUp=d.dict.insertBefore(v.nodeUp,x),x.fixUpperEdge=!1,x.sentinel=!1,x.dirty=!1,p.activeRegion=x,x;},S.isWindingInside=function(d,v){switch(d.windingRule){case r.WINDING_ODD:return(v&1)!==0;case r.WINDING_NONZERO:return v!==0;case r.WINDING_POSITIVE:return v>0;case r.WINDING_NEGATIVE:return v<0;case r.WINDING_ABS_GEQ_TWO:return v>=2||v<=-2;}return s(!1),!1;},S.computeWinding=function(d,v){v.windingNumber=S.regionAbove(v).windingNumber+v.eUp.winding,v.inside=S.isWindingInside(d,v.windingNumber);},S.finishRegion=function(d,v){var p=v.eUp,x=p.Lface;x.inside=v.inside,x.anEdge=p,S.deleteRegion(d,v);},S.finishLeftRegions=function(d,v,p){for(var x,D,E=null,R=v,D=v.eUp;R!==p;){if(R.fixUpperEdge=!1,E=S.regionBelow(R),x=E.eUp,x.Org!=D.Org){if(!E.fixUpperEdge){S.finishRegion(d,R);break;}x=d.mesh.connect(D.Lprev,x.Sym),S.fixUpperEdge(d,E,x);}D.Onext!==x&&(d.mesh.splice(x.Oprev,x),d.mesh.splice(D,x)),S.finishRegion(d,R),D=E.eUp,R=E;}return D;},S.addRightEdges=function(d,v,p,x,E,R){var D,U,M,W,X=!0;M=p;do s(n.vertLeq(M.Org,M.Dst)),S.addRegionBelow(d,v,M.Sym),M=M.Onext;while(M!==x);for(E===null&&(E=S.regionBelow(v).eUp.Rprev),U=v,W=E;D=S.regionBelow(U),M=D.eUp.Sym,M.Org===W.Org;)M.Onext!==W&&(d.mesh.splice(M.Oprev,M),d.mesh.splice(W.Oprev,M)),D.windingNumber=U.windingNumber-M.winding,D.inside=S.isWindingInside(d,D.windingNumber),U.dirty=!0,!X&&S.checkForRightSplice(d,U)&&(S.addWinding(M,W),S.deleteRegion(d,U),d.mesh["delete"](W)),X=!1,U=D,W=M;U.dirty=!0,s(U.windingNumber-M.winding===D.windingNumber),R&&S.walkDirtyRegions(d,U);},S.spliceMergeVertices=function(d,v,p){d.mesh.splice(v,p);},S.vertexWeights=function(d,v,p){var x=n.vertL1dist(v,d),E=n.vertL1dist(p,d),R=0.5*E/(x+E),D=0.5*x/(x+E);d.coords[0]+=R*v.coords[0]+D*p.coords[0],d.coords[1]+=R*v.coords[1]+D*p.coords[1],d.coords[2]+=R*v.coords[2]+D*p.coords[2];},S.getIntersectData=function(d,v,p,x,E,R){v.coords[0]=v.coords[1]=v.coords[2]=0,v.idx=-1,S.vertexWeights(v,p,x),S.vertexWeights(v,E,R);},S.checkForRightSplice=function(d,v){var p=S.regionBelow(v),x=v.eUp,E=p.eUp;if(n.vertLeq(x.Org,E.Org)){if(n.edgeSign(E.Dst,x.Org,E.Org)>0)return!1;n.vertEq(x.Org,E.Org)?x.Org!==E.Org&&(d.pq["delete"](x.Org.pqHandle),S.spliceMergeVertices(d,E.Oprev,x)):(d.mesh.splitEdge(E.Sym),d.mesh.splice(x,E.Oprev),v.dirty=p.dirty=!0);}else{if(n.edgeSign(x.Dst,E.Org,x.Org)<0)return!1;S.regionAbove(v).dirty=v.dirty=!0,d.mesh.splitEdge(x.Sym),d.mesh.splice(E.Oprev,x);}return!0;},S.checkForLeftSplice=function(d,v){var p=S.regionBelow(v),x=v.eUp,E=p.eUp,R;if(s(!n.vertEq(x.Dst,E.Dst)),n.vertLeq(x.Dst,E.Dst)){if(n.edgeSign(x.Dst,E.Dst,x.Org)<0)return!1;S.regionAbove(v).dirty=v.dirty=!0,R=d.mesh.splitEdge(x),d.mesh.splice(E.Sym,R),R.Lface.inside=v.inside;}else{if(n.edgeSign(E.Dst,x.Dst,E.Org)>0)return!1;v.dirty=p.dirty=!0,R=d.mesh.splitEdge(E),d.mesh.splice(x.Lnext,E.Sym),R.Rface.inside=v.inside;}return!0;},S.checkForIntersect=function(d,v){var p=S.regionBelow(v),x=v.eUp,E=p.eUp,R=x.Org,D=E.Org,U=x.Dst,M=E.Dst,W,X,B=new c(),N,$;if(s(!n.vertEq(M,U)),s(n.edgeSign(U,d.event,R)<=0),s(n.edgeSign(M,d.event,D)>=0),s(R!==d.event&&D!==d.event),s(!v.fixUpperEdge&&!p.fixUpperEdge),R===D||(W=Math.min(R.t,U.t),X=Math.max(D.t,M.t),W>X))return!1;if(n.vertLeq(R,D)){if(n.edgeSign(M,R,D)>0)return!1;}else if(n.edgeSign(U,D,R)<0)return!1;return S.debugEvent(d),n.intersect(U,R,M,D,B),s(Math.min(R.t,U.t)<=B.t),s(B.t<=Math.max(D.t,M.t)),s(Math.min(M.s,U.s)<=B.s),s(B.s<=Math.max(D.s,R.s)),n.vertLeq(B,d.event)&&(B.s=d.event.s,B.t=d.event.t),N=n.vertLeq(R,D)?R:D,n.vertLeq(N,B)&&(B.s=N.s,B.t=N.t),n.vertEq(B,R)||n.vertEq(B,D)?(S.checkForRightSplice(d,v),!1):!n.vertEq(U,d.event)&&n.edgeSign(U,d.event,B)>=0||!n.vertEq(M,d.event)&&n.edgeSign(M,d.event,B)<=0?M===d.event?(d.mesh.splitEdge(x.Sym),d.mesh.splice(E.Sym,x),v=S.topLeftRegion(d,v),x=S.regionBelow(v).eUp,S.finishLeftRegions(d,S.regionBelow(v),p),S.addRightEdges(d,v,x.Oprev,x,x,!0),!0):U===d.event?(d.mesh.splitEdge(E.Sym),d.mesh.splice(x.Lnext,E.Oprev),p=v,v=S.topRightRegion(v),$=S.regionBelow(v).eUp.Rprev,p.eUp=E.Oprev,E=S.finishLeftRegions(d,p,null),S.addRightEdges(d,v,E.Onext,x.Rprev,$,!0),!0):(n.edgeSign(U,d.event,B)>=0&&(S.regionAbove(v).dirty=v.dirty=!0,d.mesh.splitEdge(x.Sym),x.Org.s=d.event.s,x.Org.t=d.event.t),n.edgeSign(M,d.event,B)<=0&&(v.dirty=p.dirty=!0,d.mesh.splitEdge(E.Sym),E.Org.s=d.event.s,E.Org.t=d.event.t),!1):(d.mesh.splitEdge(x.Sym),d.mesh.splitEdge(E.Sym),d.mesh.splice(E.Oprev,x),x.Org.s=B.s,x.Org.t=B.t,x.Org.pqHandle=d.pq.insert(x.Org),S.getIntersectData(d,x.Org,R,U,D,M),S.regionAbove(v).dirty=v.dirty=p.dirty=!0,!1);},S.walkDirtyRegions=function(d,v){for(var p=S.regionBelow(v),x,E;;){for(;p.dirty;)v=p,p=S.regionBelow(p);if(!v.dirty&&(p=v,v=S.regionAbove(v),v===null||!v.dirty))return;if(v.dirty=!1,x=v.eUp,E=p.eUp,x.Dst!==E.Dst&&S.checkForLeftSplice(d,v)&&(p.fixUpperEdge?(S.deleteRegion(d,p),d.mesh["delete"](E),p=S.regionBelow(v),E=p.eUp):v.fixUpperEdge&&(S.deleteRegion(d,v),d.mesh["delete"](x),v=S.regionAbove(p),x=v.eUp)),x.Org!==E.Org)if(x.Dst!==E.Dst&&!v.fixUpperEdge&&!p.fixUpperEdge&&(x.Dst===d.event||E.Dst===d.event)){if(S.checkForIntersect(d,v))return;}else S.checkForRightSplice(d,v);x.Org===E.Org&&x.Dst===E.Dst&&(S.addWinding(E,x),S.deleteRegion(d,v),d.mesh["delete"](x),v=S.regionAbove(p));}},S.connectRightVertex=function(d,v,p){var x,E=p.Onext,R=S.regionBelow(v),D=v.eUp,U=R.eUp,M=!1;if(D.Dst!==U.Dst&&S.checkForIntersect(d,v),n.vertEq(D.Org,d.event)&&(d.mesh.splice(E.Oprev,D),v=S.topLeftRegion(d,v),E=S.regionBelow(v).eUp,S.finishLeftRegions(d,S.regionBelow(v),R),M=!0),n.vertEq(U.Org,d.event)&&(d.mesh.splice(p,U.Oprev),p=S.finishLeftRegions(d,R,null),M=!0),M){S.addRightEdges(d,v,p.Onext,E,E,!0);return;}n.vertLeq(U.Org,D.Org)?x=U.Oprev:x=D,x=d.mesh.connect(p.Lprev,x),S.addRightEdges(d,v,x,x.Onext,x.Onext,!1),x.Sym.activeRegion.fixUpperEdge=!0,S.walkDirtyRegions(d,v);},S.connectLeftDegenerate=function(d,v,p){var x,E,R,D,U;if(x=v.eUp,n.vertEq(x.Org,p)){s(!1/*TOLERANCE_NONZERO*/),S.spliceMergeVertices(d,x,p.anEdge);return;}if(!n.vertEq(x.Dst,p)){d.mesh.splitEdge(x.Sym),v.fixUpperEdge&&(d.mesh["delete"](x.Onext),v.fixUpperEdge=!1),d.mesh.splice(p.anEdge,x),S.sweepEvent(d,p);return;}s(!1/*TOLERANCE_NONZERO*/),v=S.topRightRegion(v),U=S.regionBelow(v),R=U.eUp.Sym,E=D=R.Onext,U.fixUpperEdge&&(s(E!==R),S.deleteRegion(d,U),d.mesh["delete"](R),R=E.Oprev),d.mesh.splice(p.anEdge,R),n.edgeGoesLeft(E)||(E=null),S.addRightEdges(d,v,R.Onext,D,E,!0);},S.connectLeftVertex=function(d,v){var p,x,E,R,D,U,M=new I();if(M.eUp=v.anEdge.Sym,p=d.dict.search(M).key,x=S.regionBelow(p),!!x){if(R=p.eUp,D=x.eUp,n.edgeSign(R.Dst,v,R.Org)===0){S.connectLeftDegenerate(d,p,v);return;}if(E=n.vertLeq(D.Dst,R.Dst)?p:x,p.inside||E.fixUpperEdge){if(E===p)U=d.mesh.connect(v.anEdge.Sym,R.Lnext);else{var W=d.mesh.connect(D.Dnext,v.anEdge);U=W.Sym;}E.fixUpperEdge?S.fixUpperEdge(d,E,U):S.computeWinding(d,S.addRegionBelow(d,p,U)),S.sweepEvent(d,v);}else S.addRightEdges(d,p,v.anEdge,v.anEdge,null,!0);}},S.sweepEvent=function(d,v){d.event=v,S.debugEvent(d);for(var p=v.anEdge;p.activeRegion===null;)if(p=p.Onext,p===v.anEdge){S.connectLeftVertex(d,v);return;}var x=S.topLeftRegion(d,p.activeRegion);s(x!==null);var E=S.regionBelow(x),R=E.eUp,D=S.finishLeftRegions(d,E,null);D.Onext===R?S.connectRightVertex(d,x,D):S.addRightEdges(d,x,D.Onext,R,R,!0);},S.addSentinel=function(d,v,p,x){var E=new I(),R=d.mesh.makeEdge();R.Org.s=p,R.Org.t=x,R.Dst.s=v,R.Dst.t=x,d.event=R.Dst,E.eUp=R,E.windingNumber=0,E.inside=!1,E.fixUpperEdge=!1,E.sentinel=!0,E.dirty=!1,E.nodeUp=d.dict.insert(E);},S.initEdgeDict=function(d){d.dict=new u(d,S.edgeLeq);var v=d.bmax[0]-d.bmin[0],p=d.bmax[1]-d.bmin[1],x=d.bmin[0]-v,E=d.bmax[0]+v,R=d.bmin[1]-p,D=d.bmax[1]+p;S.addSentinel(d,x,E,R),S.addSentinel(d,x,E,D);},S.doneEdgeDict=function(d){for(var v,p=0;(v=d.dict.min().key)!==null;)v.sentinel||(s(v.fixUpperEdge),s(++p===1)),s(v.windingNumber===0),S.deleteRegion(d,v);},S.removeDegenerateEdges=function(d){var v,p,x,E=d.mesh.eHead;for(v=E.next;v!==E;v=p)p=v.next,x=v.Lnext,n.vertEq(v.Org,v.Dst)&&v.Lnext.Lnext!==v&&(S.spliceMergeVertices(d,x,v),d.mesh["delete"](v),v=x,x=v.Lnext),x.Lnext===v&&(x!==v&&((x===p||x===p.Sym)&&(p=p.next),d.mesh["delete"](x)),(v===p||v===p.Sym)&&(p=p.next),d.mesh["delete"](v));},S.initPriorityQ=function(d){var v,p,x,E=0;for(x=d.mesh.vHead,p=x.next;p!==x;p=p.next)E++;for(E+=8,v=d.pq=new w(E,n.vertLeq),x=d.mesh.vHead,p=x.next;p!==x;p=p.next)p.pqHandle=v.insert(p);return p!==x?!1:(v.init(),!0);},S.donePriorityQ=function(d){d.pq=null;},S.removeDegenerateFaces=function(d,v){var p,x,E;for(p=v.fHead.next;p!==v.fHead;p=x)x=p.next,E=p.anEdge,s(E.Lnext!==E),E.Lnext.Lnext===E&&(S.addWinding(E.Onext,E),d.mesh["delete"](E));return!0;},S.computeInterior=function(d){var v,p;if(S.removeDegenerateEdges(d),!S.initPriorityQ(d))return!1;for(S.initEdgeDict(d);(v=d.pq.extractMin())!==null;){for(;p=d.pq.min(),!(p===null||!n.vertEq(p,v));)p=d.pq.extractMin(),S.spliceMergeVertices(d,v.anEdge,p.anEdge);S.sweepEvent(d,v);}return d.event=d.dict.min().key.eUp.Org,S.debugEvent(d),S.doneEdgeDict(d),S.donePriorityQ(d),S.removeDegenerateFaces(d,d.mesh)?(d.mesh.check(),!0):!1;};function O(){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;}O.prototype={dot_:function dot_(d,v){return d[0]*v[0]+d[1]*v[1]+d[2]*v[2];},normalize_:function normalize_(d){var v=d[0]*d[0]+d[1]*d[1]+d[2]*d[2];s(v>0),v=Math.sqrt(v),d[0]/=v,d[1]/=v,d[2]/=v;},longAxis_:function longAxis_(d){var v=0;return Math.abs(d[1])>Math.abs(d[0])&&(v=1),Math.abs(d[2])>Math.abs(d[v])&&(v=2),v;},computeNormal_:function computeNormal_(d){var v,p,x,E,R,D,U=[0,0,0],M=[0,0,0],W=[0,0,0],X=[0,0,0],B=[0,0,0],N=[null,null,null],$=[null,null,null],J=this.mesh.vHead,tt;for(v=J.next,tt=0;tt<3;++tt)E=v.coords[tt],M[tt]=E,$[tt]=v,U[tt]=E,N[tt]=v;for(v=J.next;v!==J;v=v.next)for(tt=0;tt<3;++tt)E=v.coords[tt],E<M[tt]&&(M[tt]=E,$[tt]=v),E>U[tt]&&(U[tt]=E,N[tt]=v);if(tt=0,U[1]-M[1]>U[0]-M[0]&&(tt=1),U[2]-M[2]>U[tt]-M[tt]&&(tt=2),M[tt]>=U[tt]){d[0]=0,d[1]=0,d[2]=1;return;}for(D=0,p=$[tt],x=N[tt],W[0]=p.coords[0]-x.coords[0],W[1]=p.coords[1]-x.coords[1],W[2]=p.coords[2]-x.coords[2],v=J.next;v!==J;v=v.next)X[0]=v.coords[0]-x.coords[0],X[1]=v.coords[1]-x.coords[1],X[2]=v.coords[2]-x.coords[2],B[0]=W[1]*X[2]-W[2]*X[1],B[1]=W[2]*X[0]-W[0]*X[2],B[2]=W[0]*X[1]-W[1]*X[0],R=B[0]*B[0]+B[1]*B[1]+B[2]*B[2],R>D&&(D=R,d[0]=B[0],d[1]=B[1],d[2]=B[2]);D<=0&&(d[0]=d[1]=d[2]=0,d[this.longAxis_(W)]=1);},checkOrientation_:function checkOrientation_(){var d,v,p=this.mesh.fHead,x,E=this.mesh.vHead,R;for(d=0,v=p.next;v!==p;v=v.next)if(R=v.anEdge,!(R.winding<=0))do d+=(R.Org.s-R.Dst.s)*(R.Org.t+R.Dst.t),R=R.Lnext;while(R!==v.anEdge);if(d<0){for(x=E.next;x!==E;x=x.next)x.t=-x.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 d,v=this.mesh.vHead,p=[0,0,0],x,E,R,D,U=!1;for(p[0]=this.normal[0],p[1]=this.normal[1],p[2]=this.normal[2],p[0]===0&&p[1]===0&&p[2]===0&&(this.computeNormal_(p),U=!0),x=this.sUnit,E=this.tUnit,R=this.longAxis_(p),x[R]=0,x[(R+1)%3]=1,x[(R+2)%3]=0,E[R]=0,E[(R+1)%3]=0,E[(R+2)%3]=p[R]>0?1:-1,d=v.next;d!==v;d=d.next)d.s=this.dot_(d.coords,x),d.t=this.dot_(d.coords,E);for(U&&this.checkOrientation_(),D=!0,d=v.next;d!==v;d=d.next)D?(this.bmin[0]=this.bmax[0]=d.s,this.bmin[1]=this.bmax[1]=d.t,D=!1):(d.s<this.bmin[0]&&(this.bmin[0]=d.s),d.s>this.bmax[0]&&(this.bmax[0]=d.s),d.t<this.bmin[1]&&(this.bmin[1]=d.t),d.t>this.bmax[1]&&(this.bmax[1]=d.t));},addWinding_:function addWinding_(d,v){d.winding+=v.winding,d.Sym.winding+=v.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_(d,v){var p,x;for(p=v.anEdge,s(p.Lnext!==p&&p.Lnext.Lnext!==p);n.vertLeq(p.Dst,p.Org);p=p.Lprev);for(;n.vertLeq(p.Org,p.Dst);p=p.Lnext);for(x=p.Lprev;p.Lnext!==x;)if(n.vertLeq(p.Dst,x.Org)){for(;x.Lnext!==p&&(n.edgeGoesLeft(x.Lnext)||n.edgeSign(x.Org,x.Dst,x.Lnext.Dst)<=0);){var E=d.connect(x.Lnext,x);x=E.Sym;}x=x.Lprev;}else{for(;x.Lnext!==p&&(n.edgeGoesRight(p.Lprev)||n.edgeSign(p.Dst,p.Org,p.Lprev.Org)>=0);){var E=d.connect(p,p.Lprev);p=E.Sym;}p=p.Lnext;}for(s(x.Lnext!==p);x.Lnext.Lnext!==p;){var E=d.connect(x.Lnext,x);x=E.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_(d){var v,p;for(v=d.fHead.next;v!==d.fHead;v=p)if(p=v.next,v.inside&&!this.tessellateMonoRegion_(d,v))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_(d){var v,p;for(v=d.fHead.next;v!==d.fHead;v=p)p=v.next,v.inside||d.zapFace(v);},/* 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_(d,v,p){var x,E;for(x=d.eHead.next;x!==d.eHead;x=E)E=x.next,x.Rface.inside!==x.Lface.inside?x.winding=x.Lface.inside?v:-v:p?d["delete"](x):x.winding=0;},getNeighbourFace_:function getNeighbourFace_(d){return!d.Rface||!d.Rface.inside?-1:d.Rface.n;},outputPolymesh_:function outputPolymesh_(d,v,p,x){var E,R,D,U=0,M=0,W,X;for(p>3&&d.mergeConvexFaces(p),E=d.vHead.next;E!==d.vHead;E=E.next)E.n=-1;for(R=d.fHead.next;R!==d.fHead;R=R.next)if(R.n=-1,!!R.inside){D=R.anEdge,W=0;do E=D.Org,E.n===-1&&(E.n=M,M++),W++,D=D.Lnext;while(D!==R.anEdge);s(W<=p),R.n=U,++U;}for(this.elementCount=U,v===r.CONNECTED_POLYGONS&&(U*=2),this.elements=[],this.elements.length=U*p,this.vertexCount=M,this.vertices=[],this.vertices.length=M*x,this.vertexIndices=[],this.vertexIndices.length=M,E=d.vHead.next;E!==d.vHead;E=E.next)if(E.n!==-1){var B=E.n*x;this.vertices[B+0]=E.coords[0],this.vertices[B+1]=E.coords[1],x>2&&(this.vertices[B+2]=E.coords[2]),this.vertexIndices[E.n]=E.idx;}var N=0;for(R=d.fHead.next;R!==d.fHead;R=R.next)if(R.inside){D=R.anEdge,W=0;do E=D.Org,this.elements[N++]=E.n,W++,D=D.Lnext;while(D!==R.anEdge);for(X=W;X<p;++X)this.elements[N++]=-1;if(v===r.CONNECTED_POLYGONS){D=R.anEdge;do this.elements[N++]=this.getNeighbourFace_(D),D=D.Lnext;while(D!==R.anEdge);for(X=W;X<p;++X)this.elements[N++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
|
|
200
|
+
outputContours_:function outputContours_(d,v){var p,x,E,R=0,D=0;for(this.vertexCount=0,this.elementCount=0,p=d.fHead.next;p!==d.fHead;p=p.next)if(p.inside){E=x=p.anEdge;do this.vertexCount++,x=x.Lnext;while(x!==E);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*v,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var U=0,M=0,W=0;for(R=0,p=d.fHead.next;p!==d.fHead;p=p.next)if(p.inside){D=0,E=x=p.anEdge;do this.vertices[U++]=x.Org.coords[0],this.vertices[U++]=x.Org.coords[1],v>2&&(this.vertices[U++]=x.Org.coords[2]),this.vertexIndices[M++]=x.Org.idx,D++,x=x.Lnext;while(x!==E);this.elements[W++]=R,this.elements[W++]=D,R+=D;}},addContour:function addContour(d,v){var p,x;for(this.mesh===null&&(this.mesh=new h()),d<2&&(d=2),d>3&&(d=3),p=null,x=0;x<v.length;x+=d)p===null?(p=this.mesh.makeEdge(),this.mesh.splice(p,p.Sym)):(this.mesh.splitEdge(p),p=p.Lnext),p.Org.coords[0]=v[x+0],p.Org.coords[1]=v[x+1],d>2?p.Org.coords[2]=v[x+2]:p.Org.coords[2]=0,p.Org.idx=this.vertexIndexCounter++,p.winding=1,p.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
|
|
201
|
+
tesselate:function tesselate(d,v,p,x,E){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,E&&(this.normal[0]=E[0],this.normal[1]=E[1],this.normal[2]=E[2]),this.windingRule=d,x<2&&(x=2),x>3&&(x=3),!this.mesh)return!1;this.projectPolygon_(),S.computeInterior(this);var R=this.mesh;return v===r.BOUNDARY_CONTOURS?this.setWindingNumber_(R,1,!0):this.tessellateInterior_(R),R.check(),v===r.BOUNDARY_CONTOURS?this.outputContours_(R,x):this.outputPolymesh_(R,v,p,x),!0;}};},/* 62 *//***/function(i,e){i.exports=r;var t=Object.prototype.hasOwnProperty;function r(){for(var n={},s=0;s<arguments.length;s++){var c=arguments[s];for(var l in c)t.call(c,l)&&(n[l]=c[l]);}return n;}},/* 63 *//***/function(i,e,t){t.r(e),t.d(e,"createShaders",function(){return f;}),t.d(e,"applyShader",function(){return h;}),t.d(e,"createCloudShaders",function(){return u;}),t.d(e,"applyCloudShader",function(){return y;});var r=t(64),n=t(65),s=t(66),c=t(67);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol("shaders");function f(T){T[l]=[];for(var w=0;w<16;w++){var I=[],S=!!(w&1),_O11=!!(w&2),_d10=!!(w&4),v=!!(w&8);S&&I.push("#define TEXTURE 1"),_O11&&I.push("#define FILTER 1"),_d10&&I.push("#define GRADIENT 1"),v&&I.push("#define CLIPPATH 1");var p="".concat(I.join("\n"),"\n"),x=[];S&&x.push("uniform sampler2D u_texSampler;"),v&&x.push("uniform sampler2D u_clipSampler;"),T[l][w]=[p+x.join("\n")+n["default"],p+r["default"]];}}function h(T){var _ref93=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref93$hasTexture=_ref93.hasTexture,w=_ref93$hasTexture===void 0?!1:_ref93$hasTexture,_ref93$hasFilter=_ref93.hasFilter,I=_ref93$hasFilter===void 0?!1:_ref93$hasFilter,_ref93$hasGradient=_ref93.hasGradient,S=_ref93$hasGradient===void 0?!1:_ref93$hasGradient,_ref93$hasClipPath=_ref93.hasClipPath,O=_ref93$hasClipPath===void 0?!1:_ref93$hasClipPath;var d=w|I<<1|S<<2|O<<3;var v=T[l][d];Array.isArray(v)&&(v=T.createProgram.apply(T,_toConsumableArray(v)),T[l][d]=v),T.program!==v&&T.useProgram(v,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var m=[];function u(T){for(var w=0;w<64;w++){var I=[],S=!!(w&1),_O12=!!(w&2),_d11=!!(w&4),v=!!(w&8),p=!!(w&16),x=!!(w&32);S&&I.push("#define TEXTURE 1"),_O12&&I.push("#define FILTER 1"),_d11&&I.push("#define GRADIENT 1"),v&&I.push("#define CLOUDCOLOR 1"),p&&I.push("#define CLOUDFILTER 1"),x&&I.push("#define CLIPPATH 1");var E="".concat(I.join("\n"),"\n"),R=[];if(S){R.push("uniform sampler2D u_texSampler;");for(var D=0;D<12;D++)R.push("uniform sampler2D u_texFrame".concat(D,";"));}x&&R.push("uniform sampler2D u_clipSampler;"),m[w]=[E+R.join("\n")+c["default"],E+s["default"]];}}function y(T){var _ref94=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref94$hasTexture=_ref94.hasTexture,w=_ref94$hasTexture===void 0?!1:_ref94$hasTexture,_ref94$hasFilter=_ref94.hasFilter,I=_ref94$hasFilter===void 0?!1:_ref94$hasFilter,_ref94$hasGradient=_ref94.hasGradient,S=_ref94$hasGradient===void 0?!1:_ref94$hasGradient,_ref94$hasCloudColor=_ref94.hasCloudColor,O=_ref94$hasCloudColor===void 0?!1:_ref94$hasCloudColor,_ref94$hasCloudFilter=_ref94.hasCloudFilter,d=_ref94$hasCloudFilter===void 0?!1:_ref94$hasCloudFilter,_ref94$hasClipPath=_ref94.hasClipPath,v=_ref94$hasClipPath===void 0?!1:_ref94$hasClipPath;var p=w|I<<1|S<<2|O<<3|d<<4|v<<5;var x=m[p];Array.isArray(x)&&(x=T.createProgram.apply(T,_toConsumableArray(x)),m[p]=x),T.program!==x&&T.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}});}},/* 64 *//***/function(i,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(i,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(i,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(i,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(i,e,t){t.r(e),function(r,n){t.d(e,"requestAnimationFrame",function(){return c;}),t.d(e,"cancelAnimationFrame",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);function s(){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),f=_r$hrtime2[0],h=_r$hrtime2[1];return f*1e3+h*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var c,l;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(c=n.requestAnimationFrame,l=n.cancelAnimationFrame):(c=function c(f){return setTimeout(function(){f(s());},16);},l=function l(f){return clearTimeout(f);});}.call(this,t(69),t(22));},/* 69 *//***/function(i,e){var t=i.exports={},r,n;function s(){throw new Error("setTimeout has not been defined");}function c(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?r=setTimeout:r=s;}catch(_unused4){r=s;}try{typeof clearTimeout=="function"?n=clearTimeout:n=c;}catch(_unused5){n=c;}})();function l(O){if(r===setTimeout)return setTimeout(O,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(O,0);try{return r(O,0);}catch(_unused6){try{return r.call(null,O,0);}catch(_unused7){return r.call(this,O,0);}}}function f(O){if(n===clearTimeout)return clearTimeout(O);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(O);try{return n(O);}catch(_unused8){try{return n.call(null,O);}catch(_unused9){return n.call(this,O);}}}var h=[],m=!1,u,y=-1;function T(){!m||!u||(m=!1,u.length?h=u.concat(h):y=-1,h.length&&w());}function w(){if(!m){var O=l(T);m=!0;for(var d=h.length;d;){for(u=h,h=[];++y<d;)u&&u[y].run();y=-1,d=h.length;}u=null,m=!1,f(O);}}t.nextTick=function(O){var d=new Array(arguments.length-1);if(arguments.length>1)for(var v=1;v<arguments.length;v++)d[v-1]=arguments[v];h.push(new I(O,d)),h.length===1&&!m&&l(w);};function I(O,d){this.fun=O,this.array=d;}I.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function S(){}t.on=S,t.addListener=S,t.once=S,t.off=S,t.removeListener=S,t.removeAllListeners=S,t.emit=S,t.prependListener=S,t.prependOnceListener=S,t.listeners=function(O){return[];},t.binding=function(O){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(O){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return D;});var r=t(1),n=t(71),s=t(73),c=t(213),l=t(214),f=t(215),h=t(216);t(1).glMatrix.setMatrixArrayType(Array);function m(U,M){var W=Object.keys(U);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(U);M&&(X=X.filter(function(B){return Object.getOwnPropertyDescriptor(U,B).enumerable;})),W.push.apply(W,X);}return W;}function u(U){for(var M=1;M<arguments.length;M++){var W=arguments[M]!=null?arguments[M]:{};M%2?m(Object(W),!0).forEach(function(X){y(U,X,W[X]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(U,Object.getOwnPropertyDescriptors(W)):m(Object(W)).forEach(function(X){Object.defineProperty(U,X,Object.getOwnPropertyDescriptor(W,X));});}return U;}function y(U,M,W){return M in U?Object.defineProperty(U,M,{value:W,enumerable:!0,configurable:!0,writable:!0}):U[M]=W,U;}var T=Symbol["for"]("spritejs_changedAttrs"),w=Symbol["for"]("spritejs_attributes"),I=Symbol("resolution"),S=Symbol("animations"),O=Symbol("eventListeners"),d=Symbol("captureEventListeners"),v=Symbol("filters"),p=Symbol("display"),x=Symbol("program"),E=Symbol("shaderAttrs"),R=Symbol("uniforms");var D=/*#__PURE__*/function(){function D(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,D);this.attributes=new this.constructor.Attr(this),this[I]={width:300,height:150},Object.assign(this.attributes,M),this[S]=/* @__PURE__ */new Set(),this[O]={},this[d]={};}return _createClass(D,[{key:"ancestors",get:function get(){var M=this.parent;var W=[];for(;M;)W.push(M),M=M.parent;return W;}},{key:"animations",get:function get(){return this[S];}},{key:"filters",get:function get(){return this[v]||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 M=this.transformMatrix,_this$attributes=this.attributes,W=_this$attributes.x,X=_this$attributes.y;return M[4]+=W,M[5]+=X,M;}},{key:"opacity",get:function get(){var M=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(M*=this.parent.opacity),M;}},{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[x];}/* 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 M=this.localMatrix;var W=this.parent;if(W){var X=W.__cacheRenderMatrix||W.renderMatrix;X&&(M=r.mat2d.multiply(Array.of(0,0,0,0,0,0),X,M));}return M;}},{key:"worldScaling",get:function get(){var M=this.renderMatrix;return[Math.hypot(M[0],M[1]),Math.hypot(M[2],M[3])];}},{key:"worldRotation",get:function get(){var M=this.renderMatrix;return Math.atan2(M[1],M[3]);}},{key:"worldPosition",get:function get(){var M=this.renderMatrix;return[M[4],M[5]];}},{key:"uniforms",get:function get(){return this[R];}/* get zOrder defined by connect method *//* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(M){this.attributes.className=M;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(M){this.attributes.id=M;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(M){this.attributes.name=M;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(M){this.attributes.zIndex=M;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[E]||{};}},{key:"activateAnimations",value:function activateAnimations(){var M=this.layer;if(M){var W=this[S];W.forEach(function(B){B.baseTimeline=M.timeline,B.play(),B.finished.then(function(){W["delete"](B);});});var X=this.children;X&&X.forEach(function(B){B.activateAnimations&&B.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(M,W){var X=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};M==="mousewheel"&&(M="wheel"),typeof X=="boolean"&&(X={capture:X});var _X8=X,B=_X8.capture,N=_X8.once,$=B?d:O;return this[$][M]=this[$][M]||[],this[$][M].push({listener:W,once:N}),this;}},{key:"animate",value:function animate(M,W){var _this8=this;var X=new s["default"](this,M,W);return this.effects&&X.applyEffects(this.effects),this.layer&&(X.baseTimeline=this.layer.timeline,X.play(),X.finished.then(function(){_this8[S]["delete"](X);})),this[S].add(X),X;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,M=new Array(_len7),_key7=0;_key7<_len7;_key7++){M[_key7]=arguments[_key7];}if(M.length===0)return this.attributes[w];if(M.length>1){var W=M[0],X=M[1];return typeof X=="function"&&(X=X(this.attr(W))),this.setAttribute(W,X),this;}return typeof M[0]=="string"?this.getAttribute(M[0]):(Object.assign(this.attributes,M[0]),this);}},{key:"cloneNode",value:function cloneNode(){var M=new this.constructor(),W=this.attributes[T];return M.attr(W),M;}},{key:"connect",value:function connect(M,W){Object.defineProperty(this,"parent",{value:M,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:W,writable:!1,configurable:!0}),M.timeline&&this.activateAnimations(),this.setResolution(M.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:M,zOrder:W}});}},{key:"contains",value:function contains(M){for(;M&&this!==M;)M=M.parent;return!!M;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[S].forEach(function(W){return W.cancel();});var M=this.children;M&&M.forEach(function(W){W.deactivateAnimations&&W.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var M=this.parent,W=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:M,zOrder:W}}),M&&M.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(M){var _this9=this;M instanceof l["default"]||(M=new l["default"](M)),M.target=this;var W=M.type;W==="mousewheel"&&(W="wheel");var X=[this];var B=this.parent;for(;M.bubbles&&B;)X.push(B),B=B.parent;for(var N=X.length-1;N>=0;N--){var $=X[N],J=$[d]&&$[d][W];if(J&&J.length&&(M.currentTarget=$,J.forEach(function(_ref95){var tt=_ref95.listener,at=_ref95.once;tt.call(_this9,M),at&&X.removeEventListener(tt);}),delete M.currentTarget),!M.bubbles&&M.cancelBubble)break;}if(!M.cancelBubble)for(var _N4=0;_N4<X.length;_N4++){var _$=X[_N4],_J3=_$[O]&&_$[O][W];if(_J3&&_J3.length&&(M.currentTarget=_$,_J3.forEach(function(_ref96){var tt=_ref96.listener,at=_ref96.once;tt.call(_this9,M),at&&X.removeEventListener(tt);}),delete M.currentTarget),!M.bubbles||M.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(M){var W=M.layerX,X=M.layerY;return this.isPointCollision(W,X)?(this.dispatchEvent(M),!0):!1;}},{key:"draw",value:function draw(){var _this10=this;var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var W=this.mesh;if(W){if(Object(f.applyFilters)(W,this.filters),M.push(W),this[x]){W.setProgram(this[x]);var X=this[E];X&&Object.entries(X).forEach(function(_ref97){var _ref98=_slicedToArray(_ref97,2),N=_ref98[0],$=_ref98[1];W.setAttribute(N,$);});var B=this[R];if(this[R]){var N={};Object.entries(B).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),$=_ref100[0],J=_ref100[1];typeof J=="function"&&(J=J(_this10,$)),N[$]=J;}),W.setUniforms(N);}}Object(h["default"])(this,W);}return M;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(M){return this.attributes[M];}},{key:"getListeners",value:function getListeners(M){var _ref101=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref101$capture=_ref101.capture,W=_ref101$capture===void 0?!1:_ref101$capture;return _toConsumableArray(this[W?d:O][M]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var M=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(M===0)return this;var W=this.parent.children,X=W.indexOf(this);return W[X+M];}},{key:"getWorldPosition",value:function getWorldPosition(M,W){var X=this.renderMatrix,B=M*X[0]+W*X[2]+X[4],N=M*X[1]+W*X[3]+X[5];return[B,N];}},{key:"getOffsetPosition",value:function getOffsetPosition(M,W){var X=r.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),B=M*X[0]+W*X[2]+X[4],N=M*X[1]+W*X[3]+X[5];return[B,N];}},{key:"getResolution",value:function getResolution(){return u({},this[I]);}},{key:"isPointCollision",value:function isPointCollision(M,W){if(!this.mesh)return!1;var X=this.attributes.pointerEvents;if(X==="none"||X!=="all"&&!this.isVisible)return!1;var B="both";return X==="visibleFill"&&(B="fill"),X==="visibleStroke"&&(B="stroke"),this.mesh.isPointCollision(M,W,B);}},{key:"onPropertyChange",value:function onPropertyChange(M,W,X){M!=="id"&&M!=="name"&&M!=="className"&&M!=="pointerEvents"&&M!=="passEvents"&&this.forceUpdate(),M==="filter"&&(this[v]=Object(f.parseFilterString)(W)),M==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(M,W){M==="attrs"&&this.attr(W),this.attributes[M]=W;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
|
|
202
|
+
},{key:"setProgram",value:function setProgram(M){this[x]=M,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(M,W){this[E]=this[E]||{},this[E][M]=W,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(M){this[R]=this[R]||{},Object.assign(this[R],M),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref102){var M=_ref102.width,W=_ref102.height;var _this$I3=this[I],X=_this$I3.width,B=_this$I3.height;(X!==M||B!==W)&&(this[I]={width:M,height:W},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:M,height:W}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[p]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[p]=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(M){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof W=="boolean"&&(W={capture:W});var B=W.capture?d:O;return this[B][M]&&(this[B][M]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(M){this.setAttribute(M,null);}},{key:"removeEventListener",value:function removeEventListener(M,W){var X=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof X=="boolean"&&(X={capture:X});var N=X.capture?d:O;if(this[N][M]){var $=this[N][M];if($)for(var J=0;J<$.length;J++){var tt=$[J].listener;if(tt===W){this[N][M].splice(J,1);break;}}}return this;}},{key:"transition",value:function transition(M){var W=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var X=this,B=Symbol("animation");W=W||"linear";var N=0;return _typeof(M)=="object"&&(N=M.delay||0,M=M.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},B,null),"cancel",function cancel(){var $=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var J=this[B];J&&J.cancel($);}),"end",function end(){var $=this[B];$&&($.playState==="running"||$.playState==="pending")&&$.finish();}),"reverse",function reverse(){var $=this[B];if($)if($.playState==="running"||$.playState==="pending")$.playbackRate=-$.playbackRate;else{var J=$.timing.direction;$.timing.direction=J==="reverse"?"normal":"reverse",$.play();}return $.finished;}),"attr",function attr($,J){return this.end(),typeof $=="string"&&($=_defineProperty({},$,J)),Object.entries($).forEach(function(_ref103){var _ref104=_slicedToArray(_ref103,2),tt=_ref104[0],at=_ref104[1];typeof at=="function"&&($[tt]=at(X.attr(tt)));}),this[B]=X.animate([$],{duration:M*1e3,delay:N*1e3,fill:"forwards",easing:W}),this[B].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();y(D,"Attr",n["default"]),c["default"].registerNode(D,"node");},/* 71 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return D;});var r=t(1),n=t(12),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_declareAlias"),f=Symbol["for"]("spritejs_setAttribute"),h=Symbol["for"]("spritejs_getAttribute"),m=Symbol["for"]("spritejs_attributes"),u=Symbol["for"]("spritejs_changedAttrs"),y=Symbol("subject"),T=Symbol("attr"),w=Symbol("default"),I=Symbol("alias");function S(U,_ref106){var _ref107=_slicedToArray(_ref106,2),M=_ref107[0],W=_ref107[1];var X=r.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(U).forEach(function(_ref108){var _ref109=_slicedToArray(_ref108,2),B=_ref109[0],N=_ref109[1];if((M||W)&&(X=r.mat2d.translate(Array.of(0,0,0,0,0,0),X,[M,W])),B==="matrix")X=r.mat2d.multiply(X,X,N);else if(B==="offsetTranslate")X[4]+=N[0],X[5]+=N[1];else if(B==="offsetRotate")X=r.mat2d.rotate(Array.of(0,0,0,0,0,0),X,N);else if(B==="skew"){var _N5=_slicedToArray(N,2),$=_N5[0],J=_N5[1];X=r.mat2d.multiply(X,X,r.mat2d.fromValues(1,Math.tan(J),Math.tan($),1,0,0));}else r.mat2d[B](X,X,N);(M||W)&&(X=r.mat2d.translate(Array.of(0,0,0,0,0,0),X,[-M,-W]));}),X;}var O=Symbol("transformMatrix"),d=Symbol("transforms"),v=Symbol("changedAttrs"),p=Symbol("lastChangedAttr"),x=Symbol("offsetFigure");function E(U,M,W){var X=U[T][M];if(U[f](M,W,!1)||U[p]!==M){var N=U[d];N.has(M)&&N["delete"](M),W&&(M==="rotate"&&(W=Math.PI*W/180),M==="scale"&&(W=W.map(function($){return Math.abs($)>1e-5?$:1/$>0?1e-5:-1e-5;})),N.set(M,W)),U[O]=null,U[y].onPropertyChange(M,W,X,U);}}function R(U){var M=U[x],W=U.offsetDistance*M.getTotalLength(),X=M.getPointAtLength(W);if(X){var B=U[d];var N=U.offsetRotate;N==="auto"?N=X.angle:N==="reverse"?N=Math.PI+X.angle:N=Math.PI*N/180,B.set("offsetRotate",N),B.set("offsetTranslate",[X.x,X.y]),U[O]=null;}}var D=/*#__PURE__*/function(){function D(M){var _this11=this;_classCallCheck(this,D);this[y]=M,this[T]={},this[O]=r.mat2d.fromValues(1,0,0,1,0,0),this[d]=/* @__PURE__ */new Map(),this[w]={},this[I]=[],Object.defineProperty(M,"transformMatrix",{get:function get(){return _this11[O]||(_this11[O]=S(_this11[d],_this11.transformOrigin)),_toConsumableArray(_this11[O]);}}),this[c]({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[l]("class","pos"),this[v]=/* @__PURE__ */new Set(),this[x]=new n.Figure2D({scale:5,simplify:0});}return _createClass(D,[{key:u,get:function get(){var _this12=this;var M={};return _toConsumableArray(this[v]).forEach(function(W){M[W]=_this12[T][W];}),M;}},{key:m,get:function get(){var M=Object.assign({},this[T]);for(var W=0;W<this[I].length;W++){var X=this[I][W];M[X]=this[X];}return M;}},{key:c,value:function value(M){Object.assign(this[w],M),Object.assign(this[T],M);}},{key:l,value:function value(){var _this$I4;(_this$I4=this[I]).push.apply(_this$I4,arguments);}},{key:f,value:function value(M,W){var X=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var B=this[T][M],N=this[y];return W==null&&(W=this[w][M]),Object(s.compareValue)(B,W)?!1:(this[T][M]=W,this[v].has(M)&&this[v]["delete"](M),this[v].add(M),this[p]=M,X&&N.onPropertyChange(M,W,B,this),!0);}},{key:h,value:function value(M){return this[T][M];}},{key:"id",get:function get(){return this[h]("id");},set:function set(M){this[f]("id",M);}},{key:"name",get:function get(){return this[h]("name");},set:function set(M){this[f]("name",M);}},{key:"className",get:function get(){return this[h]("className");},set:function set(M){this[f]("className",M);}},{key:"class",get:function get(){return this.className;},set:function set(M){this.className=M;}},{key:"x",get:function get(){return this[h]("x");},set:function set(M){this[f]("x",Object(s.toNumber)(M));}},{key:"y",get:function get(){return this[h]("y");},set:function set(M){this[f]("y",Object(s.toNumber)(M));}},{key:"pos",get:function get(){return[this.x,this.y];},set:function set(M){M=Object(s.toArray)(M),Array.isArray(M)||(M=[M,M]),this.x=M[0],this.y=M[1];}},{key:"transform",get:function get(){return this[h]("transform");},set:function set(M){var W=null;if(Array.isArray(M)&&(W=M,M="matrix(".concat(M.map(s.toNumber).join(),")")),typeof M=="string")M=M.replace(/\s*,\s*/g,",");else if(M!=null)throw new TypeError("Invalid transform value.");var X=this[T].transform;if(this[f]("transform",M,!1)){var B=this[d];if(B.has("matrix")&&B["delete"]("matrix"),W)B.set("matrix",W);else if(M){var N=M.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(N){var $=r.mat2d.fromValues(1,0,0,1,0,0);for(var J=0;J<N.length;J++){var at=N[J].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(at){var _at2=_slicedToArray(at,3),ut=_at2[1],V=_at2[2];ut==="rotate"?V=Math.PI*parseFloat(V)/180:V=V.trim().split(/[\s,]+/).map(function(Q){return Object(s.toNumber)(Q);}),ut==="matrix"?$=r.mat2d.multiply($,$,V):ut==="skew"?$=r.mat2d.multiply($,$,r.mat2d.fromValues(1,Math.tan(V[1]),Math.tan(V[0]),1,0,0)):r.mat2d[ut]($,$,V),B.set("matrix",$);}}}else throw new TypeError("Invalid transform value.");}this[O]=null,this[y].onPropertyChange("transform",M,X,this);}}},{key:"transformOrigin",get:function get(){return this[h]("transformOrigin");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),this[f]("transformOrigin",M)&&(this[O]=null);}},{key:"rotate",get:function get(){return this[h]("rotate");},set:function set(M){E(this,"rotate",M);}},{key:"translate",get:function get(){return this[h]("translate");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),E(this,"translate",M);}},{key:"scale",get:function get(){return this[h]("scale");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),E(this,"scale",M);}},{key:"skew",get:function get(){return this[h]("skew");},set:function set(M){M=Object(s.toArray)(M,!0),M!=null&&!Array.isArray(M)&&(M=[M,M]),E(this,"skew",M);}},{key:"opacity",get:function get(){return this[h]("opacity");},set:function set(M){M!=null&&(M=Number(M)),this[f]("opacity",M);}},{key:"zIndex",get:function get(){return this[h]("zIndex");},set:function set(M){M!=null&&(M=Number(M)),this[f]("zIndex",M);}},{key:"offsetPath",get:function get(){return this[h]("offsetPath");},set:function set(M){this[f]("offsetPath",M)&&(this[x].beginPath(),M!=null&&this[x].addPath(M),R(this));}},{key:"offsetDistance",get:function get(){return this[h]("offsetDistance");},set:function set(M){this[f]("offsetDistance",Object(s.toNumber)(M))&&R(this);}},{key:"offsetRotate",get:function get(){return this[h]("offsetRotate");},set:function set(M){this[f]("offsetRotate",M),R(this);}},{key:"pointerEvents",get:function get(){return this[h]("pointerEvents");},set:function set(M){if(M!=null&&M!=="none"&&M!=="visible"&&M!=="visibleFill"&&M!=="visibleStroke"&&M!=="all")throw new TypeError("Invalid pointerEvents type.");this[f]("pointerEvents",M);}},{key:"filter",get:function get(){return this[h]("filter");},set:function set(M){this[f]("filter",M);}},{key:"display",get:function get(){return this[h]("display");},set:function set(M){this[f]("display",M);}/* istanbul ignore next */},{key:"offset",set:function set(M){}}],[{key:"setDefault",value:function setDefault(M){for(var _len8=arguments.length,W=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){W[_key8-1]=arguments[_key8];}return M[c].apply(M,W);}},{key:"declareAlias",value:function declareAlias(M){for(var _len9=arguments.length,W=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){W[_key9-1]=arguments[_key9];}return M[l].apply(M,W);}},{key:"setAttribute",value:function setAttribute(M){for(var _len10=arguments.length,W=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){W[_key10-1]=arguments[_key10];}return M[f].apply(M,W);}},{key:"getAttribute",value:function getAttribute(M){for(var _len11=arguments.length,W=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){W[_key11-1]=arguments[_key11];}return M[h].apply(M,W);}},{key:"getAttributes",value:function getAttributes(M){return M[m];}},{key:"getChangedAttributes",value:function getChangedAttributes(M){return M[u];}}]);}();},/* 72 *//***/function(i,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 s;}),t.d(e,"toArray",function(){return c;}),t.d(e,"compareValue",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);function r(f,h){var m=f.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);m?f={size:parseFloat(m[1]),unit:m[2]}:f={size:parseFloat(f),unit:"px"};var _f3=f,u=_f3.size,y=_f3.unit;if(y==="pt")u/=0.75;else if(y==="pc")u*=16;else if(y==="in")u*=96;else if(y==="cm")u*=37.79527559055118;else if(y==="mm")u*=3.7795275590551185;else if(y==="em"||y==="rem"||y==="ex"){if(!h&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var T=getComputedStyle(document.documentElement).fontSize;T?h=r(T,16):h=16;}u*=h,y==="ex"&&(u/=2);}else if(y==="q")u*=0.9448818897637796;else if(y==="vw"||y==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _T4=y==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;u*=_T4/100;}}else if((y==="vmax"||y==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _T5=window.innerWidth||document.documentElement.clientWidth,w=window.innerHeight||document.documentElement.clientHeight;y==="vmax"?u*=Math.max(_T5,w)/100:u*=Math.min(_T5,w)/100;}return u;}function n(f){return f==null?f:String(f);}function s(f){if(f==null)return f;if(typeof f=="string"&&(f=r(f)),!Number.isFinite(f))throw new TypeError("Invalid value");return f;}function c(f){var h=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return f===""?null:(typeof f=="string"&&(f=f.split(/[\s,]+/g)),Array.isArray(f)&&(h&&(f=f.map(s)),f.length===1)?f[0]:f);}function l(f,h){if(Array.isArray(f)&&Array.isArray(h)){if(f.length!==h.length)return!1;for(var m=0;m<f.length;m++)if(f[m]!==h[m])return!1;return!0;}return f==null&&h==null||f===h;}},/* 73 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return y;});var r=t(74),n=t(32),s=/* @__PURE__ */t.n(n),c=t(68),l=t(72);t(1).glMatrix.setMatrixArrayType(Array);function f(){return f=Object.assign||function(T){for(var w=1;w<arguments.length;w++){var I=arguments[w];for(var S in I)Object.prototype.hasOwnProperty.call(I,S)&&(T[S]=I[S]);}return T;},f.apply(this,arguments);}function h(T){if(typeof T=="string"){if(T=T.trim(),/^[0-9.]+%$/.test(T))return parseFloat(T)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(T))return Object(l.sizeToPixel)(T);}return T;}function m(T,w,I,S,O){return typeof T=="string"&&(T=s()(T)),typeof w=="string"&&(w=s()(w)),r.Effects["default"](T,w,I,S,O);}function u(T,w,I,S,O){return r.Effects["default"](T,w,I,S,O);}r.Effects["default"]=function(T,w,I,S,O){return Array.isArray(T)&&Array.isArray(w)?T.map(function(d,v){return d+(I-S)/(O-S)*(w[v]-d);}):typeof T=="number"&&typeof w=="number"?T+(I-S)/(O-S)*(w-T):I-S>O-I?w:T;},r.Effects.fillColor=m,r.Effects.strokeColor=m,r.Effects.bgcolor=m,r.Effects.borderColor=m,r.Effects.text=u;var y=/*#__PURE__*/function(_r$Animator){function y(w,I,S){var _this13;_classCallCheck(this,y);var O=w.attr();Object.entries(O).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),d=_ref111[0],v=_ref111[1];O[d]=r.Effects[d]?v:h(v);}),I=I.map(function(d){var v=f({},d);var p={};return Object.entries(v).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),x=_ref113[0],E=_ref113[1];p[x]=r.Effects[x]?E:h(E);}),p;}),_this13=_callSuper(this,y,[O,I,S]),_this13.target=w,_this13.setter=function(d,v){v.attr(d);};return _this13;}_inherits(y,_r$Animator);return _createClass(y,[{key:"playState",get:function get(){return this.target.parent?_superPropGet(y,"playState",this,1):"idle";}},{key:"finished",get:function get(){var _this14=this;return _superPropGet(y,"finished",this,1).then(function(){var w=_this14;return new Promise(function(I){function S(){w.setter(w.frame,w.target);var O=w.playState;O==="finished"||O==="idle"?(Object(c.cancelAnimationFrame)(w.requestId),I()):Object(c.requestAnimationFrame)(S);}S();});});}},{key:"finish",value:function finish(){_superPropGet(y,"finish",this,3)([]),Object(c.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_superPropGet(y,"play",this,3)([]),this.setter(this.frame,this.target);var w=this;this.ready.then(function(){w.setter(w.frame,w.target),w.requestId=Object(c.requestAnimationFrame)(function I(){var S=w.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&S.layer&&S.layer.canvas&&!document.documentElement.contains(S.layer.canvas)){w.cancel();return;}var O=w.playState;w.setter(w.frame,w.target),O!=="idle"&&(O==="running"?w.requestId=Object(c.requestAnimationFrame)(I):(O==="paused"||O==="pending"&&w.timeline.currentTime<0)&&w.ready.then(function(){w.setter(w.frame,w.target),w.requestId=Object(c.requestAnimationFrame)(I);}));});});}},{key:"cancel",value:function cancel(){var w=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(c.cancelAnimationFrame)(this.requestId),w?(this.setter(this.frame,this.target),_superPropGet(y,"cancel",this,3)([])):(_superPropGet(y,"cancel",this,3)([]),this.setter(this.frame,this.target));}}]);}(r.Animator);},/* 74 *//***/function(i,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),s=t(187),c=m(s),l=t(188),f=t(190),h=m(f);function m(u){return u&&u.__esModule?u:{"default":u};}e.Animator=h["default"],e.Easings=l.Easings,e.Effects=c["default"],e.Timeline=n["default"];},/* 75 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=d(r),s=t(133),c=d(s),l=t(141),f=d(l),h=t(164),m=d(h),u=t(170),y=d(u),T=t(171),w=d(T),I=t(175),S=d(I),O=t(186);function d(X){return X&&X.__esModule?X:{"default":X};}var v=(0,O.createNowTime)(),p={originTime:0,playbackRate:1},x=(0,S["default"])("timeMark"),E=(0,S["default"])("playbackRate"),R=(0,S["default"])("timers"),D=(0,S["default"])("originTime"),U=(0,S["default"])("setTimer"),M=(0,S["default"])("parent"),W=function(){function X(B,N){(0,y["default"])(this,X),B instanceof X&&(N=B,B={}),B=(0,m["default"])({},p,B),N&&(this[M]=N);var $=B.nowtime||v;if(N)Object.defineProperty(this,"globalTime",{get:function get(){return N.currentTime;}});else{var J=$();Object.defineProperty(this,"globalTime",{get:function get(){return $()-J;}});}this[x]=[{globalTime:this.globalTime,localTime:-B.originTime,entropy:-B.originTime,playbackRate:B.playbackRate,globalEntropy:0}],this[M]&&(this[x][0].globalEntropy=this[M].entropy),this[D]=B.originTime,this[E]=B.playbackRate,this[R]=new f["default"]();}return(0,w["default"])(X,[{key:"markTime",value:function value(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=N.time,J=$===void 0?this.currentTime:$,tt=N.entropy,at=tt===void 0?this.entropy:tt,ut=N.playbackRate,V=ut===void 0?this.playbackRate:ut,Q={globalTime:this.globalTime,localTime:J,entropy:at,playbackRate:V,globalEntropy:this.globalEntropy};this[x].push(Q);}},{key:"fork",value:function value(N){return new X(N,this);}},{key:"seekGlobalTime",value:function value(N){var $=this.seekTimeMark(N),J=this[x][$],tt=J.entropy,at=J.playbackRate,ut=J.globalTime;return ut+(N-tt)/Math.abs(at);}},{key:"seekLocalTime",value:function value(N){var $=this.seekTimeMark(N),J=this[x][$],tt=J.localTime,at=J.entropy,ut=J.playbackRate;return ut>0?tt+(N-at):tt-(N-at);}},{key:"seekTimeMark",value:function value(N){var $=this[x],J=0,tt=$.length-1;if(N<=$[J].entropy)return J;if(N>=$[tt].entropy)return tt;for(var at=Math.floor((J+tt)/2);at>J&&at<tt;){if(N===$[at].entropy)return at;N<$[at].entropy?tt=at:N>$[at].entropy&&(J=at),at=Math.floor((J+tt)/2);}return J;}},{key:"updateTimers",value:function value(){var N=this,$=[].concat((0,c["default"])(this[R]));$.forEach(function(J){var tt=(0,n["default"])(J,2),at=tt[0],ut=tt[1];N[U](ut.handler,ut.time,at);});}},{key:"clearTimeout",value:function(B){function N($){return B.apply(this,arguments);}return N.toString=function(){return B.toString();},N;}(function(B){var N=this[R].get(B);N&&N.timerID!=null&&(this[M]?this[M].clearTimeout(N.timerID):clearTimeout(N.timerID)),this[R]["delete"](B);})},{key:"clearInterval",value:function value(N){return this.clearTimeout(N);}},{key:"clear",value:function value(){var N=this,$=this[R];[].concat((0,c["default"])($.keys())).forEach(function(J){N.clearTimeout(J);});}/*
|
|
204
|
+
setTimeout(func, {delay: 100, isEntropy: true})
|
|
205
|
+
setTimeout(func, {entropy: 100})
|
|
206
|
+
setTimeout(func, 100})
|
|
207
|
+
*/},{key:"setTimeout",value:function value(N){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[U](N,$);}},{key:"setInterval",value:function value(N){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},J=this,tt=this[U](function at(){J[U](at,$,tt),N();},$);return tt;}},{key:U,value:function value(N,$){var J=this,tt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,S["default"])("timerID");$=(0,O.formatDelay)($);var at=this[R].get(tt),ut=void 0,V=null,Q=void 0,ft=void 0;at?(this.clearTimeout(tt),$.isEntropy?ut=($.delay-(this.entropy-at.startEntropy))/Math.abs(this.playbackRate):ut=($.delay-(this.currentTime-at.startTime))/this.playbackRate,Q=at.startTime,ft=at.startEntropy):(ut=$.delay/($.isEntropy?Math.abs(this.playbackRate):this.playbackRate),Q=this.currentTime,ft=this.entropy);var mt=this[M],yt=mt?mt.setTimeout.bind(mt):setTimeout,wt=$.heading;return!mt&&wt===!1&&ut<0&&(ut=1/0),(isFinite(ut)||mt)&&(ut=Math.ceil(ut),yt!==setTimeout&&(ut={delay:ut,heading:wt}),V=yt(function(){J[R]["delete"](tt),N();},ut)),this[R].set(tt,{timerID:V,handler:N,time:$,startTime:Q,startEntropy:ft}),tt;}},{key:"parent",get:function get(){return this[M];}},{key:"lastTimeMark",get:function get(){return this[x][this[x].length-1];}},{key:"currentTime",get:function get(){var N=this.lastTimeMark,$=N.localTime,J=N.globalTime;return $+(this.globalTime-J)*this.playbackRate;},set:function set(N){var $=this,J=this.currentTime,tt=N,at=this[R];this.markTime({time:N}),[].concat((0,c["default"])(at)).forEach(function(ut){var V=(0,n["default"])(ut,2),Q=V[0],ft=V[1];if(at.has(Q)){var mt=ft.time,yt=mt.isEntropy,wt=mt.delay,ht=mt.heading,Nt=ft.handler,Dt=ft.startTime;if(yt)wt===0&&(Nt(),$.clearTimeout(Q));else{var G=Dt+wt;(wt===0||ht!==!1&&(tt-J)*wt<=0||J<=G&&G<=tt||J>=G&&G>=tt)&&(Nt(),$.clearTimeout(Q));}}}),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 N=this.lastTimeMark,$=N.entropy,J=N.globalEntropy;return $+Math.abs((this.globalEntropy-J)*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(N){if(this.entropy>N){var $=this.seekTimeMark(N);this[x].length=$+1;}this.markTime({entropy:N}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[M]?this[M].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[E];},set:function set(N){N!==this.playbackRate&&(this.markTime({playbackRate:N}),this[E]=N,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var N=this.parent;N;){if(N.playbackRate===0)return!0;N=N.parent;}return!1;}}]),X;}();e["default"]=W;},/* 76 *//***/function(i,e,t){e.__esModule=!0;var r=t(77),n=l(r),s=t(129),c=l(s);function l(f){return f&&f.__esModule?f:{"default":f};}e["default"]=/* @__PURE__ */function(){function f(h,m){var u=[],y=!0,T=!1,w=void 0;try{for(var I=(0,c["default"])(h),S;!(y=(S=I.next()).done)&&(u.push(S.value),!(m&&u.length===m));y=!0);}catch(O){T=!0,w=O;}finally{try{!y&&I["return"]&&I["return"]();}finally{if(T)throw w;}}return u;}return function(h,m){if(Array.isArray(h))return h;if((0,n["default"])(Object(h)))return f(h,m);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 *//***/function(i,e,t){i.exports={"default":t(78),__esModule:!0};},/* 78 *//***/function(i,e,t){t(79),t(125),i.exports=t(127);},/* 79 *//***/function(i,e,t){t(80);for(var r=t(91),n=t(95),s=t(83),c=t(122)("toStringTag"),l="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(","),f=0;f<l.length;f++){var h=l[f],m=r[h],u=m&&m.prototype;u&&!u[c]&&n(u,c,h),s[h]=s.Array;}},/* 80 *//***/function(i,e,t){var r=t(81),n=t(82),s=t(83),c=t(84);i.exports=t(88)(Array,"Array",function(l,f){this._t=c(l),this._i=0,this._k=f;},function(){var l=this._t,f=this._k,h=this._i++;return!l||h>=l.length?(this._t=void 0,n(1)):f=="keys"?n(0,h):f=="values"?n(0,l[h]):n(0,[h,l[h]]);},"values"),s.Arguments=s.Array,r("keys"),r("values"),r("entries");},/* 81 *//***/function(i,e){i.exports=function(){};},/* 82 *//***/function(i,e){i.exports=function(t,r){return{value:r,done:!!t};};},/* 83 *//***/function(i,e){i.exports={};},/* 84 *//***/function(i,e,t){var r=t(85),n=t(87);i.exports=function(s){return r(n(s));};},/* 85 *//***/function(i,e,t){var r=t(86);i.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return r(n)=="String"?n.split(""):Object(n);};},/* 86 *//***/function(i,e){var t={}.toString;i.exports=function(r){return t.call(r).slice(8,-1);};},/* 87 *//***/function(i,e){i.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 *//***/function(i,e,t){var r=t(89),n=t(90),s=t(106),c=t(95),l=t(83),f=t(107),h=t(121),m=t(123),u=t(122)("iterator"),y=!([].keys&&"next"in[].keys()),T="@@iterator",w="keys",I="values",S=function S(){return this;};i.exports=function(O,d,v,p,x,E,R){f(v,d,p);var D=function D(V){if(!y&&V in X)return X[V];switch(V){case w:return function(){return new v(this,V);};case I:return function(){return new v(this,V);};}return function(){return new v(this,V);};},U=d+" Iterator",M=x==I,W=!1,X=O.prototype,B=X[u]||X[T]||x&&X[x],N=B||D(x),$=x?M?D("entries"):N:void 0,J=d=="Array"&&X.entries||B,tt,at,ut;if(J&&(ut=m(J.call(new O())),ut!==Object.prototype&&ut.next&&(h(ut,U,!0),!r&&typeof ut[u]!="function"&&c(ut,u,S))),M&&B&&B.name!==I&&(W=!0,N=function N(){return B.call(this);}),(!r||R)&&(y||W||!X[u])&&c(X,u,N),l[d]=N,l[U]=S,x)if(tt={values:M?N:D(I),keys:E?N:D(w),entries:$},R)for(at in tt)at in X||s(X,at,tt[at]);else n(n.P+n.F*(y||W),d,tt);return tt;};},/* 89 *//***/function(i,e){i.exports=!0;},/* 90 *//***/function(i,e,t){var r=t(91),n=t(92),s=t(93),c=t(95),l=t(105),f="prototype",_h2=function h(m,u,y){var T=m&_h2.F,w=m&_h2.G,I=m&_h2.S,S=m&_h2.P,O=m&_h2.B,d=m&_h2.W,v=w?n:n[u]||(n[u]={}),p=v[f],x=w?r:I?r[u]:(r[u]||{})[f],E,R,D;w&&(y=u);for(E in y)R=!T&&x&&x[E]!==void 0,!(R&&l(v,E))&&(D=R?x[E]:y[E],v[E]=w&&typeof x[E]!="function"?y[E]:O&&R?s(D,r):d&&x[E]==D?function(U){var M=function M(W,X,B){if(this instanceof U){switch(arguments.length){case 0:return new U();case 1:return new U(W);case 2:return new U(W,X);}return new U(W,X,B);}return U.apply(this,arguments);};return M[f]=U[f],M;}(D):S&&typeof D=="function"?s(Function.call,D):D,S&&((v.virtual||(v.virtual={}))[E]=D,m&_h2.R&&p&&!p[E]&&c(p,E,D)));};_h2.F=1,_h2.G=2,_h2.S=4,_h2.P=8,_h2.B=16,_h2.W=32,_h2.U=64,_h2.R=128,i.exports=_h2;},/* 91 *//***/function(i,e){var t=i.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(i,e){var t=i.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 *//***/function(i,e,t){var r=t(94);i.exports=function(n,s,c){if(r(n),s===void 0)return n;switch(c){case 1:return function(l){return n.call(s,l);};case 2:return function(l,f){return n.call(s,l,f);};case 3:return function(l,f,h){return n.call(s,l,f,h);};}return function(){return n.apply(s,arguments);};};},/* 94 *//***/function(i,e){i.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 *//***/function(i,e,t){var r=t(96),n=t(104);i.exports=t(100)?function(s,c,l){return r.f(s,c,n(1,l));}:function(s,c,l){return s[c]=l,s;};},/* 96 *//***/function(i,e,t){var r=t(97),n=t(99),s=t(103),c=Object.defineProperty;e.f=t(100)?Object.defineProperty:function(f,h,m){if(r(f),h=s(h,!0),r(m),n)try{return c(f,h,m);}catch(_unused10){}if("get"in m||"set"in m)throw TypeError("Accessors not supported!");return"value"in m&&(f[h]=m.value),f;};},/* 97 *//***/function(i,e,t){var r=t(98);i.exports=function(n){if(!r(n))throw TypeError(n+" is not an object!");return n;};},/* 98 *//***/function(i,e){i.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 *//***/function(i,e,t){i.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 *//***/function(i,e,t){i.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 *//***/function(i,e){i.exports=function(t){try{return!!t();}catch(_unused11){return!0;}};},/* 102 *//***/function(i,e,t){var r=t(98),n=t(91).document,s=r(n)&&r(n.createElement);i.exports=function(c){return s?n.createElement(c):{};};},/* 103 *//***/function(i,e,t){var r=t(98);i.exports=function(n,s){if(!r(n))return n;var c,l;if(s&&typeof(c=n.toString)=="function"&&!r(l=c.call(n))||typeof(c=n.valueOf)=="function"&&!r(l=c.call(n))||!s&&typeof(c=n.toString)=="function"&&!r(l=c.call(n)))return l;throw TypeError("Can't convert object to primitive value");};},/* 104 *//***/function(i,e){i.exports=function(t,r){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:r};};},/* 105 *//***/function(i,e){var t={}.hasOwnProperty;i.exports=function(r,n){return t.call(r,n);};},/* 106 *//***/function(i,e,t){i.exports=t(95);},/* 107 *//***/function(i,e,t){var r=t(108),n=t(104),s=t(121),c={};t(95)(c,t(122)("iterator"),function(){return this;}),i.exports=function(l,f,h){l.prototype=r(c,{next:n(1,h)}),s(l,f+" Iterator");};},/* 108 *//***/function(i,e,t){var r=t(97),n=t(109),s=t(119),c=t(116)("IE_PROTO"),l=function l(){},f="prototype",_h3=function h(){var m=t(102)("iframe"),u=s.length,y="<",T=">",w;for(m.style.display="none",t(120).appendChild(m),m.src="javascript:",w=m.contentWindow.document,w.open(),w.write(y+"script"+T+"document.F=Object"+y+"/script"+T),w.close(),_h3=w.F;u--;)delete _h3[f][s[u]];return _h3();};i.exports=Object.create||function(u,y){var T;return u!==null?(l[f]=r(u),T=new l(),l[f]=null,T[c]=u):T=_h3(),y===void 0?T:n(T,y);};},/* 109 *//***/function(i,e,t){var r=t(96),n=t(97),s=t(110);i.exports=t(100)?Object.defineProperties:function(l,f){n(l);for(var h=s(f),m=h.length,u=0,y;m>u;)r.f(l,y=h[u++],f[y]);return l;};},/* 110 *//***/function(i,e,t){var r=t(111),n=t(119);i.exports=Object.keys||function(c){return r(c,n);};},/* 111 *//***/function(i,e,t){var r=t(105),n=t(84),s=t(112)(!1),c=t(116)("IE_PROTO");i.exports=function(l,f){var h=n(l),m=0,u=[],y;for(y in h)y!=c&&r(h,y)&&u.push(y);for(;f.length>m;)r(h,y=f[m++])&&(~s(u,y)||u.push(y));return u;};},/* 112 *//***/function(i,e,t){var r=t(84),n=t(113),s=t(115);i.exports=function(c){return function(l,f,h){var m=r(l),u=n(m.length),y=s(h,u),T;if(c&&f!=f){for(;u>y;)if(T=m[y++],T!=T)return!0;}else for(;u>y;y++)if((c||y in m)&&m[y]===f)return c||y||0;return!c&&-1;};};},/* 113 *//***/function(i,e,t){var r=t(114),n=Math.min;i.exports=function(s){return s>0?n(r(s),9007199254740991):0;};},/* 114 *//***/function(i,e){var t=Math.ceil,r=Math.floor;i.exports=function(n){return isNaN(n=+n)?0:(n>0?r:t)(n);};},/* 115 *//***/function(i,e,t){var r=t(114),n=Math.max,s=Math.min;i.exports=function(c,l){return c=r(c),c<0?n(c+l,0):s(c,l);};},/* 116 *//***/function(i,e,t){var r=t(117)("keys"),n=t(118);i.exports=function(s){return r[s]||(r[s]=n(s));};},/* 117 *//***/function(i,e,t){var r=t(92),n=t(91),s="__core-js_shared__",c=n[s]||(n[s]={});(i.exports=function(l,f){return c[l]||(c[l]=f!==void 0?f:{});})("versions",[]).push({version:r.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 *//***/function(i,e){var t=0,r=Math.random();i.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+r).toString(36));};},/* 119 *//***/function(i,e){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 *//***/function(i,e,t){var r=t(91).document;i.exports=r&&r.documentElement;},/* 121 *//***/function(i,e,t){var r=t(96).f,n=t(105),s=t(122)("toStringTag");i.exports=function(c,l,f){c&&!n(c=f?c:c.prototype,s)&&r(c,s,{configurable:!0,value:l});};},/* 122 *//***/function(i,e,t){var r=t(117)("wks"),n=t(118),s=t(91).Symbol,c=typeof s=="function",l=i.exports=function(f){return r[f]||(r[f]=c&&s[f]||(c?s:n)("Symbol."+f));};l.store=r;},/* 123 *//***/function(i,e,t){var r=t(105),n=t(124),s=t(116)("IE_PROTO"),c=Object.prototype;i.exports=Object.getPrototypeOf||function(l){return l=n(l),r(l,s)?l[s]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null;};},/* 124 *//***/function(i,e,t){var r=t(87);i.exports=function(n){return Object(r(n));};},/* 125 *//***/function(i,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,s=this._i,c;return s>=n.length?{value:void 0,done:!0}:(c=r(n,s),this._i+=c.length,{value:c,done:!1});});},/* 126 *//***/function(i,e,t){var r=t(114),n=t(87);i.exports=function(s){return function(c,l){var f=String(n(c)),h=r(l),m=f.length,u,y;return h<0||h>=m?s?"":void 0:(u=f.charCodeAt(h),u<55296||u>56319||h+1===m||(y=f.charCodeAt(h+1))<56320||y>57343?s?f.charAt(h):u:s?f.slice(h,h+2):(u-55296<<10)+(y-56320)+65536);};};},/* 127 *//***/function(i,e,t){var r=t(128),n=t(122)("iterator"),s=t(83);i.exports=t(92).isIterable=function(c){var l=Object(c);return l[n]!==void 0||"@@iterator"in l||s.hasOwnProperty(r(l));};},/* 128 *//***/function(i,e,t){var r=t(86),n=t(122)("toStringTag"),s=r(/* @__PURE__ */function(){return arguments;}())=="Arguments",c=function c(l,f){try{return l[f];}catch(_unused12){}};i.exports=function(l){var f,h,m;return l===void 0?"Undefined":l===null?"Null":typeof(h=c(f=Object(l),n))=="string"?h:s?r(f):(m=r(f))=="Object"&&typeof f.callee=="function"?"Arguments":m;};},/* 129 *//***/function(i,e,t){i.exports={"default":t(130),__esModule:!0};},/* 130 *//***/function(i,e,t){t(79),t(125),i.exports=t(131);},/* 131 *//***/function(i,e,t){var r=t(97),n=t(132);i.exports=t(92).getIterator=function(s){var c=n(s);if(typeof c!="function")throw TypeError(s+" is not iterable!");return r(c.call(s));};},/* 132 *//***/function(i,e,t){var r=t(128),n=t(122)("iterator"),s=t(83);i.exports=t(92).getIteratorMethod=function(c){if(c!=null)return c[n]||c["@@iterator"]||s[r(c)];};},/* 133 *//***/function(i,e,t){e.__esModule=!0;var r=t(134),n=s(r);function s(c){return c&&c.__esModule?c:{"default":c};}e["default"]=function(c){if(Array.isArray(c)){for(var l=0,f=Array(c.length);l<c.length;l++)f[l]=c[l];return f;}else return(0,n["default"])(c);};},/* 134 *//***/function(i,e,t){i.exports={"default":t(135),__esModule:!0};},/* 135 *//***/function(i,e,t){t(125),t(136),i.exports=t(92).Array.from;},/* 136 *//***/function(i,e,t){var r=t(93),n=t(90),s=t(124),c=t(137),l=t(138),f=t(113),h=t(139),m=t(132);n(n.S+n.F*!t(140)(function(u){Array.from(u);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
|
|
221
|
+
from:function from(y){var T=s(y),w=typeof this=="function"?this:Array,I=arguments.length,S=I>1?arguments[1]:void 0,O=S!==void 0,d=0,v=m(T),p,x,E,R;if(O&&(S=r(S,I>2?arguments[2]:void 0,2)),v!=null&&!(w==Array&&l(v)))for(R=v.call(T),x=new w();!(E=R.next()).done;d++)h(x,d,O?c(R,S,[E.value,d],!0):E.value);else for(p=f(T.length),x=new w(p);p>d;d++)h(x,d,O?S(T[d],d):T[d]);return x.length=d,x;}});},/* 137 *//***/function(i,e,t){var r=t(97);i.exports=function(n,s,c,l){try{return l?s(r(c)[0],c[1]):s(c);}catch(h){var f=n["return"];throw f!==void 0&&r(f.call(n)),h;}};},/* 138 *//***/function(i,e,t){var r=t(83),n=t(122)("iterator"),s=Array.prototype;i.exports=function(c){return c!==void 0&&(r.Array===c||s[n]===c);};},/* 139 *//***/function(i,e,t){var r=t(96),n=t(104);i.exports=function(s,c,l){c in s?r.f(s,c,n(0,l)):s[c]=l;};},/* 140 *//***/function(i,e,t){var r=t(122)("iterator"),n=!1;try{var s=[7][r]();s["return"]=function(){n=!0;},Array.from(s,function(){throw 2;});}catch(_unused13){}i.exports=function(c,l){if(!l&&!n)return!1;var f=!1;try{var h=[7],m=h[r]();m.next=function(){return{done:f=!0};},h[r]=function(){return m;},c(h);}catch(_unused14){}return f;};},/* 141 *//***/function(i,e,t){i.exports={"default":t(142),__esModule:!0};},/* 142 *//***/function(i,e,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),i.exports=t(92).Map;},/* 143 *//***/function(i,e){},/* 144 *//***/function(i,e,t){var r=t(145),n=t(151),s="Map";i.exports=t(152)(s,function(c){return function(){return c(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
|
|
222
|
+
get:function get(l){var f=r.getEntry(n(this,s),l);return f&&f.v;},// 23.1.3.9 Map.prototype.set(key, value)
|
|
223
|
+
set:function set(l,f){return r.def(n(this,s),l===0?0:l,f);}},r,!0);},/* 145 *//***/function(i,e,t){var r=t(96).f,n=t(108),s=t(146),c=t(93),l=t(147),f=t(148),h=t(88),m=t(82),u=t(149),y=t(100),T=t(150).fastKey,w=t(151),I=y?"_s":"size",S=function S(O,d){var v=T(d),p;if(v!=="F")return O._i[v];for(p=O._f;p;p=p.n)if(p.k==d)return p;};i.exports={getConstructor:function getConstructor(O,d,v,p){var x=O(function(E,R){l(E,x,d,"_i"),E._t=d,E._i=n(null),E._f=void 0,E._l=void 0,E[I]=0,R!=null&&f(R,v,E[p],E);});return s(x.prototype,{// 23.1.3.1 Map.prototype.clear()
|
|
224
|
+
// 23.2.3.2 Set.prototype.clear()
|
|
225
|
+
clear:function clear(){for(var R=w(this,d),D=R._i,U=R._f;U;U=U.n)U.r=!0,U.p&&(U.p=U.p.n=void 0),delete D[U.i];R._f=R._l=void 0,R[I]=0;},// 23.1.3.3 Map.prototype.delete(key)
|
|
226
|
+
// 23.2.3.4 Set.prototype.delete(value)
|
|
227
|
+
"delete":function _delete(E){var R=w(this,d),D=S(R,E);if(D){var U=D.n,M=D.p;delete R._i[D.i],D.r=!0,M&&(M.n=U),U&&(U.p=M),R._f==D&&(R._f=U),R._l==D&&(R._l=M),R[I]--;}return!!D;},// 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(R){w(this,d);for(var D=c(R,arguments.length>1?arguments[1]:void 0,3),U;U=U?U.n:this._f;)for(D(U.v,U.k,this);U&&U.r;)U=U.p;},// 23.1.3.7 Map.prototype.has(key)
|
|
230
|
+
// 23.2.3.7 Set.prototype.has(value)
|
|
231
|
+
has:function has(R){return!!S(w(this,d),R);}}),y&&r(x.prototype,"size",{get:function get(){return w(this,d)[I];}}),x;},def:function def(O,d,v){var p=S(O,d),x,E;return p?p.v=v:(O._l=p={i:E=T(d,!0),// <- index
|
|
232
|
+
k:d,// <- key
|
|
233
|
+
v:v,// <- value
|
|
234
|
+
p:x=O._l,// <- previous entry
|
|
235
|
+
n:void 0,// <- next entry
|
|
236
|
+
r:!1// <- removed
|
|
237
|
+
},O._f||(O._f=p),x&&(x.n=p),O[I]++,E!=="F"&&(O._i[E]=p)),O;},getEntry:S,setStrong:function setStrong(O,d,v){h(O,d,function(p,x){this._t=w(p,d),this._k=x,this._l=void 0;},function(){for(var p=this,x=p._k,E=p._l;E&&E.r;)E=E.p;return!p._t||!(p._l=E=E?E.n:p._t._f)?(p._t=void 0,m(1)):x=="keys"?m(0,E.k):x=="values"?m(0,E.v):m(0,[E.k,E.v]);},v?"entries":"values",!v,!0),u(d);}};},/* 146 *//***/function(i,e,t){var r=t(95);i.exports=function(n,s,c){for(var l in s)c&&n[l]?n[l]=s[l]:r(n,l,s[l]);return n;};},/* 147 *//***/function(i,e){i.exports=function(t,r,n,s){if(!(t instanceof r)||s!==void 0&&s in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 *//***/function(i,u,t){var r=t(93),n=t(137),s=t(138),c=t(97),l=t(113),f=t(132),h={},m={},u=i.exports=function(y,T,w,I,S){var O=S?function(){return y;}:f(y),d=r(w,I,T?2:1),v=0,p,x,E,R;if(typeof O!="function")throw TypeError(y+" is not iterable!");if(s(O)){for(p=l(y.length);p>v;v++)if(R=T?d(c(x=y[v])[0],x[1]):d(y[v]),R===h||R===m)return R;}else for(E=O.call(y);!(x=E.next()).done;)if(R=n(E,d,x.value,T),R===h||R===m)return R;};u.BREAK=h,u.RETURN=m;},/* 149 *//***/function(i,e,t){var r=t(91),n=t(92),s=t(96),c=t(100),l=t(122)("species");i.exports=function(f){var h=typeof n[f]=="function"?n[f]:r[f];c&&h&&!h[l]&&s.f(h,l,{configurable:!0,get:function get(){return this;}});};},/* 150 *//***/function(i,e,t){var r=t(118)("meta"),n=t(98),s=t(105),c=t(96).f,l=0,f=Object.isExtensible||function(){return!0;},h=!t(101)(function(){return f(Object.preventExtensions({}));}),m=function m(I){c(I,r,{value:{i:"O"+ ++l,// object ID
|
|
238
|
+
w:{}// weak collections IDs
|
|
239
|
+
}});},u=function u(I,S){if(!n(I))return _typeof(I)=="symbol"?I:(typeof I=="string"?"S":"P")+I;if(!s(I,r)){if(!f(I))return"F";if(!S)return"E";m(I);}return I[r].i;},y=function y(I,S){if(!s(I,r)){if(!f(I))return!0;if(!S)return!1;m(I);}return I[r].w;},T=function T(I){return h&&w.NEED&&f(I)&&!s(I,r)&&m(I),I;},w=i.exports={KEY:r,NEED:!1,fastKey:u,getWeak:y,onFreeze:T};},/* 151 *//***/function(i,e,t){var r=t(98);i.exports=function(n,s){if(!r(n)||n._t!==s)throw TypeError("Incompatible receiver, "+s+" required!");return n;};},/* 152 *//***/function(i,e,t){var r=t(91),n=t(90),s=t(150),c=t(101),l=t(95),f=t(146),h=t(148),m=t(147),u=t(98),y=t(121),T=t(96).f,w=t(153)(0),I=t(100);i.exports=function(S,O,d,v,p,x){var E=r[S],R=E,D=p?"set":"add",U=R&&R.prototype,M={};return!I||typeof R!="function"||!(x||U.forEach&&!c(function(){new R().entries().next();}))?(R=v.getConstructor(O,S,p,D),f(R.prototype,d),s.NEED=!0):(R=O(function(W,X){m(W,R,S,"_c"),W._c=new E(),X!=null&&h(X,p,W[D],W);}),w("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(W){var X=W=="add"||W=="set";W in U&&!(x&&W=="clear")&&l(R.prototype,W,function(B,N){if(m(this,R,W),!X&&x&&!u(B))return W=="get"?void 0:!1;var $=this._c[W](B===0?0:B,N);return X?this:$;});}),x||T(R.prototype,"size",{get:function get(){return this._c.size;}})),y(R,S),M[S]=R,n(n.G+n.W+n.F,M),x||v.setStrong(R,S,p),R;};},/* 153 *//***/function(i,e,t){var r=t(93),n=t(85),s=t(124),c=t(113),l=t(154);i.exports=function(f,h){var m=f==1,u=f==2,y=f==3,T=f==4,w=f==6,I=f==5||w,S=h||l;return function(O,d,v){for(var p=s(O),x=n(p),E=r(d,v,3),R=c(x.length),D=0,U=m?S(O,R):u?S(O,0):void 0,M,W;R>D;D++)if((I||D in x)&&(M=x[D],W=E(M,D,p),f)){if(m)U[D]=W;else if(W)switch(f){case 3:return!0;case 5:return M;case 6:return D;case 2:U.push(M);}else if(T)return!1;}return w?-1:y||T?T:U;};};},/* 154 *//***/function(i,e,t){var r=t(155);i.exports=function(n,s){return new(r(n))(s);};},/* 155 *//***/function(i,e,t){var r=t(98),n=t(156),s=t(122)("species");i.exports=function(c){var l;return n(c)&&(l=c.constructor,typeof l=="function"&&(l===Array||n(l.prototype))&&(l=void 0),r(l)&&(l=l[s],l===null&&(l=void 0))),l===void 0?Array:l;};},/* 156 *//***/function(i,e,t){var r=t(86);i.exports=Array.isArray||function(s){return r(s)=="Array";};},/* 157 *//***/function(i,e,t){var r=t(90);r(r.P+r.R,"Map",{toJSON:t(158)("Map")});},/* 158 *//***/function(i,e,t){var r=t(128),n=t(159);i.exports=function(s){return function(){if(r(this)!=s)throw TypeError(s+"#toJSON isn't generic");return n(this);};};},/* 159 *//***/function(i,e,t){var r=t(148);i.exports=function(n,s){var c=[];return r(n,!1,c.push,c,s),c;};},/* 160 *//***/function(i,e,t){t(161)("Map");},/* 161 *//***/function(i,e,t){var r=t(90);i.exports=function(n){r(r.S,n,{of:function of(){for(var c=arguments.length,l=new Array(c);c--;)l[c]=arguments[c];return new this(l);}});};},/* 162 *//***/function(i,e,t){t(163)("Map");},/* 163 *//***/function(i,e,t){var r=t(90),n=t(94),s=t(93),c=t(148);i.exports=function(l){r(r.S,l,{from:function from(h){var m=arguments[1],u,y,T,w;return n(this),u=m!==void 0,u&&n(m),h==null?new this():(y=[],u?(T=0,w=s(m,arguments[2],2),c(h,!1,function(I){y.push(w(I,T++));})):c(h,!1,y.push,y),new this(y));}});};},/* 164 *//***/function(i,e,t){i.exports={"default":t(165),__esModule:!0};},/* 165 *//***/function(i,e,t){t(166),i.exports=t(92).Object.assign;},/* 166 *//***/function(i,e,t){var r=t(90);r(r.S+r.F,"Object",{assign:t(167)});},/* 167 *//***/function(i,e,t){var r=t(100),n=t(110),s=t(168),c=t(169),l=t(124),f=t(85),h=Object.assign;i.exports=!h||t(101)(function(){var m={},u={},y=Symbol(),T="abcdefghijklmnopqrst";return m[y]=7,T.split("").forEach(function(w){u[w]=w;}),h({},m)[y]!=7||Object.keys(h({},u)).join("")!=T;})?function(u,y){for(var T=l(u),w=arguments.length,I=1,S=s.f,O=c.f;w>I;)for(var d=f(arguments[I++]),v=S?n(d).concat(S(d)):n(d),p=v.length,x=0,E;p>x;)E=v[x++],(!r||O.call(d,E))&&(T[E]=d[E]);return T;}:h;},/* 168 *//***/function(i,e){e.f=Object.getOwnPropertySymbols;},/* 169 *//***/function(i,e){e.f={}.propertyIsEnumerable;},/* 170 *//***/function(i,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(i,e,t){e.__esModule=!0;var r=t(172),n=s(r);function s(c){return c&&c.__esModule?c:{"default":c};}e["default"]=/* @__PURE__ */function(){function c(l,f){for(var h=0;h<f.length;h++){var m=f[h];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),(0,n["default"])(l,m.key,m);}}return function(l,f,h){return f&&c(l.prototype,f),h&&c(l,h),l;};}();},/* 172 *//***/function(i,e,t){i.exports={"default":t(173),__esModule:!0};},/* 173 *//***/function(i,e,t){t(174);var r=t(92).Object;i.exports=function(s,c,l){return r.defineProperty(s,c,l);};},/* 174 *//***/function(i,e,t){var r=t(90);r(r.S+r.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 *//***/function(i,e,t){i.exports={"default":t(176),__esModule:!0};},/* 176 *//***/function(i,e,t){t(177),t(143),t(184),t(185),i.exports=t(92).Symbol;},/* 177 *//***/function(i,e,t){var r=t(91),n=t(105),s=t(100),c=t(90),l=t(106),f=t(150).KEY,h=t(101),m=t(117),u=t(121),y=t(118),T=t(122),w=t(178),I=t(179),S=t(180),O=t(156),d=t(97),v=t(98),p=t(124),x=t(84),E=t(103),R=t(104),D=t(108),U=t(181),M=t(183),W=t(168),X=t(96),B=t(110),N=M.f,$=X.f,J=U.f,_tt2=r.Symbol,at=r.JSON,ut=at&&at.stringify,V="prototype",Q=T("_hidden"),ft=T("toPrimitive"),mt={}.propertyIsEnumerable,yt=m("symbol-registry"),wt=m("symbols"),ht=m("op-symbols"),Nt=Object[V],Dt=typeof _tt2=="function"&&!!W.f,G=r.QObject,k=!G||!G[V]||!G[V].findChild,rt=s&&h(function(){return D($({},"a",{get:function get(){return $(this,"a",{value:7}).a;}})).a!=7;})?function(At,Ot,Lt){var Yt=N(Nt,Ot);Yt&&delete Nt[Ot],$(At,Ot,Lt),Yt&&At!==Nt&&$(Nt,Ot,Yt);}:$,nt=function nt(At){var Ot=wt[At]=D(_tt2[V]);return Ot._k=At,Ot;},Y=Dt&&_typeof(_tt2.iterator)=="symbol"?function(At){return _typeof(At)=="symbol";}:function(At){return At instanceof _tt2;},_Z2=function Z(Ot,Lt,Yt){return Ot===Nt&&_Z2(ht,Lt,Yt),d(Ot),Lt=E(Lt,!0),d(Yt),n(wt,Lt)?(Yt.enumerable?(n(Ot,Q)&&Ot[Q][Lt]&&(Ot[Q][Lt]=!1),Yt=D(Yt,{enumerable:R(0,!1)})):(n(Ot,Q)||$(Ot,Q,R(1,{})),Ot[Q][Lt]=!0),rt(Ot,Lt,Yt)):$(Ot,Lt,Yt);},C=function C(Ot,Lt){d(Ot);for(var Yt=S(Lt=x(Lt)),$t=0,Wt=Yt.length,Qt;Wt>$t;)_Z2(Ot,Qt=Yt[$t++],Lt[Qt]);return Ot;},L=function L(Ot,Lt){return Lt===void 0?D(Ot):C(D(Ot),Lt);},z=function z(Ot){var Lt=mt.call(this,Ot=E(Ot,!0));return this===Nt&&n(wt,Ot)&&!n(ht,Ot)?!1:Lt||!n(this,Ot)||!n(wt,Ot)||n(this,Q)&&this[Q][Ot]?Lt:!0;},K=function K(Ot,Lt){if(Ot=x(Ot),Lt=E(Lt,!0),!(Ot===Nt&&n(wt,Lt)&&!n(ht,Lt))){var Yt=N(Ot,Lt);return Yt&&n(wt,Lt)&&!(n(Ot,Q)&&Ot[Q][Lt])&&(Yt.enumerable=!0),Yt;}},q=function q(Ot){for(var Lt=J(x(Ot)),Yt=[],$t=0,Wt;Lt.length>$t;)!n(wt,Wt=Lt[$t++])&&Wt!=Q&&Wt!=f&&Yt.push(Wt);return Yt;},it=function it(Ot){for(var Lt=Ot===Nt,Yt=J(Lt?ht:x(Ot)),$t=[],Wt=0,Qt;Yt.length>Wt;)n(wt,Qt=Yt[Wt++])&&(!Lt||n(Nt,Qt))&&$t.push(wt[Qt]);return $t;};Dt||(_tt2=function tt(){if(this instanceof _tt2)throw TypeError("Symbol is not a constructor!");var Ot=y(arguments.length>0?arguments[0]:void 0),_Lt=function Lt(Yt){this===Nt&&_Lt.call(ht,Yt),n(this,Q)&&n(this[Q],Ot)&&(this[Q][Ot]=!1),rt(this,Ot,R(1,Yt));};return s&&k&&rt(Nt,Ot,{configurable:!0,set:_Lt}),nt(Ot);},l(_tt2[V],"toString",function(){return this._k;}),M.f=K,X.f=_Z2,t(182).f=U.f=q,t(169).f=z,W.f=it,s&&!t(89)&&l(Nt,"propertyIsEnumerable",z,!0),w.f=function(At){return nt(T(At));}),c(c.G+c.W+c.F*!Dt,{Symbol:_tt2});for(var ct=// 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(","),xt=0;ct.length>xt;)T(ct[xt++]);for(var Ct=B(T.store),Mt=0;Ct.length>Mt;)I(Ct[Mt++]);c(c.S+c.F*!Dt,"Symbol",{// 19.4.2.1 Symbol.for(key)
|
|
241
|
+
"for":function _for(At){return n(yt,At+="")?yt[At]:yt[At]=_tt2(At);},// 19.4.2.5 Symbol.keyFor(sym)
|
|
242
|
+
keyFor:function keyFor(Ot){if(!Y(Ot))throw TypeError(Ot+" is not a symbol!");for(var Lt in yt)if(yt[Lt]===Ot)return Lt;},useSetter:function useSetter(){k=!0;},useSimple:function useSimple(){k=!1;}}),c(c.S+c.F*!Dt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
|
|
243
|
+
create:L,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
|
|
244
|
+
defineProperty:_Z2,// 19.1.2.3 Object.defineProperties(O, Properties)
|
|
245
|
+
defineProperties:C,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
|
246
|
+
getOwnPropertyDescriptor:K,// 19.1.2.7 Object.getOwnPropertyNames(O)
|
|
247
|
+
getOwnPropertyNames:q,// 19.1.2.8 Object.getOwnPropertySymbols(O)
|
|
248
|
+
getOwnPropertySymbols:it});var bt=h(function(){W.f(1);});c(c.S+c.F*bt,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(Ot){return W.f(p(Ot));}}),at&&c(c.S+c.F*(!Dt||h(function(){var At=_tt2();return ut([At])!="[null]"||ut({a:At})!="{}"||ut(Object(At))!="{}";})),"JSON",{stringify:function stringify(Ot){for(var Lt=[Ot],Yt=1,$t,Wt;arguments.length>Yt;)Lt.push(arguments[Yt++]);if(Wt=$t=Lt[1],!(!v($t)&&Ot===void 0||Y(Ot)))return O($t)||($t=function $t(Qt,ue){if(typeof Wt=="function"&&(ue=Wt.call(this,Qt,ue)),!Y(ue))return ue;}),Lt[1]=$t,ut.apply(at,Lt);}}),_tt2[V][ft]||t(95)(_tt2[V],ft,_tt2[V].valueOf),u(_tt2,"Symbol"),u(Math,"Math",!0),u(r.JSON,"JSON",!0);},/* 178 *//***/function(i,e,t){e.f=t(122);},/* 179 *//***/function(i,e,t){var r=t(91),n=t(92),s=t(89),c=t(178),l=t(96).f;i.exports=function(f){var h=n.Symbol||(n.Symbol=s?{}:r.Symbol||{});f.charAt(0)!="_"&&!(f in h)&&l(h,f,{value:c.f(f)});};},/* 180 *//***/function(i,e,t){var r=t(110),n=t(168),s=t(169);i.exports=function(c){var l=r(c),f=n.f;if(f)for(var h=f(c),m=s.f,u=0,y;h.length>u;)m.call(c,y=h[u++])&&l.push(y);return l;};},/* 181 *//***/function(i,e,t){var r=t(84),n=t(182).f,s={}.toString,c=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],l=function l(f){try{return n(f);}catch(_unused15){return c.slice();}};i.exports.f=function(h){return c&&s.call(h)=="[object Window]"?l(h):n(r(h));};},/* 182 *//***/function(i,e,t){var r=t(111),n=t(119).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(c){return r(c,n);};},/* 183 *//***/function(i,e,t){var r=t(169),n=t(104),s=t(84),c=t(103),l=t(105),f=t(99),h=Object.getOwnPropertyDescriptor;e.f=t(100)?h:function(u,y){if(u=s(u),y=c(y,!0),f)try{return h(u,y);}catch(_unused16){}if(l(u,y))return n(!r.f.call(u,y),u[y]);};},/* 184 *//***/function(i,e,t){t(179)("asyncIterator");},/* 185 *//***/function(i,e,t){t(179)("observable");},/* 186 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.createNowTime=r,e.formatDelay=n;function r(){var s=null;return Date.now?s=Date.now:s=function s(){return(/* @__PURE__ */new Date()).getTime();},s;}function n(s){return typeof s=="number"?s={delay:s}:"entropy"in s&&(s={delay:s.entropy,isEntropy:!0}),s;}},/* 187 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={// s - startFrame, e - endFrame
|
|
249
|
+
"default":function _default(n,s,c,l,f){return typeof n=="number"&&typeof s=="number"?n+(c-l)/(f-l)*(s-n):c-l>f-c?s:n;}};},/* 188 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.parseEasing=e.Easings=void 0;var r=t(76),n=h(r),s=t(133),c=h(s),l=t(141),f=h(l);function h(O){return O&&O.__esModule?O:{"default":O};}var m=t(189),u=new f["default"]();function y(){for(var O=arguments.length,d=Array(O),v=0;v<O;v++)d[v]=arguments[v];var p=u.get(d);return p||(p=m.apply(void 0,d),u.set(d,p),p);}function T(O){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(v,p){for(var x=1;x<p.length;x++){var E=p[x].offset;if(v<=E){var R=p[x-1].offset,D=E,U=(v-R)/(D-R),M=1/O,W=U/M;return d==="end"?W=Math.floor(W):W=Math.ceil(W),M*W*(D-R)+R;}}return 0;};}function w(O){var d=/^cubic-bezier\((.*)\)/,v=O.match(d);if(v){var p=v[1].trim();return p=p.split(",").map(function(M){return parseFloat(M.trim());}),y.apply(void 0,(0,c["default"])(p));}if(d=/^steps\((.*)\)/,v=O.match(d),v){var x=v[1].trim();x=x.split(",").map(function(M){return M.trim();});var E=x,R=(0,n["default"])(E,2),D=R[0],U=R[1];return T(parseInt(D,10),U);}return O;}var I={linear:function linear(d){return d;},ease:y(0.25,0.1,0.25,1),"ease-in":y(0.42,0,1,1),"ease-out":y(0,0,0.58,1),"ease-in-out":y(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":T(1,"start"),"step-end":T(1,"end")};function S(O){return typeof O=="string"?I[O]?O=I[O]:O=w(O):O.type==="cubic-bezier"?O=y.apply(void 0,(0,c["default"])(O.value)):O.type==="steps"&&(O=T(O.step,O.pos)),O;}e.Easings=I,e.parseEasing=S;},/* 189 *//***/function(i,e){var t=4,r=1e-3,n=1e-7,s=10,c=11,l=1/(c-1),f=typeof Float32Array=="function";function h(O,d){return 1-3*d+3*O;}function m(O,d){return 3*d-6*O;}function u(O){return 3*O;}function y(O,d,v){return((h(d,v)*O+m(d,v))*O+u(d))*O;}function T(O,d,v){return 3*h(d,v)*O*O+2*m(d,v)*O+u(d);}function w(O,d,v,p,x){var E,R,D=0;do R=d+(v-d)/2,E=y(R,p,x)-O,E>0?v=R:d=R;while(Math.abs(E)>n&&++D<s);return R;}function I(O,d,v,p){for(var x=0;x<t;++x){var E=T(d,v,p);if(E===0)return d;var R=y(d,v,p)-O;d-=R/E;}return d;}function S(O){return O;}i.exports=function(d,v,p,x){if(!(0<=d&&d<=1&&0<=p&&p<=1))throw new Error("bezier x values must be in [0, 1] range");if(d===v&&p===x)return S;for(var E=f?new Float32Array(c):new Array(c),R=0;R<c;++R)E[R]=y(R*l,d,p);function D(U){for(var M=0,W=1,X=c-1;W!==X&&E[W]<=U;++W)M+=l;--W;var B=(U-E[W])/(E[W+1]-E[W]),N=M+B*l,$=T(N,d,p);return $>=r?I(U,N,d,p):$===0?N:w(U,M,M+l,d,p);}return function(M){return M===0?0:M===1?1:y(D(M),v,x);};};},/* 190 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(191),n=v(r),s=t(204),c=v(s),l=t(164),f=v(l),h=t(170),m=v(h),u=t(171),y=v(u),T=t(175),w=v(T),I=t(75),S=v(I),O=t(208),d=t(188);function v($){return $&&$.__esModule?$:{"default":$};}var p=(0,w["default"])("timing"),x=(0,w["default"])("keyframes"),E=(0,w["default"])("initState"),R=(0,w["default"])("readyDefer"),D=(0,w["default"])("finishedDefer"),U=(0,w["default"])("effects"),M=(0,w["default"])("activeReadyTimer"),W=(0,w["default"])("activeFinishTimer"),X=(0,w["default"])("removeDefer"),B={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},N=function(){function $(J,tt,at){var ut=this;if((0,m["default"])(this,$),Array.isArray(J)){var V=[J[0],J,tt];J=V[0],tt=V[1],at=V[2];}typeof at=="number"&&(at={duration:at}),this[p]=(0,f["default"])({},B,at),this[p].easing=(0,d.parseEasing)(this[p].easing),this[x]=(0,O.calculateFramesOffset)(tt);var Q=this[x][this[x].length-1];this[E]={},(0,c["default"])(Q).forEach(function(ft){Object.prototype.hasOwnProperty.call(J,ft)&&ft!=="easing"&&ft!=="offset"&&(ut[E][ft]=J[ft]);}),this[x]=this[x].map(function(ft){return(0,f["default"])({},ut[E],ft);}),this[x][0].offset!==0&&this[x].unshift((0,f["default"])({},this[E],{offset:0})),Q.offset<1&&this[x].push((0,f["default"])({},Q,{offset:1})),this[U]={},this.timeline=null;}return(0,y["default"])($,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:M,value:function value(){var tt=this;this[R]&&!this[R].timerID&&(this.timeline.currentTime<0?this[R].timerID=this.timeline.setTimeout(function(){tt[R].resolve(),delete tt[R];},{delay:-this.timeline.currentTime,heading:!1}):this[R].timerID=this.timeline.setTimeout(function(){tt[R].resolve(),delete tt[R];},{delay:0,isEntropy:!0}));}},{key:W,value:function value(){var tt=this,at=this[p],ut=at.duration,V=at.iterations,Q=at.endDelay,ft=Math.ceil(ut*V+Q-this.timeline.currentTime)+1;this[D]&&!this[D].timerID&&(this[D].timerID=this.timeline.setTimeout(function(){tt[D].resolve(),tt[X](R),tt[X](D);},{delay:ft,heading:!1}),this[D].reverseTimerID=this.timeline.setTimeout(function(){tt[D].resolve(),tt[X](R),tt[X](D),tt.timeline=null;},{delay:-this[p].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var tt=this[p],at=tt.delay,ut=tt.playbackRate,V=tt.timeline;this.timeline=new S["default"]({originTime:at,playbackRate:ut},V),this[M](),this[W]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[M]());}},{key:X,value:function value(tt){var at=this[tt],ut=this.timeline;at&&ut&&(ut.clearTimeout(at.timerID),at.reverseTimerID&&ut.clearTimeout(at.reverseTimerID)),delete this[tt];}},{key:"cancel",value:function value(){this[X](R),this[X](D),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[X](R),this[X](D);}},{key:"applyEffects",value:function value(tt){return(0,f["default"])(this[U],tt);}},{key:"playbackRate",get:function get(){return this[p].playbackRate;},set:function set(tt){this.timeline&&(this.timeline.playbackRate=tt),this[p].playbackRate=tt;}},{key:"playState",get:function get(){var tt=this.timeline,at=this[p],ut=at.iterations,V=at.duration,Q=at.endDelay,ft="running";if(tt==null)ft="idle";else if(tt.paused)ft="paused";else if(tt.currentTime<0)ft="pending";else{var mt=tt.currentTime-ut*V;mt>0&&mt<Q?ft="pending":mt>=Q&&(ft="finished");}return ft;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var tt=this[p],at=tt.duration,ut=tt.iterations,V=this.timeline,Q=this.playState,ft=void 0;if(Q==="idle")ft=0;else if(Q==="paused"&&V.currentTime<0)ft=0;else if(Q==="pending"){if(V.currentTime<0)ft=0;else{var mt=V.seekLocalTime(ut*at);ft=(0,O.periodicity)(mt,at)[1]/at;}}else(Q==="running"||Q==="paused")&&(ft=(0,O.periodicity)(V.currentTime,at)[1]/at);return Q==="finished"&&(ft=(0,O.periodicity)(ut,1)[1]),ft;}},{key:"frame",get:function get(){var tt=this.playState,at=this[E],ut=this[p].fill;if(tt==="idle")return at;var V=this.timeline.currentTime,Q=this[x].slice(0),ft=(0,O.getProgress)(this.timeline,this[p],this.progress),mt=ft.p,yt=ft.inverted,wt=at;return V<0&&tt==="pending"?(ut==="backwards"||ut==="both")&&(wt=yt?Q[Q.length-1]:Q[0]):(tt!=="pending"&&tt!=="finished"||ut==="forwards"||ut==="both")&&(wt=(0,O.getCurrentFrame)(this[p],Q,this[U],mt)),wt;}},{key:"timing",get:function get(){return this[p];}},{key:"effects",get:function get(){return this[U];}},{key:"baseTimeline",set:function set(tt){this[p].timeline=tt;},get:function get(){return this[p].timeline;}},{key:"ready",get:function get(){return this[R]?this[R].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[R]=(0,O.defer)(),this.timeline&&this[M](),this[R]?this[R].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[D]||(this[D]=(0,O.defer)(),this.timeline&&this[W]()),this[D].promise);}}]),$;}();e["default"]=N;},/* 191 *//***/function(i,e,t){i.exports={"default":t(192),__esModule:!0};},/* 192 *//***/function(i,e,t){t(143),t(125),t(79),t(193),t(202),t(203),i.exports=t(92).Promise;},/* 193 *//***/function(i,e,t){var r=t(89),n=t(91),s=t(93),c=t(128),l=t(90),f=t(98),h=t(94),m=t(147),u=t(148),y=t(194),T=t(195).set,w=t(197)(),I=t(198),S=t(199),O=t(200),d=t(201),v="Promise",p=n.TypeError,x=n.process,E=x&&x.versions,R=E&&E.v8||"",_D=n[v],U=c(x)=="process",M=function M(){},W,X,B,N,$=X=I.f,J=!!function(){try{var yt=_D.resolve(1),wt=(yt.constructor={})[t(122)("species")]=function(ht){ht(M,M);};return(U||typeof PromiseRejectionEvent=="function")&&yt.then(M)instanceof wt&&R.indexOf("6.6")!==0&&O.indexOf("Chrome/66")===-1;}catch(_unused17){}}(),tt=function tt(yt){var wt;return f(yt)&&typeof(wt=yt.then)=="function"?wt:!1;},at=function at(yt,wt){if(!yt._n){yt._n=!0;var ht=yt._c;w(function(){for(var Nt=yt._v,Dt=yt._s==1,G=0,k=function k(rt){var nt=Dt?rt.ok:rt.fail,Y=rt.resolve,Z=rt.reject,C=rt.domain,L,z,K;try{nt?(Dt||(yt._h==2&&Q(yt),yt._h=1),nt===!0?L=Nt:(C&&C.enter(),L=nt(Nt),C&&(C.exit(),K=!0)),L===rt.promise?Z(p("Promise-chain cycle")):(z=tt(L))?z.call(L,Y,Z):Y(L)):Z(Nt);}catch(q){C&&!K&&C.exit(),Z(q);}};ht.length>G;)k(ht[G++]);yt._c=[],yt._n=!1,wt&&!yt._h&&ut(yt);});}},ut=function ut(yt){T.call(n,function(){var wt=yt._v,ht=V(yt),Nt,Dt,G;if(ht&&(Nt=S(function(){U?x.emit("unhandledRejection",wt,yt):(Dt=n.onunhandledrejection)?Dt({promise:yt,reason:wt}):(G=n.console)&&G.error&&G.error("Unhandled promise rejection",wt);}),yt._h=U||V(yt)?2:1),yt._a=void 0,ht&&Nt.e)throw Nt.v;});},V=function V(yt){return yt._h!==1&&(yt._a||yt._c).length===0;},Q=function Q(yt){T.call(n,function(){var wt;U?x.emit("rejectionHandled",yt):(wt=n.onrejectionhandled)&&wt({promise:yt,reason:yt._v});});},ft=function ft(yt){var wt=this;wt._d||(wt._d=!0,wt=wt._w||wt,wt._v=yt,wt._s=2,wt._a||(wt._a=wt._c.slice()),at(wt,!0));},_mt3=function mt(yt){var wt=this,ht;if(!wt._d){wt._d=!0,wt=wt._w||wt;try{if(wt===yt)throw p("Promise can't be resolved itself");(ht=tt(yt))?w(function(){var Nt={_w:wt,_d:!1};try{ht.call(yt,s(_mt3,Nt,1),s(ft,Nt,1));}catch(Dt){ft.call(Nt,Dt);}}):(wt._v=yt,wt._s=1,at(wt,!1));}catch(Nt){ft.call({_w:wt,_d:!1},Nt);}}};J||(_D=function D(wt){m(this,_D,v,"_h"),h(wt),W.call(this);try{wt(s(_mt3,this,1),s(ft,this,1));}catch(ht){ft.call(this,ht);}},W=function W(wt){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},W.prototype=t(146)(_D.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
|
|
272
|
+
then:function then(wt,ht){var Nt=$(y(this,_D));return Nt.ok=typeof wt=="function"?wt:!0,Nt.fail=typeof ht=="function"&&ht,Nt.domain=U?x.domain:void 0,this._c.push(Nt),this._a&&this._a.push(Nt),this._s&&at(this,!1),Nt.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
|
|
273
|
+
"catch":function _catch(yt){return this.then(void 0,yt);}}),B=function B(){var yt=new W();this.promise=yt,this.resolve=s(_mt3,yt,1),this.reject=s(ft,yt,1);},I.f=$=function $(yt){return yt===_D||yt===N?new B(yt):X(yt);}),l(l.G+l.W+l.F*!J,{Promise:_D}),t(121)(_D,v),t(149)(v),N=t(92)[v],l(l.S+l.F*!J,v,{// 25.4.4.5 Promise.reject(r)
|
|
274
|
+
reject:function reject(wt){var ht=$(this),Nt=ht.reject;return Nt(wt),ht.promise;}}),l(l.S+l.F*(r||!J),v,{// 25.4.4.6 Promise.resolve(x)
|
|
275
|
+
resolve:function resolve(wt){return d(r&&this===N?_D:this,wt);}}),l(l.S+l.F*!(J&&t(140)(function(yt){_D.all(yt)["catch"](M);})),v,{// 25.4.4.1 Promise.all(iterable)
|
|
276
|
+
all:function all(wt){var ht=this,Nt=$(ht),Dt=Nt.resolve,G=Nt.reject,k=S(function(){var rt=[],nt=0,Y=1;u(wt,!1,function(Z){var C=nt++,L=!1;rt.push(void 0),Y++,ht.resolve(Z).then(function(z){L||(L=!0,rt[C]=z,--Y||Dt(rt));},G);}),--Y||Dt(rt);});return k.e&&G(k.v),Nt.promise;},// 25.4.4.4 Promise.race(iterable)
|
|
277
|
+
race:function race(wt){var ht=this,Nt=$(ht),Dt=Nt.reject,G=S(function(){u(wt,!1,function(k){ht.resolve(k).then(Nt.resolve,Dt);});});return G.e&&Dt(G.v),Nt.promise;}});},/* 194 *//***/function(i,e,t){var r=t(97),n=t(94),s=t(122)("species");i.exports=function(c,l){var f=r(c).constructor,h;return f===void 0||(h=r(f)[s])==null?l:n(h);};},/* 195 *//***/function(i,e,t){var r=t(93),n=t(196),s=t(120),c=t(102),l=t(91),f=l.process,h=l.setImmediate,m=l.clearImmediate,u=l.MessageChannel,y=l.Dispatch,T=0,w={},I="onreadystatechange",S,O,d,v=function v(){var x=+this;if(w.hasOwnProperty(x)){var E=w[x];delete w[x],E();}},p=function p(x){v.call(x.data);};(!h||!m)&&(h=function h(E){for(var R=[],D=1;arguments.length>D;)R.push(arguments[D++]);return w[++T]=function(){n(typeof E=="function"?E:Function(E),R);},S(T),T;},m=function m(E){delete w[E];},t(86)(f)=="process"?S=function S(x){f.nextTick(r(v,x,1));}:y&&y.now?S=function S(x){y.now(r(v,x,1));}:u?(O=new u(),d=O.port2,O.port1.onmessage=p,S=r(d.postMessage,d,1)):l.addEventListener&&typeof postMessage=="function"&&!l.importScripts?(S=function S(x){l.postMessage(x+"","*");},l.addEventListener("message",p,!1)):I in c("script")?S=function S(x){s.appendChild(c("script"))[I]=function(){s.removeChild(this),v.call(x);};}:S=function S(x){setTimeout(r(v,x,1),0);}),i.exports={set:h,clear:m};},/* 196 *//***/function(i,e){i.exports=function(t,r,n){var s=n===void 0;switch(r.length){case 0:return s?t():t.call(n);case 1:return s?t(r[0]):t.call(n,r[0]);case 2:return s?t(r[0],r[1]):t.call(n,r[0],r[1]);case 3:return s?t(r[0],r[1],r[2]):t.call(n,r[0],r[1],r[2]);case 4:return s?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(i,e,t){var r=t(91),n=t(195).set,s=r.MutationObserver||r.WebKitMutationObserver,c=r.process,l=r.Promise,f=t(86)(c)=="process";i.exports=function(){var h,m,u,y=function y(){var S,O;for(f&&(S=c.domain)&&S.exit();h;){O=h.fn,h=h.next;try{O();}catch(d){throw h?u():m=void 0,d;}}m=void 0,S&&S.enter();};if(f)u=function u(){c.nextTick(y);};else if(s&&!(r.navigator&&r.navigator.standalone)){var T=!0,w=document.createTextNode("");new s(y).observe(w,{characterData:!0}),u=function u(){w.data=T=!T;};}else if(l&&l.resolve){var I=l.resolve(void 0);u=function u(){I.then(y);};}else u=function u(){n.call(r,y);};return function(S){var O={fn:S,next:void 0};m&&(m.next=O),h||(h=O,u()),m=O;};};},/* 198 *//***/function(i,e,t){var r=t(94);function n(s){var c,l;this.promise=new s(function(f,h){if(c!==void 0||l!==void 0)throw TypeError("Bad Promise constructor");c=f,l=h;}),this.resolve=r(c),this.reject=r(l);}i.exports.f=function(s){return new n(s);};},/* 199 *//***/function(i,e){i.exports=function(t){try{return{e:!1,v:t()};}catch(r){return{e:!0,v:r};}};},/* 200 *//***/function(i,e,t){var r=t(91),n=r.navigator;i.exports=n&&n.userAgent||"";},/* 201 *//***/function(i,e,t){var r=t(97),n=t(98),s=t(198);i.exports=function(c,l){if(r(c),n(l)&&l.constructor===c)return l;var f=s.f(c),h=f.resolve;return h(l),f.promise;};},/* 202 *//***/function(i,e,t){var r=t(90),n=t(92),s=t(91),c=t(194),l=t(201);r(r.P+r.R,"Promise",{"finally":function _finally(f){var h=c(this,n.Promise||s.Promise),m=typeof f=="function";return this.then(m?function(u){return l(h,f()).then(function(){return u;});}:f,m?function(u){return l(h,f()).then(function(){throw u;});}:f);}});},/* 203 *//***/function(i,e,t){var r=t(90),n=t(198),s=t(199);r(r.S,"Promise",{"try":function _try(c){var l=n.f(this),f=s(c);return(f.e?l.reject:l.resolve)(f.v),l.promise;}});},/* 204 *//***/function(i,e,t){i.exports={"default":t(205),__esModule:!0};},/* 205 *//***/function(i,e,t){t(206),i.exports=t(92).Object.keys;},/* 206 *//***/function(i,e,t){var r=t(124),n=t(110);t(207)("keys",function(){return function(c){return n(r(c));};});},/* 207 *//***/function(i,e,t){var r=t(90),n=t(92),s=t(101);i.exports=function(c,l){var f=(n.Object||{})[c]||Object[c],h={};h[c]=l(f),r(r.S+r.F*s(function(){f(1);}),"Object",h);};},/* 208 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=t(76),n=w(r),s=t(209),c=w(s),l=t(164),f=w(l),h=t(191),m=w(h);e.defer=I,e.periodicity=S,e.calculateFramesOffset=O,e.getProgress=d,e.getCurrentFrame=p;var u=t(188),y=t(187),T=w(y);function w(x){return x&&x.__esModule?x:{"default":x};}function I(){var x={};return x.promise=new m["default"](function(E,R){x.resolve=E,x.reject=R;}),x;}function S(x,E){var R=Math.floor(x/E),D=x-R*E;return D===0&&R>0&&(D=E,R--),[R,D];}function O(x){x=x.slice(0);var E=x[0],R=x[x.length-1];R.offset=R.offset||1,E.offset=E.offset||0;for(var D=0,U=-1,M=0;M<x.length;M++){var W=x[M];if(W.offset!=null){var X=M-U;if(X>1)for(var B=(W.offset-D)/X,N=0;N<X-1;N++)x[U+N+1].offset=D+B*(N+1);D=W.offset,U=M;}if(W.easing!=null&&(W.easing=(0,u.parseEasing)(W.easing)),M>0){var $=x[M].easing!=null;x[M]=(0,f["default"])({},x[M-1],x[M]),$||delete x[M].easing;}}return x;}function d(x,E,R){var D=x.currentTime,U=E.direction,M=E.duration,W=!1;if(U==="reverse")R=1-R,W=!0;else if(U==="alternate"||U==="alternate-reverse"){var X=Math.floor(D/M);R===1&&X--,X%2^U==="alternate-reverse"&&(R=1-R,W=!0);}return{p:R,inverted:W};}function v(x,E,R,D){var U={};return(0,c["default"])(E).forEach(function(M){var W=(0,n["default"])(M,2),X=W[0],B=W[1];if(X!=="offset"&&X!=="easing"){var N=R[X]||R["default"],$=N(x[X],B,D,x.offset,E.offset);$!=null&&(U[X]=$);}}),U;}function p(x,E,R,D){var U=x.easing,M=x.effect;M||(R=(0,f["default"])({},T["default"],R));var W={};D=U(D,E);for(var X=1;X<E.length;X++){var B=E[X],N=B.offset;if(N>=D||X===E.length-1){var $=E[X-1],J=$.offset,tt=$.easing,at=D;if(tt){var ut=N-J;at=tt((D-J)/ut)*ut+J;}M?W=M($,B,at,J,N):W=v($,B,R,at);break;}}return W;}},/* 209 *//***/function(i,e,t){i.exports={"default":t(210),__esModule:!0};},/* 210 *//***/function(i,e,t){t(211),i.exports=t(92).Object.entries;},/* 211 *//***/function(i,e,t){var r=t(90),n=t(212)(!0);r(r.S,"Object",{entries:function entries(c){return n(c);}});},/* 212 *//***/function(i,e,t){var r=t(100),n=t(110),s=t(84),c=t(169).f;i.exports=function(l){return function(f){for(var h=s(f),m=n(h),u=m.length,y=0,T=[],w;u>y;)w=m[y++],(!r||c.call(h,w))&&T.push(l?[w,h[w]]:h[w]);return T;};};},/* 213 *//***/function(i,e,t){t.r(e),t(1).glMatrix.setMatrixArrayType(Array);var r=/* @__PURE__ */new Map();function n(c){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];c=c.toLowerCase();var h=r.get(c);if(!h)throw new TypeError("Invalid node: ".concat(c));var m=new h(l);return f.forEach(function(u){m.appendChild(u);}),m;}var s={registerNode:function registerNode(c,l){var f=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(l=l.toLowerCase(),r.has(l))throw new TypeError("Cannot registerNode, ".concat(l," has been taken."));r.set(l,c),Object.defineProperties(c.prototype,{nodeType:{value:f},tagName:{value:l.toUpperCase()},nodeName:{value:l},ownerDocument:{value:s},namespaceURI:{value:"http://spritejs.com/".concat(l)}});},createElement:n,createElementNS:function createElementNS(c,l){return n(l);},isSpriteNode:function isSpriteNode(c){return r.has(c.toLowerCase());}};e["default"]=s;},/* 214 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;}),t(1).glMatrix.setMatrixArrayType(Array);var r=Symbol("type"),n=Symbol("bubbles"),s=Symbol("originalEvent"),c=Symbol("detail");var l=/*#__PURE__*/function(){function l(h){var _ref114=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref114$bubbles=_ref114.bubbles,m=_ref114$bubbles===void 0?null:_ref114$bubbles;_classCallCheck(this,l);if(typeof h=="string"?(this[r]=h,this[n]=!!m):(this[r]=h.type,this[s]=h,this[n]=m!=null?!!m:!!h.bubbles,h.detail&&(this[c]=h.detail)),!this[r])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(l,[{key:"setOriginalEvent",value:function setOriginalEvent(h){this[s]=h;}},{key:"originalEvent",get:function get(){return this[s];}},{key:"type",get:function get(){return this[r];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[c];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 *//***/function(i,e,t){t.r(e),t.d(e,"parseFilterString",function(){return n;}),t.d(e,"applyFilters",function(){return s;});var r=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(c){if(c=c.trim(),!c||c==="none")return null;var l=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,f=c.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),h=[];return f&&f.forEach(function(m){var u=m.match(l);if(!u)throw new TypeError("Invalid fitler string.");var _u3=_slicedToArray(u,3),y=_u3[1],T=_u3[2];y=y.toLowerCase(),T=T.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(w,I){var S;return y==="url"||y==="drop-shadow"&&I===3?S=w:S=Object(r.toNumber)(w),/%$/.test(w)&&(S/=100),S;}),h.push({type:y,args:T});}),h;}function s(c,l){c.clearFilter(),l&&l.forEach(function(_ref115){var f=_ref115.type,h=_ref115.args;var m=f;m==="drop-shadow"?m="dropShadow":m==="hue-rotate"&&(m="hueRotate"),c[m].apply(c,_toConsumableArray(h));});}},/* 216 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n,s){if(!s)return;var c=n.getListeners("beforerender"),l=n.getListeners("afterrender");c.length&&!s.beforeRender?s.beforeRender=function(f){n.dispatchEvent({type:"beforerender",detail:{context:f}});}:c.length||(s.beforeRender=null),l.length&&!s.afterRender?s.afterRender=function(f){n.dispatchEvent({type:"afterrender",detail:{context:f}});}:l.length||(s.afterRender=null);}},/* 217 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(12),n=t(218),s=t(70),c=t(213);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol("amount"),f=Symbol("meshCloud");var h=/*#__PURE__*/function(_s$default){function h(u){var _this15;var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,h);_this15=_callSuper(this,h),_this15.meshNode=u,u.connect(_assertThisInitialized(_this15)),_this15[l]=y,_this15[f]=null;return _this15;}_inherits(h,_s$default);return _createClass(h,[{key:"meshCloud",get:function get(){var u=this.meshNode,y=this[l];return!this[f]&&u.mesh&&(this[f]=new r.MeshCloud(u.mesh,y)),this[f];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[l];},set:function set(u){this[l]=u,this[f]&&(this[f].amount=u);}},{key:"brightness",value:function brightness(u,y){this.meshCloud&&(this.meshCloud.brightness(u,y),this.forceUpdate());}},{key:"contrast",value:function contrast(u,y){this.meshCloud&&(this.meshCloud.contrast(u,y),this.forceUpdate());}},{key:"delete",value:function _delete(u){this.meshCloud&&(this.meshCloud["delete"](u),this[l]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this16=this;var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_superPropGet(h,"draw",this,3)([u]),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var y=this.shaderAttrs;y&&Object.entries(y).forEach(function(_ref116){var _ref117=_slicedToArray(_ref116,2),w=_ref117[0],I=_ref117[1];_this16.meshCloud.mesh.setAttribute(w,I);});var T=this.uniforms;if(this.uniforms){var w={};Object.entries(T).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),I=_ref119[0],S=_ref119[1];typeof S=="function"&&(S=S(_this16,I)),w[I]=S;}),this.meshCloud.mesh.setUniforms(w);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),u.push(this.meshCloud);}return u;}},{key:"getTransform",value:function getTransform(u){if(this.meshCloud)return this.meshCloud.getTransform(u);}},{key:"grayscale",value:function grayscale(u,y){this.meshCloud&&(this.meshCloud.grayscale(u,y),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(u,y){this.meshCloud&&(this.meshCloud.hueRotate(u,y),this.forceUpdate());}},{key:"invert",value:function invert(u,y){this.meshCloud&&(this.meshCloud.invert(u,y),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(u,y){if(!this.meshCloud)return!1;var T=this.attributes.pointerEvents;if(T==="none"||T!=="all"&&!this.isVisible)return!1;var w="both";T==="visibleFill"&&(w="fill"),T==="visibleStroke"&&(w="stroke");for(var I=0;I<this[l];I++)if(!this.meshCloud.isPointCollision(I,[u,y],w))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(u,y){this.meshCloud&&(this.meshCloud.opacity(u,y),this.forceUpdate());}},{key:"rotate",value:function rotate(u,y){var _ref120=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref121=_slicedToArray(_ref120,2),T=_ref121[0],w=_ref121[1];var I=Math.PI*y/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,S=_this$meshNode$attrib.x,_O13=_this$meshNode$attrib.y;this.meshCloud.rotate(u,I,[T+S,w+_O13]),this.forceUpdate();}}},{key:"saturate",value:function saturate(u,y){this.meshCloud&&(this.meshCloud.saturate(u,y),this.forceUpdate());}},{key:"scale",value:function scale(u,_ref122){var _ref123=_slicedToArray(_ref122,2),y=_ref123[0],_ref123$=_ref123[1],T=_ref123$===void 0?y:_ref123$;var _ref124=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref125=_slicedToArray(_ref124,2),w=_ref125[0],I=_ref125[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,S=_this$meshNode$attrib2.x,_O14=_this$meshNode$attrib2.y,_d12=1e-5;Math.abs(y)<_d12&&(y=1/y>0?_d12:-_d12),Math.abs(T)<_d12&&(T=1/T>0?_d12:-_d12),this.meshCloud.scale(u,[y,T],[w+S,I+_O14]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(u,y){this.meshCloud&&(this.meshCloud.setColorTransform(u,y),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(u,y){this.meshCloud&&(Array.isArray(y)&&(y=_toConsumableArray(y),y[0]/=255,y[1]/=255,y[2]/=255),this.meshCloud.setFillColor(u,y),this.forceUpdate());}},{key:"sepia",value:function sepia(u,y){this.meshCloud&&(this.meshCloud.sepia(u,y),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref126){var u=_ref126.width,y=_ref126.height;_superPropGet(h,"setResolution",this,3)([{width:u,height:y}]),this.meshNode.setResolution({width:u,height:y});}},{key:"setStrokeColor",value:function setStrokeColor(u,y){this.meshCloud&&(Array.isArray(y)&&(y=_toConsumableArray(y),y[0]/=255,y[1]/=255,y[2]/=255),this.meshCloud.setStrokeColor(u,y),this.forceUpdate());}},{key:"setTransform",value:function setTransform(u,y){this.meshCloud&&(this.meshCloud.setTransform(u,y),this.forceUpdate());}},{key:"skew",value:function skew(u,_ref127){var _ref128=_slicedToArray(_ref127,2),y=_ref128[0],_ref128$=_ref128[1],T=_ref128$===void 0?y:_ref128$;var _ref129=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref130=_slicedToArray(_ref129,2),w=_ref130[0],I=_ref130[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,S=_this$meshNode$attrib3.x,_O15=_this$meshNode$attrib3.y;this.meshCloud.skew(u,[y,T],[w+S,I+_O15]),this.forceUpdate();}}},{key:"transform",value:function transform(u,y){this.meshCloud&&(this.meshCloud.transform(u,y),this.forceUpdate());}},{key:"transformColor",value:function transformColor(u,y){this.meshCloud&&(this.meshCloud.transformColor(u,y),this.forceUpdate());}},{key:"translate",value:function translate(u,_ref131){var _ref132=_slicedToArray(_ref131,2),y=_ref132[0],T=_ref132[1];this.meshCloud&&(this.meshCloud.translate(u,[y,T]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[f]&&(this[f].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(s["default"]);c["default"].registerNode(h,"cloud");},/* 218 *//***/function(i,e,t){t.r(e),t.d(e,"loadTexture",function(){return c;}),t.d(e,"applyTexture",function(){return l;}),t.d(e,"createTexture",function(){return h;}),t.d(e,"deleteTexture",function(){return m;}),t.d(e,"drawTexture",function(){return y;}),t.d(e,"loadFrames",function(){return T;});var r=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s={};function c(w,I){if(s[w])return s[w];var S=r.ENV.loadImage(w,{alias:I,useImageBitmap:!1});return S!==null&&S!==void 0?S:w;}function l(_x14,_x15,_x16){return _l2.apply(this,arguments);}function _l2(){_l2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(w,I,S){var O,_w$attributes,_d13,v,p,x;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:O=I;typeof I=="string"&&(O=c(I));_context8.t0=O&&typeof O.then=="function";if(!_context8.t0){_context8.next=7;break;}_context8.next=6;return O;case 6:O=_context8.sent;case 7:if(!(I===w.attributes.texture)){_context8.next=11;break;}O&&O.image&&(O.sourceRect&&(w.attributes.sourceRect=O.sourceRect),w.textureImageRotated=!!O.rotated,O=O.image);_w$attributes=w.attributes,_d13=_w$attributes.width,v=_w$attributes.height,p=_w$attributes.textureRect,x=w.textureImage;w.textureImage=O,S&&x!==O&&!p&&(_d13==null||v==null)&&w.updateContours(),w.forceUpdate();case 11:return _context8.abrupt("return",O);case 12:case"end":return _context8.stop();}},_callee8);}));return _l2.apply(this,arguments);}var f=Symbol("textureMap");function h(w,I){if(I[f]=I[f]||/* @__PURE__ */new Map(),I[f].has(w))return I[f].get(w);var S=I.createTexture(w);return!/^blob:/.test(w.src)&&typeof w.getContext!="function"&&I[f].set(w,S),S;}function m(w,I){if(I[f]&&I[f].has(w)){var S=I[f].get(w);return I.deleteTexture(S),I[f]["delete"](w),!0;}return!1;}var u=Symbol("textureContext");function y(w,I){var S=w.textureImage instanceof String?String(w.textureImage):w.textureImage,O=w.textureImageRotated,d=I.texture,v=w.renderer;if(S){var p=w.originalContentRect;var x=w.attributes.textureRect;var E=w.attributes.textureRepeat,R=w.attributes.sourceRect;if(!d||w[u]&&w[u]!==v||d.image!==S||d.options.repeat!==E||!Object(n.compareValue)(d.options.rect,x)||!Object(n.compareValue)(d.options.srcRect,R)){var D=h(S,v);x?(x[0]+=p[0],x[1]+=p[1]):x=p;var U=null;d&&!v[f].has(d.image)&&(!d.options||!d.options.hidden)&&(U=I.uniforms.u_texSampler),I.setTexture(D,{rect:x,repeat:E,srcRect:R,rotated:O}),U&&U["delete"]&&U["delete"](),w[u]=v;}}else if(d){var _p8=null;!v[f].has(d.image)&&(!d.options||!d.options.hidden)&&(_p8=I.uniforms.u_texSampler),I.setTexture(null),_p8&&_p8["delete"]&&_p8["delete"]();}}function T(_x17,_x18){return _T6.apply(this,arguments);}function _T6(){_T6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(w,I){var S,O;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.t0=typeof I=="string";if(!_context9.t0){_context9.next=7;break;}_context9.next=4;return fetch(I,{method:"GET",mode:"cors",cache:"default"});case 4:_context9.next=6;return _context9.sent.json();case 6:I=_context9.sent;case 7:_context9.next=9;return c(w);case 9:S=_context9.sent;O=I.frames;return _context9.abrupt("return",(Object.entries(O).forEach(function(_ref133){var _ref134=_slicedToArray(_ref133,2),d=_ref134[0],v=_ref134[1];var _v$frame=v.frame,p=_v$frame.x,x=_v$frame.y,E=_v$frame.w,R=_v$frame.h;var D=[p,x,E,R];var U=v.rotated;U&&(D=[D[0],D[1],D[3],D[2]]),s[d]={image:S,sourceRect:D,rotated:U};}),S));case 12:case"end":return _context9.stop();}},_callee9);}));return _T6.apply(this,arguments);}},/* 219 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return T;});var r=t(1),n=t(12),s=t(70),c=t(220),l=t(221),f=t(222),h=t(213),m=t(223);t(1).glMatrix.setMatrixArrayType(Array);function u(w,I,S){return I in w?Object.defineProperty(w,I,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[I]=S,w;}var y=Symbol("mesh");var T=/*#__PURE__*/function(_s$default2){function T(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,T);return _callSuper(this,T,[I]);}_inherits(T,_s$default2);return _createClass(T,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,I=_this$attributes2.paddingTop,S=_this$attributes2.paddingRight,O=_this$attributes2.paddingBottom,d=_this$attributes2.paddingLeft,v=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),p=_this$contentSize[0],x=_this$contentSize[1];return[d+p+S+v,I+x+O+v];}// content + padding
|
|
278
|
+
},{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,I=_this$attributes3.paddingTop,S=_this$attributes3.paddingRight,O=_this$attributes3.paddingBottom,d=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),v=_this$contentSize2[0],p=_this$contentSize2[1];return[d+v+S,I+p+O];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,I=_this$attributes4.width,S=_this$attributes4.height,O=_this$attributes4.boxSizing,d=_this$attributes4.paddingTop,v=_this$attributes4.paddingRight,p=_this$attributes4.paddingBottom,x=_this$attributes4.paddingLeft;if(I=I||0,S=S||0,O==="border-box"){var E=2*this.attributes.borderWidth;I-=E+v+x,S-=E+d+p,I=Math.max(0,I),S=Math.max(0,S);}return[I,S];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),I=_this$borderSize[0],S=_this$borderSize[1];return I>0&&S>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var I=this.clientBox;if(I){var _S6;var S=this[y];if(S)S.box!==I&&(S.contours=I.contours,S.box=I);else{S=new n.Mesh2D(I),S.box=I;var _d14=this.attributes.bgcolor;if(Object(l.setFillColor)(S,{color:_d14}),this.hasBorder){var _this$attributes5=this.attributes,p=_this$attributes5.borderColor,x=_this$attributes5.borderWidth,E=_this$attributes5.borderDash,R=_this$attributes5.borderDashOffset;Object(l.setStrokeColor)(S,{color:p,lineWidth:x,lineDash:E,lineDashOffset:R});}this[y]=S;var v=this.attributes.clipPath;v&&this[y].setClipPath(v);}var _O16=this.opacity;return S.getOpacity()!==_O16&&S.setOpacity(_O16),(_S6=S).setTransform.apply(_S6,_toConsumableArray(this.renderMatrix)),S;}return null;}// content + padding + border
|
|
279
|
+
},{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,I=_this$attributes6.paddingTop,S=_this$attributes6.paddingRight,O=_this$attributes6.paddingBottom,d=_this$attributes6.paddingLeft,v=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),p=_this$contentSize3[0],x=_this$contentSize3[1],E=2*v;return[d+p+S+E,I+x+O+E];}},{key:"originalClientRect",get:function get(){if(this.mesh){var I=this.mesh.boundingBox;return[I[0][0],I[0][1],I[1][0]-I[0][0],I[1][1]-I[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),I=_this$originalClientR[0],S=_this$originalClientR[1],O=_this$originalClientR[2],d=_this$originalClientR[3],v=this.attributes.padding;return[I+v[0],S+v[1],O-v[0]-v[2],d-v[1]-v[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var I=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(I=r.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,I));var S=null;if(this.mesh){S=_toConsumableArray(this.mesh.boundingBox);var _O17=this.attributes.borderWidth;_O17&&(S[0]=[S[0][0]-_O17,S[0][1]-_O17],S[1]=[S[1][0]+_O17,S[1][1]+_O17]);}return Object(m["default"])(S,I);}// 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(I,S,O){if(_superPropGet(T,"onPropertyChange",this,3)([I,S,O]),(I==="anchorX"||I==="anchorY"||I==="boxSizing"||I==="width"||I==="height"||I==="borderWidth"||I==="paddingLeft"||I==="paddingRight"||I==="paddingTop"||I==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(I))&&this.updateContours(),this[y]&&I==="clipPath"&&this[y].setClipPath(S),this[y]&&I==="bgcolor"&&Object(l.setFillColor)(this[y],{color:S}),this[y]&&(I==="borderColor"||I==="borderWidth"||I==="borderDash"||I==="borderDashOffset")){var _this$attributes7=this.attributes,_d15=_this$attributes7.borderColor,v=_this$attributes7.borderWidth,p=_this$attributes7.borderDash,x=_this$attributes7.borderDashOffset;Object(l.setStrokeColor)(this[y],{color:_d15,lineWidth:v,lineDash:v?p:0,lineDashOffset:x});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,I=_this$attributes8.anchorX,S=_this$attributes8.anchorY,O=_this$attributes8.borderWidth,d=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),v=_this$borderSize2[0],p=_this$borderSize2[1],x=this.offsetSize,E=0.5*O,R=-I*x[0]+E,D=-S*x[1]+E;this.clientBox=new n.Figure2D(),Object(f.createRadiusBox)(this.clientBox,[R,D,v,p],d);}}]);}(s["default"]);u(T,"Attr",c["default"]),h["default"].registerNode(T,"block");},/* 220 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return m;});var r=t(71),n=t(72),s=t(221);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_setAttributeDefault"),h=Symbol["for"]("spritejs_declareAlias");var m=/*#__PURE__*/function(_r$default){function m(y){var _this17;_classCallCheck(this,m);_this17=_callSuper(this,m,[y]),_this17[f]({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[h]("anchor","size","border","borderRadius","padding");return _this17;}_inherits(m,_r$default);return _createClass(m,[{key:"anchorX",get:function get(){return this[l]("anchorX");},set:function set(y){this[c]("anchorX",Object(n.toNumber)(y));}},{key:"anchorY",get:function get(){return this[l]("anchorY");},set:function set(y){this[c]("anchorY",Object(n.toNumber)(y));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y,y]),this.anchorX=y[0],this.anchorY=y[1];}},{key:"width",get:function get(){return this[l]("width");},set:function set(y){this[c]("width",Object(n.toNumber)(y));}},{key:"height",get:function get(){return this[l]("height");},set:function set(y){this[c]("height",Object(n.toNumber)(y));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y,y]),this.width=y[0],this.height=y[1];}},{key:"borderWidth",get:function get(){return this[l]("borderWidth");},set:function set(y){this[c]("borderWidth",Object(n.toNumber)(y));}},{key:"borderColor",get:function get(){return this[l]("borderColor");},set:function set(y){this[c]("borderColor",Object(s.parseColor)(y));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y]),this.borderWidth=y[0],y[1]!=null&&(this.borderColor=y[1]);}},{key:"borderDash",get:function get(){return this[l]("borderDash");},set:function set(y){y=Object(n.toArray)(y,!0),y!=null&&!Array.isArray(y)&&(y=[y]),this[c]("borderDash",y?y.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[l]("borderDashOffset");},set:function set(y){this[c]("borderDashOffset",Object(n.toNumber)(y));}},{key:"borderTopLeftRadius",get:function get(){return this[l]("borderTopLeftRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderTopLeftRadius",y.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[l]("borderTopRightRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderTopRightRadius",y.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[l]("borderBottomRightRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderBottomRightRadius",y.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[l]("borderBottomLeftRadius");},set:function set(y){y=Object(n.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this[c]("borderBottomLeftRadius",y.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(y){if(y=Object(n.toArray)(y),!Array.isArray(y))y=Array(8).fill(y);else if(y.length===2)y=[y[0],y[1],y[0],y[1],y[0],y[1],y[0],y[1]];else if(y.length===4)y=[y[0],y[1],y[2],y[3],y[0],y[1],y[2],y[3]];else if(y.length===6)y=[y[0],y[1],y[2],y[3],y[4],y[5],y[2],y[3]];else if(y.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[y[0],y[1]],this.borderTopRightRadius=[y[2],y[3]],this.borderBottomRightRadius=[y[4],y[5]],this.borderBottomLeftRadius=[y[6],y[7]];}},{key:"bgcolor",get:function get(){return this[l]("bgcolor");},set:function set(y){this[c]("bgcolor",Object(s.parseColor)(y));}},{key:"paddingTop",get:function get(){return this[l]("paddingTop");},set:function set(y){this[c]("paddingTop",Object(n.toNumber)(y));}},{key:"paddingRight",get:function get(){return this[l]("paddingRight");},set:function set(y){this[c]("paddingRight",Object(n.toNumber)(y));}},{key:"paddingBottom",get:function get(){return this[l]("paddingBottom");},set:function set(y){this[c]("paddingBottom",Object(n.toNumber)(y));}},{key:"paddingLeft",get:function get(){return this[l]("paddingLeft");},set:function set(y){this[c]("paddingLeft",Object(n.toNumber)(y));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)?y.length===2?y=[y[0],y[1],y[0],y[1]]:y.length===3&&(y=[y[0],y[1],y[2],y[1]]):y=[y,y,y,y],this.paddingTop=y[0],this.paddingRight=y[1],this.paddingBottom=y[2],this.paddingLeft=y[3];}},{key:"clipPath",get:function get(){return this[l]("clipPath");},set:function set(y){this[c]("clipPath",y);}},{key:"boxSizing",get:function get(){return this[l]("boxSizing");},set:function set(y){if(y!=null&&y!=="border-box"&&y!=="content-box")throw new TypeError("Invalid boxSizing type.");this[c]("boxSizing",y);}}]);}(r["default"]);},/* 221 *//***/function(i,e,t){t.r(e),t.d(e,"Gradient",function(){return s;}),t.d(e,"isTransparent",function(){return c;}),t.d(e,"parseColor",function(){return l;}),t.d(e,"setFillColor",function(){return h;}),t.d(e,"setStrokeColor",function(){return m;}),t.d(e,"Color",function(){return u;});var r=t(32),n=/* @__PURE__ */t.n(r);t(1).glMatrix.setMatrixArrayType(Array);var s=/*#__PURE__*/function(){function s(_ref135){var T=_ref135.vector,w=_ref135.colors;_classCallCheck(this,s);if(!Array.isArray(T)||T.length!==4&&T.length!==6&&T.length!==3)throw new TypeError("Invalid gradient");this.vector=T,this.colors=w.map(function(_ref136){var I=_ref136.offset,S=_ref136.color;return{offset:I,color:l(S)};});}return _createClass(s,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function c(y){return y instanceof s?!1:y==null?!0:n()(y)[3]===0;}function l(y){if(y==null||(y||(y="transparent"),y instanceof s))return y;var T=n()(y);if(!T||!T.length)throw new TypeError("Invalid color value.");return"rgba(".concat(T.join(),")");}function f(y,T,w){var I=y.boundingBox[0];if(w.vector){var S=w.vector,_O18=w.colors;S.length===4?(S=[S[0]+I[0],S[1]+I[1],S[2]+I[0],S[3]+I[1]],y.setLinearGradient({vector:S,colors:_O18,type:T})):S.length===3?(S=[S[0]+I[0],S[1]+I[1],S[2]],y.setCircularGradient({vector:S,colors:_O18,type:T})):(S=[S[0]+I[0],S[1]+I[1],S[2],S[3]+I[0],S[4]+I[1],S[5]],y.setRadialGradient({vector:S,colors:_O18,type:T}));}else y.gradient&&y.gradient[T]&&(delete y.gradient[T],delete y.uniforms.u_radialGradientVector);}function h(y,_ref137){var T=_ref137.color,_ref137$rule=_ref137.rule,w=_ref137$rule===void 0?"nonzero":_ref137$rule;return f(y,"fill",T),T.vector||y.setFill({color:T,rule:w}),y;}function m(y,_ref138){var T=_ref138.color,w=_ref138.lineWidth,I=_ref138.lineCap,S=_ref138.lineJoin,O=_ref138.lineDash,d=_ref138.lineDashOffset,v=_ref138.miterLimit,p=_ref138.roundSegments;f(y,"stroke",T),T.vector&&(T=[0,0,0,1]),y.setStroke({color:T,thickness:w,cap:I,join:S,miterLimit:v,lineDash:O,lineDashOffset:d,roundSegments:p});}var u=/*#__PURE__*/function(_Array){function u(){var _T7,_T8,_n2,_n3;var _this18;var T=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var w=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var I=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var S=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,u);return _possibleConstructorReturn(_this18,(Array.isArray(T)&&(_T7=T,_T8=_slicedToArray(_T7,4),T=_T8[0],w=_T8[1],I=_T8[2],S=_T8[3],_T7),typeof T=="string"&&(_n2=n()(T),_n3=_slicedToArray(_n2,4),T=_n3[0],w=_n3[1],I=_n3[2],S=_n3[3],T/=255,w/=255,I/=255),_this18=_callSuper(this,u,[T,w,I,S]),_assertThisInitialized(_this18)));}_inherits(u,_Array);return _createClass(u,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(T){this[0]=T/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(T){this[1]=T/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(T){this[2]=T/255;}},{key:"a",get:function get(){return this[3];},set:function set(T){this[3]=T;}},{key:"hex",get:function get(){var T="0".concat(this.r.toString(16)).slice(-2),w="0".concat(this.g.toString(16)).slice(-2),I="0".concat(this.b.toString(16)).slice(-2);var S;return this.a<1&&(S=Math.round(this[3]*255),S="0".concat(S.toString(16)).slice(-2)),"#".concat(T).concat(w).concat(I).concat(S||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(T){return typeof T=="string"&&(T=n()(T),T[0]/=255,T[1]/=255,T[2]/=255),this[0]=T[0],this[1]=T[1],this[2]=T[2],this[3]=T[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 *//***/function(i,e,t){t.r(e),t.d(e,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function r(s,c,l,f,h){var m=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var u=0.5522848,y=f/2*u,T=h/2*u,w=c+f,I=l+h,S=c+f/2,O=l+h/2;m==="leftTop"?(s.moveTo(c,O),s.bezierCurveTo(c,O-T,S-y,l,S,l)):m==="rightTop"?s.bezierCurveTo(S+y,l,w,O-T,w,O):m==="rightBottom"?s.bezierCurveTo(w,O+T,S+y,I,S,I):m==="leftBottom"&&s.bezierCurveTo(S-y,I,c,O+T,c,O);}function n(s,_ref139,m){var _ref140=_slicedToArray(_ref139,4),c=_ref140[0],l=_ref140[1],f=_ref140[2],h=_ref140[3];if(!m||Array.isArray(m)&&m.every(function(u){return u===0;}))s.beginPath(),s.rect(c,l,f,h);else{typeof m=="number"&&(m=Array(8).fill(m));var _m$map=m.map(function(v,p){return p%2?Math.min(v,h/2):Math.min(v,f/2);}),_m$map2=_slicedToArray(_m$map,8),u=_m$map2[0],y=_m$map2[1],T=_m$map2[2],w=_m$map2[3],I=_m$map2[4],S=_m$map2[5],_O19=_m$map2[6],_d16=_m$map2[7];s.beginPath(),s.moveTo(c,l+y),r(s,c,l,u*2,y*2,"leftTop"),s.lineTo(c+f-T,l),r(s,c+f-T*2,l,T*2,w*2,"rightTop"),s.lineTo(c+f,l+h-S),r(s,c+f-I*2,l+h-S*2,I*2,S*2,"rightBottom"),s.lineTo(c+_O19,l+h),r(s,c,l+h-_d16*2,_O19*2,_d16*2,"leftBottom"),s.closePath();}return s;}},/* 223 *//***/function(i,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),s=_r2$[0],c=_r2$[1],_r2$2=_slicedToArray(_r2[1],2),l=_r2$2[0],f=_r2$2[1],h=s*n[0]+c*n[2]+n[4],m=s*n[1]+c*n[3]+n[5],u=l*n[0]+c*n[2]+n[4],y=l*n[1]+c*n[3]+n[5],T=l*n[0]+f*n[2]+n[4],w=l*n[1]+f*n[3]+n[5],I=s*n[0]+f*n[2]+n[4],S=s*n[1]+f*n[3]+n[5],O=Math.min(h,u,T,I),d=Math.min(m,y,w,S),v=Math.max(h,u,T,I),p=Math.max(m,y,w,S);return{x:O,y:d,width:v-O,height:p-d,left:O,top:d,right:v,bottom:p};};},/* 224 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(218),n=t(219),s=t(225),c=t(213);t(1).glMatrix.setMatrixArrayType(Array);function l(m,u,y){return u in m?Object.defineProperty(m,u,{value:y,enumerable:!0,configurable:!0,writable:!0}):m[u]=y,m;}var f=Symbol("textureTask");var h=/*#__PURE__*/function(_n$default){function h(){var _this19;var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,h);typeof u=="string"&&(u={texture:u}),_this19=_callSuper(this,h,[u]);return _this19;}/* override */_inherits(h,_n$default);return _createClass(h,[{key:"contentSize",get:function get(){var _superPropGet2=_superPropGet(h,"contentSize",this,1),_superPropGet3=_slicedToArray(_superPropGet2,2),u=_superPropGet3[0],y=_superPropGet3[1];var _this$attributes9=this.attributes,T=_this$attributes9.width,w=_this$attributes9.height;if(T==null||w==null){var I=this.textureImage,S=this.attributes.textureRect,_O20=this.attributes.sourceRect;if(S)T==null&&(u=S[0]+S[2]),w==null&&(y=S[1]+S[3]);else if(_O20){var _d17=this.layer?this.layer.displayRatio:1;T==null&&(u=_O20[2]/_d17),w==null&&(y=_O20[3]/_d17);}else if(I){var _d18=this.layer?this.layer.displayRatio:1;T==null&&(u=I.width/_d18),w==null&&(y=I.height/_d18);}}return[u,y];}},{key:"textureImageReady",get:function get(){return this[f]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(h,"draw",this,3)([u]);var y=this.mesh;return y&&Object(r.drawTexture)(this,y),u;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(u,y,T){if(_superPropGet(h,"onPropertyChange",this,3)([u,y,T]),u==="texture"&&(this[f]=Object(r.applyTexture)(this,y,!0)),u==="textureRect"){var _this$attributes10=this.attributes,w=_this$attributes10.width,I=_this$attributes10.height;(w==null||I==null)&&this.updateContours();}}}]);}(n["default"]);l(h,"Attr",s["default"]),c["default"].registerNode(h,"sprite");},/* 225 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_getAttribute");var l=/*#__PURE__*/function(_r$default2){function l(h){var _this20;_classCallCheck(this,l);_this20=_callSuper(this,l,[h]),_this20[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this20;}_inherits(l,_r$default2);return _createClass(l,[{key:"texture",get:function get(){return this[c]("texture");},set:function set(h){this[s]("texture",h);}},{key:"textureRect",get:function get(){return this[c]("textureRect");},set:function set(h){this[s]("textureRect",h);}},{key:"sourceRect",get:function get(){return this[c]("sourceRect");},set:function set(h){this[s]("sourceRect",h);}},{key:"textureRepeat",get:function get(){return this[c]("textureRepeat");},set:function set(h){this[s]("textureRepeat",!!h);}}]);}(r["default"]);},/* 226 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return w;});var r=t(12),n=t(227),s=/* @__PURE__ */t.n(n),c=t(70),l=t(228),f=t(221),h=t(218),m=t(213),u=t(223);t(1).glMatrix.setMatrixArrayType(Array);function y(I,S,O){return S in I?Object.defineProperty(I,S,{value:O,enumerable:!0,configurable:!0,writable:!0}):I[S]=O,I;}var T=Symbol("mesh");var w=/*#__PURE__*/function(_c$default){function w(){var _this21;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,w);typeof S=="string"&&(S={d:S}),_this21=_callSuper(this,w,[S]),_this21.effects={d:function(_d19){function d(_x19,_x20,_x21,_x22,_x23){return _d19.apply(this,arguments);}d.toString=function(){return _d19.toString();};return d;}(function(O,d,v,p,x){var _s$a;var E=(v-p)/(x-p);if(E<=0)return O;if(E>=1)return d;var R=s.a._preprocessing(s.a.path2shapes(O),s.a.path2shapes(d)),D=(_s$a=s.a)._lerp.apply(_s$a,_toConsumableArray(R).concat([E]))[0];return D.reduce(function(M,W){return"".concat(M).concat(W.slice(2).join(" ")," ");},"M".concat(D[0][0]," ").concat(D[0][1],"C")).trim();})};return _this21;}/* override */_inherits(w,_c$default);return _createClass(w,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var S=this.path;if(S){var _O22;var _O21=this[T];if(_O21)_O21.path!==S&&(_O21.contours=S.contours,_O21.path=S);else{_O21=new r.Mesh2D(this.path),_O21.path=S;var v=this.attributes.fillColor,p=this.attributes.fillRule;v&&Object(f.setFillColor)(_O21,{color:v,rule:p});var x=this.attributes.lineWidth,E=this.attributes.strokeColor;if(E&&x>0){var _this$attributes11=this.attributes,D=_this$attributes11.lineCap,U=_this$attributes11.lineJoin,M=_this$attributes11.miterLimit,W=_this$attributes11.lineDash,X=_this$attributes11.lineDashOffset,B=_this$attributes11.roundSegments;Object(f.setStrokeColor)(_O21,{color:E,lineWidth:x,lineCap:D,lineJoin:U,miterLimit:M,lineDash:W,lineDashOffset:X,roundSegments:B});}this[T]=_O21;var R=this.attributes.clipPath;R&&this[T].setClipPath(R);}var _d20=this.opacity;return _O21.getOpacity()!==_d20&&_O21.setOpacity(_d20),(_O22=_O21).setTransform.apply(_O22,_toConsumableArray(this.renderMatrix)),_O21;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var S=this.path.boundingBox;return[S[0][0],S[0][1],S[1][0]-S[0][0],S[1][1]-S[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var S=this.mesh.boundingBox;return[S[0][0],S[0][1],S[1][0]-S[0][0],S[1][1]-S[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(S){this.attributes.d=S;}},{key:"draw",value:function draw(){var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_superPropGet(w,"draw",this,3)([S]);var O=this.mesh;return O&&Object(h.drawTexture)(this,O),S;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var S=null;return this.mesh&&(S=this.mesh.boundingBox),Object(u["default"])(S,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(S){if(this.mesh){var _O23=this.mesh.getPointAtLength(S);if(_O23)return[_O23.x,_O23.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(S,O,d){if(_superPropGet(w,"onPropertyChange",this,3)([S,O,d]),(S==="d"||S==="normalize")&&this.updateContours(),this[T]&&(S==="fillColor"||S==="fillRule")){var _this$attributes12=this.attributes,v=_this$attributes12.fillColor,p=_this$attributes12.fillRule;Object(f.setFillColor)(this[T],{color:v,rule:p});}if(this[T]&&(S==="strokeColor"||S==="lineWidth"||S==="lineCap"||S==="lineJoin"||S==="lineDash"||S==="lineDashOffset"||S==="roundSegments")){var _this$attributes13=this.attributes,_v4=_this$attributes13.strokeColor,_p9=_this$attributes13.lineWidth;if(_v4&&_p9>0){var _this$attributes14=this.attributes,x=_this$attributes14.lineCap,E=_this$attributes14.lineJoin,R=_this$attributes14.lineDash,D=_this$attributes14.lineDashOffset,U=_this$attributes14.miterLimit,M=_this$attributes14.roundSegments;Object(f.setStrokeColor)(this[T],{color:_v4,lineCap:x,lineJoin:E,lineWidth:_p9,lineDash:R,lineDashOffset:D,miterLimit:U,roundSegments:M});}}this[T]&&S==="clipPath"&&this[T].setClipPath(O),S==="texture"&&Object(h.applyTexture)(this,O);}/* 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));}}]);}(c["default"]);y(w,"Attr",l["default"]),m["default"].registerNode(w,"path");},/* 227 *//***/function(i,e,t){(function(r,n){i.exports=n();})(this,function(){var r=/* @__PURE__ */function(){function W(X,B){var N=[],$=!0,J=!1,tt=void 0;try{for(var at=X[Symbol.iterator](),ut;!($=(ut=at.next()).done)&&(N.push(ut.value),!(B&&N.length===B));$=!0);}catch(V){J=!0,tt=V;}finally{try{!$&&at["return"]&&at["return"]();}finally{if(J)throw tt;}}return N;}return function(X,B){if(Array.isArray(X))return X;if(Symbol.iterator in Object(X))return W(X,B);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,s=function s(X,B,N,$,J,tt,at){var ut=X.x,V=X.y;ut*=B,V*=N;var Q=$*ut-J*V,ft=J*ut+$*V;return{x:Q+tt,y:ft+at};},c=function c(X,B){var N=1.3333333333333333*Math.tan(B/4),$=Math.cos(X),J=Math.sin(X),tt=Math.cos(X+B),at=Math.sin(X+B);return[{x:$-J*N,y:J+$*N},{x:tt+at*N,y:at-tt*N},{x:tt,y:at}];},l=function l(X,B,N,$){var J=X*$-B*N<0?-1:1,tt=Math.sqrt(X*X+B*B),at=Math.sqrt(X*X+B*B),ut=X*N+B*$,V=ut/(tt*at);return V>1&&(V=1),V<-1&&(V=-1),J*Math.acos(V);},f=function f(X,B,N,$,J,tt,at,ut,V,Q,ft,mt){var yt=Math.pow(J,2),wt=Math.pow(tt,2),ht=Math.pow(ft,2),Nt=Math.pow(mt,2),Dt=yt*wt-yt*Nt-wt*ht;Dt<0&&(Dt=0),Dt/=yt*Nt+wt*ht,Dt=Math.sqrt(Dt)*(at===ut?-1:1);var G=Dt*J/tt*mt,k=Dt*-tt/J*ft,rt=Q*G-V*k+(X+N)/2,nt=V*G+Q*k+(B+$)/2,Y=(ft-G)/J,Z=(mt-k)/tt,C=(-ft-G)/J,L=(-mt-k)/tt,z=l(1,0,Y,Z),K=l(Y,Z,C,L);return ut===0&&K>0&&(K-=n),ut===1&&K<0&&(K+=n),[rt,nt,z,K];},h=function h(X){var B=X.px,N=X.py,$=X.cx,J=X.cy,tt=X.rx,at=X.ry,ut=X.xAxisRotation,V=ut===void 0?0:ut,Q=X.largeArcFlag,ft=Q===void 0?0:Q,mt=X.sweepFlag,yt=mt===void 0?0:mt,wt=[];if(tt===0||at===0)return[];var ht=Math.sin(V*n/360),Nt=Math.cos(V*n/360),Dt=Nt*(B-$)/2+ht*(N-J)/2,G=-ht*(B-$)/2+Nt*(N-J)/2;if(Dt===0&&G===0)return[];tt=Math.abs(tt),at=Math.abs(at);var k=Math.pow(Dt,2)/Math.pow(tt,2)+Math.pow(G,2)/Math.pow(at,2);k>1&&(tt*=Math.sqrt(k),at*=Math.sqrt(k));var rt=f(B,N,$,J,tt,at,ft,yt,ht,Nt,Dt,G),nt=r(rt,4),Y=nt[0],Z=nt[1],C=nt[2],L=nt[3],z=Math.max(Math.ceil(Math.abs(L)/(n/4)),1);L/=z;for(var K=0;K<z;K++)wt.push(c(C,L)),C+=L;return wt.map(function(q){var it=s(q[0],tt,at,Nt,ht,Y,Z),ct=it.x,xt=it.y,Ct=s(q[1],tt,at,Nt,ht,Y,Z),Mt=Ct.x,bt=Ct.y,At=s(q[2],tt,at,Nt,ht,Y,Z),Ot=At.x,Lt=At.y;return{x1:ct,y1:xt,x2:Mt,y2:bt,x:Ot,y:Lt};});},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
|
+
*/},u=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function y(W){var X=[];return W.replace(u,function(B,N,$){var J=N.toLowerCase();for($=w($),J=="m"&&$.length>2&&(X.push([N].concat($.splice(0,2))),J="l",N=N=="m"?"l":"L");;){if($.length==m[J])return $.unshift(N),X.push($);if($.length<m[J])throw new Error("malformed path data");X.push([N].concat($.splice(0,m[J])));}}),X;}var T=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function w(W){var X=W.match(T);return X?X.map(Number):[];}function I(W){var X=W[0][0],B=W[0][1],N=X,$=B;return W.forEach(function(J){var tt=J[0],at=J[2],ut=J[4],V=J[6],Q=J[1],ft=J[3],mt=J[5],yt=J[7];X=Math.min(X,tt,at,ut,V),B=Math.min(B,Q,ft,mt,yt),N=Math.max(N,tt,at,ut,V),$=Math.max($,Q,ft,mt,yt);}),[X,B,N,$];}function S(W,X){return Math.sqrt(Math.pow(W[0]-X[0],2)+Math.pow(W[1]-X[1],2))+Math.sqrt(Math.pow(W[2]-X[2],2)+Math.pow(W[3]-X[3],2));}function O(W,X){var B=W[0],N=W[2],$=W[4],J=W[6],tt=W[1],at=W[3],ut=W[5],V=W[7],Q=X[0],ft=X[2],mt=X[4],yt=X[6],wt=X[1],ht=X[3],Nt=X[5],Dt=X[7];return Math.sqrt(Math.pow(Q-B,2)+Math.pow(wt-tt,2))+Math.sqrt(Math.pow(ft-N,2)+Math.pow(ht-at,2))+Math.sqrt(Math.pow(mt-$,2)+Math.pow(Nt-ut,2))+Math.sqrt(Math.pow(yt-J,2)+Math.pow(Dt-V,2));}function d(W,X){var B=p(W.length),N=[];B.forEach(function(J){var tt=0,at=0;J.forEach(function(ut){tt+=O(W[ut],X[at++]);}),N.push({index:J,distance:tt});}),N.sort(function(J,tt){return J.distance-tt.distance;});var $=[];return N[0].index.forEach(function(J){$.push(W[J]);}),$;}function v(W,X){var B=x(W.length),N=[];B.forEach(function(J){var tt=0;J.forEach(function(at){tt+=S(I(W[at]),I(X[at]));}),N.push({index:J,distance:tt});}),N.sort(function(J,tt){return J.distance-tt.distance;});var $=[];return N[0].index.forEach(function(J){$.push(W[J]);}),$;}function p(W){for(var X=[],B=0;B<W;B++){for(var N=[],$=0;$<W;$++){var J=$+B;J>W-1&&(J-=W),N[J]=$;}X.push(N);}return X;}function x(W){for(var X=[],B=0;B<W;B++)X.push(B);return E(X);}function E(W){var X=[],B=[];function N($){var J,tt;for(J=0;J<$.length;J++)tt=$.splice(J,1)[0],B.push(tt),$.length==0&&X.push(B.slice()),N($),$.splice(J,0,tt),B.pop();return X;}return N(W);}var R={};R.parser=y,R.lerpCurve=function(W,X,B){return R.lerpPoints(W[0],W[1],X[0],X[1],B).concat(R.lerpPoints(W[2],W[3],X[2],X[3],B)).concat(R.lerpPoints(W[4],W[5],X[4],X[5],B)).concat(R.lerpPoints(W[6],W[7],X[6],X[7],B));},R.lerpPoints=function(W,X,B,N,$){return[W+(B-W)*$,X+(N-X)*$];},R.q2b=function(W,X,B,N,$,J){return[W,X,(W+2*B)/3,(X+2*N)/3,($+2*B)/3,(J+2*N)/3,$,J];},R.path2shapes=function(W){for(var X=R.parser(W),B=0,N=0,$=0,J=X.length,tt=[],at=null,ut=void 0,V=void 0,Q=void 0,ft=void 0,mt=void 0,yt=void 0,wt=void 0;$<J;$++){var ht=X[$],Nt=ht[0],Dt=X[$-1];switch(Nt){case"m":mt=tt.length,tt[mt]=[],at=tt[mt],B=B+ht[1],N=N+ht[2];break;case"M":mt=tt.length,tt[mt]=[],at=tt[mt],B=ht[1],N=ht[2];break;case"l":at.push([B,N,B,N,B,N,B+ht[1],N+ht[2]]),B+=ht[1],N+=ht[2];break;case"L":at.push([B,N,ht[1],ht[2],ht[1],ht[2],ht[1],ht[2]]),B=ht[1],N=ht[2];break;case"h":at.push([B,N,B,N,B,N,B+ht[1],N]),B+=ht[1];break;case"H":at.push([B,N,ht[1],N,ht[1],N,ht[1],N]),B=ht[1];break;case"v":at.push([B,N,B,N,B,N,B,N+ht[1]]),N+=ht[1];break;case"V":at.push([B,N,B,ht[1],B,ht[1],B,ht[1]]),N=ht[1];break;case"C":at.push([B,N,ht[1],ht[2],ht[3],ht[4],ht[5],ht[6]]),B=ht[5],N=ht[6];break;case"S":Dt[0]==="C"||Dt[0]==="c"?at.push([B,N,B+Dt[5]-Dt[3],N+Dt[6]-Dt[4],ht[1],ht[2],ht[3],ht[4]]):(Dt[0]==="S"||Dt[0]==="s")&&at.push([B,N,B+Dt[3]-Dt[1],N+Dt[4]-Dt[2],ht[1],ht[2],ht[3],ht[4]]),B=ht[3],N=ht[4];break;case"c":at.push([B,N,B+ht[1],N+ht[2],B+ht[3],N+ht[4],B+ht[5],N+ht[6]]),B=B+ht[5],N=N+ht[6];break;case"s":Dt[0]==="C"||Dt[0]==="c"?at.push([B,N,B+Dt[5]-Dt[3],N+Dt[6]-Dt[4],B+ht[1],N+ht[2],B+ht[3],N+ht[4]]):(Dt[0]==="S"||Dt[0]==="s")&&at.push([B,N,B+Dt[3]-Dt[1],N+Dt[4]-Dt[2],B+ht[1],N+ht[2],B+ht[3],N+ht[4]]),B=B+ht[3],N=N+ht[4];break;case"a":yt=h({rx:ht[1],ry:ht[2],px:B,py:N,xAxisRotation:ht[3],largeArcFlag:ht[4],sweepFlag:ht[5],cx:B+ht[6],cy:N+ht[7]}),wt=yt[yt.length-1],yt.forEach(function(G,k){k===0?at.push([B,N,G.x1,G.y1,G.x2,G.y2,G.x,G.y]):at.push([yt[k-1].x,yt[k-1].y,G.x1,G.y1,G.x2,G.y2,G.x,G.y]);}),B=wt.x,N=wt.y;break;case"A":yt=h({rx:ht[1],ry:ht[2],px:B,py:N,xAxisRotation:ht[3],largeArcFlag:ht[4],sweepFlag:ht[5],cx:ht[6],cy:ht[7]}),wt=yt[yt.length-1],yt.forEach(function(G,k){k===0?at.push([B,N,G.x1,G.y1,G.x2,G.y2,G.x,G.y]):at.push([yt[k-1].x,yt[k-1].y,G.x1,G.y1,G.x2,G.y2,G.x,G.y]);}),B=wt.x,N=wt.y;break;case"Q":at.push(R.q2b(B,N,ht[1],ht[2],ht[3],ht[4])),B=ht[3],N=ht[4];break;case"q":at.push(R.q2b(B,N,B+ht[1],N+ht[2],ht[3]+B,ht[4]+N)),B+=ht[3],N+=ht[4];break;case"T":Dt[0]==="Q"||Dt[0]==="q"?(Q=B+Dt[3]-Dt[1],ft=N+Dt[4]-Dt[2],at.push(R.q2b(B,N,Q,ft,ht[1],ht[2]))):(Dt[0]==="T"||Dt[0]==="t")&&(at.push(R.q2b(B,N,B+B-Q,N+N-ft,ht[1],ht[2])),Q=B+B-Q,ft=N+N-ft),B=ht[1],N=ht[2];break;case"t":Dt[0]==="Q"||Dt[0]==="q"?(Q=B+Dt[3]-Dt[1],ft=N+Dt[4]-Dt[2],at.push(R.q2b(B,N,Q,ft,B+ht[1],N+ht[2]))):(Dt[0]==="T"||Dt[0]==="t")&&(at.push(R.q2b(B,N,B+B-Q,N+N-ft,B+ht[1],N+ht[2])),Q=B+B-Q,ft=N+N-ft),B+=ht[1],N+=ht[2];break;case"Z":ut=at[0][0],V=at[0][1],at.push([B,N,ut,V,ut,V,ut,V]);break;case"z":ut=at[0][0],V=at[0][1],at.push([B,N,ut,V,ut,V,ut,V]);break;}}return tt;},R._upCurves=function(W,X){for(var B=0,N=0,$=W.length;B<X;B++)W.push(W[N].slice(0)),N++,N>$-1&&(N-=$);};function D(W,X,B,N,$,J,tt,at,ut){return{left:U(W,X,B,N,$,J,tt,at,ut),right:U(tt,at,$,J,B,N,W,X,1-ut,!0)};}function U(W,X,B,N,$,J,tt,at,ut,V){var Q=(B-W)*ut+W,ft=(N-X)*ut+X,mt=($-B)*ut+B,yt=(J-N)*ut+N,wt=(tt-$)*ut+$,ht=(at-J)*ut+J,Nt=(mt-Q)*ut+Q,Dt=(yt-ft)*ut+ft,G=(wt-mt)*ut+mt,k=(ht-yt)*ut+yt,rt=(G-Nt)*ut+Nt,nt=(k-Dt)*ut+Dt;return V?[rt,nt,Nt,Dt,Q,ft,W,X]:[W,X,Q,ft,Nt,Dt,rt,nt];}R._splitCurves=function(W,X){for(var B=0,N=0;B<X;B++){var $=W[N],J=D($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],0.5);W.splice(N,1),W.splice(N,0,J.left,J.right),N+=2,N>=W.length-1&&(N=0);}};function M(W,X){for(var B=function B(J){var tt=W[W.length-1],at=[];tt.forEach(function(ut){at.push(ut.slice(0));}),W.push(at);},N=0;N<X;N++)B();}return R.lerp=function(W,X,B){return R._lerp(R.path2shapes(W),R.path2shapes(X),B);},R.MIM_CURVES_COUNT=100,R._preprocessing=function(W,X){var B=W.length,N=X.length,$=JSON.parse(JSON.stringify(W)),J=JSON.parse(JSON.stringify(X));return B>N?M(J,B-N):B<N&&M($,N-B),$=v($,J),$.forEach(function(tt,at){var ut=tt.length,V=J[at].length;ut>V?ut<R.MIM_CURVES_COUNT?(R._splitCurves(tt,R.MIM_CURVES_COUNT-ut),R._splitCurves(J[at],R.MIM_CURVES_COUNT-V)):R._splitCurves(J[at],ut-V):ut<V&&(V<R.MIM_CURVES_COUNT?(R._splitCurves(tt,R.MIM_CURVES_COUNT-ut),R._splitCurves(J[at],R.MIM_CURVES_COUNT-V)):R._splitCurves(tt,V-ut));}),$.forEach(function(tt,at){$[at]=d(tt,J[at]);}),[$,J];},R._lerp=function(W,X,B){var N=[];return W.forEach(function($,J){var tt=[];$.forEach(function(at,ut){tt.push(R.lerpCurve(at,X[J][ut],B));}),N.push(tt);}),N;},R.animate=function(W){var X=R.path2shapes(W.from),B=R.path2shapes(W.to),N=R._preprocessing(X,B),$=/* @__PURE__ */new Date(),J=W.end||function(){},tt=W.progress||function(){},at=W.begin||function(){},ut=W.easing||function(yt){return yt;},V=null,Q=null,ft=W.time;at(X);var mt=function yt(){var wt=/* @__PURE__ */new Date()-$;if(wt>=ft){Q=B,tt(Q,1),J(Q),cancelAnimationFrame(V);return;}var ht=ut(wt/ft);Q=R._lerp(N[0],N[1],ht),tt(Q,ht),V=requestAnimationFrame(yt);};mt();},R;});},/* 228 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(71),n=t(221),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute");var h=/*#__PURE__*/function(_r$default3){function h(u){var _this22;_classCallCheck(this,h);_this22=_callSuper(this,h,[u]),_this22[c]({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(h,_r$default3);return _createClass(h,[{key:"d",get:function get(){return this[f]("d");},set:function set(u){this[l]("d",u);}},{key:"normalize",get:function get(){return this[f]("normalize");},set:function set(u){this[l]("normalize",!!u);}},{key:"fillColor",get:function get(){return this[f]("fillColor");},set:function set(u){this[l]("fillColor",Object(n.parseColor)(u));}},{key:"fillRule",get:function get(){return this[f]("fillRule");},set:function set(u){if(u!=null&&u!=="nonzero"&&u!=="evenodd")throw new TypeError("Invalid fill rule.");this[l]("fillRule",u);}},{key:"strokeColor",get:function get(){return this[f]("strokeColor");},set:function set(u){this[l]("strokeColor",Object(n.parseColor)(u));}},{key:"lineWidth",get:function get(){return this[f]("lineWidth");},set:function set(u){this[l]("lineWidth",Object(s.toNumber)(u));}},{key:"lineJoin",get:function get(){return this[f]("lineJoin");},set:function set(u){if(u!=null&&u!=="miter"&&u!=="bevel"&&u!=="round")throw new TypeError("Invalid lineJoin type.");this[l]("lineJoin",u);}},{key:"lineCap",get:function get(){return this[f]("lineCap");},set:function set(u){if(u!=null&&u!=="butt"&&u!=="square"&&u!=="round")throw new TypeError("Invalid lineCap type.");this[l]("lineCap",u);}},{key:"lineDash",get:function get(){return this[f]("lineDash");},set:function set(u){u=Object(s.toArray)(u,!0),u!=null&&!Array.isArray(u)&&(u=[u]),this[l]("lineDash",u?u.map(s.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[f]("lineDashOffset");},set:function set(u){this[l]("lineDashOffset",Object(s.toNumber)(u));}},{key:"miterLimit",get:function get(){return this[f]("miterLimit");},set:function set(u){this[l]("miterLimit",Object(s.toNumber)(u));}},{key:"roundSegments",get:function get(){return this[f]("roundSegments");},set:function set(u){this[l]("roundSegments",u);}},{key:"texture",get:function get(){return this[f]("texture");},set:function set(u){this[l]("texture",u);}},{key:"textureRect",get:function get(){return this[f]("textureRect");},set:function set(u){this[l]("textureRect",u);}},{key:"sourceRect",get:function get(){return this[f]("sourceRect");},set:function set(u){this[l]("sourceRect",u);}},{key:"textureRepeat",get:function get(){return this[f]("textureRepeat");},set:function set(u){this[l]("textureRepeat",!!u);}},{key:"clipPath",get:function get(){return this[f]("clipPath");},set:function set(u){this[l]("clipPath",u);}}]);}(r["default"]);},/* 229 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(230);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default4){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default4);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,h=_this$attributes15.width,m=_this$attributes15.height;return h>0&&m>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"rect");},/* 230 *//***/function(i,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 s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function h(u){var y=u.width,T=u.height;return"M0 0L".concat(y," 0L").concat(y," ").concat(T,"L0 ").concat(T,"Z");}var m=/*#__PURE__*/function(_r$default5){function m(y){var _this23;_classCallCheck(this,m);_this23=_callSuper(this,m,[y]),_this23[s]({width:0,height:0/* size */}),_this23[f]("size");return _this23;}// readonly
|
|
292
|
+
_inherits(m,_r$default5);return _createClass(m,[{key:"d",get:function get(){return this[l]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
293
|
+
},{key:"width",get:function get(){return this[l]("width");},set:function set(y){if(y=Object(n.toNumber)(y),this[c]("width",y)){var T=h(this);this[c]("d",T);}}},{key:"height",get:function get(){return this[l]("height");},set:function set(y){if(y=Object(n.toNumber)(y),this[c]("height",y)){var T=h(this);this[c]("d",T);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(y){y=Object(n.toArray)(y),Array.isArray(y)||(y=[y,y]),this.width=y[0],this.height=y[1];}}]);}(r["default"]);},/* 231 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(235);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default6){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default6);return _createClass(l,[{key:"isVisible",get:function get(){var h=this.attributes.sides;return h[0]>0&&h[1]>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"triangle");},/* 232 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(233);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default7){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default7);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var h=this.attributes.points;return h.length>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"polyline");},/* 233 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(228),n=t(72),s=t(234);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),h=Symbol["for"]("spritejs_declareAlias");function m(y){var T=y.points,w=y.smooth,I=y.smoothRange,S=y.close,O=[];for(var v=0;v<T.length;v+=2)O.push([T[v],T[v+1]]);var d="";return w?d=Object(s.makeSmoothCurveLine)(O,I):O.length&&(d="M".concat(O.map(function(v){return v.join(" ");}).join("L"))),d&&S&&(d+="Z"),d;}var u=/*#__PURE__*/function(_r$default8){function u(T){var _this24;_classCallCheck(this,u);_this24=_callSuper(this,u,[T]),_this24[c]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
|
|
294
|
+
/* close */}),_this24[h]("close");return _this24;}// readonly
|
|
295
|
+
_inherits(u,_r$default8);return _createClass(u,[{key:"d",get:function get(){return this[f]("d");},set:function set(T){}// eslint-disable-line no-empty-function
|
|
296
|
+
},{key:"close",get:function get(){return this.closeType!=="none";},set:function set(T){T=T?"normal":"none",this.closeType=T;}},{key:"closeType",get:function get(){return this[f]("closeType");},set:function set(T){if(T!=null&&T!=="none"&&T!=="normal")throw new TypeError("Invalid closeType type.");if(this[l]("closeType",T)){var w=m(this);this[l]("d",w);}}},{key:"smooth",get:function get(){return this[f]("smooth");},set:function set(T){if(this[l]("smooth",T)){var w=m(this);this[l]("d",w);}}},{key:"smoothRange",get:function get(){return this[f]("smoothRange");},set:function set(T){if(T&&!Array.isArray(T)&&(T=[T]),this[l]("smoothRange",T)&&this.smooth){var w=m(this);this[l]("d",w);}}},{key:"points",get:function get(){return this[f]("points");},set:function set(T){if(T=Object(n.toArray)(T),Array.isArray(T)&&(T=T.reduce(function(w,I){return Array.isArray(I)?[].concat(_toConsumableArray(w),_toConsumableArray(I.map(function(S){return Object(n.toNumber)(S);}))):[].concat(_toConsumableArray(w),[Object(n.toNumber)(I)]);},[])),this[l]("points",T)){var w=m(this);this[l]("d",w);}}}]);}(r["default"]);},/* 234 *//***/function(i,e,t){t.r(e),t.d(e,"makeSmoothCurveLine",function(){return r;}),t(1).glMatrix.setMatrixArrayType(Array);function r(n){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function c(h){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var u=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var y,T,w,I;if((n[h].x===n[h+1].x||n[h].y===n[h+1].y)&&(m=0,u=0),h<1?(y=n[0].x+(n[1].x-n[0].x)*m,T=n[0].y+(n[1].y-n[0].y)*m):(y=n[h].x+(n[h+1].x-n[h-1].x)*m,T=n[h].y+(n[h+1].y-n[h-1].y)*m),h>n.length-3){var S=n.length-1;w=n[S].x-(n[S].x-n[S-1].x)*u,I=n[S].y-(n[S].y-n[S-1].y)*u;}else w=n[h+1].x-(n[h+2].x-n[h].x)*u,I=n[h+1].y-(n[h+2].y-n[h].y)*u;return[{x:y,y:T},{x:w,y:I}];}n=n.map(function(_ref141){var _ref142=_slicedToArray(_ref141,2),h=_ref142[0],m=_ref142[1];return{x:h,y:m};});var l="",f=0;return n.forEach(function(h,m){if(m===0)l+="M".concat(h.x," ").concat(h.y);else{for(;m>s[f];)f++;if(f%2){var _c3=c(m-1),_c4=_slicedToArray(_c3,2),u=_c4[0],y=_c4[1];l+="C".concat([u.x,u.y,y.x,y.y,h.x,h.y].join(" "));}else l+="L".concat(h.x," ").concat(h.y);}}),l;}},/* 235 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(m){var _m$sides=_slicedToArray(m.sides,2),u=_m$sides[0],y=_m$sides[1];var T=m.angle%360;return T<0&&(T+=360),T=Math.PI*T/180,[0,0,u,0,y*Math.cos(T),y*Math.sin(T)];}var h=/*#__PURE__*/function(_r$default9){function h(u){var _this25;_classCallCheck(this,h);_this25=_callSuper(this,h,[u]),_this25[s]({sides:[0,0],angle:60,closeType:"normal"});return _this25;}// readonly
|
|
297
|
+
_inherits(h,_r$default9);return _createClass(h,[{key:"points",get:function get(){return _superPropGet(h,"points",this,1);},set:function set(u){}// eslint-disable-line no-empty-function
|
|
298
|
+
},{key:"sides",get:function get(){return this[l]("sides");},set:function set(u){if(u=Object(n.toArray)(u,!0),u!=null&&!Array.isArray(u)&&(u=[u,u]),this[c]("sides",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"angle",get:function get(){return this[l]("angle");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("angle",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}}]);}(r["default"]);},/* 236 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(237);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default10){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default10);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var h=this.attributes.sides;return h[0]>0&&h[1]>0&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"parallel");},/* 237 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(m){var _m$sides2=_slicedToArray(m.sides,2),u=_m$sides2[0],y=_m$sides2[1];var T=m.angle%360;T<0&&(T+=360),T=Math.PI*T/180;var w=y*Math.cos(T),I=y*Math.sin(T);return[0,0,u,0,w+u,I,w,I];}var h=/*#__PURE__*/function(_r$default11){function h(u){var _this26;_classCallCheck(this,h);_this26=_callSuper(this,h,[u]),_this26[s]({sides:[0,0],angle:90,closeType:"normal"});return _this26;}// readonly
|
|
299
|
+
_inherits(h,_r$default11);return _createClass(h,[{key:"points",get:function get(){return _superPropGet(h,"points",this,1);},set:function set(u){}// eslint-disable-line no-empty-function
|
|
300
|
+
},{key:"sides",get:function get(){return this[l]("sides");},set:function set(u){if(u=Object(n.toArray)(u,!0),u!=null&&!Array.isArray(u)&&(u=[u,u]),this[c]("sides",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"angle",get:function get(){return this[l]("angle");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("angle",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}}]);}(r["default"]);},/* 238 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(239);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default12){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default12);return _createClass(l);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"regular");},/* 239 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(m){var u=m.edges,y=m.radius,T=m.offsetAngle,w=Math.PI*T/180-0.5*Math.PI;if(u<3||y<=0)return[];var I=[];for(var S=0;S<u;S++){var _O24=S*2*Math.PI/u+w,_d21=y*Math.cos(_O24),v=y*Math.sin(_O24);I.push(_d21,v);}return I;}var h=/*#__PURE__*/function(_r$default13){function h(u){var _this27;_classCallCheck(this,h);_this27=_callSuper(this,h,[u]),_this27[s]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this27;}// readonly
|
|
301
|
+
_inherits(h,_r$default13);return _createClass(h,[{key:"points",get:function get(){return _superPropGet(h,"points",this,1);},set:function set(u){}// eslint-disable-line no-empty-function
|
|
302
|
+
},{key:"edges",get:function get(){return this[l]("edges");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("edges",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"radius",get:function get(){return this[l]("radius");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("radius",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"offsetAngle",get:function get(){return this[l]("offsetAngle");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("offsetAngle",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}}]);}(r["default"]);},/* 240 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(232),n=t(213),s=t(241);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default14){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default14);return _createClass(l);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"star");},/* 241 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return h;});var r=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),c=Symbol["for"]("spritejs_setAttribute"),l=Symbol["for"]("spritejs_getAttribute");function f(m){var u=m.angles,y=m.innerRadius,T=m.outerRadius,w=m.offsetAngle,I=Math.PI*w/180-0.5*Math.PI;if(u<3||y<=0||T<=0)return[];var S=[];for(var _O25=0;_O25<u*2;_O25++){var _d22=_O25*Math.PI/u+I,v=_O25%2?y:T,p=v*Math.cos(_d22),x=v*Math.sin(_d22);S.push(p,x);}return S;}var h=/*#__PURE__*/function(_r$default15){function h(u){var _this28;_classCallCheck(this,h);_this28=_callSuper(this,h,[u]),_this28[s]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this28;}// readonly
|
|
303
|
+
_inherits(h,_r$default15);return _createClass(h,[{key:"points",get:function get(){return _superPropGet(h,"points",this,1);},set:function set(u){}// eslint-disable-line no-empty-function
|
|
304
|
+
},{key:"angles",get:function get(){return this[l]("angles");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("angles",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"innerRadius",get:function get(){return this[l]("innerRadius");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("innerRadius",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"outerRadius",get:function get(){return this[l]("outerRadius");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("outerRadius",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(u){u=Object(n.toArray)(u,!0),Array.isArray(u)||(u=[u,u]),this.innerRadius=u[0],this.outerRadius=u[1];}},{key:"offsetAngle",get:function get(){return this[l]("offsetAngle");},set:function set(u){if(u=Object(n.toNumber)(u),this[c]("offsetAngle",u)){var y=f(this);_superPropSet(h,"points",y,this,1,1);}}}]);}(r["default"]);},/* 242 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(243);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default16){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default16);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,h=_this$attributes16.radiusX,m=_this$attributes16.radiusY,u=_this$attributes16.startAngle,y=_this$attributes16.endAngle;return h>0&&m>0&&u!==y&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"ellipse");},/* 243 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(12),n=t(228),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),h=Symbol["for"]("spritejs_declareAlias");function m(y){var T=y.radiusX,w=y.radiusY,I=y.startAngle,S=y.endAngle,O=y.direction,d=y.closeType,v=O==="anitclockwise",p=new r.Figure2D();return d==="sector"&&p.moveTo(0,0),p.ellipse(0,0,T,w,0,Math.PI*I/180,Math.PI*S/180,v),d!=="none"&&p.closePath(),p.path.reduce(function(R,D){return R+D.join(" ");},"");}var u=/*#__PURE__*/function(_n$default2){function u(T){var _this29;_classCallCheck(this,u);_this29=_callSuper(this,u,[T]),_this29[c]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
|
|
305
|
+
closeType:"none"// none | sector | normal
|
|
306
|
+
}),_this29[h]("radius","angle");return _this29;}// readonly
|
|
307
|
+
_inherits(u,_n$default2);return _createClass(u,[{key:"d",get:function get(){return this[f]("d");},set:function set(T){}// eslint-disable-line no-empty-function
|
|
308
|
+
},{key:"radiusX",get:function get(){return this[f]("radiusX");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("radiusX",T)){var w=m(this);this[l]("d",w);}}},{key:"radiusY",get:function get(){return this[f]("radiusY");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("radiusY",T)){var w=m(this);this[l]("d",w);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(T){T=Object(s.toArray)(T,!0),Array.isArray(T)||(T=[T,T]),this.radiusX=T[0],this.radiusY=T[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(T){T=Object(s.toArray)(T),Array.isArray(T)||(T=[T,T]),this.startAngle=T[0],this.endAngle=T[1];}},{key:"direction",get:function get(){return this[f]("direction");},set:function set(T){if(T!=null&&T!=="clockwise"&&T!=="anticlockwise")throw new TypeError("Invalid direction type.");this[l]("direction",T);}},{key:"startAngle",get:function get(){return this[f]("startAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("startAngle",T)){var w=m(this);this[l]("d",w);}}},{key:"endAngle",get:function get(){return this[f]("endAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("endAngle",T)){var w=m(this);this[l]("d",w);}}},{key:"closeType",get:function get(){return this[f]("closeType");},set:function set(T){if(T!=null&&T!=="none"&&T!=="sector"&&T!=="normal")throw new TypeError("Invalid closeType type.");if(this[l]("closeType",T)){var w=m(this);this[l]("d",w);}}}]);}(n["default"]);},/* 244 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(242),n=t(213),s=t(245);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default17){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default17);return _createClass(l);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"arc");},/* 245 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return s;});var r=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var s=/*#__PURE__*/function(_r$default18){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_r$default18);return _createClass(s,[{key:"radius",get:function get(){return _superPropGet(s,"radiusX",this,1);},set:function set(l){l=Object(n.toNumber)(l),_superPropSet(s,"radiusX",l,this,1,1),_superPropSet(s,"radiusY",l,this,1,1);}}]);}(r["default"]);},/* 246 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(226),n=t(213),s=t(247);t(1).glMatrix.setMatrixArrayType(Array);function c(f,h,m){return h in f?Object.defineProperty(f,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[h]=m,f;}var l=/*#__PURE__*/function(_r$default19){function l(){_classCallCheck(this,l);return _callSuper(this,l,arguments);}_inherits(l,_r$default19);return _createClass(l,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,h=_this$attributes17.innerRadius,m=_this$attributes17.outerRadius,u=_this$attributes17.startAngle,y=_this$attributes17.endAngle;return(h>0||m>0)&&u!==y&&_superPropGet(l,"isVisible",this,1);}}]);}(r["default"]);c(l,"Attr",s["default"]),n["default"].registerNode(l,"ring");},/* 247 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(12),n=t(228),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);var c=Symbol["for"]("spritejs_setAttributeDefault"),l=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),h=Symbol["for"]("spritejs_declareAlias");function m(y){var _ref143;var T=y.innerRadius,w=y.outerRadius,I=y.startAngle,S=y.endAngle;var O=new r.Figure2D();if(I=Math.PI*I/180,S=Math.PI*S/180,T>w&&(_ref143=[w,T],T=_ref143[0],w=_ref143[1],_ref143),T<=0&&O.moveTo(0,0),O.arc(0,0,w,I,S,!1),T>0){var p=Math.PI*2;S<I&&(S=I+p+(S-I)%p),S-I>=p&&(S=I+p-1e-6),O.arc(0,0,T,S,I,!0);}return O.closePath(),O.path.reduce(function(p,x){return p+x.join(" ");},"");}var u=/*#__PURE__*/function(_n$default3){function u(T){var _this30;_classCallCheck(this,u);_this30=_callSuper(this,u,[T]),_this30[c]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this30[h]("radius","angle");return _this30;}// readonly
|
|
309
|
+
_inherits(u,_n$default3);return _createClass(u,[{key:"d",get:function get(){return this[f]("d");},set:function set(T){}// eslint-disable-line no-empty-function
|
|
310
|
+
},{key:"innerRadius",get:function get(){return this[f]("innerRadius");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("innerRadius",T)){var w=m(this);this[l]("d",w);}}},{key:"outerRadius",get:function get(){return this[f]("outerRadius");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("outerRadius",T)){var w=m(this);this[l]("d",w);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(T){T=Object(s.toArray)(T,!0),Array.isArray(T)||(T=[T,T]),this.innerRadius=T[0],this.outerRadius=T[1];}},{key:"startAngle",get:function get(){return this[f]("startAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("startAngle",T)){var w=m(this);this[l]("d",w);}}},{key:"endAngle",get:function get(){return this[f]("endAngle");},set:function set(T){if(T=Object(s.toNumber)(T),this[l]("endAngle",T)){var w=m(this);this[l]("d",w);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(T){T=Object(s.toArray)(T),Array.isArray(T)||(T=[T,T]),this.startAngle=T[0],this.endAngle=T[1];}}]);}(n["default"]);},/* 248 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return w;});var r=t(12),n=t(218),s=t(219),c=t(249),l=t(213);t(1).glMatrix.setMatrixArrayType(Array);function f(I,S,O){return S in I?Object.defineProperty(I,S,{value:O,enumerable:!0,configurable:!0,writable:!0}):I[S]=O,I;}var h=Symbol("textImage"),m=Symbol("textImageTask"),u=Symbol("textureContext"),y=Symbol("updateTextureRect"),T=Symbol("textCanvas");var w=/*#__PURE__*/function(_s$default3){function w(){var _this31;var S=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,w);typeof S=="string"&&(S={text:S}),_this31=_callSuper(this,w,[S]);return _this31;}/* override */_inherits(w,_s$default3);return _createClass(w,[{key:"contentSize",get:function get(){var _superPropGet4=_superPropGet(w,"contentSize",this,1),_superPropGet5=_slicedToArray(_superPropGet4,2),S=_superPropGet5[0],O=_superPropGet5[1];var _this$attributes18=this.attributes,d=_this$attributes18.width,v=_this$attributes18.height;if(d==null||v==null){var p=this[h];p&&(d==null&&(S=p.rect[2]),v==null&&(O=p.rect[3]));}return[S,O];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(S){this.attributes.text=S;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(S){this.attributes.text=S;}},{key:"textImage",get:function get(){return this[h]||{};}},{key:"textImageReady",get:function get(){return this[m]||Promise.resolve();}/* override */},{key:"draw",value:function draw(S){_superPropGet(w,"draw",this,3)([S]);var O=this.mesh;if(O){var _d23=this[h];if(_d23){var v=O.texture;if(!v||this[u]&&this[u]!==this.renderer||_d23.needsUpdate?(_d23.needsUpdate=!1,Object(n.deleteTexture)(_d23.image,this.renderer),v=Object(n.createTexture)(_d23.image,this.renderer),this[y]=!0):v=O.uniforms.u_texSampler,this[y]){var _d23$rect$slice=_d23.rect.slice(2),_d23$rect$slice2=_slicedToArray(_d23$rect$slice,2),p=_d23$rect$slice2[0],x=_d23$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),E=_this$contentSize4[0],R=_this$contentSize4[1],D=this.attributes.textAlign,U=this.attributes.verticalAlign;var M=0;D==="center"?M=(E-p)/2:(D==="right"||D==="end")&&(M=E-p);var W=this.attributes.fontSize,X=this.attributes.lineHeight;var B=0;U==="top"?B=(W-X)/2:U==="bottom"&&(B=(X-W)/2);var _this$attributes19=this.attributes,N=_this$attributes19.paddingLeft,$=_this$attributes19.paddingTop,J=this.attributes.borderWidth;M+=N+J,B+=$+J;var _this$attributes20=this.attributes,tt=_this$attributes20.anchorX,at=_this$attributes20.anchorY;M-=this.offsetSize[0]*tt,B-=this.offsetSize[1]*at,O.setTexture(v,{rect:[M,B,p,x]}),this[y]=!1,this[u]=this.renderer;}}}return S;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(S,O,d){S==="text"||S==="fontSize"||S==="fontFamily"||S==="fontStyle"||S==="fontVariant"||S==="fontWeight"||S==="fontStretch"||S==="lineHeight"||S==="strokeColor"||S==="fillColor"||S==="strokeWidth"?this.updateText():((S==="textAlign"||S==="verticalAlign")&&(this[y]=!0),_superPropGet(w,"onPropertyChange",this,3)([S,O,d]));}/* override */},{key:"updateContours",value:function updateContours(){_superPropGet(w,"updateContours",this,3)([]),this[y]=!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,S=_this32$attributes.text,O=_this32$attributes.font,d=_this32$attributes.fillColor,v=_this32$attributes.strokeColor,p=_this32$attributes.strokeWidth,x=_this32.layer?_this32.layer.displayRatio:1;return _this32[T]=_this32[T]||r.ENV.createCanvas(1,1),_this32[h]=r.ENV.createText(S,{font:O,fillColor:d,strokeColor:v,strokeWidth:p,parseFont:r.parseFont,ratio:x,textCanvas:_this32[T]}),_this32[h].needsUpdate=!0,_this32.updateContours(),_this32.forceUpdate(),_this32[h];}));}}]);}(s["default"]);f(w,"Attr",c["default"]),l["default"].registerNode(w,"label");},/* 249 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return u;});var r=t(12),n=t(72),s=t(221),c=t(220);t(1).glMatrix.setMatrixArrayType(Array);var l=Symbol["for"]("spritejs_setAttributeDefault"),f=Symbol["for"]("spritejs_setAttribute"),h=Symbol["for"]("spritejs_getAttribute"),m=Symbol["for"]("spritejs_declareAlias");var u=/*#__PURE__*/function(_c$default2){function u(T){var _this33;_classCallCheck(this,u);_this33=_callSuper(this,u,[T]),_this33[l]({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(u,_c$default2);return _createClass(u,[{key:"text",get:function get(){return this[h]("text")||" ";},set:function set(T){this[f]("text",T);}},{key:"fontSize",get:function get(){return this[h]("fontSize");},set:function set(T){this[f]("fontSize",Object(n.toNumber)(T));}},{key:"fontFamily",get:function get(){return this[h]("fontFamily");},set:function set(T){this[f]("fontFamily",T);}},{key:"fontStyle",get:function get(){return this[h]("fontStyle");},set:function set(T){this[f]("fontStyle",T);}},{key:"fontVariant",get:function get(){return this[h]("fontVariant");},set:function set(T){this[f]("fontVariant",T);}},{key:"fontWeight",get:function get(){return this[h]("fontWeight");},set:function set(T){this[f]("fontWeight",T);}},{key:"fontStretch",get:function get(){return this[h]("fontStretch");},set:function set(T){this[f]("fontStretch",T);}},{key:"lineHeight",get:function get(){return this[h]("lineHeight")||this.fontSize;},set:function set(T){this[f]("lineHeight",Object(n.toNumber)(T));}},{key:"textAlign",get:function get(){return this[h]("textAlign");},set:function set(T){this[f]("textAlign",T);}},{key:"strokeColor",get:function get(){return this[h]("strokeColor");},set:function set(T){this[f]("strokeColor",Object(s.parseColor)(T));}},{key:"strokeWidth",get:function get(){return this[h]("strokeWidth");},set:function set(T){this[f]("strokeWidth",Object(n.toNumber)(T));}},{key:"verticalAlign",get:function get(){return this[h]("verticalAlign");},set:function set(T){this[f]("verticalAlign",T);}},{key:"fillColor",get:function get(){return this[h]("fillColor");},set:function set(T){this[f]("fillColor",Object(s.parseColor)(T));}},{key:"font",get:function get(){var T=this.fontStyle,w=this.fontVariant,I=this.fontWeight,S=this.fontStretch,O=this.fontSize,d=this.lineHeight,v=this.fontFamily;return"".concat(T," ").concat(w," ").concat(I," ").concat(S," ").concat(O,"px/").concat(d,"px ").concat(v);},set:function set(T){if(T==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var w=Object(r.parseFont)(T);this.fontStyle=w.style,this.fontVariant=w.variant,this.fontWeight=w.weight,this.fontStretch=w.stretch,this.fontSize=Object(n.toNumber)("".concat(w.size).concat(w.unit)),w.lineHeight&&(this.lineHeight=w.pxLineHeight),this.fontFamily=w.family;}}}]);}(c["default"]);},/* 250 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return T;});var r=t(12),n=t(219),s=t(251),c=t(213),l=t(252);t(1).glMatrix.setMatrixArrayType(Array);function f(w,I,S){return I in w?Object.defineProperty(w,I,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[I]=S,w;}var h=Symbol("zOrder"),m=Symbol("ordered"),u=Symbol("children"),y=Symbol("sealed");var T=/*#__PURE__*/function(_n$default4){function T(){var _this34;var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,T);_this34=_callSuper(this,T,[I]),_this34[u]=[],_this34[m]=null,_this34[h]=0;return _this34;}_inherits(T,_n$default4);return _createClass(T,[{key:"childNodes",get:function get(){return this[u];}},{key:"children",get:function get(){return this[u];}},{key:"orderedChildren",get:function get(){return this[m]||(this[m]=_toConsumableArray(this[u]),this[m].sort(function(I,S){return I.zIndex-S.zIndex||I.zOrder-S.zOrder;})),this[m];}},{key:"append",value:function append(){var _this35=this;for(var _len12=arguments.length,I=new Array(_len12),_key12=0;_key12<_len12;_key12++){I[_key12]=arguments[_key12];}return I.map(function(S){return _this35.appendChild(S);});}},{key:"appendChild",value:function appendChild(I){return I.remove(),this[u].push(I),I.connect(this,this[h]++),this[m]&&(this[m].length&&I.zIndex<this[m][this[m].length-1].zIndex?this.reorder():this[m].push(I)),I;}/* override */// get isVisible() {
|
|
311
|
+
// return this.attributes.opacity > 0 && this[_children].length > 0;
|
|
312
|
+
// }
|
|
313
|
+
/* override */},{key:"cloneNode",value:function cloneNode(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var S=_superPropGet(T,"cloneNode",this,3)([]);return I&&this[u].forEach(function(O){var d=O.cloneNode(I);S.appendChild(d);}),S;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(I){var S=this.orderedChildren;for(var _O26=S.length-1;_O26>=0;_O26--)if(S[_O26].dispatchPointerEvent(I))return!0;return _superPropGet(T,"dispatchPointerEvent",this,3)([I]);}/* override */},{key:"draw",value:function draw(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_superPropGet(T,"draw",this,3)([I]),!this[y]&&this.attributes.display!=="none"){var S=this.orderedChildren;for(var _O27=0;_O27<S.length;_O27++)S[_O27].draw(I);}return this.__cacheRenderMatrix=null,I;}},{key:"getElementById",value:function getElementById(I){return Object(l.querySelector)("#".concat(I),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(I){return Object(l.querySelectorAll)(".".concat(I),this);}},{key:"getElementsByName",value:function getElementsByName(I){return Object(l.querySelectorAll)("[name=\"".concat(I,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(I){return Object(l.querySelectorAll)(I,this);}},{key:"insertBefore",value:function insertBefore(I,S){if(S==null)return this.appendChild(I);I.remove();var O=this[u].indexOf(S);if(O<0)throw new Error("Invalid reference node.");var d=S.zOrder;for(var v=O;v<this[u].length;v++){var p=this[u][v].zOrder,x=this[u][v];delete x.zOrder,Object.defineProperty(x,"zOrder",{value:p+1,writable:!1,configurable:!0});}if(this[u].splice(O,0,I),I.connect(this,d),this[m])if(I.zIndex!==S.zIndex)this.reorder();else{var _v5=this[m].indexOf(S);this[m].splice(_v5,0,I);}return I;}},{key:"querySelector",value:function querySelector(I){return Object(l.querySelector)(I,this);}},{key:"querySelectorAll",value:function querySelectorAll(I){return Object(l.querySelectorAll)(I,this);}},{key:"replaceChild",value:function replaceChild(I,S){I.remove();var O=this[u].indexOf(S);if(O<0)throw new Error("Invalid reference node.");if(this[u][O]=I,I.connect(this,S.zOrder),this[m])if(I.zIndex!==S.zIndex)this.reorder();else{var _d24=this[m].indexOf(S);this[m][_d24]=I;}return S.disconnect(this),I;}},{key:"removeAllChildren",value:function removeAllChildren(){var I=this[u];for(var S=I.length-1;S>=0;S--)I[S].remove();}},{key:"removeChild",value:function removeChild(I){var S=this[u].indexOf(I);if(S>=0){if(this[u].splice(S,1),this[m]){var _O28=this[m].indexOf(I);this[m].splice(_O28,1);}return I.disconnect(this),I;}return null;}},{key:"reorder",value:function reorder(){this[m]=null;}},{key:"seal",value:function seal(){function I(v,p){var x=[];for(var E=0;E<v.length;E++){var R=_toConsumableArray(v[E]);for(var D=1;D<R.length;D+=2){var U=R[D],M=R[D+1];R[D]=U*p[0]+M*p[2]+p[4],R[D+1]=U*p[1]+M*p[3]+p[5];}x.push(R);}return x;}var S=this.orderedChildren,O=new r.Figure2D(),d=this.localMatrix;for(var v=0;v<S.length;v++){var p=S[v];if(p instanceof T&&(p=p.seal()),p.clientBox){var x=p.clientBox.contours.path;x=I(x,p.localMatrix),O.addPath(x);}if(p.path){var _x24=p.path.contours.path;_x24=I(_x24,p.localMatrix),O.addPath(_x24);}}return this[y]=!0,this.clientBox=O,{clientBox:O,localMatrix:d};}/* override */},{key:"setResolution",value:function setResolution(_ref144){var I=_ref144.width,S=_ref144.height;_superPropGet(T,"setResolution",this,3)([{width:I,height:S}]),this[u].forEach(function(O){O.setResolution({width:I,height:S});});}/* override */},{key:"updateContours",value:function updateContours(){this[y]||_superPropGet(T,"updateContours",this,3)([]);}}]);}(n["default"]);f(T,"Attr",s["default"]),c["default"].registerNode(T,"group");},/* 251 *//***/function(i,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(i,e,t){t.r(e),t.d(e,"querySelectorAll",function(){return y;}),t.d(e,"querySelector",function(){return T;}),t.d(e,"isMatched",function(){return w;}),t.d(e,"compile",function(){return I;});var r=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var s=t(253);function c(S){return S.nodeType===1||n["default"].isSpriteNode(S.nodeName);}function l(S){return Array.from(S.childNodes||[]);}function f(S){return n["default"].isSpriteNode(S.nodeName)?S.parent||S.canvas||S.container:S.parentElement;}function h(S){var O=S.length,d,v,p;for(;--O>-1;){for(d=v=S[O],S[O]=null,p=!0;v;){if(S.indexOf(v)>-1){p=!1,S.splice(O,1);break;}v=f(v);}p&&(S[O]=d);}return S;}var m={isTag:c,existsOne:function existsOne(S,O){return O.some(function(d){return c(d)?S(d)||m.existsOne(S,l(d)):!1;});},getSiblings:function getSiblings(S){var O=f(S);return O&&l(O);},getChildren:l,getParent:f,getAttributeValue:function getAttributeValue(S,O){if(S.nodeType===1&&O==="class"||O==="id")return S[O];if(this.hasAttrib(S,O)){var _d25=S.attributes[O];return Array.isArray(_d25)&&(_d25="[".concat(_d25.join(),"]")),String(_d25);}},hasAttrib:function hasAttrib(S,O){return S.attributes[O]!=null;},removeSubsets:h,getName:function getName(S){return S.tagName?S.tagName.toLowerCase():null;},findOne:function S(O,d){var v=null;for(var p=0,x=d.length;p<x&&!v;p++)if(O(d[p]))v=d[p];else{var E=l(d[p]);E&&E.length>0&&(v=S(O,E));}return v;},findAll:function S(O,d){var v=[];for(var p=0,x=d.length;p<x;p++){if(!c(d[p]))continue;O(d[p])&&v.push(d[p]);var E=l(d[p]);E&&(v=v.concat(S(O,E)));}return v;},getText:function S(O){return Array.isArray(O)?O.map(S).join(""):c(O)?S(l(O)):O.nodeType===3?O.nodeValue:n["default"].isSpriteNode(O.nodeName)?O.text:"";}};function u(S){if(typeof S!="string")return S;var O=S.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return O&&(O=O.map(function(d){var v=d.slice(1,-1).split("="),p=Object(r.parseColor)(v[1].replace(/['"]/g,""));return[d,"[".concat(v[0],"=\"").concat(p,"\"]")];}),O.forEach(function(_ref145){var _ref146=_slicedToArray(_ref145,2),d=_ref146[0],v=_ref146[1];S=S.replace(d,v);})),O=S.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),O&&(O=O.map(function(d){var v=d.slice(1,-1).split("="),p=v[1].slice(2,-2).split(/,/g).map(function(x){return x.trim();});return[d,"[".concat(v[0],"=\"[").concat(p,"]\"]")];}),O.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),d=_ref148[0],v=_ref148[1];S=S.replace(d,v);})),S;}function y(S,O){return s.selectAll(u(S),O,{adapter:m});}function T(S,O){return s.selectOne(u(S),O,{adapter:m});}function w(S,O){return s.is(S,u(O),{adapter:m});}function I(S){return s.compile(u(S),{adapter:m});}},/* 253 *//***/function(i,e,t){i.exports=I;var r=t(254),n=t(273).falseFunc,s=t(274);function c(S){return function(d,v,p){return v=v||{},v.adapter=v.adapter||r,S(d,v,p);};}var l=c(s),f=c(s.compileUnsafe);function h(S){return function(d,v,p){return p=p||{},p.adapter=p.adapter||r,typeof d!="function"&&(d=f(d,p,v)),d.shouldTestNextSiblings&&(v=u(p&&p.context||v,p.adapter)),Array.isArray(v)?v=p.adapter.removeSubsets(v):v=p.adapter.getChildren(v),S(d,v,p);};}function m(S,O){var d=O.getSiblings(S);if(!Array.isArray(d))return[];for(d=d.slice(0);d.shift()!==S;);return d;}function u(S,O){Array.isArray(S)||(S=[S]);for(var d=S.slice(0),v=0,p=S.length;v<p;v++){var x=m(d[v],O);d.push.apply(d,x);}return d;}var y=h(function(O,d,v){return O===n||!d||d.length===0?[]:v.adapter.findAll(O,d);}),T=h(function(O,d,v){return O===n||!d||d.length===0?null:v.adapter.findOne(O,d);});function w(S,O,d){return d=d||{},d.adapter=d.adapter||r,(typeof O=="function"?O:l(O,d))(S);}function I(S,O,d){return y(S,O,d);}I.compile=l,I.filters=s.Pseudos.filters,I.pseudos=s.Pseudos.pseudos,I.selectAll=y,I.selectOne=T,I.is=w,I.parse=l,I.iterate=y,I._compileUnsafe=f,I._compileToken=s.compileToken;},/* 254 *//***/function(i,e,t){var r=i.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(s){r[s]=n[s].bind(r);});});},/* 255 *//***/function(i,e,t){var r=t(256),n=t(257),s=r.isTag;i.exports={getInnerHTML:c,getOuterHTML:n,getText:l};function c(f,h){return f.children?f.children.map(function(m){return n(m,h);}).join(""):"";}function l(f){return Array.isArray(f)?f.map(l).join(""):s(f)?f.name==="br"?"\n":l(f.children):f.type===r.CDATA?l(f.children):f.type===r.Text?f.data:"";}},/* 256 *//***/function(i,e){i.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(i,e,t){var r=t(258),n=t(259),s=t(267);s.elementNames.__proto__=null,s.attributeNames.__proto__=null;var c={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function l(S,O){if(S){var d="",v;for(var p in S)v=S[p],d&&(d+=" "),O.xmlMode==="foreign"&&(p=s.attributeNames[p]||p),d+=p,(v!==null&&v!==""||O.xmlMode)&&(d+='="'+(O.decodeEntities?n.encodeXML(v):v.replace(/\"/g,"""))+'"');return d;}}var f={__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},h=i.exports=function(S,O){!Array.isArray(S)&&!S.cheerio&&(S=[S]),O=O||{};for(var d="",v=0;v<S.length;v++){var p=S[v];p.type==="root"?d+=h(p.children,O):r.isTag(p)?d+=u(p,O):p.type===r.Directive?d+=y(p):p.type===r.Comment?d+=I(p):p.type===r.CDATA?d+=w(p):d+=T(p,O);}return d;},m=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function u(S,O){O.xmlMode==="foreign"&&(S.name=s.elementNames[S.name]||S.name,S.parent&&m.indexOf(S.parent.name)>=0&&(O=Object.assign({},O,{xmlMode:!1}))),!O.xmlMode&&["svg","math"].indexOf(S.name)>=0&&(O=Object.assign({},O,{xmlMode:"foreign"}));var d="<"+S.name,v=l(S.attribs,O);return v&&(d+=" "+v),O.xmlMode&&(!S.children||S.children.length===0)?d+="/>":(d+=">",S.children&&(d+=h(S.children,O)),(!f[S.name]||O.xmlMode)&&(d+="</"+S.name+">")),d;}function y(S){return"<"+S.data+">";}function T(S,O){var d=S.data||"";return O.decodeEntities&&!(S.parent&&S.parent.name in c)&&(d=n.encodeXML(d)),d;}function w(S){return"<![CDATA["+S.children[0].data+"]]>";}function I(S){return"<!--"+S.data+"-->";}},/* 258 *//***/function(i,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(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.encode=e.decodeStrict=e.decode=void 0;var r=t(260),n=t(266);function s(m,u){return(!u||u<=0?r.decodeXML:r.decodeHTML)(m);}e.decode=s;function c(m,u){return(!u||u<=0?r.decodeXML:r.decodeHTMLStrict)(m);}e.decodeStrict=c;function l(m,u){return(!u||u<=0?n.encodeXML:n.encodeHTML)(m);}e.encode=l;var f=t(266);Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function get(){return f.encodeXML;}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function get(){return f.encodeHTML;}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function get(){return f.escape;}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function get(){return f.encodeHTML;}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function get(){return f.encodeHTML;}});var h=t(260);Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function get(){return h.decodeXML;}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function get(){return h.decodeHTML;}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function get(){return h.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function get(){return h.decodeHTML;}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function get(){return h.decodeHTML;}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function get(){return h.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function get(){return h.decodeHTMLStrict;}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function get(){return h.decodeXML;}});},/* 260 *//***/function(i,e,t){var r=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{"default":u};};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHTML=e.decodeHTMLStrict=e.decodeXML=void 0;var n=r(t(261)),s=r(t(262)),c=r(t(263)),l=r(t(264));e.decodeXML=f(c["default"]),e.decodeHTMLStrict=f(n["default"]);function f(u){var y=Object.keys(u).join("|"),T=m(u);y+="|#[xX][\\da-fA-F]+|#\\d+";var w=new RegExp("&(?:"+y+");","g");return function(I){return String(I).replace(w,T);};}var h=function h(u,y){return u<y?1:-1;};e.decodeHTML=function(){for(var u=Object.keys(s["default"]).sort(h),y=Object.keys(n["default"]).sort(h),T=0,w=0;T<y.length;T++)u[w]===y[T]?(y[T]+=";?",w++):y[T]+=";";var I=new RegExp("&(?:"+y.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),S=m(n["default"]);function O(d){return d.substr(-1)!==";"&&(d+=";"),S(d);}return function(d){return String(d).replace(I,O);};}();function m(u){return function(T){if(T.charAt(1)==="#"){var w=T.charAt(2);return w==="X"||w==="x"?l["default"](parseInt(T.substr(3),16)):l["default"](parseInt(T.substr(2),10));}return u[T.slice(1,-1)];};}},/* 261 *//***/function(i){i.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(i){i.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(i){i.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 *//***/function(i,e,t){var r=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{"default":c};};Object.defineProperty(e,"__esModule",{value:!0});var n=r(t(265));function s(c){if(c>=55296&&c<=57343||c>1114111)return"�";c in n["default"]&&(c=n["default"][c]);var l="";return c>65535&&(c-=65536,l+=String.fromCharCode(c>>>10&1023|55296),c=56320|c&1023),l+=String.fromCharCode(c),l;}e["default"]=s;},/* 265 *//***/function(i){i.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(i,e,t){var r=this&&this.__importDefault||function(O){return O&&O.__esModule?O:{"default":O};};Object.defineProperty(e,"__esModule",{value:!0}),e.escape=e.encodeHTML=e.encodeXML=void 0;var n=r(t(263)),s=m(n["default"]),c=u(s);e.encodeXML=w(s,c);var l=r(t(261)),f=m(l["default"]),h=u(f);e.encodeHTML=w(f,h);function m(O){return Object.keys(O).sort().reduce(function(d,v){return d[O[v]]="&"+v+";",d;},{});}function u(O){for(var d=[],v=[],p=0,x=Object.keys(O);p<x.length;p++){var E=x[p];E.length===1?d.push("\\"+E):v.push(E);}d.sort();for(var R=0;R<d.length-1;R++){for(var D=R;D<d.length-1&&d[D].charCodeAt(1)+1===d[D+1].charCodeAt(1);)D+=1;var U=1+D-R;U<3||d.splice(R,U,d[R]+"-"+d[D]);}return v.unshift("["+d.join("")+"]"),new RegExp(v.join("|"),"g");}var y=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function T(O){return"&#x"+O.codePointAt(0).toString(16).toUpperCase()+";";}function w(O,d){return function(v){return v.replace(d,function(p){return O[p];}).replace(y,T);};}var I=u(s);function S(O){return O.replace(I,T).replace(y,T);}e.escape=S;},/* 267 *//***/function(i){i.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(i,e){var t=e.getChildren=function(n){return n.children;},r=e.getParent=function(n){return n.parent;};e.getSiblings=function(n){var s=r(n);return s?t(s):[n];},e.getAttributeValue=function(n,s){return n.attribs&&n.attribs[s];},e.hasAttrib=function(n,s){return!!n.attribs&&hasOwnProperty.call(n.attribs,s);},e.getName=function(n){return n.name;};},/* 269 *//***/function(i,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 s=r.next=t.next;s&&(s.prev=r);var c=r.parent=t.parent;if(c){var l=c.children;l[l.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,s=t.next;if(r.next=s,r.prev=t,t.next=r,r.parent=n,s){if(s.prev=r,n){var c=n.children;c.splice(c.lastIndexOf(s),0,r);}}else n&&n.children.push(r);},e.prepend=function(t,r){var n=t.parent;if(n){var s=n.children;s.splice(s.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(i,e,t){var r=t(256).isTag;i.exports={filter:n,find:s,findOneChild:c,findOne:l,existsOne:f,findAll:h};function n(m,u,y,T){return Array.isArray(u)||(u=[u]),(typeof T!="number"||!isFinite(T))&&(T=1/0),s(m,u,y!==!1,T);}function s(m,u,y,T){for(var w=[],I,S=0,O=u.length;S<O&&!(m(u[S])&&(w.push(u[S]),--T<=0)||(I=u[S].children,y&&I&&I.length>0&&(I=s(m,I,y,T),w=w.concat(I),T-=I.length,T<=0)));S++);return w;}function c(m,u){for(var y=0,T=u.length;y<T;y++)if(m(u[y]))return u[y];return null;}function l(m,u){for(var y=null,T=0,w=u.length;T<w&&!y;T++)if(r(u[T]))m(u[T])?y=u[T]:u[T].children.length>0&&(y=l(m,u[T].children));else continue;return y;}function f(m,u){for(var y=0,T=u.length;y<T;y++)if(r(u[y])&&(m(u[y])||u[y].children.length>0&&f(m,u[y].children)))return!0;return!1;}function h(m,u){for(var y=[],T=u.slice();T.length;){var w=T.shift();r(w)&&(w.children&&w.children.length>0&&T.unshift.apply(T,w.children),m(w)&&y.push(w));}return y;}},/* 271 *//***/function(i,e,t){var r=t(256),n=e.isTag=r.isTag;e.testElement=function(f,h){for(var m in f)if(f.hasOwnProperty(m)){if(m==="tag_name"){if(!n(h)||!f.tag_name(h.name))return!1;}else if(m==="tag_type"){if(!f.tag_type(h.type))return!1;}else if(m==="tag_contains"){if(n(h)||!f.tag_contains(h.data))return!1;}else if(!h.attribs||!f[m](h.attribs[m]))return!1;}return!0;};var s={tag_name:function tag_name(f){return typeof f=="function"?function(h){return n(h)&&f(h.name);}:f==="*"?n:function(h){return n(h)&&h.name===f;};},tag_type:function tag_type(f){return typeof f=="function"?function(h){return f(h.type);}:function(h){return h.type===f;};},tag_contains:function tag_contains(f){return typeof f=="function"?function(h){return!n(h)&&f(h.data);}:function(h){return!n(h)&&h.data===f;};}};function c(f,h){return typeof h=="function"?function(m){return m.attribs&&h(m.attribs[f]);}:function(m){return m.attribs&&m.attribs[f]===h;};}function l(f,h){return function(m){return f(m)||h(m);};}e.getElements=function(f,h,m,u){var y=Object.keys(f).map(function(T){var w=f[T];return T in s?s[T](w):c(T,w);});return y.length===0?[]:this.filter(y.reduce(l),h,m,u);},e.getElementById=function(f,h,m){return Array.isArray(h)||(h=[h]),this.findOne(c("id",f),h,m!==!1);},e.getElementsByTagName=function(f,h,m,u){return this.filter(s.tag_name(f),h,m,u);},e.getElementsByTagType=function(f,h,m,u){return this.filter(s.tag_type(f),h,m,u);};},/* 272 *//***/function(i,e){e.removeSubsets=function(n){for(var s=n.length,c,l,f;--s>-1;){for(c=l=n[s],n[s]=null,f=!0;l;){if(n.indexOf(l)>-1){f=!1,n.splice(s,1);break;}l=l.parent;}f&&(n[s]=c);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},r=e.compareDocumentPosition=function(n,s){var c=[],l=[],f,h,m,u,y,T;if(n===s)return 0;for(f=n;f;)c.unshift(f),f=f.parent;for(f=s;f;)l.unshift(f),f=f.parent;for(T=0;c[T]===l[T];)T++;return T===0?t.DISCONNECTED:(h=c[T-1],m=h.children,u=c[T],y=l[T],m.indexOf(u)>m.indexOf(y)?h===s?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:h===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};e.uniqueSort=function(n){var s=n.length,c,l;for(n=n.slice();--s>-1;)c=n[s],l=n.indexOf(c),l>-1&&l<s&&n.splice(s,1);return n.sort(function(f,h){var m=r(f,h);return m&t.PRECEDING?-1:m&t.FOLLOWING?1:0;}),n;};},/* 273 *//***/function(i,e){i.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 *//***/function(i,e,t){i.exports=y;var r=t(275).parse,n=t(273),s=t(278),c=t(279),l=t(280),f=t(282),h=n.trueFunc,m=n.falseFunc,u=f.filters;function y(M,W,X){var B=w(M,W,X);return T(B,W);}function T(M,W){var X=W.adapter;return function(N){return X.isTag(N)&&M(N);};}function w(M,W,X){var B=r(M,W);return x(B,W,X);}function I(M){return M.type==="pseudo"&&(M.name==="scope"||Array.isArray(M.data)&&M.data.some(function(W){return W.some(I);}));}var S={type:"descendant"},O={type:"_flexibleDescendant"},d={type:"pseudo",name:"scope"},v={};function p(M,W,X){var B=W.adapter,N=!!X&&!!X.length&&X.every(function($){return $===v||!!B.getParent($);});M.forEach(function($){if(!($.length>0&&E($[0])&&$[0].type!=="descendant"))if(N&&!(Array.isArray($)?$.some(I):I($)))$.unshift(S);else return;$.unshift(d);});}function x(M,W,X){M=M.filter(function(J){return J.length>0;}),M.forEach(s);var B=Array.isArray(X);X=W&&W.context||X,X&&!B&&(X=[X]),p(M,W,X);var N=!1,$=M.map(function(J){if(J[0]&&J[1]&&J[0].name==="scope"){var tt=J[1].type;B&&tt==="descendant"?J[1]=O:(tt==="adjacent"||tt==="sibling")&&(N=!0);}return R(J,W,X);}).reduce(D,m);return $.shouldTestNextSiblings=N,$;}function E(M){return c[M.type]<0;}function R(M,W,X){return M.reduce(function(B,N){if(B===m)return B;if(!(N.type in l))throw new Error("Rule type "+N.type+" is not supported by css-select");return l[N.type](B,N,W,X);},W&&W.rootFunc||h);}function D(M,W){return W===m||M===h?M:M===m||W===h?W:function(B){return M(B)||W(B);};}function U(M){return M.some(E);}u.not=function(M,W,X,B){var N={xmlMode:!!(X&&X.xmlMode),strict:!!(X&&X.strict),adapter:X.adapter};if(N.strict&&(W.length>1||W.some(U)))throw new Error("complex selectors in :not aren't allowed in strict mode");var $=x(W,N,B);return $===m?M:$===h?m:function(tt){return!$(tt)&&M(tt);};},u.has=function(M,W,X){var B=X.adapter,N={xmlMode:!!(X&&X.xmlMode),strict:!!(X&&X.strict),adapter:B},$=W.some(U)?[v]:null,J=x(W,N,$);return J===m?m:J===h?function(at){return B.getChildren(at).some(B.isTag)&&M(at);}:(J=T(J,X),$?function(at){return M(at)&&($[0]=at,B.existsOne(J,B.getChildren(at)));}:function(at){return M(at)&&B.existsOne(J,B.getChildren(at));});},u.matches=function(M,W,X,B){var N={xmlMode:!!(X&&X.xmlMode),strict:!!(X&&X.strict),rootFunc:M,adapter:X.adapter};return x(W,N,B);},y.compileToken=x,y.compileUnsafe=w,y.Pseudos=f;},/* 275 *//***/function(i,e,t){var r=this&&this.__createBinding||(Object.create?function(l,f,h,m){m===void 0&&(m=h),Object.defineProperty(l,m,{enumerable:!0,get:function get(){return f[h];}});}:function(l,f,h,m){m===void 0&&(m=h),l[m]=f[h];}),n=this&&this.__exportStar||function(l,f){for(var h in l)h!=="default"&&!f.hasOwnProperty(h)&&r(f,l,h);};Object.defineProperty(e,"__esModule",{value:!0}),n(t(276),e);var s=t(276);Object.defineProperty(e,"parse",{enumerable:!0,get:function get(){return s["default"];}});var c=t(277);Object.defineProperty(e,"stringify",{enumerable:!0,get:function get(){return c["default"];}});},/* 276 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=I;var r=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,s=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,c={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},l={">":"child","<":"parent","~":"sibling","+":"adjacent"},f={"#":["id","equals"],".":["class","element"]},h=/* @__PURE__ */new Set(["has","not","matches"]),m=/* @__PURE__ */new Set(["contains","icontains"]),u=/* @__PURE__ */new Set(['"',"'"]);function y(d,v,p){var x=parseInt(v,16)-65536;return x!==x||p?v:x<0?// BMP codepoint
|
|
321
|
+
String.fromCharCode(x+65536):// Supplemental Plane codepoint (surrogate pair)
|
|
322
|
+
String.fromCharCode(x>>10|55296,x&1023|56320);}function T(d){return d.replace(n,y);}function w(d){return d===" "||d==="\n"||d===" "||d==="\f"||d==="\r";}function I(d,v){var p=[];if(d=S(p,""+d,v),d!=="")throw new Error("Unmatched selector: "+d);return p;}function S(d,v,p){var x=[],E=!1;function R(){var ft=v.match(r);if(!ft)throw new Error("Expected name, found "+v);var mt=ft[0];return v=v.substr(mt.length),T(mt);}function D(ft){for(;w(v.charAt(ft));)ft++;v=v.substr(ft);}function U(ft){for(var mt=0;v.charAt(--ft)==="\\";)mt++;return(mt&1)===1;}for(D(0);v!=="";){var M=v.charAt(0);if(w(M))E=!0,D(1);else if(M in l)x.push({type:l[M]}),E=!1,D(1);else if(M===","){if(x.length===0)throw new Error("Empty sub-selector");d.push(x),x=[],E=!1,D(1);}else if(E&&(x.length>0&&x.push({type:"descendant"}),E=!1),M==="*")v=v.substr(1),x.push({type:"universal"});else if(M in f){var W=f[M],X=W[0],B=W[1];v=v.substr(1),x.push({type:"attribute",name:X,action:B,value:R(),ignoreCase:!1});}else if(M==="["){v=v.substr(1);var N=v.match(s);if(!N)throw new Error("Malformed attribute selector: "+v);v=v.substr(N[0].length);var $=T(N[1]);(!p||("lowerCaseAttributeNames"in p?p.lowerCaseAttributeNames:!p.xmlMode))&&($=$.toLowerCase()),x.push({type:"attribute",name:$,action:c[N[2]],value:T(N[4]||N[5]||""),ignoreCase:!!N[6]});}else if(M===":"){if(v.charAt(1)===":"){v=v.substr(2),x.push({type:"pseudo-element",name:R().toLowerCase()});continue;}v=v.substr(1);var J=R().toLowerCase(),N=null;if(v.charAt(0)==="(")if(h.has(J)){var tt=v.charAt(1),at=u.has(tt);if(v=v.substr(at?2:1),N=[],v=S(N,v,p),at){if(v.charAt(0)!==tt)throw new Error("Unmatched quotes in :"+J);v=v.substr(1);}if(v.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+J+" ("+v+")");v=v.substr(1);}else{for(var ut=1,V=1;V>0&&ut<v.length;ut++)v.charAt(ut)==="("&&!U(ut)?V++:v.charAt(ut)===")"&&!U(ut)&&V--;if(V)throw new Error("Parenthesis not matched");if(N=v.substr(1,ut-2),v=v.substr(ut),m.has(J)){var tt=N.charAt(0);tt===N.slice(-1)&&u.has(tt)&&(N=N.slice(1,-1)),N=T(N);}}x.push({type:"pseudo",name:J,data:N});}else if(r.test(v)){var Q=R();(!p||("lowerCaseTags"in p?p.lowerCaseTags:!p.xmlMode))&&(Q=Q.toLowerCase()),x.push({type:"tag",name:Q});}else return x.length&&x[x.length-1].type==="descendant"&&x.pop(),O(d,x),v;}return O(d,x),v;}function O(d,v){if(d.length>0&&v.length===0)throw new Error("Empty sub-selector");d.push(v);}},/* 277 *//***/function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(f){return f.map(s).join(", ");}e["default"]=n;function s(f){return f.map(c).join("");}function c(f){switch(f.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return f.name;case"pseudo-element":return"::"+f.name;case"pseudo":return f.data===null?":"+f.name:typeof f.data=="string"?":"+f.name+"("+f.data+")":":"+f.name+"("+n(f.data)+")";case"attribute":return f.action==="exists"?"["+f.name+"]":f.name==="id"&&f.action==="equals"&&!f.ignoreCase?"#"+f.value:f.name==="class"&&f.action==="element"&&!f.ignoreCase?"."+f.value:"["+f.name+r[f.action]+"='"+f.value+"'"+(f.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function l(f){return f;}},/* 278 *//***/function(i,e,t){i.exports=s;var r=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function s(l){for(var f=l.map(c),h=1;h<l.length;h++){var m=f[h];if(!(m<0))for(var u=h-1;u>=0&&m<f[u];u--){var y=l[u+1];l[u+1]=l[u],l[u]=y,f[u+1]=f[u],f[u]=m;}}}function c(l){var f=r[l.type];if(f===r.attribute)f=n[l.action],f===n.equals&&l.name==="id"&&(f=9),l.ignoreCase&&(f>>=1);else if(f===r.pseudo)if(!l.data)f=3;else if(l.name==="has"||l.name==="contains")f=0;else if(l.name==="matches"||l.name==="not"){f=0;for(var h=0;h<l.data.length;h++)if(l.data[h].length===1){var m=c(l.data[h][0]);if(m===0){f=0;break;}m>f&&(f=m);}l.data.length>1&&f>0&&(f-=1);}else f=1;return f;}},/* 279 *//***/function(i){i.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 *//***/function(i,e,t){var r=t(281),n=t(282);i.exports={__proto__:null,attribute:r.compile,pseudo:n.compile,//tags
|
|
323
|
+
tag:function tag(s,c,l){var f=c.name,h=l.adapter;return function(u){return h.getName(u)===f&&s(u);};},//traversal
|
|
324
|
+
descendant:function descendant(s,c,l){var f=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,h=l.adapter;return function(u){for(var y=!1;!y&&(u=h.getParent(u));)(!f||!f.has(u))&&(y=s(u),!y&&f&&f.add(u));return y;};},_flexibleDescendant:function _flexibleDescendant(s,c,l){var f=l.adapter;return function(m){for(var u=s(m);!u&&(m=f.getParent(m));)u=s(m);return u;};},parent:function parent(s,c,l){if(l&&l.strict)throw new Error("Parent selector isn't part of CSS3");var f=l.adapter;return function(u){return f.getChildren(u).some(h);};function h(m){return f.isTag(m)&&s(m);}},child:function child(s,c,l){var f=l.adapter;return function(m){var u=f.getParent(m);return!!u&&s(u);};},sibling:function sibling(s,c,l){var f=l.adapter;return function(m){for(var u=f.getSiblings(m),y=0;y<u.length;y++)if(f.isTag(u[y])){if(u[y]===m)break;if(s(u[y]))return!0;}return!1;};},adjacent:function adjacent(s,c,l){var f=l.adapter;return function(m){for(var u=f.getSiblings(m),y,T=0;T<u.length;T++)if(f.isTag(u[T])){if(u[T]===m)break;y=u[T];}return!!y&&s(y);};},universal:function universal(s){return s;}};},/* 281 *//***/function(i,e,t){var r=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,s={__proto__:null,equals:function equals(c,l,f){var h=l.name,m=l.value,u=f.adapter;return l.ignoreCase?(m=m.toLowerCase(),function(T){var w=u.getAttributeValue(T,h);return w!=null&&w.toLowerCase()===m&&c(T);}):function(T){return u.getAttributeValue(T,h)===m&&c(T);};},hyphen:function hyphen(c,l,f){var h=l.name,m=l.value,u=m.length,y=f.adapter;return l.ignoreCase?(m=m.toLowerCase(),function(w){var I=y.getAttributeValue(w,h);return I!=null&&(I.length===u||I.charAt(u)==="-")&&I.substr(0,u).toLowerCase()===m&&c(w);}):function(w){var I=y.getAttributeValue(w,h);return I!=null&&I.substr(0,u)===m&&(I.length===u||I.charAt(u)==="-")&&c(w);};},element:function element(c,l,f){var h=l.name,m=l.value,u=f.adapter;if(/\s/.test(m))return r;m=m.replace(n,"\\$&");var y="(?:^|\\s)"+m+"(?:$|\\s)",T=l.ignoreCase?"i":"",w=new RegExp(y,T);return function(S){var O=u.getAttributeValue(S,h);return O!=null&&w.test(O)&&c(S);};},exists:function exists(c,l,f){var h=l.name,m=f.adapter;return function(y){return m.hasAttrib(y,h)&&c(y);};},start:function start(c,l,f){var h=l.name,m=l.value,u=m.length,y=f.adapter;return u===0?r:l.ignoreCase?(m=m.toLowerCase(),function(w){var I=y.getAttributeValue(w,h);return I!=null&&I.substr(0,u).toLowerCase()===m&&c(w);}):function(w){var I=y.getAttributeValue(w,h);return I!=null&&I.substr(0,u)===m&&c(w);};},end:function end(c,l,f){var h=l.name,m=l.value,u=-m.length,y=f.adapter;return u===0?r:l.ignoreCase?(m=m.toLowerCase(),function(w){var I=y.getAttributeValue(w,h);return I!=null&&I.substr(u).toLowerCase()===m&&c(w);}):function(w){var I=y.getAttributeValue(w,h);return I!=null&&I.substr(u)===m&&c(w);};},any:function any(c,l,f){var h=l.name,m=l.value,u=f.adapter;if(m==="")return r;if(l.ignoreCase){var y=new RegExp(m.replace(n,"\\$&"),"i");return function(w){var I=u.getAttributeValue(w,h);return I!=null&&y.test(I)&&c(w);};}return function(w){var I=u.getAttributeValue(w,h);return I!=null&&I.indexOf(m)>=0&&c(w);};},not:function not(c,l,f){var h=l.name,m=l.value,u=f.adapter;return m===""?function(T){return!!u.getAttributeValue(T,h)&&c(T);}:l.ignoreCase?(m=m.toLowerCase(),function(T){var w=u.getAttributeValue(T,h);return w!=null&&w.toLowerCase()!==m&&c(T);}):function(T){return u.getAttributeValue(T,h)!==m&&c(T);};}};i.exports={compile:function compile(c,l,f){if(f&&f.strict&&(l.ignoreCase||l.action==="not"))throw new Error("Unsupported attribute selector");return s[l.action](c,l,f);},rules:s};},/* 282 *//***/function(i,e,t){var r=t(283),n=t(273),s=t(281),c=n.trueFunc,l=n.falseFunc,f=s.rules.equals;function h(O,d){var v={name:O,value:d};return function(x,E,R){return f(x,v,R);};}function m(O,d){return function(v){return!!d.getParent(v)&&O(v);};}var u={contains:function contains(O,d,v){var p=v.adapter;return function(E){return O(E)&&p.getText(E).indexOf(d)>=0;};},icontains:function icontains(O,d,v){var p=d.toLowerCase(),x=v.adapter;return function(R){return O(R)&&x.getText(R).toLowerCase().indexOf(p)>=0;};},//location specific methods
|
|
325
|
+
"nth-child":function nthChild(O,d,v){var p=r(d),x=v.adapter;return p===l?p:p===c?m(O,x):function(R){for(var D=x.getSiblings(R),U=0,M=0;U<D.length;U++)if(x.isTag(D[U])){if(D[U]===R)break;M++;}return p(M)&&O(R);};},"nth-last-child":function nthLastChild(O,d,v){var p=r(d),x=v.adapter;return p===l?p:p===c?m(O,x):function(R){for(var D=x.getSiblings(R),U=0,M=D.length-1;M>=0;M--)if(x.isTag(D[M])){if(D[M]===R)break;U++;}return p(U)&&O(R);};},"nth-of-type":function nthOfType(O,d,v){var p=r(d),x=v.adapter;return p===l?p:p===c?m(O,x):function(R){for(var D=x.getSiblings(R),U=0,M=0;M<D.length;M++)if(x.isTag(D[M])){if(D[M]===R)break;x.getName(D[M])===x.getName(R)&&U++;}return p(U)&&O(R);};},"nth-last-of-type":function nthLastOfType(O,d,v){var p=r(d),x=v.adapter;return p===l?p:p===c?m(O,x):function(R){for(var D=x.getSiblings(R),U=0,M=D.length-1;M>=0;M--)if(x.isTag(D[M])){if(D[M]===R)break;x.getName(D[M])===x.getName(R)&&U++;}return p(U)&&O(R);};},//TODO determine the actual root element
|
|
326
|
+
root:function root(O,d,v){var p=v.adapter;return function(x){return!p.getParent(x)&&O(x);};},scope:function scope(O,d,v,p){var x=v.adapter;if(!p||p.length===0)return u.root(O,d,v);function E(R,D){return typeof x.equals=="function"?x.equals(R,D):R===D;}return p.length===1?function(R){return E(p[0],R)&&O(R);}:function(R){return p.indexOf(R)>=0&&O(R);};},//jQuery extensions (others follow as pseudos)
|
|
327
|
+
checkbox:h("type","checkbox"),file:h("type","file"),password:h("type","password"),radio:h("type","radio"),reset:h("type","reset"),image:h("type","image"),submit:h("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
|
|
328
|
+
hover:function hover(O,d,v){var p=v.adapter;return typeof p.isHovered=="function"?function(E){return O(E)&&p.isHovered(E);}:l;},visited:function visited(O,d,v){var p=v.adapter;return typeof p.isVisited=="function"?function(E){return O(E)&&p.isVisited(E);}:l;},active:function active(O,d,v){var p=v.adapter;return typeof p.isActive=="function"?function(E){return O(E)&&p.isActive(E);}:l;}};function y(O,d){for(var v=0;O&&v<O.length;v++)if(d.isTag(O[v]))return O[v];}var T={empty:function empty(O,d){return!d.getChildren(O).some(function(v){return d.isTag(v)||v.type==="text";});},"first-child":function firstChild(O,d){return y(d.getSiblings(O),d)===O;},"last-child":function lastChild(O,d){for(var v=d.getSiblings(O),p=v.length-1;p>=0;p--){if(v[p]===O)return!0;if(d.isTag(v[p]))break;}return!1;},"first-of-type":function firstOfType(O,d){for(var v=d.getSiblings(O),p=0;p<v.length;p++)if(d.isTag(v[p])){if(v[p]===O)return!0;if(d.getName(v[p])===d.getName(O))break;}return!1;},"last-of-type":function lastOfType(O,d){for(var v=d.getSiblings(O),p=v.length-1;p>=0;p--)if(d.isTag(v[p])){if(v[p]===O)return!0;if(d.getName(v[p])===d.getName(O))break;}return!1;},"only-of-type":function onlyOfType(O,d){for(var v=d.getSiblings(O),p=0,x=v.length;p<x;p++)if(d.isTag(v[p])){if(v[p]===O)continue;if(d.getName(v[p])===d.getName(O))return!1;}return!0;},"only-child":function onlyChild(O,d){for(var v=d.getSiblings(O),p=0;p<v.length;p++)if(d.isTag(v[p])&&v[p]!==O)return!1;return!0;},//:matches(a, area, link)[href]
|
|
329
|
+
link:function link(O,d){return d.hasAttrib(O,"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(O,d){if(d.hasAttrib(O,"selected"))return!0;if(d.getName(O)!=="option")return!1;var v=d.getParent(O);if(!v||d.getName(v)!=="select"||d.hasAttrib(v,"multiple"))return!1;for(var p=d.getChildren(v),x=!1,E=0;E<p.length;E++)if(d.isTag(p[E]))if(p[E]===O)x=!0;else if(x){if(d.hasAttrib(p[E],"selected"))return!1;}else return!1;return x;},//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(O,d){return d.hasAttrib(O,"disabled");},enabled:function enabled(O,d){return!d.hasAttrib(O,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
|
|
340
|
+
checked:function checked(O,d){return d.hasAttrib(O,"checked")||T.selected(O,d);},//:matches(input, select, textarea)[required]
|
|
341
|
+
required:function required(O,d){return d.hasAttrib(O,"required");},//:matches(input, select, textarea):not([required])
|
|
342
|
+
optional:function optional(O,d){return!d.hasAttrib(O,"required");},//jQuery extensions
|
|
343
|
+
//:not(:empty)
|
|
344
|
+
parent:function parent(O,d){return!T.empty(O,d);},//:matches(h1, h2, h3, h4, h5, h6)
|
|
345
|
+
header:w(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
|
|
346
|
+
button:function button(O,d){var v=d.getName(O);return v==="button"||v==="input"&&d.getAttributeValue(O,"type")==="button";},//:matches(input, textarea, select, button)
|
|
347
|
+
input:w(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
|
|
348
|
+
text:function text(O,d){var v;return d.getName(O)==="input"&&(!(v=d.getAttributeValue(O,"type"))||v.toLowerCase()==="text");}};function w(O){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var d=new Set(O);return function(v,p){return d.has(p.getName(v));};}return function(v,p){return O.indexOf(p.getName(v))>=0;};}function I(O,d,v){if(v===null){if(O.length>2&&d!=="scope")throw new Error("pseudo-selector :"+d+" requires an argument");}else if(O.length===2)throw new Error("pseudo-selector :"+d+" doesn't have any arguments");}var S=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;i.exports={compile:function compile(O,d,v,p){var x=d.name,E=d.data,R=v.adapter;if(v&&v.strict&&!S.test(x))throw new Error(":"+x+" isn't part of CSS3");if(typeof u[x]=="function")return u[x](O,E,v,p);if(typeof T[x]=="function"){var D=T[x];return I(D,x,E),D===l?D:O===c?function(M){return D(M,R,E);}:function(M){return D(M,R,E)&&O(M);};}else throw new Error("unmatched pseudo-class :"+x);},filters:u,pseudos:T};},/* 283 *//***/function(i,e,t){var r=t(284),n=t(285);i.exports=function(c){return n(r(c));},i.exports.parse=r,i.exports.compile=n;},/* 284 *//***/function(i,e){i.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 s=n.match(t);if(!s)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var c;return s[1]?(c=parseInt(s[1],10),isNaN(c)&&(s[1].charAt(0)==="-"?c=-1:c=1)):c=0,[c,s[3]?parseInt((s[2]||"")+s[3],10):0];}},/* 285 *//***/function(i,e,t){i.exports=c;var r=t(273),n=r.trueFunc,s=r.falseFunc;function c(l){var f=l[0],h=l[1]-1;if(h<0&&f<=0)return s;if(f===-1)return function(u){return u<=h;};if(f===0)return function(u){return u===h;};if(f===1)return h<0?n:function(u){return u>=h;};var m=h%f;return m<0&&(m+=f),f>1?function(u){return u>=h&&u%f===m;}:(f*=-1,function(u){return u<=h&&u%f===m;});}},/* 286 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return E;});var r=t(12),n=t(74),s=t(1),c=t(68),l=t(250),f=t(213),h=t(218);t(1).glMatrix.setMatrixArrayType(Array);function m(R,D){if(R==null)return{};var U=u(R,D),M,W;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(R);for(W=0;W<X.length;W++)M=X[W],!(D.indexOf(M)>=0)&&Object.prototype.propertyIsEnumerable.call(R,M)&&(U[M]=R[M]);}return U;}function u(R,D){if(R==null)return{};var U={},M=Object.keys(R),W,X;for(X=0;X<M.length;X++)W=M[X],!(D.indexOf(W)>=0)&&(U[W]=R[W]);return U;}var y={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
|
|
349
|
+
},T=Symbol("autoRender"),w=Symbol("renderer"),I=Symbol("timeline"),S=Symbol("prepareRender"),O=Symbol("tickRender"),d=Symbol("pass"),v=Symbol("fbo"),p=Symbol("tickers"),x=Symbol("layerTransformInvert");var E=/*#__PURE__*/function(_l$default){function E(){var _this36;var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,E);if(_this36=_callSuper(this,E),!D.canvas){var _this36$getResolution=_this36.getResolution(),X=_this36$getResolution.width,B=_this36$getResolution.height,N=r.ENV.createCanvas(X,B,{offscreen:!!D.offscreen,id:D.id,extra:D.extra});N.style&&(N.style.position="absolute"),N.dataset&&(N.dataset.layerId=D.id),N.contextType&&(D.contextType=N.contextType),D.canvas=N;}var U=D.canvas,M=Object.assign({},y,D);_this36[T]=M.autoRender,delete D.autoRender;var W=M.Renderer||r.Renderer;_this36[w]=new W(U,M),_this36.options=D,_this36.id=D.id,_this36[d]=[],_this36.setResolution(U),_this36.canvas=U,_this36[I]=new n.Timeline(),_this36.__mouseCapturedTarget=null,_this36[x]=null;return _this36;}_inherits(E,_l$default);return _createClass(E,[{key:"autoRender",get:function get(){return this[T];}},{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(),D=_this$getResolution.height;return D/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[d];}},{key:"prepareRender",get:function get(){return this[S]?this[S]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[w];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,D=_this$parent$options.left,U=_this$parent$options.top;return[D,U];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[I];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),D=_this$getResolution2.width;return D/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,D=_this$attributes21.x,U=_this$attributes21.y;return[1,0,0,1,D,U];}},{key:"layerTransformInvert",get:function get(){if(this[x])return this[x];var D=this.transformMatrix;return D[0]===1&&D[1]===0&&D[2]===0&&D[3]===1&&D[4]===0&&D[5]===0?null:(this[x]=s.mat2d.invert(Array.of(0,0,0,0,0,0),D),this[x]);}},{key:"forceContextLoss",value:function forceContextLoss(){var D=this.renderer.glRenderer;if(D){var U=D.getExtension("WEBGL_lose_context");if(U)return U.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]:{},D=_ref149.vertex,U=_ref149.fragment,M=_ref149.options,W=_ref149.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),X=_this$getResolution3.width,B=_this$getResolution3.height,N=this.renderer.createPassProgram({vertex:D,fragment:U,options:M}),$=new r.Figure2D();$.rect(0,0,X/this.displayRatio,B/this.displayRatio);var J=new r.Mesh2D($);return J.setUniforms(W),J.setProgram(N),this[d].push(J),this.forceUpdate(),J;}return null;}// delete unused texture to release memory.
|
|
353
|
+
},{key:"deleteTexture",value:function deleteTexture(D){return Object(h.deleteTexture)(D,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(D){var U=D.type;if(U==="mousedown"||U==="mouseup"||U==="mousemove"){var N=this.__mouseCapturedTarget;if(N){if(N.layer===this)return N.dispatchEvent(D),!0;this.__mouseCapturedTarget=null;}}var M,W;var X=this.layerTransformInvert;if(X){M=D.x,W=D.y;var _N6=X,$=_N6[0]*M+_N6[2]*W+_N6[4],J=_N6[1]*M+_N6[3]*W+_N6[5];delete D.x,delete D.y,delete D.layerX,delete D.layerY,Object.defineProperties(D,{layerX:{value:$,configurable:!0},layerY:{value:J,configurable:!0},x:{value:$,configurable:!0},y:{value:J,configurable:!0}});}var B=_superPropGet(E,"dispatchPointerEvent",this,3)([D]);return X&&Object.defineProperties(D,{layerX:{value:M,configurable:!0},layerY:{value:W,configurable:!0},x:{value:M,configurable:!0},y:{value:W,configurable:!0}}),B;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this37=this;if(!this[S])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var D=null;var U=new Promise(function(M){D=M;});U._resolve=D,this[S]=U;}else{var _D2=null,_U8=null;var M=new Promise(function(W){_D2=W,_this37[T]&&(_U8=Object(c.requestAnimationFrame)(function(){delete M._requestID,_this37.render();}));});M._resolve=_D2,M._requestID=_U8,this[S]=M;}}},{key:"getFBO",value:function getFBO(){var D=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),U=_this$getResolution4.width,M=_this$getResolution4.height;return D&&(!this[v]||this[v].width!==U||this[v].height!==M)?(this[v]={width:U,height:M,target:D.createFBO(),buffer:D.createFBO(),swap:function swap(){var _ref150=[this.buffer,this.target];this.target=_ref150[0];this.buffer=_ref150[1];}},this[v]):this[v]?this[v]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var D=this.renderer,U=D.__globalTransformMatrix||D.globalTransformMatrix;D.__globalTransformMatrix=U;var M=s.mat2d.fromValues(1,0,0,1,0,0);D.setGlobalTransform.apply(D,_toConsumableArray(s.mat2d.multiply(M,U,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(D,U,M){if(_superPropGet(E,"onPropertyChange",this,3)([D,U,M]),D==="zIndex"&&(this.canvas.style.zIndex=U),D==="transform"||D==="translate"||D==="rotate"||D==="scale"||D==="skew"){var W=this[x];if(this[x]=null,this.updateGlobalTransform(),W&&!this.layerTransformInvert){var X=this.renderer,B=X.__globalTransformMatrix||X.globalTransformMatrix;X.setGlobalTransform.apply(X,_toConsumableArray(B));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[S]&&(this[S]._requestID&&Object(c.cancelAnimationFrame)(this[S]._requestID),this[S]._resolve(),delete this[S]);}},{key:"render",value:function render(){var _this38=this;var _ref151=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref151$clear=_ref151.clear,D=_ref151$clear===void 0?!0:_ref151$clear;var U=this[d].length?this.getFBO():null;U&&this.renderer.glRenderer.bindFBO(U.target),D&&this[w].clear();var M=this.draw();if(M&&M.length&&(this.renderer.drawMeshes(M),this.canvas.draw&&this.canvas.draw()),U){var W=this.renderer.glRenderer,X=this[d].length,_this$getResolution5=this.getResolution(),B=_this$getResolution5.width,N=_this$getResolution5.height,$=[0,0,B/this.displayRatio,N/this.displayRatio];this[d].forEach(function(J,tt){J.blend=!0,J.setTexture(U.target.texture,{rect:$}),tt===X-1?W.bindFBO(null):(U.swap(),W.bindFBO(U.target)),_this38[w].clear(),_this38.renderer.drawMeshes([J]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref152){var _this39=this;var D=_ref152.width,U=_ref152.height;var M=this.renderer,W=M.__globalTransformMatrix||M.globalTransformMatrix,X=W[4],B=W[5],N=W[0],_this$getResolution6=this.getResolution(),$=_this$getResolution6.width,J=_this$getResolution6.height;($!==D||J!==U)&&(_superPropGet(E,"setResolution",this,3)([{width:D,height:U}]),this.canvas&&(this.canvas.width=D,this.canvas.height=U,M.updateResolution&&M.updateResolution()),this.attributes.size=[D,U],this[d].length&&this[d].forEach(function(V){var Q=new r.Figure2D();Q.rect(0,0,D/_this39.displayRatio,U/_this39.displayRatio),V.contours=Q.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),tt=_this$renderOffset[0],at=_this$renderOffset[1],ut=this.displayRatio;(X!==tt||B!==at||N!==ut)&&(M.setGlobalTransform(ut,0,0,ut,tt,at),M.__globalTransformMatrix=null,this[x]=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 D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var U=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _U$duration=U.duration,M=_U$duration===void 0?1/0:_U$duration,W=m(U,["duration"]);var X=this.timeline.fork(W),B=this;this[p]=this[p]||[],this[p].push({handler:D,duration:M});var _N7=function N(){var $=null,J=null;var tt=function tt(){var at=_this40[p].map(function(_ref153){var ut=_ref153.handler,V=_ref153.duration;var Q=Math.min(1,X.currentTime/V);return{value:ut?ut(X.currentTime,Q):null,p:Q};});B[O]||(B[O]=Promise.resolve().then(function(){B[T]&&B.render(),delete B[O];for(var ut=at.length-1;ut>=0;ut--){var _at$ut=at[ut],V=_at$ut.value,Q=_at$ut.p;(V===!1||Q>=1)&&_this40[p].splice(ut,1);}_this40[p].length>0&&_N7();}));};if(_this40[S]&&_this40[S]._type!=="ticker"&&(Object(c.cancelAnimationFrame)(_this40[S]._requestID),delete _this40[S]),!_this40[S]){var at=new Promise(function(ut){$=ut,J=Object(c.requestAnimationFrame)(tt);});at._resolve=$,at._requestID=J,at._type="ticker",_this40[S]=at;}};_N7();}},{key:"toGlobalPos",value:function toGlobalPos(D,U){if(this.layerTransformInvert){var $=this.transformMatrix;D=$[0]*D+$[2]*U+$[4],U=$[1]*D+$[3]*U+$[5];}var _this$getResolution7=this.getResolution(),M=_this$getResolution7.width,W=_this$getResolution7.height,X=this.renderOffset,B=[this.canvas.clientWidth,this.canvas.clientHeight];D=D*B[0]/M+X[0],U=U*B[1]/W+X[1];var N=this.displayRatio;return D*=N,U*=N,[D,U];}},{key:"toLocalPos",value:function toLocalPos(D,U){var _this$getResolution8=this.getResolution(),M=_this$getResolution8.width,W=_this$getResolution8.height,X=this.renderOffset,B=[this.canvas.clientWidth,this.canvas.clientHeight];D=D*M/B[0]-X[0],U=U*W/B[1]-X[1];var N=this.displayRatio;D/=N,U/=N;var $=this.layerTransformInvert;return $&&(D=$[0]*D+$[2]*U+$[4],U=$[1]*D+$[3]*U+$[5]),[D,U];}}]);}(l["default"]);f["default"].registerNode(E,"layer");},/* 287 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return S;});var r=t(224),n=t(288),s=t(213),c=t(252),l=t(72);t(1).glMatrix.setMatrixArrayType(Array);function f(O,d){if(O==null)return{};var v=h(O,d),p,x;if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(O);for(x=0;x<E.length;x++)p=E[x],!(d.indexOf(p)>=0)&&Object.prototype.propertyIsEnumerable.call(O,p)&&(v[p]=O[p]);}return v;}function h(O,d){if(O==null)return{};var v={},p=Object.keys(O),x,E;for(E=0;E<p.length;E++)x=p[E],!(d.indexOf(x)>=0)&&(v[x]=O[x]);return v;}function m(O,d,v){return d in O?Object.defineProperty(O,d,{value:v,enumerable:!0,configurable:!0,writable:!0}):O[d]=v,O;}var u="http://www.w3.org/2000/svg",y=Symbol["for"]("spritejs_setAttribute"),T=Symbol("root"),w=Symbol("task");function I(O){var d=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var v=O[T];if(v&&v.children[0]){var p=O.svg,x=O.layer?O.layer.displayRatio:1;if(!p.hasAttribute("data-original-width")){var D=p.getAttribute("width");D=D?Object(l.sizeToPixel)(D):300;var U=p.getAttribute("height");U=U?Object(l.sizeToPixel)(U):150,p.hasAttribute("viewBox")||p.setAttribute("viewBox","0 0 ".concat(Math.round(D)," ").concat(Math.round(U))),p.setAttribute("data-original-width",D),p.setAttribute("data-original-height",U);}var E=O.attributes.width||Number(p.getAttribute("data-original-width")),R=O.attributes.height||Number(p.getAttribute("data-original-height"));if(E*=x,R*=x,d&&O.attributes.flexible){var _D3=O.attributes.scale[0];if(E*=_D3,R*=_D3,p.setAttribute("width",E),p.setAttribute("height",R),E&&R&&O.textureImage){var _U9=O.textureImage.width,M=O.textureImage.height,W=O.clientSize;O.attributes.textureRect=[0,0,Math.round(W[0]*_U9/E),Math.round(W[1]*M/R)];}}else O[w]||(p.setAttribute("width",E),p.setAttribute("height",R),O[w]=Promise.resolve().then(function(){delete O[w];var D=v.innerHTML,U=new Blob([D],{type:"image/svg+xml"}),M=URL.createObjectURL(U),W=new Image();W.onload=function(){W.width&&W.height?(O.attributes[y]("texture",W),O.attributes.flexible&&(O.attributes.textureRect=null)):O.attributes[y]("texture",null);},W.src=M;}));}}var S=/*#__PURE__*/function(_r$default21){function S(){var _this41;var d=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,S);typeof d=="string"&&(d={svgText:d});var _d26=d,v=_d26.svgText,p=f(d,["svgText"]);if(_this41=_callSuper(this,S,[p]),_this41[T]=document.createElement("div"),v){_this41[T].innerHTML=v;var x=_this41[T].children[0];x?x.setAttribute("xmlns",u):(fetch(v).then(function(E){return E.text();}).then(function(E){_this41[T].innerHTML=E,(!_this41.observer||_this41.attributes.flexible)&&I(_assertThisInitialized(_this41));}),v=null);}if(!v){var _x25=document.createElementNS(u,"svg");_x25.setAttribute("xmlns",u),_this41[T].appendChild(_x25);}if(typeof MutationObserver=="function"){var _x26=new MutationObserver(function(E){I(_this41,!1);});_x26.observe(_this41[T],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this41.observer=_x26;}return _this41;}_inherits(S,_r$default21);return _createClass(S,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[T]?this[T].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref154){var d=_ref154.width,v=_ref154.height;_superPropGet(S,"setResolution",this,3)([{width:d,height:v}]),I(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(d){var v=_superPropGet(S,"dispatchPointerEvent",this,3)([d]);if(v&&this.attributes.passEvents&&typeof MouseEvent=="function"){var p=d.x,x=d.y;var _this$getOffsetPositi=this.getOffsetPosition(p,x),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),E=_this$getOffsetPositi2[0],R=_this$getOffsetPositi2[1];var D=d.originalEvent,U=this.attributes.anchor,M=this.clientSize;E=(E+U[0]*M[0])/2,R=(R+U[1]*M[1])/2;var W=d.type;if(W===D.type){var X=null;if(D instanceof MouseEvent)X=new MouseEvent(W,{screenX:E,screenY:R,clientX:E,clientY:R,bubbles:D.bubbles,button:D.button,buttons:D.buttons,cancelBubble:D.cancelBubble,cancelable:D.cancelable,currentTarget:D.currentTarget,fromElement:D.fromElement,relatedTarget:D.relatedTarget,returnValue:D.returnValue,srcElement:D.srcElement,target:D.target,toElement:D.toElement,// view: originalEvent.view,
|
|
358
|
+
which:D.witch});else if(D instanceof TouchEvent){var B=null;var N=D.changedTouches||[D];for(var $=0;$<N.length;$++){var J=N[$];if(d.identifier===J.identifier){B=J;break;}}if(B){var _$3=new Touch({identifier:B.identifier,target:B.target,clientX:E,clientY:R,screenX:E,screenY:R,pageX:E,pageY:R,radiusX:B.radiusX,radiusY:B.radiusY,rotationAngle:B.rotationAngle,force:B.force});X=new TouchEvent(W,{cancelable:D.cancelable,bubbles:D.bubbles,composed:D.composed,touches:[_$3],targetTouches:[_$3],changedTouches:[_$3]});}}else X=D;X&&this.svg.dispatchEvent(X);}}return v;}},{key:"getElementById",value:function getElementById(d){return Object(c.querySelector)("#".concat(d),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(d){return Object(c.querySelectorAll)(".".concat(d),this);}},{key:"getElementsByName",value:function getElementsByName(d){return Object(c.querySelectorAll)("[name=\"".concat(d,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(d){return Object(c.querySelectorAll)(d,this);}},{key:"querySelector",value:function querySelector(d){return Object(c.querySelector)(d,this);}},{key:"querySelectorAll",value:function querySelectorAll(d){return Object(c.querySelectorAll)(d,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(d,v,p){_superPropGet(S,"onPropertyChange",this,3)([d,v,p]),d==="flexible"&&I(this),this.attributes.flexible&&(d==="width"||d==="height"||d==="scale"||d==="transform")&&I(this);}}]);}(r["default"]);m(S,"Attr",n["default"]),s["default"].registerNode(S,"spritesvg");},/* 288 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return l;});var r=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttribute"),c=Symbol["for"]("spritejs_setAttributeDefault");var l=/*#__PURE__*/function(_r$default22){function l(h){var _this42;_classCallCheck(this,l);_this42=_callSuper(this,l,[h]),_this42[c]({passEvents:!1,flexible:!1});return _this42;}// readonly
|
|
359
|
+
_inherits(l,_r$default22);return _createClass(l,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(h){}// eslint-disable-line no-empty-function
|
|
360
|
+
},{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(h){return this[s]("passEvents",h);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(h){return this[s]("flexible",h);}}]);}(r["default"]);},/* 289 *//***/function(i,e,t){t.r(e);var r=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(h,m){var u=Object.keys(h);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(h);m&&(y=y.filter(function(T){return Object.getOwnPropertyDescriptor(h,T).enumerable;})),u.push.apply(u,y);}return u;}function s(h){for(var m=1;m<arguments.length;m++){var u=arguments[m]!=null?arguments[m]:{};m%2?n(Object(u),!0).forEach(function(y){c(h,y,u[y]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach(function(y){Object.defineProperty(h,y,Object.getOwnPropertyDescriptor(u,y));});}return h;}function c(h,m,u){return m in h?Object.defineProperty(h,m,{value:u,enumerable:!0,configurable:!0,writable:!0}):h[m]=u,h;}var l=Symbol("inited");var f=null;typeof Worker=="function"&&(f=/*#__PURE__*/function(_Worker){function f(h){var _this43;_classCallCheck(this,f);if(h.worker===!0&&(h.worker="./".concat(h.id,".worker.js")),_this43=_callSuper(this,f,[h.worker]),_this43.options=h,!h.canvas){var _this43$getResolution=_this43.getResolution(),m=_this43$getResolution.width,u=_this43$getResolution.height,y=r.ENV.createCanvas(m,u,{offscreen:!1});y.style&&(y.style.position="absolute"),y.dataset&&(y.dataset.layerId=h.id),h.canvas=y;}_this43.canvas=h.canvas;return _this43;}_inherits(f,_Worker);return _createClass(f,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref155){var h=_ref155.width,m=_ref155.height;if(this[l])this.postMessage({type:"resolution_change",width:h,height:m});else{this.canvas.width=h,this.canvas.height=m;var u=this.options,y=u.canvas.transferControlToOffscreen(),T=s({},u);delete T.container,T.canvas=y,this.postMessage({type:"create",options:T},[y]),this[l]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas7=this.canvas,h=_this$canvas7.width,m=_this$canvas7.height;return{width:h,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(h,m){Object.defineProperty(this,"parent",{value:h,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(h){this.postMessage({type:"event",event:{cancelBubble:h.cancelBubble,bubbles:h.bubbles,detail:h.detail,identifier:h.identifier,layerX:h.layerX,layerY:h.layerY,originalX:h.originalX,originalY:h.originalY,type:h.type,x:h.x,y:h.y}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),e["default"]=f;},/* 290 *//***/function(i,e,t){t.r(e),function(r){t.d(e,"default",function(){return E;});var n=t(12),s=t(68),c=t(70),l=t(286),f=t(289),h=t(250),m=t(291),u=t(214),y=t(218),T=t(213);t(1).glMatrix.setMatrixArrayType(Array);var w=Symbol("enteredTargets");function I(R){return R.id=R.id||"_layer".concat(Math.random().toString(36).slice(2,12)),R.dataset||(R.dataset={}),R.dataset.layerId=R.id,R.connect=function(D,U){R.parent=D,Object.defineProperty(R,"zOrder",{value:U,writable:!1,configurable:!0});},R.disconnect=function(D){delete R.zOrder;},R.canvas=R,R.getResolution=function(){return{width:0,height:0};},R.setResolution=function(){return!1;},R.options={handleEvent:!1},R;}function S(R,D){var U=R.children;var M=null;for(var W=0;W<U.length;W++){var X=U[W];if((D===X||M!=null)&&(M=X),M&&M!==D&&!M.offscreen)return M.canvas;}return null;}function O(R,D){var _R$renderOffset=_slicedToArray(R.renderOffset,2),U=_R$renderOffset[0],M=_R$renderOffset[1],_R$getResolution=R.getResolution(),W=_R$getResolution.width,X=_R$getResolution.height,B=R.displayRatio;R.renderer.drawImage(D.canvas,-U/B,-M/B,W/B,X/B);}var d={};function v(R){var D=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],U=R.container;U.addEventListener("mouseleave",function(M){var W=R[w];if(W.size){var X=new u["default"]("mouseleave");X.setOriginalEvent(M),_toConsumableArray(W).forEach(function(B){B.dispatchEvent(X);}),R[w].clear();}},{passive:!0}),D.forEach(function(M){U.addEventListener(M,function(W){var _R$options=R.options,X=_R$options.left,B=_R$options.top,N=_R$options.displayRatio,$=R.orderedChildren;Object(m["default"])(W,{offsetLeft:X,offsetTop:B,displayRatio:N}).forEach(function(tt){var at=tt.identifier;if(tt.type==="touchmove"||tt.type==="touchend"){var V=d[at];V&&V.dispatchEvent(tt),tt.type==="touchend"&&delete d[at];}else{for(var _V=$.length-1;_V>=0;_V--){var Q=$[_V];if(Q.options.handleEvent!==!1){if(Q.dispatchPointerEvent(tt)&&tt.target!==Q)break;tt.cancelBubble=!1;}}if(tt.target===$[0])for(var _V2=$.length-1;_V2>=0;_V2--){var _Q=$[_V2];if(_Q.options.handleEvent!==!1){tt.target=_Q;break;}}}var ut=tt.target;if(tt.type==="touchstart"&&(d[at]=tt.target),tt.type==="mousemove"){var _V3=R[w];var _Q2;if(ut){var yt=ut.ancestors||[];_Q2=/* @__PURE__ */new Set([ut].concat(_toConsumableArray(yt)));}else _Q2=/* @__PURE__ */new Set();var ft=Object.entries(W);if(!_V3.has(ut)&&ut){var _yt2=new u["default"]("mouseenter");_yt2.setOriginalEvent(W),ft.forEach(function(_ref156){var _ref157=_slicedToArray(_ref156,2),ht=_ref157[0],Nt=_ref157[1];_yt2[ht]=Nt;}),_V3.add(ut),ut.dispatchEvent(_yt2);var wt=ut.ancestors;wt&&wt.forEach(function(ht){ht instanceof c["default"]&&!_V3.has(ht)&&(_V3.add(ht),ht.dispatchEvent(_yt2));});}var mt=new u["default"]("mouseleave");mt.setOriginalEvent(W),ft.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),yt=_ref159[0],wt=_ref159[1];mt[yt]=wt;}),_toConsumableArray(_V3).forEach(function(yt){_Q2.has(yt)||(_V3["delete"](yt),yt.dispatchEvent(mt));});}});},{passive:M!=="contextmenu"});});}function p(R,D){if(D&&D.style){var U=R.width,M=R.height,W=R.mode,X=R.container;var B=X.clientWidth,N=X.clientHeight;U=U||B,M=M||N,W==="static"?(D.style.width="".concat(U,"px"),D.style.height="".concat(M,"px")):(D.style.top="0",D.style.left="0",D.style.width="".concat(B,"px"),D.style.height="".concat(N,"px"),D.style.transform="",D.style.webkitTransform="");}}var x=Symbol("offscreenLayerCount");var E=/*#__PURE__*/function(_h$default){/**
|
|
361
|
+
width
|
|
362
|
+
height
|
|
363
|
+
mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
|
|
364
|
+
*/function E(){var _this44;var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,E);if(_this44=_callSuper(this,E),!D.container)if(typeof n.ENV.Container=="function")D.container=new n.ENV.Container(D.width||300,D.height||150);else throw new Error("No container specified.");if(_this44.container=D.container,_this44.container.style&&(_this44.container.style.overflow||(_this44.container.style.overflow="hidden"),_this44.container.style.position||(_this44.container.style.position="relative")),_this44.options=D,D.displayRatio=D.displayRatio||1,D.mode=D.mode||"scale",D.left=0,D.top=0,D.autoResize=D.autoResize!==!1,D.autoResize){var U;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?U=globalThis:U=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:r,U.addEventListener){var M=_this44;U.addEventListener("resize",function W(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(M.container)?M.resize():U.removeEventListener("resize",W);});}}_this44[w]=/* @__PURE__ */new Set(),_this44.setResolution(D),v(_this44),_this44[x]=0;return _this44;}_inherits(E,_h$default);return _createClass(E,[{key:"hasOffscreenCanvas",get:function get(){return this[x]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(D){this.options.displayRatio!==D&&(this.options.displayRatio=D,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(D){this.options.height!==D&&(this.options.height=D,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(D){this.options.mode!==D&&(this.options.mode=D,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(D){this.options.width!==D&&(this.options.width=D,this.resize());}},{key:"appendChild",value:function appendChild(D){!(D instanceof l["default"])&&!(D instanceof f["default"])&&I(D);var U=_superPropGet(E,"appendChild",this,3)([D]),M=D.canvas;return D.offscreen?this[x]++:this.container.appendChild(M),p(this.options,M),D.setResolution(this.getResolution()),U;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this45=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(s.requestAnimationFrame)(function(){delete _this45._requestID,_this45.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(D,U){!(D instanceof l["default"])&&!(D instanceof f["default"])&&I(D);var M=_superPropGet(E,"insertBefore",this,3)([D,U]),W=D.canvas;if(!D.offscreen){var X=S(this,D);this.container.insertBefore(W,X);}return p(this.options,W),D.setResolution(this.getResolution()),M;}},{key:"layer",value:function layer(){var D=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var U=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};U=Object.assign({},this.options,U),U.id=D;var M=this.orderedChildren;for(var B=0;B<M.length;B++)if(M[B].id===D)return M[B];var W=U.worker;var X;return W?X=new f["default"](U):X=new l["default"](U),this.appendChild(X),X;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _this46=this;var _len13,D,_key13,U,M,W,_loop2,X,_args11=arguments;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:for(_len13=_args11.length,D=new Array(_len13),_key13=0;_key13<_len13;_key13++){D[_key13]=_args11[_key13];}U=[],M=[],W=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(X){var B,N,$,J;return _regeneratorRuntime().wrap(function _loop2$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:B=D[X];if(typeof B=="string")N=Object(y.loadTexture)(B);else if(Array.isArray(B))N=Object(y.loadFrames).apply(void 0,_toConsumableArray(B));else{$=B.id,J=B.src;N=Object(y.loadTexture)(J,$);}N instanceof Promise||(N=Promise.resolve(N)),M.push(N.then(function($){U.push($),W[X]=$;var J=new u["default"]({type:"preload",detail:{current:$,loaded:U,resources:D}});_this46.dispatchEvent(J);}));case 3:case"end":return _context10.stop();}},_loop2);});X=0;case 4:if(!(X<D.length)){_context11.next=9;break;}return _context11.delegateYield(_loop2(X),"t0",6);case 6:X++;_context11.next=4;break;case 9:_context11.next=11;return Promise.all(M);case 11:return _context11.abrupt("return",W);case 12:case"end":return _context11.stop();}},_callee10);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(D){var U=_superPropGet(E,"removeChild",this,3)([D]);if(U){D._prepareRenderFinished&&D._prepareRenderFinished();var M=D.canvas;M&&M.remove&&M.remove(),D.offscreen&&this[x]--;}return U;}// for offscreen mode rendering
|
|
365
|
+
},{key:"render",value:function render(){var D=this.orderedChildren;var U=null;var M=[];for(var W=0;W<D.length;W++){var X=D[W],B=M.length>0;if(X instanceof l["default"]&&!X.offscreen){if(!X.autoRender)B&&(console.warn("Some offscreen canvas will not be rendered."),M.length=0);else if(U=X,B){X.renderer.clear();for(var N=0;N<M.length;N++){var $=M[N];$.render(),O(X,$);}M.length=0,X.render({clear:!1});}else X.prepareRender&&X.render();}else X.offscreen?U?(X.prepareRender&&X.render(),O(U,X)):M.push(X):X instanceof f["default"]&&B&&(console.warn("Some offscreen canvas will not be rendered."),M.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(D,U){var M=_superPropGet(E,"replaceChild",this,3)([D,U]);U.canvas.remove&&U.canvas.remove(),U.offscreen&&this[x]--;var W=D.canvas;if(!D.offscreen){var X=S(this,D);this.container.insertBefore(W,X);}return p(this.options,W),D.setResolution(this.getResolution()),M;}},{key:"resize",value:function resize(){var D=this.options;this.children.forEach(function(U){p(D,U.canvas);}),this.setResolution(D),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _D4,_U10;var _ref160=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},D=_ref160.width,U=_ref160.height;var M=this.container,W=M.clientWidth,X=M.clientHeight;(D==null||U==null)&&(D=(_D4=D)!==null&&_D4!==void 0?_D4:W,U=(_U10=U)!==null&&_U10!==void 0?_U10:X);var _this$options=this.options,B=_this$options.mode,N=_this$options.displayRatio;if(D*=N,U*=N,this.options.left=0,this.options.top=0,B==="stickyHeight"||B==="stickyLeft"||B==="stickyRight"){var $=D;D=W*U/X,B==="stickyHeight"&&(this.options.left=0.5*(D-$)),B==="stickyRight"&&(this.options.left=D-$);}else if(B==="stickyWidth"||B==="stickyTop"||B==="stickyBottom"){var _$4=U;U=X*D/W,B==="stickyWidth"&&(this.options.top=0.5*(U-_$4)),B==="stickyBottom"&&(this.options.top=U-_$4);}_superPropGet(E,"setResolution",this,3)([{width:D,height:U}]);}},{key:"snapshot",value:function snapshot(){var _ref161=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref161$offscreen=_ref161.offscreen,D=_ref161$offscreen===void 0?!1:_ref161$offscreen,U=_ref161.layers;var M=D?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),W=_this$getResolution9.width,X=_this$getResolution9.height;this[M]=this[M]||n.ENV.createCanvas(W,X,{offscreen:D});var B=this[M].getContext("2d");U=U||this.orderedChildren,this[M].width=W,this[M].height=X;for(var N=0;N<U.length;N++){var $=U[N];if(!$.options.ignoreSnapshot){$.render&&$.render();var J=$.canvas;J&&J!==$&&B.drawImage(J,0,0,W,X);}}return this[M];}}]);}(h["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(E.prototype.layer3d=function(R){var _this47=this;var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var U=D.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(M,W){var X=document.createElement("script");X.async=!1,X.src=U,X.onload=function(){try{M(_this47.layer3d(R,D));}catch(B){W(B);}},document.documentElement.appendChild(X);});}),T["default"].registerNode(E,"scene");}.call(this,t(22));},/* 291 *//***/function(i,e,t){t.r(e),t.d(e,"default",function(){return n;});var r=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(s){var _ref162=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref162$offsetTop=_ref162.offsetTop,c=_ref162$offsetTop===void 0?0:_ref162$offsetTop,_ref162$offsetLeft=_ref162.offsetLeft,l=_ref162$offsetLeft===void 0?0:_ref162$offsetLeft,_ref162$displayRatio=_ref162.displayRatio,f=_ref162$displayRatio===void 0?1:_ref162$displayRatio;var h,m;var u=[],_s$target$getBounding=s.target.getBoundingClientRect(),y=_s$target$getBounding.left,T=_s$target$getBounding.top,w=_s$target$getBounding.width,I=_s$target$getBounding.height,S=s.target.width,O=s.target.height,d=s.changedTouches||[s];for(var p=0;p<d.length;p++){var x=d[p],E=x.identifier,R=x.clientX,D=x.clientY;R!=null&&D!=null&&u.push({x:Math.round((R|0)-y),y:Math.round((D|0)-T),identifier:E});}u.length<=0&&u.push({x:h,y:m});var v=[];return u.forEach(function(p){p.x!=null&&p.y!=null&&(h=(p.x*S/w-l)/f,m=(p.y*O/I-c)/f);var x=new r["default"](s);Object.defineProperties(x,{layerX:{value:h,configurable:!0},layerY:{value:m,configurable:!0},originalX:{value:p.x},originalY:{value:p.y},x:{value:h,configurable:!0},y:{value:m,configurable:!0},identifier:{value:p.identifier}}),v.push(x);}),v;}}/******/]);be.version;be.Arc;be.Block;be.Cloud;be.Color;var t1=be.Ellipse;be.Gradient;var cr=be.Group,e1=be.Label,il=be.Layer;be.LayerWorker;be.Node;be.Parallel;var Mn=be.Path,dn=be.Polyline,sl=be.Rect;be.Regular;be.Ring;var zu=be.Scene,$u=be.Sprite;be.SpriteSvg;be.Star;be.Triangle;be.helpers;be.createElement;be.isSpriteNode;be.registerNode;be.requestAnimationFrame;be.cancelAnimationFrame;be.ENV;var Ae=/* @__PURE__ */function(i){return i.Normal="Normal",i.Stroke="Stroke",i.Dotted="Dotted",i.LongDotted="LongDotted",i;}(Ae||{}),pe=/* @__PURE__ */function(i){return i.None="None",i.ShowFloatBar="ShowFloatBar",i.ZIndexFloatBar="ZIndexFloatBar",i.DeleteNode="DeleteNode",i.CopyNode="CopyNode",i.ZIndexNode="ZIndexNode",i.ZIndexBackgroundSVG="ZIndexBackgroundSVG",i.RotateNode="RotateNode",i.SetColorNode="SetColorNode",i.TranslateNode="TranslateNode",i.ScaleNode="ScaleNode",i.OriginalEvent="OriginalEvent",i.CreateScene="CreateScene",i.ActiveCursor="ActiveCursor",i.MoveCursor="MoveCursor",i.CommandEditor="CommandEditor",i.SetEditorData="SetEditorData",i.SetFontStyle="SetFontStyle",i.SetPoint="SetPoint",i.SetLock="SetLock",i.SetShapeOpt="SetShapeOpt",i.CameraChange="CameraChange",i.ActiveMethod="ActiveMethod",i.HidFloatBarBtn="HidFloatBarBtn",i;}(pe||{}),Tt=/* @__PURE__ */function(i){return i[i.Pencil=1]="Pencil",i[i.Eraser=2]="Eraser",i[i.PencilEraser=3]="PencilEraser",i[i.BitMapEraser=4]="BitMapEraser",i[i.Selector=5]="Selector",i[i.Clicker=6]="Clicker",i[i.Arrow=7]="Arrow",i[i.Hand=8]="Hand",i[i.LaserPen=9]="LaserPen",i[i.Text=10]="Text",i[i.Straight=11]="Straight",i[i.Rectangle=12]="Rectangle",i[i.Ellipse=13]="Ellipse",i[i.Star=14]="Star",i[i.Triangle=15]="Triangle",i[i.Rhombus=16]="Rhombus",i[i.Polygon=17]="Polygon",i[i.SpeechBalloon=18]="SpeechBalloon",i[i.Image=19]="Image",i[i.BackgroundSVG=20]="BackgroundSVG",i;}(Tt||{}),Kt=/* @__PURE__ */function(i){return i[i.Local=1]="Local",i[i.Service=2]="Service",i[i.Worker=3]="Worker",i;}(Kt||{}),te=/* @__PURE__ */function(i){return i[i.Pending=0]="Pending",i[i.Start=1]="Start",i[i.Doing=2]="Doing",i[i.Done=3]="Done",i[i.Unwritable=4]="Unwritable",i;}(te||{}),gt=/* @__PURE__ */function(i){return i[i.None=0]="None",i[i.Init=1]="Init",i[i.UpdateCamera=2]="UpdateCamera",i[i.UpdateTools=3]="UpdateTools",i[i.CreateWork=4]="CreateWork",i[i.DrawWork=5]="DrawWork",i[i.FullWork=6]="FullWork",i[i.UpdateNode=7]="UpdateNode",i[i.RemoveNode=8]="RemoveNode",i[i.Clear=9]="Clear",i[i.Select=10]="Select",i[i.Destroy=11]="Destroy",i[i.Snapshot=12]="Snapshot",i[i.BoundingBox=13]="BoundingBox",i[i.Cursor=14]="Cursor",i[i.TextUpdate=15]="TextUpdate",i[i.GetTextActive=16]="GetTextActive",i[i.TasksQueue=17]="TasksQueue",i[i.CursorHover=18]="CursorHover",i[i.CursorBlur=19]="CursorBlur",i[i.Console=20]="Console",i[i.GetImageBitMap=23]="GetImageBitMap",i[i.AuthWriter=24]="AuthWriter",i[i.AuthReader=25]="AuthReader",i[i.AuthClear=26]="AuthClear",i[i.AuthPage=27]="AuthPage",i[i.GetVNodeInfo=28]="GetVNodeInfo",i[i.UpdateDpr=29]="UpdateDpr",i[i.SetFontFace=30]="SetFontFace",i[i.ReportError=31]="ReportError",i[i.ReportLog=32]="ReportLog",i[i.BackgroundSVGUpdate=33]="BackgroundSVGUpdate",i[i.BackgroundSVGDelete=34]="BackgroundSVGDelete",i;}(gt||{}),Ut=/* @__PURE__ */function(i){return i[i.None=0]="None",i[i.Bg=1]="Bg",i[i.ServiceFloat=2]="ServiceFloat",i[i.Float=3]="Float",i[i.TopFloat=4]="TopFloat",i;}(Ut||{}),Ce=/* @__PURE__ */function(i){return i[i.none=1]="none",i[i.all=2]="all",i[i.both=3]="both",i[i.proportional=4]="proportional",i;}(Ce||{}),Tr=/* @__PURE__ */function(i){return i[i.inside=0]="inside",i[i.outside=1]="outside",i[i.intersect=2]="intersect",i;}(Tr||{}),vo=/* @__PURE__ */function(i){return i.Image="image",i.Iconify="iconify",i;}(vo||{});var qr=/*#__PURE__*/function(){function qr(){_classCallCheck(this,qr);dt(this,"localWork");dt(this,"serviceWork");dt(this,"threadEngine");}return _createClass(qr,[{key:"registerForWorker",value:function registerForWorker(e){return this.threadEngine=e,this.localWork=e.localWork,this.serviceWork=e.serviceWork,this;}}]);}();var r1=/*#__PURE__*/function(_qr){function r1(){var _this48;_classCallCheck(this,r1);_this48=_callSuper(this,r1,arguments);dt(_this48,"emitEventType",pe.CopyNode);return _this48;}_inherits(r1,_qr);return _createClass(r1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.FullWork&&n===Kt.Local&&s===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(_x27){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(qr);var yi="++",Me="selector",n1="all";var i1=/*#__PURE__*/function(_qr2){function i1(){var _this49;_classCallCheck(this,i1);_this49=_callSuper(this,i1,arguments);dt(_this49,"emitEventType",pe.SetColorNode);return _this49;}_inherits(i1,_qr2);return _createClass(i1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(t){var m,r,n,s,c,l,f,h;return _regeneratorRuntime().wrap(function _callee12$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker,h=t.needUndoTicker;_context13.t0=r===Me&&n;if(!_context13.t0){_context13.next=5;break;}_context13.next=5;return(m=this.localWork)==null?void 0:m.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,textUpdateForWoker:f,callback:this.updateSelectorCallback,needUndoTicker:h});case 5:case"end":return _context13.stop();}},_callee12,this);}));function consumeForLocalWorker(_x28){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=r.willSyncService,l=r.isSync,f=r.textUpdateForWoker,h=r.needUndoTicker,m=n.render||[],u=n.sp||[];if(c){var _iterator3=_createForOfIteratorHelper(s.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),y=_step3$value[0],T=_step3$value[1];f&&T.toolsType===Tt.Text?u.push(_objectSpread(_objectSpread({},T),{},{workId:y,type:gt.TextUpdate,dataType:Kt.Local,willSyncService:!0})):u.push(_objectSpread(_objectSpread({},T),{},{workId:y,type:gt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}return h&&u.push({type:gt.None,needUndoTicker:h}),{render:m,sp:u};}}]);}(qr);var s1=/*#__PURE__*/function(_qr3){function s1(){var _this50;_classCallCheck(this,s1);_this50=_callSuper(this,s1,arguments);dt(_this50,"emitEventType",pe.ZIndexNode);return _this50;}_inherits(s1,_qr3);return _createClass(s1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(t){var f,r,n,s,c,l;return _regeneratorRuntime().wrap(function _callee13$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData;_context14.t0=r===Me&&n;if(!_context14.t0){_context14.next=5;break;}_context14.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,callback:this.updateSelectorCallback});case 5:case"end":return _context14.stop();}},_callee13,this);}));function consumeForLocalWorker(_x29){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=r.willSyncService,l=r.isSync,f=n.render||[],h=n.sp||[];if(c&&h){var _iterator4=_createForOfIteratorHelper(s.entries()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),m=_step4$value[0],u=_step4$value[1];u.toolsType===Tt.BackgroundSVG&&h.push(_objectSpread(_objectSpread({},u),{},{workId:m,type:gt.BackgroundSVGUpdate,dataType:Kt.Local,updateNodeOpt:{useAnimation:!1}})),h.push(_objectSpread(_objectSpread({},u),{},{workId:m,type:gt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}}return{render:f,sp:h};}}]);}(qr);var o1=/*#__PURE__*/function(_qr4){function o1(){var _this51;_classCallCheck(this,o1);_this51=_callSuper(this,o1,arguments);dt(_this51,"emitEventType",pe.TranslateNode);return _this51;}_inherits(o1,_qr4);return _createClass(o1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(t){var y,T,r,n,s,c,l,f,h,m,u;return _regeneratorRuntime().wrap(function _callee14$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker,h=t.emitEventType,m=t.smoothSync,u=t.needUndoTicker;_context15.t0=r===Me&&n;if(!_context15.t0){_context15.next=9;break;}if(!(n.workState===te.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==te.Done)){_context15.next=8;break;}_context15.next=6;return(y=this.localWork)==null?void 0:y.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,isSync:!0,textUpdateForWoker:f,emitEventType:h,callback:this.updateSelectorCallback,smoothSync:m,needUndoTicker:u});case 6:_context15.next=9;break;case 8:n.workState===te.Done&&((T=this.localWork)==null||T.vNodes.deleteLastTarget());case 9:case"end":return _context15.stop();}},_callee14,this);}));function consumeForLocalWorker(_x30){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=t.smoothSync,h=r.willSyncService,m=r.isSync,u=r.updateSelectorOpt,y=r.textUpdateForWoker,T=r.needUndoTicker,w=u.workState,I=n.render||[],S=n.sp||[];if(w===te.Start)return{sp:[],render:[]};var O=l==null?void 0:l.selectRect;if(h){S.push({type:gt.Select,selectIds:c.selectIds,selectRect:O,willSyncService:w===te.Done?!0:f,isSync:!0,points:w===te.Done&&c.getChildrenPoints()||void 0,textOpt:c.textOpt});var _d27={useAnimation:u.useAnimation||!1};u.uid&&(_d27.uid=u.uid);var _iterator5=_createForOfIteratorHelper(s.entries()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _step5$value=_slicedToArray(_step5.value,2),v=_step5$value[0],p=_step5$value[1];p.toolsType===Tt.BackgroundSVG&&S.push(_objectSpread(_objectSpread({},p),{},{workId:v,type:gt.BackgroundSVGUpdate,dataType:Kt.Local,willSyncService:w===te.Done?!0:f,updateNodeOpt:_d27})),y&&p.toolsType===Tt.Text?S.push(_objectSpread(_objectSpread({},p),{},{workId:v,type:gt.TextUpdate,dataType:Kt.Local,willSyncService:w===te.Done?!0:f,updateNodeOpt:_d27})):(f||w===te.Done)&&S.push(_objectSpread(_objectSpread({},p),{},{workId:v,type:gt.UpdateNode,updateNodeOpt:_d27,isSync:m}));}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}return T&&S.push({type:gt.None,needUndoTicker:T}),{render:I,sp:S};}}]);}(qr);var a1=/*#__PURE__*/function(_qr5){function a1(){var _this52;_classCallCheck(this,a1);_this52=_callSuper(this,a1,arguments);dt(_this52,"emitEventType",pe.ScaleNode);return _this52;}_inherits(a1,_qr5);return _createClass(a1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(t){var h,r,n,s,c,l,f;return _regeneratorRuntime().wrap(function _callee15$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willSyncService,c=t.willSerializeData,l=t.smoothSync,f=t.needUndoTicker;_context16.t0=r===Me&&n;if(!_context16.t0){_context16.next=5;break;}_context16.next=5;return(h=this.localWork)==null?void 0:h.updateSelector({updateSelectorOpt:n,willSyncService:s,willSerializeData:c,isSync:!0,callback:this.updateSelectorCallback.bind(this),smoothSync:l,needUndoTicker:f});case 5:case"end":return _context16.stop();}},_callee15,this);}));function consumeForLocalWorker(_x31){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.workShapeNode,c=t.res,l=t.newServiceStore,f=t.smoothSync,h=r.updateSelectorOpt,m=r.willSyncService,u=r.needUndoTicker,y=h.workState,T=n.render||[],w=n.sp||[],I=c==null?void 0:c.selectRect;if(y===te.Start)return{sp:[],render:[]};if(m){w.push({type:gt.Select,selectIds:s.selectIds,selectRect:I,willSyncService:y===te.Done?!0:f,isSync:!0,points:y===te.Done&&s.getChildrenPoints()||void 0,textOpt:s.textOpt});var S={useAnimation:h.useAnimation||!1};h.uid&&(S.uid=h.uid);var _iterator6=_createForOfIteratorHelper(l.entries()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),_O29=_step6$value[0],_d28=_step6$value[1];_d28.toolsType===Tt.BackgroundSVG&&w.push(_objectSpread(_objectSpread({},_d28),{},{workId:_O29,type:gt.BackgroundSVGUpdate,dataType:Kt.Local,willSyncService:y===te.Done?!0:f,updateNodeOpt:S})),_d28.toolsType===Tt.Text?w.push(_objectSpread(_objectSpread({},_d28),{},{workId:_O29,type:gt.TextUpdate,dataType:Kt.Local,willSyncService:y===te.Done?!0:f,updateNodeOpt:S})):(f||y===te.Done)&&w.push(_objectSpread(_objectSpread({},_d28),{},{workId:_O29,type:gt.UpdateNode,updateNodeOpt:S,isSync:!0}));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}return u&&w.push({type:gt.None,needUndoTicker:u}),{render:T,sp:w};}}]);}(qr);var l1=/*#__PURE__*/function(_qr6){function l1(){var _this53;_classCallCheck(this,l1);_this53=_callSuper(this,l1,arguments);dt(_this53,"emitEventType",pe.RotateNode);return _this53;}_inherits(l1,_qr6);return _createClass(l1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(t){var u,r,n,s,c,l,f,h,m;return _regeneratorRuntime().wrap(function _callee16$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.emitEventType,h=t.smoothSync,m=t.needUndoTicker;_context17.t0=r===Me&&n;if(!_context17.t0){_context17.next=5;break;}_context17.next=5;return(u=this.localWork)==null?void 0:u.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,emitEventType:f,isSync:!0,callback:this.updateSelectorCallback,smoothSync:h,needUndoTicker:m});case 5:case"end":return _context17.stop();}},_callee16,this);}));function consumeForLocalWorker(_x32){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.workShapeNode,c=t.res,l=t.newServiceStore,f=t.smoothSync,h=r.updateSelectorOpt,m=r.willSyncService,u=r.willSerializeData,y=r.isSync,T=r.needUndoTicker,w=h.workState,I=n.render||[],S=n.sp||[],O=c==null?void 0:c.selectRect;if(m){u&&w===te.Done&&S.push({type:gt.Select,selectIds:s.selectIds,selectRect:O,willSyncService:!0,isSync:y,points:s.getChildrenPoints(),textOpt:s.textOpt,selectorColor:s.selectorColor,strokeColor:s.strokeColor,fillColor:s.fillColor,canTextEdit:s.canTextEdit,canRotate:s.canRotate,scaleType:s.scaleType,opt:s.getWorkOptions()||void 0,canLock:s.canLock,isLocked:s.isLocked,toolsTypes:s.toolsTypes,shapeOpt:s.shapeOpt,thickness:s.thickness,useStroke:s.useStroke,strokeType:s.strokeType});var _d29={useAnimation:h.useAnimation||!1};if(h.uid&&(_d29.uid=h.uid),f||w===te.Done){var _iterator7=_createForOfIteratorHelper(l.entries()),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray(_step7.value,2),v=_step7$value[0],p=_step7$value[1];S.push(_objectSpread(_objectSpread({},p),{},{workId:v,type:gt.UpdateNode,updateNodeOpt:_d29,isSync:y}));}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}}return T&&S.push({type:gt.None,needUndoTicker:T}),{render:I,sp:S};}}]);}(qr);var f1=/*#__PURE__*/function(_qr7){function f1(){var _this54;_classCallCheck(this,f1);_this54=_callSuper(this,f1,arguments);dt(_this54,"emitEventType",pe.SetFontStyle);return _this54;}_inherits(f1,_qr7);return _createClass(f1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(t){var h,r,n,s,c,l,f;return _regeneratorRuntime().wrap(function _callee17$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker;_context18.t0=r===Me&&n;if(!_context18.t0){_context18.next=5;break;}_context18.next=5;return(h=this.localWork)==null?void 0:h.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,textUpdateForWoker:f,callback:this.updateSelectorCallback});case 5:case"end":return _context18.stop();}},_callee17,this);}));function consumeForLocalWorker(_x33){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=r.willSyncService,h=r.isSync,m=r.updateSelectorOpt,u=r.textUpdateForWoker,y=n.render||[],T=n.sp||[],w=l==null?void 0:l.selectRect;if(f&&T){m.fontSize&&T.push({type:gt.Select,selectIds:c.selectIds,selectRect:w,willSyncService:f,isSync:h,points:c.getChildrenPoints()});var _iterator8=_createForOfIteratorHelper(s.entries()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),I=_step8$value[0],S=_step8$value[1];u&&S.toolsType===Tt.Text?T.push(_objectSpread(_objectSpread({},S),{},{workId:I,type:gt.TextUpdate,dataType:Kt.Local,willSyncService:!0})):T.push(_objectSpread(_objectSpread({},S),{},{workId:I,type:gt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}));}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}return{render:y,sp:T};}}]);}(qr);var c1=/*#__PURE__*/function(_qr8){function c1(){var _this55;_classCallCheck(this,c1);_this55=_callSuper(this,c1,arguments);dt(_this55,"emitEventType",pe.SetPoint);return _this55;}_inherits(c1,_qr8);return _createClass(c1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(t){var m,r,n,s,c,l,f,h;return _regeneratorRuntime().wrap(function _callee18$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.textUpdateForWoker,h=t.needUndoTicker;_context19.t0=r===Me&&n;if(!_context19.t0){_context19.next=5;break;}_context19.next=5;return(m=this.localWork)==null?void 0:m.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,emitEventType:this.emitEventType,willSerializeData:l,isSync:!0,textUpdateForWoker:f,callback:this.updateSelectorCallback,needUndoTicker:h});case 5:case"end":return _context19.stop();}},_callee18,this);}));function consumeForLocalWorker(_x34){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=r.willSyncService,h=r.isSync,m=r.needUndoTicker,u=n.render||[],y=n.sp||[],T=l==null?void 0:l.selectRect;if(f&&y){var _iterator9=_createForOfIteratorHelper(s.entries()),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _step9$value=_slicedToArray(_step9.value,2),w=_step9$value[0],I=_step9$value[1];y.push(_objectSpread(_objectSpread({},I),{},{workId:w,type:gt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}));}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}y.push({type:gt.Select,selectIds:c.selectIds,selectRect:T,willSyncService:f,isSync:h,points:c.getChildrenPoints()});}return m&&y.push({type:gt.None,needUndoTicker:m}),{render:u,sp:y};}}]);}(qr);var u1=/*#__PURE__*/function(_qr9){function u1(){var _this56;_classCallCheck(this,u1);_this56=_callSuper(this,u1,arguments);dt(_this56,"emitEventType",pe.SetLock);return _this56;}_inherits(u1,_qr9);return _createClass(u1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(t){var h,r,n,s,c,l,f;return _regeneratorRuntime().wrap(function _callee19$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.needUndoTicker;_context20.t0=r===Me&&n;if(!_context20.t0){_context20.next=5;break;}_context20.next=5;return(h=this.localWork)==null?void 0:h.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,callback:this.updateSelectorCallback,needUndoTicker:f});case 5:case"end":return _context20.stop();}},_callee19,this);}));function consumeForLocalWorker(_x35){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=t.workShapeNode,l=t.res,f=r.willSyncService,h=r.isSync,m=r.updateSelectorOpt,u=r.needUndoTicker,y=n.render||[],T=n.sp||[],w=l==null?void 0:l.selectRect;if(f&&T){var _iterator10=_createForOfIteratorHelper(s.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),I=_step10$value[0],S=_step10$value[1];T.push(_objectSpread(_objectSpread({},S),{},{workId:I,type:gt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:h}));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}T.push({isLocked:m.isLocked,selectorColor:c.selectorColor,scaleType:c.scaleType,canRotate:c.canRotate,type:gt.Select,selectIds:c.selectIds,selectRect:w,willSyncService:f,isSync:h});}return u&&T.push({type:gt.None,needUndoTicker:u}),{render:y,sp:T};}}]);}(qr);var h1=/*#__PURE__*/function(_qr10){function h1(){var _this57;_classCallCheck(this,h1);_this57=_callSuper(this,h1,arguments);dt(_this57,"emitEventType",pe.SetShapeOpt);return _this57;}_inherits(h1,_qr10);return _createClass(h1,[{key:"consume",value:function consume(t){var r=t.msgType,n=t.dataType,s=t.emitEventType;if(r===gt.UpdateNode&&n===Kt.Local&&s===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(t){var h,r,n,s,c,l,f;return _regeneratorRuntime().wrap(function _callee20$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:r=t.workId,n=t.updateNodeOpt,s=t.willRefreshSelector,c=t.willSyncService,l=t.willSerializeData,f=t.needUndoTicker;_context21.t0=r===Me&&n;if(!_context21.t0){_context21.next=5;break;}_context21.next=5;return(h=this.localWork)==null?void 0:h.updateSelector({updateSelectorOpt:n,willRefreshSelector:s,willSyncService:c,willSerializeData:l,callback:this.updateSelectorCallback,needUndoTicker:f});case 5:case"end":return _context21.stop();}},_callee20,this);}));function consumeForLocalWorker(_x36){return _consumeForLocalWorker10.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var r=t.param,n=t.postData,s=t.newServiceStore,c=r.willSyncService,l=r.isSync,f=r.needUndoTicker,h=n.render||[],m=n.sp||[];if(c&&m){var _iterator11=_createForOfIteratorHelper(s.entries()),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var _step11$value=_slicedToArray(_step11.value,2),u=_step11$value[0],y=_step11$value[1];m.push(_objectSpread(_objectSpread({},y),{},{workId:u,type:gt.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}}return f&&m.push({type:gt.None,needUndoTicker:f}),{render:h,sp:m};}}]);}(qr);var ju=/*#__PURE__*/function(){function ju(e){var _this58=this;_classCallCheck(this,ju);dt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(e.map(function(t){return[t,_this58.build(t)];}));}return _createClass(ju,[{key:"build",value:function build(e){switch(e){case pe.TranslateNode:return new o1();case pe.ZIndexNode:return new s1();case pe.CopyNode:return new r1();case pe.SetColorNode:return new i1();case pe.ScaleNode:return new a1();case pe.RotateNode:return new l1();case pe.SetFontStyle:return new f1();case pe.SetPoint:return new c1();case pe.SetLock:return new u1();case pe.SetShapeOpt:return new h1();}}},{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 d1={linear:function linear(i){return i;},easeInQuad:function easeInQuad(i){return i*i;},easeOutQuad:function easeOutQuad(i){return i*(2-i);},easeInOutQuad:function easeInOutQuad(i){return i<0.5?2*i*i:-1+(4-2*i)*i;},easeInCubic:function easeInCubic(i){return i*i*i;},easeOutCubic:function easeOutCubic(i){return--i*i*i+1;},easeInOutCubic:function easeInOutCubic(i){return i<0.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1;},easeInQuart:function easeInQuart(i){return i*i*i*i;},easeOutQuart:function easeOutQuart(i){return 1- --i*i*i*i;},easeInOutQuart:function easeInOutQuart(i){return i<0.5?8*i*i*i*i:1-8*--i*i*i*i;},easeInQuint:function easeInQuint(i){return i*i*i*i*i;},easeOutQuint:function easeOutQuint(i){return 1+--i*i*i*i*i;},easeInOutQuint:function easeInOutQuint(i){return i<0.5?16*i*i*i*i*i:1+16*--i*i*i*i*i;},easeInSine:function easeInSine(i){return 1-Math.cos(i*Math.PI/2);},easeOutSine:function easeOutSine(i){return Math.sin(i*Math.PI/2);},easeInOutSine:function easeInOutSine(i){return-(Math.cos(Math.PI*i)-1)/2;},easeInExpo:function easeInExpo(i){return i<=0?0:Math.pow(2,10*i-10);},easeOutExpo:function easeOutExpo(i){return i>=1?1:1-Math.pow(2,-10*i);},easeInOutExpo:function easeInOutExpo(i){return i<=0?0:i>=1?1:i<0.5?Math.pow(2,20*i-10)/2:(2-Math.pow(2,-20*i+10))/2;}};var pt=/*#__PURE__*/function(){function pt(){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,pt);this.x=e,this.y=t,this.z=r;}return _createClass(pt,[{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),s=Math.cos(e);return this.x=t*s-r*n,this.y=t*n+r*s,this;}},{key:"rotWith",value:function rotWith(e,t){if(t===0)return this;var r=this.x-e.x,n=this.y-e.y,s=Math.sin(t),c=Math.cos(t);return this.x=e.x+(r*c-n*s),this.y=e.y+(r*s+n*c),this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z;return new pt(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=pt.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 pt.Dpr(this,e);}},{key:"cpr",value:function cpr(e){return pt.Cpr(this,e);}},{key:"len2",value:function len2(){return pt.Len2(this);}},{key:"len",value:function len(){return pt.Len(this);}},{key:"pry",value:function pry(e){return pt.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 pt.Uni(this);}},{key:"tan",value:function tan(e){return pt.Tan(this,e);}},{key:"dist",value:function dist(e){return pt.Dist(this,e);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(e,t){return pt.DistanceToLineSegment(e,t,this);}},{key:"slope",value:function slope(e){return pt.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 pt.Angle(this,e);}},{key:"toAngle",value:function toAngle(){return pt.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 pt.Equals(this,e,t);}},{key:"equalsXY",value:function equalsXY(e,t){return pt.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 pt.ToFixed(this);}},{key:"toString",value:function toString(){return pt.ToString(pt.ToFixed(this));}},{key:"toJson",value:function toJson(){return pt.ToJson(this);}},{key:"toArray",value:function toArray(){return pt.ToArray(this);}}],[{key:"Add",value:function Add(e,t){return new pt(e.x+t.x,e.y+t.y);}},{key:"AddXY",value:function AddXY(e,t,r){return new pt(e.x+t,e.y+r);}},{key:"Sub",value:function Sub(e,t){return new pt(e.x-t.x,e.y-t.y);}},{key:"SubXY",value:function SubXY(e,t,r){return new pt(e.x-t,e.y-r);}},{key:"AddScalar",value:function AddScalar(e,t){return new pt(e.x+t,e.y+t);}},{key:"SubScalar",value:function SubScalar(e,t){return new pt(e.x-t,e.y-t);}},{key:"Div",value:function Div(e,t){return new pt(e.x/t,e.y/t);}},{key:"Mul",value:function Mul(e,t){return new pt(e.x*t,e.y*t);}},{key:"DivV",value:function DivV(e,t){return new pt(e.x/t.x,e.y/t.y);}},{key:"MulV",value:function MulV(e,t){return new pt(e.x*t.x,e.y*t.y);}},{key:"Neg",value:function Neg(e){return new pt(-e.x,-e.y);}},{key:"Per",value:function Per(e){return new pt(e.y,-e.x);}},{key:"Dist2",value:function Dist2(e,t){return pt.Sub(e,t).len2();}},{key:"Abs",value:function Abs(e){return new pt(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 pt(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 pt.Dpr(e,t)/pt.Len(t);}},{key:"Uni",value:function Uni(e){return pt.Div(e,pt.Len(e));}},{key:"Tan",value:function Tan(e,t){return pt.Uni(pt.Sub(e,t));}},{key:"Min",value:function Min(e,t){return new pt(Math.min(e.x,t.x),Math.min(e.y,t.y));}},{key:"Max",value:function Max(e,t){return new pt(Math.max(e.x,t.x),Math.max(e.y,t.y));}},{key:"From",value:function From(e){return new pt().add(e);}},{key:"FromArray",value:function FromArray(e){return new pt(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 pt(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,s=e.y-t.y,c=Math.sin(r),l=Math.cos(r);return new pt(t.x+(n*l-s*c),t.y+(n*c+s*l));}/**
|
|
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 pt.Mul(t,pt.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 s=pt.Tan(t,e),c=pt.Add(e,pt.Mul(s,pt.Sub(r,e).pry(s)));if(n){if(c.x<Math.min(e.x,t.x))return pt.Cast(e.x<t.x?e:t);if(c.x>Math.max(e.x,t.x))return pt.Cast(e.x>t.x?e:t);if(c.y<Math.min(e.y,t.y))return pt.Cast(e.y<t.y?e:t);if(c.y>Math.max(e.y,t.y))return pt.Cast(e.y>t.y?e:t);}return c;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(e,t,r){return pt.Dist(r,pt.NearestPointOnLineThroughPoint(e,t,r));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return pt.Dist(r,pt.NearestPointOnLineSegment(e,t,r,n));}},{key:"Snap",value:function Snap(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new pt(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}},{key:"Cast",value:function Cast(e){return e instanceof pt?e:pt.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 pt.Sub(t,e).mul(r).add(e);}},{key:"Med",value:function Med(e,t){return new pt((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 pt.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=pt.Len(e);return new pt(t*e.x/r,t*e.y/r);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(e,t,r){return pt.Sub(e,r).mul(t).add(r);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(e,t,r){return pt.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 pt(+e.x.toFixed(t),+e.y.toFixed(t),+e.z.toFixed(t));}},{key:"Nudge",value:function Nudge(e,t,r){return pt.Add(e,pt.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 pt(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 pt(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 pt(Math.min(Math.max(e.x,t)),Math.min(Math.max(e.y,t))):new pt(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 s=0;s<r;s++){var c=d1.easeInQuad(s/(r-1)),l=pt.Lrp(e,t,c);l.z=Math.min(1,0.5+Math.abs(0.5-p1(c))*0.65),n.push(l);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new pt(Math.round(e.x/t)*t,Math.round(e.y/t)*t);}}]);}();var p1=function p1(i){return i<0.5?2*i*i:-1+(4-2*i)*i;};var Jt=/*#__PURE__*/function(_pt){function Jt(){var _this59;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 s=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var c=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,Jt);_this59=_callSuper(this,Jt,[e,t,r]),_this59.x=e,_this59.y=t,_this59.z=r,_this59.v=n,_this59.t=s,_this59.a=c;return _this59;}_inherits(Jt,_pt);return _createClass(Jt,[{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 s=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var c=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=s,this.a=c,this;}},{key:"clone",value:function clone(){var e=this.x,t=this.y,r=this.z,n=this.v,s=this.t,c=this.a,l={x:n.x,y:n.y};return new Jt(e,t,r,l,s,c);}},{key:"distance",value:function distance(e){return Jt.GetDistance(this,e);}},{key:"isNear",value:function isNear(e,t){return Jt.IsNear(this,e,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(e,t){return Jt.GetAngleByPoints(e,this,t);}}],[{key:"Sub",value:function Sub(e,t){return new Jt(e.x-t.x,e.y-t.y);}},{key:"Add",value:function Add(e,t){return new Jt(e.x+t.x,e.y+t.y);}},{key:"GetDistance",value:function GetDistance(e,t){return Jt.Len(e.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(e,t,r){var n=t.x-e.x,s=r.x-t.x,c=t.y-e.y,l=r.y-t.y;var f=0;var h=Math.sqrt(n*n+c*c),m=Math.sqrt(s*s+l*l);if(h&&m){var u=n*s+c*l;f=Math.acos(u/(h*m)),f=f/Math.PI*180;var y=n*l-c*s;y=y>0?1:-1,f=180+y*f;}return f;}},{key:"IsNear",value:function IsNear(e,t,r){return Jt.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 s=e.x-t.x,c=e.y-t.y,l=Math.sin(r),f=Math.cos(r),h=Math.pow(10,n),m=Math.floor((t.x+(s*f-c*l))*h)/h,u=Math.floor((t.y+(s*l+c*f))*h)/h;return new Jt(m,u);}/**
|
|
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 pt(1,1),s=Math.PI+1e-3,c=Jt.Add(e,Jt.Sub(e,n).uni().per().mul(-t)),l=[];for(var f=1/r,h=f;h<=1;h+=f)l.push(Jt.RotWith(c,e,s*2*h));return l;}/**
|
|
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 s=r*(Math.PI+1e-3),c=[];for(var l=1/n,f=l;f<=1;f+=l)c.push(Jt.RotWith(t,e,s*f));return c;}}]);}(pt);var hn=(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 Ln(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i["default"]:i;}var v1=_typeof(hn)=="object"&&hn&&hn.Object===Object&&hn,Gu=v1,g1=Gu,m1=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,y1=g1||m1||Function("return this")(),_r=y1,S1=_r,P1=S1.Symbol,Qi=P1,Gc=Qi,ku=Object.prototype,x1=ku.hasOwnProperty,T1=ku.toString,ji=Gc?Gc.toStringTag:void 0;function C1(i){var e=x1.call(i,ji),t=i[ji];try{i[ji]=void 0;var r=!0;}catch(_unused18){}var n=T1.call(i);return r&&(e?i[ji]=t:delete i[ji]),n;}var I1=C1,O1=Object.prototype,w1=O1.toString;function A1(i){return w1.call(i);}var E1=A1,kc=Qi,M1=I1,L1=E1,R1="[object Null]",b1="[object Undefined]",Hc=kc?kc.toStringTag:void 0;function D1(i){return i==null?i===void 0?b1:R1:Hc&&Hc in Object(i)?M1(i):L1(i);}var Pi=D1;function N1(i){return i!=null&&_typeof(i)=="object";}var pn=N1,B1=Pi,W1=pn,F1="[object Number]";function U1(i){return typeof i=="number"||W1(i)&&B1(i)==F1;}var Y1=U1,_e=/* @__PURE__ */Ln(Y1);function X1(){this.__data__=[],this.size=0;}var z1=X1;function $1(i,e){return i===e||i!==i&&e!==e;}var pl=$1,j1=pl;function G1(i,e){for(var t=i.length;t--;)if(j1(i[t][0],e))return t;return-1;}var go=G1,k1=go,H1=Array.prototype,V1=H1.splice;function K1(i){var e=this.__data__,t=k1(e,i);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():V1.call(e,t,1),--this.size,!0;}var Z1=K1,J1=go;function Q1(i){var e=this.__data__,t=J1(e,i);return t<0?void 0:e[t][1];}var q1=Q1,_1=go;function tS(i){return _1(this.__data__,i)>-1;}var eS=tS,rS=go;function nS(i,e){var t=this.__data__,r=rS(t,i);return r<0?(++this.size,t.push([i,e])):t[r][1]=e,this;}var iS=nS,sS=z1,oS=Z1,aS=q1,lS=eS,fS=iS;function xi(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1]);}}xi.prototype.clear=sS;xi.prototype["delete"]=oS;xi.prototype.get=aS;xi.prototype.has=lS;xi.prototype.set=fS;var mo=xi,cS=mo;function uS(){this.__data__=new cS(),this.size=0;}var hS=uS;function dS(i){var e=this.__data__,t=e["delete"](i);return this.size=e.size,t;}var pS=dS;function vS(i){return this.__data__.get(i);}var gS=vS;function mS(i){return this.__data__.has(i);}var yS=mS;function SS(i){var e=_typeof(i);return i!=null&&(e=="object"||e=="function");}var qi=SS,PS=Pi,xS=qi,TS="[object AsyncFunction]",CS="[object Function]",IS="[object GeneratorFunction]",OS="[object Proxy]";function wS(i){if(!xS(i))return!1;var e=PS(i);return e==CS||e==IS||e==TS||e==OS;}var Hu=wS,AS=_r,ES=AS["__core-js_shared__"],MS=ES,tl=MS,Vc=function(){var i=/[^.]+$/.exec(tl&&tl.keys&&tl.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:"";}();function LS(i){return!!Vc&&Vc in i;}var RS=LS,bS=Function.prototype,DS=bS.toString;function NS(i){if(i!=null){try{return DS.call(i);}catch(_unused19){}try{return i+"";}catch(_unused20){}}return"";}var Vu=NS,BS=Hu,WS=RS,FS=qi,US=Vu,YS=/[\\^$.*+?()[\]{}|]/g,XS=/^\[object .+?Constructor\]$/,zS=Function.prototype,$S=Object.prototype,jS=zS.toString,GS=$S.hasOwnProperty,kS=RegExp("^"+jS.call(GS).replace(YS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function HS(i){if(!FS(i)||WS(i))return!1;var e=BS(i)?kS:XS;return e.test(US(i));}var VS=HS;function KS(i,e){return i==null?void 0:i[e];}var ZS=KS,JS=VS,QS=ZS;function qS(i,e){var t=QS(i,e);return JS(t)?t:void 0;}var Gn=qS,_S=Gn,tP=_r,eP=_S(tP,"Map"),vl=eP,rP=Gn,nP=rP(Object,"create"),yo=nP,Kc=yo;function iP(){this.__data__=Kc?Kc(null):{},this.size=0;}var sP=iP;function oP(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e;}var aP=oP,lP=yo,fP="__lodash_hash_undefined__",cP=Object.prototype,uP=cP.hasOwnProperty;function hP(i){var e=this.__data__;if(lP){var t=e[i];return t===fP?void 0:t;}return uP.call(e,i)?e[i]:void 0;}var dP=hP,pP=yo,vP=Object.prototype,gP=vP.hasOwnProperty;function mP(i){var e=this.__data__;return pP?e[i]!==void 0:gP.call(e,i);}var yP=mP,SP=yo,PP="__lodash_hash_undefined__";function xP(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=SP&&e===void 0?PP:e,this;}var TP=xP,CP=sP,IP=aP,OP=dP,wP=yP,AP=TP;function Ti(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1]);}}Ti.prototype.clear=CP;Ti.prototype["delete"]=IP;Ti.prototype.get=OP;Ti.prototype.has=wP;Ti.prototype.set=AP;var EP=Ti,Zc=EP,MP=mo,LP=vl;function RP(){this.size=0,this.__data__={hash:new Zc(),map:new(LP||MP)(),string:new Zc()};}var bP=RP;function DP(i){var e=_typeof(i);return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null;}var NP=DP,BP=NP;function WP(i,e){var t=i.__data__;return BP(e)?t[typeof e=="string"?"string":"hash"]:t.map;}var So=WP,FP=So;function UP(i){var e=FP(this,i)["delete"](i);return this.size-=e?1:0,e;}var YP=UP,XP=So;function zP(i){return XP(this,i).get(i);}var $P=zP,jP=So;function GP(i){return jP(this,i).has(i);}var kP=GP,HP=So;function VP(i,e){var t=HP(this,i),r=t.size;return t.set(i,e),this.size+=t.size==r?0:1,this;}var KP=VP,ZP=bP,JP=YP,QP=$P,qP=kP,_P=KP;function Ci(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var r=i[e];this.set(r[0],r[1]);}}Ci.prototype.clear=ZP;Ci.prototype["delete"]=JP;Ci.prototype.get=QP;Ci.prototype.has=qP;Ci.prototype.set=_P;var Ku=Ci,tx=mo,ex=vl,rx=Ku,nx=200;function ix(i,e){var t=this.__data__;if(t instanceof tx){var r=t.__data__;if(!ex||r.length<nx-1)return r.push([i,e]),this.size=++t.size,this;t=this.__data__=new rx(r);}return t.set(i,e),this.size=t.size,this;}var sx=ix,ox=mo,ax=hS,lx=pS,fx=gS,cx=yS,ux=sx;function Ii(i){var e=this.__data__=new ox(i);this.size=e.size;}Ii.prototype.clear=ax;Ii.prototype["delete"]=lx;Ii.prototype.get=fx;Ii.prototype.has=cx;Ii.prototype.set=ux;var Zu=Ii;function hx(i,e){for(var t=-1,r=i==null?0:i.length;++t<r&&e(i[t],t,i)!==!1;);return i;}var dx=hx,px=Gn,vx=function(){try{var i=px(Object,"defineProperty");return i({},"",{}),i;}catch(_unused21){}}(),Ju=vx,Jc=Ju;function gx(i,e,t){e=="__proto__"&&Jc?Jc(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t;}var Qu=gx,mx=Qu,yx=pl,Sx=Object.prototype,Px=Sx.hasOwnProperty;function xx(i,e,t){var r=i[e];(!(Px.call(i,e)&&yx(r,t))||t===void 0&&!(e in i))&&mx(i,e,t);}var qu=xx,Tx=qu,Cx=Qu;function Ix(i,e,t,r){var n=!t;t||(t={});for(var s=-1,c=e.length;++s<c;){var l=e[s],f=r?r(t[l],i[l],l,t,i):void 0;f===void 0&&(f=i[l]),n?Cx(t,l,f):Tx(t,l,f);}return t;}var Po=Ix;function Ox(i,e){for(var t=-1,r=Array(i);++t<i;)r[t]=e(t);return r;}var wx=Ox,Ax=Pi,Ex=pn,Mx="[object Arguments]";function Lx(i){return Ex(i)&&Ax(i)==Mx;}var Rx=Lx,Qc=Rx,bx=pn,_u=Object.prototype,Dx=_u.hasOwnProperty,Nx=_u.propertyIsEnumerable,Bx=Qc(/* @__PURE__ */function(){return arguments;}())?Qc:function(i){return bx(i)&&Dx.call(i,"callee")&&!Nx.call(i,"callee");},th=Bx,Wx=Array.isArray,_i=Wx,eo={exports:{}};function Fx(){return!1;}var Ux=Fx;eo.exports;(function(i,e){var t=_r,r=Ux,n=e&&!e.nodeType&&e,s=n&&!0&&i&&!i.nodeType&&i,c=s&&s.exports===n,l=c?t.Buffer:void 0,f=l?l.isBuffer:void 0,h=f||r;i.exports=h;})(eo,eo.exports);var gl=eo.exports,Yx=9007199254740991,Xx=/^(?:0|[1-9]\d*)$/;function zx(i,e){var _e2;var t=_typeof(i);return e=(_e2=e)!==null&&_e2!==void 0?_e2:Yx,!!e&&(t=="number"||t!="symbol"&&Xx.test(i))&&i>-1&&i%1==0&&i<e;}var $x=zx,jx=9007199254740991;function Gx(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=jx;}var eh=Gx,kx=Pi,Hx=eh,Vx=pn,Kx="[object Arguments]",Zx="[object Array]",Jx="[object Boolean]",Qx="[object Date]",qx="[object Error]",_x="[object Function]",tT="[object Map]",eT="[object Number]",rT="[object Object]",nT="[object RegExp]",iT="[object Set]",sT="[object String]",oT="[object WeakMap]",aT="[object ArrayBuffer]",lT="[object DataView]",fT="[object Float32Array]",cT="[object Float64Array]",uT="[object Int8Array]",hT="[object Int16Array]",dT="[object Int32Array]",pT="[object Uint8Array]",vT="[object Uint8ClampedArray]",gT="[object Uint16Array]",mT="[object Uint32Array]",$e={};$e[fT]=$e[cT]=$e[uT]=$e[hT]=$e[dT]=$e[pT]=$e[vT]=$e[gT]=$e[mT]=!0;$e[Kx]=$e[Zx]=$e[aT]=$e[Jx]=$e[lT]=$e[Qx]=$e[qx]=$e[_x]=$e[tT]=$e[eT]=$e[rT]=$e[nT]=$e[iT]=$e[sT]=$e[oT]=!1;function yT(i){return Vx(i)&&Hx(i.length)&&!!$e[kx(i)];}var ST=yT;function PT(i){return function(e){return i(e);};}var xo=PT,ro={exports:{}};ro.exports;(function(i,e){var t=Gu,r=e&&!e.nodeType&&e,n=r&&!0&&i&&!i.nodeType&&i,s=n&&n.exports===r,c=s&&t.process,l=function(){try{var f=n&&n.require&&n.require("util").types;return f||c&&c.binding&&c.binding("util");}catch(_unused22){}}();i.exports=l;})(ro,ro.exports);var ml=ro.exports,xT=ST,TT=xo,qc=ml,_c=qc&&qc.isTypedArray,CT=_c?TT(_c):xT,rh=CT,IT=wx,OT=th,wT=_i,AT=gl,ET=$x,MT=rh,LT=Object.prototype,RT=LT.hasOwnProperty;function bT(i,e){var t=wT(i),r=!t&&OT(i),n=!t&&!r&&AT(i),s=!t&&!r&&!n&&MT(i),c=t||r||n||s,l=c?IT(i.length,String):[],f=l.length;for(var h in i)(e||RT.call(i,h))&&!(c&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
396
|
+
h=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
397
|
+
n&&(h=="offset"||h=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
398
|
+
s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||// Skip index properties.
|
|
399
|
+
ET(h,f)))&&l.push(h);return l;}var nh=bT,DT=Object.prototype;function NT(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||DT;return i===t;}var yl=NT;function BT(i,e){return function(t){return i(e(t));};}var ih=BT,WT=ih,FT=WT(Object.keys,Object),UT=FT,YT=yl,XT=UT,zT=Object.prototype,$T=zT.hasOwnProperty;function jT(i){if(!YT(i))return XT(i);var e=[];for(var t in Object(i))$T.call(i,t)&&t!="constructor"&&e.push(t);return e;}var GT=jT,kT=Hu,HT=eh;function VT(i){return i!=null&&HT(i.length)&&!kT(i);}var Sl=VT,KT=nh,ZT=GT,JT=Sl;function QT(i){return JT(i)?KT(i):ZT(i);}var Pl=QT,qT=Po,_T=Pl;function tC(i,e){return i&&qT(e,_T(e),i);}var eC=tC;function rC(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e;}var nC=rC,iC=qi,sC=yl,oC=nC,aC=Object.prototype,lC=aC.hasOwnProperty;function fC(i){if(!iC(i))return oC(i);var e=sC(i),t=[];for(var r in i)r=="constructor"&&(e||!lC.call(i,r))||t.push(r);return t;}var cC=fC,uC=nh,hC=cC,dC=Sl;function pC(i){return dC(i)?uC(i,!0):hC(i);}var xl=pC,vC=Po,gC=xl;function mC(i,e){return i&&vC(e,gC(e),i);}var yC=mC,no={exports:{}};no.exports;(function(i,e){var t=_r,r=e&&!e.nodeType&&e,n=r&&!0&&i&&!i.nodeType&&i,s=n&&n.exports===r,c=s?t.Buffer:void 0,l=c?c.allocUnsafe:void 0;function f(h,m){if(m)return h.slice();var u=h.length,y=l?l(u):new h.constructor(u);return h.copy(y),y;}i.exports=f;})(no,no.exports);var SC=no.exports;function PC(i,e){var t=-1,r=i.length;for(e||(e=Array(r));++t<r;)e[t]=i[t];return e;}var xC=PC;function TC(i,e){for(var t=-1,r=i==null?0:i.length,n=0,s=[];++t<r;){var c=i[t];e(c,t,i)&&(s[n++]=c);}return s;}var sh=TC;function CC(){return[];}var oh=CC,IC=sh,OC=oh,wC=Object.prototype,AC=wC.propertyIsEnumerable,tu=Object.getOwnPropertySymbols,EC=tu?function(i){return i==null?[]:(i=Object(i),IC(tu(i),function(e){return AC.call(i,e);}));}:OC,Tl=EC,MC=Po,LC=Tl;function RC(i,e){return MC(i,LC(i),e);}var bC=RC;function DC(i,e){for(var t=-1,r=e.length,n=i.length;++t<r;)i[n+t]=e[t];return i;}var Cl=DC,NC=ih,BC=NC(Object.getPrototypeOf,Object),ah=BC,WC=Cl,FC=ah,UC=Tl,YC=oh,XC=Object.getOwnPropertySymbols,zC=XC?function(i){for(var e=[];i;)WC(e,UC(i)),i=FC(i);return e;}:YC,lh=zC,$C=Po,jC=lh;function GC(i,e){return $C(i,jC(i),e);}var kC=GC,HC=Cl,VC=_i;function KC(i,e,t){var r=e(i);return VC(i)?r:HC(r,t(i));}var fh=KC,ZC=fh,JC=Tl,QC=Pl;function qC(i){return ZC(i,QC,JC);}var ch=qC,_C=fh,tI=lh,eI=xl;function rI(i){return _C(i,eI,tI);}var nI=rI,iI=Gn,sI=_r,oI=iI(sI,"DataView"),aI=oI,lI=Gn,fI=_r,cI=lI(fI,"Promise"),uI=cI,hI=Gn,dI=_r,pI=hI(dI,"Set"),uh=pI,vI=Gn,gI=_r,mI=vI(gI,"WeakMap"),yI=mI,ol=aI,al=vl,ll=uI,fl=uh,cl=yI,hh=Pi,Oi=Vu,eu="[object Map]",SI="[object Object]",ru="[object Promise]",nu="[object Set]",iu="[object WeakMap]",su="[object DataView]",PI=Oi(ol),xI=Oi(al),TI=Oi(ll),CI=Oi(fl),II=Oi(cl),zn=hh;(ol&&zn(new ol(new ArrayBuffer(1)))!=su||al&&zn(new al())!=eu||ll&&zn(ll.resolve())!=ru||fl&&zn(new fl())!=nu||cl&&zn(new cl())!=iu)&&(zn=function zn(i){var e=hh(i),t=e==SI?i.constructor:void 0,r=t?Oi(t):"";if(r)switch(r){case PI:return su;case xI:return eu;case TI:return ru;case CI:return nu;case II:return iu;}return e;});var To=zn,OI=Object.prototype,wI=OI.hasOwnProperty;function AI(i){var e=i.length,t=new i.constructor(e);return e&&typeof i[0]=="string"&&wI.call(i,"index")&&(t.index=i.index,t.input=i.input),t;}var EI=AI,MI=_r,LI=MI.Uint8Array,dh=LI,ou=dh;function RI(i){var e=new i.constructor(i.byteLength);return new ou(e).set(new ou(i)),e;}var Il=RI,bI=Il;function DI(i,e){var t=e?bI(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.byteLength);}var NI=DI,BI=/\w*$/;function WI(i){var e=new i.constructor(i.source,BI.exec(i));return e.lastIndex=i.lastIndex,e;}var FI=WI,au=Qi,lu=au?au.prototype:void 0,fu=lu?lu.valueOf:void 0;function UI(i){return fu?Object(fu.call(i)):{};}var YI=UI,XI=Il;function zI(i,e){var t=e?XI(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.length);}var $I=zI,jI=Il,GI=NI,kI=FI,HI=YI,VI=$I,KI="[object Boolean]",ZI="[object Date]",JI="[object Map]",QI="[object Number]",qI="[object RegExp]",_I="[object Set]",tO="[object String]",eO="[object Symbol]",rO="[object ArrayBuffer]",nO="[object DataView]",iO="[object Float32Array]",sO="[object Float64Array]",oO="[object Int8Array]",aO="[object Int16Array]",lO="[object Int32Array]",fO="[object Uint8Array]",cO="[object Uint8ClampedArray]",uO="[object Uint16Array]",hO="[object Uint32Array]";function dO(i,e,t){var r=i.constructor;switch(e){case rO:return jI(i);case KI:case ZI:return new r(+i);case nO:return GI(i,t);case iO:case sO:case oO:case aO:case lO:case fO:case cO:case uO:case hO:return VI(i,t);case JI:return new r();case QI:case tO:return new r(i);case qI:return kI(i);case _I:return new r();case eO:return HI(i);}}var pO=dO,vO=qi,cu=Object.create,gO=/* @__PURE__ */function(){function i(){}return function(e){if(!vO(e))return{};if(cu)return cu(e);i.prototype=e;var t=new i();return i.prototype=void 0,t;};}(),mO=gO,yO=mO,SO=ah,PO=yl;function xO(i){return typeof i.constructor=="function"&&!PO(i)?yO(SO(i)):{};}var TO=xO,CO=To,IO=pn,OO="[object Map]";function wO(i){return IO(i)&&CO(i)==OO;}var AO=wO,EO=AO,MO=xo,uu=ml,hu=uu&&uu.isMap,LO=hu?MO(hu):EO,RO=LO,bO=To,DO=pn,NO="[object Set]";function BO(i){return DO(i)&&bO(i)==NO;}var WO=BO,FO=WO,UO=xo,du=ml,pu=du&&du.isSet,YO=pu?UO(pu):FO,ph=YO,XO=/* @__PURE__ */Ln(ph),zO=Zu,$O=dx,jO=qu,GO=eC,kO=yC,HO=SC,VO=xC,KO=bC,ZO=kC,JO=ch,QO=nI,qO=To,_O=EI,tw=pO,ew=TO,rw=_i,nw=gl,iw=RO,sw=qi,ow=ph,aw=Pl,lw=xl,fw=1,cw=2,uw=4,vh="[object Arguments]",hw="[object Array]",dw="[object Boolean]",pw="[object Date]",vw="[object Error]",gh="[object Function]",gw="[object GeneratorFunction]",mw="[object Map]",yw="[object Number]",mh="[object Object]",Sw="[object RegExp]",Pw="[object Set]",xw="[object String]",Tw="[object Symbol]",Cw="[object WeakMap]",Iw="[object ArrayBuffer]",Ow="[object DataView]",ww="[object Float32Array]",Aw="[object Float64Array]",Ew="[object Int8Array]",Mw="[object Int16Array]",Lw="[object Int32Array]",Rw="[object Uint8Array]",bw="[object Uint8ClampedArray]",Dw="[object Uint16Array]",Nw="[object Uint32Array]",Ye={};Ye[vh]=Ye[hw]=Ye[Iw]=Ye[Ow]=Ye[dw]=Ye[pw]=Ye[ww]=Ye[Aw]=Ye[Ew]=Ye[Mw]=Ye[Lw]=Ye[mw]=Ye[yw]=Ye[mh]=Ye[Sw]=Ye[Pw]=Ye[xw]=Ye[Tw]=Ye[Rw]=Ye[bw]=Ye[Dw]=Ye[Nw]=!0;Ye[vw]=Ye[gh]=Ye[Cw]=!1;function _s(i,e,t,r,n,s){var c,l=e&fw,f=e&cw,h=e&uw;if(t&&(c=n?t(i,r,n,s):t(i)),c!==void 0)return c;if(!sw(i))return i;var m=rw(i);if(m){if(c=_O(i),!l)return VO(i,c);}else{var u=qO(i),y=u==gh||u==gw;if(nw(i))return HO(i,l);if(u==mh||u==vh||y&&!n){if(c=f||y?{}:ew(i),!l)return f?ZO(i,kO(c,i)):KO(i,GO(c,i));}else{if(!Ye[u])return n?i:{};c=tw(i,u,l);}}s||(s=new zO());var T=s.get(i);if(T)return T;s.set(i,c),ow(i)?i.forEach(function(S){c.add(_s(S,e,t,S,i,s));}):iw(i)&&i.forEach(function(S,O){c.set(O,_s(S,e,t,O,i,s));});var w=h?f?QO:JO:f?lw:aw,I=m?void 0:w(i);return $O(I||i,function(S,O){I&&(O=S,S=i[O]),jO(c,O,_s(S,e,t,O,i,s));}),c;}var Bw=_s,Ww=Bw,Fw=1,Uw=4;function Yw(i){return Ww(i,Fw|Uw);}var Xw=Yw,fr=/* @__PURE__ */Ln(Xw);var yh="1.1.30-beta.0",zw="@netless/appliance-plugin";if((typeof window==="undefined"?"undefined":_typeof(window))<"u"){var i=window.__netlessUA||"";i+=" ".concat(zw,"@").concat(yh),window.__netlessUA=i;}var gr={useWorker:"auto",useSimple:!1,useBackgroundSvg:!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},longDottedStroke:{lineCap:"round",segment:1,gap:2},dottedStroke:{lineCap:"round",segment:1,gap:2},normalStroke:{lineCap:"round"},undoRedo:{enableGlobal:!1,maxStackLength:20},markmap:{enable:!0,timeout:2e4,options:{autoFit:!0,duration:0,zoom:!1,pan:!1,maxInitialScale:10}}};function En(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=i.length;if(t<2)return"";var r=i[0],n=i[1];if(t===2)return"M".concat(ui(r),"L").concat(ui(n));var s="";for(var c=2,l=t-1;c<l;c++)r=i[c],n=i[c+1],s+=hi(r,n);return e?"M".concat(hi(i[0],i[1]),"Q").concat(ui(i[1])).concat(hi(i[1],i[2]),"T").concat(s).concat(hi(i[t-1],i[0])).concat(hi(i[0],i[1]),"Z"):"M".concat(ui(i[0]),"Q").concat(ui(i[1])).concat(hi(i[1],i[2])).concat(i.length>3?"T":"").concat(s,"L").concat(ui(i[t-1]));}var Mr=/*#__PURE__*/function(){function Mr(e){_classCallCheck(this,Mr);dt(this,"maxImageWidth",gr.pencilEraser.maxImageWidth);dt(this,"maxImageHeight",gr.pencilEraser.maxImageHeight);dt(this,"syncUnitTime",gr.syncOpt.interval);dt(this,"vNodes");dt(this,"drawLayer");dt(this,"fullLayer");dt(this,"workId");dt(this,"isDelete",!1);var t=e.vNodes,r=e.fullLayer,n=e.drawLayer,s=e.workId,c=e.toolsOpt;this.vNodes=t,this.fullLayer=r,this.drawLayer=n,this.workId=s,this.syncUnitTime=c.syncUnitTime||this.syncUnitTime;}return _createClass(Mr,[{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 s=r[r.length-1];return(n&&!s||n&&s&&!n.isNear(s,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,s,c;this.workOptions=e,this.syncUnitTime=e.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),r=t&&((s=this.vNodes)==null?void 0:s.get(t))||void 0;t&&r&&(r.opt=e,(c=this.vNodes)==null||c.setInfo(t,r));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(e){var n,s;var t;var r=(n=this.workId)==null?void 0:n.toString();if(r&&e){var c=this.fullLayer.getElementsByName(r)||this.drawLayer&&this.drawLayer.getElementsByName(r)||[];if(c.length!==1)return;var l=c[0],f=e.pos,h=e.zIndex,m=e.scale,u=e.angle,y=e.translate,T={};_e(h)&&(T.zIndex=h),f&&(T.pos=[f[0],f[1]]),m&&(T.scale=m),u&&(T.rotate=u),y&&(T.translate=y),l.attr(T);var w=l==null?void 0:l.getBoundingClientRect();return w&&(t=Zt(t,{x:Math.floor(w.x-Mr.SafeBorderPadding),y:Math.floor(w.y-Mr.SafeBorderPadding),w:Math.floor(w.width+Mr.SafeBorderPadding*2),h:Math.floor(w.height+Mr.SafeBorderPadding*2)})),(s=this.vNodes)==null||s.setInfo(r,{rect:t,centerPos:f}),t;}}},{key:"drawEraserlines",value:function drawEraserlines(e,t){var r=e.group,n=e.eraserlines,s=e.pos,c=e.layer,l=c.parent;if(t)try{var h=(c.renderer.glRenderer||c.renderer.canvasRenderer).options.displayRatio,m=r.getBoundingClientRect(),u=m.width*h*c.worldScaling[0],y=m.height*h*c.worldScaling[1];var T=1;(u>this.maxImageWidth||y>this.maxImageHeight)&&(T=Math.min(this.maxImageWidth/u,this.maxImageHeight/y));var w=c.getAttribute("scale");w=[w[0]*T,w[1]*T];var I=c.parent.parent,S=c.getAttribute("translate"),_O30=this.createVmRenderNode("".concat(this.workId,"_bitMapLayer"),I,{offscreen:l.offscreen,width:l.width,height:l.height,contextType:"2d",autoRender:!1,bufferSize:500},w,S),_d30=r.cloneNode(!0);if(!n||!n.length)return;this.addEraserlines(_d30,n,s,!1),_O30.appendChild(_d30);var v=_O30.parent;v.render();var p=_O30.renderer.canvasRenderer,x=p.context;if(!x)return;var E=p.options.displayRatio,R=_d30.getBoundingClientRect(),D={x:R.x,y:R.y,w:R.width,h:R.height},U={x:0,y:0,w:I.width,h:I.height};if(Ji(D,U)===Tr.outside){Lr(_d30,v),I.removeChild(v),this.isDelete=!0;return;}var W=fr(D);W.x=Math.floor(Math.max(D.x,0)),W.y=Math.floor(Math.max(D.y,0)),W.w=Math.min(D.x+D.w,I.width)-W.x,W.h=Math.min(D.y+D.h,I.height)-W.y;var X=this.getGroupRect(W,E),B=X.x,N=X.y,$=X.w,J=X.h;var tt=x.getImageData(B,N,$,J);if(this.isTransparentRectByCanvas(tt)){Lr(_d30,v),I.removeChild(v),this.isDelete=!0,tt=null;return;}Lr(r,l);var ut=this.createSpriteNode({imageData:tt,safariRect:W,originRect:D,worldScaling:_O30.worldScaling});ut&&r.append(ut),Lr(_d30,v),I.removeChild(v),l.deleteTexture(tt),tt=null;}catch(f){console.error("[BaseShapeTool] drawEraserlines error:",f);return;}}},{key:"createVmRenderNode",value:function createVmRenderNode(e,t,r,n,s){var c=r.width,l=r.height,f="bitMap-".concat(e),h=t.layer(f,r),m=new cr({anchor:[0.5,0.5],pos:[c*0.5,l*0.5],size:[c,l],name:"viewport",id:e});return m.setAttribute("scale",n),m.setAttribute("translate",s),h.append(m),m;}},{key:"getGroupRect",value:function getGroupRect(e,t){var r=Math.floor(e.x*t),n=Math.floor(e.y*t),s=Math.floor(e.w*t),c=Math.floor(e.h*t);return{x:r,y:n,w:s,h:c};}},{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 s=_step13.value;var c=s.thickness,l=s.op;var _iterator14=_createForOfIteratorHelper(l),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var f=_step14.value;var h=f.map(function(w,I){return I%2?w-r[1]:w-r[0];}),m=this.computEraserPoints(h,c),u=En(m,!0),y={pos:[0,0],d:u,fillColor:"rgba(0,0,0,1)"},T=new Mn(y);T.addEventListener("beforerender",function(_ref164){var w=_ref164.detail;var I=w.context;n?I.blendFuncSeparate(I.ZERO,I.ZERO,I.ZERO,I.ZERO):I.globalCompositeOperation="destination-out";}),T.addEventListener("afterrender",function(_ref165){var w=_ref165.detail;var I=w.context;n?I.blendFuncSeparate(I.SRC_ALPHA,I.ONE_MINUS_SRC_ALPHA,I.ONE,I.ONE_MINUS_SRC_ALPHA):I.globalCompositeOperation="source-over";}),e.append(T);}}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,s=e.originRect;var c;if(typeof OffscreenCanvas=="function"){c=new OffscreenCanvas(t.width,t.height);var m=c.getContext("2d");m&&m.putImageData(t,0,0);}else if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){c=document.createElement("canvas"),c.width=t.width,c.height=t.height;var _m4=c.getContext("2d");_m4&&_m4.putImageData(t,0,0);}if(!c)return console.warn("Failed to create imageEraserBitmap Sprite"),null;var l=[Math.floor(s.w/r[0]),Math.floor(s.h/r[1])],f=[Math.floor((n.x-s.x)/r[0]),Math.floor((n.y-s.y)/r[1]),Math.floor(n.w/r[0]),Math.floor(n.h/r[1])],h={name:"eraserTexture",anchor:[0.5,0.5],pos:[0,0],size:l,texture:c,textureRect:f};return new $u(h);}},{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 Jt(e[0],e[1]);return Jt.GetDotStroke(r,t,8);}},{key:"computLine",value:function computLine(e,t){var r=[],n=[];var s,c;for(var l=0;l<e.length;l+=2){var f=new Jt(e[l],e[l+1]);var h=void 0;if(l==e.length-2){var m=new Jt(e[l-2],e[l-1]);h=pt.Sub(f,m).uni(),s=f;}else{l===0&&(c=f);var _m5=new Jt(e[l+2],e[l+3]);h=pt.Sub(_m5,f).uni();}if(h){var _m6=pt.Per(h).mul(t);r.push(Jt.Sub(f,_m6)),n.push(Jt.Add(f,_m6));}}if(s&&c){var _l3=Jt.GetSemicircleStroke(s,r[r.length-1],-1,8),_f4=Jt.GetSemicircleStroke(c,n[0],-1,8);return r.concat(_l3,n.reverse(),_f4);}return[];}},{key:"replace",value:function replace(e,t,r){var _this60=this;var s;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 c=_step15.value;r?sE(r,c,e):(c.remove(),_vr(c,e.parent));}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}}else r&&e.append(r);this.fullLayer!==this.drawLayer&&(this.fullLayer===e?(s=this.drawLayer)==null||s.getElementsByName(t).forEach(function(l){var f;l.remove(),_vr(l,(f=_this60.drawLayer)==null?void 0:f.parent);}):this.fullLayer.getElementsByName(t).forEach(function(l){l.remove(),_vr(l,_this60.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(),_vr(n,e.parent);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(e){var d;var t=e.node,r=e.opt,n=e.vNodes,s=e.willSerializeData,c=e.targetNode,l=r.zIndex,f=r.translate,h=r.angle,m=r.originPoint,u=r.scenePoint,y=r.scale,T=r.pointMap,w=r.thickness;var I;var S=c&&fr(c)||n.get(t.name);if(!S)return;_e(l)&&(t.setAttribute("zIndex",l),S.opt.zIndex=l);var O=t.parent;if(O){if(m&&y&&c){var v=[S.op[0],S.op[1]];Oo(S.op,u,y,f);var p=[S.op[0],S.op[1]],x=[p[0]-v[0],p[1]-v[1]];if(S.centerPos=[S.centerPos[0]+x[0],S.centerPos[1]+x[1]],S.opt.translate=void 0,S.opt.scale=void 0,S.opt.eraserlines)for(var E=0;E<S.opt.eraserlines.length;E++){var _S$opt$eraserlines$E=S.opt.eraserlines[E],R=_S$opt$eraserlines$E.op,D=_S$opt$eraserlines$E.thickness;S.opt.eraserlines[E].thickness=Math.round(D*Math.max(y[0],y[1]));for(var U=0;U<R.length;U++)Nl(R[U],u,y,f);}}else if(f){if(t.setAttribute("translate",f),S.opt.translate=f,c){var _v6=[f[0]*O.worldScaling[0],f[1]*O.worldScaling[1]];I=Zi(S.rect,_v6),S.rect=I;}else{var _v7=Mr.getRectFromLayer(O,t.name);S.rect=_v7||S.rect;}}else if(_e(h))if(t.setAttribute("rotate",h),S.opt.rotate=h,c)I=Dl(S.rect,h),S.rect=I;else{var _v8=Mr.getRectFromLayer(O,t.name);S.rect=_v8||S.rect;}if(T){var _v9=T.get(t.name);if(_v9)for(var _p10=0,_x37=0;_p10<S.op.length;_p10+=3,_x37++)S.op[_p10]=_v9[_x37][0],S.op[_p10+1]=_v9[_x37][1];}if(w&&(d=S==null?void 0:S.opt)!=null&&d.thickness&&(S.opt.thickness=w),s&&!(m&&y&&c)){if(f){var _v10=S.op.map(function(p,x){var E=x%3;return E===0?p+f[0]:E===1?p+f[1]:p;});if(S.op=_v10,S.centerPos=[S.centerPos[0]+f[0],S.centerPos[1]+f[1]],S!=null&&S.opt&&(S.opt.translate=void 0),S.opt.eraserlines)for(var _p11=0;_p11<S.opt.eraserlines.length;_p11++){var _x38=S.opt.eraserlines[_p11].op;for(var _E7=0;_E7<_x38.length;_E7++){var _R3=_x38[_E7].map(function(D,U){return U%2?D+f[1]:D+f[0];});S.opt.eraserlines[_p11].op[_E7]=_R3;}}}else if(_e(h)){var _v11=S.op;if(QA(_v11,S.centerPos,h),S.op=_v11,S!=null&&S.opt&&(S.opt.rotate=void 0),S.opt.eraserlines)for(var _p12=0;_p12<S.opt.eraserlines.length;_p12++){var _x39=S.opt.eraserlines[_p12].op;for(var _E8=0;_E8<_x39.length;_E8++)qA(_x39[_E8],S.centerPos,h);}}}S&&n.setInfo(t.name,S);}}},{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-Mr.SafeBorderPadding),y:Math.floor(n.y-Mr.SafeBorderPadding),w:Math.floor(n.width+Mr.SafeBorderPadding*2),h:Math.floor(n.height+Mr.SafeBorderPadding*2)};}}},{key:"isWillRefresh",value:function isWillRefresh(e){var t=e.toolsType,r=e.opt,n=e.node,s=e.updateOpt,c=e.willSerializeData;return!!(c&&(s.angle||s.translate)||s.thickness&&r.thickness&&r.thickness!==s.thickness||s.strokeType&&r.strokeType&&r.strokeType!==s.strokeType||s.originPoint&&s.scenePoint&&s.scale||s.pointMap&&s.pointMap.has(n.name)||t===Tt.Text&&(s.fontSize||s.translate||s.textInfos&&s.textInfos.get(n.name))||t===Tt.BackgroundSVG&&(s.translate||s.scale)||t===Tt.Image&&(s.angle||s.translate||s.scale||s.strokeColor&&r.type===vo.Iconify)||t===s.toolsType&&s.willRefresh||r.eraserlines&&r.eraserlines.length&&(s.strokeColor||s.fillColor));}}]);}();dt(Mr,"SafeBorderPadding",10);var Xt=Mr;var Ol=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 wl={exports:{}};wl.exports;(function(i){var e=function(){var t=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",s={};function c(f,h){if(!s[f]){s[f]={};for(var m=0;m<f.length;m++)s[f][f.charAt(m)]=m;}return s[f][h];}var l={compressToBase64:function compressToBase64(f){if(f==null)return"";var h=l._compress(f,6,function(m){return r.charAt(m);});switch(h.length%4){default:case 0:return h;case 1:return h+"===";case 2:return h+"==";case 3:return h+"=";}},decompressFromBase64:function decompressFromBase64(f){return f==null?"":f==""?null:l._decompress(f.length,32,function(h){return c(r,f.charAt(h));});},compressToUTF16:function compressToUTF16(f){return f==null?"":l._compress(f,15,function(h){return t(h+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(f){return f==null?"":f==""?null:l._decompress(f.length,16384,function(h){return f.charCodeAt(h)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
400
|
+
compressToUint8Array:function compressToUint8Array(f){for(var h=l.compress(f),m=new Uint8Array(h.length*2),u=0,y=h.length;u<y;u++){var T=h.charCodeAt(u);m[u*2]=T>>>8,m[u*2+1]=T%256;}return m;},//decompress from uint8array (UCS-2 big endian format)
|
|
401
|
+
decompressFromUint8Array:function decompressFromUint8Array(f){if(f==null)return l.decompress(f);for(var h=new Array(f.length/2),m=0,u=h.length;m<u;m++)h[m]=f[m*2]*256+f[m*2+1];var y=[];return h.forEach(function(T){y.push(t(T));}),l.decompress(y.join(""));},//compress into a string that is already URI encoded
|
|
402
|
+
compressToEncodedURIComponent:function compressToEncodedURIComponent(f){return f==null?"":l._compress(f,6,function(h){return n.charAt(h);});},//decompress from an output of compressToEncodedURIComponent
|
|
403
|
+
decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(f){return f==null?"":f==""?null:(f=f.replace(/ /g,"+"),l._decompress(f.length,32,function(h){return c(n,f.charAt(h));}));},compress:function compress(f){return l._compress(f,16,function(h){return t(h);});},_compress:function _compress(f,h,m){if(f==null)return"";var u,y,T={},w={},I="",S="",O="",d=2,v=3,p=2,x=[],E=0,R=0,D;for(D=0;D<f.length;D+=1)if(I=f.charAt(D),Object.prototype.hasOwnProperty.call(T,I)||(T[I]=v++,w[I]=!0),S=O+I,Object.prototype.hasOwnProperty.call(T,S))O=S;else{if(Object.prototype.hasOwnProperty.call(w,O)){if(O.charCodeAt(0)<256){for(u=0;u<p;u++)E=E<<1,R==h-1?(R=0,x.push(m(E)),E=0):R++;for(y=O.charCodeAt(0),u=0;u<8;u++)E=E<<1|y&1,R==h-1?(R=0,x.push(m(E)),E=0):R++,y=y>>1;}else{for(y=1,u=0;u<p;u++)E=E<<1|y,R==h-1?(R=0,x.push(m(E)),E=0):R++,y=0;for(y=O.charCodeAt(0),u=0;u<16;u++)E=E<<1|y&1,R==h-1?(R=0,x.push(m(E)),E=0):R++,y=y>>1;}d--,d==0&&(d=Math.pow(2,p),p++),delete w[O];}else for(y=T[O],u=0;u<p;u++)E=E<<1|y&1,R==h-1?(R=0,x.push(m(E)),E=0):R++,y=y>>1;d--,d==0&&(d=Math.pow(2,p),p++),T[S]=v++,O=String(I);}if(O!==""){if(Object.prototype.hasOwnProperty.call(w,O)){if(O.charCodeAt(0)<256){for(u=0;u<p;u++)E=E<<1,R==h-1?(R=0,x.push(m(E)),E=0):R++;for(y=O.charCodeAt(0),u=0;u<8;u++)E=E<<1|y&1,R==h-1?(R=0,x.push(m(E)),E=0):R++,y=y>>1;}else{for(y=1,u=0;u<p;u++)E=E<<1|y,R==h-1?(R=0,x.push(m(E)),E=0):R++,y=0;for(y=O.charCodeAt(0),u=0;u<16;u++)E=E<<1|y&1,R==h-1?(R=0,x.push(m(E)),E=0):R++,y=y>>1;}d--,d==0&&(d=Math.pow(2,p),p++),delete w[O];}else for(y=T[O],u=0;u<p;u++)E=E<<1|y&1,R==h-1?(R=0,x.push(m(E)),E=0):R++,y=y>>1;d--,d==0&&(d=Math.pow(2,p),p++);}for(y=2,u=0;u<p;u++)E=E<<1|y&1,R==h-1?(R=0,x.push(m(E)),E=0):R++,y=y>>1;for(;;)if(E=E<<1,R==h-1){x.push(m(E));break;}else R++;return x.join("");},decompress:function decompress(f){return f==null?"":f==""?null:l._decompress(f.length,32768,function(h){return f.charCodeAt(h);});},_decompress:function _decompress(f,h,m){var u=[],y=4,T=4,w=3,I="",S=[],O,d,v,p,x,E,R,D={val:m(0),position:h,index:1};for(O=0;O<3;O+=1)u[O]=O;for(v=0,x=Math.pow(2,2),E=1;E!=x;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*E,E<<=1;switch(v){case 0:for(v=0,x=Math.pow(2,8),E=1;E!=x;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*E,E<<=1;R=t(v);break;case 1:for(v=0,x=Math.pow(2,16),E=1;E!=x;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*E,E<<=1;R=t(v);break;case 2:return"";}for(u[3]=R,d=R,S.push(R);;){if(D.index>f)return"";for(v=0,x=Math.pow(2,w),E=1;E!=x;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*E,E<<=1;switch(R=v){case 0:for(v=0,x=Math.pow(2,8),E=1;E!=x;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*E,E<<=1;u[T++]=t(v),R=T-1,y--;break;case 1:for(v=0,x=Math.pow(2,16),E=1;E!=x;)p=D.val&D.position,D.position>>=1,D.position==0&&(D.position=h,D.val=m(D.index++)),v|=(p>0?1:0)*E,E<<=1;u[T++]=t(v),R=T-1,y--;break;case 2:return S.join("");}if(y==0&&(y=Math.pow(2,w),w++),u[R])I=u[R];else if(R===T)I=d+d.charAt(0);else return null;S.push(I),u[T++]=d+I.charAt(0),y--,d=I,y==0&&(y=Math.pow(2,w),w++);}}};return l;}();i!=null?i.exports=e:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e;});})(wl);var Sh=wl.exports;function Si(i){return JSON.parse(Sh.decompress(i));}function mr(i){return Sh.compress(JSON.stringify(i));}var Ph={exports:{}};(function(i){(function(){var e={};e.version="6.4.2.2",e.use_lines=!0,e.use_xyz=!1;var t=!1;i.exports?(i.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 s={};n.indexOf("chrome")!=-1&&n.indexOf("chromium")==-1?s.chrome=1:s.chrome=0,n.indexOf("chromium")!=-1?s.chromium=1:s.chromium=0,n.indexOf("safari")!=-1&&n.indexOf("chrome")==-1&&n.indexOf("chromium")==-1?s.safari=1:s.safari=0,n.indexOf("firefox")!=-1?s.firefox=1:s.firefox=0,n.indexOf("firefox/17")!=-1?s.firefox17=1:s.firefox17=0,n.indexOf("firefox/15")!=-1?s.firefox15=1:s.firefox15=0,n.indexOf("firefox/3")!=-1?s.firefox3=1:s.firefox3=0,n.indexOf("opera")!=-1?s.opera=1:s.opera=0,n.indexOf("msie 10")!=-1?s.msie10=1:s.msie10=0,n.indexOf("msie 9")!=-1?s.msie9=1:s.msie9=0,n.indexOf("msie 8")!=-1?s.msie8=1:s.msie8=0,n.indexOf("msie 7")!=-1?s.msie7=1:s.msie7=0,n.indexOf("msie ")!=-1?s.msie=1:s.msie=0,e.biginteger_used=null;var c;function l(a,P,A){e.biginteger_used=1,a!=null&&(typeof a=="number"&&_typeof(P)>"u"?this.fromInt(a):typeof a=="number"?this.fromNumber(a,P,A):P==null&&typeof a!="string"?this.fromString(a,256):this.fromString(a,P));}function f(){return new l(null,void 0,void 0);}function h(a,P,A,F,j,_){for(;--_>=0;){var st=P*this[a++]+A[F]+j;j=Math.floor(st/67108864),A[F++]=st&67108863;}return j;}function m(a,P,A,F,j,_){for(var st=P&32767,St=P>>15;--_>=0;){var Pt=this[a]&32767,Bt=this[a++]>>15,Ht=St*Pt+Bt*st;Pt=st*Pt+((Ht&32767)<<15)+A[F]+(j&1073741823),j=(Pt>>>30)+(Ht>>>15)+St*Bt+(j>>>30),A[F++]=Pt&1073741823;}return j;}function u(a,P,A,F,j,_){for(var st=P&16383,St=P>>14;--_>=0;){var Pt=this[a]&16383,Bt=this[a++]>>14,Ht=St*Pt+Bt*st;Pt=st*Pt+((Ht&16383)<<14)+A[F]+j,j=(Pt>>28)+(Ht>>14)+St*Bt,A[F++]=Pt&268435455;}return j;}r=="Microsoft Internet Explorer"?(l.prototype.am=m,c=30):r!="Netscape"?(l.prototype.am=h,c=26):(l.prototype.am=u,c=28),l.prototype.DB=c,l.prototype.DM=(1<<c)-1,l.prototype.DV=1<<c;var y=52;l.prototype.FV=Math.pow(2,y),l.prototype.F1=y-c,l.prototype.F2=2*c-y;var T="0123456789abcdefghijklmnopqrstuvwxyz",w=new Array(),I,S;for(I=48,S=0;S<=9;++S)w[I++]=S;for(I=97,S=10;S<36;++S)w[I++]=S;for(I=65,S=10;S<36;++S)w[I++]=S;function O(a){return T.charAt(a);}function d(a,P){var A=w[a.charCodeAt(P)];return A!==null&&A!==void 0?A:-1;}function v(a){for(var P=this.t-1;P>=0;--P)a[P]=this[P];a.t=this.t,a.s=this.s;}function p(a){this.t=1,this.s=a<0?-1:0,a>0?this[0]=a:a<-1?this[0]=a+this.DV:this.t=0;}function x(a){var P=f();return P.fromInt(a),P;}function E(a,P){var A;if(P==16)A=4;else if(P==8)A=3;else if(P==256)A=8;else if(P==2)A=1;else if(P==32)A=5;else if(P==4)A=2;else{this.fromRadix(a,P);return;}this.t=0,this.s=0;for(var F=a.length,j=!1,_=0;--F>=0;){var st=A==8?a[F]&255:d(a,F);if(st<0){a.charAt(F)=="-"&&(j=!0);continue;}j=!1,_==0?this[this.t++]=st:_+A>this.DB?(this[this.t-1]|=(st&(1<<this.DB-_)-1)<<_,this[this.t++]=st>>this.DB-_):this[this.t-1]|=st<<_,_+=A,_>=this.DB&&(_-=this.DB);}A==8&&a[0]&128&&(this.s=-1,_>0&&(this[this.t-1]|=(1<<this.DB-_)-1<<_)),this.clamp(),j&&l.ZERO.subTo(this,this);}function R(){for(var a=this.s&this.DM;this.t>0&&this[this.t-1]==a;)--this.t;}function D(a){if(this.s<0)return"-"+this.negate().toString(a);var P;if(a==16)P=4;else if(a==8)P=3;else if(a==2)P=1;else if(a==32)P=5;else if(a==4)P=2;else return this.toRadix(a);var A=(1<<P)-1,F,j=!1,_="",st=this.t,St=this.DB-st*this.DB%P;if(st-->0)for(St<this.DB&&(F=this[st]>>St)>0&&(j=!0,_=O(F));st>=0;)St<P?(F=(this[st]&(1<<St)-1)<<P-St,F|=this[--st]>>(St+=this.DB-P)):(F=this[st]>>(St-=P)&A,St<=0&&(St+=this.DB,--st)),F>0&&(j=!0),j&&(_+=O(F));return j?_:"0";}function U(){var a=f();return l.ZERO.subTo(this,a),a;}function M(){return this.s<0?this.negate():this;}function W(a){var P=this.s-a.s;if(P!=0)return P;var A=this.t;if(P=A-a.t,P!=0)return this.s<0?-P:P;for(;--A>=0;)if((P=this[A]-a[A])!=0)return P;return 0;}function X(a){var P=1,A;return(A=a>>>16)!=0&&(a=A,P+=16),(A=a>>8)!=0&&(a=A,P+=8),(A=a>>4)!=0&&(a=A,P+=4),(A=a>>2)!=0&&(a=A,P+=2),(A=a>>1)!=0&&(a=A,P+=1),P;}function B(){return this.t<=0?0:this.DB*(this.t-1)+X(this[this.t-1]^this.s&this.DM);}function N(a,P){var A;for(A=this.t-1;A>=0;--A)P[A+a]=this[A];for(A=a-1;A>=0;--A)P[A]=0;P.t=this.t+a,P.s=this.s;}function $(a,P){for(var A=a;A<this.t;++A)P[A-a]=this[A];P.t=Math.max(this.t-a,0),P.s=this.s;}function J(a,P){var A=a%this.DB,F=this.DB-A,j=(1<<F)-1,_=Math.floor(a/this.DB),st=this.s<<A&this.DM,St;for(St=this.t-1;St>=0;--St)P[St+_+1]=this[St]>>F|st,st=(this[St]&j)<<A;for(St=_-1;St>=0;--St)P[St]=0;P[_]=st,P.t=this.t+_+1,P.s=this.s,P.clamp();}function tt(a,P){P.s=this.s;var A=Math.floor(a/this.DB);if(A>=this.t){P.t=0;return;}var F=a%this.DB,j=this.DB-F,_=(1<<F)-1;P[0]=this[A]>>F;for(var st=A+1;st<this.t;++st)P[st-A-1]|=(this[st]&_)<<j,P[st-A]=this[st]>>F;F>0&&(P[this.t-A-1]|=(this.s&_)<<j),P.t=this.t-A,P.clamp();}function at(a,P){for(var A=0,F=0,j=Math.min(a.t,this.t);A<j;)F+=this[A]-a[A],P[A++]=F&this.DM,F>>=this.DB;if(a.t<this.t){for(F-=a.s;A<this.t;)F+=this[A],P[A++]=F&this.DM,F>>=this.DB;F+=this.s;}else{for(F+=this.s;A<a.t;)F-=a[A],P[A++]=F&this.DM,F>>=this.DB;F-=a.s;}P.s=F<0?-1:0,F<-1?P[A++]=this.DV+F:F>0&&(P[A++]=F),P.t=A,P.clamp();}function ut(a,P){var A=this.abs(),F=a.abs(),j=A.t;for(P.t=j+F.t;--j>=0;)P[j]=0;for(j=0;j<F.t;++j)P[j+A.t]=A.am(0,F[j],P,j,0,A.t);P.s=0,P.clamp(),this.s!=a.s&&l.ZERO.subTo(P,P);}function V(a){for(var P=this.abs(),A=a.t=2*P.t;--A>=0;)a[A]=0;for(A=0;A<P.t-1;++A){var F=P.am(A,P[A],a,2*A,0,1);(a[A+P.t]+=P.am(A+1,2*P[A],a,2*A+1,F,P.t-A-1))>=P.DV&&(a[A+P.t]-=P.DV,a[A+P.t+1]=1);}a.t>0&&(a[a.t-1]+=P.am(A,P[A],a,2*A,0,1)),a.s=0,a.clamp();}function Q(a,P,A){var F=a.abs();if(!(F.t<=0)){var j=this.abs();if(j.t<F.t){P!=null&&P.fromInt(0),A!=null&&this.copyTo(A);return;}A==null&&(A=f());var _=f(),st=this.s,St=a.s,Pt=this.DB-X(F[F.t-1]);Pt>0?(F.lShiftTo(Pt,_),j.lShiftTo(Pt,A)):(F.copyTo(_),j.copyTo(A));var Bt=_.t,Ht=_[Bt-1];if(Ht!=0){var jt=Ht*(1<<this.F1)+(Bt>1?_[Bt-2]>>this.F2:0),qt=this.FV/jt,oe=(1<<this.F1)/jt,me=1<<this.F2,Se=A.t,De=Se-Bt,or=P!==null&&P!==void 0?P:f();for(_.dlShiftTo(De,or),A.compareTo(or)>=0&&(A[A.t++]=1,A.subTo(or,A)),l.ONE.dlShiftTo(Bt,or),or.subTo(_,_);_.t<Bt;)_[_.t++]=0;for(;--De>=0;){var Rr=A[--Se]==Ht?this.DM:Math.floor(A[Se]*qt+(A[Se-1]+me)*oe);if((A[Se]+=_.am(0,Rr,A,De,0,Bt))<Rr)for(_.dlShiftTo(De,or),A.subTo(or,A);A[Se]<--Rr;)A.subTo(or,A);}P!=null&&(A.drShiftTo(Bt,P),st!=St&&l.ZERO.subTo(P,P)),A.t=Bt,A.clamp(),Pt>0&&A.rShiftTo(Pt,A),st<0&&l.ZERO.subTo(A,A);}}}function ft(a){var P=f();return this.abs().divRemTo(a,null,P),this.s<0&&P.compareTo(l.ZERO)>0&&a.subTo(P,P),P;}function mt(a){this.m=a;}function yt(a){return a.s<0||a.compareTo(this.m)>=0?a.mod(this.m):a;}function wt(a){return a;}function ht(a){a.divRemTo(this.m,null,a);}function Nt(a,P,A){a.multiplyTo(P,A),this.reduce(A);}function Dt(a,P){a.squareTo(P),this.reduce(P);}mt.prototype.convert=yt,mt.prototype.revert=wt,mt.prototype.reduce=ht,mt.prototype.mulTo=Nt,mt.prototype.sqrTo=Dt;function G(){if(this.t<1)return 0;var a=this[0];if(!(a&1))return 0;var P=a&3;return P=P*(2-(a&15)*P)&15,P=P*(2-(a&255)*P)&255,P=P*(2-((a&65535)*P&65535))&65535,P=P*(2-a*P%this.DV)%this.DV,P>0?this.DV-P:-P;}function k(a){this.m=a,this.mp=a.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<a.DB-15)-1,this.mt2=2*a.t;}function rt(a){var P=f();return a.abs().dlShiftTo(this.m.t,P),P.divRemTo(this.m,null,P),a.s<0&&P.compareTo(l.ZERO)>0&&this.m.subTo(P,P),P;}function nt(a){var P=f();return a.copyTo(P),this.reduce(P),P;}function Y(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var P=0;P<this.m.t;++P){var A=a[P]&32767,F=A*this.mpl+((A*this.mph+(a[P]>>15)*this.mpl&this.um)<<15)&a.DM;for(A=P+this.m.t,a[A]+=this.m.am(0,F,a,P,0,this.m.t);a[A]>=a.DV;)a[A]-=a.DV,a[++A]++;}a.clamp(),a.drShiftTo(this.m.t,a),a.compareTo(this.m)>=0&&a.subTo(this.m,a);}function Z(a,P){a.squareTo(P),this.reduce(P);}function C(a,P,A){a.multiplyTo(P,A),this.reduce(A);}k.prototype.convert=rt,k.prototype.revert=nt,k.prototype.reduce=Y,k.prototype.mulTo=C,k.prototype.sqrTo=Z;function L(){return(this.t>0?this[0]&1:this.s)==0;}function z(a,P){if(a>4294967295||a<1)return l.ONE;var A=f(),F=f(),j=P.convert(this),_=X(a)-1;for(j.copyTo(A);--_>=0;)if(P.sqrTo(A,F),(a&1<<_)>0)P.mulTo(F,j,A);else{var st=A;A=F,F=st;}return P.revert(A);}function K(a,P){var A;return a<256||P.isEven()?A=new mt(P):A=new k(P),this.exp(a,A);}l.prototype.copyTo=v,l.prototype.fromInt=p,l.prototype.fromString=E,l.prototype.clamp=R,l.prototype.dlShiftTo=N,l.prototype.drShiftTo=$,l.prototype.lShiftTo=J,l.prototype.rShiftTo=tt,l.prototype.subTo=at,l.prototype.multiplyTo=ut,l.prototype.squareTo=V,l.prototype.divRemTo=Q,l.prototype.invDigit=G,l.prototype.isEven=L,l.prototype.exp=z,l.prototype.toString=D,l.prototype.negate=U,l.prototype.abs=M,l.prototype.compareTo=W,l.prototype.bitLength=B,l.prototype.mod=ft,l.prototype.modPowInt=K,l.ZERO=x(0),l.ONE=x(1);function q(){var a=f();return this.copyTo(a),a;}function it(){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 ct(){return this.t==0?this.s:this[0]<<24>>24;}function xt(){return this.t==0?this.s:this[0]<<16>>16;}function Ct(a){return Math.floor(Math.LN2*this.DB/Math.log(a));}function Mt(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1;}function bt(a){if(a==null&&(a=10),this.signum()==0||a<2||a>36)return"0";var P=this.chunkSize(a),A=Math.pow(a,P),F=x(A),j=f(),_=f(),st="";for(this.divRemTo(F,j,_);j.signum()>0;)st=(A+_.intValue()).toString(a).substr(1)+st,j.divRemTo(F,j,_);return _.intValue().toString(a)+st;}function At(a,P){this.fromInt(0),P==null&&(P=10);for(var A=this.chunkSize(P),F=Math.pow(P,A),j=!1,_=0,st=0,St=0;St<a.length;++St){var Pt=d(a,St);if(Pt<0){a.charAt(St)=="-"&&this.signum()==0&&(j=!0);continue;}st=P*st+Pt,++_>=A&&(this.dMultiply(F),this.dAddOffset(st,0),_=0,st=0);}_>0&&(this.dMultiply(Math.pow(P,_)),this.dAddOffset(st,0)),j&&l.ZERO.subTo(this,this);}function Ot(a,P,A){if(typeof P=="number"){if(a<2)this.fromInt(1);else for(this.fromNumber(a,A),this.testBit(a-1)||this.bitwiseTo(l.ONE.shiftLeft(a-1),ne,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(P);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(l.ONE.shiftLeft(a-1),this);}else{var F=new Array(),j=a&7;F.length=(a>>3)+1,P.nextBytes(F),j>0?F[0]&=(1<<j)-1:F[0]=0,this.fromString(F,256);}}function Lt(){var a=this.t,P=new Array();P[0]=this.s;var A=this.DB-a*this.DB%8,F,j=0;if(a-->0)for(A<this.DB&&(F=this[a]>>A)!=(this.s&this.DM)>>A&&(P[j++]=F|this.s<<this.DB-A);a>=0;)A<8?(F=(this[a]&(1<<A)-1)<<8-A,F|=this[--a]>>(A+=this.DB-8)):(F=this[a]>>(A-=8)&255,A<=0&&(A+=this.DB,--a)),F&128&&(F|=-256),j==0&&(this.s&128)!=(F&128)&&++j,(j>0||F!=this.s)&&(P[j++]=F);return P;}function Yt(a){return this.compareTo(a)==0;}function $t(a){return this.compareTo(a)<0?this:a;}function Wt(a){return this.compareTo(a)>0?this:a;}function Qt(a,P,A){var F,j,_=Math.min(a.t,this.t);for(F=0;F<_;++F)A[F]=P(this[F],a[F]);if(a.t<this.t){for(j=a.s&this.DM,F=_;F<this.t;++F)A[F]=P(this[F],j);A.t=this.t;}else{for(j=this.s&this.DM,F=_;F<a.t;++F)A[F]=P(j,a[F]);A.t=a.t;}A.s=P(this.s,a.s),A.clamp();}function ue(a,P){return a&P;}function ie(a){var P=f();return this.bitwiseTo(a,ue,P),P;}function ne(a,P){return a|P;}function ae(a){var P=f();return this.bitwiseTo(a,ne,P),P;}function se(a,P){return a^P;}function je(a){var P=f();return this.bitwiseTo(a,se,P),P;}function We(a,P){return a&~P;}function Xe(a){var P=f();return this.bitwiseTo(a,We,P),P;}function Fe(){for(var a=f(),P=0;P<this.t;++P)a[P]=this.DM&~this[P];return a.t=this.t,a.s=~this.s,a;}function Ge(a){var P=f();return a<0?this.rShiftTo(-a,P):this.lShiftTo(a,P),P;}function Ve(a){var P=f();return a<0?this.lShiftTo(-a,P):this.rShiftTo(a,P),P;}function Je(a){if(a==0)return-1;var P=0;return a&65535||(a>>=16,P+=16),a&255||(a>>=8,P+=8),a&15||(a>>=4,P+=4),a&3||(a>>=2,P+=2),a&1||++P,P;}function Oe(){for(var a=0;a<this.t;++a)if(this[a]!=0)return a*this.DB+Je(this[a]);return this.s<0?this.t*this.DB:-1;}function ur(a){for(var P=0;a!=0;)a&=a-1,++P;return P;}function Hr(){for(var a=0,P=this.s&this.DM,A=0;A<this.t;++A)a+=ur(this[A]^P);return a;}function tn(a){var P=Math.floor(a/this.DB);return P>=this.t?this.s!=0:(this[P]&1<<a%this.DB)!=0;}function Hn(a,P){var A=l.ONE.shiftLeft(a);return this.bitwiseTo(A,P,A),A;}function Vn(a){return this.changeBit(a,ne);}function wi(a){return this.changeBit(a,We);}function wo(a){return this.changeBit(a,se);}function Ai(a,P){for(var A=0,F=0,j=Math.min(a.t,this.t);A<j;)F+=this[A]+a[A],P[A++]=F&this.DM,F>>=this.DB;if(a.t<this.t){for(F+=a.s;A<this.t;)F+=this[A],P[A++]=F&this.DM,F>>=this.DB;F+=this.s;}else{for(F+=this.s;A<a.t;)F+=a[A],P[A++]=F&this.DM,F>>=this.DB;F+=a.s;}P.s=F<0?-1:0,F>0?P[A++]=F:F<-1&&(P[A++]=this.DV+F),P.t=A,P.clamp();}function Ao(a){var P=f();return this.addTo(a,P),P;}function Eo(a){var P=f();return this.subTo(a,P),P;}function Mo(a){var P=f();return this.multiplyTo(a,P),P;}function Lo(){var a=f();return this.squareTo(a),a;}function Ro(a){var P=f();return this.divRemTo(a,P,null),P;}function bo(a){var P=f();return this.divRemTo(a,null,P),P;}function Do(a){var P=f(),A=f();return this.divRemTo(a,P,A),new Array(P,A);}function No(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp();}function ts(a,P){if(a!=0){for(;this.t<=P;)this[this.t++]=0;for(this[P]+=a;this[P]>=this.DV;)this[P]-=this.DV,++P>=this.t&&(this[this.t++]=0),++this[P];}}function Rn(){}function es(a){return a;}function Bo(a,P,A){a.multiplyTo(P,A);}function Wo(a,P){a.squareTo(P);}Rn.prototype.convert=es,Rn.prototype.revert=es,Rn.prototype.mulTo=Bo,Rn.prototype.sqrTo=Wo;function Fo(a){return this.exp(a,new Rn());}function Uo(a,P,A){var F=Math.min(this.t+a.t,P);for(A.s=0,A.t=F;F>0;)A[--F]=0;var j;for(j=A.t-this.t;F<j;++F)A[F+this.t]=this.am(0,a[F],A,F,0,this.t);for(j=Math.min(a.t,P);F<j;++F)this.am(0,a[F],A,F,0,P-F);A.clamp();}function Kn(a,P,A){--P;var F=A.t=this.t+a.t-P;for(A.s=0;--F>=0;)A[F]=0;for(F=Math.max(P-this.t,0);F<a.t;++F)A[this.t+F-P]=this.am(P-F,a[F],A,0,0,this.t+F-P);A.clamp(),A.drShiftTo(1,A);}function vn(a){this.r2=f(),this.q3=f(),l.ONE.dlShiftTo(2*a.t,this.r2),this.mu=this.r2.divide(a),this.m=a;}function Zn(a){if(a.s<0||a.t>2*this.m.t)return a.mod(this.m);if(a.compareTo(this.m)<0)return a;var P=f();return a.copyTo(P),this.reduce(P),P;}function Yo(a){return a;}function Xo(a){for(a.drShiftTo(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);a.compareTo(this.r2)<0;)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);a.compareTo(this.m)>=0;)a.subTo(this.m,a);}function zo(a,P){a.squareTo(P),this.reduce(P);}function rs(a,P,A){a.multiplyTo(P,A),this.reduce(A);}vn.prototype.convert=Zn,vn.prototype.revert=Yo,vn.prototype.reduce=Xo,vn.prototype.mulTo=rs,vn.prototype.sqrTo=zo;function ns(a,P){var A=a.bitLength(),F,j=x(1),_;if(A<=0)return j;A<18?F=1:A<48?F=3:A<144?F=4:A<768?F=5:F=6,A<8?_=new mt(P):P.isEven()?_=new vn(P):_=new k(P);var st=new Array(),St=3,Pt=F-1,Bt=(1<<F)-1;if(st[1]=_.convert(this),F>1){var Ht=f();for(_.sqrTo(st[1],Ht);St<=Bt;)st[St]=f(),_.mulTo(Ht,st[St-2],st[St]),St+=2;}var jt=a.t-1,qt,oe=!0,me=f(),Se;for(A=X(a[jt])-1;jt>=0;){for(A>=Pt?qt=a[jt]>>A-Pt&Bt:(qt=(a[jt]&(1<<A+1)-1)<<Pt-A,jt>0&&(qt|=a[jt-1]>>this.DB+A-Pt)),St=F;!(qt&1);)qt>>=1,--St;if((A-=St)<0&&(A+=this.DB,--jt),oe)st[qt].copyTo(j),oe=!1;else{for(;St>1;)_.sqrTo(j,me),_.sqrTo(me,j),St-=2;St>0?_.sqrTo(j,me):(Se=j,j=me,me=Se),_.mulTo(me,st[qt],j);}for(;jt>=0&&!(a[jt]&1<<A);)_.sqrTo(j,me),Se=j,j=me,me=Se,--A<0&&(A=this.DB-1,--jt);}return _.revert(j);}function is(a){var P=this.s<0?this.negate():this.clone(),A=a.s<0?a.negate():a.clone();if(P.compareTo(A)<0){var F=P;P=A,A=F;}var j=P.getLowestSetBit(),_=A.getLowestSetBit();if(_<0)return P;for(j<_&&(_=j),_>0&&(P.rShiftTo(_,P),A.rShiftTo(_,A));P.signum()>0;)(j=P.getLowestSetBit())>0&&P.rShiftTo(j,P),(j=A.getLowestSetBit())>0&&A.rShiftTo(j,A),P.compareTo(A)>=0?(P.subTo(A,P),P.rShiftTo(1,P)):(A.subTo(P,A),A.rShiftTo(1,A));return _>0&&A.lShiftTo(_,A),A;}function $o(a){if(a<=0)return 0;var P=this.DV%a,A=this.s<0?a-1:0;if(this.t>0)if(P==0)A=this[0]%a;else for(var F=this.t-1;F>=0;--F)A=(P*A+this[F])%a;return A;}function jo(a){var P=a.isEven();if(this.isEven()&&P||a.signum()==0)return l.ZERO;for(var A=a.clone(),F=this.clone(),j=x(1),_=x(0),st=x(0),St=x(1);A.signum()!=0;){for(;A.isEven();)A.rShiftTo(1,A),P?((!j.isEven()||!_.isEven())&&(j.addTo(this,j),_.subTo(a,_)),j.rShiftTo(1,j)):_.isEven()||_.subTo(a,_),_.rShiftTo(1,_);for(;F.isEven();)F.rShiftTo(1,F),P?((!st.isEven()||!St.isEven())&&(st.addTo(this,st),St.subTo(a,St)),st.rShiftTo(1,st)):St.isEven()||St.subTo(a,St),St.rShiftTo(1,St);A.compareTo(F)>=0?(A.subTo(F,A),P&&j.subTo(st,j),_.subTo(St,_)):(F.subTo(A,F),P&&st.subTo(j,st),St.subTo(_,St));}if(F.compareTo(l.ONE)!=0)return l.ZERO;if(St.compareTo(a)>=0)return St.subtract(a);if(St.signum()<0)St.addTo(a,St);else return St;return St.signum()<0?St.add(a):St;}var nr=[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],Go=(1<<26)/nr[nr.length-1];function ss(a){var P,A=this.abs();if(A.t==1&&A[0]<=nr[nr.length-1]){for(P=0;P<nr.length;++P)if(A[0]==nr[P])return!0;return!1;}if(A.isEven())return!1;for(P=1;P<nr.length;){for(var F=nr[P],j=P+1;j<nr.length&&F<Go;)F*=nr[j++];for(F=A.modInt(F);P<j;)if(F%nr[P++]==0)return!1;}return A.millerRabin(a);}function os(a){var P=this.subtract(l.ONE),A=P.getLowestSetBit();if(A<=0)return!1;var F=P.shiftRight(A);a=a+1>>1,a>nr.length&&(a=nr.length);for(var j=f(),_=0;_<a;++_){j.fromInt(nr[Math.floor(Math.random()*nr.length)]);var st=j.modPow(F,this);if(st.compareTo(l.ONE)!=0&&st.compareTo(P)!=0){for(var St=1;St++<A&&st.compareTo(P)!=0;)if(st=st.modPowInt(2,this),st.compareTo(l.ONE)==0)return!1;if(st.compareTo(P)!=0)return!1;}}return!0;}l.prototype.chunkSize=Ct,l.prototype.toRadix=bt,l.prototype.fromRadix=At,l.prototype.fromNumber=Ot,l.prototype.bitwiseTo=Qt,l.prototype.changeBit=Hn,l.prototype.addTo=Ai,l.prototype.dMultiply=No,l.prototype.dAddOffset=ts,l.prototype.multiplyLowerTo=Uo,l.prototype.multiplyUpperTo=Kn,l.prototype.modInt=$o,l.prototype.millerRabin=os,l.prototype.clone=q,l.prototype.intValue=it,l.prototype.byteValue=ct,l.prototype.shortValue=xt,l.prototype.signum=Mt,l.prototype.toByteArray=Lt,l.prototype.equals=Yt,l.prototype.min=$t,l.prototype.max=Wt,l.prototype.and=ie,l.prototype.or=ae,l.prototype.xor=je,l.prototype.andNot=Xe,l.prototype.not=Fe,l.prototype.shiftLeft=Ge,l.prototype.shiftRight=Ve,l.prototype.getLowestSetBit=Oe,l.prototype.bitCount=Hr,l.prototype.testBit=tn,l.prototype.setBit=Vn,l.prototype.clearBit=wi,l.prototype.flipBit=wo,l.prototype.add=Ao,l.prototype.subtract=Eo,l.prototype.multiply=Mo,l.prototype.divide=Ro,l.prototype.remainder=bo,l.prototype.divideAndRemainder=Do,l.prototype.modPow=ns,l.prototype.modInverse=jo,l.prototype.pow=Fo,l.prototype.gcd=is,l.prototype.isProbablePrime=ss,l.prototype.square=Lo;var ge=l;ge.prototype.IsNegative=function(){return this.compareTo(ge.ZERO)==-1;},ge.op_Equality=function(a,P){return a.compareTo(P)==0;},ge.op_Inequality=function(a,P){return a.compareTo(P)!=0;},ge.op_GreaterThan=function(a,P){return a.compareTo(P)>0;},ge.op_LessThan=function(a,P){return a.compareTo(P)<0;},ge.op_Addition=function(a,P){return new ge(a,void 0,void 0).add(new ge(P,void 0,void 0));},ge.op_Subtraction=function(a,P){return new ge(a,void 0,void 0).subtract(new ge(P,void 0,void 0));},ge.Int128Mul=function(a,P){return new ge(a,void 0,void 0).multiply(new ge(P,void 0,void 0));},ge.op_Division=function(a,P){return a.divide(P);},ge.prototype.ToDouble=function(){return parseFloat(this.toString());};var Jn=function Jn(a,P){var A;if(_typeof(Object.getOwnPropertyNames)>"u"){for(A in P.prototype)(_typeof(a.prototype[A])>"u"||a.prototype[A]===Object.prototype[A])&&(a.prototype[A]=P.prototype[A]);for(A in P)_typeof(a[A])>"u"&&(a[A]=P[A]);a.$baseCtor=P;}else{for(var F=Object.getOwnPropertyNames(P.prototype),j=0;j<F.length;j++)_typeof(Object.getOwnPropertyDescriptor(a.prototype,F[j]))>"u"&&Object.defineProperty(a.prototype,F[j],Object.getOwnPropertyDescriptor(P.prototype,F[j]));for(A in P)_typeof(a[A])>"u"&&(a[A]=P[A]);a.$baseCtor=P;}};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 a=arguments;this.X=0,this.Y=0,a.length===1?(this.X=a[0].X,this.Y=a[0].Y):a.length===2&&(this.X=a[0],this.Y=a[1]);},e.DoublePoint0=function(){this.X=0,this.Y=0;},e.DoublePoint0.prototype=e.DoublePoint.prototype,e.DoublePoint1=function(a){this.X=a.X,this.Y=a.Y;},e.DoublePoint1.prototype=e.DoublePoint.prototype,e.DoublePoint2=function(a,P){this.X=a,this.Y=P;},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 a=!0,P=this.m_Parent;P!==null;)a=!a,P=P.m_Parent;return a;},e.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length;},e.PolyNode.prototype.Contour=function(){return this.m_polygon;},e.PolyNode.prototype.AddChild=function(a){var P=this.m_Childs.length;this.m_Childs.push(a),a.m_Parent=this,a.m_Index=P;},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 a=0,P=this.m_AllPolys.length;a<P;a++)this.m_AllPolys[a]=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 a=this.m_AllPolys.length;return a>0&&this.m_Childs[0]!==this.m_AllPolys[0]&&a--,a;},Jn(e.PolyTree,e.PolyNode),e.Math_Abs_Int64=e.Math_Abs_Int32=e.Math_Abs_Double=function(a){return Math.abs(a);},e.Math_Max_Int32_Int32=function(a,P){return Math.max(a,P);},s.msie||s.opera||s.safari?e.Cast_Int32=function(a){return a|0;}:e.Cast_Int32=function(a){return~~a;},_typeof(Number.toInteger)>"u"&&(Number.toInteger=null),s.chrome?e.Cast_Int64=function(a){return a<-2147483648||a>2147483647?a<0?Math.ceil(a):Math.floor(a):~~a;}:s.firefox&&typeof Number.toInteger=="function"?e.Cast_Int64=function(a){return Number.toInteger(a);}:s.msie7||s.msie8?e.Cast_Int64=function(a){return parseInt(a,10);}:s.msie?e.Cast_Int64=function(a){return a<-2147483648||a>2147483647?a<0?Math.ceil(a):Math.floor(a):a|0;}:e.Cast_Int64=function(a){return a<0?Math.ceil(a):Math.floor(a);},e.Clear=function(a){a.length=0;},e.PI=3.141592653589793,e.PI2=2*3.141592653589793,e.IntPoint=function(){var a=arguments,P=a.length;if(this.X=0,this.Y=0,e.use_xyz){if(this.Z=0,P===3)this.X=a[0],this.Y=a[1],this.Z=a[2];else if(P===2)this.X=a[0],this.Y=a[1],this.Z=0;else if(P===1){if(a[0]instanceof e.DoublePoint){var A=a[0];this.X=e.Clipper.Round(A.X),this.Y=e.Clipper.Round(A.Y),this.Z=0;}else{var F=a[0];_typeof(F.Z)>"u"&&(F.Z=0),this.X=F.X,this.Y=F.Y,this.Z=F.Z;}}else this.X=0,this.Y=0,this.Z=0;}else if(P===2)this.X=a[0],this.Y=a[1];else if(P===1){if(a[0]instanceof e.DoublePoint){var A=a[0];this.X=e.Clipper.Round(A.X),this.Y=e.Clipper.Round(A.Y);}else{var F=a[0];this.X=F.X,this.Y=F.Y;}}else this.X=0,this.Y=0;},e.IntPoint.op_Equality=function(a,P){return a.X===P.X&&a.Y===P.Y;},e.IntPoint.op_Inequality=function(a,P){return a.X!==P.X||a.Y!==P.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(a){this.X=a.X,this.Y=a.Y,e.use_xyz&&(_typeof(a.Z)>"u"?this.Z=0:this.Z=a.Z);},e.IntPoint1.prototype=e.IntPoint.prototype,e.IntPoint1dp=function(a){this.X=e.Clipper.Round(a.X),this.Y=e.Clipper.Round(a.Y),e.use_xyz&&(this.Z=0);},e.IntPoint1dp.prototype=e.IntPoint.prototype,e.IntPoint2=function(a,P,A){this.X=a,this.Y=P,e.use_xyz&&(_typeof(A)>"u"?this.Z=0:this.Z=A);},e.IntPoint2.prototype=e.IntPoint.prototype,e.IntRect=function(){var a=arguments,P=a.length;if(P===4)this.left=a[0],this.top=a[1],this.right=a[2],this.bottom=a[3];else if(P===1){var A=a[0];this.left=A.left,this.top=A.top,this.right=A.right,this.bottom=A.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(a){this.left=a.left,this.top=a.top,this.right=a.right,this.bottom=a.bottom;},e.IntRect1.prototype=e.IntRect.prototype,e.IntRect4=function(a,P,A,F){this.left=a,this.top=P,this.right=A,this.bottom=F;},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(a,P){var A=P.Pt.Y-a.Pt.Y;return A>0?1:A<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(a){return a>-e.ClipperBase.tolerance&&a<e.ClipperBase.tolerance;},e.ClipperBase.IsHorizontal=function(a){return a.Delta.Y===0;},e.ClipperBase.prototype.PointIsVertex=function(a,P){var A=P;do{if(e.IntPoint.op_Equality(A.Pt,a))return!0;A=A.Next;}while(A!==P);return!1;},e.ClipperBase.prototype.PointOnLineSegment=function(a,P,A,F){return F?a.X===P.X&&a.Y===P.Y||a.X===A.X&&a.Y===A.Y||a.X>P.X==a.X<A.X&&a.Y>P.Y==a.Y<A.Y&&ge.op_Equality(ge.Int128Mul(a.X-P.X,A.Y-P.Y),ge.Int128Mul(A.X-P.X,a.Y-P.Y)):a.X===P.X&&a.Y===P.Y||a.X===A.X&&a.Y===A.Y||a.X>P.X==a.X<A.X&&a.Y>P.Y==a.Y<A.Y&&(a.X-P.X)*(A.Y-P.Y)===(A.X-P.X)*(a.Y-P.Y);},e.ClipperBase.prototype.PointOnPolygon=function(a,P,A){for(var F=P;;){if(this.PointOnLineSegment(a,F.Pt,F.Next.Pt,A))return!0;if(F=F.Next,F===P)break;}return!1;},e.ClipperBase.prototype.SlopesEqual=e.ClipperBase.SlopesEqual=function(){var a=arguments,P=a.length,A,F,j,_,st,St,Pt;return P===3?(A=a[0],F=a[1],Pt=a[2],Pt?ge.op_Equality(ge.Int128Mul(A.Delta.Y,F.Delta.X),ge.Int128Mul(A.Delta.X,F.Delta.Y)):e.Cast_Int64(A.Delta.Y*F.Delta.X)===e.Cast_Int64(A.Delta.X*F.Delta.Y)):P===4?(j=a[0],_=a[1],st=a[2],Pt=a[3],Pt?ge.op_Equality(ge.Int128Mul(j.Y-_.Y,_.X-st.X),ge.Int128Mul(j.X-_.X,_.Y-st.Y)):e.Cast_Int64((j.Y-_.Y)*(_.X-st.X))-e.Cast_Int64((j.X-_.X)*(_.Y-st.Y))===0):(j=a[0],_=a[1],st=a[2],St=a[3],Pt=a[4],Pt?ge.op_Equality(ge.Int128Mul(j.Y-_.Y,st.X-St.X),ge.Int128Mul(j.X-_.X,st.Y-St.Y)):e.Cast_Int64((j.Y-_.Y)*(st.X-St.X))-e.Cast_Int64((j.X-_.X)*(st.Y-St.Y))===0);},e.ClipperBase.SlopesEqual3=function(a,P,A){return A?ge.op_Equality(ge.Int128Mul(a.Delta.Y,P.Delta.X),ge.Int128Mul(a.Delta.X,P.Delta.Y)):e.Cast_Int64(a.Delta.Y*P.Delta.X)===e.Cast_Int64(a.Delta.X*P.Delta.Y);},e.ClipperBase.SlopesEqual4=function(a,P,A,F){return F?ge.op_Equality(ge.Int128Mul(a.Y-P.Y,P.X-A.X),ge.Int128Mul(a.X-P.X,P.Y-A.Y)):e.Cast_Int64((a.Y-P.Y)*(P.X-A.X))-e.Cast_Int64((a.X-P.X)*(P.Y-A.Y))===0;},e.ClipperBase.SlopesEqual5=function(a,P,A,F,j){return j?ge.op_Equality(ge.Int128Mul(a.Y-P.Y,A.X-F.X),ge.Int128Mul(a.X-P.X,A.Y-F.Y)):e.Cast_Int64((a.Y-P.Y)*(A.X-F.X))-e.Cast_Int64((a.X-P.X)*(A.Y-F.Y))===0;},e.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var a=0,P=this.m_edges.length;a<P;++a){for(var A=0,F=this.m_edges[a].length;A<F;++A)this.m_edges[a][A]=null;e.Clear(this.m_edges[a]);}e.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1;},e.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var a=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=a;}this.m_CurrentLM=null;},e.ClipperBase.prototype.RangeTest=function(a,P){P.Value?(a.X>e.ClipperBase.hiRange||a.Y>e.ClipperBase.hiRange||-a.X>e.ClipperBase.hiRange||-a.Y>e.ClipperBase.hiRange)&&e.Error("Coordinate outside allowed range in RangeTest()."):(a.X>e.ClipperBase.loRange||a.Y>e.ClipperBase.loRange||-a.X>e.ClipperBase.loRange||-a.Y>e.ClipperBase.loRange)&&(P.Value=!0,this.RangeTest(a,P));},e.ClipperBase.prototype.InitEdge=function(a,P,A,F){a.Next=P,a.Prev=A,a.Curr.X=F.X,a.Curr.Y=F.Y,e.use_xyz&&(a.Curr.Z=F.Z),a.OutIdx=-1;},e.ClipperBase.prototype.InitEdge2=function(a,P){a.Curr.Y>=a.Next.Curr.Y?(a.Bot.X=a.Curr.X,a.Bot.Y=a.Curr.Y,e.use_xyz&&(a.Bot.Z=a.Curr.Z),a.Top.X=a.Next.Curr.X,a.Top.Y=a.Next.Curr.Y,e.use_xyz&&(a.Top.Z=a.Next.Curr.Z)):(a.Top.X=a.Curr.X,a.Top.Y=a.Curr.Y,e.use_xyz&&(a.Top.Z=a.Curr.Z),a.Bot.X=a.Next.Curr.X,a.Bot.Y=a.Next.Curr.Y,e.use_xyz&&(a.Bot.Z=a.Next.Curr.Z)),this.SetDx(a),a.PolyTyp=P;},e.ClipperBase.prototype.FindNextLocMin=function(a){for(var P;;){for(;e.IntPoint.op_Inequality(a.Bot,a.Prev.Bot)||e.IntPoint.op_Equality(a.Curr,a.Top);)a=a.Next;if(a.Dx!==e.ClipperBase.horizontal&&a.Prev.Dx!==e.ClipperBase.horizontal)break;for(;a.Prev.Dx===e.ClipperBase.horizontal;)a=a.Prev;for(P=a;a.Dx===e.ClipperBase.horizontal;)a=a.Next;if(a.Top.Y!==a.Prev.Bot.Y){P.Prev.Bot.X<a.Bot.X&&(a=P);break;}}return a;},e.ClipperBase.prototype.ProcessBound=function(a,P){var A,F=a,j;if(F.OutIdx===e.ClipperBase.Skip){if(a=F,P){for(;a.Top.Y===a.Next.Bot.Y;)a=a.Next;for(;a!==F&&a.Dx===e.ClipperBase.horizontal;)a=a.Prev;}else{for(;a.Top.Y===a.Prev.Bot.Y;)a=a.Prev;for(;a!==F&&a.Dx===e.ClipperBase.horizontal;)a=a.Next;}if(a===F)P?F=a.Next:F=a.Prev;else{P?a=F.Next:a=F.Prev;var _=new e.LocalMinima();_.Next=null,_.Y=a.Bot.Y,_.LeftBound=null,_.RightBound=a,a.WindDelta=0,F=this.ProcessBound(a,P),this.InsertLocalMinima(_);}return F;}if(a.Dx===e.ClipperBase.horizontal&&(P?A=a.Prev:A=a.Next,A.Dx===e.ClipperBase.horizontal?A.Bot.X!==a.Bot.X&&A.Top.X!==a.Bot.X&&this.ReverseHorizontal(a):A.Bot.X!==a.Bot.X&&this.ReverseHorizontal(a)),A=a,P){for(;F.Top.Y===F.Next.Bot.Y&&F.Next.OutIdx!==e.ClipperBase.Skip;)F=F.Next;if(F.Dx===e.ClipperBase.horizontal&&F.Next.OutIdx!==e.ClipperBase.Skip){for(j=F;j.Prev.Dx===e.ClipperBase.horizontal;)j=j.Prev;j.Prev.Top.X>F.Next.Top.X&&(F=j.Prev);}for(;a!==F;)a.NextInLML=a.Next,a.Dx===e.ClipperBase.horizontal&&a!==A&&a.Bot.X!==a.Prev.Top.X&&this.ReverseHorizontal(a),a=a.Next;a.Dx===e.ClipperBase.horizontal&&a!==A&&a.Bot.X!==a.Prev.Top.X&&this.ReverseHorizontal(a),F=F.Next;}else{for(;F.Top.Y===F.Prev.Bot.Y&&F.Prev.OutIdx!==e.ClipperBase.Skip;)F=F.Prev;if(F.Dx===e.ClipperBase.horizontal&&F.Prev.OutIdx!==e.ClipperBase.Skip){for(j=F;j.Next.Dx===e.ClipperBase.horizontal;)j=j.Next;(j.Next.Top.X===F.Prev.Top.X||j.Next.Top.X>F.Prev.Top.X)&&(F=j.Next);}for(;a!==F;)a.NextInLML=a.Prev,a.Dx===e.ClipperBase.horizontal&&a!==A&&a.Bot.X!==a.Next.Top.X&&this.ReverseHorizontal(a),a=a.Prev;a.Dx===e.ClipperBase.horizontal&&a!==A&&a.Bot.X!==a.Next.Top.X&&this.ReverseHorizontal(a),F=F.Prev;}return F;},e.ClipperBase.prototype.AddPath=function(a,P,A){e.use_lines?!A&&P===e.PolyType.ptClip&&e.Error("AddPath: Open paths must be subject."):A||e.Error("AddPath: Open paths have been disabled.");var F=a.length-1;if(A)for(;F>0&&e.IntPoint.op_Equality(a[F],a[0]);)--F;for(;F>0&&e.IntPoint.op_Equality(a[F],a[F-1]);)--F;if(A&&F<2||!A&&F<1)return!1;for(var j=new Array(),_=0;_<=F;_++)j.push(new e.TEdge());var st=!0;j[1].Curr.X=a[1].X,j[1].Curr.Y=a[1].Y,e.use_xyz&&(j[1].Curr.Z=a[1].Z);var St={Value:this.m_UseFullRange};this.RangeTest(a[0],St),this.m_UseFullRange=St.Value,St.Value=this.m_UseFullRange,this.RangeTest(a[F],St),this.m_UseFullRange=St.Value,this.InitEdge(j[0],j[1],j[F],a[0]),this.InitEdge(j[F],j[0],j[F-1],a[F]);for(var _=F-1;_>=1;--_)St.Value=this.m_UseFullRange,this.RangeTest(a[_],St),this.m_UseFullRange=St.Value,this.InitEdge(j[_],j[_+1],j[_-1],a[_]);for(var Pt=j[0],Bt=Pt,Ht=Pt;;){if(Bt.Curr===Bt.Next.Curr&&(A||Bt.Next!==Pt)){if(Bt===Bt.Next)break;Bt===Pt&&(Pt=Bt.Next),Bt=this.RemoveEdge(Bt),Ht=Bt;continue;}if(Bt.Prev===Bt.Next)break;if(A&&e.ClipperBase.SlopesEqual4(Bt.Prev.Curr,Bt.Curr,Bt.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(Bt.Prev.Curr,Bt.Curr,Bt.Next.Curr))){Bt===Pt&&(Pt=Bt.Next),Bt=this.RemoveEdge(Bt),Bt=Bt.Prev,Ht=Bt;continue;}if(Bt=Bt.Next,Bt===Ht||!A&&Bt.Next===Pt)break;}if(!A&&Bt===Bt.Next||A&&Bt.Prev===Bt.Next)return!1;A||(this.m_HasOpenPaths=!0,Pt.Prev.OutIdx=e.ClipperBase.Skip),Bt=Pt;do this.InitEdge2(Bt,P),Bt=Bt.Next,st&&Bt.Curr.Y!==Pt.Curr.Y&&(st=!1);while(Bt!==Pt);if(st){if(A)return!1;Bt.Prev.OutIdx=e.ClipperBase.Skip;var jt=new e.LocalMinima();for(jt.Next=null,jt.Y=Bt.Bot.Y,jt.LeftBound=null,jt.RightBound=Bt,jt.RightBound.Side=e.EdgeSide.esRight,jt.RightBound.WindDelta=0;Bt.Bot.X!==Bt.Prev.Top.X&&this.ReverseHorizontal(Bt),Bt.Next.OutIdx!==e.ClipperBase.Skip;)Bt.NextInLML=Bt.Next,Bt=Bt.Next;return this.InsertLocalMinima(jt),this.m_edges.push(j),!0;}this.m_edges.push(j);var qt,oe=null;for(e.IntPoint.op_Equality(Bt.Prev.Bot,Bt.Prev.Top)&&(Bt=Bt.Next);Bt=this.FindNextLocMin(Bt),Bt!==oe;){oe===null&&(oe=Bt);var jt=new e.LocalMinima();jt.Next=null,jt.Y=Bt.Bot.Y,Bt.Dx<Bt.Prev.Dx?(jt.LeftBound=Bt.Prev,jt.RightBound=Bt,qt=!1):(jt.LeftBound=Bt,jt.RightBound=Bt.Prev,qt=!0),jt.LeftBound.Side=e.EdgeSide.esLeft,jt.RightBound.Side=e.EdgeSide.esRight,A?jt.LeftBound.Next===jt.RightBound?jt.LeftBound.WindDelta=-1:jt.LeftBound.WindDelta=1:jt.LeftBound.WindDelta=0,jt.RightBound.WindDelta=-jt.LeftBound.WindDelta,Bt=this.ProcessBound(jt.LeftBound,qt),Bt.OutIdx===e.ClipperBase.Skip&&(Bt=this.ProcessBound(Bt,qt));var me=this.ProcessBound(jt.RightBound,!qt);me.OutIdx===e.ClipperBase.Skip&&(me=this.ProcessBound(me,!qt)),jt.LeftBound.OutIdx===e.ClipperBase.Skip?jt.LeftBound=null:jt.RightBound.OutIdx===e.ClipperBase.Skip&&(jt.RightBound=null),this.InsertLocalMinima(jt),qt||(Bt=me);}return!0;},e.ClipperBase.prototype.AddPaths=function(a,P,A){for(var F=!1,j=0,_=a.length;j<_;++j)this.AddPath(a[j],P,A)&&(F=!0);return F;},e.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(a,P,A){return e.IntPoint.op_Equality(a,A)||e.IntPoint.op_Equality(a,P)||e.IntPoint.op_Equality(A,P)?!1:a.X!==A.X?P.X>a.X==P.X<A.X:P.Y>a.Y==P.Y<A.Y;},e.ClipperBase.prototype.RemoveEdge=function(a){a.Prev.Next=a.Next,a.Next.Prev=a.Prev;var P=a.Next;return a.Prev=null,P;},e.ClipperBase.prototype.SetDx=function(a){a.Delta.X=a.Top.X-a.Bot.X,a.Delta.Y=a.Top.Y-a.Bot.Y,a.Delta.Y===0?a.Dx=e.ClipperBase.horizontal:a.Dx=a.Delta.X/a.Delta.Y;},e.ClipperBase.prototype.InsertLocalMinima=function(a){if(this.m_MinimaList===null)this.m_MinimaList=a;else if(a.Y>=this.m_MinimaList.Y)a.Next=this.m_MinimaList,this.m_MinimaList=a;else{for(var P=this.m_MinimaList;P.Next!==null&&a.Y<P.Next.Y;)P=P.Next;a.Next=P.Next,P.Next=a;}},e.ClipperBase.prototype.PopLocalMinima=function(a,P){return P.v=this.m_CurrentLM,this.m_CurrentLM!==null&&this.m_CurrentLM.Y===a?(this.m_CurrentLM=this.m_CurrentLM.Next,!0):!1;},e.ClipperBase.prototype.ReverseHorizontal=function(a){var P=a.Top.X;a.Top.X=a.Bot.X,a.Bot.X=P,e.use_xyz&&(P=a.Top.Z,a.Top.Z=a.Bot.Z,a.Bot.Z=P);},e.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!==null){this.m_Scanbeam=null;for(var a=this.m_MinimaList;a!==null;){this.InsertScanbeam(a.Y);var P=a.LeftBound;P!==null&&(P.Curr.X=P.Bot.X,P.Curr.Y=P.Bot.Y,e.use_xyz&&(P.Curr.Z=P.Bot.Z),P.OutIdx=e.ClipperBase.Unassigned),P=a.RightBound,P!==null&&(P.Curr.X=P.Bot.X,P.Curr.Y=P.Bot.Y,e.use_xyz&&(P.Curr.Z=P.Bot.Z),P.OutIdx=e.ClipperBase.Unassigned),a=a.Next;}this.m_ActiveEdges=null;}},e.ClipperBase.prototype.InsertScanbeam=function(a){if(this.m_Scanbeam===null)this.m_Scanbeam=new e.Scanbeam(),this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=a;else if(a>this.m_Scanbeam.Y){var P=new e.Scanbeam();P.Y=a,P.Next=this.m_Scanbeam,this.m_Scanbeam=P;}else{for(var A=this.m_Scanbeam;A.Next!==null&&a<=A.Next.Y;)A=A.Next;if(a===A.Y)return;var F=new e.Scanbeam();F.Y=a,F.Next=A.Next,A.Next=F;}},e.ClipperBase.prototype.PopScanbeam=function(a){return this.m_Scanbeam===null?(a.v=0,!1):(a.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 a=new e.OutRec();return a.Idx=e.ClipperBase.Unassigned,a.IsHole=!1,a.IsOpen=!1,a.FirstLeft=null,a.Pts=null,a.BottomPt=null,a.PolyNode=null,this.m_PolyOuts.push(a),a.Idx=this.m_PolyOuts.length-1,a;},e.ClipperBase.prototype.DisposeOutRec=function(a){var P=this.m_PolyOuts[a];P.Pts=null,P=null,this.m_PolyOuts[a]=null;},e.ClipperBase.prototype.UpdateEdgeIntoAEL=function(a){a.NextInLML===null&&e.Error("UpdateEdgeIntoAEL: invalid call");var P=a.PrevInAEL,A=a.NextInAEL;return a.NextInLML.OutIdx=a.OutIdx,P!==null?P.NextInAEL=a.NextInLML:this.m_ActiveEdges=a.NextInLML,A!==null&&(A.PrevInAEL=a.NextInLML),a.NextInLML.Side=a.Side,a.NextInLML.WindDelta=a.WindDelta,a.NextInLML.WindCnt=a.WindCnt,a.NextInLML.WindCnt2=a.WindCnt2,a=a.NextInLML,a.Curr.X=a.Bot.X,a.Curr.Y=a.Bot.Y,a.PrevInAEL=P,a.NextInAEL=A,e.ClipperBase.IsHorizontal(a)||this.InsertScanbeam(a.Top.Y),a;},e.ClipperBase.prototype.SwapPositionsInAEL=function(a,P){if(!(a.NextInAEL===a.PrevInAEL||P.NextInAEL===P.PrevInAEL)){if(a.NextInAEL===P){var A=P.NextInAEL;A!==null&&(A.PrevInAEL=a);var F=a.PrevInAEL;F!==null&&(F.NextInAEL=P),P.PrevInAEL=F,P.NextInAEL=a,a.PrevInAEL=P,a.NextInAEL=A;}else if(P.NextInAEL===a){var j=a.NextInAEL;j!==null&&(j.PrevInAEL=P);var _=P.PrevInAEL;_!==null&&(_.NextInAEL=a),a.PrevInAEL=_,a.NextInAEL=P,P.PrevInAEL=a,P.NextInAEL=j;}else{var st=a.NextInAEL,St=a.PrevInAEL;a.NextInAEL=P.NextInAEL,a.NextInAEL!==null&&(a.NextInAEL.PrevInAEL=a),a.PrevInAEL=P.PrevInAEL,a.PrevInAEL!==null&&(a.PrevInAEL.NextInAEL=a),P.NextInAEL=st,P.NextInAEL!==null&&(P.NextInAEL.PrevInAEL=P),P.PrevInAEL=St,P.PrevInAEL!==null&&(P.PrevInAEL.NextInAEL=P);}a.PrevInAEL===null?this.m_ActiveEdges=a:P.PrevInAEL===null&&(this.m_ActiveEdges=P);}},e.ClipperBase.prototype.DeleteFromAEL=function(a){var P=a.PrevInAEL,A=a.NextInAEL;P===null&&A===null&&a!==this.m_ActiveEdges||(P!==null?P.NextInAEL=A:this.m_ActiveEdges=A,A!==null&&(A.PrevInAEL=P),a.NextInAEL=null,a.PrevInAEL=null);},e.Clipper=function(a){_typeof(a)>"u"&&(a=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&a)!==0,this.StrictlySimple=(2&a)!==0,this.PreserveCollinear=(4&a)!==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(a){var P=new e.Maxima();if(P.X=a,this.m_Maxima===null)this.m_Maxima=P,this.m_Maxima.Next=null,this.m_Maxima.Prev=null;else if(a<this.m_Maxima.X)P.Next=this.m_Maxima,P.Prev=null,this.m_Maxima=P;else{for(var A=this.m_Maxima;A.Next!==null&&a>=A.Next.X;)A=A.Next;if(a===A.X)return;P.Next=A.Next,P.Prev=A,A.Next!==null&&(A.Next.Prev=P),A.Next=P;}},e.Clipper.prototype.Execute=function(){var a=arguments,P=a.length,A=a[1]instanceof e.PolyTree;if(P===4&&!A){var F=a[0],j=a[1],_=a[2],st=a[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(j),this.m_SubjFillType=_,this.m_ClipFillType=st,this.m_ClipType=F,this.m_UsingPolyTree=!1;try{var St=this.ExecuteInternal();St&&this.BuildResult(j);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return St;}else if(P===4&&A){var F=a[0],Pt=a[1],_=a[2],st=a[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=_,this.m_ClipFillType=st,this.m_ClipType=F,this.m_UsingPolyTree=!0;try{var St=this.ExecuteInternal();St&&this.BuildResult2(Pt);}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1;}return St;}else if(P===2&&!A){var F=a[0],j=a[1];return this.Execute(F,j,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}else if(P===2&&A){var F=a[0],Pt=a[1];return this.Execute(F,Pt,e.PolyFillType.pftEvenOdd,e.PolyFillType.pftEvenOdd);}},e.Clipper.prototype.FixHoleLinkage=function(a){if(!(a.FirstLeft===null||a.IsHole!==a.FirstLeft.IsHole&&a.FirstLeft.Pts!==null)){for(var P=a.FirstLeft;P!==null&&(P.IsHole===a.IsHole||P.Pts===null);)P=P.FirstLeft;a.FirstLeft=P;}},e.Clipper.prototype.ExecuteInternal=function(){try{this.Reset(),this.m_SortedEdges=null,this.m_Maxima=null;var a={},P={};if(!this.PopScanbeam(a))return!1;for(this.InsertLocalMinimaIntoAEL(a.v);this.PopScanbeam(P)||this.LocalMinimaPending();){if(this.ProcessHorizontals(),this.m_GhostJoins.length=0,!this.ProcessIntersections(P.v))return!1;this.ProcessEdgesAtTopOfScanbeam(P.v),a.v=P.v,this.InsertLocalMinimaIntoAEL(a.v);}var A,F,j;for(F=0,j=this.m_PolyOuts.length;F<j;F++)A=this.m_PolyOuts[F],!(A.Pts===null||A.IsOpen)&&(A.IsHole^this.ReverseSolution)==this.Area$1(A)>0&&this.ReversePolyPtLinks(A.Pts);for(this.JoinCommonEdges(),F=0,j=this.m_PolyOuts.length;F<j;F++)A=this.m_PolyOuts[F],A.Pts!==null&&(A.IsOpen?this.FixupOutPolyline(A):this.FixupOutPolygon(A));return this.StrictlySimple&&this.DoSimplePolygons(),!0;}finally{this.m_Joins.length=0,this.m_GhostJoins.length=0;}},e.Clipper.prototype.DisposeAllPolyPts=function(){for(var a=0,P=this.m_PolyOuts.length;a<P;++a)this.DisposeOutRec(a);e.Clear(this.m_PolyOuts);},e.Clipper.prototype.AddJoin=function(a,P,A){var F=new e.Join();F.OutPt1=a,F.OutPt2=P,F.OffPt.X=A.X,F.OffPt.Y=A.Y,e.use_xyz&&(F.OffPt.Z=A.Z),this.m_Joins.push(F);},e.Clipper.prototype.AddGhostJoin=function(a,P){var A=new e.Join();A.OutPt1=a,A.OffPt.X=P.X,A.OffPt.Y=P.Y,e.use_xyz&&(A.OffPt.Z=P.Z),this.m_GhostJoins.push(A);},e.Clipper.prototype.SetZ=function(a,P,A){if(this.ZFillFunction!==null){if(a.Z!==0||this.ZFillFunction===null)return;e.IntPoint.op_Equality(a,P.Bot)?a.Z=P.Bot.Z:e.IntPoint.op_Equality(a,P.Top)?a.Z=P.Top.Z:e.IntPoint.op_Equality(a,A.Bot)?a.Z=A.Bot.Z:e.IntPoint.op_Equality(a,A.Top)?a.Z=A.Top.Z:this.ZFillFunction(P.Bot,P.Top,A.Bot,A.Top,a);}},e.Clipper.prototype.InsertLocalMinimaIntoAEL=function(a){for(var P={},A,F;this.PopLocalMinima(a,P);){A=P.v.LeftBound,F=P.v.RightBound;var j=null;if(A===null?(this.InsertEdgeIntoAEL(F,null),this.SetWindingCount(F),this.IsContributing(F)&&(j=this.AddOutPt(F,F.Bot))):F===null?(this.InsertEdgeIntoAEL(A,null),this.SetWindingCount(A),this.IsContributing(A)&&(j=this.AddOutPt(A,A.Bot)),this.InsertScanbeam(A.Top.Y)):(this.InsertEdgeIntoAEL(A,null),this.InsertEdgeIntoAEL(F,A),this.SetWindingCount(A),F.WindCnt=A.WindCnt,F.WindCnt2=A.WindCnt2,this.IsContributing(A)&&(j=this.AddLocalMinPoly(A,F,A.Bot)),this.InsertScanbeam(A.Top.Y)),F!==null&&(e.ClipperBase.IsHorizontal(F)?(F.NextInLML!==null&&this.InsertScanbeam(F.NextInLML.Top.Y),this.AddEdgeToSEL(F)):this.InsertScanbeam(F.Top.Y)),!(A===null||F===null)){if(j!==null&&e.ClipperBase.IsHorizontal(F)&&this.m_GhostJoins.length>0&&F.WindDelta!==0)for(var _=0,st=this.m_GhostJoins.length;_<st;_++){var St=this.m_GhostJoins[_];this.HorzSegmentsOverlap(St.OutPt1.Pt.X,St.OffPt.X,F.Bot.X,F.Top.X)&&this.AddJoin(St.OutPt1,j,St.OffPt);}if(A.OutIdx>=0&&A.PrevInAEL!==null&&A.PrevInAEL.Curr.X===A.Bot.X&&A.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(A.PrevInAEL.Curr,A.PrevInAEL.Top,A.Curr,A.Top,this.m_UseFullRange)&&A.WindDelta!==0&&A.PrevInAEL.WindDelta!==0){var Pt=this.AddOutPt(A.PrevInAEL,A.Bot);this.AddJoin(j,Pt,A.Top);}if(A.NextInAEL!==F){if(F.OutIdx>=0&&F.PrevInAEL.OutIdx>=0&&e.ClipperBase.SlopesEqual5(F.PrevInAEL.Curr,F.PrevInAEL.Top,F.Curr,F.Top,this.m_UseFullRange)&&F.WindDelta!==0&&F.PrevInAEL.WindDelta!==0){var Pt=this.AddOutPt(F.PrevInAEL,F.Bot);this.AddJoin(j,Pt,F.Top);}var Bt=A.NextInAEL;if(Bt!==null)for(;Bt!==F;)this.IntersectEdges(F,Bt,A.Curr),Bt=Bt.NextInAEL;}}}},e.Clipper.prototype.InsertEdgeIntoAEL=function(a,P){if(this.m_ActiveEdges===null)a.PrevInAEL=null,a.NextInAEL=null,this.m_ActiveEdges=a;else if(P===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,a))a.PrevInAEL=null,a.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=a,this.m_ActiveEdges=a;else{for(P===null&&(P=this.m_ActiveEdges);P.NextInAEL!==null&&!this.E2InsertsBeforeE1(P.NextInAEL,a);)P=P.NextInAEL;a.NextInAEL=P.NextInAEL,P.NextInAEL!==null&&(P.NextInAEL.PrevInAEL=a),a.PrevInAEL=P,P.NextInAEL=a;}},e.Clipper.prototype.E2InsertsBeforeE1=function(a,P){return P.Curr.X===a.Curr.X?P.Top.Y>a.Top.Y?P.Top.X<e.Clipper.TopX(a,P.Top.Y):a.Top.X>e.Clipper.TopX(P,a.Top.Y):P.Curr.X<a.Curr.X;},e.Clipper.prototype.IsEvenOddFillType=function(a){return a.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType===e.PolyFillType.pftEvenOdd:this.m_ClipFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsEvenOddAltFillType=function(a){return a.PolyTyp===e.PolyType.ptSubject?this.m_ClipFillType===e.PolyFillType.pftEvenOdd:this.m_SubjFillType===e.PolyFillType.pftEvenOdd;},e.Clipper.prototype.IsContributing=function(a){var P,A;switch(a.PolyTyp===e.PolyType.ptSubject?(P=this.m_SubjFillType,A=this.m_ClipFillType):(P=this.m_ClipFillType,A=this.m_SubjFillType),P){case e.PolyFillType.pftEvenOdd:if(a.WindDelta===0&&a.WindCnt!==1)return!1;break;case e.PolyFillType.pftNonZero:if(Math.abs(a.WindCnt)!==1)return!1;break;case e.PolyFillType.pftPositive:if(a.WindCnt!==1)return!1;break;default:if(a.WindCnt!==-1)return!1;break;}switch(this.m_ClipType){case e.ClipType.ctIntersection:switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2!==0;case e.PolyFillType.pftPositive:return a.WindCnt2>0;default:return a.WindCnt2<0;}case e.ClipType.ctUnion:switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2===0;case e.PolyFillType.pftPositive:return a.WindCnt2<=0;default:return a.WindCnt2>=0;}case e.ClipType.ctDifference:if(a.PolyTyp===e.PolyType.ptSubject)switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2===0;case e.PolyFillType.pftPositive:return a.WindCnt2<=0;default:return a.WindCnt2>=0;}else switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2!==0;case e.PolyFillType.pftPositive:return a.WindCnt2>0;default:return a.WindCnt2<0;}case e.ClipType.ctXor:if(a.WindDelta===0)switch(A){case e.PolyFillType.pftEvenOdd:case e.PolyFillType.pftNonZero:return a.WindCnt2===0;case e.PolyFillType.pftPositive:return a.WindCnt2<=0;default:return a.WindCnt2>=0;}else return!0;}return!0;},e.Clipper.prototype.SetWindingCount=function(a){for(var P=a.PrevInAEL;P!==null&&(P.PolyTyp!==a.PolyTyp||P.WindDelta===0);)P=P.PrevInAEL;if(P===null){var A=a.PolyTyp===e.PolyType.ptSubject?this.m_SubjFillType:this.m_ClipFillType;a.WindDelta===0?a.WindCnt=A===e.PolyFillType.pftNegative?-1:1:a.WindCnt=a.WindDelta,a.WindCnt2=0,P=this.m_ActiveEdges;}else if(a.WindDelta===0&&this.m_ClipType!==e.ClipType.ctUnion)a.WindCnt=1,a.WindCnt2=P.WindCnt2,P=P.NextInAEL;else if(this.IsEvenOddFillType(a)){if(a.WindDelta===0){for(var F=!0,j=P.PrevInAEL;j!==null;)j.PolyTyp===P.PolyTyp&&j.WindDelta!==0&&(F=!F),j=j.PrevInAEL;a.WindCnt=F?0:1;}else a.WindCnt=a.WindDelta;a.WindCnt2=P.WindCnt2,P=P.NextInAEL;}else P.WindCnt*P.WindDelta<0?Math.abs(P.WindCnt)>1?P.WindDelta*a.WindDelta<0?a.WindCnt=P.WindCnt:a.WindCnt=P.WindCnt+a.WindDelta:a.WindCnt=a.WindDelta===0?1:a.WindDelta:a.WindDelta===0?a.WindCnt=P.WindCnt<0?P.WindCnt-1:P.WindCnt+1:P.WindDelta*a.WindDelta<0?a.WindCnt=P.WindCnt:a.WindCnt=P.WindCnt+a.WindDelta,a.WindCnt2=P.WindCnt2,P=P.NextInAEL;if(this.IsEvenOddAltFillType(a))for(;P!==a;)P.WindDelta!==0&&(a.WindCnt2=a.WindCnt2===0?1:0),P=P.NextInAEL;else for(;P!==a;)a.WindCnt2+=P.WindDelta,P=P.NextInAEL;},e.Clipper.prototype.AddEdgeToSEL=function(a){this.m_SortedEdges===null?(this.m_SortedEdges=a,a.PrevInSEL=null,a.NextInSEL=null):(a.NextInSEL=this.m_SortedEdges,a.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=a,this.m_SortedEdges=a);},e.Clipper.prototype.PopEdgeFromSEL=function(a){if(a.v=this.m_SortedEdges,a.v===null)return!1;var P=a.v;return this.m_SortedEdges=a.v.NextInSEL,this.m_SortedEdges!==null&&(this.m_SortedEdges.PrevInSEL=null),P.NextInSEL=null,P.PrevInSEL=null,!0;},e.Clipper.prototype.CopyAELToSEL=function(){var a=this.m_ActiveEdges;for(this.m_SortedEdges=a;a!==null;)a.PrevInSEL=a.PrevInAEL,a.NextInSEL=a.NextInAEL,a=a.NextInAEL;},e.Clipper.prototype.SwapPositionsInSEL=function(a,P){if(!(a.NextInSEL===null&&a.PrevInSEL===null)&&!(P.NextInSEL===null&&P.PrevInSEL===null)){if(a.NextInSEL===P){var A=P.NextInSEL;A!==null&&(A.PrevInSEL=a);var F=a.PrevInSEL;F!==null&&(F.NextInSEL=P),P.PrevInSEL=F,P.NextInSEL=a,a.PrevInSEL=P,a.NextInSEL=A;}else if(P.NextInSEL===a){var A=a.NextInSEL;A!==null&&(A.PrevInSEL=P);var F=P.PrevInSEL;F!==null&&(F.NextInSEL=a),a.PrevInSEL=F,a.NextInSEL=P,P.PrevInSEL=a,P.NextInSEL=A;}else{var A=a.NextInSEL,F=a.PrevInSEL;a.NextInSEL=P.NextInSEL,a.NextInSEL!==null&&(a.NextInSEL.PrevInSEL=a),a.PrevInSEL=P.PrevInSEL,a.PrevInSEL!==null&&(a.PrevInSEL.NextInSEL=a),P.NextInSEL=A,P.NextInSEL!==null&&(P.NextInSEL.PrevInSEL=P),P.PrevInSEL=F,P.PrevInSEL!==null&&(P.PrevInSEL.NextInSEL=P);}a.PrevInSEL===null?this.m_SortedEdges=a:P.PrevInSEL===null&&(this.m_SortedEdges=P);}},e.Clipper.prototype.AddLocalMaxPoly=function(a,P,A){this.AddOutPt(a,A),P.WindDelta===0&&this.AddOutPt(P,A),a.OutIdx===P.OutIdx?(a.OutIdx=-1,P.OutIdx=-1):a.OutIdx<P.OutIdx?this.AppendPolygon(a,P):this.AppendPolygon(P,a);},e.Clipper.prototype.AddLocalMinPoly=function(a,P,A){var F,j,_;if(e.ClipperBase.IsHorizontal(P)||a.Dx>P.Dx?(F=this.AddOutPt(a,A),P.OutIdx=a.OutIdx,a.Side=e.EdgeSide.esLeft,P.Side=e.EdgeSide.esRight,j=a,j.PrevInAEL===P?_=P.PrevInAEL:_=j.PrevInAEL):(F=this.AddOutPt(P,A),a.OutIdx=P.OutIdx,a.Side=e.EdgeSide.esRight,P.Side=e.EdgeSide.esLeft,j=P,j.PrevInAEL===a?_=a.PrevInAEL:_=j.PrevInAEL),_!==null&&_.OutIdx>=0&&_.Top.Y<A.Y&&j.Top.Y<A.Y){var st=e.Clipper.TopX(_,A.Y),St=e.Clipper.TopX(j,A.Y);if(st===St&&j.WindDelta!==0&&_.WindDelta!==0&&e.ClipperBase.SlopesEqual5(new e.IntPoint2(st,A.Y),_.Top,new e.IntPoint2(St,A.Y),j.Top,this.m_UseFullRange)){var Pt=this.AddOutPt(_,A);this.AddJoin(F,Pt,j.Top);}}return F;},e.Clipper.prototype.AddOutPt=function(a,P){if(a.OutIdx<0){var A=this.CreateOutRec();A.IsOpen=a.WindDelta===0;var F=new e.OutPt();return A.Pts=F,F.Idx=A.Idx,F.Pt.X=P.X,F.Pt.Y=P.Y,e.use_xyz&&(F.Pt.Z=P.Z),F.Next=F,F.Prev=F,A.IsOpen||this.SetHoleState(a,A),a.OutIdx=A.Idx,F;}else{var A=this.m_PolyOuts[a.OutIdx],j=A.Pts,_=a.Side===e.EdgeSide.esLeft;if(_&&e.IntPoint.op_Equality(P,j.Pt))return j;if(!_&&e.IntPoint.op_Equality(P,j.Prev.Pt))return j.Prev;var F=new e.OutPt();return F.Idx=A.Idx,F.Pt.X=P.X,F.Pt.Y=P.Y,e.use_xyz&&(F.Pt.Z=P.Z),F.Next=j,F.Prev=j.Prev,F.Prev.Next=F,j.Prev=F,_&&(A.Pts=F),F;}},e.Clipper.prototype.GetLastOutPt=function(a){var P=this.m_PolyOuts[a.OutIdx];return a.Side===e.EdgeSide.esLeft?P.Pts:P.Pts.Prev;},e.Clipper.prototype.SwapPoints=function(a,P){var A=new e.IntPoint1(a.Value);a.Value.X=P.Value.X,a.Value.Y=P.Value.Y,e.use_xyz&&(a.Value.Z=P.Value.Z),P.Value.X=A.X,P.Value.Y=A.Y,e.use_xyz&&(P.Value.Z=A.Z);},e.Clipper.prototype.HorzSegmentsOverlap=function(a,P,A,F){var j;return a>P&&(j=a,a=P,P=j),A>F&&(j=A,A=F,F=j),a<F&&A<P;},e.Clipper.prototype.SetHoleState=function(a,P){for(var A=a.PrevInAEL,F=null;A!==null;)A.OutIdx>=0&&A.WindDelta!==0&&(F===null?F=A:F.OutIdx===A.OutIdx&&(F=null)),A=A.PrevInAEL;F===null?(P.FirstLeft=null,P.IsHole=!1):(P.FirstLeft=this.m_PolyOuts[F.OutIdx],P.IsHole=!P.FirstLeft.IsHole);},e.Clipper.prototype.GetDx=function(a,P){return a.Y===P.Y?e.ClipperBase.horizontal:(P.X-a.X)/(P.Y-a.Y);},e.Clipper.prototype.FirstIsBottomPt=function(a,P){for(var A=a.Prev;e.IntPoint.op_Equality(A.Pt,a.Pt)&&A!==a;)A=A.Prev;var F=Math.abs(this.GetDx(a.Pt,A.Pt));for(A=a.Next;e.IntPoint.op_Equality(A.Pt,a.Pt)&&A!==a;)A=A.Next;var j=Math.abs(this.GetDx(a.Pt,A.Pt));for(A=P.Prev;e.IntPoint.op_Equality(A.Pt,P.Pt)&&A!==P;)A=A.Prev;var _=Math.abs(this.GetDx(P.Pt,A.Pt));for(A=P.Next;e.IntPoint.op_Equality(A.Pt,P.Pt)&&A!==P;)A=A.Next;var st=Math.abs(this.GetDx(P.Pt,A.Pt));return Math.max(F,j)===Math.max(_,st)&&Math.min(F,j)===Math.min(_,st)?this.Area(a)>0:F>=_&&F>=st||j>=_&&j>=st;},e.Clipper.prototype.GetBottomPt=function(a){for(var P=null,A=a.Next;A!==a;)A.Pt.Y>a.Pt.Y?(a=A,P=null):A.Pt.Y===a.Pt.Y&&A.Pt.X<=a.Pt.X&&(A.Pt.X<a.Pt.X?(P=null,a=A):A.Next!==a&&A.Prev!==a&&(P=A)),A=A.Next;if(P!==null)for(;P!==A;)for(this.FirstIsBottomPt(A,P)||(a=P),P=P.Next;e.IntPoint.op_Inequality(P.Pt,a.Pt);)P=P.Next;return a;},e.Clipper.prototype.GetLowermostRec=function(a,P){a.BottomPt===null&&(a.BottomPt=this.GetBottomPt(a.Pts)),P.BottomPt===null&&(P.BottomPt=this.GetBottomPt(P.Pts));var A=a.BottomPt,F=P.BottomPt;return A.Pt.Y>F.Pt.Y?a:A.Pt.Y<F.Pt.Y?P:A.Pt.X<F.Pt.X?a:A.Pt.X>F.Pt.X||A.Next===A?P:F.Next===F||this.FirstIsBottomPt(A,F)?a:P;},e.Clipper.prototype.OutRec1RightOfOutRec2=function(a,P){do if(a=a.FirstLeft,a===P)return!0;while(a!==null);return!1;},e.Clipper.prototype.GetOutRec=function(a){for(var P=this.m_PolyOuts[a];P!==this.m_PolyOuts[P.Idx];)P=this.m_PolyOuts[P.Idx];return P;},e.Clipper.prototype.AppendPolygon=function(a,P){var A=this.m_PolyOuts[a.OutIdx],F=this.m_PolyOuts[P.OutIdx],j;this.OutRec1RightOfOutRec2(A,F)?j=F:this.OutRec1RightOfOutRec2(F,A)?j=A:j=this.GetLowermostRec(A,F);var _=A.Pts,st=_.Prev,St=F.Pts,Pt=St.Prev;a.Side===e.EdgeSide.esLeft?P.Side===e.EdgeSide.esLeft?(this.ReversePolyPtLinks(St),St.Next=_,_.Prev=St,st.Next=Pt,Pt.Prev=st,A.Pts=Pt):(Pt.Next=_,_.Prev=Pt,St.Prev=st,st.Next=St,A.Pts=St):P.Side===e.EdgeSide.esRight?(this.ReversePolyPtLinks(St),st.Next=Pt,Pt.Prev=st,St.Next=_,_.Prev=St):(st.Next=St,St.Prev=st,_.Prev=Pt,Pt.Next=_),A.BottomPt=null,j===F&&(F.FirstLeft!==A&&(A.FirstLeft=F.FirstLeft),A.IsHole=F.IsHole),F.Pts=null,F.BottomPt=null,F.FirstLeft=A;var Bt=a.OutIdx,Ht=P.OutIdx;a.OutIdx=-1,P.OutIdx=-1;for(var jt=this.m_ActiveEdges;jt!==null;){if(jt.OutIdx===Ht){jt.OutIdx=Bt,jt.Side=a.Side;break;}jt=jt.NextInAEL;}F.Idx=A.Idx;},e.Clipper.prototype.ReversePolyPtLinks=function(a){if(a!==null){var P,A;P=a;do A=P.Next,P.Next=P.Prev,P.Prev=A,P=A;while(P!==a);}},e.Clipper.SwapSides=function(a,P){var A=a.Side;a.Side=P.Side,P.Side=A;},e.Clipper.SwapPolyIndexes=function(a,P){var A=a.OutIdx;a.OutIdx=P.OutIdx,P.OutIdx=A;},e.Clipper.prototype.IntersectEdges=function(a,P,A){var F=a.OutIdx>=0,j=P.OutIdx>=0;if(e.use_xyz&&this.SetZ(A,a,P),e.use_lines&&(a.WindDelta===0||P.WindDelta===0)){if(a.WindDelta===0&&P.WindDelta===0)return;a.PolyTyp===P.PolyTyp&&a.WindDelta!==P.WindDelta&&this.m_ClipType===e.ClipType.ctUnion?a.WindDelta===0?j&&(this.AddOutPt(a,A),F&&(a.OutIdx=-1)):F&&(this.AddOutPt(P,A),j&&(P.OutIdx=-1)):a.PolyTyp!==P.PolyTyp&&(a.WindDelta===0&&Math.abs(P.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||P.WindCnt2===0)?(this.AddOutPt(a,A),F&&(a.OutIdx=-1)):P.WindDelta===0&&Math.abs(a.WindCnt)===1&&(this.m_ClipType!==e.ClipType.ctUnion||a.WindCnt2===0)&&(this.AddOutPt(P,A),j&&(P.OutIdx=-1)));return;}if(a.PolyTyp===P.PolyTyp){if(this.IsEvenOddFillType(a)){var _=a.WindCnt;a.WindCnt=P.WindCnt,P.WindCnt=_;}else a.WindCnt+P.WindDelta===0?a.WindCnt=-a.WindCnt:a.WindCnt+=P.WindDelta,P.WindCnt-a.WindDelta===0?P.WindCnt=-P.WindCnt:P.WindCnt-=a.WindDelta;}else this.IsEvenOddFillType(P)?a.WindCnt2=a.WindCnt2===0?1:0:a.WindCnt2+=P.WindDelta,this.IsEvenOddFillType(a)?P.WindCnt2=P.WindCnt2===0?1:0:P.WindCnt2-=a.WindDelta;var st,St,Pt,Bt;a.PolyTyp===e.PolyType.ptSubject?(st=this.m_SubjFillType,Pt=this.m_ClipFillType):(st=this.m_ClipFillType,Pt=this.m_SubjFillType),P.PolyTyp===e.PolyType.ptSubject?(St=this.m_SubjFillType,Bt=this.m_ClipFillType):(St=this.m_ClipFillType,Bt=this.m_SubjFillType);var Ht,jt;switch(st){case e.PolyFillType.pftPositive:Ht=a.WindCnt;break;case e.PolyFillType.pftNegative:Ht=-a.WindCnt;break;default:Ht=Math.abs(a.WindCnt);break;}switch(St){case e.PolyFillType.pftPositive:jt=P.WindCnt;break;case e.PolyFillType.pftNegative:jt=-P.WindCnt;break;default:jt=Math.abs(P.WindCnt);break;}if(F&&j)Ht!==0&&Ht!==1||jt!==0&&jt!==1||a.PolyTyp!==P.PolyTyp&&this.m_ClipType!==e.ClipType.ctXor?this.AddLocalMaxPoly(a,P,A):(this.AddOutPt(a,A),this.AddOutPt(P,A),e.Clipper.SwapSides(a,P),e.Clipper.SwapPolyIndexes(a,P));else if(F)(jt===0||jt===1)&&(this.AddOutPt(a,A),e.Clipper.SwapSides(a,P),e.Clipper.SwapPolyIndexes(a,P));else if(j)(Ht===0||Ht===1)&&(this.AddOutPt(P,A),e.Clipper.SwapSides(a,P),e.Clipper.SwapPolyIndexes(a,P));else if((Ht===0||Ht===1)&&(jt===0||jt===1)){var qt,oe;switch(Pt){case e.PolyFillType.pftPositive:qt=a.WindCnt2;break;case e.PolyFillType.pftNegative:qt=-a.WindCnt2;break;default:qt=Math.abs(a.WindCnt2);break;}switch(Bt){case e.PolyFillType.pftPositive:oe=P.WindCnt2;break;case e.PolyFillType.pftNegative:oe=-P.WindCnt2;break;default:oe=Math.abs(P.WindCnt2);break;}if(a.PolyTyp!==P.PolyTyp)this.AddLocalMinPoly(a,P,A);else if(Ht===1&&jt===1)switch(this.m_ClipType){case e.ClipType.ctIntersection:qt>0&&oe>0&&this.AddLocalMinPoly(a,P,A);break;case e.ClipType.ctUnion:qt<=0&&oe<=0&&this.AddLocalMinPoly(a,P,A);break;case e.ClipType.ctDifference:(a.PolyTyp===e.PolyType.ptClip&&qt>0&&oe>0||a.PolyTyp===e.PolyType.ptSubject&&qt<=0&&oe<=0)&&this.AddLocalMinPoly(a,P,A);break;case e.ClipType.ctXor:this.AddLocalMinPoly(a,P,A);break;}else e.Clipper.SwapSides(a,P);}},e.Clipper.prototype.DeleteFromSEL=function(a){var P=a.PrevInSEL,A=a.NextInSEL;P===null&&A===null&&a!==this.m_SortedEdges||(P!==null?P.NextInSEL=A:this.m_SortedEdges=A,A!==null&&(A.PrevInSEL=P),a.NextInSEL=null,a.PrevInSEL=null);},e.Clipper.prototype.ProcessHorizontals=function(){for(var a={};this.PopEdgeFromSEL(a);)this.ProcessHorizontal(a.v);},e.Clipper.prototype.GetHorzDirection=function(a,P){a.Bot.X<a.Top.X?(P.Left=a.Bot.X,P.Right=a.Top.X,P.Dir=e.Direction.dLeftToRight):(P.Left=a.Top.X,P.Right=a.Bot.X,P.Dir=e.Direction.dRightToLeft);},e.Clipper.prototype.ProcessHorizontal=function(a){var P={Dir:null,Left:null,Right:null};this.GetHorzDirection(a,P);for(var A=P.Dir,F=P.Left,j=P.Right,_=a.WindDelta===0,st=a,St=null;st.NextInLML!==null&&e.ClipperBase.IsHorizontal(st.NextInLML);)st=st.NextInLML;st.NextInLML===null&&(St=this.GetMaximaPair(st));var Pt=this.m_Maxima;if(Pt!==null)if(A===e.Direction.dLeftToRight){for(;Pt!==null&&Pt.X<=a.Bot.X;)Pt=Pt.Next;Pt!==null&&Pt.X>=st.Top.X&&(Pt=null);}else{for(;Pt.Next!==null&&Pt.Next.X<a.Bot.X;)Pt=Pt.Next;Pt.X<=st.Top.X&&(Pt=null);}for(var Bt=null;;){for(var Ht=a===st,jt=this.GetNextInAEL(a,A);jt!==null;){if(Pt!==null)if(A===e.Direction.dLeftToRight)for(;Pt!==null&&Pt.X<jt.Curr.X;)a.OutIdx>=0&&!_&&this.AddOutPt(a,new e.IntPoint2(Pt.X,a.Bot.Y)),Pt=Pt.Next;else for(;Pt!==null&&Pt.X>jt.Curr.X;)a.OutIdx>=0&&!_&&this.AddOutPt(a,new e.IntPoint2(Pt.X,a.Bot.Y)),Pt=Pt.Prev;if(A===e.Direction.dLeftToRight&&jt.Curr.X>j||A===e.Direction.dRightToLeft&&jt.Curr.X<F||jt.Curr.X===a.Top.X&&a.NextInLML!==null&&jt.Dx<a.NextInLML.Dx)break;if(a.OutIdx>=0&&!_){e.use_xyz&&(A===e.Direction.dLeftToRight?this.SetZ(jt.Curr,a,jt):this.SetZ(jt.Curr,jt,a)),Bt=this.AddOutPt(a,jt.Curr);for(var qt=this.m_SortedEdges;qt!==null;){if(qt.OutIdx>=0&&this.HorzSegmentsOverlap(a.Bot.X,a.Top.X,qt.Bot.X,qt.Top.X)){var oe=this.GetLastOutPt(qt);this.AddJoin(oe,Bt,qt.Top);}qt=qt.NextInSEL;}this.AddGhostJoin(Bt,a.Bot);}if(jt===St&&Ht){a.OutIdx>=0&&this.AddLocalMaxPoly(a,St,a.Top),this.DeleteFromAEL(a),this.DeleteFromAEL(St);return;}if(A===e.Direction.dLeftToRight){var me=new e.IntPoint2(jt.Curr.X,a.Curr.Y);this.IntersectEdges(a,jt,me);}else{var me=new e.IntPoint2(jt.Curr.X,a.Curr.Y);this.IntersectEdges(jt,a,me);}var Se=this.GetNextInAEL(jt,A);this.SwapPositionsInAEL(a,jt),jt=Se;}if(a.NextInLML===null||!e.ClipperBase.IsHorizontal(a.NextInLML))break;a=this.UpdateEdgeIntoAEL(a),a.OutIdx>=0&&this.AddOutPt(a,a.Bot),P={Dir:A,Left:F,Right:j},this.GetHorzDirection(a,P),A=P.Dir,F=P.Left,j=P.Right;}if(a.OutIdx>=0&&Bt===null){Bt=this.GetLastOutPt(a);for(var qt=this.m_SortedEdges;qt!==null;){if(qt.OutIdx>=0&&this.HorzSegmentsOverlap(a.Bot.X,a.Top.X,qt.Bot.X,qt.Top.X)){var oe=this.GetLastOutPt(qt);this.AddJoin(oe,Bt,qt.Top);}qt=qt.NextInSEL;}this.AddGhostJoin(Bt,a.Top);}if(a.NextInLML!==null){if(a.OutIdx>=0){if(Bt=this.AddOutPt(a,a.Top),a=this.UpdateEdgeIntoAEL(a),a.WindDelta===0)return;var De=a.PrevInAEL,Se=a.NextInAEL;if(De!==null&&De.Curr.X===a.Bot.X&&De.Curr.Y===a.Bot.Y&&De.WindDelta===0&&De.OutIdx>=0&&De.Curr.Y>De.Top.Y&&e.ClipperBase.SlopesEqual3(a,De,this.m_UseFullRange)){var oe=this.AddOutPt(De,a.Bot);this.AddJoin(Bt,oe,a.Top);}else if(Se!==null&&Se.Curr.X===a.Bot.X&&Se.Curr.Y===a.Bot.Y&&Se.WindDelta!==0&&Se.OutIdx>=0&&Se.Curr.Y>Se.Top.Y&&e.ClipperBase.SlopesEqual3(a,Se,this.m_UseFullRange)){var oe=this.AddOutPt(Se,a.Bot);this.AddJoin(Bt,oe,a.Top);}}else a=this.UpdateEdgeIntoAEL(a);}else a.OutIdx>=0&&this.AddOutPt(a,a.Top),this.DeleteFromAEL(a);},e.Clipper.prototype.GetNextInAEL=function(a,P){return P===e.Direction.dLeftToRight?a.NextInAEL:a.PrevInAEL;},e.Clipper.prototype.IsMinima=function(a){return a!==null&&a.Prev.NextInLML!==a&&a.Next.NextInLML!==a;},e.Clipper.prototype.IsMaxima=function(a,P){return a!==null&&a.Top.Y===P&&a.NextInLML===null;},e.Clipper.prototype.IsIntermediate=function(a,P){return a.Top.Y===P&&a.NextInLML!==null;},e.Clipper.prototype.GetMaximaPair=function(a){return e.IntPoint.op_Equality(a.Next.Top,a.Top)&&a.Next.NextInLML===null?a.Next:e.IntPoint.op_Equality(a.Prev.Top,a.Top)&&a.Prev.NextInLML===null?a.Prev:null;},e.Clipper.prototype.GetMaximaPairEx=function(a){var P=this.GetMaximaPair(a);return P===null||P.OutIdx===e.ClipperBase.Skip||P.NextInAEL===P.PrevInAEL&&!e.ClipperBase.IsHorizontal(P)?null:P;},e.Clipper.prototype.ProcessIntersections=function(a){if(this.m_ActiveEdges===null)return!0;try{if(this.BuildIntersectList(a),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(a){if(this.m_ActiveEdges!==null){var P=this.m_ActiveEdges;for(this.m_SortedEdges=P;P!==null;)P.PrevInSEL=P.PrevInAEL,P.NextInSEL=P.NextInAEL,P.Curr.X=e.Clipper.TopX(P,a),P=P.NextInAEL;for(var A=!0;A&&this.m_SortedEdges!==null;){for(A=!1,P=this.m_SortedEdges;P.NextInSEL!==null;){var F=P.NextInSEL,j=new e.IntPoint0();if(P.Curr.X>F.Curr.X){this.IntersectPoint(P,F,j),j.Y<a&&(j=new e.IntPoint2(e.Clipper.TopX(P,a),a));var _=new e.IntersectNode();_.Edge1=P,_.Edge2=F,_.Pt.X=j.X,_.Pt.Y=j.Y,e.use_xyz&&(_.Pt.Z=j.Z),this.m_IntersectList.push(_),this.SwapPositionsInSEL(P,F),A=!0;}else P=F;}if(P.PrevInSEL!==null)P.PrevInSEL.NextInSEL=null;else break;}this.m_SortedEdges=null;}},e.Clipper.prototype.EdgesAdjacent=function(a){return a.Edge1.NextInSEL===a.Edge2||a.Edge1.PrevInSEL===a.Edge2;},e.Clipper.IntersectNodeSort=function(a,P){return P.Pt.Y-a.Pt.Y;},e.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var a=this.m_IntersectList.length,P=0;P<a;P++){if(!this.EdgesAdjacent(this.m_IntersectList[P])){for(var A=P+1;A<a&&!this.EdgesAdjacent(this.m_IntersectList[A]);)A++;if(A===a)return!1;var F=this.m_IntersectList[P];this.m_IntersectList[P]=this.m_IntersectList[A],this.m_IntersectList[A]=F;}this.SwapPositionsInSEL(this.m_IntersectList[P].Edge1,this.m_IntersectList[P].Edge2);}return!0;},e.Clipper.prototype.ProcessIntersectList=function(){for(var a=0,P=this.m_IntersectList.length;a<P;a++){var A=this.m_IntersectList[a];this.IntersectEdges(A.Edge1,A.Edge2,A.Pt),this.SwapPositionsInAEL(A.Edge1,A.Edge2);}this.m_IntersectList.length=0;};var ko=function ko(a){return a<0?Math.ceil(a-0.5):Math.round(a);},as=function as(a){return a<0?Math.ceil(a-0.5):Math.floor(a+0.5);},Qn=function Qn(a){return a<0?-Math.round(Math.abs(a)):Math.round(a);},ls=function ls(a){return a<0?(a-=0.5,a<-2147483648?Math.ceil(a):a|0):(a+=0.5,a>2147483647?Math.floor(a):a|0);};s.msie?e.Clipper.Round=ko:s.chromium?e.Clipper.Round=Qn:s.safari?e.Clipper.Round=ls:e.Clipper.Round=as,e.Clipper.TopX=function(a,P){return P===a.Top.Y?a.Top.X:a.Bot.X+e.Clipper.Round(a.Dx*(P-a.Bot.Y));},e.Clipper.prototype.IntersectPoint=function(a,P,A){A.X=0,A.Y=0;var F,j;if(a.Dx===P.Dx){A.Y=a.Curr.Y,A.X=e.Clipper.TopX(a,A.Y);return;}if(a.Delta.X===0)A.X=a.Bot.X,e.ClipperBase.IsHorizontal(P)?A.Y=P.Bot.Y:(j=P.Bot.Y-P.Bot.X/P.Dx,A.Y=e.Clipper.Round(A.X/P.Dx+j));else if(P.Delta.X===0)A.X=P.Bot.X,e.ClipperBase.IsHorizontal(a)?A.Y=a.Bot.Y:(F=a.Bot.Y-a.Bot.X/a.Dx,A.Y=e.Clipper.Round(A.X/a.Dx+F));else{F=a.Bot.X-a.Bot.Y*a.Dx,j=P.Bot.X-P.Bot.Y*P.Dx;var _=(j-F)/(a.Dx-P.Dx);A.Y=e.Clipper.Round(_),Math.abs(a.Dx)<Math.abs(P.Dx)?A.X=e.Clipper.Round(a.Dx*_+F):A.X=e.Clipper.Round(P.Dx*_+j);}if(A.Y<a.Top.Y||A.Y<P.Top.Y){if(a.Top.Y>P.Top.Y)return A.Y=a.Top.Y,A.X=e.Clipper.TopX(P,a.Top.Y),A.X<a.Top.X;A.Y=P.Top.Y,Math.abs(a.Dx)<Math.abs(P.Dx)?A.X=e.Clipper.TopX(a,A.Y):A.X=e.Clipper.TopX(P,A.Y);}A.Y>a.Curr.Y&&(A.Y=a.Curr.Y,Math.abs(a.Dx)>Math.abs(P.Dx)?A.X=e.Clipper.TopX(P,A.Y):A.X=e.Clipper.TopX(a,A.Y));},e.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(a){for(var P=this.m_ActiveEdges;P!==null;){var A=this.IsMaxima(P,a);if(A){var F=this.GetMaximaPairEx(P);A=F===null||!e.ClipperBase.IsHorizontal(F);}if(A){this.StrictlySimple&&this.InsertMaxima(P.Top.X);var j=P.PrevInAEL;this.DoMaxima(P),j===null?P=this.m_ActiveEdges:P=j.NextInAEL;}else{if(this.IsIntermediate(P,a)&&e.ClipperBase.IsHorizontal(P.NextInLML)?(P=this.UpdateEdgeIntoAEL(P),P.OutIdx>=0&&this.AddOutPt(P,P.Bot),this.AddEdgeToSEL(P)):(P.Curr.X=e.Clipper.TopX(P,a),P.Curr.Y=a),e.use_xyz&&(P.Top.Y===a?P.Curr.Z=P.Top.Z:P.Bot.Y===a?P.Curr.Z=P.Bot.Z:P.Curr.Z=0),this.StrictlySimple){var j=P.PrevInAEL;if(P.OutIdx>=0&&P.WindDelta!==0&&j!==null&&j.OutIdx>=0&&j.Curr.X===P.Curr.X&&j.WindDelta!==0){var _=new e.IntPoint1(P.Curr);e.use_xyz&&this.SetZ(_,j,P);var st=this.AddOutPt(j,_),St=this.AddOutPt(P,_);this.AddJoin(st,St,_);}}P=P.NextInAEL;}}for(this.ProcessHorizontals(),this.m_Maxima=null,P=this.m_ActiveEdges;P!==null;){if(this.IsIntermediate(P,a)){var st=null;P.OutIdx>=0&&(st=this.AddOutPt(P,P.Top)),P=this.UpdateEdgeIntoAEL(P);var j=P.PrevInAEL,Pt=P.NextInAEL;if(j!==null&&j.Curr.X===P.Bot.X&&j.Curr.Y===P.Bot.Y&&st!==null&&j.OutIdx>=0&&j.Curr.Y===j.Top.Y&&e.ClipperBase.SlopesEqual5(P.Curr,P.Top,j.Curr,j.Top,this.m_UseFullRange)&&P.WindDelta!==0&&j.WindDelta!==0){var St=this.AddOutPt(ePrev2,P.Bot);this.AddJoin(st,St,P.Top);}else if(Pt!==null&&Pt.Curr.X===P.Bot.X&&Pt.Curr.Y===P.Bot.Y&&st!==null&&Pt.OutIdx>=0&&Pt.Curr.Y===Pt.Top.Y&&e.ClipperBase.SlopesEqual5(P.Curr,P.Top,Pt.Curr,Pt.Top,this.m_UseFullRange)&&P.WindDelta!==0&&Pt.WindDelta!==0){var St=this.AddOutPt(Pt,P.Bot);this.AddJoin(st,St,P.Top);}}P=P.NextInAEL;}},e.Clipper.prototype.DoMaxima=function(a){var P=this.GetMaximaPairEx(a);if(P===null){a.OutIdx>=0&&this.AddOutPt(a,a.Top),this.DeleteFromAEL(a);return;}for(var A=a.NextInAEL;A!==null&&A!==P;)this.IntersectEdges(a,A,a.Top),this.SwapPositionsInAEL(a,A),A=a.NextInAEL;a.OutIdx===-1&&P.OutIdx===-1?(this.DeleteFromAEL(a),this.DeleteFromAEL(P)):a.OutIdx>=0&&P.OutIdx>=0?(a.OutIdx>=0&&this.AddLocalMaxPoly(a,P,a.Top),this.DeleteFromAEL(a),this.DeleteFromAEL(P)):e.use_lines&&a.WindDelta===0?(a.OutIdx>=0&&(this.AddOutPt(a,a.Top),a.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(a),P.OutIdx>=0&&(this.AddOutPt(P,a.Top),P.OutIdx=e.ClipperBase.Unassigned),this.DeleteFromAEL(P)):e.Error("DoMaxima error");},e.Clipper.ReversePaths=function(a){for(var P=0,A=a.length;P<A;P++)a[P].reverse();},e.Clipper.Orientation=function(a){return e.Clipper.Area(a)>=0;},e.Clipper.prototype.PointCount=function(a){if(a===null)return 0;var P=0,A=a;do P++,A=A.Next;while(A!==a);return P;},e.Clipper.prototype.BuildResult=function(a){e.Clear(a);for(var P=0,A=this.m_PolyOuts.length;P<A;P++){var F=this.m_PolyOuts[P];if(F.Pts!==null){var j=F.Pts.Prev,_=this.PointCount(j);if(!(_<2)){for(var st=new Array(_),St=0;St<_;St++)st[St]=j.Pt,j=j.Prev;a.push(st);}}}},e.Clipper.prototype.BuildResult2=function(a){a.Clear();for(var P=0,A=this.m_PolyOuts.length;P<A;P++){var F=this.m_PolyOuts[P],j=this.PointCount(F.Pts);if(!(F.IsOpen&&j<2||!F.IsOpen&&j<3)){this.FixHoleLinkage(F);var _=new e.PolyNode();a.m_AllPolys.push(_),F.PolyNode=_,_.m_polygon.length=j;for(var st=F.Pts.Prev,St=0;St<j;St++)_.m_polygon[St]=st.Pt,st=st.Prev;}}for(var P=0,A=this.m_PolyOuts.length;P<A;P++){var F=this.m_PolyOuts[P];F.PolyNode!==null&&(F.IsOpen?(F.PolyNode.IsOpen=!0,a.AddChild(F.PolyNode)):F.FirstLeft!==null&&F.FirstLeft.PolyNode!==null?F.FirstLeft.PolyNode.AddChild(F.PolyNode):a.AddChild(F.PolyNode));}},e.Clipper.prototype.FixupOutPolyline=function(a){for(var P=a.Pts,A=P.Prev;P!==A;)if(P=P.Next,e.IntPoint.op_Equality(P.Pt,P.Prev.Pt)){P===A&&(A=P.Prev);var F=P.Prev;F.Next=P.Next,P.Next.Prev=F,P=F;}P===P.Prev&&(a.Pts=null);},e.Clipper.prototype.FixupOutPolygon=function(a){var P=null;a.BottomPt=null;for(var A=a.Pts,F=this.PreserveCollinear||this.StrictlySimple;;){if(A.Prev===A||A.Prev===A.Next){a.Pts=null;return;}if(e.IntPoint.op_Equality(A.Pt,A.Next.Pt)||e.IntPoint.op_Equality(A.Pt,A.Prev.Pt)||e.ClipperBase.SlopesEqual4(A.Prev.Pt,A.Pt,A.Next.Pt,this.m_UseFullRange)&&(!F||!this.Pt2IsBetweenPt1AndPt3(A.Prev.Pt,A.Pt,A.Next.Pt)))P=null,A.Prev.Next=A.Next,A.Next.Prev=A.Prev,A=A.Prev;else{if(A===P)break;P===null&&(P=A),A=A.Next;}}a.Pts=A;},e.Clipper.prototype.DupOutPt=function(a,P){var A=new e.OutPt();return A.Pt.X=a.Pt.X,A.Pt.Y=a.Pt.Y,e.use_xyz&&(A.Pt.Z=a.Pt.Z),A.Idx=a.Idx,P?(A.Next=a.Next,A.Prev=a,a.Next.Prev=A,a.Next=A):(A.Prev=a.Prev,A.Next=a,a.Prev.Next=A,a.Prev=A),A;},e.Clipper.prototype.GetOverlap=function(a,P,A,F,j){return a<P?A<F?(j.Left=Math.max(a,A),j.Right=Math.min(P,F)):(j.Left=Math.max(a,F),j.Right=Math.min(P,A)):A<F?(j.Left=Math.max(P,A),j.Right=Math.min(a,F)):(j.Left=Math.max(P,F),j.Right=Math.min(a,A)),j.Left<j.Right;},e.Clipper.prototype.JoinHorz=function(a,P,A,F,j,_){var st=a.Pt.X>P.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight,St=A.Pt.X>F.Pt.X?e.Direction.dRightToLeft:e.Direction.dLeftToRight;if(st===St)return!1;if(st===e.Direction.dLeftToRight){for(;a.Next.Pt.X<=j.X&&a.Next.Pt.X>=a.Pt.X&&a.Next.Pt.Y===j.Y;)a=a.Next;_&&a.Pt.X!==j.X&&(a=a.Next),P=this.DupOutPt(a,!_),e.IntPoint.op_Inequality(P.Pt,j)&&(a=P,a.Pt.X=j.X,a.Pt.Y=j.Y,e.use_xyz&&(a.Pt.Z=j.Z),P=this.DupOutPt(a,!_));}else{for(;a.Next.Pt.X>=j.X&&a.Next.Pt.X<=a.Pt.X&&a.Next.Pt.Y===j.Y;)a=a.Next;!_&&a.Pt.X!==j.X&&(a=a.Next),P=this.DupOutPt(a,_),e.IntPoint.op_Inequality(P.Pt,j)&&(a=P,a.Pt.X=j.X,a.Pt.Y=j.Y,e.use_xyz&&(a.Pt.Z=j.Z),P=this.DupOutPt(a,_));}if(St===e.Direction.dLeftToRight){for(;A.Next.Pt.X<=j.X&&A.Next.Pt.X>=A.Pt.X&&A.Next.Pt.Y===j.Y;)A=A.Next;_&&A.Pt.X!==j.X&&(A=A.Next),F=this.DupOutPt(A,!_),e.IntPoint.op_Inequality(F.Pt,j)&&(A=F,A.Pt.X=j.X,A.Pt.Y=j.Y,e.use_xyz&&(A.Pt.Z=j.Z),F=this.DupOutPt(A,!_));}else{for(;A.Next.Pt.X>=j.X&&A.Next.Pt.X<=A.Pt.X&&A.Next.Pt.Y===j.Y;)A=A.Next;!_&&A.Pt.X!==j.X&&(A=A.Next),F=this.DupOutPt(A,_),e.IntPoint.op_Inequality(F.Pt,j)&&(A=F,A.Pt.X=j.X,A.Pt.Y=j.Y,e.use_xyz&&(A.Pt.Z=j.Z),F=this.DupOutPt(A,_));}return st===e.Direction.dLeftToRight===_?(a.Prev=A,A.Next=a,P.Next=F,F.Prev=P):(a.Next=A,A.Prev=a,P.Prev=F,F.Next=P),!0;},e.Clipper.prototype.JoinPoints=function(a,P,A){var F=a.OutPt1,j=new e.OutPt(),_=a.OutPt2,st=new e.OutPt(),St=a.OutPt1.Pt.Y===a.OffPt.Y;if(St&&e.IntPoint.op_Equality(a.OffPt,a.OutPt1.Pt)&&e.IntPoint.op_Equality(a.OffPt,a.OutPt2.Pt)){if(P!==A)return!1;for(j=a.OutPt1.Next;j!==F&&e.IntPoint.op_Equality(j.Pt,a.OffPt);)j=j.Next;var Pt=j.Pt.Y>a.OffPt.Y;for(st=a.OutPt2.Next;st!==_&&e.IntPoint.op_Equality(st.Pt,a.OffPt);)st=st.Next;var Bt=st.Pt.Y>a.OffPt.Y;return Pt===Bt?!1:Pt?(j=this.DupOutPt(F,!1),st=this.DupOutPt(_,!0),F.Prev=_,_.Next=F,j.Next=st,st.Prev=j,a.OutPt1=F,a.OutPt2=j,!0):(j=this.DupOutPt(F,!0),st=this.DupOutPt(_,!1),F.Next=_,_.Prev=F,j.Prev=st,st.Next=j,a.OutPt1=F,a.OutPt2=j,!0);}else if(St){for(j=F;F.Prev.Pt.Y===F.Pt.Y&&F.Prev!==j&&F.Prev!==_;)F=F.Prev;for(;j.Next.Pt.Y===j.Pt.Y&&j.Next!==F&&j.Next!==_;)j=j.Next;if(j.Next===F||j.Next===_)return!1;for(st=_;_.Prev.Pt.Y===_.Pt.Y&&_.Prev!==st&&_.Prev!==j;)_=_.Prev;for(;st.Next.Pt.Y===st.Pt.Y&&st.Next!==_&&st.Next!==F;)st=st.Next;if(st.Next===_||st.Next===F)return!1;var Ht={Left:null,Right:null};if(!this.GetOverlap(F.Pt.X,j.Pt.X,_.Pt.X,st.Pt.X,Ht))return!1;var jt=Ht.Left,qt=Ht.Right,oe=new e.IntPoint0(),me;return F.Pt.X>=jt&&F.Pt.X<=qt?(oe.X=F.Pt.X,oe.Y=F.Pt.Y,e.use_xyz&&(oe.Z=F.Pt.Z),me=F.Pt.X>j.Pt.X):_.Pt.X>=jt&&_.Pt.X<=qt?(oe.X=_.Pt.X,oe.Y=_.Pt.Y,e.use_xyz&&(oe.Z=_.Pt.Z),me=_.Pt.X>st.Pt.X):j.Pt.X>=jt&&j.Pt.X<=qt?(oe.X=j.Pt.X,oe.Y=j.Pt.Y,e.use_xyz&&(oe.Z=j.Pt.Z),me=j.Pt.X>F.Pt.X):(oe.X=st.Pt.X,oe.Y=st.Pt.Y,e.use_xyz&&(oe.Z=st.Pt.Z),me=st.Pt.X>_.Pt.X),a.OutPt1=F,a.OutPt2=_,this.JoinHorz(F,j,_,st,oe,me);}else{for(j=F.Next;e.IntPoint.op_Equality(j.Pt,F.Pt)&&j!==F;)j=j.Next;var Se=j.Pt.Y>F.Pt.Y||!e.ClipperBase.SlopesEqual4(F.Pt,j.Pt,a.OffPt,this.m_UseFullRange);if(Se){for(j=F.Prev;e.IntPoint.op_Equality(j.Pt,F.Pt)&&j!==F;)j=j.Prev;if(j.Pt.Y>F.Pt.Y||!e.ClipperBase.SlopesEqual4(F.Pt,j.Pt,a.OffPt,this.m_UseFullRange))return!1;}for(st=_.Next;e.IntPoint.op_Equality(st.Pt,_.Pt)&&st!==_;)st=st.Next;var De=st.Pt.Y>_.Pt.Y||!e.ClipperBase.SlopesEqual4(_.Pt,st.Pt,a.OffPt,this.m_UseFullRange);if(De){for(st=_.Prev;e.IntPoint.op_Equality(st.Pt,_.Pt)&&st!==_;)st=st.Prev;if(st.Pt.Y>_.Pt.Y||!e.ClipperBase.SlopesEqual4(_.Pt,st.Pt,a.OffPt,this.m_UseFullRange))return!1;}return j===F||st===_||j===st||P===A&&Se===De?!1:Se?(j=this.DupOutPt(F,!1),st=this.DupOutPt(_,!0),F.Prev=_,_.Next=F,j.Next=st,st.Prev=j,a.OutPt1=F,a.OutPt2=j,!0):(j=this.DupOutPt(F,!0),st=this.DupOutPt(_,!1),F.Next=_,_.Prev=F,j.Prev=st,st.Next=j,a.OutPt1=F,a.OutPt2=j,!0);}},e.Clipper.GetBounds=function(a){for(var P=0,A=a.length;P<A&&a[P].length===0;)P++;if(P===A)return new e.IntRect(0,0,0,0);var F=new e.IntRect();for(F.left=a[P][0].X,F.right=F.left,F.top=a[P][0].Y,F.bottom=F.top;P<A;P++)for(var j=0,_=a[P].length;j<_;j++)a[P][j].X<F.left?F.left=a[P][j].X:a[P][j].X>F.right&&(F.right=a[P][j].X),a[P][j].Y<F.top?F.top=a[P][j].Y:a[P][j].Y>F.bottom&&(F.bottom=a[P][j].Y);return F;},e.Clipper.prototype.GetBounds2=function(a){var P=a,A=new e.IntRect();for(A.left=a.Pt.X,A.right=a.Pt.X,A.top=a.Pt.Y,A.bottom=a.Pt.Y,a=a.Next;a!==P;)a.Pt.X<A.left&&(A.left=a.Pt.X),a.Pt.X>A.right&&(A.right=a.Pt.X),a.Pt.Y<A.top&&(A.top=a.Pt.Y),a.Pt.Y>A.bottom&&(A.bottom=a.Pt.Y),a=a.Next;return A;},e.Clipper.PointInPolygon=function(a,P){var A=0,F=P.length;if(F<3)return 0;for(var j=P[0],_=1;_<=F;++_){var st=_===F?P[0]:P[_];if(st.Y===a.Y&&(st.X===a.X||j.Y===a.Y&&st.X>a.X==j.X<a.X))return-1;if(j.Y<a.Y!=st.Y<a.Y){if(j.X>=a.X){if(st.X>a.X)A=1-A;else{var St=(j.X-a.X)*(st.Y-a.Y)-(st.X-a.X)*(j.Y-a.Y);if(St===0)return-1;St>0==st.Y>j.Y&&(A=1-A);}}else if(st.X>a.X){var St=(j.X-a.X)*(st.Y-a.Y)-(st.X-a.X)*(j.Y-a.Y);if(St===0)return-1;St>0==st.Y>j.Y&&(A=1-A);}}j=st;}return A;},e.Clipper.prototype.PointInPolygon=function(a,P){var A=0,F=P,j=a.X,_=a.Y,st=P.Pt.X,St=P.Pt.Y;do{P=P.Next;var Pt=P.Pt.X,Bt=P.Pt.Y;if(Bt===_&&(Pt===j||St===_&&Pt>j==st<j))return-1;if(St<_!=Bt<_){if(st>=j){if(Pt>j)A=1-A;else{var Ht=(st-j)*(Bt-_)-(Pt-j)*(St-_);if(Ht===0)return-1;Ht>0==Bt>St&&(A=1-A);}}else if(Pt>j){var Ht=(st-j)*(Bt-_)-(Pt-j)*(St-_);if(Ht===0)return-1;Ht>0==Bt>St&&(A=1-A);}}st=Pt,St=Bt;}while(F!==P);return A;},e.Clipper.prototype.Poly2ContainsPoly1=function(a,P){var A=a;do{var F=this.PointInPolygon(A.Pt,P);if(F>=0)return F>0;A=A.Next;}while(A!==a);return!0;},e.Clipper.prototype.FixupFirstLefts1=function(a,P){for(var A,F,j=0,_=this.m_PolyOuts.length;j<_;j++)A=this.m_PolyOuts[j],F=e.Clipper.ParseFirstLeft(A.FirstLeft),A.Pts!==null&&F===a&&this.Poly2ContainsPoly1(A.Pts,P.Pts)&&(A.FirstLeft=P);},e.Clipper.prototype.FixupFirstLefts2=function(a,P){for(var A=P.FirstLeft,F,j,_=0,st=this.m_PolyOuts.length;_<st;_++)F=this.m_PolyOuts[_],!(F.Pts===null||F===P||F===a)&&(j=e.Clipper.ParseFirstLeft(F.FirstLeft),!(j!==A&&j!==a&&j!==P)&&(this.Poly2ContainsPoly1(F.Pts,a.Pts)?F.FirstLeft=a:this.Poly2ContainsPoly1(F.Pts,P.Pts)?F.FirstLeft=P:(F.FirstLeft===a||F.FirstLeft===P)&&(F.FirstLeft=A)));},e.Clipper.prototype.FixupFirstLefts3=function(a,P){for(var A,F,j=0,_=this.m_PolyOuts.length;j<_;j++)A=this.m_PolyOuts[j],F=e.Clipper.ParseFirstLeft(A.FirstLeft),A.Pts!==null&&F===a&&(A.FirstLeft=P);},e.Clipper.ParseFirstLeft=function(a){for(;a!==null&&a.Pts===null;)a=a.FirstLeft;return a;},e.Clipper.prototype.JoinCommonEdges=function(){for(var a=0,P=this.m_Joins.length;a<P;a++){var A=this.m_Joins[a],F=this.GetOutRec(A.OutPt1.Idx),j=this.GetOutRec(A.OutPt2.Idx);if(!(F.Pts===null||j.Pts===null)&&!(F.IsOpen||j.IsOpen)){var _;F===j?_=F:this.OutRec1RightOfOutRec2(F,j)?_=j:this.OutRec1RightOfOutRec2(j,F)?_=F:_=this.GetLowermostRec(F,j),this.JoinPoints(A,F,j)&&(F===j?(F.Pts=A.OutPt1,F.BottomPt=null,j=this.CreateOutRec(),j.Pts=A.OutPt2,this.UpdateOutPtIdxs(j),this.Poly2ContainsPoly1(j.Pts,F.Pts)?(j.IsHole=!F.IsHole,j.FirstLeft=F,this.m_UsingPolyTree&&this.FixupFirstLefts2(j,F),(j.IsHole^this.ReverseSolution)==this.Area$1(j)>0&&this.ReversePolyPtLinks(j.Pts)):this.Poly2ContainsPoly1(F.Pts,j.Pts)?(j.IsHole=F.IsHole,F.IsHole=!j.IsHole,j.FirstLeft=F.FirstLeft,F.FirstLeft=j,this.m_UsingPolyTree&&this.FixupFirstLefts2(F,j),(F.IsHole^this.ReverseSolution)==this.Area$1(F)>0&&this.ReversePolyPtLinks(F.Pts)):(j.IsHole=F.IsHole,j.FirstLeft=F.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(F,j))):(j.Pts=null,j.BottomPt=null,j.Idx=F.Idx,F.IsHole=_.IsHole,_===j&&(F.FirstLeft=j.FirstLeft),j.FirstLeft=F,this.m_UsingPolyTree&&this.FixupFirstLefts3(j,F)));}}},e.Clipper.prototype.UpdateOutPtIdxs=function(a){var P=a.Pts;do P.Idx=a.Idx,P=P.Prev;while(P!==a.Pts);},e.Clipper.prototype.DoSimplePolygons=function(){for(var a=0;a<this.m_PolyOuts.length;){var P=this.m_PolyOuts[a++],A=P.Pts;if(!(A===null||P.IsOpen))do{for(var F=A.Next;F!==P.Pts;){if(e.IntPoint.op_Equality(A.Pt,F.Pt)&&F.Next!==A&&F.Prev!==A){var j=A.Prev,_=F.Prev;A.Prev=_,_.Next=A,F.Prev=j,j.Next=F,P.Pts=A;var st=this.CreateOutRec();st.Pts=F,this.UpdateOutPtIdxs(st),this.Poly2ContainsPoly1(st.Pts,P.Pts)?(st.IsHole=!P.IsHole,st.FirstLeft=P,this.m_UsingPolyTree&&this.FixupFirstLefts2(st,P)):this.Poly2ContainsPoly1(P.Pts,st.Pts)?(st.IsHole=P.IsHole,P.IsHole=!st.IsHole,st.FirstLeft=P.FirstLeft,P.FirstLeft=st,this.m_UsingPolyTree&&this.FixupFirstLefts2(P,st)):(st.IsHole=P.IsHole,st.FirstLeft=P.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(P,st)),F=A;}F=F.Next;}A=A.Next;}while(A!==P.Pts);}},e.Clipper.Area=function(a){if(!Array.isArray(a))return 0;var P=a.length;if(P<3)return 0;for(var A=0,F=0,j=P-1;F<P;++F)A+=(a[j].X+a[F].X)*(a[j].Y-a[F].Y),j=F;return-A*0.5;},e.Clipper.prototype.Area=function(a){var P=a;if(a===null)return 0;var A=0;do A=A+(a.Prev.Pt.X+a.Pt.X)*(a.Prev.Pt.Y-a.Pt.Y),a=a.Next;while(a!==P);return A*0.5;},e.Clipper.prototype.Area$1=function(a){return this.Area(a.Pts);},e.Clipper.SimplifyPolygon=function(a,P){var A=new Array(),F=new e.Clipper(0);return F.StrictlySimple=!0,F.AddPath(a,e.PolyType.ptSubject,!0),F.Execute(e.ClipType.ctUnion,A,P,P),A;},e.Clipper.SimplifyPolygons=function(a,P){_typeof(P)>"u"&&(P=e.PolyFillType.pftEvenOdd);var A=new Array(),F=new e.Clipper(0);return F.StrictlySimple=!0,F.AddPaths(a,e.PolyType.ptSubject,!0),F.Execute(e.ClipType.ctUnion,A,P,P),A;},e.Clipper.DistanceSqrd=function(a,P){var A=a.X-P.X,F=a.Y-P.Y;return A*A+F*F;},e.Clipper.DistanceFromLineSqrd=function(a,P,A){var F=P.Y-A.Y,j=A.X-P.X,_=F*P.X+j*P.Y;return _=F*a.X+j*a.Y-_,_*_/(F*F+j*j);},e.Clipper.SlopesNearCollinear=function(a,P,A,F){return Math.abs(a.X-P.X)>Math.abs(a.Y-P.Y)?a.X>P.X==a.X<A.X?e.Clipper.DistanceFromLineSqrd(a,P,A)<F:P.X>a.X==P.X<A.X?e.Clipper.DistanceFromLineSqrd(P,a,A)<F:e.Clipper.DistanceFromLineSqrd(A,a,P)<F:a.Y>P.Y==a.Y<A.Y?e.Clipper.DistanceFromLineSqrd(a,P,A)<F:P.Y>a.Y==P.Y<A.Y?e.Clipper.DistanceFromLineSqrd(P,a,A)<F:e.Clipper.DistanceFromLineSqrd(A,a,P)<F;},e.Clipper.PointsAreClose=function(a,P,A){var F=a.X-P.X,j=a.Y-P.Y;return F*F+j*j<=A;},e.Clipper.ExcludeOp=function(a){var P=a.Prev;return P.Next=a.Next,a.Next.Prev=P,P.Idx=0,P;},e.Clipper.CleanPolygon=function(a,P){_typeof(P)>"u"&&(P=1.415);var A=a.length;if(A===0)return new Array();for(var F=new Array(A),j=0;j<A;++j)F[j]=new e.OutPt();for(var j=0;j<A;++j)F[j].Pt=a[j],F[j].Next=F[(j+1)%A],F[j].Next.Prev=F[j],F[j].Idx=0;for(var _=P*P,st=F[0];st.Idx===0&&st.Next!==st.Prev;)e.Clipper.PointsAreClose(st.Pt,st.Prev.Pt,_)?(st=e.Clipper.ExcludeOp(st),A--):e.Clipper.PointsAreClose(st.Prev.Pt,st.Next.Pt,_)?(e.Clipper.ExcludeOp(st.Next),st=e.Clipper.ExcludeOp(st),A-=2):e.Clipper.SlopesNearCollinear(st.Prev.Pt,st.Pt,st.Next.Pt,_)?(st=e.Clipper.ExcludeOp(st),A--):(st.Idx=1,st=st.Next);A<3&&(A=0);for(var St=new Array(A),j=0;j<A;++j)St[j]=new e.IntPoint1(st.Pt),st=st.Next;return F=null,St;},e.Clipper.CleanPolygons=function(a,P){for(var A=new Array(a.length),F=0,j=a.length;F<j;F++)A[F]=e.Clipper.CleanPolygon(a[F],P);return A;},e.Clipper.Minkowski=function(a,P,A,F){var j=F?1:0,_=a.length,st=P.length,St=new Array();if(A)for(var Pt=0;Pt<st;Pt++){for(var Bt=new Array(_),Ht=0,jt=a.length,qt=a[Ht];Ht<jt;Ht++,qt=a[Ht])Bt[Ht]=new e.IntPoint2(P[Pt].X+qt.X,P[Pt].Y+qt.Y);St.push(Bt);}else for(var Pt=0;Pt<st;Pt++){for(var Bt=new Array(_),Ht=0,jt=a.length,qt=a[Ht];Ht<jt;Ht++,qt=a[Ht])Bt[Ht]=new e.IntPoint2(P[Pt].X-qt.X,P[Pt].Y-qt.Y);St.push(Bt);}for(var oe=new Array(),Pt=0;Pt<st-1+j;Pt++)for(var Ht=0;Ht<_;Ht++){var me=new Array();me.push(St[Pt%st][Ht%_]),me.push(St[(Pt+1)%st][Ht%_]),me.push(St[(Pt+1)%st][(Ht+1)%_]),me.push(St[Pt%st][(Ht+1)%_]),e.Clipper.Orientation(me)||me.reverse(),oe.push(me);}return oe;},e.Clipper.MinkowskiSum=function(a,P,A){if(P[0]instanceof Array){for(var j=P,st=new e.Paths(),_=new e.Clipper(),St=0;St<j.length;++St){var Pt=e.Clipper.Minkowski(a,j[St],!0,A);if(_.AddPaths(Pt,e.PolyType.ptSubject,!0),A){var F=e.Clipper.TranslatePath(j[St],a[0]);_.AddPath(F,e.PolyType.ptClip,!0);}}return _.Execute(e.ClipType.ctUnion,st,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),st;}else{var F=P,j=e.Clipper.Minkowski(a,F,!0,A),_=new e.Clipper();return _.AddPaths(j,e.PolyType.ptSubject,!0),_.Execute(e.ClipType.ctUnion,j,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),j;}},e.Clipper.TranslatePath=function(a,P){for(var A=new e.Path(),F=0;F<a.length;F++)A.push(new e.IntPoint2(a[F].X+P.X,a[F].Y+P.Y));return A;},e.Clipper.MinkowskiDiff=function(a,P){var A=e.Clipper.Minkowski(a,P,!1,!0),F=new e.Clipper();return F.AddPaths(A,e.PolyType.ptSubject,!0),F.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftNonZero,e.PolyFillType.pftNonZero),A;},e.Clipper.PolyTreeToPaths=function(a){var P=new Array();return e.Clipper.AddPolyNodeToPaths(a,e.Clipper.NodeType.ntAny,P),P;},e.Clipper.AddPolyNodeToPaths=function(a,P,A){var F=!0;switch(P){case e.Clipper.NodeType.ntOpen:return;case e.Clipper.NodeType.ntClosed:F=!a.IsOpen;break;}a.m_polygon.length>0&&F&&A.push(a.m_polygon);for(var j=0,_=a.Childs(),st=_.length,St=_[j];j<st;j++,St=_[j])e.Clipper.AddPolyNodeToPaths(St,P,A);},e.Clipper.OpenPathsFromPolyTree=function(a){for(var P=new e.Paths(),A=0,F=a.ChildCount();A<F;A++)a.Childs()[A].IsOpen&&P.push(a.Childs()[A].m_polygon);return P;},e.Clipper.ClosedPathsFromPolyTree=function(a){var P=new e.Paths();return e.Clipper.AddPolyNodeToPaths(a,e.Clipper.NodeType.ntClosed,P),P;},Jn(e.Clipper,e.ClipperBase),e.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2},e.ClipperOffset=function(a,P){_typeof(a)>"u"&&(a=2),_typeof(P)>"u"&&(P=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=a,this.ArcTolerance=P,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(a,P,A){var F=a.length-1;if(!(F<0)){var j=new e.PolyNode();if(j.m_jointype=P,j.m_endtype=A,A===e.EndType.etClosedLine||A===e.EndType.etClosedPolygon)for(;F>0&&e.IntPoint.op_Equality(a[0],a[F]);)F--;j.m_polygon.push(a[0]);for(var _=0,st=0,St=1;St<=F;St++)e.IntPoint.op_Inequality(j.m_polygon[_],a[St])&&(_++,j.m_polygon.push(a[St]),(a[St].Y>j.m_polygon[st].Y||a[St].Y===j.m_polygon[st].Y&&a[St].X<j.m_polygon[st].X)&&(st=_));if(!(A===e.EndType.etClosedPolygon&&_<2)&&(this.m_polyNodes.AddChild(j),A===e.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,st);else{var Pt=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(j.m_polygon[st].Y>Pt.Y||j.m_polygon[st].Y===Pt.Y&&j.m_polygon[st].X<Pt.X)&&(this.m_lowest=new e.IntPoint2(this.m_polyNodes.ChildCount()-1,st));}}},e.ClipperOffset.prototype.AddPaths=function(a,P,A){for(var F=0,j=a.length;F<j;F++)this.AddPath(a[F],P,A);},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 a=0;a<this.m_polyNodes.ChildCount();a++){var P=this.m_polyNodes.Childs()[a];(P.m_endtype===e.EndType.etClosedPolygon||P.m_endtype===e.EndType.etClosedLine&&e.Clipper.Orientation(P.m_polygon))&&P.m_polygon.reverse();}else for(var a=0;a<this.m_polyNodes.ChildCount();a++){var P=this.m_polyNodes.Childs()[a];P.m_endtype===e.EndType.etClosedLine&&!e.Clipper.Orientation(P.m_polygon)&&P.m_polygon.reverse();}},e.ClipperOffset.GetUnitNormal=function(a,P){var A=P.X-a.X,F=P.Y-a.Y;if(A===0&&F===0)return new e.DoublePoint2(0,0);var j=1/Math.sqrt(A*A+F*F);return A*=j,F*=j,new e.DoublePoint2(F,-A);},e.ClipperOffset.prototype.DoOffset=function(a){if(this.m_destPolys=new Array(),this.m_delta=a,e.ClipperBase.near_zero(a)){for(var P=0;P<this.m_polyNodes.ChildCount();P++){var A=this.m_polyNodes.Childs()[P];A.m_endtype===e.EndType.etClosedPolygon&&this.m_destPolys.push(A.m_polygon);}return;}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=0.5;var F;this.ArcTolerance<=0?F=e.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(a)*e.ClipperOffset.def_arc_tolerance?F=Math.abs(a)*e.ClipperOffset.def_arc_tolerance:F=this.ArcTolerance;var j=3.14159265358979/Math.acos(1-F/Math.abs(a));this.m_sin=Math.sin(e.ClipperOffset.two_pi/j),this.m_cos=Math.cos(e.ClipperOffset.two_pi/j),this.m_StepsPerRad=j/e.ClipperOffset.two_pi,a<0&&(this.m_sin=-this.m_sin);for(var P=0;P<this.m_polyNodes.ChildCount();P++){var A=this.m_polyNodes.Childs()[P];this.m_srcPoly=A.m_polygon;var _=this.m_srcPoly.length;if(!(_===0||a<=0&&(_<3||A.m_endtype!==e.EndType.etClosedPolygon))){if(this.m_destPoly=new Array(),_===1){if(A.m_jointype===e.JoinType.jtRound)for(var st=1,St=0,Pt=1;Pt<=j;Pt++){this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+st*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y+St*a)));var Bt=st;st=st*this.m_cos-this.m_sin*St,St=Bt*this.m_sin+St*this.m_cos;}else for(var st=-1,St=-1,Pt=0;Pt<4;++Pt)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+st*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y+St*a))),st<0?st=1:St<0?St=1:st=-1;this.m_destPolys.push(this.m_destPoly);continue;}this.m_normals.length=0;for(var Pt=0;Pt<_-1;Pt++)this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[Pt],this.m_srcPoly[Pt+1]));if(A.m_endtype===e.EndType.etClosedLine||A.m_endtype===e.EndType.etClosedPolygon?this.m_normals.push(e.ClipperOffset.GetUnitNormal(this.m_srcPoly[_-1],this.m_srcPoly[0])):this.m_normals.push(new e.DoublePoint1(this.m_normals[_-2])),A.m_endtype===e.EndType.etClosedPolygon){for(var Ht=_-1,Pt=0;Pt<_;Pt++)Ht=this.OffsetPoint(Pt,Ht,A.m_jointype);this.m_destPolys.push(this.m_destPoly);}else if(A.m_endtype===e.EndType.etClosedLine){for(var Ht=_-1,Pt=0;Pt<_;Pt++)Ht=this.OffsetPoint(Pt,Ht,A.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array();for(var jt=this.m_normals[_-1],Pt=_-1;Pt>0;Pt--)this.m_normals[Pt]=new e.DoublePoint2(-this.m_normals[Pt-1].X,-this.m_normals[Pt-1].Y);this.m_normals[0]=new e.DoublePoint2(-jt.X,-jt.Y),Ht=0;for(var Pt=_-1;Pt>=0;Pt--)Ht=this.OffsetPoint(Pt,Ht,A.m_jointype);this.m_destPolys.push(this.m_destPoly);}else{for(var Ht=0,Pt=1;Pt<_-1;++Pt)Ht=this.OffsetPoint(Pt,Ht,A.m_jointype);var qt;if(A.m_endtype===e.EndType.etOpenButt){var Pt=_-1;qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[Pt].X+this.m_normals[Pt].X*a),e.ClipperOffset.Round(this.m_srcPoly[Pt].Y+this.m_normals[Pt].Y*a)),this.m_destPoly.push(qt),qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[Pt].X-this.m_normals[Pt].X*a),e.ClipperOffset.Round(this.m_srcPoly[Pt].Y-this.m_normals[Pt].Y*a)),this.m_destPoly.push(qt);}else{var Pt=_-1;Ht=_-2,this.m_sinA=0,this.m_normals[Pt]=new e.DoublePoint2(-this.m_normals[Pt].X,-this.m_normals[Pt].Y),A.m_endtype===e.EndType.etOpenSquare?this.DoSquare(Pt,Ht):this.DoRound(Pt,Ht);}for(var Pt=_-1;Pt>0;Pt--)this.m_normals[Pt]=new e.DoublePoint2(-this.m_normals[Pt-1].X,-this.m_normals[Pt-1].Y);this.m_normals[0]=new e.DoublePoint2(-this.m_normals[1].X,-this.m_normals[1].Y),Ht=_-1;for(var Pt=Ht-1;Pt>0;--Pt)Ht=this.OffsetPoint(Pt,Ht,A.m_jointype);A.m_endtype===e.EndType.etOpenButt?(qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*a)),this.m_destPoly.push(qt),qt=new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*a),e.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*a)),this.m_destPoly.push(qt)):(Ht=1,this.m_sinA=0,A.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 a=arguments,P=a[0]instanceof e.PolyTree;if(P){var A=a[0],F=a[1];A.Clear(),this.FixOrientations(),this.DoOffset(F);var j=new e.Clipper(0);if(j.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),F>0)j.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var _=e.Clipper.GetBounds(this.m_destPolys),st=new e.Path();if(st.push(new e.IntPoint2(_.left-10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.top-10)),st.push(new e.IntPoint2(_.left-10,_.top-10)),j.AddPath(st,e.PolyType.ptSubject,!0),j.ReverseSolution=!0,j.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),A.ChildCount()===1&&A.Childs()[0].ChildCount()>0){var St=A.Childs()[0];A.Childs()[0]=St.Childs()[0],A.Childs()[0].m_Parent=A;for(var Pt=1;Pt<St.ChildCount();Pt++)A.AddChild(St.Childs()[Pt]);}else A.Clear();}}else{var A=a[0],F=a[1];e.Clear(A),this.FixOrientations(),this.DoOffset(F);var j=new e.Clipper(0);if(j.AddPaths(this.m_destPolys,e.PolyType.ptSubject,!0),F>0)j.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftPositive,e.PolyFillType.pftPositive);else{var _=e.Clipper.GetBounds(this.m_destPolys),st=new e.Path();st.push(new e.IntPoint2(_.left-10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.bottom+10)),st.push(new e.IntPoint2(_.right+10,_.top-10)),st.push(new e.IntPoint2(_.left-10,_.top-10)),j.AddPath(st,e.PolyType.ptSubject,!0),j.ReverseSolution=!0,j.Execute(e.ClipType.ctUnion,A,e.PolyFillType.pftNegative,e.PolyFillType.pftNegative),A.length>0&&A.splice(0,1);}}},e.ClipperOffset.prototype.OffsetPoint=function(a,P,A){if(this.m_sinA=this.m_normals[P].X*this.m_normals[a].Y-this.m_normals[a].X*this.m_normals[P].Y,Math.abs(this.m_sinA*this.m_delta)<1){var F=this.m_normals[P].X*this.m_normals[a].X+this.m_normals[a].Y*this.m_normals[P].Y;if(F>0)return this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[P].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[P].Y*this.m_delta))),P;}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[a].X+this.m_normals[P].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[P].Y*this.m_delta))),this.m_destPoly.push(new e.IntPoint1(this.m_srcPoly[a])),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[a].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[a].Y*this.m_delta)));else switch(A){case e.JoinType.jtMiter:{var j=1+(this.m_normals[a].X*this.m_normals[P].X+this.m_normals[a].Y*this.m_normals[P].Y);j>=this.m_miterLim?this.DoMiter(a,P,j):this.DoSquare(a,P);break;}case e.JoinType.jtSquare:this.DoSquare(a,P);break;case e.JoinType.jtRound:this.DoRound(a,P);break;}return P=a,P;},e.ClipperOffset.prototype.DoSquare=function(a,P){var A=Math.tan(Math.atan2(this.m_sinA,this.m_normals[P].X*this.m_normals[a].X+this.m_normals[P].Y*this.m_normals[a].Y)/4);this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_delta*(this.m_normals[P].X-this.m_normals[P].Y*A)),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_delta*(this.m_normals[P].Y+this.m_normals[P].X*A)))),this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_delta*(this.m_normals[a].X+this.m_normals[a].Y*A)),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_delta*(this.m_normals[a].Y-this.m_normals[a].X*A))));},e.ClipperOffset.prototype.DoMiter=function(a,P,A){var F=this.m_delta/A;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+(this.m_normals[P].X+this.m_normals[a].X)*F),e.ClipperOffset.Round(this.m_srcPoly[a].Y+(this.m_normals[P].Y+this.m_normals[a].Y)*F)));},e.ClipperOffset.prototype.DoRound=function(a,P){for(var A=Math.atan2(this.m_sinA,this.m_normals[P].X*this.m_normals[a].X+this.m_normals[P].Y*this.m_normals[a].Y),F=Math.max(e.Cast_Int32(e.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(A))),1),j=this.m_normals[P].X,_=this.m_normals[P].Y,st,St=0;St<F;++St)this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+j*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+_*this.m_delta))),st=j,j=j*this.m_cos-this.m_sin*_,_=st*this.m_sin+_*this.m_cos;this.m_destPoly.push(new e.IntPoint2(e.ClipperOffset.Round(this.m_srcPoly[a].X+this.m_normals[a].X*this.m_delta),e.ClipperOffset.Round(this.m_srcPoly[a].Y+this.m_normals[a].Y*this.m_delta)));},e.Error=function(a){try{throw new Error(a);}catch(P){alert(P.message);}},e.JS={},e.JS.AreaOfPolygon=function(a,P){return P||(P=1),e.Clipper.Area(a)/(P*P);},e.JS.AreaOfPolygons=function(a,P){P||(P=1);for(var A=0,F=0;F<a.length;F++)A+=e.Clipper.Area(a[F]);return A/(P*P);},e.JS.BoundsOfPath=function(a,P){return e.JS.BoundsOfPaths([a],P);},e.JS.BoundsOfPaths=function(a,P){P||(P=1);var A=e.Clipper.GetBounds(a);return A.left/=P,A.bottom/=P,A.right/=P,A.top/=P,A;},e.JS.Clean=function(F,P){if(!(F instanceof Array))return[];var A=F[0]instanceof Array,F=e.JS.Clone(F);if(typeof P!="number"||P===null)return e.Error("Delta is not a number in Clean()."),F;if(F.length===0||F.length===1&&F[0].length===0||P<0)return F;A||(F=[F]);for(var j=F.length,_,st,St,Pt,Bt,Ht,jt,qt=[],oe=0;oe<j;oe++)if(st=F[oe],_=st.length,_!==0){if(_<3){St=st,qt.push(St);continue;}for(St=st,Pt=P*P,Bt=st[0],Ht=1,jt=1;jt<_;jt++)(st[jt].X-Bt.X)*(st[jt].X-Bt.X)+(st[jt].Y-Bt.Y)*(st[jt].Y-Bt.Y)<=Pt||(St[Ht]=st[jt],Bt=st[jt],Ht++);Bt=st[Ht-1],(st[0].X-Bt.X)*(st[0].X-Bt.X)+(st[0].Y-Bt.Y)*(st[0].Y-Bt.Y)<=Pt&&Ht--,Ht<_&&St.splice(Ht,_-Ht),St.length&&qt.push(St);}return!A&&qt.length?qt=qt[0]:!A&&qt.length===0?qt=[]:A&&qt.length===0&&(qt=[[]]),qt;},e.JS.Clone=function(a){if(!(a instanceof Array))return[];if(a.length===0)return[];if(a.length===1&&a[0].length===0)return[[]];var P=a[0]instanceof Array;P||(a=[a]);var A=a.length,F,j,_,st,St=new Array(A);for(j=0;j<A;j++){for(F=a[j].length,st=new Array(F),_=0;_<F;_++)st[_]={X:a[j][_].X,Y:a[j][_].Y};St[j]=st;}return P||(St=St[0]),St;},e.JS.Lighten=function(a,P){if(!(a instanceof Array))return[];if(typeof P!="number"||P===null)return e.Error("Tolerance is not a number in Lighten()."),e.JS.Clone(a);if(a.length===0||a.length===1&&a[0].length===0||P<0)return e.JS.Clone(a);var A=a[0]instanceof Array;A||(a=[a]);var F,j,_,st,St,Pt,Bt,Ht,jt,qt,oe,me,Se,De,or,Rr,en,Ho=a.length,Vo=P*P,gn=[];for(F=0;F<Ho;F++)if(_=a[F],Pt=_.length,Pt!==0){for(st=0;st<1e6;st++){for(St=[],Pt=_.length,_[Pt-1].X!==_[0].X||_[Pt-1].Y!==_[0].Y?(me=1,_.push({X:_[0].X,Y:_[0].Y}),Pt=_.length):me=0,oe=[],j=0;j<Pt-2;j++)Bt=_[j],jt=_[j+1],Ht=_[j+2],Rr=Bt.X,en=Bt.Y,Se=Ht.X-Rr,De=Ht.Y-en,(Se!==0||De!==0)&&(or=((jt.X-Rr)*Se+(jt.Y-en)*De)/(Se*Se+De*De),or>1?(Rr=Ht.X,en=Ht.Y):or>0&&(Rr+=Se*or,en+=De*or)),Se=jt.X-Rr,De=jt.Y-en,qt=Se*Se+De*De,qt<=Vo&&(oe[j+1]=1,j++);for(St.push({X:_[0].X,Y:_[0].Y}),j=1;j<Pt-1;j++)oe[j]||St.push({X:_[j].X,Y:_[j].Y});if(St.push({X:_[Pt-1].X,Y:_[Pt-1].Y}),me&&_.pop(),oe.length)_=St;else break;}Pt=St.length,St[Pt-1].X===St[0].X&&St[Pt-1].Y===St[0].Y&&St.pop(),St.length>2&&gn.push(St);}return A||(gn=gn[0]),_typeof(gn)>"u"&&(gn=[]),gn;},e.JS.PerimeterOfPath=function(a,P,A){if(_typeof(a)>"u")return 0;var F=Math.sqrt,j=0,_,st,St=0,Pt=0,Bt=0,Ht=0,jt=a.length;if(jt<2)return 0;for(P&&(a[jt]=a[0],jt++);--jt;)_=a[jt],St=_.X,Pt=_.Y,st=a[jt-1],Bt=st.X,Ht=st.Y,j+=F((St-Bt)*(St-Bt)+(Pt-Ht)*(Pt-Ht));return P&&a.pop(),j/A;},e.JS.PerimeterOfPaths=function(a,P,A){A||(A=1);for(var F=0,j=0;j<a.length;j++)F+=e.JS.PerimeterOfPath(a[j],P,A);return F;},e.JS.ScaleDownPath=function(a,P){var A,F;for(P||(P=1),A=a.length;A--;)F=a[A],F.X=F.X/P,F.Y=F.Y/P;},e.JS.ScaleDownPaths=function(a,P){var A,F,j;for(P||(P=1),A=a.length;A--;)for(F=a[A].length;F--;)j=a[A][F],j.X=j.X/P,j.Y=j.Y/P;},e.JS.ScaleUpPath=function(a,P){var A,F,j=Math.round;for(P||(P=1),A=a.length;A--;)F=a[A],F.X=j(F.X*P),F.Y=j(F.Y*P);},e.JS.ScaleUpPaths=function(a,P){var A,F,j,_=Math.round;for(P||(P=1),A=a.length;A--;)for(F=a[A].length;F--;)j=a[A][F],j.X=_(j.X*P),j.Y=_(j.Y*P);},e.ExPolygons=function(){return[];},e.ExPolygon=function(){this.outer=null,this.holes=null;},e.JS.AddOuterPolyNodeToExPolygons=function(a,P){var A=new e.ExPolygon();A.outer=a.Contour();var F=a.Childs(),j=F.length;A.holes=new Array(j);var _,st,St,Pt,Bt,Ht;for(St=0;St<j;St++)for(_=F[St],A.holes[St]=_.Contour(),Pt=0,Bt=_.Childs(),Ht=Bt.length;Pt<Ht;Pt++)st=Bt[Pt],e.JS.AddOuterPolyNodeToExPolygons(st,P);P.push(A);},e.JS.ExPolygonsToPaths=function(a){var P,A,F,j,_=new e.Paths();for(P=0,F=a.length;P<F;P++)for(_.push(a[P].outer),A=0,j=a[P].holes.length;A<j;A++)_.push(a[P].holes[A]);return _;},e.JS.PolyTreeToExPolygons=function(a){var P=new e.ExPolygons(),A,F,j,_;for(F=0,j=a.Childs(),_=j.length;F<_;F++)A=j[F],e.JS.AddOuterPolyNodeToExPolygons(A,P);return P;};})();})(Ph);var $w=Ph.exports,Jr=/* @__PURE__ */Ln($w);function xh(i,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;return Math.abs(i[0]-e[0])<t&&Math.abs(i[1]-e[1])<t;}function jw(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(i.length===0)return[];var t=[[i[0][0],i[0][1]]];for(var r=1;r<i.length;r++)xh([i[r][0],i[r][1]],t[t.length-1],e)||t.push([i[r][0],i[r][1]]);return t;}function Gw(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(i.length<=2)return i;var t=i[0],r=i[i.length-1];return xh(t,r,e)?i.slice(0,-1):i;}function kw(i){var e=i.reduce(function(r,n){return r+n[0];},0)/i.length,t=i.reduce(function(r,n){return r+n[1];},0)/i.length;return[e,t];}function vu(i,e){return Math.atan2(e[1]-i[1],e[0]-i[0]);}function Hw(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.01;if(i.length<=2)return i;var t=[];var _iterator16=_createForOfIteratorHelper(i),_step16;try{var _loop3=function _loop3(){var n=_step16.value;t.some(function(c){return Math.abs(c[0]-n[0])<e&&Math.abs(c[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=kw(t);return t.sort(function(n,s){var c=vu(r,n),l=vu(r,s);return c-l;});}function Vw(i,e){var t=e[0].x<e[e.length-1].x;return i.map(function(n){var c=n.map(function(l){var f=-1,h=1/0,m=0;for(var u=0;u<e.length;u++){var y=e[u],T=Math.sqrt(Math.pow(y.x-l[0],2)+Math.pow(y.y-l[1],2));T<h&&(h=T,f=u,m=y.z);}return{point:l,index:f,bestZ:m};}).sort(function(l,f){return l.index-f.index;}).map(function(l){return[].concat(_toConsumableArray(l.point),[l.bestZ]);});return t&&c[0][0]>c[c.length-1][0]||!t&&c[0][0]<c[c.length-1][0]?c.reverse():c;}).sort(function(n,s){var c=n[0][0],l=s[0][0];return t?c-l:l-c;});}function Kw(i,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.01;var n=i.map(function(u){return[u.x,u.y];}),s=function s(u,y){return u.map(function(_ref166){var _ref167=_slicedToArray(_ref166,2),T=_ref167[0],w=_ref167[1];return{X:Math.round(T*y),Y:Math.round(w*y)};});},c=new Jr.ClipperOffset();c.AddPath(s(n,1e3),Jr.JoinType.jtRound,Jr.EndType.etOpenButt);var l=[];c.Execute(l,1);var f=new Jr.Clipper();f.AddPaths(l,Jr.PolyType.ptSubject,!0),e.forEach(function(u){f.AddPath(s(u,1e3),Jr.PolyType.ptClip,!0);});var h=new Jr.Paths();f.Execute(Jr.ClipType.ctDifference,h,Jr.PolyFillType.pftNonZero,Jr.PolyFillType.pftNonZero);var m=h.map(function(u){return Gw(Hw(jw(u.map(function(y){return[y.X/1e3,y.Y/1e3];}),t),t),t);}).filter(function(u){return u.length>=2;});return Vw(m,i);}var Th=/*#__PURE__*/function(_Xt){function Th(t){var _this61;_classCallCheck(this,Th);_this61=_callSuper(this,Th,[t]);dt(_this61,"canRotate",!0);dt(_this61,"scaleType",Ce.all);dt(_this61,"toolsType",Tt.Pencil);dt(_this61,"syncTimestamp");dt(_this61,"syncIndex",0);dt(_this61,"tmpPoints",[]);dt(_this61,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */dt(_this61,"uniThickness");dt(_this61,"workOptions");dt(_this61,"centerPos",[0,0]);_this61.workOptions=t.toolsOpt,_this61.uniThickness=_this61.MAX_REPEAR/_this61.workOptions.thickness/10,_this61.syncTimestamp=0;return _this61;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(Th,_Xt);return _createClass(Th,[{key:"combineConsume",value:function combineConsume(){var l;var t=(l=this.workId)==null?void 0:l.toString();if(this.tmpPoints.length<2)return{type:gt.None};var r=this.transformDataAll(!0),n={name:t};var s;var c=this.drawLayer||this.fullLayer;return r.length&&(s=this.draw({attrs:n,tasks:r,replaceId:t,layer:c})),{rect:s,type:gt.DrawWork,dataType:Kt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Th,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this62=this;var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.drawCount,f=t.removeDrawCount,h=t.isSimpleWorker,m=r.workId,u=r.syncUnitTime;u&&(this.syncUnitTime=u);var _this$transformData=this.transformData(r,!1),y=_this$transformData.tasks,T=_this$transformData.effects,w=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,w,Math.max(0,this.tmpPoints.length-2));var I={name:m,id:_e(l)&&l.toString()||void 0};var S,O=!1;var d=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),y.length&&(y[0].taskId-this.syncTimestamp>this.syncUnitTime&&(O=!0,this.syncTimestamp=y[0].taskId,this.syncIndex=this.tmpPoints.length),s||c||h)){var p=n?this.fullLayer:this.drawLayer||this.fullLayer;S=this.draw({attrs:I,tasks:y,effects:T,layer:p,removeDrawCount:f});}if(h){var _p13=[];return this.tmpPoints.slice(d).forEach(function(x){_p13.push(x.x,x.y,_this62.computRadius(x.z,_this62.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:gt.DrawWork,dataType:Kt.Local,op:O?_p13:void 0,index:O?d*3:void 0,rect:S,updateNodeOpt:{useAnimation:!0}});}if(s)return w>10&&this.tmpPoints.splice(0,w-10),{rect:S,type:gt.DrawWork,dataType:Kt.Local};var v=[];return this.tmpPoints.slice(d).forEach(function(p){v.push(p.x,p.y,_this62.computRadius(p.z,_this62.workOptions.thickness));}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:gt.DrawWork,dataType:Kt.Local,rect:S,op:O?v:void 0,index:O?d*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,u=_t$data.op,y=_t$data.workState;u!=null&&u.length&&y===te.Done&&this.workOptions.strokeType===Ae.Stroke&&this.updateTempPointsWithPressureWhenDone(u);}var n=this.transformDataAll(!0),s={name:r};var c;var l=this.fullLayer;if(n.length&&(c=this.draw({attrs:s,tasks:n,replaceId:r,layer:l})),this.tmpPoints.length<2)return this.replace(l,r),{type:gt.RemoveNode,removeIds:[r],rect:c};var f=[];this.tmpPoints.map(function(u){f.push(u.x,u.y,u.z);}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var h=mr(f);return(m=this.vNodes)==null||m.setInfo(r,{rect:c,op:f,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:c&&Xt.getCenterPos(c,l)}),_objectSpread(_objectSpread({},this.baseConsumeResult),{},{rect:c,type:gt.FullWork,dataType:Kt.Local,ops:h,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 u,y;var r=t.op,n=t.isFullWork,s=t.replaceId,_t$workState=t.workState,c=_t$workState===void 0?te.Done:_t$workState;this.tmpPoints.length=0;for(var T=0;T<r.length;T+=3){var w=new Jt(r[T],r[T+1],r[T+2]);if(this.tmpPoints.length>0){var I=this.tmpPoints[this.tmpPoints.length-1],S=pt.Sub(w,I).uni();w.setv(S);}this.tmpPoints.push(w);}if(this.tmpPoints.length<2)return;var l=this.transformDataAll(!0),f=(u=this.workId)==null?void 0:u.toString(),h={name:f};var m;if(f&&l.length){var _T9=n?this.fullLayer:this.drawLayer||this.fullLayer;m=this.draw({attrs:h,tasks:l,replaceId:s,layer:_T9,isDrawEraserlines:c===te.Done}),(y=this.vNodes)==null||y.setInfo(f,{rect:m,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&Xt.getCenterPos(m,_T9)});}return m;}},{key:"computPencilPoints",value:function computPencilPoints(t){var _this63=this;var r=[],n=t.op,s=t.eraserPolylines,c=t.eraserThickness;this.tmpPoints.length=0;for(var f=0;f<n.length;f+=3){var h=new Jt(n[f],n[f+1],n[f+2]);if(this.tmpPoints.length>0){var m=this.tmpPoints[this.tmpPoints.length-1],u=pt.Sub(h,m).uni();h.setv(u);}this.tmpPoints.push(h);}if(this.tmpPoints.length<2)return;var l=this.transformDataAll(!0);if(l.length){var _loop4=function _loop4(){var _l$_f=l[_f5],h=_l$_f.pos,m=_l$_f.points,u=m.map(function(w){return w.point.addXY(h[0],h[1]);}),y=[];var _iterator17=_createForOfIteratorHelper(s),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var w=_step17.value;var I=[];for(var _O31=0;_O31<w.length;_O31+=2){var _d31=new Jt(w[_O31],w[_O31+1]);if(I.length>0){var v=I[I.length-1].point,p=pt.Sub(_d31,v).uni();_d31.setv(p);}I.push({point:_d31,radius:c});}var _this63$computStroke=_this63.computStroke(I,!1),S=_this63$computStroke.ps;y.push(S.map(function(O){return O.XY;}));}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}Kw(u,y,0.01).forEach(function(w){r.push(w.map(function(I){return[I[0],I[1],I[2]];}).flat(1));});};for(var _f5=0;_f5<l.length;_f5++){_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 _this64=this;var r=t.attrs,n=t.tasks,s=t.replaceId,c=t.effects,l=t.layer,f=t.removeDrawCount,_t$isDrawEraserlines=t.isDrawEraserlines,h=_t$isDrawEraserlines===void 0?!0:_t$isDrawEraserlines,_this$workOptions=this.workOptions,m=_this$workOptions.strokeColor,u=_this$workOptions.strokeType,y=_this$workOptions.thickness,T=_this$workOptions.zIndex,w=_this$workOptions.scale,I=_this$workOptions.rotate,S=_this$workOptions.translate,O=_this$workOptions.eraserlines,d=_this$workOptions.lineCap,v=_this$workOptions.lineDash;c!=null&&c.size&&(c.forEach(function(U){var M;(M=l.getElementById(U+""))==null||M.remove();}),c.clear()),f&&this.removeDrawCountNodes(l,f);var p;var x=[],E=l.worldPosition,R=l.worldScaling;for(var U=0;U<n.length;U++){var _n$U=n[U],M=_n$U.pos,W=_n$U.points,_this$computDrawPoint=this.computDrawPoints(W),X=_this$computDrawPoint.ps,B=_this$computDrawPoint.rect;var N=void 0;var $=W.length===1;u===Ae.Stroke||$?N=En(X,!0):N=En(X,!1);var J={pos:M,d:N,fillColor:u===Ae.Stroke||$?m:void 0,lineDash:$?void 0:u===Ae.Dotted?[v&&v[0]||1,(v&&v[1]||2)*y]:u===Ae.LongDotted?[(v&&v[0]||1)*y,(v&&v[1]||2)*y]:void 0,strokeColor:m,lineCap:$?void 0:d,lineWidth:u===Ae.Stroke||$?0:y};p=Zt(p,{x:Math.floor((B.x+M[0])*R[0]+E[0]-Xt.SafeBorderPadding),y:Math.floor((B.y+M[1])*R[1]+E[1]-Xt.SafeBorderPadding),w:Math.floor(B.w*R[0]+2*Xt.SafeBorderPadding),h:Math.floor(B.h*R[1]+2*Xt.SafeBorderPadding)}),x.push(J);}w&&(r.scale=w),I&&(r.rotate=I),S&&(r.translate=S);var D=new cr();if(p){this.centerPos=Xt.getCenterPos(p,l);var _U11=u===Ae.Stroke&&!O;D.attr(_objectSpread(_objectSpread({},r),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:_U11?m:void 0,pos:this.centerPos,size:[(p.w-2*Xt.SafeBorderPadding)/R[0],(p.h-2*Xt.SafeBorderPadding)/R[1]],zIndex:T}));var _M9=x.map(function(W){return W.pos=[W.pos[0]-_this64.centerPos[0],W.pos[1]-_this64.centerPos[1]],new Mn(W);});D.append.apply(D,_toConsumableArray(_M9)),_U11&&D.seal(),O&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:D,eraserlines:O,pos:this.centerPos,layer:l},h)),this.replace(l,s,D);}if(w||I||S){var _U12=D==null?void 0:D.getBoundingClientRect();_U12&&(p={x:Math.floor(_U12.x-Xt.SafeBorderPadding),y:Math.floor(_U12.y-Xt.SafeBorderPadding),w:Math.floor(_U12.width+Xt.SafeBorderPadding*2),h:Math.floor(_U12.height+Xt.SafeBorderPadding*2)});}return this.isDelete&&D.setAttribute("opacity",0),p;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Ae.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(s){return r=Math.max(r,s.radius),s.point;});return{ps:n,rect:Re(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=[],s=[];for(var f=0;f<t.length;f++){var _t$f=t[f],h=_t$f.point,m=_t$f.radius;var u=h.v;f===0&&t.length>1&&(u=t[f+1].point.v);var y=pt.Per(u).mul(m);n.push(Jt.Sub(h,y)),s.push(Jt.Add(h,y));}var c=t[t.length-1];if(r){var _f6=Jt.GetSemicircleStroke(c.point,n[n.length-1],-1,8),_h4=Jt.GetSemicircleStroke(t[0].point,s[0],-1,8),_m7=n.concat(_f6,s.reverse(),_h4);return{ps:_m7,rect:Re(_m7)};}var l=n.concat(s.reverse());return{ps:l,rect:Re(l)};}},{key:"computDotStroke",value:function computDotStroke(t){var r=t.point,n=t.radius,s={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Jt.GetDotStroke(r,n,8),rect:s};}},{key:"transformData",value:function transformData(t,r){var n=t.op,s=t.workState;var c=this.tmpPoints.length-1,l=[];if(n!=null&&n.length&&s){var _this$workOptions2=this.workOptions,f=_this$workOptions2.strokeType,h=_this$workOptions2.thickness,m=/* @__PURE__ */new Set();c=f===Ae.Stroke?this.updateTempPointsWithPressure(n,h,m):this.updateTempPoints(n,h,m);var u=r?this.tmpPoints:this.tmpPoints.slice(c);return l=this.getTaskPoints(u,h),{tasks:l,effects:m,consumeIndex:c};}return{tasks:l,consumeIndex:c};}/** 压力渐变公式 */},{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 u;var n=[];if(t.length===0)return[];var s=0,c=t[0].x,l=t[0].y,f=[c,l],h=[],m=t[0].t;for(;s<t.length;){var y=t[s],T=y.x-c,w=y.y-l,I=y.z,S=r?this.computRadius(I,r):I;if(h.push({point:new Jt(T,w,I,t[s].v),radius:S}),s>0&&s<t.length-1){var _O32=t[s].getAngleByPoints(t[s-1],t[s+1]);if(_O32<60||_O32>300){var _d32=(u=h.pop())==null?void 0:u.point.clone();_d32&&n.push({taskId:m,pos:f,points:[].concat(_toConsumableArray(h),[{point:_d32,radius:S}])}),c=t[s].x,l=t[s].y,f=[c,l];var v=y.x-c,p=y.y-l;h=[{point:new Jt(v,p,I),radius:S}],m=Date.now();}}s++;}return n.push({taskId:m,pos:f,points:h}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,r,n){var s=Date.now(),c=this.tmpPoints.length;var l=c;for(var h=0;h<t.length;h+=2){l=Math.min(l,c);var m=this.tmpPoints.length,u=new Jt(t[h],t[h+1]);if(m===0){this.tmpPoints.push(u);continue;}var y=m-1,T=this.tmpPoints[y],w=pt.Sub(u,T).uni();if(u.isNear(T,r)){if(T.z<this.MAX_REPEAR){if(T.setz(Math.min(T.z+1,this.MAX_REPEAR)),l=Math.min(l,y),m>1){var _O33=m-1;for(;_O33>0;){var _d33=this.tmpPoints[_O33].distance(this.tmpPoints[_O33-1]),v=Math.max(this.tmpPoints[_O33].z-this.uniThickness*_d33,0);if(this.tmpPoints[_O33-1].z>=v)break;this.tmpPoints[_O33-1].setz(v),l=Math.min(l,_O33-1),_O33--;}}}else l=1/0;continue;}u.setv(w);var I=u.distance(T),S=Math.max(T.z-this.uniThickness*I,0);m>1&&pt.Equals(w,T.v,0.02)&&(S>0||T.z<=0)&&(n&&T.t&&n.add(T.t),this.tmpPoints.pop(),l=Math.min(y,l)),u.setz(S),this.tmpPoints.push(u);}if(l===1/0)return this.tmpPoints.length;var f=c;if(l===c){f=Math.max(f-1,0);var _h5=this.tmpPoints[f].t;_h5&&(n==null||n.add(_h5));}else{var _h6=c-1;for(f=l;_h6>=0;){var _m8=this.tmpPoints[_h6].t;if(_m8&&(n==null||n.add(_m8),_h6<=l)){f=_h6,_h6=-1;break;}_h6--;}}return this.tmpPoints[f].setT(s),f;}},{key:"updateTempPoints",value:function updateTempPoints(t,r,n){var h;var s=Date.now(),c=this.tmpPoints.length;var l=c;for(var m=0;m<t.length;m+=2){var u=this.tmpPoints.length,y=new Jt(t[m],t[m+1]);if(u===0){this.tmpPoints.push(y);continue;}var T=u-1,w=this.tmpPoints[T],I=pt.Sub(y,w).uni();if(y.isNear(w,r/2)){l=Math.min(T,l);continue;}pt.Equals(I,w.v,0.02)&&(n&&w.t&&n.add(w.t),this.tmpPoints.pop(),l=Math.min(T,l)),y.setv(I),this.tmpPoints.push(y);}var f=c;if(l===c){f=Math.max(f-1,0);var _m9=this.tmpPoints[f].t;_m9&&(n==null||n.add(_m9));}else{var _m10=Math.min(c-1,l);for(f=l;_m10>=0;){var _u4=(h=this.tmpPoints[_m10])==null?void 0:h.t;if(_u4&&(n==null||n.add(_u4),_m10<=l)){f=_m10,_m10=-1;break;}_m10--;}}return this.tmpPoints[f].setT(s),f;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var r=this.workOptions.thickness,n=t.length,s=this.getMinZ(r);for(var c=0;c<n;c+=2){var l=this.tmpPoints.length,f=new Jt(t[c],t[c+1]);if(l===0){this.tmpPoints.push(f);continue;}var h=l-1,m=this.tmpPoints[h],u=pt.Sub(f,m).uni(),y=f.distance(m);if(l>1&&m.z===s)break;if(f.isNear(m,r/2)){if(n<3&&m.z<this.MAX_REPEAR&&(m.setz(Math.min(m.z+1,this.MAX_REPEAR)),l>1)){var w=l-1;for(;w>0;){var I=this.tmpPoints[w].distance(this.tmpPoints[w-1]),S=Math.max(this.tmpPoints[w].z-this.uniThickness*I,-r/4);if(this.tmpPoints[w-1].z>=S)break;this.tmpPoints[w-1].setz(S),w--;}}continue;}f.setv(u);var T=Math.max(m.z-this.uniThickness*y,s);l>1&&pt.Equals(u,m.v,0.02)&&m.z<=0&&this.tmpPoints.pop(),f.setz(T),this.tmpPoints.push(f);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,m;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.strokeType,f=s.get(r.name);return c&&(r.tagName==="GROUP"?iE(r)?r.setAttribute("bgcolor",c):r.children.forEach(function(u){u.setAttribute("strokeColor",c),u.getAttribute("fillColor")&&u.setAttribute("fillColor",c);}):(r.setAttribute("strokeColor",c),r.setAttribute("fillColor",c)),(h=f==null?void 0:f.opt)!=null&&h.strokeColor&&(f.opt.strokeColor=c)),l&&f!=null&&f.opt&&(m=f.opt)!=null&&m.strokeType&&(f.opt.strokeType=l),f&&s.setInfo(r.name,f),Xt.updateNodeOpt(t);}}]);}(Xt);var Ch=/*#__PURE__*/function(_Xt2){function Ch(t){var _this65;_classCallCheck(this,Ch);_this65=_callSuper(this,Ch,[t]);dt(_this65,"toolsType",Tt.LaserPen);dt(_this65,"canRotate",!1);dt(_this65,"scaleType",Ce.none);dt(_this65,"syncTimestamp");dt(_this65,"syncIndex",0);dt(_this65,"tmpPoints",[]);dt(_this65,"workOptions");dt(_this65,"consumeIndex",0);_this65.workOptions=t.toolsOpt,_this65.syncTimestamp=0;return _this65;}_inherits(Ch,_Xt2);return _createClass(Ch,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(Ch,"setWorkOptions",this,3)([t]),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var r=t.data,n=t.isSubWorker,s=r.workId,c=r.op,l=r.syncUnitTime;if((c==null?void 0:c.length)===0)return{type:gt.None};if(l&&(this.syncUnitTime=l),this.updateTempPoints(c||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:gt.None};var _this$workOptions3=this.workOptions,f=_this$workOptions3.strokeColor,h=_this$workOptions3.thickness,m=_this$workOptions3.strokeType,u=_this$workOptions3.lineDash,y=_this$workOptions3.lineCap,T=Re(this.tmpPoints,h);var w=!1;var I=this.syncIndex,S=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var O={name:s==null?void 0:s.toString(),opacity:1,lineDash:m===Ae.Dotted?[u&&u[0]||1,(u&&u[1]||2)*h]:m===Ae.LongDotted?[(u&&u[0]||1)*h,(u&&u[1]||2)*h]:void 0,strokeColor:f,lineCap:y,lineWidth:h,anchor:[0.5,0.5]},d=this.getTaskPoints(S);if(d.length){var p=Date.now();p-this.syncTimestamp>this.syncUnitTime&&(w=!0,this.syncTimestamp=p,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:O,tasks:d,isDot:!1,layer:this.drawLayer||this.fullLayer});}var v=[];return this.tmpPoints.slice(I).forEach(function(p){v.push(p.x,p.y);}),_objectSpread({rect:{x:T.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:T.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:T.w*this.fullLayer.worldScaling[0],h:T.h*this.fullLayer.worldScaling[1]},type:gt.DrawWork,dataType:Kt.Local,op:w?v:void 0,index:w?I*2:void 0},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var c;var t=(c=this.workId)==null?void 0:c.toString();var r;if(this.tmpPoints.length-1>this.consumeIndex){var l=this.tmpPoints.slice(this.consumeIndex);var f=l.length===1,_this$workOptions4=this.workOptions,h=_this$workOptions4.strokeColor,m=_this$workOptions4.thickness,u=_this$workOptions4.strokeType;if(f){var w=this.computDotStroke({point:l[0],radius:m/2});l=w.ps,r=w.rect;}else r=Re(this.tmpPoints,m);var y={name:t==null?void 0:t.toString(),fillColor:f?h:void 0,opacity:1,lineDash:u===Ae.Dotted&&!f?[1,m*2]:u===Ae.LongDotted&&!f?[m,m*2]:void 0,strokeColor:h,lineCap:f?void 0:"round",lineWidth:f?0:m,anchor:[0.5,0.5]},T=this.getTaskPoints(l);T.length&&this.draw({attrs:y,tasks:T,isDot:f,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(l){n.push(l.x,l.y);});var s=mr(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:gt.FullWork,dataType:Kt.Local,ops:s,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 I;var r=t.op,n=t.replaceId,s=t.isFullWork,_this$workOptions5=this.workOptions,c=_this$workOptions5.strokeColor,l=_this$workOptions5.thickness,f=_this$workOptions5.strokeType;if(!r.length){var S=Re(this.tmpPoints,l);return{x:S.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:S.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:S.w*this.fullLayer.worldScaling[0],h:S.h*this.fullLayer.worldScaling[1]};}var h=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(r||[]);var m,u=this.tmpPoints.slice(h);var y=u.length===1;if(y){var _S7=this.computDotStroke({point:u[0],radius:l/2});u=_S7.ps,m=_S7.rect;}else m=Re(this.tmpPoints,l);var T={name:(I=this.workId)==null?void 0:I.toString(),fillColor:y?c:void 0,opacity:1,lineDash:f===Ae.Dotted&&!y?[1,l*2]:f===Ae.LongDotted&&!y?[l,l*2]:void 0,strokeColor:c,lineCap:y?void 0:"round",lineWidth:y?0:l,anchor:[0.5,0.5]},w=this.getTaskPoints(u);if(w.length){var _S8=s?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:T,tasks:w,isDot:y,replaceId:n,layer:_S8});}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,s={x:r.x-n,y:r.y-n,w:n*2,h:n*2};return{ps:Jt.GetDotStroke(r,n,8),rect:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(r){var s=this.tmpPoints.slice(-1)[0];s&&s.x===t[n]&&s.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new Jt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var _this66=this;var r,n,s,c,l,_iterator18,_step18,_loop5;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:r=t.attrs,n=t.tasks,s=t.isDot,c=t.layer,l=this.workOptions.duration;_iterator18=_createForOfIteratorHelper(n);_context23.prev=2;_loop5=/*#__PURE__*/_regeneratorRuntime().mark(function _loop5(){var f,h,m,u,y,_this66$workOptions,T,w,I,_c$getResolution,S,_O34;return _regeneratorRuntime().wrap(function _loop5$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:f=_step18.value;h=new Mn(),m=f.pos,u=f.points;s?y=En(u,!0):y=En(u,!1),h.attr(_objectSpread(_objectSpread({},r),{},{pos:m,d:y}));_this66$workOptions=_this66.workOptions,T=_this66$workOptions.vertex,w=_this66$workOptions.fragment;if(T&&w){I=c.renderer.createProgram({vertex:T,fragment:w}),_c$getResolution=c.getResolution(),S=_c$getResolution.width,_O34=_c$getResolution.height;h.setUniforms({u_time:0,u_resolution:[S,_O34]}),h.setProgram(I);}c.appendChild(h),h.transition(l).attr({scale:s?[0.1,0.1]:[1,1],lineWidth:s?0:1}).then(function(){h.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(_x40){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var h;var r=[];if(t.length===0)return[];var n=0,s=t[0].x,c=t[0].y,l=[s,c],f=[];for(;n<t.length;){var m=t[n],u=m.x-s,y=m.y-c;if(f.push(new Jt(u,y)),n>0&&n<t.length-1){var T=t[n].getAngleByPoints(t[n-1],t[n+1]);if(T<60||T>300){var w=(h=f.pop())==null?void 0:h.clone();w&&r.push({pos:l,points:[].concat(_toConsumableArray(f),[w])}),s=t[n].x,c=t[n].y,l=[s,c];var I=m.x-s,S=m.y-c;f=[new Jt(I,S)];}}n++;}return r.push({pos:l,points:f}),r;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var r;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(s){if(s.name===t){var c=s.getBoundingClientRect();r=Zt(r,{x:c.x,y:c.y,w:c.width,h:c.height}),n.push(s);}}),n.length&&n.forEach(function(s){return s.remove();}),r;}}]);}(Xt);var Zw=io;io.polyline=io;io.polygon=Jw;function io(i,e,t){var r=i.length,n=di(i[0],e),s=[],c,l,f,h,m;for(t||(t=[]),c=1;c<r;c++){for(l=i[c-1],f=i[c],h=m=di(f,e);;)if(n|h){if(n&h)break;n?(l=ul(l,f,n,e),n=di(l,e)):(f=ul(l,f,h,e),h=di(f,e));}else{s.push(l),h!==m?(s.push(f),c<r-1&&(t.push(s),s=[])):c===r-1&&s.push(f);break;}n=m;}return s.length&&t.push(s),t;}function Jw(i,e){var t,r,n,s,c,l,f;for(r=1;r<=8;r*=2){for(t=[],n=i[i.length-1],s=!(di(n,e)&r),c=0;c<i.length;c++)l=i[c],f=!(di(l,e)&r),f!==s&&t.push(ul(n,l,r,e)),f&&t.push(l),n=l,s=f;if(i=t,!i.length)break;}return t;}function ul(i,e,t,r){return t&8?[i[0]+(e[0]-i[0])*(r[3]-i[1])/(e[1]-i[1]),r[3]]:// top
|
|
404
|
+
t&4?[i[0]+(e[0]-i[0])*(r[1]-i[1])/(e[1]-i[1]),r[1]]:// bottom
|
|
405
|
+
t&2?[r[2],i[1]+(e[1]-i[1])*(r[2]-i[0])/(e[0]-i[0])]:// right
|
|
406
|
+
t&1?[r[0],i[1]+(e[1]-i[1])*(r[0]-i[0])/(e[0]-i[0])]:// left
|
|
407
|
+
null;}function di(i,e){var t=0;return i[0]<e[0]?t|=1:i[0]>e[2]&&(t|=2),i[1]<e[1]?t|=4:i[1]>e[3]&&(t|=8),t;}var Al=/* @__PURE__ */Ln(Zw);var vi=/*#__PURE__*/function(_Xt3){function vi(t,r){var _this67;_classCallCheck(this,vi);_this67=_callSuper(this,vi,[t]);dt(_this67,"canRotate",!1);dt(_this67,"scaleType",Ce.none);dt(_this67,"toolsType",Tt.Eraser);dt(_this67,"serviceWork");dt(_this67,"tmpPoints",[]);dt(_this67,"workOptions");dt(_this67,"worldPosition");dt(_this67,"worldScaling");dt(_this67,"eraserRect");dt(_this67,"eraserPolyline");_this67.serviceWork=r,_this67.workOptions=t.toolsOpt,_this67.worldPosition=_this67.fullLayer.worldPosition,_this67.worldScaling=_this67.fullLayer.worldScaling;return _this67;}_inherits(vi,_Xt3);return _createClass(vi,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_superPropGet(vi,"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],_vi$eraserSizes$this$=vi.eraserSizes[this.workOptions.thickness],s=_vi$eraserSizes$this$.width,c=_vi$eraserSizes$this$.height;this.eraserRect={x:r-s*0.5,y:n-c*0.5,w:s,h:c},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 pt(this.tmpPoints[0],this.tmpPoints[1]),n=new pt(this.tmpPoints[2],this.tmpPoints[3]),s=pt.Sub(n,r).uni(),c=pt.Dist(r,n),_vi$eraserSizes$this$2=vi.eraserSizes[this.workOptions.thickness],l=_vi$eraserSizes$this$2.width,f=_vi$eraserSizes$this$2.height,h=Math.min(l,f),m=Math.round(c/h);if(m>1){var u=[];for(var y=0;y<m;y++){var T=pt.Mul(s,y*h);u.push(this.tmpPoints[0]+T.x,this.tmpPoints[1]+T.y);}return u.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,r){var n=new pt(t[0],t[1]),s=new pt(r[0],r[1]),_vi$eraserSizes$this$3=vi.eraserSizes[this.workOptions.thickness],c=_vi$eraserSizes$this$3.width,l=_vi$eraserSizes$this$3.height;return pt.Dist(n,s)<Math.hypot(c,l)*0.5;}},{key:"remove",value:function remove(t){var _this68=this;var r=t.curNodeMap,n=t.removeIds;var s;var _iterator19=_createForOfIteratorHelper(r.values()),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var c=_step19.value;if(c.rect&&this.eraserRect&&this.eraserPolyline&&dl(this.eraserRect,c.rect)){var l=c.op,f=[],h=[];for(var u=0;u<l.length;u+=3){var y=new pt(l[u]*this.worldScaling[0]+this.worldPosition[0],l[u+1]*this.worldScaling[1]+this.worldPosition[1],l[u+2]);h.push(y),f.push(new Jt(y.x,y.y));}var m=f.length&&Re(f)||c.rect;dl(m,this.eraserRect)&&(h.length>1?Al.polyline(h.map(function(y){return y.XY;}),this.eraserPolyline).length&&n.add(c.name):n.add(c.name),s=Zt(s,c.rect||m));}}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return n.forEach(function(c){var f;var l=_this68.fullLayer.getElementsByName(c);l[0]&&(l[0].remove(),_vr(l[0],_this68.fullLayer.parent),(f=_this68.vNodes)==null||f["delete"](c));}),s&&(s.x-=Xt.SafeBorderPadding,s.y-=Xt.SafeBorderPadding,s.w+=Xt.SafeBorderPadding*2,s.h+=Xt.SafeBorderPadding*2),s;}},{key:"consume",value:function consume(t){var _t$data2=t.data,r=_t$data2.op,n=_t$data2.disableEraseImage,s=_t$data2.disableEraseText;if(!r||r.length===0)return _objectSpread({type:gt.None},this.baseConsumeResult);var c=this.tmpPoints.length;if(c>1&&this.isNear([r[0],r[1]],[this.tmpPoints[c-2],this.tmpPoints[c-1]]))return _objectSpread({type:gt.None},this.baseConsumeResult);c<3?this.tmpPoints.push(r[0],r[1]):this.tmpPoints.splice(2,2,r[0],r[1]);var l=this.computRectCenterPoints();var f;var h=/* @__PURE__ */new Set();if(!this.vNodes)return _objectSpread({type:gt.None},this.baseConsumeResult);var m=this.getCanEraserNodeMap(this.vNodes.getCanEraserNodes(this.vNodes.curNodeMap,{disableEraseImage:n,disableEraseText:s}));for(var u=0;u<l.length-1;u+=2){this.createEraserRect(l.slice(u,u+2));var y=this.remove({curNodeMap:m,removeIds:h});f=Zt(f,y);}return f&&h.size?{type:gt.RemoveNode,rect:f,removeIds:_toConsumableArray(h)}:_objectSpread({type:gt.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),s=this.serviceWork.selectorWorkShapes,c=this.serviceWork.workShapes;var _iterator20=_createForOfIteratorHelper(s.values()),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var l=_step20.value;if((r=l.selectIds)!=null&&r.length){var _iterator22=_createForOfIteratorHelper(l.selectIds),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var f=_step22.value;n["delete"](f);}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}var _iterator21=_createForOfIteratorHelper(c.keys()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _l4=_step21.value;n["delete"](_l4);}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}return n;}return t;}}]);}(Xt);// 来源于white-sdk
|
|
408
|
+
dt(vi,"eraserSizes",Ol);var so=vi;var Qw="__lodash_hash_undefined__";function qw(i){return this.__data__.set(i,Qw),this;}var _w=qw;function t2(i){return this.__data__.has(i);}var e2=t2,r2=Ku,n2=_w,i2=e2;function oo(i){var e=-1,t=i==null?0:i.length;for(this.__data__=new r2();++e<t;)this.add(i[e]);}oo.prototype.add=oo.prototype.push=n2;oo.prototype.has=i2;var El=oo;function s2(i,e){for(var t=-1,r=i==null?0:i.length;++t<r;)if(e(i[t],t,i))return!0;return!1;}var o2=s2;function a2(i,e){return i.has(e);}var Ml=a2,l2=El,f2=o2,c2=Ml,u2=1,h2=2;function d2(i,e,t,r,n,s){var c=t&u2,l=i.length,f=e.length;if(l!=f&&!(c&&f>l))return!1;var h=s.get(i),m=s.get(e);if(h&&m)return h==e&&m==i;var u=-1,y=!0,T=t&h2?new l2():void 0;for(s.set(i,e),s.set(e,i);++u<l;){var w=i[u],I=e[u];if(r)var S=c?r(I,w,u,e,i,s):r(w,I,u,i,e,s);if(S!==void 0){if(S)continue;y=!1;break;}if(T){if(!f2(e,function(O,d){if(!c2(T,d)&&(w===O||n(w,O,t,r,s)))return T.push(d);})){y=!1;break;}}else if(!(w===I||n(w,I,t,r,s))){y=!1;break;}}return s["delete"](i),s["delete"](e),y;}var Ih=d2;function p2(i){var e=-1,t=Array(i.size);return i.forEach(function(r,n){t[++e]=[n,r];}),t;}var v2=p2;function g2(i){var e=-1,t=Array(i.size);return i.forEach(function(r){t[++e]=r;}),t;}var Ll=g2,gu=Qi,mu=dh,m2=pl,y2=Ih,S2=v2,P2=Ll,x2=1,T2=2,C2="[object Boolean]",I2="[object Date]",O2="[object Error]",w2="[object Map]",A2="[object Number]",E2="[object RegExp]",M2="[object Set]",L2="[object String]",R2="[object Symbol]",b2="[object ArrayBuffer]",D2="[object DataView]",yu=gu?gu.prototype:void 0,el=yu?yu.valueOf:void 0;function N2(i,e,t,r,n,s,c){switch(t){case D2:if(i.byteLength!=e.byteLength||i.byteOffset!=e.byteOffset)return!1;i=i.buffer,e=e.buffer;case b2:return!(i.byteLength!=e.byteLength||!s(new mu(i),new mu(e)));case C2:case I2:case A2:return m2(+i,+e);case O2:return i.name==e.name&&i.message==e.message;case E2:case L2:return i==e+"";case w2:var l=S2;case M2:var f=r&x2;if(l||(l=P2),i.size!=e.size&&!f)return!1;var h=c.get(i);if(h)return h==e;r|=T2,c.set(i,e);var m=y2(l(i),l(e),r,n,s,c);return c["delete"](i),m;case R2:if(el)return el.call(i)==el.call(e);}return!1;}var B2=N2,Su=ch,W2=1,F2=Object.prototype,U2=F2.hasOwnProperty;function Y2(i,e,t,r,n,s){var c=t&W2,l=Su(i),f=l.length,h=Su(e),m=h.length;if(f!=m&&!c)return!1;for(var u=f;u--;){var y=l[u];if(!(c?y in e:U2.call(e,y)))return!1;}var T=s.get(i),w=s.get(e);if(T&&w)return T==e&&w==i;var I=!0;s.set(i,e),s.set(e,i);for(var S=c;++u<f;){y=l[u];var O=i[y],d=e[y];if(r)var v=c?r(d,O,y,e,i,s):r(O,d,y,i,e,s);if(!(v===void 0?O===d||n(O,d,t,r,s):v)){I=!1;break;}S||(S=y=="constructor");}if(I&&!S){var p=i.constructor,x=e.constructor;p!=x&&"constructor"in i&&"constructor"in e&&!(typeof p=="function"&&p instanceof p&&typeof x=="function"&&x instanceof x)&&(I=!1);}return s["delete"](i),s["delete"](e),I;}var X2=Y2,rl=Zu,z2=Ih,$2=B2,j2=X2,Pu=To,xu=_i,Tu=gl,G2=rh,k2=1,Cu="[object Arguments]",Iu="[object Array]",Ks="[object Object]",H2=Object.prototype,Ou=H2.hasOwnProperty;function V2(i,e,t,r,n,s){var c=xu(i),l=xu(e),f=c?Iu:Pu(i),h=l?Iu:Pu(e);f=f==Cu?Ks:f,h=h==Cu?Ks:h;var m=f==Ks,u=h==Ks,y=f==h;if(y&&Tu(i)){if(!Tu(e))return!1;c=!0,m=!1;}if(y&&!m)return s||(s=new rl()),c||G2(i)?z2(i,e,t,r,n,s):$2(i,e,f,t,r,n,s);if(!(t&k2)){var T=m&&Ou.call(i,"__wrapped__"),w=u&&Ou.call(e,"__wrapped__");if(T||w){var I=T?i.value():i,S=w?e.value():e;return s||(s=new rl()),n(I,S,t,r,s);}}return y?(s||(s=new rl()),j2(i,e,t,r,n,s)):!1;}var K2=V2,Z2=K2,wu=pn;function Oh(i,e,t,r,n){return i===e?!0:i==null||e==null||!wu(i)&&!wu(e)?i!==i&&e!==e:Z2(i,e,t,r,Oh,n);}var J2=Oh,Q2=J2;function q2(i,e){return Q2(i,e);}var _2=q2,Qr=/* @__PURE__ */Ln(_2);function Au(i,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;return"rgba(".concat(i,",").concat(e,",").concat(t,",").concat(r,")");}function tA(i){var e=i.split(","),t=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),n=parseInt(e[2]),s=Number(e[3].split(")")[0]);return[t,r,n,s];}var po=/*#__PURE__*/function(_Xt4){function po(t){var _this69;_classCallCheck(this,po);_this69=_callSuper(this,po,[t]);dt(_this69,"toolsType",Tt.Selector);dt(_this69,"tmpPoints",[]);dt(_this69,"subTmpPoints",[]);dt(_this69,"workOptions");dt(_this69,"vNodes");dt(_this69,"selectIds");dt(_this69,"selectorColor");dt(_this69,"strokeColor");dt(_this69,"fillColor");dt(_this69,"oldSelectRect");dt(_this69,"oldSubSelectRect");dt(_this69,"canRotate",!1);dt(_this69,"canTextEdit",!1);dt(_this69,"canLock",!1);dt(_this69,"scaleType",Ce.all);dt(_this69,"toolsTypes");dt(_this69,"shapeOpt");dt(_this69,"textOpt");dt(_this69,"isLocked");dt(_this69,"thickness");dt(_this69,"strokeType");dt(_this69,"useStroke");_this69.workOptions=t.toolsOpt,_this69.vNodes=t.vNodes;return _this69;}_inherits(po,_Xt4);return _createClass(po,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var r=Re(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,s=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(s.keys()),intersectRect:n,subNodeMap:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=this.tmpPoints.length,n=t.length;if(n>1){var s=new Jt(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,s):this.tmpPoints.push(s);}}},{key:"drawSelector",value:function drawSelector(t){var _this70=this;var r=t.drawRect,n=t.subNodeMap,s=t.selectorId,c=t.layer,l=t.isService,f=new cr({pos:[r.x,r.y],anchor:[0,0],size:[r.w,r.h],id:s,name:s,zIndex:9999}),h=[];if(l){var m=new sl({normalize:!0,pos:[r.w/2,r.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:r.w,height:r.h,name:po.selectorBorderId});h.push(m);}n.forEach(function(m,u){var y=[m.rect.x+m.rect.w/2-r.x,m.rect.y+m.rect.h/2-r.y],T=new sl({normalize:!0,pos:y,lineWidth:1,strokeColor:n.size>1?_this70.selectorColor||_this70.workOptions.strokeColor:void 0,width:m.rect.w,height:m.rect.h,id:"selector-".concat(u),name:"selector-".concat(u)});h.push(T);}),h&&f.append.apply(f,h),(c==null?void 0:c.parent).appendChild(f);}},{key:"draw",value:function draw(t,r,n){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var f,h;var c=n.intersectRect,l=n.subNodeMap;(h=(f=r.parent)==null?void 0:f.getElementById(t))==null||h.remove(),c&&this.drawSelector({drawRect:c,subNodeMap:l,selectorId:t,layer:r,isService:s});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=Ce.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,s=!0;var _iterator23=_createForOfIteratorHelper(t.values()),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var c=_step23.value;var l=c.opt,f=c.canRotate,h=c.scaleType,m=c.toolsType;this.selectorColor=this.workOptions.strokeColor,l.strokeColor&&(this.strokeColor=l.strokeColor),l.fillColor&&(this.fillColor=l.fillColor),l.textOpt&&(this.textOpt=l.textOpt),l.thickness&&(this.thickness=l.thickness),m!==Tt.Pencil&&(s=!1),l.strokeType&&(this.strokeType=l.strokeType),m===Tt.SpeechBalloon&&(r.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=l.placement),m===Tt.Polygon&&(r.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=l.vertices),m===Tt.Star&&(r.add(m),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=l.vertices,this.shapeOpt.innerRatio=l.innerRatio,this.shapeOpt.innerVerticeStep=l.innerVerticeStep),m===Tt.Text&&(this.textOpt=l),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=f,this.scaleType=h),m===Tt.Image&&(n=c),(h===Ce.proportional&&this.scaleType!==Ce.none||h===Ce.none)&&(this.scaleType=h);}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}s&&(this.useStroke=!0),r.size&&(this.toolsTypes=_toConsumableArray(r)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=Ce.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===Ce.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],s=(r=this.vNodes.get(n))==null?void 0:r.op;if(s){var c=[];for(var l=0;l<s.length;l+=3)c.push([s[l],s[l+1]]);return c;}}}},{key:"consume",value:function consume(t){if(t.isSubWorker)return this.subWorkerConsume(t);var r=_objectSpread({type:gt.Select,dataType:Kt.Local},this.baseConsumeResult);if(t.isSimpleWorker){var m=this.subWorkerConsume(t);r.subRect=m.rect;}var _t$data3=t.data,n=_t$data3.op,s=_t$data3.workState;var c=this.oldSelectRect;if(s===te.Start&&(c=this.unSelectedAllIds()),!(n!=null&&n.length)||!this.vNodes.curNodeMap.size)return t.isSimpleWorker?r:{type:gt.None};this.updateTempPoints(n);var l=this.computSelector();if(this.selectIds&&Qr(this.selectIds,l.selectIds))return t.isSimpleWorker?r:{type:gt.None};this.selectIds=l.selectIds;var f=l.intersectRect;this.getSelecteorInfo(l.subNodeMap),this.draw(Me,this.fullLayer,l),this.oldSelectRect=f;var h=this.getChildrenPoints();return r=_objectSpread(_objectSpread({},r),{},{rect:Zt(f,c),selectIds:l.selectIds,selectRect:f,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:h,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,Me,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var s=this.getChildrenPoints();return _objectSpread({type:gt.Select,dataType:Kt.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:s,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt,thickness:this.thickness,useStroke:this.useStroke,strokeType:this.strokeType},this.baseConsumeResult);}return{type:gt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPointsForSubWorker",value:function updateTempPointsForSubWorker(t){var r=t.slice(-2),n=new Jt(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 l=_step24.value;n.push(_construct(pt,_toConsumableArray(l)));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}var s=Re(n,r),c=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:c,points:n.map(function(l){return l.XY;}).flat(1)};}},{key:"drawForSubWorker",value:function drawForSubWorker(t){var r=t.workId,n=t.layer,s=t.ps,_this$workOptions6=this.workOptions,c=_this$workOptions6.strokeColor,l=_this$workOptions6.scale,f=_this$workOptions6.rotate,h=_this$workOptions6.translate,m=n.worldPosition,u=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(s),y=_this$computDrawPoint2.points,T=_this$computDrawPoint2.rect,w=_this$computDrawPoint2.pos,I=1/n.worldScaling[0],S=c&&tA(c)||[0,0,0,0],O={close:!0,normalize:!0,points:y,lineWidth:I,fillColor:Au(S[0],S[1],S[2],0.1),strokeColor:Au(S[0],S[1],S[2],1),lineJoin:"round",lineCap:"round"};var d={x:Math.floor(T.x*u[0]+m[0]-Xt.SafeBorderPadding),y:Math.floor(T.y*u[1]+m[1]-Xt.SafeBorderPadding),w:Math.floor(T.w*u[0]+2*Xt.SafeBorderPadding),h:Math.floor(T.h*u[0]+2*Xt.SafeBorderPadding)};var v=new cr({name:r,id:r,pos:w,anchor:[0.5,0.5],size:[T.w,T.h],scale:l,rotate:f,translate:h}),p=new dn(_objectSpread(_objectSpread({},O),{},{pos:[0,0]}));if(v.appendChild(p),this.replace(n,r,v),l||f||h){var x=v.getBoundingClientRect();d={x:Math.floor(x.x-Xt.SafeBorderPadding),y:Math.floor(x.y-Xt.SafeBorderPadding),w:Math.floor(x.width+2*Xt.SafeBorderPadding),h:Math.floor(x.height+2*Xt.SafeBorderPadding)};}return d;}},{key:"transformData",value:function transformData(t){var r=Re(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,s=r.op,c=r.syncUnitTime;c&&(this.syncUnitTime=c);var l=s==null?void 0:s.length;if(!l||l<2)return{type:gt.None,rect:void 0};var f;if(this.subTmpPoints.length===0?(this.subTmpPoints=[new Jt(s[0],s[1])],f=!1):f=this.updateTempPointsForSubWorker(s),!f)return{type:gt.None,rect:void 0};var h=this.transformData(this.subTmpPoints),m=n?this.fullLayer:this.drawLayer||this.fullLayer,u=this.drawForSubWorker({ps:h,workId:this.workId,layer:m}),y=Zt(u,this.oldSubSelectRect);return this.oldSubSelectRect=u,_objectSpread({rect:y,type:gt.DrawWork,dataType:Kt.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:gt.FullWork,dataType:Kt.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]:Me;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var s=t[0],c=t[1];var l;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:s,y:c,w:0,h:0},!1),f=_this$vNodes$getRectI2.nodeRange,h=_toConsumableArray(f.values()).sort(function(m,u){return(u.opt.zIndex||0)-(m.opt.zIndex||0);});var _iterator25=_createForOfIteratorHelper(h),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _m11=_step25.value;var _u5=this.fullLayer.getElementsByName(_m11.name);if(Kh(_u5).find(function(T){return T.isPointCollision(s,c);})){l=_m11;break;}}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}if(l){var m=l.name;if(!Qr(this.oldSelectRect,l.rect)){var u=/* @__PURE__ */new Map([[m,l]]);this.getSelecteorInfo(u),this.draw(r,this.fullLayer,{intersectRect:l.rect,subNodeMap:u,selectIds:this.selectIds||[]},n);}this.selectIds=[m],this.oldSelectRect=l.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=Zt(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 s=this.vNodes.get(n);s&&s.isSelected&&(r=Zt(r,s.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 s=this.vNodes.get(n);s&&(r=Zt(r,s.rect),this.vNodes.selected(n));}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"getSelectorRect",value:function getSelectorRect(t,r){var l;var n;var s=(l=t.parent)==null?void 0:l.getElementById(r),c=s==null?void 0:s.getBoundingClientRect();return c&&(n=Zt(n,{x:Math.floor(c.x),y:Math.floor(c.y),w:Math.floor(c.width+1),h:Math.floor(c.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===Tt.Ellipse||t===Tt.Triangle||t===Tt.Rectangle||t===Tt.Polygon||t===Tt.Star||t===Tt.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var r,n,s,c,l,f,h,m,u,y,T,w,I,S,O,d,_iterator29,_step29,x,E,R,D,U,M,W,X,B,N,$,v,_x42,_E9,_R4,p;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:r=t.updateSelectorOpt,n=t.selectIds,s=t.vNodes,c=t.willSerializeData,l=t.worker,f=t.offset,h=this.fullLayer;if(h){_context24.next=3;break;}return _context24.abrupt("return");case 3:u=/* @__PURE__ */new Map(),y=r.originPoint,T=r.workState,w=r.angle,I=r.translate,S=r.dir,O=r.scale;f&&(I?r.translate=[I[0]+f[0],I[1]+f[1]]:r.translate=f);if(!(y||I||_e(w))){_context24.next=10;break;}if(!(T===te.Start&&n)){_context24.next=8;break;}return _context24.abrupt("return",(s.setTargetAssignKeys(n),{type:gt.Select,dataType:Kt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:if(!(d=s.getLastTarget(),!d)){_context24.next=10;break;}return _context24.abrupt("return");case 10:if(!n){_context24.next=66;break;}_iterator29=_createForOfIteratorHelper(n);_context24.prev=12;_iterator29.s();case 14:if((_step29=_iterator29.n()).done){_context24.next=58;break;}x=_step29.value;E=s.get(x);if(!E){_context24.next=56;break;}R=E.toolsType,D=E.opt,U=(h==null?void 0:h.getElementsByName(x))[0];if(!U){_context24.next=56;break;}M=_objectSpread({},r);W=void 0;X=Xt.isWillRefresh({toolsType:R,opt:D,updateOpt:M,vNodes:s,node:U,willSerializeData:c});if(!R){_context24.next=56;break;}W=d==null?void 0:d.get(x);B=Vh(R);if(!(B==null||B.updateNodeOpt({node:U,opt:M,vNodes:s,willSerializeData:c,targetNode:W}),E&&l&&X)){_context24.next=55;break;}N=l.createWorkShapeNode({workId:x,toolsType:R,toolsOpt:E.opt});N==null||N.setWorkId(x);$=void 0;if(!(R===Tt.BackgroundSVG)){_context24.next=34;break;}$=N.consumeService({isFullWork:!0,replaceId:x});_context24.next=54;break;case 34:if(!(R===Tt.Image)){_context24.next=40;break;}_context24.next=37;return N.consumeServiceAsync({isFullWork:!0,replaceId:x,worker:l});case 37:$=_context24.sent;_context24.next=54;break;case 40:if(!(R===Tt.Text)){_context24.next=46;break;}_context24.next=43;return N.consumeServiceAsync({isFullWork:!0,replaceId:x,isDrawLabel:!0});case 43:$=_context24.sent;_context24.next=54;break;case 46:_context24.prev=46;$=N==null?void 0:N.consumeService({op:E.op,isFullWork:!0,replaceId:x,workState:T});_context24.next=54;break;case 50:_context24.prev=50;_context24.t0=_context24["catch"](46);console.error("consumeService error",_context24.t0);return _context24.abrupt("continue",56);case 54:$&&(E.rect=$);case 55:E&&(u.set(x,E),m=Zt(m,E.rect));case 56:_context24.next=14;break;case 58:_context24.next=63;break;case 60:_context24.prev=60;_context24.t1=_context24["catch"](12);_iterator29.e(_context24.t1);case 63:_context24.prev=63;_iterator29.f();return _context24.finish(63);case 66:d&&T===te.Done&&(s.deleteLastTarget(),d=void 0);v=m;if(!(y&&I&&O&&S&&v&&!f)){_context24.next=86;break;}_x42=[[v.x,v.y],[v.x+v.w,v.y],[v.x+v.w,v.y+v.h],[v.x,v.y+v.h]];_context24.t2=S;_context24.next=_context24.t2==="top"?73:_context24.t2==="topLeft"?73:_context24.t2==="left"?73:_context24.t2==="topRight"?75:_context24.t2==="right"?77:_context24.t2==="bottomRight"?77:_context24.t2==="bottom"?77:_context24.t2==="bottomLeft"?79:81;break;case 73:I[0]>0&&I[1]>0?_E9=_x42[0]:I[0]>0?_E9=_x42[3]:I[1]>0?_E9=_x42[1]:_E9=_x42[2];return _context24.abrupt("break",81);case 75:I[0]<0&&I[1]>0?_E9=_x42[1]:I[0]<0?_E9=_x42[2]:I[1]>0?_E9=_x42[0]:_E9=_x42[3];return _context24.abrupt("break",81);case 77:I[0]<0&&I[1]<0?_E9=_x42[2]:I[0]<0?_E9=_x42[1]:I[1]<0?_E9=_x42[3]:_E9=_x42[0];return _context24.abrupt("break",81);case 79:I[0]>0&&I[1]<0?_E9=_x42[3]:I[0]>0?_E9=_x42[0]:I[1]<0?_E9=_x42[2]:_E9=_x42[1];return _context24.abrupt("break",81);case 81:_R4=_E9&&[y[0]-_E9[0],y[1]-_E9[1]]||[0,0];if(Qr(_R4,[0,0])){_context24.next=86;break;}_context24.next=85;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{updateSelectorOpt:{workState:T},offset:_R4}));case 85:return _context24.abrupt("return",_context24.sent);case 86:this.getSelecteorInfo(u),this.draw(Me,h,{selectIds:n||[],subNodeMap:u,intersectRect:v});p=Zt(this.oldSelectRect,v);return _context24.abrupt("return",(this.oldSelectRect=v,{type:gt.Select,dataType:Kt.Local,selectRect:v,renderRect:m,rect:Zt(p,v),selectIds:n}));case 89:case"end":return _context24.stop();}},_callee22,this,[[12,60,63,66],[46,50]]);}));function updateSelector(_x41){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:gt.Select,dataType:Kt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(yi,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,r,n){var _this71=this;var s=r.selectIds,c=this.getRightServiceId(t),l=this.getSelectorRect(this.fullLayer,c);var f;var h=/* @__PURE__ */new Map();return s==null||s.forEach(function(m){var u=_this71.vNodes.get(m);u&&(f=Zt(f,u.rect),h.set(m,u));}),this.getSelecteorInfo(h),this.draw(c,this.fullLayer,{intersectRect:f,selectIds:s||[],subNodeMap:h},n),Zt(f,l);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this72=this;var n;var t;var r=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(s){var c=_this72.vNodes.get(s);c&&(t=Zt(t,c.rect),r.set(s,c));},this),this.getSelecteorInfo(r),this.draw(Me,this.fullLayer,{intersectRect:t,subNodeMap:r,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var c;var r;var n=(c=this.selectIds)==null?void 0:c.filter(function(l){return!t.includes(l);});if(n!=null&&n.length&&(r=this.unSelectedByIds(n)),t.length){var l=this.selectedByIds(t);r=Zt(r,l);}this.selectIds=t;var s=this.reRenderSelector();return{bgRect:r,selectRect:s};}},{key:"cursorHover",value:function cursorHover(t){var c,l;var r=this.oldSelectRect;this.selectIds=[];var n=(c=this.workId)==null?void 0:c.toString(),s=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(s,n,!0),this.oldSelectRect&&!Qr(r,this.oldSelectRect))return{type:gt.CursorHover,dataType:Kt.Local,rect:Zt(r,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((l=this.selectIds)!=null&&l.length||(this.oldSelectRect=void 0),r&&!this.oldSelectRect)return this.cursorBlur(),{type:gt.CursorHover,dataType:Kt.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(s){s.name===t&&s.remove();});}}]);}(Xt);dt(po,"selectorBorderId","selector-border");var ki=po;var wh=/*#__PURE__*/function(_Xt5){function wh(t){var _this73;_classCallCheck(this,wh);_this73=_callSuper(this,wh,[t]);dt(_this73,"canRotate",!1);dt(_this73,"scaleType",Ce.both);dt(_this73,"toolsType",Tt.Arrow);dt(_this73,"tmpPoints",[]);dt(_this73,"workOptions");dt(_this73,"oldRect");dt(_this73,"arrowTipWidth");dt(_this73,"syncTimestamp");_this73.workOptions=t.toolsOpt,_this73.arrowTipWidth=_this73.workOptions.thickness*4,_this73.syncTimestamp=0,_this73.syncUnitTime=50;return _this73;}_inherits(wh,_Xt5);return _createClass(wh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=r.syncUnitTime;u&&(this.syncUnitTime=u);var y=m==null?void 0:m.length;if(!y||y<2)return{type:gt.None};var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],T=!1):T=this.updateTempPoints(m),!T)return{type:gt.None};var w;if(s||c||f){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;w=this.draw({workId:h,layer:S});}if(f){var _S9=Zt(w,this.oldRect);this.oldRect=w;var _O35=_objectSpread({rect:_S9,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d34=Date.now();_d34-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d34,_O35.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_O35.index=0,_O35.isSync=!0);}return _O35;}if(!s&&l){var _S10=Date.now();return _S10-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S10,_objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:gt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(O){return[].concat(_toConsumableArray(O.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:gt.None};}var I=Zt(w,this.oldRect);return this.oldRect=w,_objectSpread(_objectSpread({rect:I},this.baseConsumeResult),{},{type:gt.DrawWork,dataType:Kt.Local});}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:gt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:Xt.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n},this.baseConsumeResult),{},{type:gt.FullWork,dataType:Kt.Local,ops:c,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawEraserlines,_this$workOptions7=this.workOptions,c=_this$workOptions7.strokeColor,l=_this$workOptions7.thickness,f=_this$workOptions7.zIndex,h=_this$workOptions7.scale,m=_this$workOptions7.rotate,u=_this$workOptions7.translate,y=_this$workOptions7.strokeType,T=_this$workOptions7.eraserlines,w=_this$workOptions7.lineDash,I=_this$workOptions7.lineCap,S=n.worldPosition,O=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(l),d=_this$computDrawPoint3.points,v=_this$computDrawPoint3.pos,p=_this$computDrawPoint3.rect,x=_this$computDrawPoint3.isTriangle,E=_this$computDrawPoint3.trianglePoints,R=_this$computDrawPoint3.trianglePos,D=[p.x+p.w/2,p.y+p.h/2],U={pos:D,name:r,id:r,zIndex:f,anchor:[0.5,0.5],size:[p.w,p.h]};h&&(U.scale=h),m&&(U.rotate=m),u&&(U.translate=u);var M=new cr(U),W={points:E,pos:[R[0]-D[0],R[1]-D[1]],fillColor:c,strokeColor:c,lineWidth:0,normalize:!1},X=new dn(W);if(M.append(X),!x&&d&&v){var N={points:d,pos:[v[0]-D[0],v[1]-D[1]],fillColor:c,strokeColor:c,lineDash:y===Ae.Dotted?[w&&w[0]||1,(w&&w[1]||2)*l]:y===Ae.LongDotted?[(w&&w[0]||1)*l,(w&&w[1]||2)*l]:void 0,lineCap:y===Ae.Normal?void 0:I,lineWidth:l,normalize:!1},$=new dn(N);M.append($);}T&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:M,eraserlines:T,pos:D,layer:n},s)),this.replace(n,r,M);var B={x:Math.floor(p.x*O[0]+S[0]-Xt.SafeBorderPadding),y:Math.floor(p.y*O[1]+S[1]-Xt.SafeBorderPadding),w:Math.floor(p.w*O[0]+2*Xt.SafeBorderPadding),h:Math.floor(p.h*O[1]+2*Xt.SafeBorderPadding)};if(h||m||u){var _N8=M.getBoundingClientRect();B={x:Math.floor(_N8.x-Xt.SafeBorderPadding),y:Math.floor(_N8.y-Xt.SafeBorderPadding),w:Math.floor(_N8.width+Xt.SafeBorderPadding*2),h:Math.floor(_N8.height+Xt.SafeBorderPadding*2)};}return this.isDelete&&M.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 _this74=this;var r=pt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=pt.Per(r).mul(t/2),s=Jt.Sub(this.tmpPoints[0],n),c=Jt.Add(this.tmpPoints[0],n),l=pt.Mul(r,this.arrowTipWidth),f=pt.Sub(this.tmpPoints[1],l),h=Jt.Sub(f,n),m=Jt.Add(f,n),u=pt.Per(r).mul(t*1.5),y=Jt.Sub(f,u),T=Jt.Add(f,u),w=[this.tmpPoints[0],f],I=[y,this.tmpPoints[1],T],S=[s,c].concat(I,[h,m]);return{trianglePoints:I.map(function(O){return Jt.Sub(O,_this74.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,points:w.map(function(O){return Jt.Sub(O,_this74.tmpPoints[0]).XY;}).flat(1),rect:Re(S),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this75=this;var t=pt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),r=this.tmpPoints[1].distance(this.tmpPoints[0]),n=pt.Per(t).mul(Math.floor(r*3/8)),s=Jt.Sub(this.tmpPoints[0],n),c=Jt.Add(this.tmpPoints[0],n),l=[s,this.tmpPoints[1],c];return{trianglePoints:l.map(function(f){return Jt.Sub(f,_this75.tmpPoints[1]).XY;}).flat(1),trianglePos:this.tmpPoints[1].XY,rect:Re(l),isTriangle:!0};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))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 h,m;var r=t.op,n=t.isFullWork,_t$workState2=t.workState,s=_t$workState2===void 0?te.Done:_t$workState2,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:Xt.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,m;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.strokeType,f=s.get(r.name);return c&&(r.tagName==="GROUP"?r.children.forEach(function(u){u.setAttribute("strokeColor",c),u.getAttribute("fillColor")&&u.setAttribute("fillColor",c);}):(r.setAttribute("strokeColor",c),r.setAttribute("fillColor",c)),(h=f==null?void 0:f.opt)!=null&&h.strokeColor&&(f.opt.strokeColor=c)),l&&f!=null&&f.opt&&(m=f.opt)!=null&&m.strokeType&&(f.opt.strokeType=l),f&&s.setInfo(r.name,f),Xt.updateNodeOpt(t);}}]);}(Xt);var Ah=/*#__PURE__*/function(_Xt6){function Ah(t){var _this76;_classCallCheck(this,Ah);_this76=_callSuper(this,Ah,[t]);dt(_this76,"canRotate",!1);dt(_this76,"scaleType",Ce.all);dt(_this76,"toolsType",Tt.Ellipse);dt(_this76,"tmpPoints",[]);dt(_this76,"workOptions");dt(_this76,"oldRect");dt(_this76,"syncTimestamp");_this76.workOptions=t.toolsOpt,_this76.syncTimestamp=0,_this76.syncUnitTime=50;return _this76;}_inherits(Ah,_Xt6);return _createClass(Ah,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=r.syncUnitTime;u&&(this.syncUnitTime=u);var y=m==null?void 0:m.length;if(!y||y<2)return{type:gt.None};var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],T=!1):T=this.updateTempPoints(m),!T)return{type:gt.None};var w;if(s||c||f){var I=n?this.fullLayer:this.drawLayer||this.fullLayer;w=this.draw({workId:h,layer:I,isDrawing:!0});var S=I.parent.parent,_O36={x:0,y:0,w:Math.floor(S.width),h:Math.floor(S.height)},_d35=_objectSpread({type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(Ji(w,_O36)!==Tr.outside){var p=Zt(w,this.oldRect);if(this.oldRect=w,_d35.rect=p,!f)return _d35;}if(f){var _p14=Date.now();return _p14-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_p14,_d35.op=this.tmpPoints.map(function(x){return[].concat(_toConsumableArray(x.XY),[0]);}).flat(1),_d35.index=0,_d35.isSync=!0),_d35;}return{type:gt.None};}if(!s&&!c&&!f&&l){var _I4=Date.now();return _I4-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_I4,_objectSpread(_objectSpread({type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult),{},{op:this.tmpPoints.map(function(S){return[].concat(_toConsumableArray(S.XY),[0]);}).flat(1),isSync:!0,index:0})):{type:gt.None};}return{type:gt.None};}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:gt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:n&&Xt.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:gt.FullWork,dataType:Kt.Local},this.baseConsumeResult),{},{ops:c,isSync:!0,updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,c=t.isDrawEraserlines,_this$workOptions8=this.workOptions,l=_this$workOptions8.strokeColor,f=_this$workOptions8.fillColor,h=_this$workOptions8.thickness,m=_this$workOptions8.zIndex,u=_this$workOptions8.scale,y=_this$workOptions8.rotate,T=_this$workOptions8.translate,w=_this$workOptions8.strokeType,I=_this$workOptions8.eraserlines,S=_this$workOptions8.lineDash,O=_this$workOptions8.lineCap,d=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(h),v=_this$computDrawPoint4.radius,p=_this$computDrawPoint4.rect,x=_this$computDrawPoint4.pos,E={closeType:"normal",radius:v,lineWidth:h,fillColor:f!=="transparent"&&f||void 0,strokeColor:l,normalize:!0,lineCap:O,lineDash:w===Ae.Dotted?[S&&S[0]||1,(S&&S[1]||2)*h]:w===Ae.LongDotted?[(S&&S[0]||1)*h,(S&&S[1]||2)*h]:void 0},R={name:r,id:r,zIndex:m,pos:x,anchor:[0.5,0.5],size:[p.w,p.h]};u&&(R.scale=u),y&&(R.rotate=y),T&&(R.translate=T);var D=new cr(R);if(s){var W=new Mn({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:l,lineWidth:1,scale:[1/d[0],1/d[1]]});D.append(W);}var U=new t1(_objectSpread(_objectSpread({},E),{},{pos:[0,0]}));D.append(U),I&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:D,eraserlines:I,pos:x,layer:n},c)),this.replace(n,r,D);var M=D.getBoundingClientRect();return this.isDelete&&D.setAttribute("opacity",0),{x:Math.floor(M.x-Xt.SafeBorderPadding),y:Math.floor(M.y-Xt.SafeBorderPadding),w:Math.floor(M.width+Xt.SafeBorderPadding*2),h:Math.floor(M.height+Xt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var r=Re(this.tmpPoints),n=Re(this.tmpPoints,t),s=[Math.floor(r.x+r.w/2),Math.floor(r.y+r.h/2)];return{rect:n,pos:s,radius:[Math.floor(r.w/2),Math.floor(r.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))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 h,m;var r=t.op,n=t.isFullWork,_t$workState3=t.workState,s=_t$workState3===void 0?te.Done:_t$workState3,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:Xt.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var u,y,T;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.strokeType,h=s.get(r.name);var m=r;return r.tagName==="GROUP"&&(m=r.children[0]),c&&(m.setAttribute("strokeColor",c),(u=h==null?void 0:h.opt)!=null&&u.strokeColor&&(h.opt.strokeColor=c)),l&&(l==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",l),(y=h==null?void 0:h.opt)!=null&&y.fillColor&&(h.opt.fillColor=l)),f&&h!=null&&h.opt&&(T=h.opt)!=null&&T.strokeType&&(h.opt.strokeType=f),h&&s.setInfo(r.name,h),Xt.updateNodeOpt(t);}}]);}(Xt);var Eh=/*#__PURE__*/function(_Xt7){function Eh(t){var _this77;_classCallCheck(this,Eh);_this77=_callSuper(this,Eh,[t]);dt(_this77,"canRotate",!0);dt(_this77,"scaleType",Ce.all);dt(_this77,"toolsType",Tt.Rectangle);dt(_this77,"tmpPoints",[]);dt(_this77,"workOptions");dt(_this77,"oldRect");dt(_this77,"syncTimestamp");_this77.workOptions=t.toolsOpt,_this77.syncTimestamp=0,_this77.syncUnitTime=50;return _this77;}_inherits(Eh,_Xt7);return _createClass(Eh,[{key:"transformData",value:function transformData(){var t=Re(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 l=_step30.value;n.push(_construct(pt,_toConsumableArray(l)));}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}var s=Re(n,r),c=[s.x+s.w/2,s.y+s.h/2];return{rect:s,pos:c,points:n.map(function(l){return l.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=m==null?void 0:m.length;if(!u||u<2)return{type:gt.None};var y;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],y=!1):y=this.updateTempPoints(m),!y)return{type:gt.None};var T=this.transformData();var w;if(s||c||f){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;w=this.draw({ps:T,workId:h,layer:S,isDrawing:!0});}if(f){var _S11=Zt(w,this.oldRect);this.oldRect=w;var _O37=_objectSpread({rect:_S11,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d36=Date.now();_d36-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d36,_O37.op=T.flat(1),_O37.index=0,_O37.isSync=!0);}return _O37;}if(!s&&l){var _S12=Date.now();return _S12-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S12,_objectSpread({type:gt.DrawWork,dataType:Kt.Local,op:T.flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:gt.None};}var I=Zt(w,this.oldRect);return this.oldRect=w,_objectSpread({rect:I,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var f;var t=this.workId;if(this.tmpPoints.length<2)return{type:gt.RemoveNode,removeIds:[t]};var r=this.transformData(),n=this.fullLayer,s=this.draw({ps:r,workId:t,layer:n,isDrawing:!1});this.oldRect=s;var c=r.flat(1),l=mr(c);return(f=this.vNodes)==null||f.setInfo(t,{rect:s,op:c,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&Xt.getCenterPos(s,n)}),_objectSpread(_objectSpread({rect:s,type:gt.FullWork,dataType:Kt.Local,ops:l,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,c=t.ps,l=t.replaceId,_t$isDrawEraserlines2=t.isDrawEraserlines,f=_t$isDrawEraserlines2===void 0?!0:_t$isDrawEraserlines2,_this$workOptions9=this.workOptions,h=_this$workOptions9.strokeColor,m=_this$workOptions9.fillColor,u=_this$workOptions9.thickness,y=_this$workOptions9.zIndex,T=_this$workOptions9.scale,w=_this$workOptions9.rotate,I=_this$workOptions9.translate,S=_this$workOptions9.strokeType,O=_this$workOptions9.eraserlines,d=_this$workOptions9.lineCap,v=_this$workOptions9.lineDash,p=n.worldPosition,x=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(c),E=_this$computDrawPoint5.points,R=_this$computDrawPoint5.rect,D=_this$computDrawPoint5.pos,U={close:!0,normalize:!0,points:E,lineWidth:u,fillColor:m!=="transparent"&&m||void 0,strokeColor:h,lineCap:d,lineDash:S===Ae.Dotted?[v&&v[0]||1,(v&&v[1]||2)*u]:S===Ae.LongDotted?[(v&&v[0]||1)*u,(v&&v[1]||2)*u]:void 0};var M={x:Math.floor(R.x*x[0]+p[0]-Xt.SafeBorderPadding),y:Math.floor(R.y*x[1]+p[1]-Xt.SafeBorderPadding),w:Math.floor(R.w*x[0]+2*Xt.SafeBorderPadding),h:Math.floor(R.h*x[0]+2*Xt.SafeBorderPadding)};var W=new cr({name:r,id:r,zIndex:y,pos:D,anchor:[0.5,0.5],size:[R.w,R.h],scale:T,rotate:w,translate:I}),X=new dn(_objectSpread(_objectSpread({},U),{},{pos:[0,0]}));if(W.appendChild(X),s){var B=new Mn({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:h,lineWidth:1,scale:[1/x[0],1/x[1]]});W.appendChild(B);}if(O&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:W,eraserlines:O,pos:D,layer:n},f)),this.replace(n,l||r,W),T||w||I){var _B4=W.getBoundingClientRect();M={x:Math.floor(_B4.x-Xt.SafeBorderPadding),y:Math.floor(_B4.y-Xt.SafeBorderPadding),w:Math.floor(_B4.width+2*Xt.SafeBorderPadding),h:Math.floor(_B4.height+2*Xt.SafeBorderPadding)};}return this.isDelete&&W.setAttribute("opacity",0),M;}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))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 u,y;var r=t.op,n=t.isFullWork,s=t.replaceId,_t$workState4=t.workState,c=_t$workState4===void 0?te.Done:_t$workState4,l=(u=this.workId)==null?void 0:u.toString();if(!l)return;var f=[];for(var T=0;T<r.length;T+=3)f.push([r[T],r[T+1],r[T+2]]);var h=n?this.fullLayer:this.drawLayer||this.fullLayer,m=this.draw({ps:f,workId:l,layer:h,isDrawing:!1,replaceId:s,isDrawEraserlines:c===te.Done});return this.oldRect=m,(y=this.vNodes)==null||y.setInfo(l,{rect:m,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&Xt.getCenterPos(m,h)}),m;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var u,y,T;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.strokeType,h=s.get(r.name);var m=r;return r.tagName==="GROUP"&&(m=r.children[0]),c&&(m.setAttribute("strokeColor",c),(u=h==null?void 0:h.opt)!=null&&u.strokeColor&&(h.opt.strokeColor=c)),l&&(l==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",l),(y=h==null?void 0:h.opt)!=null&&y.fillColor&&(h.opt.fillColor=l)),f&&h!=null&&h.opt&&(T=h.opt)!=null&&T.strokeType&&(h.opt.strokeType=f),h&&s.setInfo(r.name,h),Xt.updateNodeOpt(t);}}]);}(Xt);var Mh=/*#__PURE__*/function(_Xt8){function Mh(t){var _this78;_classCallCheck(this,Mh);_this78=_callSuper(this,Mh,[t]);dt(_this78,"canRotate",!1);dt(_this78,"scaleType",Ce.all);dt(_this78,"toolsType",Tt.Star);dt(_this78,"tmpPoints",[]);dt(_this78,"workOptions");dt(_this78,"oldRect");dt(_this78,"syncTimestamp");_this78.workOptions=t.toolsOpt,_this78.syncTimestamp=0,_this78.syncUnitTime=50;return _this78;}_inherits(Mh,_Xt8);return _createClass(Mh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=r.syncUnitTime,y=m==null?void 0:m.length;if(!y||y<2)return{type:gt.None};u&&(this.syncUnitTime=u);var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],T=!1):T=this.updateTempPoints(m),!T)return{type:gt.None};var w;if(s||c||f){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;w=this.draw({workId:h,layer:S,isDrawing:!0});}if(f){var _S13=Zt(w,this.oldRect);this.oldRect=w;var _O38=_objectSpread({rect:_S13,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d37=Date.now();_d37-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d37,_O38.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_O38.index=0,_O38.isSync=!0);}return _O38;}if(!s&&l){var _S14=Date.now();return _S14-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S14,_objectSpread({type:gt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(O){return[].concat(_toConsumableArray(O.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:gt.None};}var I=Zt(w,this.oldRect);return this.oldRect=w,_objectSpread({rect:I,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:gt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Xt.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:gt.FullWork,dataType:Kt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,_t$isDrawEraserlines3=t.isDrawEraserlines,c=_t$isDrawEraserlines3===void 0?!0:_t$isDrawEraserlines3,_this$workOptions10=this.workOptions,l=_this$workOptions10.strokeColor,f=_this$workOptions10.fillColor,h=_this$workOptions10.thickness,m=_this$workOptions10.zIndex,u=_this$workOptions10.vertices,y=_this$workOptions10.innerVerticeStep,T=_this$workOptions10.innerRatio,w=_this$workOptions10.scale,I=_this$workOptions10.rotate,S=_this$workOptions10.translate,O=_this$workOptions10.strokeType,d=_this$workOptions10.eraserlines,v=_this$workOptions10.lineDash,p=_this$workOptions10.lineCap,x=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(h,u,y,T),E=_this$computDrawPoint6.rect,R=_this$computDrawPoint6.pos,D=_this$computDrawPoint6.points,U={close:!0,points:D,lineWidth:h,fillColor:f!=="transparent"&&f||void 0,strokeColor:l,normalize:!0,lineCap:p,lineDash:O===Ae.Dotted?[v&&v[0]||1,(v&&v[1]||2)*h]:O===Ae.LongDotted?[(v&&v[0]||1)*h,(v&&v[1]||2)*h]:void 0},M={name:r,id:r,zIndex:m,pos:R,anchor:[0.5,0.5],size:[E.w,E.h]};w&&(M.scale=w),I&&(M.rotate=I),S&&(M.translate=S);var W=new cr(M);if(s){var N=new Mn({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:l,lineWidth:1,scale:[1/x[0],1/x[1]]});W.append(N);}var X=new dn(_objectSpread(_objectSpread({},U),{},{pos:[0,0]}));W.append(X),d&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:W,eraserlines:d,pos:R,layer:n},c)),this.replace(n,r,W);var B=W.getBoundingClientRect();return this.isDelete&&W.setAttribute("opacity",0),{x:Math.floor(B.x-Xt.SafeBorderPadding),y:Math.floor(B.y-Xt.SafeBorderPadding),w:Math.floor(B.width+Xt.SafeBorderPadding*2),h:Math.floor(B.height+Xt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r,n,s){var c=Re(this.tmpPoints),l=[Math.floor(c.x+c.w/2),Math.floor(c.y+c.h/2)],f=Jh(c.w,c.h),h=Math.floor(Math.min(c.w,c.h)/2),m=s*h,u=[],y=2*Math.PI/r;for(var w=0;w<r;w++){var I=w*y-0.5*Math.PI;var S=void 0,_O39=void 0;w%n===1?(S=m*f[0]*Math.cos(I),_O39=m*f[1]*Math.sin(I)):(S=h*f[0]*Math.cos(I),_O39=h*f[1]*Math.sin(I),u.push(S,_O39)),u.push(S,_O39);}return{rect:Re(this.tmpPoints,t),pos:l,points:u};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c)||Jt.Sub(s,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 h,m;var r=t.op,n=t.isFullWork,_t$workState5=t.workState,s=_t$workState5===void 0?te.Done:_t$workState5,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&Xt.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var S;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.toolsType,h=n.vertices,m=n.innerVerticeStep,u=n.innerRatio,y=n.strokeType,T=s.get(r.name),w=T==null?void 0:T.opt;var I=r;return r.tagName==="GROUP"&&(I=r.children[0]),c&&(I.setAttribute("strokeColor",c),w!=null&&w.strokeColor&&(w.strokeColor=c)),l&&(l==="transparent"?I.setAttribute("fillColor","rgba(0,0,0,0)"):I.setAttribute("fillColor",l),w!=null&&w.fillColor&&(w.fillColor=l)),f===Tt.Star&&(h&&(w.vertices=h),m&&(w.innerVerticeStep=m),u&&(w.innerRatio=u)),y&&T!=null&&T.opt&&(S=T.opt)!=null&&S.strokeType&&(T.opt.strokeType=y),T&&s.setInfo(r.name,_objectSpread(_objectSpread({},T),{},{opt:w})),Xt.updateNodeOpt(t);}}]);}(Xt);var Lh=/*#__PURE__*/function(_Xt9){function Lh(t){var _this79;_classCallCheck(this,Lh);_this79=_callSuper(this,Lh,[t]);dt(_this79,"canRotate",!1);dt(_this79,"scaleType",Ce.all);dt(_this79,"toolsType",Tt.Polygon);dt(_this79,"tmpPoints",[]);dt(_this79,"workOptions");dt(_this79,"oldRect");dt(_this79,"syncTimestamp");_this79.workOptions=t.toolsOpt,_this79.syncTimestamp=0,_this79.syncUnitTime=50;return _this79;}_inherits(Lh,_Xt9);return _createClass(Lh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=r.op,m=r.syncUnitTime;m&&(this.syncUnitTime=m);var u=this.workId,y=h==null?void 0:h.length;if(!y||y<2)return{type:gt.None};var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(h[0],h[1])],T=!1):T=this.updateTempPoints(h),!T)return{type:gt.None};var w;if(s||c||f){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;w=this.draw({workId:u,layer:S,isDrawing:!0});}if(f){var _S15=Zt(w,this.oldRect);this.oldRect=w;var _O40=_objectSpread({type:gt.DrawWork,rect:_S15,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d38=Date.now();_d38-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d38,_O40.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_O40.index=0,_O40.isSync=!0);}return _O40;}if(!s&&l){var _S16=Date.now();return _S16-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S16,_objectSpread({type:gt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(O){return[].concat(_toConsumableArray(O.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:gt.None};}var I=Zt(w,this.oldRect);return this.oldRect=w,_objectSpread({rect:I,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:gt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Xt.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:gt.FullWork,dataType:Kt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,s=t.isDrawing,_t$isDrawEraserlines4=t.isDrawEraserlines,c=_t$isDrawEraserlines4===void 0?!0:_t$isDrawEraserlines4,_this$workOptions11=this.workOptions,l=_this$workOptions11.strokeColor,f=_this$workOptions11.fillColor,h=_this$workOptions11.thickness,m=_this$workOptions11.zIndex,u=_this$workOptions11.vertices,y=_this$workOptions11.scale,T=_this$workOptions11.rotate,w=_this$workOptions11.translate,I=_this$workOptions11.strokeType,S=_this$workOptions11.eraserlines,O=_this$workOptions11.lineCap,d=_this$workOptions11.lineDash,v=n.worldScaling,_this$computDrawPoint7=this.computDrawPoints(h,u),p=_this$computDrawPoint7.rect,x=_this$computDrawPoint7.pos,E=_this$computDrawPoint7.points,R={close:!0,points:E,lineWidth:h,fillColor:f!=="transparent"&&f||void 0,strokeColor:l,normalize:!0,lineCap:O,lineDash:I===Ae.Dotted?[d&&d[0]||1,(d&&d[1]||2)*h]:I===Ae.LongDotted?[(d&&d[0]||1)*h,(d&&d[1]||2)*h]:void 0},D={name:r,id:r,zIndex:m,pos:x,anchor:[0.5,0.5],size:[p.w,p.h]};y&&(D.scale=y),T&&(D.rotate=T),w&&(D.translate=w);var U=new cr(D);if(s){var X=new Mn({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:l,lineWidth:1,scale:[1/v[0],1/v[1]]});U.append(X);}var M=new dn(_objectSpread(_objectSpread({},R),{},{pos:[0,0]}));U.append(M),S&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:U,eraserlines:S,pos:x,layer:n},c)),this.replace(n,r,U);var W=U.getBoundingClientRect();return this.isDelete&&U.setAttribute("opacity",0),{x:Math.floor(W.x-Xt.SafeBorderPadding),y:Math.floor(W.y-Xt.SafeBorderPadding),w:Math.floor(W.width+Xt.SafeBorderPadding*2),h:Math.floor(W.height+Xt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=Re(this.tmpPoints),s=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],c=Jh(n.w,n.h),l=Math.floor(Math.min(n.w,n.h)/2),f=[],h=2*Math.PI/r;for(var u=0;u<r;u++){var y=u*h-0.5*Math.PI,T=l*c[0]*Math.cos(y),w=l*c[1]*Math.sin(y);f.push(T,w);}return{rect:Re(this.tmpPoints,t),pos:s,points:f};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c)||Jt.Sub(s,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 h,m;var r=t.op,n=t.isFullWork,_t$workState6=t.workState,s=_t$workState6===void 0?te.Done:_t$workState6,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&Xt.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var w;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.toolsType,h=n.vertices,m=n.strokeType,u=s.get(r.name),y=u==null?void 0:u.opt;var T=r;return r.tagName==="GROUP"&&(T=r.children[0]),c&&(T.setAttribute("strokeColor",c),y!=null&&y.strokeColor&&(y.strokeColor=c)),l&&(l==="transparent"?T.setAttribute("fillColor","rgba(0,0,0,0)"):T.setAttribute("fillColor",l),y!=null&&y.fillColor&&(y.fillColor=l)),f===Tt.Polygon&&h&&(y.vertices=h),m&&u!=null&&u.opt&&(w=u.opt)!=null&&w.strokeType&&(u.opt.strokeType=m),u&&s.setInfo(r.name,_objectSpread(_objectSpread({},u),{},{opt:y})),Xt.updateNodeOpt(t);}}]);}(Xt);var kr=/*#__PURE__*/function(){function kr(){_classCallCheck(this,kr);}return _createClass(kr,null,[{key:"bezier",value:function bezier(e,t){var r=[];for(var n=0;n<t.length;n+=4){var s=t[n],c=t[n+1],l=t[n+2],f=t[n+3];s&&c&&l&&f?r.push.apply(r,_toConsumableArray(kr.getBezierPoints(e,s,c,l,f))):s&&c&&l?r.push.apply(r,_toConsumableArray(kr.getBezierPoints(e,s,c,l))):s&&c?r.push.apply(r,_toConsumableArray(kr.getBezierPoints(e,s,c))):s&&r.push(s);}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 s=arguments.length>4?arguments[4]:undefined;var c=null;var l=[];!n&&!s?c=kr.oneBezier:n&&!s?c=kr.twoBezier:n&&s&&(c=kr.threeBezier);for(var f=0;f<e;f++)c&&l.push(c(f/e,t,r,n,s));return s?l.push(s):n&&l.push(n),l;}/**
|
|
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,s=t.y+(r.y-t.y)*e;return new pt(n,s);}/**
|
|
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 s=(1-e)*(1-e)*t.x+2*e*(1-e)*r.x+e*e*n.x,c=(1-e)*(1-e)*t.y+2*e*(1-e)*r.y+e*e*n.y;return new pt(s,c);}/**
|
|
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,s){var c=t.x*(1-e)*(1-e)*(1-e)+3*r.x*e*(1-e)*(1-e)+3*n.x*e*e*(1-e)+s.x*e*e*e,l=t.y*(1-e)*(1-e)*(1-e)+3*r.y*e*(1-e)*(1-e)+3*n.y*e*e*(1-e)+s.y*e*e*e;return new pt(c,l);}}]);}();var Rh=/*#__PURE__*/function(_Xt10){function Rh(t){var _this80;_classCallCheck(this,Rh);_this80=_callSuper(this,Rh,[t]);dt(_this80,"canRotate",!1);dt(_this80,"scaleType",Ce.all);dt(_this80,"toolsType",Tt.SpeechBalloon);dt(_this80,"ratio",0.8);dt(_this80,"tmpPoints",[]);dt(_this80,"workOptions");dt(_this80,"oldRect");dt(_this80,"syncTimestamp");_this80.workOptions=t.toolsOpt,_this80.syncTimestamp=0,_this80.syncUnitTime=50;return _this80;}_inherits(Rh,_Xt10);return _createClass(Rh,[{key:"consume",value:function consume(t){var I;var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=(I=r==null?void 0:r.workId)==null?void 0:I.toString();if(!h)return{type:gt.None};var m=r.op,u=m==null?void 0:m.length;if(!u||u<2)return{type:gt.None};var y;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],y=!1):y=this.updateTempPoints(m),!y)return{type:gt.None};var T;if(s||c||f){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;T=this.draw({workId:h,layer:S,isDrawing:!0});}if(f){var _S17=Zt(T,this.oldRect);this.oldRect=T;var _O41=_objectSpread({rect:_S17,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d39=Date.now();_d39-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d39,_O41.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_O41.index=0,_O41.isSync=!0);}return _O41;}if(!s&&l){var _S18=Date.now();return _S18-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S18,_objectSpread({type:gt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(O){return[].concat(_toConsumableArray(O.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:gt.None};}var w=Zt(T,this.oldRect);return this.oldRect=T,_objectSpread({rect:w,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:gt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r,isDrawing:!1});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Xt.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:gt.FullWork,dataType:Kt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines5=t.isDrawEraserlines,s=_t$isDrawEraserlines5===void 0?!0:_t$isDrawEraserlines5,_this$workOptions12=this.workOptions,c=_this$workOptions12.strokeColor,l=_this$workOptions12.fillColor,f=_this$workOptions12.thickness,h=_this$workOptions12.zIndex,m=_this$workOptions12.placement,u=_this$workOptions12.scale,y=_this$workOptions12.rotate,T=_this$workOptions12.translate,w=_this$workOptions12.strokeType,I=_this$workOptions12.eraserlines,S=_this$workOptions12.lineDash,O=_this$workOptions12.lineCap,_this$computDrawPoint8=this.computDrawPoints(f,m),d=_this$computDrawPoint8.rect,v=_this$computDrawPoint8.pos,p=_this$computDrawPoint8.points,x={points:p.map(function(M){return M.XY;}),lineWidth:f,fillColor:l!=="transparent"&&l||void 0,strokeColor:c,normalize:!0,className:"".concat(v[0],",").concat(v[1]),close:!0,lineCap:O,lineDash:w===Ae.Dotted?[S&&S[0]||1,(S&&S[1]||2)*f]:w===Ae.LongDotted?[(S&&S[0]||1)*f,(S&&S[1]||2)*f]:void 0},E={name:r,id:r,zIndex:h,pos:v,anchor:[0.5,0.5],size:[d.w,d.h]};u&&(E.scale=u),y&&(E.rotate=y),T&&(E.translate=T);var R=new cr(E),D=new dn(_objectSpread(_objectSpread({},x),{},{pos:[0,0]}));R.append(D),I&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:R,eraserlines:I,pos:v,layer:n},s)),this.replace(n,r,R);var U=R.getBoundingClientRect();return this.isDelete&&R.setAttribute("opacity",0),{x:Math.floor(U.x-Xt.SafeBorderPadding),y:Math.floor(U.y-Xt.SafeBorderPadding),w:Math.floor(U.width+Xt.SafeBorderPadding*2),h:Math.floor(U.height+Xt.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var r=Re(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=r.y+r.h*this.ratio;return[new pt(r.x,r.y,0),new pt(r.x+r.w,r.y,0),new pt(r.x+r.w,n,0),new pt(r.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=r.y+r.h*(1-this.ratio);return[new pt(r.x,_n4,0),new pt(r.x+r.w,_n4,0),new pt(r.x+r.w,r.y+r.h,0),new pt(r.x,r.y+r.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=r.x+r.w*(1-this.ratio);return[new pt(_n5,r.y,0),new pt(r.x+r.w,r.y,0),new pt(r.x+r.w,r.y+r.h,0),new pt(_n5,r.y+r.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=r.x+r.w*this.ratio;return[new pt(r.x,r.y,0),new pt(_n6,r.y,0),new pt(_n6,r.y+r.h,0),new pt(r.x,r.y+r.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,r){var n=Re(this.tmpPoints),s=this.transformControlPoints(r),c=Math.floor(n.w*0.1),l=Math.floor(n.h*0.1),f=[],h=pt.Add(s[0],new pt(0,l,0)),m=pt.Add(s[0],new pt(c,0,0)),u=kr.getBezierPoints(10,h,s[0],m),y=pt.Sub(s[1],new pt(c,0,0)),T=pt.Add(s[1],new pt(0,l,0)),w=kr.getBezierPoints(10,y,s[1],T),I=pt.Sub(s[2],new pt(0,l,0)),S=pt.Sub(s[2],new pt(c,0,0)),O=kr.getBezierPoints(10,I,s[2],S),d=pt.Add(s[3],new pt(c,0,0)),v=pt.Sub(s[3],new pt(0,l,0)),p=kr.getBezierPoints(10,d,s[3],v),x=c*(1-this.ratio)*10,E=l*(1-this.ratio)*10;switch(r){case"bottom":{var U=pt.Sub(s[2],new pt(c*5-x/2,0,0)),M=pt.Sub(s[2],new pt(c*5,-E,0)),W=pt.Sub(s[2],new pt(c*5+x/2,0,0));f.push.apply(f,[M,W].concat(_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(w),_toConsumableArray(O),[U]));break;}case"bottomRight":{var _U13=pt.Sub(s[2],new pt(c*1.1,0,0)),_M10=pt.Sub(s[2],new pt(c*1.1+x/2,-E,0)),_W8=pt.Sub(s[2],new pt(c*1.1+x,0,0));f.push.apply(f,[_M10,_W8].concat(_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(w),_toConsumableArray(O),[_U13]));break;}case"bottomLeft":{var _U14=pt.Add(s[3],new pt(c*1.1+x,0,0)),_M11=pt.Add(s[3],new pt(c*1.1+x/2,E,0)),_W9=pt.Add(s[3],new pt(c*1.1,0,0));f.push.apply(f,[_M11,_W9].concat(_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(w),_toConsumableArray(O),[_U14]));break;}case"top":{var _U15=pt.Sub(s[1],new pt(c*5-x/2,0,0)),_M12=pt.Sub(s[1],new pt(c*5,E,0)),_W10=pt.Sub(s[1],new pt(c*5+x/2,0,0));f.push.apply(f,[_M12,_U15].concat(_toConsumableArray(w),_toConsumableArray(O),_toConsumableArray(p),_toConsumableArray(u),[_W10]));break;}case"topRight":{var _U16=pt.Sub(s[1],new pt(c*1.1,0,0)),_M13=pt.Sub(s[1],new pt(c*1.1+x/2,E,0)),_W11=pt.Sub(s[1],new pt(c*1.1+x,0,0));f.push.apply(f,[_M13,_U16].concat(_toConsumableArray(w),_toConsumableArray(O),_toConsumableArray(p),_toConsumableArray(u),[_W11]));break;}case"topLeft":{var _U17=pt.Add(s[0],new pt(c*1.1+x,0,0)),_M14=pt.Add(s[0],new pt(c*1.1+x/2,-E,0)),_W12=pt.Add(s[0],new pt(c*1.1,0,0));f.push.apply(f,[_M14,_U17].concat(_toConsumableArray(w),_toConsumableArray(O),_toConsumableArray(p),_toConsumableArray(u),[_W12]));break;}case"left":{var _U18=pt.Add(s[0],new pt(0,l*5-E/2,0)),_M15=pt.Add(s[0],new pt(-x,l*5,0)),_W13=pt.Add(s[0],new pt(0,l*5+E/2,0));f.push.apply(f,[_M15,_U18].concat(_toConsumableArray(u),_toConsumableArray(w),_toConsumableArray(O),_toConsumableArray(p),[_W13]));break;}case"leftTop":{var _U19=pt.Add(s[0],new pt(0,l*1.1,0)),_M16=pt.Add(s[0],new pt(-x,l*1.1+E/2,0)),_W14=pt.Add(s[0],new pt(0,l*1.1+E,0));f.push.apply(f,[_M16,_U19].concat(_toConsumableArray(u),_toConsumableArray(w),_toConsumableArray(O),_toConsumableArray(p),[_W14]));break;}case"leftBottom":{var _U20=pt.Sub(s[3],new pt(0,l*1.1+E,0)),_M17=pt.Sub(s[3],new pt(x,l*1.1+E/2,0)),_W15=pt.Sub(s[3],new pt(0,l*1.1,0));f.push.apply(f,[_M17,_U20].concat(_toConsumableArray(u),_toConsumableArray(w),_toConsumableArray(O),_toConsumableArray(p),[_W15]));break;}case"right":{var _U21=pt.Add(s[1],new pt(0,l*5-E/2,0)),_M18=pt.Add(s[1],new pt(x,l*5,0)),_W16=pt.Add(s[1],new pt(0,l*5+E/2,0));f.push.apply(f,[_M18,_W16].concat(_toConsumableArray(O),_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(w),[_U21]));break;}case"rightTop":{var _U22=pt.Add(s[1],new pt(0,l*1.1,0)),_M19=pt.Add(s[1],new pt(x,l*1.1+E/2,0)),_W17=pt.Add(s[1],new pt(0,l*1.1+E,0));f.push.apply(f,[_M19,_W17].concat(_toConsumableArray(O),_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(w),[_U22]));break;}case"rightBottom":{var _U23=pt.Sub(s[2],new pt(0,l*1.1+E,0)),_M20=pt.Sub(s[2],new pt(-x,l*1.1+E/2,0)),_W18=pt.Sub(s[2],new pt(0,l*1.1,0));f.push.apply(f,[_M20,_W18].concat(_toConsumableArray(O),_toConsumableArray(p),_toConsumableArray(u),_toConsumableArray(w),[_U23]));break;}}var R=Re(this.tmpPoints,t),D=[Math.floor(R.x+R.w/2),Math.floor(R.y+R.h/2)];return{rect:R,pos:D,points:f};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c)||Jt.Sub(s,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 h,m;var r=t.op,n=t.isFullWork,_t$workState7=t.workState,s=_t$workState7===void 0?te.Done:_t$workState7,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawing:!1,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&Xt.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var w;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.fillColor,f=n.toolsType,h=n.placement,m=n.strokeType,u=s.get(r.name),y=u==null?void 0:u.opt;var T=r;return r.tagName==="GROUP"&&(T=r.children[0]),c&&(T.setAttribute("strokeColor",c),y!=null&&y.strokeColor&&(y.strokeColor=c)),l&&(l==="transparent"?T.setAttribute("fillColor","rgba(0,0,0,0)"):T.setAttribute("fillColor",l),y!=null&&y.fillColor&&(y.fillColor=l)),f===Tt.SpeechBalloon&&h&&(y.placement=h),m&&u!=null&&u.opt&&(w=u.opt)!=null&&w.strokeType&&(u.opt.strokeType=m),u&&s.setInfo(r.name,_objectSpread(_objectSpread({},u),{},{opt:y})),Xt.updateNodeOpt(t);}}]);}(Xt);var eA=Pi,rA=pn,nA="[object Boolean]";function iA(i){return i===!0||i===!1||rA(i)&&eA(i)==nA;}var sA=iA,$n=/* @__PURE__ */Ln(sA);var Hi=/*#__PURE__*/function(_Xt11){function Hi(t){var _this81;_classCallCheck(this,Hi);_this81=_callSuper(this,Hi,[t]);dt(_this81,"canRotate",!0);dt(_this81,"scaleType",Ce.all);dt(_this81,"toolsType",Tt.Image);dt(_this81,"tmpPoints",[]);dt(_this81,"workOptions");dt(_this81,"oldRect");_this81.workOptions=t.toolsOpt,_this81.scaleType=Hi.getScaleType(_this81.workOptions);return _this81;}_inherits(Hi,_Xt11);return _createClass(Hi,[{key:"consume",value:function consume(){return{type:gt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:gt.None};}},{key:"draw",value:function draw(t){var r=t.layer,n=t.workId,s=t.replaceId,c=t.imageBitmap,_this$workOptions13=this.workOptions,l=_this$workOptions13.centerX,f=_this$workOptions13.centerY,h=_this$workOptions13.width,m=_this$workOptions13.height,u=_this$workOptions13.rotate,y=_this$workOptions13.zIndex,T=_this$workOptions13.eraserlines,w=new cr({anchor:[0.5,0.5],pos:[l,f],name:n,size:[h,m],zIndex:y,rotate:u}),I={anchor:[0.5,0.5],pos:[0,0],size:[h,m],texture:c};c||(I.bgcolor="rgba(0,0,0,0.3)");var S=new $u(I);w.append(S),T&&this.drawEraserlines({group:w,eraserlines:T,pos:[l,f],layer:r}),this.replace(r,s||n,w);var O=w.getBoundingClientRect();if(O)return{x:Math.floor(O.x-Xt.SafeBorderPadding),y:Math.floor(O.y-Xt.SafeBorderPadding),w:Math.floor(O.width+Xt.SafeBorderPadding*2),h:Math.floor(O.height+Xt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var m,u,y,T,r,n,s,_this$workOptions14,c,l,f,h,w,I;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:r=t.isFullWork,n=t.replaceId,s=t.worker,_this$workOptions14=this.workOptions,c=_this$workOptions14.src,l=_this$workOptions14.uuid,f=((m=this.workId)==null?void 0:m.toString())||l,h=r?this.fullLayer:this.drawLayer||this.fullLayer;if(!c){_context25.next=8;break;}_context25.next=4;return s.loadImageBitMap({toolsType:this.toolsType,opt:this.workOptions,workId:f,isSubWorker:s instanceof od});case 4:w=_context25.sent;if(!w){_context25.next=8;break;}I=this.draw({workId:f,layer:h,replaceId:n,imageBitmap:w});return _context25.abrupt("return",(this.oldRect=f&&((y=(u=this.vNodes)==null?void 0:u.get(f))==null?void 0:y.rect)||void 0,(T=this.vNodes)==null||T.setInfo(f,{rect:I,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:I&&Xt.getCenterPos(I,h)}),I));case 8:case"end":return _context25.stop();}},_callee23,this);}));function consumeServiceAsync(_x43){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?Ce.proportional:Ce.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,c=t.targetNode,l=n.translate,f=n.originPoint,h=n.scenePoint,m=n.scale,u=n.angle,y=n.isLocked,T=n.zIndex,w=n.strokeColor,I=c&&fr(c)||s.get(r.name);if(!I)return;var S=r.parent;if(S){if(w&&(I.opt.strokeColor=w),_e(T)&&(r.setAttribute("zIndex",T),I.opt.zIndex=T),$n(y)&&(I.opt.locked=y),f&&h&&m&&l){var _I$opt=I.opt,_O42=_I$opt.centerX,_d40=_I$opt.centerY,v=_I$opt.width,p=_I$opt.height,x=_I$opt.uniformScale,E=x!==!1?[m[0],m[0]]:m,R=[_O42,_d40],D=[_O42,_d40];Oo(D,h,E,l);var U=[D[0]-R[0],D[1]-R[1]];if(I.centerPos=[I.centerPos[0]+U[0],I.centerPos[1]+U[1]],I.opt.width=Math.round(v*E[0]),I.opt.height=Math.round(p*E[1]),I.opt.centerX=D[0],I.opt.centerY=D[1],I.opt.eraserlines){var _iterator31=_createForOfIteratorHelper(I.opt.eraserlines),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var M=_step31.value;var W=M.op,X=M.thickness;M.thickness=Math.round(X*Math.max(m[0],m[1]));for(var B=0;B<W.length;B++)Nl(W[B],h,m,l);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}}else if(l){if(I.opt.centerX=I.opt.centerX+l[0],I.opt.centerY=I.opt.centerY+l[1],I.centerPos=[I.centerPos[0]+l[0],I.centerPos[1]+l[1]],I.opt.eraserlines){var _iterator32=_createForOfIteratorHelper(I.opt.eraserlines),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _O43=_step32.value;var _d41=_O43.op;for(var _v12=0;_v12<_d41.length;_v12++){var _p15=_d41[_v12].map(function(x,E){return E%2?x+l[1]:x+l[0];});_O43.op[_v12]=_p15;}}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}}}else if(_e(u))if(I.opt.rotate=u,I.scaleType=Hi.getScaleType(I.opt),c){var _O44=Dl(I.rect,u);I.rect=_O44;}else{var _O45=Xt.getRectFromLayer(S,r.name);I.rect=_O45||I.rect;}return I&&s.setInfo(r.name,I),I==null?void 0:I.rect;}}}]);}(Xt);var bh=/*#__PURE__*/function(_Xt12){function bh(t){var _this82;_classCallCheck(this,bh);_this82=_callSuper(this,bh,[t]);dt(_this82,"canRotate",!1);dt(_this82,"scaleType",Ce.both);dt(_this82,"toolsType",Tt.Straight);dt(_this82,"tmpPoints",[]);dt(_this82,"workOptions");dt(_this82,"oldRect");dt(_this82,"straightTipWidth");dt(_this82,"syncTimestamp");_this82.workOptions=t.toolsOpt,_this82.straightTipWidth=_this82.workOptions.thickness/2,_this82.syncTimestamp=0,_this82.syncUnitTime=50;return _this82;}_inherits(bh,_Xt12);return _createClass(bh,[{key:"consume",value:function consume(t){var r=t.data,n=t.isFullWork,s=t.isSubWorker,c=t.isMainThread,l=t.smoothSync,f=t.isSimpleWorker,h=this.workId,m=r.op,u=r.syncUnitTime,y=m==null?void 0:m.length;if(!y||y<2)return{type:gt.None};u&&(this.syncUnitTime=u);var T;if(this.tmpPoints.length===0?(this.tmpPoints=[new Jt(m[0],m[1])],T=!1):T=this.updateTempPoints(m),!T)return{type:gt.None};var w;if(s||c||f){var S=n?this.fullLayer:this.drawLayer||this.fullLayer;w=this.draw({workId:h,layer:S});}if(f){var _S19=Zt(w,this.oldRect);this.oldRect=w;var _O46=_objectSpread({rect:_S19,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);if(l){var _d42=Date.now();_d42-this.syncTimestamp>this.syncUnitTime&&(this.syncTimestamp=_d42,_O46.op=this.tmpPoints.map(function(v){return[].concat(_toConsumableArray(v.XY),[0]);}).flat(1),_O46.index=0,_O46.isSync=!0);}return _O46;}if(!s&&l){var _S20=Date.now();return _S20-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_S20,_objectSpread({type:gt.DrawWork,dataType:Kt.Local,op:this.tmpPoints.map(function(O){return[].concat(_toConsumableArray(O.XY),[0]);}).flat(1),isSync:!0,index:0},this.baseConsumeResult)):{type:gt.None};}var I=Zt(w,this.oldRect);return this.oldRect=w,_objectSpread({rect:I,type:gt.DrawWork,dataType:Kt.Local},this.baseConsumeResult);}},{key:"consumeAll",value:function consumeAll(){var l;var t=this.workId;if(this.tmpPoints.length<2)return{type:gt.RemoveNode,removeIds:[t]};var r=this.fullLayer,n=this.draw({workId:t,layer:r});this.oldRect=n;var s=this.tmpPoints.map(function(f){return[].concat(_toConsumableArray(f.XY),[0]);}).flat(1),c=mr(s);return(l=this.vNodes)==null||l.setInfo(t,{rect:n,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:n&&Xt.getCenterPos(n,r)}),_objectSpread(_objectSpread({rect:n,type:gt.FullWork,dataType:Kt.Local,ops:c,isSync:!0},this.baseConsumeResult),{},{updateNodeOpt:{useAnimation:!0}});}},{key:"draw",value:function draw(t){var r=t.workId,n=t.layer,_t$isDrawEraserlines6=t.isDrawEraserlines,s=_t$isDrawEraserlines6===void 0?!0:_t$isDrawEraserlines6,_this$workOptions15=this.workOptions,c=_this$workOptions15.strokeColor,l=_this$workOptions15.thickness,f=_this$workOptions15.zIndex,h=_this$workOptions15.scale,m=_this$workOptions15.rotate,u=_this$workOptions15.translate,y=_this$workOptions15.strokeType,T=_this$workOptions15.eraserlines,w=_this$workOptions15.lineCap,I=_this$workOptions15.lineDash,S=n.worldPosition,O=n.worldScaling,_this$computDrawPoint9=this.computDrawPoints(l,y),d=_this$computDrawPoint9.d,v=_this$computDrawPoint9.rect,p=_this$computDrawPoint9.isDot,x=[v.x+v.w/2,v.y+v.h/2],E=new cr({pos:x,anchor:[0.5,0.5],size:[v.w,v.h],name:r,id:r,normalize:!0,zIndex:f}),R={pos:[0,0],normalize:!0,d:d,fillColor:c,strokeColor:c,lineDash:p?void 0:y===Ae.Dotted?[I&&I[0]||1,(I&&I[1]||2)*l]:y===Ae.LongDotted?[(I&&I[0]||1)*l,(I&&I[1]||2)*l]:void 0,lineCap:p?void 0:w,lineWidth:y===Ae.Normal||p?0:l};h&&(R.scale=h),m&&(R.rotate=m),u&&(R.translate=u);var D=new Mn(R);E.append(D),T&&(this.scaleType=Ce.proportional,this.drawEraserlines({group:E,eraserlines:T,pos:x,layer:n},s)),this.replace(n,r,E);var U={x:Math.floor(v.x*O[0]+S[0]-Xt.SafeBorderPadding),y:Math.floor(v.y*O[1]+S[1]-Xt.SafeBorderPadding),w:Math.floor(v.w*O[0]+2*Xt.SafeBorderPadding),h:Math.floor(v.h*O[1]+2*Xt.SafeBorderPadding)};if(m||h||u){var M=D.getBoundingClientRect();U={x:Math.floor(M.x-Xt.SafeBorderPadding),y:Math.floor(M.y-Xt.SafeBorderPadding),w:Math.floor(M.width+Xt.SafeBorderPadding*2),h:Math.floor(M.height+Xt.SafeBorderPadding*2)};}return this.isDelete&&E.setAttribute("opacity",0),U;}},{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=pt.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),s=pt.Per(n).mul(t/2),c=Jt.Sub(this.tmpPoints[0],s),l=Jt.Add(this.tmpPoints[0],s),f=Jt.Sub(this.tmpPoints[1],s),h=Jt.Add(this.tmpPoints[1],s),m=Jt.GetSemicircleStroke(this.tmpPoints[1],f,-1,8),u=Jt.GetSemicircleStroke(this.tmpPoints[0],l,-1,8),y=[c,f].concat(_toConsumableArray(m),[h,l],_toConsumableArray(u));var T;return r!==Ae.Normal?T=En(this.tmpPoints,!1):T=En(y,!0),{d:T,rect:Re(y),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var r=Jt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:En(r,!0),rect:Re(r),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var r=t.slice(-2),n=new Jt(r[0],r[1]),s=this.tmpPoints[0],c=this.workOptions.thickness;if(s.isNear(n,c))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 h,m;var r=t.op,n=t.isFullWork,_t$workState8=t.workState,s=_t$workState8===void 0?te.Done:_t$workState8,c=(h=this.workId)==null?void 0:h.toString();if(!c)return;this.tmpPoints.length=0;for(var u=0;u<r.length;u+=3)this.tmpPoints.push(new Jt(r[u],r[u+1],r[u+2]));var l=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({workId:c,layer:l,isDrawEraserlines:s===te.Done});return this.oldRect=f,(m=this.vNodes)==null||m.setInfo(c,{rect:f,op:r,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&Xt.getCenterPos(f,l)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var h,m;var r=t.node,n=t.opt,s=t.vNodes,c=n.strokeColor,l=n.strokeType,f=s.get(r.name);return c&&(r.tagName==="GROUP"?r.children.forEach(function(u){u.setAttribute("strokeColor",c),u.getAttribute("fillColor")&&u.setAttribute("fillColor",c);}):(r.setAttribute("strokeColor",c),r.setAttribute("fillColor",c)),(h=f==null?void 0:f.opt)!=null&&h.strokeColor&&(f.opt.strokeColor=c)),l&&f!=null&&f.opt&&(m=f.opt)!=null&&m.strokeType&&(f.opt.strokeType=l),f&&s.setInfo(r.name,f),Xt.updateNodeOpt(t);}}]);}(Xt);var pi="cursorhover",Eu=20,jn="mainView";var Mu={exports:{}},He={},hl={exports:{}},kn={};function Dh(){var i={};return i["align-content"]=!1,i["align-items"]=!1,i["align-self"]=!1,i["alignment-adjust"]=!1,i["alignment-baseline"]=!1,i.all=!1,i["anchor-point"]=!1,i.animation=!1,i["animation-delay"]=!1,i["animation-direction"]=!1,i["animation-duration"]=!1,i["animation-fill-mode"]=!1,i["animation-iteration-count"]=!1,i["animation-name"]=!1,i["animation-play-state"]=!1,i["animation-timing-function"]=!1,i.azimuth=!1,i["backface-visibility"]=!1,i.background=!0,i["background-attachment"]=!0,i["background-clip"]=!0,i["background-color"]=!0,i["background-image"]=!0,i["background-origin"]=!0,i["background-position"]=!0,i["background-repeat"]=!0,i["background-size"]=!0,i["baseline-shift"]=!1,i.binding=!1,i.bleed=!1,i["bookmark-label"]=!1,i["bookmark-level"]=!1,i["bookmark-state"]=!1,i.border=!0,i["border-bottom"]=!0,i["border-bottom-color"]=!0,i["border-bottom-left-radius"]=!0,i["border-bottom-right-radius"]=!0,i["border-bottom-style"]=!0,i["border-bottom-width"]=!0,i["border-collapse"]=!0,i["border-color"]=!0,i["border-image"]=!0,i["border-image-outset"]=!0,i["border-image-repeat"]=!0,i["border-image-slice"]=!0,i["border-image-source"]=!0,i["border-image-width"]=!0,i["border-left"]=!0,i["border-left-color"]=!0,i["border-left-style"]=!0,i["border-left-width"]=!0,i["border-radius"]=!0,i["border-right"]=!0,i["border-right-color"]=!0,i["border-right-style"]=!0,i["border-right-width"]=!0,i["border-spacing"]=!0,i["border-style"]=!0,i["border-top"]=!0,i["border-top-color"]=!0,i["border-top-left-radius"]=!0,i["border-top-right-radius"]=!0,i["border-top-style"]=!0,i["border-top-width"]=!0,i["border-width"]=!0,i.bottom=!1,i["box-decoration-break"]=!0,i["box-shadow"]=!0,i["box-sizing"]=!0,i["box-snap"]=!0,i["box-suppress"]=!0,i["break-after"]=!0,i["break-before"]=!0,i["break-inside"]=!0,i["caption-side"]=!1,i.chains=!1,i.clear=!0,i.clip=!1,i["clip-path"]=!1,i["clip-rule"]=!1,i.color=!0,i["color-interpolation-filters"]=!0,i["column-count"]=!1,i["column-fill"]=!1,i["column-gap"]=!1,i["column-rule"]=!1,i["column-rule-color"]=!1,i["column-rule-style"]=!1,i["column-rule-width"]=!1,i["column-span"]=!1,i["column-width"]=!1,i.columns=!1,i.contain=!1,i.content=!1,i["counter-increment"]=!1,i["counter-reset"]=!1,i["counter-set"]=!1,i.crop=!1,i.cue=!1,i["cue-after"]=!1,i["cue-before"]=!1,i.cursor=!1,i.direction=!1,i.display=!0,i["display-inside"]=!0,i["display-list"]=!0,i["display-outside"]=!0,i["dominant-baseline"]=!1,i.elevation=!1,i["empty-cells"]=!1,i.filter=!1,i.flex=!1,i["flex-basis"]=!1,i["flex-direction"]=!1,i["flex-flow"]=!1,i["flex-grow"]=!1,i["flex-shrink"]=!1,i["flex-wrap"]=!1,i["float"]=!1,i["float-offset"]=!1,i["flood-color"]=!1,i["flood-opacity"]=!1,i["flow-from"]=!1,i["flow-into"]=!1,i.font=!0,i["font-family"]=!0,i["font-feature-settings"]=!0,i["font-kerning"]=!0,i["font-language-override"]=!0,i["font-size"]=!0,i["font-size-adjust"]=!0,i["font-stretch"]=!0,i["font-style"]=!0,i["font-synthesis"]=!0,i["font-variant"]=!0,i["font-variant-alternates"]=!0,i["font-variant-caps"]=!0,i["font-variant-east-asian"]=!0,i["font-variant-ligatures"]=!0,i["font-variant-numeric"]=!0,i["font-variant-position"]=!0,i["font-weight"]=!0,i.grid=!1,i["grid-area"]=!1,i["grid-auto-columns"]=!1,i["grid-auto-flow"]=!1,i["grid-auto-rows"]=!1,i["grid-column"]=!1,i["grid-column-end"]=!1,i["grid-column-start"]=!1,i["grid-row"]=!1,i["grid-row-end"]=!1,i["grid-row-start"]=!1,i["grid-template"]=!1,i["grid-template-areas"]=!1,i["grid-template-columns"]=!1,i["grid-template-rows"]=!1,i["hanging-punctuation"]=!1,i.height=!0,i.hyphens=!1,i.icon=!1,i["image-orientation"]=!1,i["image-resolution"]=!1,i["ime-mode"]=!1,i["initial-letters"]=!1,i["inline-box-align"]=!1,i["justify-content"]=!1,i["justify-items"]=!1,i["justify-self"]=!1,i.left=!1,i["letter-spacing"]=!0,i["lighting-color"]=!0,i["line-box-contain"]=!1,i["line-break"]=!1,i["line-grid"]=!1,i["line-height"]=!1,i["line-snap"]=!1,i["line-stacking"]=!1,i["line-stacking-ruby"]=!1,i["line-stacking-shift"]=!1,i["line-stacking-strategy"]=!1,i["list-style"]=!0,i["list-style-image"]=!0,i["list-style-position"]=!0,i["list-style-type"]=!0,i.margin=!0,i["margin-bottom"]=!0,i["margin-left"]=!0,i["margin-right"]=!0,i["margin-top"]=!0,i["marker-offset"]=!1,i["marker-side"]=!1,i.marks=!1,i.mask=!1,i["mask-box"]=!1,i["mask-box-outset"]=!1,i["mask-box-repeat"]=!1,i["mask-box-slice"]=!1,i["mask-box-source"]=!1,i["mask-box-width"]=!1,i["mask-clip"]=!1,i["mask-image"]=!1,i["mask-origin"]=!1,i["mask-position"]=!1,i["mask-repeat"]=!1,i["mask-size"]=!1,i["mask-source-type"]=!1,i["mask-type"]=!1,i["max-height"]=!0,i["max-lines"]=!1,i["max-width"]=!0,i["min-height"]=!0,i["min-width"]=!0,i["move-to"]=!1,i["nav-down"]=!1,i["nav-index"]=!1,i["nav-left"]=!1,i["nav-right"]=!1,i["nav-up"]=!1,i["object-fit"]=!1,i["object-position"]=!1,i.opacity=!1,i.order=!1,i.orphans=!1,i.outline=!1,i["outline-color"]=!1,i["outline-offset"]=!1,i["outline-style"]=!1,i["outline-width"]=!1,i.overflow=!1,i["overflow-wrap"]=!1,i["overflow-x"]=!1,i["overflow-y"]=!1,i.padding=!0,i["padding-bottom"]=!0,i["padding-left"]=!0,i["padding-right"]=!0,i["padding-top"]=!0,i.page=!1,i["page-break-after"]=!1,i["page-break-before"]=!1,i["page-break-inside"]=!1,i["page-policy"]=!1,i.pause=!1,i["pause-after"]=!1,i["pause-before"]=!1,i.perspective=!1,i["perspective-origin"]=!1,i.pitch=!1,i["pitch-range"]=!1,i["play-during"]=!1,i.position=!1,i["presentation-level"]=!1,i.quotes=!1,i["region-fragment"]=!1,i.resize=!1,i.rest=!1,i["rest-after"]=!1,i["rest-before"]=!1,i.richness=!1,i.right=!1,i.rotation=!1,i["rotation-point"]=!1,i["ruby-align"]=!1,i["ruby-merge"]=!1,i["ruby-position"]=!1,i["shape-image-threshold"]=!1,i["shape-outside"]=!1,i["shape-margin"]=!1,i.size=!1,i.speak=!1,i["speak-as"]=!1,i["speak-header"]=!1,i["speak-numeral"]=!1,i["speak-punctuation"]=!1,i["speech-rate"]=!1,i.stress=!1,i["string-set"]=!1,i["tab-size"]=!1,i["table-layout"]=!1,i["text-align"]=!0,i["text-align-last"]=!0,i["text-combine-upright"]=!0,i["text-decoration"]=!0,i["text-decoration-color"]=!0,i["text-decoration-line"]=!0,i["text-decoration-skip"]=!0,i["text-decoration-style"]=!0,i["text-emphasis"]=!0,i["text-emphasis-color"]=!0,i["text-emphasis-position"]=!0,i["text-emphasis-style"]=!0,i["text-height"]=!0,i["text-indent"]=!0,i["text-justify"]=!0,i["text-orientation"]=!0,i["text-overflow"]=!0,i["text-shadow"]=!0,i["text-space-collapse"]=!0,i["text-transform"]=!0,i["text-underline-position"]=!0,i["text-wrap"]=!0,i.top=!1,i.transform=!1,i["transform-origin"]=!1,i["transform-style"]=!1,i.transition=!1,i["transition-delay"]=!1,i["transition-duration"]=!1,i["transition-property"]=!1,i["transition-timing-function"]=!1,i["unicode-bidi"]=!1,i["vertical-align"]=!1,i.visibility=!1,i["voice-balance"]=!1,i["voice-duration"]=!1,i["voice-family"]=!1,i["voice-pitch"]=!1,i["voice-range"]=!1,i["voice-rate"]=!1,i["voice-stress"]=!1,i["voice-volume"]=!1,i.volume=!1,i["white-space"]=!1,i.widows=!1,i.width=!0,i["will-change"]=!1,i["word-break"]=!0,i["word-spacing"]=!0,i["word-wrap"]=!0,i["wrap-flow"]=!1,i["wrap-through"]=!1,i["writing-mode"]=!1,i["z-index"]=!1,i;}function oA(i,e,t){}function aA(i,e,t){}var lA=/javascript\s*\:/img;function fA(i,e){return lA.test(e)?"":e;}kn.whiteList=Dh();kn.getDefaultWhiteList=Dh;kn.onAttr=oA;kn.onIgnoreAttr=aA;kn.safeAttrValue=fA;var cA={indexOf:function indexOf(i,e){var t,r;if(Array.prototype.indexOf)return i.indexOf(e);for(t=0,r=i.length;t<r;t++)if(i[t]===e)return t;return-1;},forEach:function forEach(i,e,t){var r,n;if(Array.prototype.forEach)return i.forEach(e,t);for(r=0,n=i.length;r<n;r++)e.call(t,i[r],r,i);},trim:function trim(i){return String.prototype.trim?i.trim():i.replace(/(^\s*)|(\s*$)/g,"");},trimRight:function trimRight(i){return String.prototype.trimRight?i.trimRight():i.replace(/(\s*$)/g,"");}},Gi=cA;function uA(i,e){i=Gi.trimRight(i),i[i.length-1]!==";"&&(i+=";");var t=i.length,r=!1,n=0,s=0,c="";function l(){if(!r){var m=Gi.trim(i.slice(n,s)),u=m.indexOf(":");if(u!==-1){var y=Gi.trim(m.slice(0,u)),T=Gi.trim(m.slice(u+1));if(y){var w=e(n,c.length,y,T,m);w&&(c+=w+"; ");}}}n=s+1;}for(;s<t;s++){var f=i[s];if(f==="/"&&i[s+1]==="*"){var h=i.indexOf("*/",s+2);if(h===-1)break;s=h+1,n=s+1,r=!1;}else f==="("?r=!0:f===")"?r=!1:f===";"?r||l():f==="\n"&&l();}return Gi.trim(c);}var hA=uA,Zs=kn,dA=hA;function Lu(i){return i==null;}function pA(i){var e={};for(var t in i)e[t]=i[t];return e;}function Nh(i){i=pA(i||{}),i.whiteList=i.whiteList||Zs.whiteList,i.onAttr=i.onAttr||Zs.onAttr,i.onIgnoreAttr=i.onIgnoreAttr||Zs.onIgnoreAttr,i.safeAttrValue=i.safeAttrValue||Zs.safeAttrValue,this.options=i;}Nh.prototype.process=function(i){if(i=i||"",i=i.toString(),!i)return"";var e=this,t=e.options,r=t.whiteList,n=t.onAttr,s=t.onIgnoreAttr,c=t.safeAttrValue,l=dA(i,function(f,h,m,u,y){var T=r[m],w=!1;if(T===!0?w=T:typeof T=="function"?w=T(u):T instanceof RegExp&&(w=T.test(u)),w!==!0&&(w=!1),u=c(m,u),!!u){var I={position:h,sourcePosition:f,source:y,isWhite:w};if(w){var S=n(m,u,I);return Lu(S)?m+":"+u:S;}else{var S=s(m,u,I);if(!Lu(S))return S;}}});return l;};var vA=Nh;(function(i,e){var t=kn,r=vA;function n(c,l){var f=new r(l);return f.process(c);}e=i.exports=n,e.FilterCSS=r;for(var s in t)e[s]=t[s];(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterCSS=i.exports);})(hl,hl.exports);var Rl=hl.exports,bl={indexOf:function indexOf(i,e){var t,r;if(Array.prototype.indexOf)return i.indexOf(e);for(t=0,r=i.length;t<r;t++)if(i[t]===e)return t;return-1;},forEach:function forEach(i,e,t){var r,n;if(Array.prototype.forEach)return i.forEach(e,t);for(r=0,n=i.length;r<n;r++)e.call(t,i[r],r,i);},trim:function trim(i){return String.prototype.trim?i.trim():i.replace(/(^\s*)|(\s*$)/g,"");},spaceIndex:function spaceIndex(i){var e=/\s|\n|\t/,t=e.exec(i);return t?t.index:-1;}},gA=Rl.FilterCSS,mA=Rl.getDefaultWhiteList,ao=bl;function Bh(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]};}var Wh=new gA();function yA(i,e,t){}function SA(i,e,t){}function PA(i,e,t){}function xA(i,e,t){}function Fh(i){return i.replace(CA,"<").replace(IA,">");}function TA(i,e,t,r){if(t=jh(t),e==="href"||e==="src"){if(t=ao.trim(t),t==="#")return"#";if(!(t.substr(0,7)==="http://"||t.substr(0,8)==="https://"||t.substr(0,7)==="mailto:"||t.substr(0,4)==="tel:"||t.substr(0,11)==="data:image/"||t.substr(0,6)==="ftp://"||t.substr(0,2)==="./"||t.substr(0,3)==="../"||t[0]==="#"||t[0]==="/"))return"";}else if(e==="background"){if(Js.lastIndex=0,Js.test(t))return"";}else if(e==="style"){if(Ru.lastIndex=0,Ru.test(t)||(bu.lastIndex=0,bu.test(t)&&(Js.lastIndex=0,Js.test(t))))return"";r!==!1&&(r=r||Wh,t=r.process(t));}return t=Gh(t),t;}var CA=/</g,IA=/>/g,OA=/"/g,wA=/"/g,AA=/&#([a-zA-Z0-9]*);?/gim,EA=/:?/gim,MA=/&newline;?/gim,Js=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Ru=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,bu=/u\s*r\s*l\s*\(.*/gi;function Uh(i){return i.replace(OA,""");}function Yh(i){return i.replace(wA,'"');}function Xh(i){return i.replace(AA,function(t,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10));});}function zh(i){return i.replace(EA,":").replace(MA," ");}function $h(i){for(var e="",t=0,r=i.length;t<r;t++)e+=i.charCodeAt(t)<32?" ":i.charAt(t);return ao.trim(e);}function jh(i){return i=Yh(i),i=Xh(i),i=zh(i),i=$h(i),i;}function Gh(i){return i=Uh(i),i=Fh(i),i;}function LA(){return"";}function RA(i,e){typeof e!="function"&&(e=function e(){});var t=!Array.isArray(i);function r(c){return t?!0:ao.indexOf(i,c)!==-1;}var n=[],s=!1;return{onIgnoreTag:function onIgnoreTag(c,l,f){if(r(c)){if(f.isClosing){var h="[/removed]",m=f.position+h.length;return n.push([s!==!1?s:f.position,m]),s=!1,h;}else return s||(s=f.position),"[removed]";}else return e(c,l,f);},remove:function remove(c){var l="",f=0;return ao.forEach(n,function(h){l+=c.slice(f,h[0]),f=h[1];}),l+=c.slice(f),l;}};}function bA(i){for(var e="",t=0;t<i.length;){var r=i.indexOf("<!--",t);if(r===-1){e+=i.slice(t);break;}e+=i.slice(t,r);var n=i.indexOf("-->",r);if(n===-1)break;t=n+3;}return e;}function DA(i){var e=i.split("");return e=e.filter(function(t){var r=t.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0;}),e.join("");}He.whiteList=Bh();He.getDefaultWhiteList=Bh;He.onTag=yA;He.onIgnoreTag=SA;He.onTagAttr=PA;He.onIgnoreTagAttr=xA;He.safeAttrValue=TA;He.escapeHtml=Fh;He.escapeQuote=Uh;He.unescapeQuote=Yh;He.escapeHtmlEntities=Xh;He.escapeDangerHtml5Entities=zh;He.clearNonPrintableCharacter=$h;He.friendlyAttrValue=jh;He.escapeAttrValue=Gh;He.onIgnoreTagStripAll=LA;He.StripTagBody=RA;He.stripCommentTag=bA;He.stripBlankChar=DA;He.attributeWrapSign='"';He.cssFilter=Wh;He.getDefaultCSSWhiteList=mA;var Co={},wn=bl;function NA(i){var e=wn.spaceIndex(i),t;return e===-1?t=i.slice(1,-1):t=i.slice(1,e+1),t=wn.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t;}function BA(i){return i.slice(0,2)==="</";}function WA(i,e,t){var r="",n=0,s=!1,c=!1,l=0,f=i.length,h="",m="";t:for(l=0;l<f;l++){var u=i.charAt(l);if(s===!1){if(u==="<"){s=l;continue;}}else if(c===!1){if(u==="<"){r+=t(i.slice(n,l)),s=l,n=l;continue;}if(u===">"||l===f-1){r+=t(i.slice(n,s)),m=i.slice(s,l+1),h=NA(m),r+=e(s,r.length,h,m,BA(m)),n=l+1,s=!1;continue;}if(u==='"'||u==="'")for(var y=1,T=i.charAt(l-y);T.trim()===""||T==="=";){if(T==="="){c=u;continue t;}T=i.charAt(l-++y);}}else if(u===c){c=!1;continue;}}return n<f&&(r+=t(i.substr(n))),r;}var FA=/[^a-zA-Z0-9\\_:.-]/gim;function UA(i,e){var t=0,r=0,n=[],s=!1,c=i.length;function l(y,T){if(y=wn.trim(y),y=y.replace(FA,"").toLowerCase(),!(y.length<1)){var w=e(y,T||"");w&&n.push(w);}}for(var f=0;f<c;f++){var h=i.charAt(f),m,u;if(s===!1&&h==="="){s=i.slice(t,f),t=f+1,r=i.charAt(t)==='"'||i.charAt(t)==="'"?t:XA(i,f+1);continue;}if(s!==!1&&f===r){if(u=i.indexOf(h,f+1),u===-1)break;m=wn.trim(i.slice(r+1,u)),l(s,m),s=!1,f=u,t=f+1;continue;}if(/\s|\n|\t/.test(h))if(i=i.replace(/\s|\n|\t/g," "),s===!1){if(u=YA(i,f),u===-1){m=wn.trim(i.slice(t,f)),l(m),s=!1,t=f+1;continue;}else{f=u-1;continue;}}else if(u=zA(i,f-1),u===-1){m=wn.trim(i.slice(t,f)),m=Du(m),l(s,m),s=!1,t=f+1;continue;}else continue;}return t<i.length&&(s===!1?l(i.slice(t)):l(s,Du(wn.trim(i.slice(t))))),wn.trim(n.join(" "));}function YA(i,e){for(;e<i.length;e++){var t=i[e];if(t!==" ")return t==="="?e:-1;}}function XA(i,e){for(;e<i.length;e++){var t=i[e];if(t!==" ")return t==="'"||t==='"'?e:-1;}}function zA(i,e){for(;e>0;e--){var t=i[e];if(t!==" ")return t==="="?e:-1;}}function $A(i){return i[0]==='"'&&i[i.length-1]==='"'||i[0]==="'"&&i[i.length-1]==="'";}function Du(i){return $A(i)?i.substr(1,i.length-2):i;}Co.parseTag=WA;Co.parseAttr=UA;var jA=Rl.FilterCSS,Xr=He,kh=Co,GA=kh.parseTag,kA=kh.parseAttr,to=bl;function Qs(i){return i==null;}function HA(i){var e=to.spaceIndex(i);if(e===-1)return{html:"",closing:i[i.length-2]==="/"};i=to.trim(i.slice(e+1,-1));var t=i[i.length-1]==="/";return t&&(i=to.trim(i.slice(0,-1))),{html:i,closing:t};}function VA(i){var e={};for(var t in i)e[t]=i[t];return e;}function KA(i){var e={};for(var t in i)Array.isArray(i[t])?e[t.toLowerCase()]=i[t].map(function(r){return r.toLowerCase();}):e[t.toLowerCase()]=i[t];return e;}function Hh(i){i=VA(i||{}),i.stripIgnoreTag&&(i.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),i.onIgnoreTag=Xr.onIgnoreTagStripAll),i.whiteList||i.allowList?i.whiteList=KA(i.whiteList||i.allowList):i.whiteList=Xr.whiteList,this.attributeWrapSign=i.singleQuotedAttributeValue===!0?"'":Xr.attributeWrapSign,i.onTag=i.onTag||Xr.onTag,i.onTagAttr=i.onTagAttr||Xr.onTagAttr,i.onIgnoreTag=i.onIgnoreTag||Xr.onIgnoreTag,i.onIgnoreTagAttr=i.onIgnoreTagAttr||Xr.onIgnoreTagAttr,i.safeAttrValue=i.safeAttrValue||Xr.safeAttrValue,i.escapeHtml=i.escapeHtml||Xr.escapeHtml,this.options=i,i.css===!1?this.cssFilter=!1:(i.css=i.css||{},this.cssFilter=new jA(i.css));}Hh.prototype.process=function(i){if(i=i||"",i=i.toString(),!i)return"";var e=this,t=e.options,r=t.whiteList,n=t.onTag,s=t.onIgnoreTag,c=t.onTagAttr,l=t.onIgnoreTagAttr,f=t.safeAttrValue,h=t.escapeHtml,m=e.attributeWrapSign,u=e.cssFilter;t.stripBlankChar&&(i=Xr.stripBlankChar(i)),t.allowCommentTag||(i=Xr.stripCommentTag(i));var y=!1;t.stripIgnoreTagBody&&(y=Xr.StripTagBody(t.stripIgnoreTagBody,s),s=y.onIgnoreTag);var T=GA(i,function(w,I,S,O,d){var v={sourcePosition:w,position:I,isClosing:d,isWhite:Object.prototype.hasOwnProperty.call(r,S)},p=n(S,O,v);if(!Qs(p))return p;if(v.isWhite){if(v.isClosing)return"</"+S+">";var x=HA(O),E=r[S],R=kA(x.html,function(D,U){var M=to.indexOf(E,D)!==-1,W=c(S,D,U,M);return Qs(W)?M?(U=f(S,D,U,u),U?D+"="+m+U+m:D):(W=l(S,D,U,M),Qs(W)?void 0:W):W;});return O="<"+S,R&&(O+=" "+R),x.closing&&(O+=" /"),O+=">",O;}else return p=s(S,O,v),Qs(p)?h(O):p;},h);return y&&(T=y.remove(T)),T;};var ZA=Hh;(function(i,e){var t=He,r=Co,n=ZA;function s(l,f){var h=new n(f);return h.process(l);}e=i.exports=s,e.filterXSS=s,e.FilterXSS=n,function(){for(var l in t)e[l]=t[l];for(var f in r)e[f]=r[f];}(),(typeof window==="undefined"?"undefined":_typeof(window))<"u"&&(window.filterXSS=i.exports);function c(){return(typeof self==="undefined"?"undefined":_typeof(self))<"u"&&(typeof DedicatedWorkerGlobalScope==="undefined"?"undefined":_typeof(DedicatedWorkerGlobalScope))<"u"&&self instanceof DedicatedWorkerGlobalScope;}c()&&(self.filterXSS=i.exports);})(Mu,Mu.exports);var lo={exports:{}};/**
|
|
437
|
+
* @license
|
|
438
|
+
* Lodash <https://lodash.com/>
|
|
439
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
440
|
+
* Released under MIT license <https://lodash.com/license>
|
|
441
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
442
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
443
|
+
*/lo.exports;(function(i,e){(function(){var t,r="4.17.21",n=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",u=1,y=2,T=4,w=1,I=2,S=1,O=2,d=4,v=8,p=16,x=32,E=64,R=128,D=256,U=512,M=30,W="...",X=800,B=16,N=1,$=2,J=3,tt=1/0,at=9007199254740991,ut=17976931348623157e292,V=NaN,Q=4294967295,ft=Q-1,mt=Q>>>1,yt=[["ary",R],["bind",S],["bindKey",O],["curry",v],["curryRight",p],["flip",U],["partial",x],["partialRight",E],["rearg",D]],wt="[object Arguments]",ht="[object Array]",Nt="[object AsyncFunction]",Dt="[object Boolean]",G="[object Date]",k="[object DOMException]",rt="[object Error]",nt="[object Function]",Y="[object GeneratorFunction]",Z="[object Map]",C="[object Number]",L="[object Null]",z="[object Object]",K="[object Promise]",q="[object Proxy]",it="[object RegExp]",ct="[object Set]",xt="[object String]",Ct="[object Symbol]",Mt="[object Undefined]",bt="[object WeakMap]",At="[object WeakSet]",Ot="[object ArrayBuffer]",Lt="[object DataView]",Yt="[object Float32Array]",$t="[object Float64Array]",Wt="[object Int8Array]",Qt="[object Int16Array]",ue="[object Int32Array]",ie="[object Uint8Array]",ne="[object Uint8ClampedArray]",ae="[object Uint16Array]",se="[object Uint32Array]",je=/\b__p \+= '';/g,We=/\b(__p \+=) '' \+/g,Xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Fe=/&(?:amp|lt|gt|quot|#39);/g,Ge=/[&<>"']/g,Ve=RegExp(Fe.source),Je=RegExp(Ge.source),Oe=/<%-([\s\S]+?)%>/g,ur=/<%([\s\S]+?)%>/g,Hr=/<%=([\s\S]+?)%>/g,tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hn=/^\w*$/,Vn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wi=/[\\^$.*+?()[\]{}|]/g,wo=RegExp(wi.source),Ai=/^\s+/,Ao=/\s/,Eo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Mo=/\{\n\/\* \[wrapped with (.+)\] \*/,Lo=/,? & /,Ro=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,bo=/[()=,{}\[\]\/\s]/,Do=/\\(\\)?/g,No=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ts=/\w*$/,Rn=/^[-+]0x[0-9a-f]+$/i,es=/^0b[01]+$/i,Bo=/^\[object .+?Constructor\]$/,Wo=/^0o[0-7]+$/i,Fo=/^(?:0|[1-9]\d*)$/,Uo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Kn=/($^)/,vn=/['\n\r\u2028\u2029\\]/g,Zn="\\ud800-\\udfff",Yo="\\u0300-\\u036f",Xo="\\ufe20-\\ufe2f",zo="\\u20d0-\\u20ff",rs=Yo+Xo+zo,ns="\\u2700-\\u27bf",is="a-z\\xdf-\\xf6\\xf8-\\xff",$o="\\xac\\xb1\\xd7\\xf7",jo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nr="\\u2000-\\u206f",Go=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ss="A-Z\\xc0-\\xd6\\xd8-\\xde",os="\\ufe0e\\ufe0f",ge=$o+jo+nr+Go,Jn="['’]",ko="["+Zn+"]",as="["+ge+"]",Qn="["+rs+"]",ls="\\d+",a="["+ns+"]",P="["+is+"]",A="[^"+Zn+ge+ls+ns+is+ss+"]",F="\\ud83c[\\udffb-\\udfff]",j="(?:"+Qn+"|"+F+")",_="[^"+Zn+"]",st="(?:\\ud83c[\\udde6-\\uddff]){2}",St="[\\ud800-\\udbff][\\udc00-\\udfff]",Pt="["+ss+"]",Bt="\\u200d",Ht="(?:"+P+"|"+A+")",jt="(?:"+Pt+"|"+A+")",qt="(?:"+Jn+"(?:d|ll|m|re|s|t|ve))?",oe="(?:"+Jn+"(?:D|LL|M|RE|S|T|VE))?",me=j+"?",Se="["+os+"]?",De="(?:"+Bt+"(?:"+[_,st,St].join("|")+")"+Se+me+")*",or="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",en=Se+me+De,Ho="(?:"+[a,st,St].join("|")+")"+en,Vo="(?:"+[_+Qn+"?",Qn,st,St,ko].join("|")+")",gn=RegExp(Jn,"g"),ld=RegExp(Qn,"g"),Ko=RegExp(F+"(?="+F+")|"+Vo+en,"g"),fd=RegExp([Pt+"?"+P+"+"+qt+"(?="+[as,Pt,"$"].join("|")+")",jt+"+"+oe+"(?="+[as,Pt+Ht,"$"].join("|")+")",Pt+"?"+Ht+"+"+qt,Pt+"+"+oe,Rr,or,ls,Ho].join("|"),"g"),cd=RegExp("["+Bt+Zn+rs+os+"]"),ud=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,hd=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],dd=-1,ze={};ze[Yt]=ze[$t]=ze[Wt]=ze[Qt]=ze[ue]=ze[ie]=ze[ne]=ze[ae]=ze[se]=!0,ze[wt]=ze[ht]=ze[Ot]=ze[Dt]=ze[Lt]=ze[G]=ze[rt]=ze[nt]=ze[Z]=ze[C]=ze[z]=ze[it]=ze[ct]=ze[xt]=ze[bt]=!1;var Ue={};Ue[wt]=Ue[ht]=Ue[Ot]=Ue[Lt]=Ue[Dt]=Ue[G]=Ue[Yt]=Ue[$t]=Ue[Wt]=Ue[Qt]=Ue[ue]=Ue[Z]=Ue[C]=Ue[z]=Ue[it]=Ue[ct]=Ue[xt]=Ue[Ct]=Ue[ie]=Ue[ne]=Ue[ae]=Ue[se]=!0,Ue[rt]=Ue[nt]=Ue[bt]=!1;var pd={// Latin-1 Supplement block.
|
|
444
|
+
À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",// Latin Extended-A block.
|
|
445
|
+
Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},vd={"&":"&","<":"<",">":">",'"':""","'":"'"},gd={"&":"&","<":"<",">":">",""":'"',"'":"'"},md={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},yd=parseFloat,Sd=parseInt,Wl=_typeof(hn)=="object"&&hn&&hn.Object===Object&&hn,Pd=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,ir=Wl||Pd||Function("return this")(),Zo=e&&!e.nodeType&&e,bn=Zo&&!0&&i&&!i.nodeType&&i,Fl=bn&&bn.exports===Zo,Jo=Fl&&Wl.process,br=function(){try{var Et=bn&&bn.require&&bn.require("util").types;return Et||Jo&&Jo.binding&&Jo.binding("util");}catch(_unused24){}}(),Ul=br&&br.isArrayBuffer,Yl=br&&br.isDate,Xl=br&&br.isMap,zl=br&&br.isRegExp,$l=br&&br.isSet,jl=br&&br.isTypedArray;function Cr(Et,zt,Ft){switch(Ft.length){case 0:return Et.call(zt);case 1:return Et.call(zt,Ft[0]);case 2:return Et.call(zt,Ft[0],Ft[1]);case 3:return Et.call(zt,Ft[0],Ft[1],Ft[2]);}return Et.apply(zt,Ft);}function xd(Et,zt,Ft,ee){for(var he=-1,Ee=Et==null?0:Et.length;++he<Ee;){var tr=Et[he];zt(ee,tr,Ft(tr),Et);}return ee;}function Dr(Et,zt){for(var Ft=-1,ee=Et==null?0:Et.length;++Ft<ee&&zt(Et[Ft],Ft,Et)!==!1;);return Et;}function Td(Et,zt){for(var Ft=Et==null?0:Et.length;Ft--&&zt(Et[Ft],Ft,Et)!==!1;);return Et;}function Gl(Et,zt){for(var Ft=-1,ee=Et==null?0:Et.length;++Ft<ee;)if(!zt(Et[Ft],Ft,Et))return!1;return!0;}function mn(Et,zt){for(var Ft=-1,ee=Et==null?0:Et.length,he=0,Ee=[];++Ft<ee;){var tr=Et[Ft];zt(tr,Ft,Et)&&(Ee[he++]=tr);}return Ee;}function fs(Et,zt){var Ft=Et==null?0:Et.length;return!!Ft&&qn(Et,zt,0)>-1;}function Qo(Et,zt,Ft){for(var ee=-1,he=Et==null?0:Et.length;++ee<he;)if(Ft(zt,Et[ee]))return!0;return!1;}function ke(Et,zt){for(var Ft=-1,ee=Et==null?0:Et.length,he=Array(ee);++Ft<ee;)he[Ft]=zt(Et[Ft],Ft,Et);return he;}function yn(Et,zt){for(var Ft=-1,ee=zt.length,he=Et.length;++Ft<ee;)Et[he+Ft]=zt[Ft];return Et;}function qo(Et,zt,Ft,ee){var he=-1,Ee=Et==null?0:Et.length;for(ee&&Ee&&(Ft=Et[++he]);++he<Ee;)Ft=zt(Ft,Et[he],he,Et);return Ft;}function Cd(Et,zt,Ft,ee){var he=Et==null?0:Et.length;for(ee&&he&&(Ft=Et[--he]);he--;)Ft=zt(Ft,Et[he],he,Et);return Ft;}function _o(Et,zt){for(var Ft=-1,ee=Et==null?0:Et.length;++Ft<ee;)if(zt(Et[Ft],Ft,Et))return!0;return!1;}var Id=ta("length");function Od(Et){return Et.split("");}function wd(Et){return Et.match(Ro)||[];}function kl(Et,zt,Ft){var ee;return Ft(Et,function(he,Ee,tr){if(zt(he,Ee,tr))return ee=Ee,!1;}),ee;}function cs(Et,zt,Ft,ee){for(var he=Et.length,Ee=Ft+(ee?1:-1);ee?Ee--:++Ee<he;)if(zt(Et[Ee],Ee,Et))return Ee;return-1;}function qn(Et,zt,Ft){return zt===zt?Ud(Et,zt,Ft):cs(Et,Hl,Ft);}function Ad(Et,zt,Ft,ee){for(var he=Ft-1,Ee=Et.length;++he<Ee;)if(ee(Et[he],zt))return he;return-1;}function Hl(Et){return Et!==Et;}function Vl(Et,zt){var Ft=Et==null?0:Et.length;return Ft?ra(Et,zt)/Ft:V;}function ta(Et){return function(zt){return zt==null?t:zt[Et];};}function ea(Et){return function(zt){return Et==null?t:Et[zt];};}function Kl(Et,zt,Ft,ee,he){return he(Et,function(Ee,tr,Be){Ft=ee?(ee=!1,Ee):zt(Ft,Ee,tr,Be);}),Ft;}function Ed(Et,zt){var Ft=Et.length;for(Et.sort(zt);Ft--;)Et[Ft]=Et[Ft].value;return Et;}function ra(Et,zt){for(var Ft,ee=-1,he=Et.length;++ee<he;){var Ee=zt(Et[ee]);Ee!==t&&(Ft=Ft===t?Ee:Ft+Ee);}return Ft;}function na(Et,zt){for(var Ft=-1,ee=Array(Et);++Ft<Et;)ee[Ft]=zt(Ft);return ee;}function Md(Et,zt){return ke(zt,function(Ft){return[Ft,Et[Ft]];});}function Zl(Et){return Et&&Et.slice(0,_l(Et)+1).replace(Ai,"");}function Ir(Et){return function(zt){return Et(zt);};}function ia(Et,zt){return ke(zt,function(Ft){return Et[Ft];});}function Ei(Et,zt){return Et.has(zt);}function Jl(Et,zt){for(var Ft=-1,ee=Et.length;++Ft<ee&&qn(zt,Et[Ft],0)>-1;);return Ft;}function Ql(Et,zt){for(var Ft=Et.length;Ft--&&qn(zt,Et[Ft],0)>-1;);return Ft;}function Ld(Et,zt){for(var Ft=Et.length,ee=0;Ft--;)Et[Ft]===zt&&++ee;return ee;}var Rd=ea(pd),bd=ea(vd);function Dd(Et){return"\\"+md[Et];}function Nd(Et,zt){return Et==null?t:Et[zt];}function _n(Et){return cd.test(Et);}function Bd(Et){return ud.test(Et);}function Wd(Et){for(var zt,Ft=[];!(zt=Et.next()).done;)Ft.push(zt.value);return Ft;}function sa(Et){var zt=-1,Ft=Array(Et.size);return Et.forEach(function(ee,he){Ft[++zt]=[he,ee];}),Ft;}function ql(Et,zt){return function(Ft){return Et(zt(Ft));};}function Sn(Et,zt){for(var Ft=-1,ee=Et.length,he=0,Ee=[];++Ft<ee;){var tr=Et[Ft];(tr===zt||tr===m)&&(Et[Ft]=m,Ee[he++]=Ft);}return Ee;}function us(Et){var zt=-1,Ft=Array(Et.size);return Et.forEach(function(ee){Ft[++zt]=ee;}),Ft;}function Fd(Et){var zt=-1,Ft=Array(Et.size);return Et.forEach(function(ee){Ft[++zt]=[ee,ee];}),Ft;}function Ud(Et,zt,Ft){for(var ee=Ft-1,he=Et.length;++ee<he;)if(Et[ee]===zt)return ee;return-1;}function Yd(Et,zt,Ft){for(var ee=Ft+1;ee--;)if(Et[ee]===zt)return ee;return ee;}function ti(Et){return _n(Et)?zd(Et):Id(Et);}function zr(Et){return _n(Et)?$d(Et):Od(Et);}function _l(Et){for(var zt=Et.length;zt--&&Ao.test(Et.charAt(zt)););return zt;}var Xd=ea(gd);function zd(Et){for(var zt=Ko.lastIndex=0;Ko.test(Et);)++zt;return zt;}function $d(Et){return Et.match(Ko)||[];}function jd(Et){return Et.match(fd)||[];}var Gd=function Et(zt){zt=zt==null?ir:ei.defaults(ir.Object(),zt,ei.pick(ir,hd));var Ft=zt.Array,ee=zt.Date,he=zt.Error,Ee=zt.Function,tr=zt.Math,Be=zt.Object,oa=zt.RegExp,kd=zt.String,Nr=zt.TypeError,hs=Ft.prototype,Hd=Ee.prototype,ri=Be.prototype,ds=zt["__core-js_shared__"],ps=Hd.toString,Ne=ri.hasOwnProperty,Vd=0,tf=function(){var o=/[^.]+$/.exec(ds&&ds.keys&&ds.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:"";}(),vs=ri.toString,Kd=ps.call(Be),Zd=ir._,Jd=oa("^"+ps.call(Ne).replace(wi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gs=Fl?zt.Buffer:t,Pn=zt.Symbol,ms=zt.Uint8Array,ef=gs?gs.allocUnsafe:t,ys=ql(Be.getPrototypeOf,Be),rf=Be.create,nf=ri.propertyIsEnumerable,Ss=hs.splice,sf=Pn?Pn.isConcatSpreadable:t,Mi=Pn?Pn.iterator:t,Dn=Pn?Pn.toStringTag:t,Ps=function(){try{var o=Un(Be,"defineProperty");return o({},"",{}),o;}catch(_unused25){}}(),Qd=zt.clearTimeout!==ir.clearTimeout&&zt.clearTimeout,qd=ee&&ee.now!==ir.Date.now&&ee.now,_d=zt.setTimeout!==ir.setTimeout&&zt.setTimeout,xs=tr.ceil,Ts=tr.floor,aa=Be.getOwnPropertySymbols,tp=gs?gs.isBuffer:t,of=zt.isFinite,ep=hs.join,rp=ql(Be.keys,Be),er=tr.max,ar=tr.min,np=ee.now,ip=zt.parseInt,af=tr.random,sp=hs.reverse,la=Un(zt,"DataView"),Li=Un(zt,"Map"),fa=Un(zt,"Promise"),ni=Un(zt,"Set"),Ri=Un(zt,"WeakMap"),bi=Un(Be,"create"),Cs=Ri&&new Ri(),ii={},op=Yn(la),ap=Yn(Li),lp=Yn(fa),fp=Yn(ni),cp=Yn(Ri),Is=Pn?Pn.prototype:t,Di=Is?Is.valueOf:t,lf=Is?Is.toString:t;function ot(o){if(Ze(o)&&!de(o)&&!(o instanceof Ie)){if(o instanceof Br)return o;if(Ne.call(o,"__wrapped__"))return fc(o);}return new Br(o);}var si=/* @__PURE__ */function(){function o(){}return function(g){if(!Ke(g))return{};if(rf)return rf(g);o.prototype=g;var b=new o();return o.prototype=t,b;};}();function Os(){}function Br(o,g){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=t;}ot.templateSettings={/**
|
|
446
|
+
* Used to detect `data` property values to be HTML-escaped.
|
|
447
|
+
*
|
|
448
|
+
* @memberOf _.templateSettings
|
|
449
|
+
* @type {RegExp}
|
|
450
|
+
*/escape:Oe,/**
|
|
451
|
+
* Used to detect code to be evaluated.
|
|
452
|
+
*
|
|
453
|
+
* @memberOf _.templateSettings
|
|
454
|
+
* @type {RegExp}
|
|
455
|
+
*/evaluate:ur,/**
|
|
456
|
+
* Used to detect `data` property values to inject.
|
|
457
|
+
*
|
|
458
|
+
* @memberOf _.templateSettings
|
|
459
|
+
* @type {RegExp}
|
|
460
|
+
*/interpolate:Hr,/**
|
|
461
|
+
* Used to reference the data object in the template text.
|
|
462
|
+
*
|
|
463
|
+
* @memberOf _.templateSettings
|
|
464
|
+
* @type {string}
|
|
465
|
+
*/variable:"",/**
|
|
466
|
+
* Used to import variables into the compiled template.
|
|
467
|
+
*
|
|
468
|
+
* @memberOf _.templateSettings
|
|
469
|
+
* @type {Object}
|
|
470
|
+
*/imports:{/**
|
|
471
|
+
* A reference to the `lodash` function.
|
|
472
|
+
*
|
|
473
|
+
* @memberOf _.templateSettings.imports
|
|
474
|
+
* @type {Function}
|
|
475
|
+
*/_:ot}},ot.prototype=Os.prototype,ot.prototype.constructor=ot,Br.prototype=si(Os.prototype),Br.prototype.constructor=Br;function Ie(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Q,this.__views__=[];}function up(){var o=new Ie(this.__wrapped__);return o.__actions__=yr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=yr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=yr(this.__views__),o;}function hp(){if(this.__filtered__){var o=new Ie(this);o.__dir__=-1,o.__filtered__=!0;}else o=this.clone(),o.__dir__*=-1;return o;}function dp(){var o=this.__wrapped__.value(),g=this.__dir__,b=de(o),H=g<0,et=b?o.length:0,lt=O0(0,et,this.__views__),vt=lt.start,It=lt.end,Rt=It-vt,Gt=H?It:vt-1,kt=this.__iteratees__,Vt=kt.length,_t=0,re=ar(Rt,this.__takeCount__);if(!b||!H&&et==Rt&&re==Rt)return bf(o,this.__actions__);var fe=[];t:for(;Rt--&&_t<re;){Gt+=g;for(var Pe=-1,ce=o[Gt];++Pe<Vt;){var Te=kt[Pe],we=Te.iteratee,Ar=Te.type,pr=we(ce);if(Ar==$)ce=pr;else if(!pr){if(Ar==N)continue t;break t;}}fe[_t++]=ce;}return fe;}Ie.prototype=si(Os.prototype),Ie.prototype.constructor=Ie;function Nn(o){var g=-1,b=o==null?0:o.length;for(this.clear();++g<b;){var H=o[g];this.set(H[0],H[1]);}}function pp(){this.__data__=bi?bi(null):{},this.size=0;}function vp(o){var g=this.has(o)&&delete this.__data__[o];return this.size-=g?1:0,g;}function gp(o){var g=this.__data__;if(bi){var b=g[o];return b===f?t:b;}return Ne.call(g,o)?g[o]:t;}function mp(o){var g=this.__data__;return bi?g[o]!==t:Ne.call(g,o);}function yp(o,g){var b=this.__data__;return this.size+=this.has(o)?0:1,b[o]=bi&&g===t?f:g,this;}Nn.prototype.clear=pp,Nn.prototype["delete"]=vp,Nn.prototype.get=gp,Nn.prototype.has=mp,Nn.prototype.set=yp;function rn(o){var g=-1,b=o==null?0:o.length;for(this.clear();++g<b;){var H=o[g];this.set(H[0],H[1]);}}function Sp(){this.__data__=[],this.size=0;}function Pp(o){var g=this.__data__,b=ws(g,o);if(b<0)return!1;var H=g.length-1;return b==H?g.pop():Ss.call(g,b,1),--this.size,!0;}function xp(o){var g=this.__data__,b=ws(g,o);return b<0?t:g[b][1];}function Tp(o){return ws(this.__data__,o)>-1;}function Cp(o,g){var b=this.__data__,H=ws(b,o);return H<0?(++this.size,b.push([o,g])):b[H][1]=g,this;}rn.prototype.clear=Sp,rn.prototype["delete"]=Pp,rn.prototype.get=xp,rn.prototype.has=Tp,rn.prototype.set=Cp;function nn(o){var g=-1,b=o==null?0:o.length;for(this.clear();++g<b;){var H=o[g];this.set(H[0],H[1]);}}function Ip(){this.size=0,this.__data__={hash:new Nn(),map:new(Li||rn)(),string:new Nn()};}function Op(o){var g=Us(this,o)["delete"](o);return this.size-=g?1:0,g;}function wp(o){return Us(this,o).get(o);}function Ap(o){return Us(this,o).has(o);}function Ep(o,g){var b=Us(this,o),H=b.size;return b.set(o,g),this.size+=b.size==H?0:1,this;}nn.prototype.clear=Ip,nn.prototype["delete"]=Op,nn.prototype.get=wp,nn.prototype.has=Ap,nn.prototype.set=Ep;function Bn(o){var g=-1,b=o==null?0:o.length;for(this.__data__=new nn();++g<b;)this.add(o[g]);}function Mp(o){return this.__data__.set(o,f),this;}function Lp(o){return this.__data__.has(o);}Bn.prototype.add=Bn.prototype.push=Mp,Bn.prototype.has=Lp;function $r(o){var g=this.__data__=new rn(o);this.size=g.size;}function Rp(){this.__data__=new rn(),this.size=0;}function bp(o){var g=this.__data__,b=g["delete"](o);return this.size=g.size,b;}function Dp(o){return this.__data__.get(o);}function Np(o){return this.__data__.has(o);}function Bp(o,g){var b=this.__data__;if(b instanceof rn){var H=b.__data__;if(!Li||H.length<n-1)return H.push([o,g]),this.size=++b.size,this;b=this.__data__=new nn(H);}return b.set(o,g),this.size=b.size,this;}$r.prototype.clear=Rp,$r.prototype["delete"]=bp,$r.prototype.get=Dp,$r.prototype.has=Np,$r.prototype.set=Bp;function ff(o,g){var b=de(o),H=!b&&Xn(o),et=!b&&!H&&On(o),lt=!b&&!H&&!et&&fi(o),vt=b||H||et||lt,It=vt?na(o.length,kd):[],Rt=It.length;for(var Gt in o)(g||Ne.call(o,Gt))&&!(vt&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
476
|
+
Gt=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
477
|
+
et&&(Gt=="offset"||Gt=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
478
|
+
lt&&(Gt=="buffer"||Gt=="byteLength"||Gt=="byteOffset")||// Skip index properties.
|
|
479
|
+
ln(Gt,Rt)))&&It.push(Gt);return It;}function cf(o){var g=o.length;return g?o[Pa(0,g-1)]:t;}function Wp(o,g){return Ys(yr(o),Wn(g,0,o.length));}function Fp(o){return Ys(yr(o));}function ca(o,g,b){(b!==t&&!jr(o[g],b)||b===t&&!(g in o))&&sn(o,g,b);}function Ni(o,g,b){var H=o[g];(!(Ne.call(o,g)&&jr(H,b))||b===t&&!(g in o))&&sn(o,g,b);}function ws(o,g){for(var b=o.length;b--;)if(jr(o[b][0],g))return b;return-1;}function Up(o,g,b,H){return xn(o,function(et,lt,vt){g(H,et,b(et),vt);}),H;}function uf(o,g){return o&&Kr(g,rr(g),o);}function Yp(o,g){return o&&Kr(g,Pr(g),o);}function sn(o,g,b){g=="__proto__"&&Ps?Ps(o,g,{configurable:!0,enumerable:!0,value:b,writable:!0}):o[g]=b;}function ua(o,g){for(var b=-1,H=g.length,et=Ft(H),lt=o==null;++b<H;)et[b]=lt?t:ka(o,g[b]);return et;}function Wn(o,g,b){return o===o&&(b!==t&&(o=o<=b?o:b),g!==t&&(o=o>=g?o:g)),o;}function Wr(o,g,b,H,et,lt){var vt,It=g&u,Rt=g&y,Gt=g&T;if(b&&(vt=et?b(o,H,et,lt):b(o)),vt!==t)return vt;if(!Ke(o))return o;var kt=de(o);if(kt){if(vt=A0(o),!It)return yr(o,vt);}else{var Vt=lr(o),_t=Vt==nt||Vt==Y;if(On(o))return Bf(o,It);if(Vt==z||Vt==wt||_t&&!et){if(vt=Rt||_t?{}:tc(o),!It)return Rt?g0(o,Yp(vt,o)):v0(o,uf(vt,o));}else{if(!Ue[Vt])return et?o:{};vt=E0(o,Vt,It);}}lt||(lt=new $r());var re=lt.get(o);if(re)return re;lt.set(o,vt),Mc(o)?o.forEach(function(ce){vt.add(Wr(ce,g,b,ce,o,lt));}):Ac(o)&&o.forEach(function(ce,Te){vt.set(Te,Wr(ce,g,b,Te,o,lt));});var fe=Gt?Rt?Ra:La:Rt?Pr:rr,Pe=kt?t:fe(o);return Dr(Pe||o,function(ce,Te){Pe&&(Te=ce,ce=o[Te]),Ni(vt,Te,Wr(ce,g,b,Te,o,lt));}),vt;}function Xp(o){var g=rr(o);return function(b){return hf(b,o,g);};}function hf(o,g,b){var H=b.length;if(o==null)return!H;for(o=Be(o);H--;){var et=b[H],lt=g[et],vt=o[et];if(vt===t&&!(et in o)||!lt(vt))return!1;}return!0;}function df(o,g,b){if(typeof o!="function")throw new Nr(c);return zi(function(){o.apply(t,b);},g);}function Bi(o,g,b,H){var et=-1,lt=fs,vt=!0,It=o.length,Rt=[],Gt=g.length;if(!It)return Rt;b&&(g=ke(g,Ir(b))),H?(lt=Qo,vt=!1):g.length>=n&&(lt=Ei,vt=!1,g=new Bn(g));t:for(;++et<It;){var kt=o[et],Vt=b==null?kt:b(kt);if(kt=H||kt!==0?kt:0,vt&&Vt===Vt){for(var _t=Gt;_t--;)if(g[_t]===Vt)continue t;Rt.push(kt);}else lt(g,Vt,H)||Rt.push(kt);}return Rt;}var xn=Xf(Vr),pf=Xf(da,!0);function zp(o,g){var b=!0;return xn(o,function(H,et,lt){return b=!!g(H,et,lt),b;}),b;}function As(o,g,b){for(var H=-1,et=o.length;++H<et;){var lt=o[H],vt=g(lt);if(vt!=null&&(It===t?vt===vt&&!wr(vt):b(vt,It)))var It=vt,Rt=lt;}return Rt;}function $p(o,g,b,H){var et=o.length;for(b=ye(b),b<0&&(b=-b>et?0:et+b),H=H===t||H>et?et:ye(H),H<0&&(H+=et),H=b>H?0:Rc(H);b<H;)o[b++]=g;return o;}function vf(o,g){var b=[];return xn(o,function(H,et,lt){g(H,et,lt)&&b.push(H);}),b;}function sr(o,g,b,H,et){var lt=-1,vt=o.length;for(b||(b=L0),et||(et=[]);++lt<vt;){var It=o[lt];g>0&&b(It)?g>1?sr(It,g-1,b,H,et):yn(et,It):H||(et[et.length]=It);}return et;}var ha=zf(),gf=zf(!0);function Vr(o,g){return o&&ha(o,g,rr);}function da(o,g){return o&&gf(o,g,rr);}function Es(o,g){return mn(g,function(b){return fn(o[b]);});}function Fn(o,g){g=Cn(g,o);for(var b=0,H=g.length;o!=null&&b<H;)o=o[Zr(g[b++])];return b&&b==H?o:t;}function mf(o,g,b){var H=g(o);return de(o)?H:yn(H,b(o));}function hr(o){return o==null?o===t?Mt:L:Dn&&Dn in Be(o)?I0(o):F0(o);}function pa(o,g){return o>g;}function jp(o,g){return o!=null&&Ne.call(o,g);}function Gp(o,g){return o!=null&&g in Be(o);}function kp(o,g,b){return o>=ar(g,b)&&o<er(g,b);}function va(o,g,b){for(var H=b?Qo:fs,et=o[0].length,lt=o.length,vt=lt,It=Ft(lt),Rt=1/0,Gt=[];vt--;){var kt=o[vt];vt&&g&&(kt=ke(kt,Ir(g))),Rt=ar(kt.length,Rt),It[vt]=!b&&(g||et>=120&&kt.length>=120)?new Bn(vt&&kt):t;}kt=o[0];var Vt=-1,_t=It[0];t:for(;++Vt<et&&Gt.length<Rt;){var re=kt[Vt],fe=g?g(re):re;if(re=b||re!==0?re:0,!(_t?Ei(_t,fe):H(Gt,fe,b))){for(vt=lt;--vt;){var Pe=It[vt];if(!(Pe?Ei(Pe,fe):H(o[vt],fe,b)))continue t;}_t&&_t.push(fe),Gt.push(re);}}return Gt;}function Hp(o,g,b,H){return Vr(o,function(et,lt,vt){g(H,b(et),lt,vt);}),H;}function Wi(o,g,b){g=Cn(g,o),o=ic(o,g);var H=o==null?o:o[Zr(Ur(g))];return H==null?t:Cr(H,o,b);}function yf(o){return Ze(o)&&hr(o)==wt;}function Vp(o){return Ze(o)&&hr(o)==Ot;}function Kp(o){return Ze(o)&&hr(o)==G;}function Fi(o,g,b,H,et){return o===g?!0:o==null||g==null||!Ze(o)&&!Ze(g)?o!==o&&g!==g:Zp(o,g,b,H,Fi,et);}function Zp(o,g,b,H,et,lt){var vt=de(o),It=de(g),Rt=vt?ht:lr(o),Gt=It?ht:lr(g);Rt=Rt==wt?z:Rt,Gt=Gt==wt?z:Gt;var kt=Rt==z,Vt=Gt==z,_t=Rt==Gt;if(_t&&On(o)){if(!On(g))return!1;vt=!0,kt=!1;}if(_t&&!kt)return lt||(lt=new $r()),vt||fi(o)?Qf(o,g,b,H,et,lt):T0(o,g,Rt,b,H,et,lt);if(!(b&w)){var re=kt&&Ne.call(o,"__wrapped__"),fe=Vt&&Ne.call(g,"__wrapped__");if(re||fe){var Pe=re?o.value():o,ce=fe?g.value():g;return lt||(lt=new $r()),et(Pe,ce,b,H,lt);}}return _t?(lt||(lt=new $r()),C0(o,g,b,H,et,lt)):!1;}function Jp(o){return Ze(o)&&lr(o)==Z;}function ga(o,g,b,H){var et=b.length,lt=et,vt=!H;if(o==null)return!lt;for(o=Be(o);et--;){var It=b[et];if(vt&&It[2]?It[1]!==o[It[0]]:!(It[0]in o))return!1;}for(;++et<lt;){It=b[et];var Rt=It[0],Gt=o[Rt],kt=It[1];if(vt&&It[2]){if(Gt===t&&!(Rt in o))return!1;}else{var Vt=new $r();if(H)var _t=H(Gt,kt,Rt,o,g,Vt);if(!(_t===t?Fi(kt,Gt,w|I,H,Vt):_t))return!1;}}return!0;}function Sf(o){if(!Ke(o)||b0(o))return!1;var g=fn(o)?Jd:Bo;return g.test(Yn(o));}function Qp(o){return Ze(o)&&hr(o)==it;}function qp(o){return Ze(o)&&lr(o)==ct;}function _p(o){return Ze(o)&&ks(o.length)&&!!ze[hr(o)];}function Pf(o){return typeof o=="function"?o:o==null?xr:_typeof(o)=="object"?de(o)?Cf(o[0],o[1]):Tf(o):$c(o);}function ma(o){if(!Xi(o))return rp(o);var g=[];for(var b in Be(o))Ne.call(o,b)&&b!="constructor"&&g.push(b);return g;}function t0(o){if(!Ke(o))return W0(o);var g=Xi(o),b=[];for(var H in o)H=="constructor"&&(g||!Ne.call(o,H))||b.push(H);return b;}function ya(o,g){return o<g;}function xf(o,g){var b=-1,H=Sr(o)?Ft(o.length):[];return xn(o,function(et,lt,vt){H[++b]=g(et,lt,vt);}),H;}function Tf(o){var g=Da(o);return g.length==1&&g[0][2]?rc(g[0][0],g[0][1]):function(b){return b===o||ga(b,o,g);};}function Cf(o,g){return Ba(o)&&ec(g)?rc(Zr(o),g):function(b){var H=ka(b,o);return H===t&&H===g?Ha(b,o):Fi(g,H,w|I);};}function Ms(o,g,b,H,et){o!==g&&ha(g,function(lt,vt){if(et||(et=new $r()),Ke(lt))e0(o,g,vt,b,Ms,H,et);else{var It=H?H(Fa(o,vt),lt,vt+"",o,g,et):t;It===t&&(It=lt),ca(o,vt,It);}},Pr);}function e0(o,g,b,H,et,lt,vt){var It=Fa(o,b),Rt=Fa(g,b),Gt=vt.get(Rt);if(Gt){ca(o,b,Gt);return;}var kt=lt?lt(It,Rt,b+"",o,g,vt):t,Vt=kt===t;if(Vt){var _t=de(Rt),re=!_t&&On(Rt),fe=!_t&&!re&&fi(Rt);kt=Rt,_t||re||fe?de(It)?kt=It:Qe(It)?kt=yr(It):re?(Vt=!1,kt=Bf(Rt,!0)):fe?(Vt=!1,kt=Wf(Rt,!0)):kt=[]:$i(Rt)||Xn(Rt)?(kt=It,Xn(It)?kt=bc(It):(!Ke(It)||fn(It))&&(kt=tc(Rt))):Vt=!1;}Vt&&(vt.set(Rt,kt),et(kt,Rt,H,lt,vt),vt["delete"](Rt)),ca(o,b,kt);}function If(o,g){var b=o.length;if(b)return g+=g<0?b:0,ln(g,b)?o[g]:t;}function Of(o,g,b){g.length?g=ke(g,function(lt){return de(lt)?function(vt){return Fn(vt,lt.length===1?lt[0]:lt);}:lt;}):g=[xr];var H=-1;g=ke(g,Ir(le()));var et=xf(o,function(lt,vt,It){var Rt=ke(g,function(Gt){return Gt(lt);});return{criteria:Rt,index:++H,value:lt};});return Ed(et,function(lt,vt){return p0(lt,vt,b);});}function r0(o,g){return wf(o,g,function(b,H){return Ha(o,H);});}function wf(o,g,b){for(var H=-1,et=g.length,lt={};++H<et;){var vt=g[H],It=Fn(o,vt);b(It,vt)&&Ui(lt,Cn(vt,o),It);}return lt;}function n0(o){return function(g){return Fn(g,o);};}function Sa(o,g,b,H){var et=H?Ad:qn,lt=-1,vt=g.length,It=o;for(o===g&&(g=yr(g)),b&&(It=ke(o,Ir(b)));++lt<vt;)for(var Rt=0,Gt=g[lt],kt=b?b(Gt):Gt;(Rt=et(It,kt,Rt,H))>-1;)It!==o&&Ss.call(It,Rt,1),Ss.call(o,Rt,1);return o;}function Af(o,g){for(var b=o?g.length:0,H=b-1;b--;){var et=g[b];if(b==H||et!==lt){var lt=et;ln(et)?Ss.call(o,et,1):Ca(o,et);}}return o;}function Pa(o,g){return o+Ts(af()*(g-o+1));}function i0(o,g,b,H){for(var et=-1,lt=er(xs((g-o)/(b||1)),0),vt=Ft(lt);lt--;)vt[H?lt:++et]=o,o+=b;return vt;}function xa(o,g){var b="";if(!o||g<1||g>at)return b;do g%2&&(b+=o),g=Ts(g/2),g&&(o+=o);while(g);return b;}function xe(o,g){return Ua(nc(o,g,xr),o+"");}function s0(o){return cf(ci(o));}function o0(o,g){var b=ci(o);return Ys(b,Wn(g,0,b.length));}function Ui(o,g,b,H){if(!Ke(o))return o;g=Cn(g,o);for(var et=-1,lt=g.length,vt=lt-1,It=o;It!=null&&++et<lt;){var Rt=Zr(g[et]),Gt=b;if(Rt==="__proto__"||Rt==="constructor"||Rt==="prototype")return o;if(et!=vt){var kt=It[Rt];Gt=H?H(kt,Rt,It):t,Gt===t&&(Gt=Ke(kt)?kt:ln(g[et+1])?[]:{});}Ni(It,Rt,Gt),It=It[Rt];}return o;}var Ef=Cs?function(o,g){return Cs.set(o,g),o;}:xr,a0=Ps?function(o,g){return Ps(o,"toString",{configurable:!0,enumerable:!1,value:Ka(g),writable:!0});}:xr;function l0(o){return Ys(ci(o));}function Fr(o,g,b){var H=-1,et=o.length;g<0&&(g=-g>et?0:et+g),b=b>et?et:b,b<0&&(b+=et),et=g>b?0:b-g>>>0,g>>>=0;for(var lt=Ft(et);++H<et;)lt[H]=o[H+g];return lt;}function f0(o,g){var b;return xn(o,function(H,et,lt){return b=g(H,et,lt),!b;}),!!b;}function Ls(o,g,b){var H=0,et=o==null?H:o.length;if(typeof g=="number"&&g===g&&et<=mt){for(;H<et;){var lt=H+et>>>1,vt=o[lt];vt!==null&&!wr(vt)&&(b?vt<=g:vt<g)?H=lt+1:et=lt;}return et;}return Ta(o,g,xr,b);}function Ta(o,g,b,H){var et=0,lt=o==null?0:o.length;if(lt===0)return 0;g=b(g);for(var vt=g!==g,It=g===null,Rt=wr(g),Gt=g===t;et<lt;){var kt=Ts((et+lt)/2),Vt=b(o[kt]),_t=Vt!==t,re=Vt===null,fe=Vt===Vt,Pe=wr(Vt);if(vt)var ce=H||fe;else Gt?ce=fe&&(H||_t):It?ce=fe&&_t&&(H||!re):Rt?ce=fe&&_t&&!re&&(H||!Pe):re||Pe?ce=!1:ce=H?Vt<=g:Vt<g;ce?et=kt+1:lt=kt;}return ar(lt,ft);}function Mf(o,g){for(var b=-1,H=o.length,et=0,lt=[];++b<H;){var vt=o[b],It=g?g(vt):vt;if(!b||!jr(It,Rt)){var Rt=It;lt[et++]=vt===0?0:vt;}}return lt;}function Lf(o){return typeof o=="number"?o:wr(o)?V:+o;}function Or(o){if(typeof o=="string")return o;if(de(o))return ke(o,Or)+"";if(wr(o))return lf?lf.call(o):"";var g=o+"";return g=="0"&&1/o==-tt?"-0":g;}function Tn(o,g,b){var H=-1,et=fs,lt=o.length,vt=!0,It=[],Rt=It;if(b)vt=!1,et=Qo;else if(lt>=n){var Gt=g?null:P0(o);if(Gt)return us(Gt);vt=!1,et=Ei,Rt=new Bn();}else Rt=g?[]:It;t:for(;++H<lt;){var kt=o[H],Vt=g?g(kt):kt;if(kt=b||kt!==0?kt:0,vt&&Vt===Vt){for(var _t=Rt.length;_t--;)if(Rt[_t]===Vt)continue t;g&&Rt.push(Vt),It.push(kt);}else et(Rt,Vt,b)||(Rt!==It&&Rt.push(Vt),It.push(kt));}return It;}function Ca(o,g){return g=Cn(g,o),o=ic(o,g),o==null||delete o[Zr(Ur(g))];}function Rf(o,g,b,H){return Ui(o,g,b(Fn(o,g)),H);}function Rs(o,g,b,H){for(var et=o.length,lt=H?et:-1;(H?lt--:++lt<et)&&g(o[lt],lt,o););return b?Fr(o,H?0:lt,H?lt+1:et):Fr(o,H?lt+1:0,H?et:lt);}function bf(o,g){var b=o;return b instanceof Ie&&(b=b.value()),qo(g,function(H,et){return et.func.apply(et.thisArg,yn([H],et.args));},b);}function Ia(o,g,b){var H=o.length;if(H<2)return H?Tn(o[0]):[];for(var et=-1,lt=Ft(H);++et<H;)for(var vt=o[et],It=-1;++It<H;)It!=et&&(lt[et]=Bi(lt[et]||vt,o[It],g,b));return Tn(sr(lt,1),g,b);}function Df(o,g,b){for(var H=-1,et=o.length,lt=g.length,vt={};++H<et;){var It=H<lt?g[H]:t;b(vt,o[H],It);}return vt;}function Oa(o){return Qe(o)?o:[];}function wa(o){return typeof o=="function"?o:xr;}function Cn(o,g){return de(o)?o:Ba(o,g)?[o]:lc(Le(o));}var c0=xe;function In(o,g,b){var H=o.length;return b=b===t?H:b,!g&&b>=H?o:Fr(o,g,b);}var Nf=Qd||function(o){return ir.clearTimeout(o);};function Bf(o,g){if(g)return o.slice();var b=o.length,H=ef?ef(b):new o.constructor(b);return o.copy(H),H;}function Aa(o){var g=new o.constructor(o.byteLength);return new ms(g).set(new ms(o)),g;}function u0(o,g){var b=g?Aa(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.byteLength);}function h0(o){var g=new o.constructor(o.source,ts.exec(o));return g.lastIndex=o.lastIndex,g;}function d0(o){return Di?Be(Di.call(o)):{};}function Wf(o,g){var b=g?Aa(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.length);}function Ff(o,g){if(o!==g){var b=o!==t,H=o===null,et=o===o,lt=wr(o),vt=g!==t,It=g===null,Rt=g===g,Gt=wr(g);if(!It&&!Gt&&!lt&&o>g||lt&&vt&&Rt&&!It&&!Gt||H&&vt&&Rt||!b&&Rt||!et)return 1;if(!H&&!lt&&!Gt&&o<g||Gt&&b&&et&&!H&&!lt||It&&b&&et||!vt&&et||!Rt)return-1;}return 0;}function p0(o,g,b){for(var H=-1,et=o.criteria,lt=g.criteria,vt=et.length,It=b.length;++H<vt;){var Rt=Ff(et[H],lt[H]);if(Rt){if(H>=It)return Rt;var Gt=b[H];return Rt*(Gt=="desc"?-1:1);}}return o.index-g.index;}function Uf(o,g,b,H){for(var et=-1,lt=o.length,vt=b.length,It=-1,Rt=g.length,Gt=er(lt-vt,0),kt=Ft(Rt+Gt),Vt=!H;++It<Rt;)kt[It]=g[It];for(;++et<vt;)(Vt||et<lt)&&(kt[b[et]]=o[et]);for(;Gt--;)kt[It++]=o[et++];return kt;}function Yf(o,g,b,H){for(var et=-1,lt=o.length,vt=-1,It=b.length,Rt=-1,Gt=g.length,kt=er(lt-It,0),Vt=Ft(kt+Gt),_t=!H;++et<kt;)Vt[et]=o[et];for(var re=et;++Rt<Gt;)Vt[re+Rt]=g[Rt];for(;++vt<It;)(_t||et<lt)&&(Vt[re+b[vt]]=o[et++]);return Vt;}function yr(o,g){var b=-1,H=o.length;for(g||(g=Ft(H));++b<H;)g[b]=o[b];return g;}function Kr(o,g,b,H){var et=!b;b||(b={});for(var lt=-1,vt=g.length;++lt<vt;){var It=g[lt],Rt=H?H(b[It],o[It],It,b,o):t;Rt===t&&(Rt=o[It]),et?sn(b,It,Rt):Ni(b,It,Rt);}return b;}function v0(o,g){return Kr(o,Na(o),g);}function g0(o,g){return Kr(o,qf(o),g);}function bs(o,g){return function(b,H){var et=de(b)?xd:Up,lt=g?g():{};return et(b,o,le(H,2),lt);};}function oi(o){return xe(function(g,b){var H=-1,et=b.length,lt=et>1?b[et-1]:t,vt=et>2?b[2]:t;for(lt=o.length>3&&typeof lt=="function"?(et--,lt):t,vt&&dr(b[0],b[1],vt)&&(lt=et<3?t:lt,et=1),g=Be(g);++H<et;){var It=b[H];It&&o(g,It,H,lt);}return g;});}function Xf(o,g){return function(b,H){if(b==null)return b;if(!Sr(b))return o(b,H);for(var et=b.length,lt=g?et:-1,vt=Be(b);(g?lt--:++lt<et)&&H(vt[lt],lt,vt)!==!1;);return b;};}function zf(o){return function(g,b,H){for(var et=-1,lt=Be(g),vt=H(g),It=vt.length;It--;){var Rt=vt[o?It:++et];if(b(lt[Rt],Rt,lt)===!1)break;}return g;};}function m0(o,g,b){var H=g&S,et=Yi(o);function lt(){var vt=this&&this!==ir&&this instanceof lt?et:o;return vt.apply(H?b:this,arguments);}return lt;}function $f(o){return function(g){g=Le(g);var b=_n(g)?zr(g):t,H=b?b[0]:g.charAt(0),et=b?In(b,1).join(""):g.slice(1);return H[o]()+et;};}function ai(o){return function(g){return qo(Xc(Yc(g).replace(gn,"")),o,"");};}function Yi(o){return function(){var g=arguments;switch(g.length){case 0:return new o();case 1:return new o(g[0]);case 2:return new o(g[0],g[1]);case 3:return new o(g[0],g[1],g[2]);case 4:return new o(g[0],g[1],g[2],g[3]);case 5:return new o(g[0],g[1],g[2],g[3],g[4]);case 6:return new o(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new o(g[0],g[1],g[2],g[3],g[4],g[5],g[6]);}var b=si(o.prototype),H=o.apply(b,g);return Ke(H)?H:b;};}function y0(o,g,b){var H=Yi(o);function et(){for(var lt=arguments.length,vt=Ft(lt),It=lt,Rt=li(et);It--;)vt[It]=arguments[It];var Gt=lt<3&&vt[0]!==Rt&&vt[lt-1]!==Rt?[]:Sn(vt,Rt);if(lt-=Gt.length,lt<b)return Vf(o,g,Ds,et.placeholder,t,vt,Gt,t,t,b-lt);var kt=this&&this!==ir&&this instanceof et?H:o;return Cr(kt,this,vt);}return et;}function jf(o){return function(g,b,H){var et=Be(g);if(!Sr(g)){var lt=le(b,3);g=rr(g),b=function b(It){return lt(et[It],It,et);};}var vt=o(g,b,H);return vt>-1?et[lt?g[vt]:vt]:t;};}function Gf(o){return an(function(g){var b=g.length,H=b,et=Br.prototype.thru;for(o&&g.reverse();H--;){var lt=g[H];if(typeof lt!="function")throw new Nr(c);if(et&&!vt&&Fs(lt)=="wrapper")var vt=new Br([],!0);}for(H=vt?H:b;++H<b;){lt=g[H];var It=Fs(lt),Rt=It=="wrapper"?ba(lt):t;Rt&&Wa(Rt[0])&&Rt[1]==(R|v|x|D)&&!Rt[4].length&&Rt[9]==1?vt=vt[Fs(Rt[0])].apply(vt,Rt[3]):vt=lt.length==1&&Wa(lt)?vt[It]():vt.thru(lt);}return function(){var Gt=arguments,kt=Gt[0];if(vt&&Gt.length==1&&de(kt))return vt.plant(kt).value();for(var Vt=0,_t=b?g[Vt].apply(this,Gt):kt;++Vt<b;)_t=g[Vt].call(this,_t);return _t;};});}function Ds(o,g,b,H,et,lt,vt,It,Rt,Gt){var kt=g&R,Vt=g&S,_t=g&O,re=g&(v|p),fe=g&U,Pe=_t?t:Yi(o);function ce(){for(var Te=arguments.length,we=Ft(Te),Ar=Te;Ar--;)we[Ar]=arguments[Ar];if(re)var pr=li(ce),Er=Ld(we,pr);if(H&&(we=Uf(we,H,et,re)),lt&&(we=Yf(we,lt,vt,re)),Te-=Er,re&&Te<Gt){var qe=Sn(we,pr);return Vf(o,g,Ds,ce.placeholder,b,we,qe,It,Rt,Gt-Te);}var Gr=Vt?b:this,un=_t?Gr[o]:o;return Te=we.length,It?we=U0(we,It):fe&&Te>1&&we.reverse(),kt&&Rt<Te&&(we.length=Rt),this&&this!==ir&&this instanceof ce&&(un=Pe||Yi(un)),un.apply(Gr,we);}return ce;}function kf(o,g){return function(b,H){return Hp(b,o,g(H),{});};}function Ns(o,g){return function(b,H){var et;if(b===t&&H===t)return g;if(b!==t&&(et=b),H!==t){if(et===t)return H;typeof b=="string"||typeof H=="string"?(b=Or(b),H=Or(H)):(b=Lf(b),H=Lf(H)),et=o(b,H);}return et;};}function Ea(o){return an(function(g){return g=ke(g,Ir(le())),xe(function(b){var H=this;return o(g,function(et){return Cr(et,H,b);});});});}function Bs(o,g){g=g===t?" ":Or(g);var b=g.length;if(b<2)return b?xa(g,o):g;var H=xa(g,xs(o/ti(g)));return _n(g)?In(zr(H),0,o).join(""):H.slice(0,o);}function S0(o,g,b,H){var et=g&S,lt=Yi(o);function vt(){for(var It=-1,Rt=arguments.length,Gt=-1,kt=H.length,Vt=Ft(kt+Rt),_t=this&&this!==ir&&this instanceof vt?lt:o;++Gt<kt;)Vt[Gt]=H[Gt];for(;Rt--;)Vt[Gt++]=arguments[++It];return Cr(_t,et?b:this,Vt);}return vt;}function Hf(o){return function(g,b,H){return H&&typeof H!="number"&&dr(g,b,H)&&(b=H=t),g=cn(g),b===t?(b=g,g=0):b=cn(b),H=H===t?g<b?1:-1:cn(H),i0(g,b,H,o);};}function Ws(o){return function(g,b){return typeof g=="string"&&typeof b=="string"||(g=Yr(g),b=Yr(b)),o(g,b);};}function Vf(o,g,b,H,et,lt,vt,It,Rt,Gt){var kt=g&v,Vt=kt?vt:t,_t=kt?t:vt,re=kt?lt:t,fe=kt?t:lt;g|=kt?x:E,g&=~(kt?E:x),g&d||(g&=~(S|O));var Pe=[o,g,et,re,Vt,fe,_t,It,Rt,Gt],ce=b.apply(t,Pe);return Wa(o)&&sc(ce,Pe),ce.placeholder=H,oc(ce,o,g);}function Ma(o){var g=tr[o];return function(b,H){if(b=Yr(b),H=H==null?0:ar(ye(H),292),H&&of(b)){var et=(Le(b)+"e").split("e"),lt=g(et[0]+"e"+(+et[1]+H));return et=(Le(lt)+"e").split("e"),+(et[0]+"e"+(+et[1]-H));}return g(b);};}var P0=ni&&1/us(new ni([,-0]))[1]==tt?function(o){return new ni(o);}:Qa;function Kf(o){return function(g){var b=lr(g);return b==Z?sa(g):b==ct?Fd(g):Md(g,o(g));};}function on(o,g,b,H,et,lt,vt,It){var Rt=g&O;if(!Rt&&typeof o!="function")throw new Nr(c);var Gt=H?H.length:0;if(Gt||(g&=~(x|E),H=et=t),vt=vt===t?vt:er(ye(vt),0),It=It===t?It:ye(It),Gt-=et?et.length:0,g&E){var kt=H,Vt=et;H=et=t;}var _t=Rt?t:ba(o),re=[o,g,b,H,et,kt,Vt,lt,vt,It];if(_t&&B0(re,_t),o=re[0],g=re[1],b=re[2],H=re[3],et=re[4],It=re[9]=re[9]===t?Rt?0:o.length:er(re[9]-Gt,0),!It&&g&(v|p)&&(g&=~(v|p)),!g||g==S)var fe=m0(o,g,b);else g==v||g==p?fe=y0(o,g,It):(g==x||g==(S|x))&&!et.length?fe=S0(o,g,b,H):fe=Ds.apply(t,re);var Pe=_t?Ef:sc;return oc(Pe(fe,re),o,g);}function Zf(o,g,b,H){return o===t||jr(o,ri[b])&&!Ne.call(H,b)?g:o;}function Jf(o,g,b,H,et,lt){return Ke(o)&&Ke(g)&&(lt.set(g,o),Ms(o,g,t,Jf,lt),lt["delete"](g)),o;}function x0(o){return $i(o)?t:o;}function Qf(o,g,b,H,et,lt){var vt=b&w,It=o.length,Rt=g.length;if(It!=Rt&&!(vt&&Rt>It))return!1;var Gt=lt.get(o),kt=lt.get(g);if(Gt&&kt)return Gt==g&&kt==o;var Vt=-1,_t=!0,re=b&I?new Bn():t;for(lt.set(o,g),lt.set(g,o);++Vt<It;){var fe=o[Vt],Pe=g[Vt];if(H)var ce=vt?H(Pe,fe,Vt,g,o,lt):H(fe,Pe,Vt,o,g,lt);if(ce!==t){if(ce)continue;_t=!1;break;}if(re){if(!_o(g,function(Te,we){if(!Ei(re,we)&&(fe===Te||et(fe,Te,b,H,lt)))return re.push(we);})){_t=!1;break;}}else if(!(fe===Pe||et(fe,Pe,b,H,lt))){_t=!1;break;}}return lt["delete"](o),lt["delete"](g),_t;}function T0(o,g,b,H,et,lt,vt){switch(b){case Lt:if(o.byteLength!=g.byteLength||o.byteOffset!=g.byteOffset)return!1;o=o.buffer,g=g.buffer;case Ot:return!(o.byteLength!=g.byteLength||!lt(new ms(o),new ms(g)));case Dt:case G:case C:return jr(+o,+g);case rt:return o.name==g.name&&o.message==g.message;case it:case xt:return o==g+"";case Z:var It=sa;case ct:var Rt=H&w;if(It||(It=us),o.size!=g.size&&!Rt)return!1;var Gt=vt.get(o);if(Gt)return Gt==g;H|=I,vt.set(o,g);var kt=Qf(It(o),It(g),H,et,lt,vt);return vt["delete"](o),kt;case Ct:if(Di)return Di.call(o)==Di.call(g);}return!1;}function C0(o,g,b,H,et,lt){var vt=b&w,It=La(o),Rt=It.length,Gt=La(g),kt=Gt.length;if(Rt!=kt&&!vt)return!1;for(var Vt=Rt;Vt--;){var _t=It[Vt];if(!(vt?_t in g:Ne.call(g,_t)))return!1;}var re=lt.get(o),fe=lt.get(g);if(re&&fe)return re==g&&fe==o;var Pe=!0;lt.set(o,g),lt.set(g,o);for(var ce=vt;++Vt<Rt;){_t=It[Vt];var Te=o[_t],we=g[_t];if(H)var Ar=vt?H(we,Te,_t,g,o,lt):H(Te,we,_t,o,g,lt);if(!(Ar===t?Te===we||et(Te,we,b,H,lt):Ar)){Pe=!1;break;}ce||(ce=_t=="constructor");}if(Pe&&!ce){var pr=o.constructor,Er=g.constructor;pr!=Er&&"constructor"in o&&"constructor"in g&&!(typeof pr=="function"&&pr instanceof pr&&typeof Er=="function"&&Er instanceof Er)&&(Pe=!1);}return lt["delete"](o),lt["delete"](g),Pe;}function an(o){return Ua(nc(o,t,hc),o+"");}function La(o){return mf(o,rr,Na);}function Ra(o){return mf(o,Pr,qf);}var ba=Cs?function(o){return Cs.get(o);}:Qa;function Fs(o){for(var g=o.name+"",b=ii[g],H=Ne.call(ii,g)?b.length:0;H--;){var et=b[H],lt=et.func;if(lt==null||lt==o)return et.name;}return g;}function li(o){var g=Ne.call(ot,"placeholder")?ot:o;return g.placeholder;}function le(){var o=ot.iteratee||Za;return o=o===Za?Pf:o,arguments.length?o(arguments[0],arguments[1]):o;}function Us(o,g){var b=o.__data__;return R0(g)?b[typeof g=="string"?"string":"hash"]:b.map;}function Da(o){for(var g=rr(o),b=g.length;b--;){var H=g[b],et=o[H];g[b]=[H,et,ec(et)];}return g;}function Un(o,g){var b=Nd(o,g);return Sf(b)?b:t;}function I0(o){var g=Ne.call(o,Dn),b=o[Dn];try{o[Dn]=t;var H=!0;}catch(_unused26){}var et=vs.call(o);return H&&(g?o[Dn]=b:delete o[Dn]),et;}var Na=aa?function(o){return o==null?[]:(o=Be(o),mn(aa(o),function(g){return nf.call(o,g);}));}:qa,qf=aa?function(o){for(var g=[];o;)yn(g,Na(o)),o=ys(o);return g;}:qa,lr=hr;(la&&lr(new la(new ArrayBuffer(1)))!=Lt||Li&&lr(new Li())!=Z||fa&&lr(fa.resolve())!=K||ni&&lr(new ni())!=ct||Ri&&lr(new Ri())!=bt)&&(lr=function lr(o){var g=hr(o),b=g==z?o.constructor:t,H=b?Yn(b):"";if(H)switch(H){case op:return Lt;case ap:return Z;case lp:return K;case fp:return ct;case cp:return bt;}return g;});function O0(o,g,b){for(var H=-1,et=b.length;++H<et;){var lt=b[H],vt=lt.size;switch(lt.type){case"drop":o+=vt;break;case"dropRight":g-=vt;break;case"take":g=ar(g,o+vt);break;case"takeRight":o=er(o,g-vt);break;}}return{start:o,end:g};}function w0(o){var g=o.match(Mo);return g?g[1].split(Lo):[];}function _f(o,g,b){g=Cn(g,o);for(var H=-1,et=g.length,lt=!1;++H<et;){var vt=Zr(g[H]);if(!(lt=o!=null&&b(o,vt)))break;o=o[vt];}return lt||++H!=et?lt:(et=o==null?0:o.length,!!et&&ks(et)&&ln(vt,et)&&(de(o)||Xn(o)));}function A0(o){var g=o.length,b=new o.constructor(g);return g&&typeof o[0]=="string"&&Ne.call(o,"index")&&(b.index=o.index,b.input=o.input),b;}function tc(o){return typeof o.constructor=="function"&&!Xi(o)?si(ys(o)):{};}function E0(o,g,b){var H=o.constructor;switch(g){case Ot:return Aa(o);case Dt:case G:return new H(+o);case Lt:return u0(o,b);case Yt:case $t:case Wt:case Qt:case ue:case ie:case ne:case ae:case se:return Wf(o,b);case Z:return new H();case C:case xt:return new H(o);case it:return h0(o);case ct:return new H();case Ct:return d0(o);}}function M0(o,g){var b=g.length;if(!b)return o;var H=b-1;return g[H]=(b>1?"& ":"")+g[H],g=g.join(b>2?", ":" "),o.replace(Eo,"{\n/* [wrapped with "+g+"] */\n");}function L0(o){return de(o)||Xn(o)||!!(sf&&o&&o[sf]);}function ln(o,g){var _g2;var b=_typeof(o);return g=(_g2=g)!==null&&_g2!==void 0?_g2:at,!!g&&(b=="number"||b!="symbol"&&Fo.test(o))&&o>-1&&o%1==0&&o<g;}function dr(o,g,b){if(!Ke(b))return!1;var H=_typeof(g);return(H=="number"?Sr(b)&&ln(g,b.length):H=="string"&&g in b)?jr(b[g],o):!1;}function Ba(o,g){if(de(o))return!1;var b=_typeof(o);return b=="number"||b=="symbol"||b=="boolean"||o==null||wr(o)?!0:Hn.test(o)||!tn.test(o)||g!=null&&o in Be(g);}function R0(o){var g=_typeof(o);return g=="string"||g=="number"||g=="symbol"||g=="boolean"?o!=="__proto__":o===null;}function Wa(o){var g=Fs(o),b=ot[g];if(typeof b!="function"||!(g in Ie.prototype))return!1;if(o===b)return!0;var H=ba(b);return!!H&&o===H[0];}function b0(o){return!!tf&&tf in o;}var D0=ds?fn:_a;function Xi(o){var g=o&&o.constructor,b=typeof g=="function"&&g.prototype||ri;return o===b;}function ec(o){return o===o&&!Ke(o);}function rc(o,g){return function(b){return b==null?!1:b[o]===g&&(g!==t||o in Be(b));};}function N0(o){var g=js(o,function(H){return b.size===h&&b.clear(),H;}),b=g.cache;return g;}function B0(o,g){var b=o[1],H=g[1],et=b|H,lt=et<(S|O|R),vt=H==R&&b==v||H==R&&b==D&&o[7].length<=g[8]||H==(R|D)&&g[7].length<=g[8]&&b==v;if(!(lt||vt))return o;H&S&&(o[2]=g[2],et|=b&S?0:d);var It=g[3];if(It){var Rt=o[3];o[3]=Rt?Uf(Rt,It,g[4]):It,o[4]=Rt?Sn(o[3],m):g[4];}return It=g[5],It&&(Rt=o[5],o[5]=Rt?Yf(Rt,It,g[6]):It,o[6]=Rt?Sn(o[5],m):g[6]),It=g[7],It&&(o[7]=It),H&R&&(o[8]=o[8]==null?g[8]:ar(o[8],g[8])),o[9]==null&&(o[9]=g[9]),o[0]=g[0],o[1]=et,o;}function W0(o){var g=[];if(o!=null)for(var b in Be(o))g.push(b);return g;}function F0(o){return vs.call(o);}function nc(o,g,b){return g=er(g===t?o.length-1:g,0),function(){for(var H=arguments,et=-1,lt=er(H.length-g,0),vt=Ft(lt);++et<lt;)vt[et]=H[g+et];et=-1;for(var It=Ft(g+1);++et<g;)It[et]=H[et];return It[g]=b(vt),Cr(o,this,It);};}function ic(o,g){return g.length<2?o:Fn(o,Fr(g,0,-1));}function U0(o,g){for(var b=o.length,H=ar(g.length,b),et=yr(o);H--;){var lt=g[H];o[H]=ln(lt,b)?et[lt]:t;}return o;}function Fa(o,g){if(!(g==="constructor"&&typeof o[g]=="function")&&g!="__proto__")return o[g];}var sc=ac(Ef),zi=_d||function(o,g){return ir.setTimeout(o,g);},Ua=ac(a0);function oc(o,g,b){var H=g+"";return Ua(o,M0(H,Y0(w0(H),b)));}function ac(o){var g=0,b=0;return function(){var H=np(),et=B-(H-b);if(b=H,et>0){if(++g>=X)return arguments[0];}else g=0;return o.apply(t,arguments);};}function Ys(o,g){var b=-1,H=o.length,et=H-1;for(g=g===t?H:g;++b<g;){var lt=Pa(b,et),vt=o[lt];o[lt]=o[b],o[b]=vt;}return o.length=g,o;}var lc=N0(function(o){var g=[];return o.charCodeAt(0)===46&&g.push(""),o.replace(Vn,function(b,H,et,lt){g.push(et?lt.replace(Do,"$1"):H||b);}),g;});function Zr(o){if(typeof o=="string"||wr(o))return o;var g=o+"";return g=="0"&&1/o==-tt?"-0":g;}function Yn(o){if(o!=null){try{return ps.call(o);}catch(_unused27){}try{return o+"";}catch(_unused28){}}return"";}function Y0(o,g){return Dr(yt,function(b){var H="_."+b[0];g&b[1]&&!fs(o,H)&&o.push(H);}),o.sort();}function fc(o){if(o instanceof Ie)return o.clone();var g=new Br(o.__wrapped__,o.__chain__);return g.__actions__=yr(o.__actions__),g.__index__=o.__index__,g.__values__=o.__values__,g;}function X0(o,g,b){(b?dr(o,g,b):g===t)?g=1:g=er(ye(g),0);var H=o==null?0:o.length;if(!H||g<1)return[];for(var et=0,lt=0,vt=Ft(xs(H/g));et<H;)vt[lt++]=Fr(o,et,et+=g);return vt;}function z0(o){for(var g=-1,b=o==null?0:o.length,H=0,et=[];++g<b;){var lt=o[g];lt&&(et[H++]=lt);}return et;}function $0(){var o=arguments.length;if(!o)return[];for(var g=Ft(o-1),b=arguments[0],H=o;H--;)g[H-1]=arguments[H];return yn(de(b)?yr(b):[b],sr(g,1));}var j0=xe(function(o,g){return Qe(o)?Bi(o,sr(g,1,Qe,!0)):[];}),G0=xe(function(o,g){var b=Ur(g);return Qe(b)&&(b=t),Qe(o)?Bi(o,sr(g,1,Qe,!0),le(b,2)):[];}),k0=xe(function(o,g){var b=Ur(g);return Qe(b)&&(b=t),Qe(o)?Bi(o,sr(g,1,Qe,!0),t,b):[];});function H0(o,g,b){var H=o==null?0:o.length;return H?(g=b||g===t?1:ye(g),Fr(o,g<0?0:g,H)):[];}function V0(o,g,b){var H=o==null?0:o.length;return H?(g=b||g===t?1:ye(g),g=H-g,Fr(o,0,g<0?0:g)):[];}function K0(o,g){return o&&o.length?Rs(o,le(g,3),!0,!0):[];}function Z0(o,g){return o&&o.length?Rs(o,le(g,3),!0):[];}function J0(o,g,b,H){var et=o==null?0:o.length;return et?(b&&typeof b!="number"&&dr(o,g,b)&&(b=0,H=et),$p(o,g,b,H)):[];}function cc(o,g,b){var H=o==null?0:o.length;if(!H)return-1;var et=b==null?0:ye(b);return et<0&&(et=er(H+et,0)),cs(o,le(g,3),et);}function uc(o,g,b){var H=o==null?0:o.length;if(!H)return-1;var et=H-1;return b!==t&&(et=ye(b),et=b<0?er(H+et,0):ar(et,H-1)),cs(o,le(g,3),et,!0);}function hc(o){var g=o==null?0:o.length;return g?sr(o,1):[];}function Q0(o){var g=o==null?0:o.length;return g?sr(o,tt):[];}function q0(o,g){var b=o==null?0:o.length;return b?(g=g===t?1:ye(g),sr(o,g)):[];}function _0(o){for(var g=-1,b=o==null?0:o.length,H={};++g<b;){var et=o[g];H[et[0]]=et[1];}return H;}function dc(o){return o&&o.length?o[0]:t;}function tv(o,g,b){var H=o==null?0:o.length;if(!H)return-1;var et=b==null?0:ye(b);return et<0&&(et=er(H+et,0)),qn(o,g,et);}function ev(o){var g=o==null?0:o.length;return g?Fr(o,0,-1):[];}var rv=xe(function(o){var g=ke(o,Oa);return g.length&&g[0]===o[0]?va(g):[];}),nv=xe(function(o){var g=Ur(o),b=ke(o,Oa);return g===Ur(b)?g=t:b.pop(),b.length&&b[0]===o[0]?va(b,le(g,2)):[];}),iv=xe(function(o){var g=Ur(o),b=ke(o,Oa);return g=typeof g=="function"?g:t,g&&b.pop(),b.length&&b[0]===o[0]?va(b,t,g):[];});function sv(o,g){return o==null?"":ep.call(o,g);}function Ur(o){var g=o==null?0:o.length;return g?o[g-1]:t;}function ov(o,g,b){var H=o==null?0:o.length;if(!H)return-1;var et=H;return b!==t&&(et=ye(b),et=et<0?er(H+et,0):ar(et,H-1)),g===g?Yd(o,g,et):cs(o,Hl,et,!0);}function av(o,g){return o&&o.length?If(o,ye(g)):t;}var lv=xe(pc);function pc(o,g){return o&&o.length&&g&&g.length?Sa(o,g):o;}function fv(o,g,b){return o&&o.length&&g&&g.length?Sa(o,g,le(b,2)):o;}function cv(o,g,b){return o&&o.length&&g&&g.length?Sa(o,g,t,b):o;}var uv=an(function(o,g){var b=o==null?0:o.length,H=ua(o,g);return Af(o,ke(g,function(et){return ln(et,b)?+et:et;}).sort(Ff)),H;});function hv(o,g){var b=[];if(!(o&&o.length))return b;var H=-1,et=[],lt=o.length;for(g=le(g,3);++H<lt;){var vt=o[H];g(vt,H,o)&&(b.push(vt),et.push(H));}return Af(o,et),b;}function Ya(o){return o==null?o:sp.call(o);}function dv(o,g,b){var H=o==null?0:o.length;return H?(b&&typeof b!="number"&&dr(o,g,b)?(g=0,b=H):(g=g==null?0:ye(g),b=b===t?H:ye(b)),Fr(o,g,b)):[];}function pv(o,g){return Ls(o,g);}function vv(o,g,b){return Ta(o,g,le(b,2));}function gv(o,g){var b=o==null?0:o.length;if(b){var H=Ls(o,g);if(H<b&&jr(o[H],g))return H;}return-1;}function mv(o,g){return Ls(o,g,!0);}function yv(o,g,b){return Ta(o,g,le(b,2),!0);}function Sv(o,g){var b=o==null?0:o.length;if(b){var H=Ls(o,g,!0)-1;if(jr(o[H],g))return H;}return-1;}function Pv(o){return o&&o.length?Mf(o):[];}function xv(o,g){return o&&o.length?Mf(o,le(g,2)):[];}function Tv(o){var g=o==null?0:o.length;return g?Fr(o,1,g):[];}function Cv(o,g,b){return o&&o.length?(g=b||g===t?1:ye(g),Fr(o,0,g<0?0:g)):[];}function Iv(o,g,b){var H=o==null?0:o.length;return H?(g=b||g===t?1:ye(g),g=H-g,Fr(o,g<0?0:g,H)):[];}function Ov(o,g){return o&&o.length?Rs(o,le(g,3),!1,!0):[];}function wv(o,g){return o&&o.length?Rs(o,le(g,3)):[];}var Av=xe(function(o){return Tn(sr(o,1,Qe,!0));}),Ev=xe(function(o){var g=Ur(o);return Qe(g)&&(g=t),Tn(sr(o,1,Qe,!0),le(g,2));}),Mv=xe(function(o){var g=Ur(o);return g=typeof g=="function"?g:t,Tn(sr(o,1,Qe,!0),t,g);});function Lv(o){return o&&o.length?Tn(o):[];}function Rv(o,g){return o&&o.length?Tn(o,le(g,2)):[];}function bv(o,g){return g=typeof g=="function"?g:t,o&&o.length?Tn(o,t,g):[];}function Xa(o){if(!(o&&o.length))return[];var g=0;return o=mn(o,function(b){if(Qe(b))return g=er(b.length,g),!0;}),na(g,function(b){return ke(o,ta(b));});}function vc(o,g){if(!(o&&o.length))return[];var b=Xa(o);return g==null?b:ke(b,function(H){return Cr(g,t,H);});}var Dv=xe(function(o,g){return Qe(o)?Bi(o,g):[];}),Nv=xe(function(o){return Ia(mn(o,Qe));}),Bv=xe(function(o){var g=Ur(o);return Qe(g)&&(g=t),Ia(mn(o,Qe),le(g,2));}),Wv=xe(function(o){var g=Ur(o);return g=typeof g=="function"?g:t,Ia(mn(o,Qe),t,g);}),Fv=xe(Xa);function Uv(o,g){return Df(o||[],g||[],Ni);}function Yv(o,g){return Df(o||[],g||[],Ui);}var Xv=xe(function(o){var g=o.length,b=g>1?o[g-1]:t;return b=typeof b=="function"?(o.pop(),b):t,vc(o,b);});function gc(o){var g=ot(o);return g.__chain__=!0,g;}function zv(o,g){return g(o),o;}function Xs(o,g){return g(o);}var $v=an(function(o){var g=o.length,b=g?o[0]:0,H=this.__wrapped__,et=function et(lt){return ua(lt,o);};return g>1||this.__actions__.length||!(H instanceof Ie)||!ln(b)?this.thru(et):(H=H.slice(b,+b+(g?1:0)),H.__actions__.push({func:Xs,args:[et],thisArg:t}),new Br(H,this.__chain__).thru(function(lt){return g&&!lt.length&<.push(t),lt;}));});function jv(){return gc(this);}function Gv(){return new Br(this.value(),this.__chain__);}function kv(){this.__values__===t&&(this.__values__=Lc(this.value()));var o=this.__index__>=this.__values__.length,g=o?t:this.__values__[this.__index__++];return{done:o,value:g};}function Hv(){return this;}function Vv(o){for(var g,b=this;b instanceof Os;){var H=fc(b);H.__index__=0,H.__values__=t,g?et.__wrapped__=H:g=H;var et=H;b=b.__wrapped__;}return et.__wrapped__=o,g;}function Kv(){var o=this.__wrapped__;if(o instanceof Ie){var g=o;return this.__actions__.length&&(g=new Ie(this)),g=g.reverse(),g.__actions__.push({func:Xs,args:[Ya],thisArg:t}),new Br(g,this.__chain__);}return this.thru(Ya);}function Zv(){return bf(this.__wrapped__,this.__actions__);}var Jv=bs(function(o,g,b){Ne.call(o,b)?++o[b]:sn(o,b,1);});function Qv(o,g,b){var H=de(o)?Gl:zp;return b&&dr(o,g,b)&&(g=t),H(o,le(g,3));}function qv(o,g){var b=de(o)?mn:vf;return b(o,le(g,3));}var _v=jf(cc),tg=jf(uc);function eg(o,g){return sr(zs(o,g),1);}function rg(o,g){return sr(zs(o,g),tt);}function ng(o,g,b){return b=b===t?1:ye(b),sr(zs(o,g),b);}function mc(o,g){var b=de(o)?Dr:xn;return b(o,le(g,3));}function yc(o,g){var b=de(o)?Td:pf;return b(o,le(g,3));}var ig=bs(function(o,g,b){Ne.call(o,b)?o[b].push(g):sn(o,b,[g]);});function sg(o,g,b,H){o=Sr(o)?o:ci(o),b=b&&!H?ye(b):0;var et=o.length;return b<0&&(b=er(et+b,0)),Hs(o)?b<=et&&o.indexOf(g,b)>-1:!!et&&qn(o,g,b)>-1;}var og=xe(function(o,g,b){var H=-1,et=typeof g=="function",lt=Sr(o)?Ft(o.length):[];return xn(o,function(vt){lt[++H]=et?Cr(g,vt,b):Wi(vt,g,b);}),lt;}),ag=bs(function(o,g,b){sn(o,b,g);});function zs(o,g){var b=de(o)?ke:xf;return b(o,le(g,3));}function lg(o,g,b,H){return o==null?[]:(de(g)||(g=g==null?[]:[g]),b=H?t:b,de(b)||(b=b==null?[]:[b]),Of(o,g,b));}var fg=bs(function(o,g,b){o[b?0:1].push(g);},function(){return[[],[]];});function cg(o,g,b){var H=de(o)?qo:Kl,et=arguments.length<3;return H(o,le(g,4),b,et,xn);}function ug(o,g,b){var H=de(o)?Cd:Kl,et=arguments.length<3;return H(o,le(g,4),b,et,pf);}function hg(o,g){var b=de(o)?mn:vf;return b(o,Gs(le(g,3)));}function dg(o){var g=de(o)?cf:s0;return g(o);}function pg(o,g,b){(b?dr(o,g,b):g===t)?g=1:g=ye(g);var H=de(o)?Wp:o0;return H(o,g);}function vg(o){var g=de(o)?Fp:l0;return g(o);}function gg(o){if(o==null)return 0;if(Sr(o))return Hs(o)?ti(o):o.length;var g=lr(o);return g==Z||g==ct?o.size:ma(o).length;}function mg(o,g,b){var H=de(o)?_o:f0;return b&&dr(o,g,b)&&(g=t),H(o,le(g,3));}var yg=xe(function(o,g){if(o==null)return[];var b=g.length;return b>1&&dr(o,g[0],g[1])?g=[]:b>2&&dr(g[0],g[1],g[2])&&(g=[g[0]]),Of(o,sr(g,1),[]);}),$s=qd||function(){return ir.Date.now();};function Sg(o,g){if(typeof g!="function")throw new Nr(c);return o=ye(o),function(){if(--o<1)return g.apply(this,arguments);};}function Sc(o,g,b){return g=b?t:g,g=o&&g==null?o.length:g,on(o,R,t,t,t,t,g);}function Pc(o,g){var b;if(typeof g!="function")throw new Nr(c);return o=ye(o),function(){return--o>0&&(b=g.apply(this,arguments)),o<=1&&(g=t),b;};}var za=xe(function(o,g,b){var H=S;if(b.length){var et=Sn(b,li(za));H|=x;}return on(o,H,g,b,et);}),xc=xe(function(o,g,b){var H=S|O;if(b.length){var et=Sn(b,li(xc));H|=x;}return on(g,H,o,b,et);});function Tc(o,g,b){g=b?t:g;var H=on(o,v,t,t,t,t,t,g);return H.placeholder=Tc.placeholder,H;}function Cc(o,g,b){g=b?t:g;var H=on(o,p,t,t,t,t,t,g);return H.placeholder=Cc.placeholder,H;}function Ic(o,g,b){var H,et,lt,vt,It,Rt,Gt=0,kt=!1,Vt=!1,_t=!0;if(typeof o!="function")throw new Nr(c);g=Yr(g)||0,Ke(b)&&(kt=!!b.leading,Vt="maxWait"in b,lt=Vt?er(Yr(b.maxWait)||0,g):lt,_t="trailing"in b?!!b.trailing:_t);function re(qe){var Gr=H,un=et;return H=et=t,Gt=qe,vt=o.apply(un,Gr),vt;}function fe(qe){return Gt=qe,It=zi(Te,g),kt?re(qe):vt;}function Pe(qe){var Gr=qe-Rt,un=qe-Gt,jc=g-Gr;return Vt?ar(jc,lt-un):jc;}function ce(qe){var Gr=qe-Rt,un=qe-Gt;return Rt===t||Gr>=g||Gr<0||Vt&&un>=lt;}function Te(){var qe=$s();if(ce(qe))return we(qe);It=zi(Te,Pe(qe));}function we(qe){return It=t,_t&&H?re(qe):(H=et=t,vt);}function Ar(){It!==t&&Nf(It),Gt=0,H=Rt=et=It=t;}function pr(){return It===t?vt:we($s());}function Er(){var qe=$s(),Gr=ce(qe);if(H=arguments,et=this,Rt=qe,Gr){if(It===t)return fe(Rt);if(Vt)return Nf(It),It=zi(Te,g),re(Rt);}return It===t&&(It=zi(Te,g)),vt;}return Er.cancel=Ar,Er.flush=pr,Er;}var Pg=xe(function(o,g){return df(o,1,g);}),xg=xe(function(o,g,b){return df(o,Yr(g)||0,b);});function Tg(o){return on(o,U);}function js(o,g){if(typeof o!="function"||g!=null&&typeof g!="function")throw new Nr(c);var _b=function b(){var H=arguments,et=g?g.apply(this,H):H[0],lt=_b.cache;if(lt.has(et))return lt.get(et);var vt=o.apply(this,H);return _b.cache=lt.set(et,vt)||lt,vt;};return _b.cache=new(js.Cache||nn)(),_b;}js.Cache=nn;function Gs(o){if(typeof o!="function")throw new Nr(c);return function(){var g=arguments;switch(g.length){case 0:return!o.call(this);case 1:return!o.call(this,g[0]);case 2:return!o.call(this,g[0],g[1]);case 3:return!o.call(this,g[0],g[1],g[2]);}return!o.apply(this,g);};}function Cg(o){return Pc(2,o);}var Ig=c0(function(o,g){g=g.length==1&&de(g[0])?ke(g[0],Ir(le())):ke(sr(g,1),Ir(le()));var b=g.length;return xe(function(H){for(var et=-1,lt=ar(H.length,b);++et<lt;)H[et]=g[et].call(this,H[et]);return Cr(o,this,H);});}),$a=xe(function(o,g){var b=Sn(g,li($a));return on(o,x,t,g,b);}),Oc=xe(function(o,g){var b=Sn(g,li(Oc));return on(o,E,t,g,b);}),Og=an(function(o,g){return on(o,D,t,t,t,g);});function wg(o,g){if(typeof o!="function")throw new Nr(c);return g=g===t?g:ye(g),xe(o,g);}function Ag(o,g){if(typeof o!="function")throw new Nr(c);return g=g==null?0:er(ye(g),0),xe(function(b){var H=b[g],et=In(b,0,g);return H&&yn(et,H),Cr(o,this,et);});}function Eg(o,g,b){var H=!0,et=!0;if(typeof o!="function")throw new Nr(c);return Ke(b)&&(H="leading"in b?!!b.leading:H,et="trailing"in b?!!b.trailing:et),Ic(o,g,{leading:H,maxWait:g,trailing:et});}function Mg(o){return Sc(o,1);}function Lg(o,g){return $a(wa(g),o);}function Rg(){if(!arguments.length)return[];var o=arguments[0];return de(o)?o:[o];}function bg(o){return Wr(o,T);}function Dg(o,g){return g=typeof g=="function"?g:t,Wr(o,T,g);}function Ng(o){return Wr(o,u|T);}function Bg(o,g){return g=typeof g=="function"?g:t,Wr(o,u|T,g);}function Wg(o,g){return g==null||hf(o,g,rr(g));}function jr(o,g){return o===g||o!==o&&g!==g;}var Fg=Ws(pa),Ug=Ws(function(o,g){return o>=g;}),Xn=yf(/* @__PURE__ */function(){return arguments;}())?yf:function(o){return Ze(o)&&Ne.call(o,"callee")&&!nf.call(o,"callee");},de=Ft.isArray,Yg=Ul?Ir(Ul):Vp;function Sr(o){return o!=null&&ks(o.length)&&!fn(o);}function Qe(o){return Ze(o)&&Sr(o);}function Xg(o){return o===!0||o===!1||Ze(o)&&hr(o)==Dt;}var On=tp||_a,zg=Yl?Ir(Yl):Kp;function $g(o){return Ze(o)&&o.nodeType===1&&!$i(o);}function jg(o){if(o==null)return!0;if(Sr(o)&&(de(o)||typeof o=="string"||typeof o.splice=="function"||On(o)||fi(o)||Xn(o)))return!o.length;var g=lr(o);if(g==Z||g==ct)return!o.size;if(Xi(o))return!ma(o).length;for(var b in o)if(Ne.call(o,b))return!1;return!0;}function Gg(o,g){return Fi(o,g);}function kg(o,g,b){b=typeof b=="function"?b:t;var H=b?b(o,g):t;return H===t?Fi(o,g,t,b):!!H;}function ja(o){if(!Ze(o))return!1;var g=hr(o);return g==rt||g==k||typeof o.message=="string"&&typeof o.name=="string"&&!$i(o);}function Hg(o){return typeof o=="number"&&of(o);}function fn(o){if(!Ke(o))return!1;var g=hr(o);return g==nt||g==Y||g==Nt||g==q;}function wc(o){return typeof o=="number"&&o==ye(o);}function ks(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=at;}function Ke(o){var g=_typeof(o);return o!=null&&(g=="object"||g=="function");}function Ze(o){return o!=null&&_typeof(o)=="object";}var Ac=Xl?Ir(Xl):Jp;function Vg(o,g){return o===g||ga(o,g,Da(g));}function Kg(o,g,b){return b=typeof b=="function"?b:t,ga(o,g,Da(g),b);}function Zg(o){return Ec(o)&&o!=+o;}function Jg(o){if(D0(o))throw new he(s);return Sf(o);}function Qg(o){return o===null;}function qg(o){return o==null;}function Ec(o){return typeof o=="number"||Ze(o)&&hr(o)==C;}function $i(o){if(!Ze(o)||hr(o)!=z)return!1;var g=ys(o);if(g===null)return!0;var b=Ne.call(g,"constructor")&&g.constructor;return typeof b=="function"&&b instanceof b&&ps.call(b)==Kd;}var Ga=zl?Ir(zl):Qp;function _g(o){return wc(o)&&o>=-at&&o<=at;}var Mc=$l?Ir($l):qp;function Hs(o){return typeof o=="string"||!de(o)&&Ze(o)&&hr(o)==xt;}function wr(o){return _typeof(o)=="symbol"||Ze(o)&&hr(o)==Ct;}var fi=jl?Ir(jl):_p;function tm(o){return o===t;}function em(o){return Ze(o)&&lr(o)==bt;}function rm(o){return Ze(o)&&hr(o)==At;}var nm=Ws(ya),im=Ws(function(o,g){return o<=g;});function Lc(o){if(!o)return[];if(Sr(o))return Hs(o)?zr(o):yr(o);if(Mi&&o[Mi])return Wd(o[Mi]());var g=lr(o),b=g==Z?sa:g==ct?us:ci;return b(o);}function cn(o){if(!o)return o===0?o:0;if(o=Yr(o),o===tt||o===-tt){var g=o<0?-1:1;return g*ut;}return o===o?o:0;}function ye(o){var g=cn(o),b=g%1;return g===g?b?g-b:g:0;}function Rc(o){return o?Wn(ye(o),0,Q):0;}function Yr(o){if(typeof o=="number")return o;if(wr(o))return V;if(Ke(o)){var g=typeof o.valueOf=="function"?o.valueOf():o;o=Ke(g)?g+"":g;}if(typeof o!="string")return o===0?o:+o;o=Zl(o);var b=es.test(o);return b||Wo.test(o)?Sd(o.slice(2),b?2:8):Rn.test(o)?V:+o;}function bc(o){return Kr(o,Pr(o));}function sm(o){return o?Wn(ye(o),-at,at):o===0?o:0;}function Le(o){return o==null?"":Or(o);}var om=oi(function(o,g){if(Xi(g)||Sr(g)){Kr(g,rr(g),o);return;}for(var b in g)Ne.call(g,b)&&Ni(o,b,g[b]);}),Dc=oi(function(o,g){Kr(g,Pr(g),o);}),Vs=oi(function(o,g,b,H){Kr(g,Pr(g),o,H);}),am=oi(function(o,g,b,H){Kr(g,rr(g),o,H);}),lm=an(ua);function fm(o,g){var b=si(o);return g==null?b:uf(b,g);}var cm=xe(function(o,g){o=Be(o);var b=-1,H=g.length,et=H>2?g[2]:t;for(et&&dr(g[0],g[1],et)&&(H=1);++b<H;)for(var lt=g[b],vt=Pr(lt),It=-1,Rt=vt.length;++It<Rt;){var Gt=vt[It],kt=o[Gt];(kt===t||jr(kt,ri[Gt])&&!Ne.call(o,Gt))&&(o[Gt]=lt[Gt]);}return o;}),um=xe(function(o){return o.push(t,Jf),Cr(Nc,t,o);});function hm(o,g){return kl(o,le(g,3),Vr);}function dm(o,g){return kl(o,le(g,3),da);}function pm(o,g){return o==null?o:ha(o,le(g,3),Pr);}function vm(o,g){return o==null?o:gf(o,le(g,3),Pr);}function gm(o,g){return o&&Vr(o,le(g,3));}function mm(o,g){return o&&da(o,le(g,3));}function ym(o){return o==null?[]:Es(o,rr(o));}function Sm(o){return o==null?[]:Es(o,Pr(o));}function ka(o,g,b){var H=o==null?t:Fn(o,g);return H===t?b:H;}function Pm(o,g){return o!=null&&_f(o,g,jp);}function Ha(o,g){return o!=null&&_f(o,g,Gp);}var xm=kf(function(o,g,b){g!=null&&typeof g.toString!="function"&&(g=vs.call(g)),o[g]=b;},Ka(xr)),Tm=kf(function(o,g,b){g!=null&&typeof g.toString!="function"&&(g=vs.call(g)),Ne.call(o,g)?o[g].push(b):o[g]=[b];},le),Cm=xe(Wi);function rr(o){return Sr(o)?ff(o):ma(o);}function Pr(o){return Sr(o)?ff(o,!0):t0(o);}function Im(o,g){var b={};return g=le(g,3),Vr(o,function(H,et,lt){sn(b,g(H,et,lt),H);}),b;}function Om(o,g){var b={};return g=le(g,3),Vr(o,function(H,et,lt){sn(b,et,g(H,et,lt));}),b;}var wm=oi(function(o,g,b){Ms(o,g,b);}),Nc=oi(function(o,g,b,H){Ms(o,g,b,H);}),Am=an(function(o,g){var b={};if(o==null)return b;var H=!1;g=ke(g,function(lt){return lt=Cn(lt,o),H||(H=lt.length>1),lt;}),Kr(o,Ra(o),b),H&&(b=Wr(b,u|y|T,x0));for(var et=g.length;et--;)Ca(b,g[et]);return b;});function Em(o,g){return Bc(o,Gs(le(g)));}var Mm=an(function(o,g){return o==null?{}:r0(o,g);});function Bc(o,g){if(o==null)return{};var b=ke(Ra(o),function(H){return[H];});return g=le(g),wf(o,b,function(H,et){return g(H,et[0]);});}function Lm(o,g,b){g=Cn(g,o);var H=-1,et=g.length;for(et||(et=1,o=t);++H<et;){var lt=o==null?t:o[Zr(g[H])];lt===t&&(H=et,lt=b),o=fn(lt)?lt.call(o):lt;}return o;}function Rm(o,g,b){return o==null?o:Ui(o,g,b);}function bm(o,g,b,H){return H=typeof H=="function"?H:t,o==null?o:Ui(o,g,b,H);}var Wc=Kf(rr),Fc=Kf(Pr);function Dm(o,g,b){var H=de(o),et=H||On(o)||fi(o);if(g=le(g,4),b==null){var lt=o&&o.constructor;et?b=H?new lt():[]:Ke(o)?b=fn(lt)?si(ys(o)):{}:b={};}return(et?Dr:Vr)(o,function(vt,It,Rt){return g(b,vt,It,Rt);}),b;}function Nm(o,g){return o==null?!0:Ca(o,g);}function Bm(o,g,b){return o==null?o:Rf(o,g,wa(b));}function Wm(o,g,b,H){return H=typeof H=="function"?H:t,o==null?o:Rf(o,g,wa(b),H);}function ci(o){return o==null?[]:ia(o,rr(o));}function Fm(o){return o==null?[]:ia(o,Pr(o));}function Um(o,g,b){return b===t&&(b=g,g=t),b!==t&&(b=Yr(b),b=b===b?b:0),g!==t&&(g=Yr(g),g=g===g?g:0),Wn(Yr(o),g,b);}function Ym(o,g,b){return g=cn(g),b===t?(b=g,g=0):b=cn(b),o=Yr(o),kp(o,g,b);}function Xm(o,g,b){if(b&&typeof b!="boolean"&&dr(o,g,b)&&(g=b=t),b===t&&(typeof g=="boolean"?(b=g,g=t):typeof o=="boolean"&&(b=o,o=t)),o===t&&g===t?(o=0,g=1):(o=cn(o),g===t?(g=o,o=0):g=cn(g)),o>g){var H=o;o=g,g=H;}if(b||o%1||g%1){var et=af();return ar(o+et*(g-o+yd("1e-"+((et+"").length-1))),g);}return Pa(o,g);}var zm=ai(function(o,g,b){return g=g.toLowerCase(),o+(b?Uc(g):g);});function Uc(o){return Va(Le(o).toLowerCase());}function Yc(o){return o=Le(o),o&&o.replace(Uo,Rd).replace(ld,"");}function $m(o,g,b){o=Le(o),g=Or(g);var H=o.length;b=b===t?H:Wn(ye(b),0,H);var et=b;return b-=g.length,b>=0&&o.slice(b,et)==g;}function jm(o){return o=Le(o),o&&Je.test(o)?o.replace(Ge,bd):o;}function Gm(o){return o=Le(o),o&&wo.test(o)?o.replace(wi,"\\$&"):o;}var km=ai(function(o,g,b){return o+(b?"-":"")+g.toLowerCase();}),Hm=ai(function(o,g,b){return o+(b?" ":"")+g.toLowerCase();}),Vm=$f("toLowerCase");function Km(o,g,b){o=Le(o),g=ye(g);var H=g?ti(o):0;if(!g||H>=g)return o;var et=(g-H)/2;return Bs(Ts(et),b)+o+Bs(xs(et),b);}function Zm(o,g,b){o=Le(o),g=ye(g);var H=g?ti(o):0;return g&&H<g?o+Bs(g-H,b):o;}function Jm(o,g,b){o=Le(o),g=ye(g);var H=g?ti(o):0;return g&&H<g?Bs(g-H,b)+o:o;}function Qm(o,g,b){return b||g==null?g=0:g&&(g=+g),ip(Le(o).replace(Ai,""),g||0);}function qm(o,g,b){return(b?dr(o,g,b):g===t)?g=1:g=ye(g),xa(Le(o),g);}function _m(){var o=arguments,g=Le(o[0]);return o.length<3?g:g.replace(o[1],o[2]);}var ty=ai(function(o,g,b){return o+(b?"_":"")+g.toLowerCase();});function ey(o,g,b){return b&&typeof b!="number"&&dr(o,g,b)&&(g=b=t),b=b===t?Q:b>>>0,b?(o=Le(o),o&&(typeof g=="string"||g!=null&&!Ga(g))&&(g=Or(g),!g&&_n(o))?In(zr(o),0,b):o.split(g,b)):[];}var ry=ai(function(o,g,b){return o+(b?" ":"")+Va(g);});function ny(o,g,b){return o=Le(o),b=b==null?0:Wn(ye(b),0,o.length),g=Or(g),o.slice(b,b+g.length)==g;}function iy(o,g,b){var H=ot.templateSettings;b&&dr(o,g,b)&&(g=t),o=Le(o),g=Vs({},g,H,Zf);var et=Vs({},g.imports,H.imports,Zf),lt=rr(et),vt=ia(et,lt),It,Rt,Gt=0,kt=g.interpolate||Kn,Vt="__p += '",_t=oa((g.escape||Kn).source+"|"+kt.source+"|"+(kt===Hr?No:Kn).source+"|"+(g.evaluate||Kn).source+"|$","g"),re="//# sourceURL="+(Ne.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++dd+"]")+"\n";o.replace(_t,function(ce,Te,we,Ar,pr,Er){return we||(we=Ar),Vt+=o.slice(Gt,Er).replace(vn,Dd),Te&&(It=!0,Vt+="' +\n__e("+Te+") +\n'"),pr&&(Rt=!0,Vt+="';\n"+pr+";\n__p += '"),we&&(Vt+="' +\n((__t = ("+we+")) == null ? '' : __t) +\n'"),Gt=Er+ce.length,ce;}),Vt+="';\n";var fe=Ne.call(g,"variable")&&g.variable;if(!fe)Vt="with (obj) {\n"+Vt+"\n}\n";else if(bo.test(fe))throw new he(l);Vt=(Rt?Vt.replace(je,""):Vt).replace(We,"$1").replace(Xe,"$1;"),Vt="function("+(fe||"obj")+") {\n"+(fe?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(It?", __e = _.escape":"")+(Rt?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+Vt+"return __p\n}";var Pe=zc(function(){return Ee(lt,re+"return "+Vt).apply(t,vt);});if(Pe.source=Vt,ja(Pe))throw Pe;return Pe;}function sy(o){return Le(o).toLowerCase();}function oy(o){return Le(o).toUpperCase();}function ay(o,g,b){if(o=Le(o),o&&(b||g===t))return Zl(o);if(!o||!(g=Or(g)))return o;var H=zr(o),et=zr(g),lt=Jl(H,et),vt=Ql(H,et)+1;return In(H,lt,vt).join("");}function ly(o,g,b){if(o=Le(o),o&&(b||g===t))return o.slice(0,_l(o)+1);if(!o||!(g=Or(g)))return o;var H=zr(o),et=Ql(H,zr(g))+1;return In(H,0,et).join("");}function fy(o,g,b){if(o=Le(o),o&&(b||g===t))return o.replace(Ai,"");if(!o||!(g=Or(g)))return o;var H=zr(o),et=Jl(H,zr(g));return In(H,et).join("");}function cy(o,g){var b=M,H=W;if(Ke(g)){var et="separator"in g?g.separator:et;b="length"in g?ye(g.length):b,H="omission"in g?Or(g.omission):H;}o=Le(o);var lt=o.length;if(_n(o)){var vt=zr(o);lt=vt.length;}if(b>=lt)return o;var It=b-ti(H);if(It<1)return H;var Rt=vt?In(vt,0,It).join(""):o.slice(0,It);if(et===t)return Rt+H;if(vt&&(It+=Rt.length-It),Ga(et)){if(o.slice(It).search(et)){var Gt,kt=Rt;for(et.global||(et=oa(et.source,Le(ts.exec(et))+"g")),et.lastIndex=0;Gt=et.exec(kt);)var Vt=Gt.index;Rt=Rt.slice(0,Vt===t?It:Vt);}}else if(o.indexOf(Or(et),It)!=It){var _t=Rt.lastIndexOf(et);_t>-1&&(Rt=Rt.slice(0,_t));}return Rt+H;}function uy(o){return o=Le(o),o&&Ve.test(o)?o.replace(Fe,Xd):o;}var hy=ai(function(o,g,b){return o+(b?" ":"")+g.toUpperCase();}),Va=$f("toUpperCase");function Xc(o,g,b){return o=Le(o),g=b?t:g,g===t?Bd(o)?jd(o):wd(o):o.match(g)||[];}var zc=xe(function(o,g){try{return Cr(o,t,g);}catch(b){return ja(b)?b:new he(b);}}),dy=an(function(o,g){return Dr(g,function(b){b=Zr(b),sn(o,b,za(o[b],o));}),o;});function py(o){var g=o==null?0:o.length,b=le();return o=g?ke(o,function(H){if(typeof H[1]!="function")throw new Nr(c);return[b(H[0]),H[1]];}):[],xe(function(H){for(var et=-1;++et<g;){var lt=o[et];if(Cr(lt[0],this,H))return Cr(lt[1],this,H);}});}function vy(o){return Xp(Wr(o,u));}function Ka(o){return function(){return o;};}function gy(o,g){return o==null||o!==o?g:o;}var my=Gf(),yy=Gf(!0);function xr(o){return o;}function Za(o){return Pf(typeof o=="function"?o:Wr(o,u));}function Sy(o){return Tf(Wr(o,u));}function Py(o,g){return Cf(o,Wr(g,u));}var xy=xe(function(o,g){return function(b){return Wi(b,o,g);};}),Ty=xe(function(o,g){return function(b){return Wi(o,b,g);};});function Ja(o,g,b){var H=rr(g),et=Es(g,H);b==null&&!(Ke(g)&&(et.length||!H.length))&&(b=g,g=o,o=this,et=Es(g,rr(g)));var lt=!(Ke(b)&&"chain"in b)||!!b.chain,vt=fn(o);return Dr(et,function(It){var Rt=g[It];o[It]=Rt,vt&&(o.prototype[It]=function(){var Gt=this.__chain__;if(lt||Gt){var kt=o(this.__wrapped__),Vt=kt.__actions__=yr(this.__actions__);return Vt.push({func:Rt,args:arguments,thisArg:o}),kt.__chain__=Gt,kt;}return Rt.apply(o,yn([this.value()],arguments));});}),o;}function Cy(){return ir._===this&&(ir._=Zd),this;}function Qa(){}function Iy(o){return o=ye(o),xe(function(g){return If(g,o);});}var Oy=Ea(ke),wy=Ea(Gl),Ay=Ea(_o);function $c(o){return Ba(o)?ta(Zr(o)):n0(o);}function Ey(o){return function(g){return o==null?t:Fn(o,g);};}var My=Hf(),Ly=Hf(!0);function qa(){return[];}function _a(){return!1;}function Ry(){return{};}function by(){return"";}function Dy(){return!0;}function Ny(o,g){if(o=ye(o),o<1||o>at)return[];var b=Q,H=ar(o,Q);g=le(g),o-=Q;for(var et=na(H,g);++b<o;)g(b);return et;}function By(o){return de(o)?ke(o,Zr):wr(o)?[o]:yr(lc(Le(o)));}function Wy(o){var g=++Vd;return Le(o)+g;}var Fy=Ns(function(o,g){return o+g;},0),Uy=Ma("ceil"),Yy=Ns(function(o,g){return o/g;},1),Xy=Ma("floor");function zy(o){return o&&o.length?As(o,xr,pa):t;}function $y(o,g){return o&&o.length?As(o,le(g,2),pa):t;}function jy(o){return Vl(o,xr);}function Gy(o,g){return Vl(o,le(g,2));}function ky(o){return o&&o.length?As(o,xr,ya):t;}function Hy(o,g){return o&&o.length?As(o,le(g,2),ya):t;}var Vy=Ns(function(o,g){return o*g;},1),Ky=Ma("round"),Zy=Ns(function(o,g){return o-g;},0);function Jy(o){return o&&o.length?ra(o,xr):0;}function Qy(o,g){return o&&o.length?ra(o,le(g,2)):0;}return ot.after=Sg,ot.ary=Sc,ot.assign=om,ot.assignIn=Dc,ot.assignInWith=Vs,ot.assignWith=am,ot.at=lm,ot.before=Pc,ot.bind=za,ot.bindAll=dy,ot.bindKey=xc,ot.castArray=Rg,ot.chain=gc,ot.chunk=X0,ot.compact=z0,ot.concat=$0,ot.cond=py,ot.conforms=vy,ot.constant=Ka,ot.countBy=Jv,ot.create=fm,ot.curry=Tc,ot.curryRight=Cc,ot.debounce=Ic,ot.defaults=cm,ot.defaultsDeep=um,ot.defer=Pg,ot.delay=xg,ot.difference=j0,ot.differenceBy=G0,ot.differenceWith=k0,ot.drop=H0,ot.dropRight=V0,ot.dropRightWhile=K0,ot.dropWhile=Z0,ot.fill=J0,ot.filter=qv,ot.flatMap=eg,ot.flatMapDeep=rg,ot.flatMapDepth=ng,ot.flatten=hc,ot.flattenDeep=Q0,ot.flattenDepth=q0,ot.flip=Tg,ot.flow=my,ot.flowRight=yy,ot.fromPairs=_0,ot.functions=ym,ot.functionsIn=Sm,ot.groupBy=ig,ot.initial=ev,ot.intersection=rv,ot.intersectionBy=nv,ot.intersectionWith=iv,ot.invert=xm,ot.invertBy=Tm,ot.invokeMap=og,ot.iteratee=Za,ot.keyBy=ag,ot.keys=rr,ot.keysIn=Pr,ot.map=zs,ot.mapKeys=Im,ot.mapValues=Om,ot.matches=Sy,ot.matchesProperty=Py,ot.memoize=js,ot.merge=wm,ot.mergeWith=Nc,ot.method=xy,ot.methodOf=Ty,ot.mixin=Ja,ot.negate=Gs,ot.nthArg=Iy,ot.omit=Am,ot.omitBy=Em,ot.once=Cg,ot.orderBy=lg,ot.over=Oy,ot.overArgs=Ig,ot.overEvery=wy,ot.overSome=Ay,ot.partial=$a,ot.partialRight=Oc,ot.partition=fg,ot.pick=Mm,ot.pickBy=Bc,ot.property=$c,ot.propertyOf=Ey,ot.pull=lv,ot.pullAll=pc,ot.pullAllBy=fv,ot.pullAllWith=cv,ot.pullAt=uv,ot.range=My,ot.rangeRight=Ly,ot.rearg=Og,ot.reject=hg,ot.remove=hv,ot.rest=wg,ot.reverse=Ya,ot.sampleSize=pg,ot.set=Rm,ot.setWith=bm,ot.shuffle=vg,ot.slice=dv,ot.sortBy=yg,ot.sortedUniq=Pv,ot.sortedUniqBy=xv,ot.split=ey,ot.spread=Ag,ot.tail=Tv,ot.take=Cv,ot.takeRight=Iv,ot.takeRightWhile=Ov,ot.takeWhile=wv,ot.tap=zv,ot.throttle=Eg,ot.thru=Xs,ot.toArray=Lc,ot.toPairs=Wc,ot.toPairsIn=Fc,ot.toPath=By,ot.toPlainObject=bc,ot.transform=Dm,ot.unary=Mg,ot.union=Av,ot.unionBy=Ev,ot.unionWith=Mv,ot.uniq=Lv,ot.uniqBy=Rv,ot.uniqWith=bv,ot.unset=Nm,ot.unzip=Xa,ot.unzipWith=vc,ot.update=Bm,ot.updateWith=Wm,ot.values=ci,ot.valuesIn=Fm,ot.without=Dv,ot.words=Xc,ot.wrap=Lg,ot.xor=Nv,ot.xorBy=Bv,ot.xorWith=Wv,ot.zip=Fv,ot.zipObject=Uv,ot.zipObjectDeep=Yv,ot.zipWith=Xv,ot.entries=Wc,ot.entriesIn=Fc,ot.extend=Dc,ot.extendWith=Vs,Ja(ot,ot),ot.add=Fy,ot.attempt=zc,ot.camelCase=zm,ot.capitalize=Uc,ot.ceil=Uy,ot.clamp=Um,ot.clone=bg,ot.cloneDeep=Ng,ot.cloneDeepWith=Bg,ot.cloneWith=Dg,ot.conformsTo=Wg,ot.deburr=Yc,ot.defaultTo=gy,ot.divide=Yy,ot.endsWith=$m,ot.eq=jr,ot.escape=jm,ot.escapeRegExp=Gm,ot.every=Qv,ot.find=_v,ot.findIndex=cc,ot.findKey=hm,ot.findLast=tg,ot.findLastIndex=uc,ot.findLastKey=dm,ot.floor=Xy,ot.forEach=mc,ot.forEachRight=yc,ot.forIn=pm,ot.forInRight=vm,ot.forOwn=gm,ot.forOwnRight=mm,ot.get=ka,ot.gt=Fg,ot.gte=Ug,ot.has=Pm,ot.hasIn=Ha,ot.head=dc,ot.identity=xr,ot.includes=sg,ot.indexOf=tv,ot.inRange=Ym,ot.invoke=Cm,ot.isArguments=Xn,ot.isArray=de,ot.isArrayBuffer=Yg,ot.isArrayLike=Sr,ot.isArrayLikeObject=Qe,ot.isBoolean=Xg,ot.isBuffer=On,ot.isDate=zg,ot.isElement=$g,ot.isEmpty=jg,ot.isEqual=Gg,ot.isEqualWith=kg,ot.isError=ja,ot.isFinite=Hg,ot.isFunction=fn,ot.isInteger=wc,ot.isLength=ks,ot.isMap=Ac,ot.isMatch=Vg,ot.isMatchWith=Kg,ot.isNaN=Zg,ot.isNative=Jg,ot.isNil=qg,ot.isNull=Qg,ot.isNumber=Ec,ot.isObject=Ke,ot.isObjectLike=Ze,ot.isPlainObject=$i,ot.isRegExp=Ga,ot.isSafeInteger=_g,ot.isSet=Mc,ot.isString=Hs,ot.isSymbol=wr,ot.isTypedArray=fi,ot.isUndefined=tm,ot.isWeakMap=em,ot.isWeakSet=rm,ot.join=sv,ot.kebabCase=km,ot.last=Ur,ot.lastIndexOf=ov,ot.lowerCase=Hm,ot.lowerFirst=Vm,ot.lt=nm,ot.lte=im,ot.max=zy,ot.maxBy=$y,ot.mean=jy,ot.meanBy=Gy,ot.min=ky,ot.minBy=Hy,ot.stubArray=qa,ot.stubFalse=_a,ot.stubObject=Ry,ot.stubString=by,ot.stubTrue=Dy,ot.multiply=Vy,ot.nth=av,ot.noConflict=Cy,ot.noop=Qa,ot.now=$s,ot.pad=Km,ot.padEnd=Zm,ot.padStart=Jm,ot.parseInt=Qm,ot.random=Xm,ot.reduce=cg,ot.reduceRight=ug,ot.repeat=qm,ot.replace=_m,ot.result=Lm,ot.round=Ky,ot.runInContext=Et,ot.sample=dg,ot.size=gg,ot.snakeCase=ty,ot.some=mg,ot.sortedIndex=pv,ot.sortedIndexBy=vv,ot.sortedIndexOf=gv,ot.sortedLastIndex=mv,ot.sortedLastIndexBy=yv,ot.sortedLastIndexOf=Sv,ot.startCase=ry,ot.startsWith=ny,ot.subtract=Zy,ot.sum=Jy,ot.sumBy=Qy,ot.template=iy,ot.times=Ny,ot.toFinite=cn,ot.toInteger=ye,ot.toLength=Rc,ot.toLower=sy,ot.toNumber=Yr,ot.toSafeInteger=sm,ot.toString=Le,ot.toUpper=oy,ot.trim=ay,ot.trimEnd=ly,ot.trimStart=fy,ot.truncate=cy,ot.unescape=uy,ot.uniqueId=Wy,ot.upperCase=hy,ot.upperFirst=Va,ot.each=mc,ot.eachRight=yc,ot.first=dc,Ja(ot,function(){var o={};return Vr(ot,function(g,b){Ne.call(ot.prototype,b)||(o[b]=g);}),o;}(),{chain:!1}),ot.VERSION=r,Dr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){ot[o].placeholder=ot;}),Dr(["drop","take"],function(o,g){Ie.prototype[o]=function(b){b=b===t?1:er(ye(b),0);var H=this.__filtered__&&!g?new Ie(this):this.clone();return H.__filtered__?H.__takeCount__=ar(b,H.__takeCount__):H.__views__.push({size:ar(b,Q),type:o+(H.__dir__<0?"Right":"")}),H;},Ie.prototype[o+"Right"]=function(b){return this.reverse()[o](b).reverse();};}),Dr(["filter","map","takeWhile"],function(o,g){var b=g+1,H=b==N||b==J;Ie.prototype[o]=function(et){var lt=this.clone();return lt.__iteratees__.push({iteratee:le(et,3),type:b}),lt.__filtered__=lt.__filtered__||H,lt;};}),Dr(["head","last"],function(o,g){var b="take"+(g?"Right":"");Ie.prototype[o]=function(){return this[b](1).value()[0];};}),Dr(["initial","tail"],function(o,g){var b="drop"+(g?"":"Right");Ie.prototype[o]=function(){return this.__filtered__?new Ie(this):this[b](1);};}),Ie.prototype.compact=function(){return this.filter(xr);},Ie.prototype.find=function(o){return this.filter(o).head();},Ie.prototype.findLast=function(o){return this.reverse().find(o);},Ie.prototype.invokeMap=xe(function(o,g){return typeof o=="function"?new Ie(this):this.map(function(b){return Wi(b,o,g);});}),Ie.prototype.reject=function(o){return this.filter(Gs(le(o)));},Ie.prototype.slice=function(o,g){o=ye(o);var b=this;return b.__filtered__&&(o>0||g<0)?new Ie(b):(o<0?b=b.takeRight(-o):o&&(b=b.drop(o)),g!==t&&(g=ye(g),b=g<0?b.dropRight(-g):b.take(g-o)),b);},Ie.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse();},Ie.prototype.toArray=function(){return this.take(Q);},Vr(Ie.prototype,function(o,g){var b=/^(?:filter|find|map|reject)|While$/.test(g),H=/^(?:head|last)$/.test(g),et=ot[H?"take"+(g=="last"?"Right":""):g],lt=H||/^find/.test(g);et&&(ot.prototype[g]=function(){var vt=this.__wrapped__,It=H?[1]:arguments,Rt=vt instanceof Ie,Gt=It[0],kt=Rt||de(vt),Vt=function Vt(Te){var we=et.apply(ot,yn([Te],It));return H&&_t?we[0]:we;};kt&&b&&typeof Gt=="function"&&Gt.length!=1&&(Rt=kt=!1);var _t=this.__chain__,re=!!this.__actions__.length,fe=lt&&!_t,Pe=Rt&&!re;if(!lt&&kt){vt=Pe?vt:new Ie(this);var ce=o.apply(vt,It);return ce.__actions__.push({func:Xs,args:[Vt],thisArg:t}),new Br(ce,_t);}return fe&&Pe?o.apply(this,It):(ce=this.thru(Vt),fe?H?ce.value()[0]:ce.value():ce);});}),Dr(["pop","push","shift","sort","splice","unshift"],function(o){var g=hs[o],b=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",H=/^(?:pop|shift)$/.test(o);ot.prototype[o]=function(){var et=arguments;if(H&&!this.__chain__){var lt=this.value();return g.apply(de(lt)?lt:[],et);}return this[b](function(vt){return g.apply(de(vt)?vt:[],et);});};}),Vr(Ie.prototype,function(o,g){var b=ot[g];if(b){var H=b.name+"";Ne.call(ii,H)||(ii[H]=[]),ii[H].push({name:g,func:b});}}),ii[Ds(t,O).name]=[{name:"wrapper",func:t}],Ie.prototype.clone=up,Ie.prototype.reverse=hp,Ie.prototype.value=dp,ot.prototype.at=$v,ot.prototype.chain=jv,ot.prototype.commit=Gv,ot.prototype.next=kv,ot.prototype.plant=Vv,ot.prototype.reverse=Kv,ot.prototype.toJSON=ot.prototype.valueOf=ot.prototype.value=Zv,ot.prototype.first=ot.prototype.head,Mi&&(ot.prototype[Mi]=Hv),ot;},ei=Gd();bn?((bn.exports=ei)._=ei,Zo._=ei):ir._=ei;}).call(hn);})(lo,lo.exports);lo.exports;var qs=5,An=/*#__PURE__*/function(_Xt13){function An(t){var _this83;_classCallCheck(this,An);_this83=_callSuper(this,An,[t]);dt(_this83,"canRotate",!1);dt(_this83,"scaleType",Ce.proportional);dt(_this83,"toolsType",Tt.Text);dt(_this83,"tmpPoints",[]);dt(_this83,"workOptions");dt(_this83,"oldRect");_this83.workOptions=t.toolsOpt;return _this83;}_inherits(An,_Xt13);return _createClass(An,[{key:"consume",value:function consume(){return{type:gt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:gt.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var r,n,s,c,_this$workOptions16,l,f,h,m,u,y,T,w,I,S,_O47,_d43,v;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:r=t.workId,n=t.layer,s=t.isDrawLabel,c=t.boxRect,_this$workOptions16=this.workOptions,l=_this$workOptions16.boxSize,f=_this$workOptions16.boxPoint,h=_this$workOptions16.zIndex,m=n.worldPosition,u=n.worldScaling;if(!(!f||!l)){_context26.next=3;break;}return _context26.abrupt("return");case 3:y={name:r,id:r,pos:[f[0]-qs,f[1]-qs],anchor:[0,0],size:l,zIndex:h},T=new cr(y),w={x:f[0]-qs,y:f[1]-qs,w:l[0],h:l[1]},I={x:Math.floor(w.x*u[0]+m[0]),y:Math.floor(w.y*u[1]+m[1]),w:Math.floor(w.w*u[0])+2,h:Math.floor(w.h*u[1])+2};this.replace(n,r,T);if(!(c&&(S=Ji(I,c)),(s||c&&S!==Tr.outside)&&n&&this.workOptions.text)){_context26.next=12;break;}_context26.next=8;return An.createLabels(this.workOptions,n,I);case 8:_O47=_context26.sent;_d43=_O47.labels;v=_O47.maxWidth;T.append.apply(T,_toConsumableArray(_d43)),I.w=Math.ceil(Math.max(v*n.worldScaling[0],I.w));case 12:return _context26.abrupt("return",I);case 13:case"end":return _context26.stop();}},_callee24,this);}));function draw(_x44){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var m,u,y,T,r,n,s,c,l,f,h;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:r=(m=this.workId)==null?void 0:m.toString();if(r){_context27.next=3;break;}return _context27.abrupt("return");case 3:n=t.isFullWork,s=t.replaceId,c=t.isDrawLabel,l=t.boxRect;this.oldRect=s&&((y=(u=this.vNodes)==null?void 0:u.get(s))==null?void 0:y.rect)||void 0;f=n?this.fullLayer:this.drawLayer||this.fullLayer;_context27.next=8;return this.draw({workId:r,layer:f,isDrawLabel:_typeof(c)>"u"&&this.workOptions.workState===te.Done||c,boxRect:l});case 8:h=_context27.sent;return _context27.abrupt("return",((T=this.vNodes)==null||T.setInfo(r,{rect:h,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:h&&Xt.getCenterPos(h,f)}),h));case 10:case"end":return _context27.stop();}},_callee25,this);}));function consumeServiceAsync(_x45){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,n){var I,S,s,c,l,f,h,m,u,y,T,w;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:s=this.workId.toString(),c=t.fontColor,l=t.fontBgColor,f=t.bold,h=t.italic,m=t.lineThrough,u=t.underline,y=t.zIndex,T=(I=this.vNodes)==null?void 0:I.get(s);if(T){_context28.next=5;break;}return _context28.abrupt("return");case 5:c&&(T.opt.fontColor=c),l&&(T.opt.fontBgColor=l),f&&(T.opt.bold=f),h&&(T.opt.italic=h),$n(m)&&(T.opt.lineThrough=m),$n(u)&&(T.opt.underline=u),_e(y)&&(T.opt.zIndex=y),this.oldRect=T.rect;_context28.next=8;return this.draw({workId:s,layer:this.fullLayer,isDrawLabel:_typeof(r)>"u"&&this.workOptions.workState===te.Done||r,boxRect:n});case 8:w=_context28.sent;return _context28.abrupt("return",((S=this.vNodes)==null||S.setInfo(s,{rect:w,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:w&&Xt.getCenterPos(w,this.fullLayer)}),w));case 10:case"end":return _context28.stop();}},_callee26,this);}));function updataOptServiceAsync(_x46,_x47,_x48){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 s=n;return n<=2?s=n*r*2:n>2&&n<=3?s=n*r*1.6:n>3&&n<=4?s=n*r*1.2:n>4&&(s=n*r),Math.floor(s*1e3)/1e3;}},{key:"getSafetySnippetFontLength",value:function getSafetySnippetFontLength(t){return Math.floor(An.textImageSnippetSize*3/4/t)||1;}},{key:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t,r,n){var W,s,c,l,_ref168,f,h,m,u,y,T,w,I,S,O,d,v,p,x,E,R,D,U,M,X,B,N,$,J,tt,at,ut,V,Q,ft,yt,wt,ht,Nt,Dt,G,k,rt,nt,mt,_ht2,_Nt,_Dt,_ht3,_Nt2,_yt3,_wt2;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:s=[],c=n.x,l=n.y,_ref168=(W=r.parent)==null?void 0:W.parent,f=_ref168.width,h=_ref168.height,m=Si(t.text),u=m.length,y=t.fontSize,T=t.lineHeight,w=t.bold,I=t.textAlign,S=t.italic,O=t.fontFamily,d=t.verticalAlign,v=t.fontColor,p=t.fontBgColor,x=t.underline,E=t.lineThrough,R=An.getSafetySnippetRatio(r)||1,D=Math.floor(y*R),U=An.getSafetySnippetFontLength(D);M=0;X=0;case 3:if(!(X<u)){_context29.next=33;break;}B=m[X],N=T||D*1.5;if(!B){_context29.next=30;break;}$=oE(B),J=[0,0],tt=[0,y*1.2];d==="middle"&&(J[1]=Math.floor(X*y*1.2+6+y*(1.1-1)));at=[0,Math.floor(-y*0.15)];J[0]=6;ut=Math.sin(Math.PI/180*20);V=0;Q=[];ft=0;case 14:if(!(ft<$)){_context29.next=27;break;}I==="left"&&(at[0]=V),ft===0&&S==="italic"&&(at[0]=at[0]-ut/2*y);yt=B.slice(ft,ft+U);wt={anchor:[0,0],pos:at,text:yt,fontFamily:O,fontSize:D,lineHeight:N,strokeColor:v,fontWeight:w,fillColor:v,textAlign:I,fontStyle:S,scale:[1/R,1/R]};ht=new e1(wt);_context29.next=21;return ht.textImageReady;case 21:Nt=_context29.sent;Dt=!0;if(Nt){G=Nt.rect&&Nt.rect[2],k=Nt.rect&&Nt.rect[3];if(G&&k){rt=G/R,nt=k/R;V=rt+V,S==="italic"&&(w==="bold"?V=V-ut*y*1.2:V=V-ut*y),((at[0]+J[0]+rt)*r.worldScaling[0]+c<=0||(at[0]+J[0])*r.worldScaling[0]+c>=f||(at[1]+J[1]+nt)*r.worldScaling[1]+l<=0||(at[1]+J[1])*r.worldScaling[1]+l>=h)&&(ht.disconnect(),Dt=!1),Dt&&Q.push(ht);}}ft+=U;case 25:_context29.next=14;break;case 27:tt[0]=V,S==="italic"&&(tt[0]=tt[0]+ut*y),M=Math.max(M,tt[0]);mt=!0;if(((J[0]+tt[0])*r.worldScaling[0]+c<=0||J[0]*r.worldScaling[0]+c>=f||(J[1]+tt[1])*r.worldScaling[0]+l<=0||J[1]*r.worldScaling[1]+l>=h)&&(mt=!1),mt){if(x){_ht2=Math.floor(y/10),_Nt={normalize:!1,pos:[0,y*1.1+_ht2/2],lineWidth:_ht2,points:[0,0,Math.ceil(tt[0]),0],strokeColor:v,className:"underline"},_Dt=new dn(_Nt);Q.push(_Dt);}if(E){_ht3={normalize:!1,pos:[0,y*1.2/2],lineWidth:Math.floor(y/10),points:[0,0,Math.ceil(tt[0]),0],strokeColor:v,className:"lineThrough"},_Nt2=new dn(_ht3);Q.push(_Nt2);}_yt3={pos:J,anchor:[0,0],size:tt,bgcolor:p},_wt2=new cr(_yt3);_wt2.append.apply(_wt2,Q),s.push(_wt2);}case 30:X++;_context29.next=3;break;case 33:return _context29.abrupt("return",{labels:s,maxWidth:M});case 34:case"end":return _context29.stop();}},_callee27);}));function createLabels(_x49,_x50,_x51){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,c=t.targetNode,l=n.fontBgColor,f=n.fontColor,h=n.translate,m=n.originPoint,u=n.scenePoint,y=n.scale,T=n.bold,w=n.italic,I=n.lineThrough,S=n.underline,O=n.fontSize,d=n.textInfos,v=n.zIndex,p=c&&fr(c)||s.get(r.name);if(!p||!r.parent)return;var E=p.opt;if(_e(v)&&(r.setAttribute("zIndex",v),p.opt.zIndex=v),f&&E.fontColor&&(E.fontColor=f,r.children.forEach(function(R){R.tagName==="GROUP"&&R.children.forEach(function(D){D.tagName==="LABEL"?(D.setAttribute("fillColor",f),D.setAttribute("strokeColor",f)):D.tagName==="POLYLINE"&&D.setAttribute("strokeColor",f);});})),l&&E.fontBgColor&&(E.fontBgColor=l,r.children.forEach(function(R){R.tagName==="GROUP"&&R.setAttribute("bgcolor",l);})),T&&(E.bold=T),w&&(E.italic=w),$n(I)&&(E.lineThrough=I),$n(S)&&(E.underline=S),O&&(E.fontSize=O),m&&u&&y&&c&&E.boxPoint){var R=d==null?void 0:d.get(r.name);if(R){var W=R.fontSize,X=R.boxSize;E.boxSize=X||E.boxSize,E.fontSize=W||E.fontSize;}var D=[E.boxPoint[0],E.boxPoint[1]];Oo(E.boxPoint,u,y,h);var U=[p.op[0],p.op[1]],M=[U[0]-D[0],U[1]-D[1]];if(p.centerPos=[p.centerPos[0]+M[0],p.centerPos[1]+M[1]],p.opt.eraserlines){var _iterator33=_createForOfIteratorHelper(p.opt.eraserlines),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _W19=_step33.value;var _X9=_W19.op,B=_W19.thickness;_W19.thickness=Math.round(B*Math.max(y[0],y[1]));for(var N=0;N<_X9.length;N++)Nl(_X9[N],u,y,h);}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}}}else if(h&&E.boxPoint&&(E.boxPoint=[Math.round(E.boxPoint[0]+h[0]),Math.round(E.boxPoint[1]+h[1])],p.centerPos=[p.centerPos[0]+h[0],p.centerPos[1]+h[1]],p.opt.eraserlines)){var _iterator34=_createForOfIteratorHelper(p.opt.eraserlines),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _R5=_step34.value;var _D5=_R5.op;for(var _U24=0;_U24<_D5.length;_U24++){var _M21=_D5[_U24].map(function(W,X){return X%2?W+h[1]:W+h[0];});_R5.op[_U24]=_M21;}}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}}return p&&s.setInfo(r.name,p),p==null?void 0:p.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,r){var n=t.getElementsByName(r)[0];if(n){var s=n.getBoundingClientRect();var c={x:Math.floor(s.x),y:Math.floor(s.y),w:Math.floor(s.width+2),h:Math.floor(s.height+2)};return n.children.forEach(function(l){if(l.tagName==="GROUP"){var f=n.getBoundingClientRect();c=Zt(c,{x:Math.floor(f.x),y:Math.floor(f.y),w:Math.floor(f.width+2),h:Math.floor(f.height+2)});}}),c;}}}]);}(Xt);// 4k
|
|
480
|
+
dt(An,"textImageSnippetSize",1024*4),dt(An,"SafeBorderPadding",30);var Vi=An;var gi=/*#__PURE__*/function(_Xt14){function gi(t){var _this84;_classCallCheck(this,gi);_this84=_callSuper(this,gi,[t]);dt(_this84,"canRotate",!1);dt(_this84,"scaleType",Ce.none);dt(_this84,"toolsType",Tt.PencilEraser);dt(_this84,"tmpPoints",[]);dt(_this84,"workOptions");dt(_this84,"worldPosition");dt(_this84,"worldScaling");dt(_this84,"eraserRect");dt(_this84,"eraserPolyline");_this84.workOptions=t.toolsOpt,_this84.worldPosition=_this84.fullLayer.worldPosition,_this84.worldScaling=_this84.fullLayer.worldScaling;return _this84;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(gi,_Xt14);return _createClass(gi,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:gt.None};var n=this.workOptions.thickness,_gi$eraserSizes$n=gi.eraserSizes[n],s=_gi$eraserSizes$n.width,c=_gi$eraserSizes$n.height,l=Math.round(Math.max(s,c)/this.worldScaling[0]),_this$getChangeNodes=this.getChangeNodes(l,r),f=_this$getChangeNodes.rect,h=_this$getChangeNodes.willNewNodes,m=_this$getChangeNodes.willDeleteNodes;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:gt.DrawWork,rect:f,willNewNodes:h,willDeleteNodes:m});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var s=Date.now();for(var c=0;c<t.length;c+=2){var l=this.tmpPoints.length,f=new Jt(t[c],t[c+1]);if(l===0){this.tmpPoints.push(f);continue;}var h=l-1,m=this.tmpPoints[h],u=pt.Sub(f,m).uni();f.isNear(m,r/2)||(pt.Equals(u,m.v,0.02)&&(this.tmpPoints.pop(),n--),f.setv(u),f.setT(s),this.tmpPoints.push(f));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var n=/* @__PURE__ */new Map(),s=/* @__PURE__ */new Set();var c;if(!this.vNodes)return{willDeleteNodes:s,willNewNodes:n,rect:c};var l=this.worldPosition;var f=Re(this.tmpPoints,t);f=Zi(f,l),f=Zh(f,this.worldScaling,l);var _this$vNodes$getRectI3=this.vNodes.getRectIntersectRange(f),h=_this$vNodes$getRectI3.nodeRange;if(!h.size)return{willDeleteNodes:s,willNewNodes:n,rect:c};var m=this.computEraserPointLines(this.tmpPoints,90);var _iterator35=_createForOfIteratorHelper(h.entries()),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _step35$value=_slicedToArray(_step35.value,2),u=_step35$value[0],y=_step35$value[1];if(y.toolsType!==Tt.Pencil)continue;var T=Zi(y.rect,[-l[0],-l[1]]);T={x:T.x/this.worldScaling[0],y:T.y/this.worldScaling[1],w:T.w/this.worldScaling[0],h:T.h/this.worldScaling[1]};var w=[T.x,T.y,T.x+T.w,T.y+T.h],I=[],S=[];var _iterator36=_createForOfIteratorHelper(m),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _O50=_step36.value;Al.polyline(_O50,w,I);}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}if(I.length&&y.opt){var _iterator37=_createForOfIteratorHelper(I),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _O48=_step37.value;var _d44=[];for(var v=0;v<_O48.length;v++)v!==0&&Qr(_O48[v],_O48[v-1])||_d44.push.apply(_d44,_toConsumableArray(_O48[v]));S.push(_d44);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}if(S.length&&r){var _O49=r.createWorkShapeNode({workId:u,toolsType:Tt.Pencil,toolsOpt:y.opt});_O49.setWorkId(u);var _d45=_O49==null?void 0:_O49.computPencilPoints({op:y.op,eraserPolylines:S,eraserThickness:t});if(c=Zt(c,y.rect),s.add(u),r.removeNode(u),_d45.length)for(var _v13=0;_v13<_d45.length;_v13++){var p="".concat(u,"_").concat(Date.now(),"_").concat(_v13),x=p,R=r.setFullWork({workId:x,opt:y.opt,toolsType:Tt.Pencil}).consumeService({op:_d45[_v13],isFullWork:!0,replaceId:x});r.clearWorkShapeNodeCache(x),c=Zt(c,R),n.set(p,_objectSpread(_objectSpread({},y),{},{toolsType:Tt.Pencil,rect:R!==null&&R!==void 0?R:y.rect,name:p,op:_d45[_v13]}));}}}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}return{willNewNodes:n,willDeleteNodes:s,rect:c};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:gt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_gi$eraserSizes$s=gi.eraserSizes[s],c=_gi$eraserSizes$s.width,l=_gi$eraserSizes$s.height,f=Math.max(c,l)/this.worldScaling[0];return this.updateTempPoints(n,f),_objectSpread({type:gt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var s=0;var c=360-r;for(var l=1;l<t.length;l++){var f=t[l-1],h=t[l];if(l===1&&s===0&&(n[s]=[f.XY]),n[s].push(h.XY),l<t.length-1){var m=h.getAngleByPoints(f,t[l+1]);(m<r||m>c)&&(s++,n[s]=[h.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:gt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_gi$eraserSizes$n2=gi.eraserSizes[n],s=_gi$eraserSizes$n2.width,c=_gi$eraserSizes$n2.height,l=Math.max(s,c)/this.worldScaling[0],_this$getChangeNodes2=this.getChangeNodes(l,r),f=_this$getChangeNodes2.willDeleteNodes,h=_this$getChangeNodes2.willNewNodes,m=_this$getChangeNodes2.rect;if(f.size===0&&h.size===0)return _objectSpread(_objectSpread({type:gt.FullWork},this.baseConsumeResult),{},{rect:m});var u=[];this.tmpPoints.map(function(T){u.push(T.x,T.y,l/2);});var y=mr(u);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:gt.FullWork,dataType:Kt.Local,rect:m,ops:y,willNewNodes:h,willDeleteNodes:f});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(Xt);// 来源于white-sdk
|
|
481
|
+
dt(gi,"eraserSizes",Ol);var fo=gi;var mi=/*#__PURE__*/function(_Xt15){function mi(t){var _this85;_classCallCheck(this,mi);_this85=_callSuper(this,mi,[t]);dt(_this85,"canRotate",!1);dt(_this85,"scaleType",Ce.none);dt(_this85,"toolsType",Tt.BitMapEraser);dt(_this85,"tmpPoints",[]);dt(_this85,"workOptions");dt(_this85,"worldPosition");dt(_this85,"worldScaling");dt(_this85,"eraserRect");dt(_this85,"eraserPolyline");dt(_this85,"oldRect");_this85.workOptions=t.toolsOpt,_this85.worldPosition=_this85.fullLayer.worldPosition,_this85.worldScaling=_this85.fullLayer.worldScaling;return _this85;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(mi,_Xt15);return _createClass(mi,[{key:"combineConsume",value:function combineConsume(t){var r=t.workerEngine;if(this.tmpPoints.length<2)return{type:gt.None};var n=this.workOptions.thickness,_mi$eraserSizes$n=mi.eraserSizes[n],s=_mi$eraserSizes$n.width,c=_mi$eraserSizes$n.height,l=Math.round(Math.max(s,c)/this.worldScaling[0]),_this$getChangeNodes3=this.getChangeNodes(l,r),f=_this$getChangeNodes3.willDeleteNodes,h=_this$getChangeNodes3.rect;return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:gt.DrawWork,rect:h,willDeleteNodes:f});}},{key:"consumeService",value:function consumeService(){}},{key:"updateTempPoints",value:function updateTempPoints(t,r){var n=this.tmpPoints.length-1;var s=Date.now();for(var c=0;c<t.length;c+=2){var l=this.tmpPoints.length,f=new Jt(t[c],t[c+1]);if(l===0){this.tmpPoints.push(f);continue;}var h=l-1,m=this.tmpPoints[h],u=pt.Sub(f,m).uni();f.isNear(m,r/2)||(pt.Equals(u,m.v,0.02)&&(this.tmpPoints.pop(),n--),f.setv(u),f.setT(s),this.tmpPoints.push(f));}return Math.max(n,0);}},{key:"getChangeNodes",value:function getChangeNodes(t,r){var _this86=this;var n=/* @__PURE__ */new Map(),s=/* @__PURE__ */new Set();var c;if(!this.vNodes)return{willDeleteNodes:s,willUpdateNodes:n,rect:c};var l=this.worldPosition;var f=Re(this.tmpPoints,t);f=Zi(f,l),f=Zh(f,this.worldScaling,l);var _this$vNodes$getRectI4=this.vNodes.getRectIntersectRange(f),h=_this$vNodes$getRectI4.nodeRange;if(!h.size)return{willDeleteNodes:s,willUpdateNodes:n,rect:c};var m=this.computEraserPointLines(this.tmpPoints,120);var _iterator38=_createForOfIteratorHelper(h.entries()),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _step38$value=_slicedToArray(_step38.value,2),u=_step38$value[0],y=_step38$value[1];if(y.toolsType===Tt.Text||y.toolsType===Tt.Image)continue;var T=Zi(y.rect,[-l[0],-l[1]]);T={x:T.x/this.worldScaling[0],y:T.y/this.worldScaling[1],w:T.w/this.worldScaling[0],h:T.h/this.worldScaling[1]};var w=[T.x,T.y,T.x+T.w,T.y+T.h],I=[],S=[];var _iterator39=_createForOfIteratorHelper(m),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _v15=_step39.value;Al.polyline(_v15,w,I);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}if(I.length&&y.opt){var _iterator40=_createForOfIteratorHelper(I),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var v=_step40.value;var p=[];for(var x=0;x<v.length&&!(isNaN(v[x][0])||isNaN(v[x][1]));x++){var E=v[x].map(function(R){return Math.round(R*100)/100;});if(x!==0){var R=v[x-1].map(function(D){return Math.round(D*100)/100;});if(Qr(E,R))continue;}p.push.apply(p,_toConsumableArray(E));}p.length!==0&&S.push(p);}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}}if(!S.length)continue;var _O51=y.opt.eraserlines?y.opt.eraserlines:[],_d46=_O51.find(function(v){return v.workId===_this86.workId;});if(_d46?_d46.op=S:_O51.push({workId:this.workId,op:S,thickness:t}),y.opt.eraserlines=_O51,r){var _v14=y.toolsType,_p16=r.createWorkShapeNode({workId:u,toolsType:_v14,toolsOpt:y.opt});_p16==null||_p16.setWorkId(u);var _x52=_p16==null?void 0:_p16.consumeService({op:y.op,isFullWork:!0,replaceId:u});if(c=Zt(c,_x52),_p16!=null&&_p16.isDelete){r.removeNode(u),s.add(u);continue;}}n.set(u,y);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return{willUpdateNodes:n,willDeleteNodes:s,rect:c};}},{key:"consume",value:function consume(t){var r=t.data,n=r.op;if(!n||n.length===0)return _objectSpread({type:gt.None},this.baseConsumeResult);var s=this.workOptions.thickness,_mi$eraserSizes$s=mi.eraserSizes[s],c=_mi$eraserSizes$s.width,l=_mi$eraserSizes$s.height,f=Math.round(Math.max(c,l)/this.worldScaling[0]);return this.updateTempPoints(n,f),_objectSpread({type:gt.None},this.baseConsumeResult);}},{key:"computEraserPointLines",value:function computEraserPointLines(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;var n=[];var s=0;var c=360-r;for(var l=1;l<t.length;l++){var f=t[l-1],h=t[l];if(l===1&&s===0&&(n[s]=[f.XY]),n[s].push(h.XY),l<t.length-1){var m=h.getAngleByPoints(f,t[l+1]);(m<r||m>c)&&(s++,n[s]=[h.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:gt.None},this.baseConsumeResult);var n=this.workOptions.thickness,_mi$eraserSizes$n2=mi.eraserSizes[n],s=_mi$eraserSizes$n2.width,c=_mi$eraserSizes$n2.height,l=Math.round(Math.max(s,c)/this.worldScaling[0]),_this$getChangeNodes4=this.getChangeNodes(l,r),f=_this$getChangeNodes4.willDeleteNodes,h=_this$getChangeNodes4.willUpdateNodes,m=_this$getChangeNodes4.rect;if(f.size===0&&h.size===0)return _objectSpread(_objectSpread({type:gt.FullWork},this.baseConsumeResult),{},{rect:m});var u=[];this.tmpPoints.map(function(T){u.push(T.x,T.y,l/2);});var y=mr(u);return _objectSpread(_objectSpread({},this.baseConsumeResult),{},{type:gt.FullWork,dataType:Kt.Local,rect:m,ops:y,willUpdateNodes:h,willDeleteNodes:f});}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}]);}(Xt);// 来源于white-sdk
|
|
482
|
+
dt(mi,"eraserSizes",Ol);var co=mi;var Ki=/*#__PURE__*/function(_Xt16){function Ki(t){var _this87;_classCallCheck(this,Ki);_this87=_callSuper(this,Ki,[t]);dt(_this87,"canRotate",!1);dt(_this87,"scaleType",Ce.all);dt(_this87,"toolsType",Tt.BackgroundSVG);dt(_this87,"tmpPoints",[]);dt(_this87,"workOptions");dt(_this87,"oldRect");_this87.workOptions=t.toolsOpt,_this87.scaleType=Ki.getScaleType(_this87.workOptions);return _this87;}_inherits(Ki,_Xt16);return _createClass(Ki,[{key:"consume",value:function consume(){return{type:gt.None};}},{key:"consumeAll",value:function consumeAll(){return{type:gt.None};}},{key:"draw",value:function draw(t){var r=t.layer,n=t.workId,s=t.replaceId,_this$workOptions17=this.workOptions,c=_this$workOptions17.centerX,l=_this$workOptions17.centerY,f=_this$workOptions17.width,h=_this$workOptions17.height,m=_this$workOptions17.rotate,u=_this$workOptions17.zIndex,y=(u||0)-100,T=new cr({anchor:[0.5,0.5],pos:[c,l],name:n,size:[f,h],zIndex:y,rotate:m}),w=new sl({normalize:!0,pos:[0,0],width:f,height:h});T.appendChild(w),this.replace(r,s||n,T);var I=T.getBoundingClientRect();if(I)return{x:Math.floor(I.x-Xt.SafeBorderPadding),y:Math.floor(I.y-Xt.SafeBorderPadding),w:Math.floor(I.width+Xt.SafeBorderPadding*2),h:Math.floor(I.height+Xt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(t){var c;var r=t.replaceId,n=this.workId,s=this.draw({workId:n,layer:this.fullLayer,replaceId:r});return(c=this.vNodes)==null||c.setInfo(n,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&Xt.getCenterPos(s,this.fullLayer)}),s;}},{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?Ce.proportional:Ce.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var r=t.node,n=t.opt,s=t.vNodes,c=t.targetNode,l=n.translate,f=n.originPoint,h=n.scenePoint,m=n.scale,u=n.angle,y=n.isLocked,T=n.zIndexForBackgroundSVG,w=c&&fr(c)||s.get(r.name);if(!w)return;var I=r.parent;if(I){if(_e(T)){var S=(T||0)-100;r.setAttribute("zIndex",S),w.opt.zIndex=T;}if($n(y)&&(w.opt.locked=y),f&&h&&m&&l){var _w$opt=w.opt,_S21=_w$opt.centerX,_O52=_w$opt.centerY,_d47=_w$opt.width,v=_w$opt.height,p=_w$opt.uniformScale,x=p!==!1?[m[0],m[0]]:m,E=[_S21,_O52],R=[_S21,_O52];Oo(R,h,x,l);var D=[R[0]-E[0],R[1]-E[1]];w.centerPos=[w.centerPos[0]+D[0],w.centerPos[1]+D[1]],w.opt.width=Math.round(_d47*x[0]),w.opt.height=Math.round(v*x[1]),w.opt.centerX=R[0],w.opt.centerY=R[1];}else if(l)w.opt.centerX=w.opt.centerX+l[0],w.opt.centerY=w.opt.centerY+l[1],w.centerPos=[w.centerPos[0]+l[0],w.centerPos[1]+l[1]];else if(_e(u))if(w.opt.rotate=u,w.scaleType=Ki.getScaleType(w.opt),c){var _S22=Dl(w.rect,u);w.rect=_S22;}else{var _S23=Xt.getRectFromLayer(I,r.name);w.rect=_S23||w.rect;}return w&&s.setInfo(r.name,w),w==null?void 0:w.rect;}}}]);}(Xt);function Vh(i){switch(i){case Tt.Arrow:return wh;case Tt.Pencil:return Th;case Tt.Straight:return bh;case Tt.Ellipse:return Ah;case Tt.Polygon:case Tt.Triangle:return Lh;case Tt.Star:case Tt.Rhombus:return Mh;case Tt.Rectangle:return Eh;case Tt.SpeechBalloon:return Rh;case Tt.Text:return Vi;case Tt.LaserPen:return Ch;case Tt.Eraser:return so;case Tt.PencilEraser:return fo;case Tt.BitMapEraser:return co;case Tt.Selector:return ki;case Tt.Image:return Hi;case Tt.BackgroundSVG:return Ki;}}function Io(i,e){var t=i.toolsType,r=_objectWithoutProperties(i,_excluded);switch(t){case Tt.Arrow:return new wh(r);case Tt.Pencil:return new Th(r);case Tt.Straight:return new bh(r);case Tt.Ellipse:return new Ah(r);case Tt.Polygon:case Tt.Triangle:return new Lh(r);case Tt.Star:case Tt.Rhombus:return new Mh(r);case Tt.Rectangle:return new Eh(r);case Tt.SpeechBalloon:return new Rh(r);case Tt.Text:return new Vi(r);case Tt.LaserPen:return new Ch(r);case Tt.Eraser:return new so(r,e);case Tt.BitMapEraser:return new co(r);case Tt.PencilEraser:return new fo(r);case Tt.Selector:return r.vNodes?new ki(_objectSpread(_objectSpread({},r),{},{vNodes:r.vNodes,drawLayer:r.fullLayer})):void 0;case Tt.Image:return new Hi(r);case Tt.BackgroundSVG:return new Ki(_objectSpread(_objectSpread({},r),{},{toolsOpt:r.toolsOpt}));default:return;}}function Kh(i){var e=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE","LABEL","SPRITESVG"];var _iterator41=_createForOfIteratorHelper(i),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var r=_step41.value;if(r.tagName==="GROUP"&&r.children.length){var n=Kh(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 Zt(i,e){if(i&&e){var t=Math.min(i.x,e.x),r=Math.min(i.y,e.y),n=Math.max(i.x+i.w,e.x+e.w),s=Math.max(i.y+i.h,e.y+e.h),c=n-t,l=s-r;return{x:t,y:r,w:c,h:l};}return e||i;}function Re(i){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,s=-1/0,c=-1/0;return i.forEach(function(l){var _l$XY=_slicedToArray(l.XY,2),f=_l$XY[0],h=_l$XY[1];r=Math.min(r,f-e),n=Math.min(n,h-e),s=Math.max(s,f+e),c=Math.max(c,h+e);}),t.x=r,t.y=n,t.w=s-r,t.h=c-n,t;}function dl(i,e){return!(i.x+i.w<e.x||i.x>e.x+e.w||i.y+i.h<e.y||i.y>e.y+e.h);}function ve(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(i.x-e),y:Math.floor(i.y-e),w:Math.ceil(i.w+e*2),h:Math.ceil(i.h+e*2)};}function Zi(i,e){return{x:i.x+e[0],y:i.y+e[1],w:i.w,h:i.h};}function JA(i,e){var t=new pt(i.x,i.y),r=new pt(i.x+i.w,i.y),n=new pt(i.x+i.w,i.y+i.h),s=new pt(i.x,i.y+i.h),c=new pt(i.x+i.w/2,i.y+i.h/2),l=Math.PI*e/180,f=pt.RotWith(t,c,l),h=pt.RotWith(r,c,l),m=pt.RotWith(n,c,l),u=pt.RotWith(s,c,l);return[f,h,m,u];}function Dl(i,e){var t=JA(i,e);return Re(t);}function Zh(i,e,t){var r=new pt(i.x,i.y),n=new pt(i.x+i.w,i.y),s=new pt(i.x+i.w,i.y+i.h),c=new pt(i.x,i.y+i.h),l=new pt(t[0],t[1]),f=new pt(e[0],e[1]),h=pt.ScaleWOrigin(r,f,l),m=pt.ScaleWOrigin(n,f,l),u=pt.ScaleWOrigin(s,f,l),y=pt.ScaleWOrigin(c,f,l);return Re([h,m,u,y]);}function QA(i,e,t){var r=new pt(e[0],e[1]);for(var n=0;n<i.length;n+=3){var s=new pt(i[n],i[n+1]),c=Math.PI*t/180,l=pt.RotWith(s,r,c);i[n]=l.x,i[n+1]=l.y;}}function qA(i,e,t){var r=new pt(e[0],e[1]);for(var n=0;n<i.length;n+=2){var s=new pt(i[n],i[n+1]),c=Math.PI*t/180,l=pt.RotWith(s,r,c);i[n]=l.x,i[n+1]=l.y;}}function Oo(i,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new pt(e[0],e[1]);for(var s=0;s<i.length;s+=3){var c=new pt(i[s],i[s+1]),l=new pt(t[0],t[1]),f=pt.ScaleWOrigin(c,l,n);i[s]=f.x+r[0],i[s+1]=f.y+r[1];}}function Nl(i,e,t){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0];var n=new pt(e[0],e[1]);for(var s=0;s<i.length;s+=2){var c=new pt(i[s],i[s+1]),l=new pt(t[0],t[1]),f=pt.ScaleWOrigin(c,l,n);i[s]=f.x+r[0],i[s+1]=f.y+r[1];}}function _A(i,e){return i[0]>=e.x&&i[0]<=e.x+e.w&&i[1]>=e.y&&i[1]<=e.y+e.h;}function Jh(i,e){var t=i<=e?1:i/e,r=e<=i?1:e/i;return[t,r];}function tE(i){var _iterator42=_createForOfIteratorHelper(i),_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 eE(i){return i!==Math.floor(i);}function rE(i){var e=i.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0;}function nE(i,e){for(;e!==0;){var _ref169=[e,i%e];i=_ref169[0];e=_ref169[1];}return i;}var iE=function iE(i){if(i.tagName==="GROUP"){var _e4=Object.getOwnPropertySymbols(i).find(function(t){return t.toString()==="Symbol(sealed)";});if(_e4&&i[_e4])return!0;}return!1;},_vr=function vr(i,e){if(i.mesh&&i.mesh.texture&&i.name==="eraserTexture"){var t=i.mesh.texture.image;e.deleteTexture(t);}else if(i.tagName==="GROUP"&&i&&i.children){var _iterator43=_createForOfIteratorHelper(i.children),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _t3=_step43.value;_vr(_t3,e);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}},Lr=function Lr(i,e){_vr(i,e),i.removeAllChildren();},sE=function sE(i,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 s=_step44.value;if(_vr(s,r),s.tagName==="GROUP"){var _iterator45=_createForOfIteratorHelper(s.children),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var c=_step45.value;_vr(c,r);}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}}e.parent.replaceChild(i,e);},Qh=function Qh(i,e,t){if(i.w+i.x<=0||i.h+i.y<=0||i.w<=0||i.h<=0)return;var r=e.width,n=e.height,s={x:Math.floor(Math.max(0,i.x)),y:Math.floor(Math.max(0,i.y)),w:Math.floor(Math.min(r,i.w)),h:Math.floor(Math.min(n,i.h))};if(s.x+s.w>r&&(s.w=Math.floor(r-s.x)),s.y+s.h>n&&(s.h=Math.floor(n-s.y)),eE(t)){var c=rE(t),l=Math.pow(10,c),f=nE(l,t*l),h=s.x%f,m=s.x-h;m>=0?(s.x=m,s.w=s.w+h):(s.x=0,s.w=s.w+h-m);var u=s.y%f,y=s.y-u;y>=0?(s.y=y,s.h=s.h+u):(s.y=0,s.h=s.h+u-y);}return s;};function ui(i){return"".concat(uo(i.x),",").concat(uo(i.y)," ");}function hi(i,e){return"".concat(uo((i.x+e.x)/2),",").concat(uo((i.y+e.y)/2)," ");}function uo(i){return+i.toFixed(4);}var Ji=function Ji(i,e){return i.x+i.w<e.x||i.x>e.x+e.w||i.y+i.h<e.y||i.y>e.y+e.h?Tr.outside:i.x>=e.x&&i.y>=e.y&&i.x+i.w<=e.x+e.w&&i.y+i.h<=e.y+e.h?Tr.inside:Tr.intersect;};function oE(i){var e=0;for(var t=0;t<i.length;t++){var r=i.charCodeAt(t);r>=1&&r<=126||65376<=r&&r<=65439?e++:e+=2;}return e;}var Nu=/*#__PURE__*/function(){function Nu(e){_classCallCheck(this,Nu);dt(this,"_map");dt(this,"_observers",/* @__PURE__ */new Set());this._map=new Map(e);}return _createClass(Nu,[{key:"notifyObservers",value:function notifyObservers(e,t,r){var _iterator46=_createForOfIteratorHelper(this._observers),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var n=_step46.value;n(e,t,r);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}}},{key:"observe",value:function observe(e){this._observers.add(e);}},{key:"unobserve",value:function unobserve(e){this._observers["delete"](e);}},{key:"get",value:function get(e){return this._map.get(e);}},{key:"set",value:function set(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var n=this._map.has(e)?"update":"add";return this._map.set(e,t),r&&this.notifyObservers(n,e,t),this;}},{key:"has",value:function has(e){return this._map.has(e);}},{key:"delete",value:function _delete(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var r=this._map.get(e),n=this._map["delete"](e);return t&&r&&this.notifyObservers("delete",e,r),n;}},{key:"clear",value:function clear(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var t=this._map.keys();if(this._map.clear(),e){var _iterator47=_createForOfIteratorHelper(t),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var r=_step47.value;this.notifyObservers("clear",r,void 0);}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}}}},{key:"size",get:function get(){return this._map.size;}},{key:"keys",value:function keys(){return this._map.keys();}},{key:"values",value:function values(){return this._map.values();}},{key:"entries",value:function entries(){return this._map.entries();}},{key:"forEach",value:function forEach(e,t){this._map.forEach(e,t);}}]);}();var aE=/*#__PURE__*/function(){function aE(e,t){_classCallCheck(this,aE);dt(this,"viewId");dt(this,"scene");dt(this,"fullLayer");dt(this,"curNodeMap");dt(this,"targetNodeMap",[]);dt(this,"highLevelIds");dt(this,"canClearUids");dt(this,"localUid");this.viewId=e,this.scene=t,this.curNodeMap=new Nu();}return _createClass(aE,[{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 _iterator48=_createForOfIteratorHelper(e.entries()),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var _step48$value=_slicedToArray(_step48.value,2),n=_step48$value[0],s=_step48$value[1];s.toolsType!==Tt.BackgroundSVG&&(s.toolsType===Tt.Image&&s.opt.type===vo.Image&&(s.opt.locked||t&&t.disableEraseImage)||s.toolsType===Tt.Text&&(s.opt.workState===te.Doing||s.opt.workState===te.Start||t&&t.disableEraseText)||this.isCanClearWorkId(n)&&r.set(n,s));}}catch(err){_iterator48.e(err);}finally{_iterator48.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=fr(t.rect)),t.op&&tE(t.op)&&(r.op=fr(t.op)),t.canRotate&&(r.canRotate=t.canRotate),t.scaleType&&(r.scaleType=t.scaleType),t.opt&&(r.opt=fr(t.opt)),t.toolsType&&(r.toolsType=t.toolsType),t.centerPos&&(r.centerPos=fr(t.centerPos)),$n(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 s=/* @__PURE__ */new Map();var _iterator49=_createForOfIteratorHelper(this.curNodeMap.entries()),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _step49$value=_slicedToArray(_step49.value,2),c=_step49$value[0],l=_step49$value[1];if(dl(e,l.rect)){if(t&&l.toolsType===Tt.Image&&l.opt.locked||r&&l.toolsType===Tt.Text&&(l.opt.workState===te.Doing||l.opt.workState===te.Start))continue;n=Zt(n,l.rect),s.set(c,l);}}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}return{rectRange:n,nodeRange:s};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(e,t){var r=Vh(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 _iterator50=_createForOfIteratorHelper(this.highLevelIds.keys()),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var t=_step50.value;this.updateNodeRect(t);}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}}},{key:"updateLowLevelNodesRect",value:function updateLowLevelNodesRect(){var e;var _iterator51=_createForOfIteratorHelper(this.curNodeMap.keys()),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var t=_step51.value;(e=this.highLevelIds)!=null&&e.has(t)||this.updateNodeRect(t);}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}}},{key:"clearHighLevelIds",value:function clearHighLevelIds(){this.highLevelIds=void 0;}},{key:"setTargetAssignKeys",value:function setTargetAssignKeys(e){var t=new Nu();var _iterator52=_createForOfIteratorHelper(e),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var r=_step52.value;var n=this.curNodeMap.get(r);n&&t.set(r,fr(n));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}return this.targetNodeMap.push(fr(t)),this.targetNodeMap.length-1;}},{key:"setTarget",value:function setTarget(){var e=this.curNodeMap.keys();return this.setTargetAssignKeys(Array.from(e));}},{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(yi).length===1;}},{key:"isCanClearWorkId",value:function isCanClearWorkId(e){if(this.canClearUids===void 0||this.canClearUids===!0)return!0;if(XO(this.canClearUids)){var t=e.split(yi);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 qh=/*#__PURE__*/function(){function qh(e,t,r){_classCallCheck(this,qh);dt(this,"viewId");dt(this,"type");dt(this,"scene");dt(this,"fullLayer");dt(this,"vNodes");dt(this,"dpr");dt(this,"contextType");dt(this,"opt");dt(this,"cameraOpt");dt(this,"isSafari",!1);dt(this,"combinePostMsg",/* @__PURE__ */new Set());dt(this,"workerTaskId");dt(this,"protectedTask");// protected hasPriorityDraw: boolean = true;
|
|
483
|
+
dt(this,"delayPostDoneResolve");dt(this,"cacheImages",/* @__PURE__ */new Map());dt(this,"imageResolveMap",/* @__PURE__ */new Map());dt(this,"taskUpdateCameraId");dt(this,"debounceUpdateCameraId");var n,s;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(c){if(this.contextType!=="2d")this.contextType="2d",(s=this.scene)==null||s.disconnect(),this.scene=this.createScene(t),this.createRenderLayer(this.scene,t);else throw c;}this.vNodes=new aE(e,this.scene);}return _createClass(qh,[{key:"createRenderLayer",value:function createRenderLayer(e,t){var r=gr.bufferSize.full,n=gr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",e,_objectSpread(_objectSpread({},t.layerOpt),{},{bufferSize:this.viewId===jn?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(_x53){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 _iterator53=_createForOfIteratorHelper(this.cacheImages.entries()),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var _step53$value=_slicedToArray(_step53.value,2),t=_step53$value[0],r=_step53$value[1];if(t===e&&r.imageBitmap)return r.imageBitmap;}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}}},{key:"deleteCachedImagesByWorkId",value:function deleteCachedImagesByWorkId(e,t){var _iterator54=_createForOfIteratorHelper(this.cacheImages.entries()),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var _step54$value=_slicedToArray(_step54.value,2),r=_step54$value[0],n=_step54$value[1];t&&r===t||n.workId===e&&(n.imageBitmap.close(),this.cacheImages["delete"](r));}}catch(err){_iterator54.e(err);}finally{_iterator54.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,s,c,l,f,h,_h7,m,u,y;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:t=e.msgType,r=e.toolsType,n=e.opt,s=e.imageSrc,c=e.imageBitmap,l=e.workId,f=e.dpr;_context31.t0=t;_context31.next=_context31.t0===gt.UpdateDpr?4:_context31.t0===gt.UpdateCamera?9:_context31.t0===gt.Destroy?12:_context31.t0===gt.Clear?14:_context31.t0===gt.UpdateTools?17:_context31.t0===gt.GetImageBitMap?19:21;break;case 4:_context31.t1=_e(f);if(!_context31.t1){_context31.next=8;break;}_context31.next=8;return this.updateDpr(f);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){h={toolsType:r,toolsOpt:n,combineUnitTime:e.combineUnitTime,maxCombineEraserTime:e.maxCombineEraserTime};this.localWork.setToolsOpt(h);}return _context31.abrupt("break",21);case 19:if(s&&c&&l){_h7=l.toString();this.cacheImages.set(s,{imageBitmap:c,workId:_h7});m=this.imageResolveMap.get(s);if(m){u=m.resolve,y=m.timer;y&&clearTimeout(y),u&&u(s);}this.deleteCachedImagesByWorkId(_h7,s);}return _context31.abrupt("break",21);case 21:case"end":return _context31.stop();}},_callee29,this);}));function on(_x54){return _on.apply(this,arguments);}return on;}()},{key:"getIconSize",value:function getIconSize(e,t,r){var n=e*r,s=t*r;return n<=50||s<=50?[50,50]:n<=100||s<=100?[100,100]:n<=200||s<=200?[200,200]:n<=400||s<=400?[400,400]:n<=800||s<=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,s,c,l,f,h,m,u,y,_this$getIconSize,_this$getIconSize2,S,_O53,_S24,_S25,I;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:t=e.toolsType,r=e.opt,n=e.workId,s=e.isSubWorker;if(!(t===Tt.Image&&r&&n)){_context32.next=19;break;}c=n.toString(),l=r.src,f=r.type,h=r.width,m=r.height,u=r.strokeColor;if(!(!l||!f||!h||!m)){_context32.next=5;break;}return _context32.abrupt("return");case 5:y=l;if(f===vo.Iconify){_this$getIconSize=this.getIconSize(h,m,this.dpr),_this$getIconSize2=_slicedToArray(_this$getIconSize,2),S=_this$getIconSize2[0],_O53=_this$getIconSize2[1];y="".concat(l,"?width=").concat(S,"&height=").concat(_O53,"&color=").concat(u);}if(!this.cacheImages.has(y)){_context32.next=11;break;}_S24=this.getCachedImages(y);if(!_S24){_context32.next=11;break;}return _context32.abrupt("return",_S24);case 11:if(!this.imageResolveMap.has(y)){_context32.next=15;break;}_S25=this.getCachedImagesByWorkId(c);if(!_S25){_context32.next=15;break;}return _context32.abrupt("return",_S25);case 15:_context32.next=17;return new Promise(function(S){var O=_this88.imageResolveMap.get(y)||{resolve:void 0,timer:void 0};O.timer&&clearTimeout(O.timer),O.resolve=S,O.timer=setTimeout(function(){var d=_this88.imageResolveMap.get(y);d!=null&&d.resolve&&d.resolve(y);},5e3),_this88.imageResolveMap.set(y,O),_this88._post({sp:[{imageSrc:y,workId:c,viewId:_this88.viewId,isgl:!!_this88.fullLayer.parent.gl,isSubWorker:s,type:gt.GetImageBitMap}]});});case 17:I=_context32.sent;return _context32.abrupt("return",(this.imageResolveMap["delete"](I),this.getCachedImages(y)));case 19:case"end":return _context32.stop();}},_callee30,this);}));function loadImageBitMap(_x55){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,s=t.height;e.container.width=n,e.container.height=s,e.width=n,e.height=s,this.updateLayer({width:n,height:s},r);}},{key:"updateLayer",value:function updateLayer(e,t){var r=e.width,n=e.height,s=t||this.fullLayer;s&&(s.parent.setAttribute("width",r),s.parent.setAttribute("height",n),s.setAttribute("size",[r,n]),s.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===ho.Full&&this.viewId===jn&&(n=["webgl2","webgl","2d"],t&&n.unshift(t));for(var _i3=0,_n7=n;_i3<_n7.length;_i3++){var s=_n7[_i3];try{if(r.getContext(s))return s;}catch(c){throw c;}}}},{key:"createScene",value:function createScene(e){var t=e.offscreenCanvasOpt,r=t.width,n=t.height,s=new OffscreenCanvas(r,n);t.contextType&&delete t.contextType;var c=new zu(_objectSpread(_objectSpread({container:s,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},t),{},{contextType:this.contextType,id:this.viewId}));return c.setAttribute("id",this.viewId),c;}},{key:"createLayer",value:function createLayer(e,t,r,n){var s="offscreen-".concat(e),c=r.width,l=r.height;n&&(r.offscreen=!0,r.canvas=n);var f=t.layer(s,r),h=new cr({anchor:[0.5,0.5],pos:[c*0.5,l*0.5],size:[c,l],name:"viewport",id:e});return f.append(h),h;}},{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();}),Lr(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(),_vr(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(_x56){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===ho.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 l,f;this.workerTaskId=void 0;var e=[],t=[];var r,n,s;var c=/* @__PURE__ */new Set();var _iterator55=_createForOfIteratorHelper(this.combinePostMsg.values()),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var h=_step55.value;if((l=h.render)!=null&&l.length){var _iterator56=_createForOfIteratorHelper(h.render),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var m=_step56.value;var u=!1;if(m.workId&&c.add(m.workId),m.isClearAll&&(m.rect=this.getSceneRect(),m.isClear=!0,delete m.isClearAll),m.drawCanvas){var y=this.getLayer(m.drawCanvas);if(!y||!(y.parent instanceof il))continue;if(y.parent.render(),m.isDrawAll){var T=this.getSceneRect();m.rect=T,delete m.isDrawAll;}}var _iterator57=_createForOfIteratorHelper(e),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _y3=_step57.value;if(m.viewId===_y3.viewId){m.isClear&&_y3.clearCanvas&&_y3.isClear&&_y3.clearCanvas===m.clearCanvas&&(_y3.rect=Zt(_y3.rect,m.rect),u=!0),_y3.drawCanvas&&_y3.drawCanvas===m.drawCanvas&&(_y3.rect=Zt(_y3.rect,m.rect),u=!0);continue;}}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}u||(m.isClear&&!m.drawCanvas?e.unshift(m):e.push(m));}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}}if((f=h.sp)!=null&&f.length){var _iterator58=_createForOfIteratorHelper(h.sp),_step58;try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){var _m12=_step58.value;var _u6=!1;var _iterator59=_createForOfIteratorHelper(t),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var _y4=_step59.value;if(Qr(_m12,_y4)){_u6=!0;break;}}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}_u6||t.push(_m12);}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}}_e(h.fullWorkerDrawCount)&&(r=h.fullWorkerDrawCount),_e(h.subWorkerDrawCount)&&(n=h.subWorkerDrawCount),_e(h.consumeCount)&&(s=h.consumeCount);}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}return this.combinePostMsg.clear(),{render:e,sp:t,fullWorkerDrawCount:r,subWorkerDrawCount:n,consumeCount:s,workIds:c,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 Bl=/*#__PURE__*/function(){function Bl(e){_classCallCheck(this,Bl);dt(this,"viewId");dt(this,"vNodes");dt(this,"thread");dt(this,"fullLayer");dt(this,"drawLayer");dt(this,"_post");dt(this,"tmpOpt");dt(this,"workShapes",/* @__PURE__ */new Map());dt(this,"drawCount",0);dt(this,"consumeCount",0);dt(this,"syncUnitTime",gr.syncOpt.interval);dt(this,"combineUnitTime",gr.bezier.combineUnitTime);dt(this,"maxCombineEraserTime",gr.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(Bl,[{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 Io(_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 s=t.toString();var c;return t&&this.workShapes.has(s)?(c=this.workShapes.get(s),c==null||c.setWorkOptions(r)):c=this.createWorkShapeNode({toolsOpt:r,toolsType:n,workId:s}),c?(this.workShapes.set(s,c),c):void 0;}}}]);}();function lE(i){return i;}var _h=lE;function fE(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2]);}return i.apply(e,t);}var cE=fE,uE=cE,Bu=Math.max;function hE(i,e,t){return e=Bu(e===void 0?i.length-1:e,0),function(){for(var r=arguments,n=-1,s=Bu(r.length-e,0),c=Array(s);++n<s;)c[n]=r[e+n];n=-1;for(var l=Array(e+1);++n<e;)l[n]=r[n];return l[e]=t(c),uE(i,this,l);};}var dE=hE;function pE(i){return function(){return i;};}var vE=pE,gE=vE,Wu=Ju,mE=_h,yE=Wu?function(i,e){return Wu(i,"toString",{configurable:!0,enumerable:!1,value:gE(e),writable:!0});}:mE,SE=yE,PE=800,xE=16,TE=Date.now;function CE(i){var e=0,t=0;return function(){var r=TE(),n=xE-(r-t);if(t=r,n>0){if(++e>=PE)return arguments[0];}else e=0;return i.apply(void 0,arguments);};}var IE=CE,OE=SE,wE=IE,AE=wE(OE),EE=AE,ME=_h,LE=dE,RE=EE;function bE(i,e){return RE(LE(i,e,ME),i+"");}var DE=bE;function NE(i,e,t,r){for(var n=i.length,s=t+(r?1:-1);r?s--:++s<n;)if(e(i[s],s,i))return s;return-1;}var BE=NE;function WE(i){return i!==i;}var FE=WE;function UE(i,e,t){for(var r=t-1,n=i.length;++r<n;)if(i[r]===e)return r;return-1;}var YE=UE,XE=BE,zE=FE,$E=YE;function jE(i,e,t){return e===e?$E(i,e,t):XE(i,zE,t);}var GE=jE,kE=GE;function HE(i,e){var t=i==null?0:i.length;return!!t&&kE(i,e,0)>-1;}var td=HE;function VE(i,e,t){for(var r=-1,n=i==null?0:i.length;++r<n;)if(t(e,i[r]))return!0;return!1;}var ed=VE;function KE(i,e){for(var t=-1,r=i==null?0:i.length,n=Array(r);++t<r;)n[t]=e(i[t],t,i);return n;}var ZE=KE,JE=El,QE=td,qE=ed,_E=ZE,tM=xo,eM=Ml,rM=200;function nM(i,e,t,r){var n=-1,s=QE,c=!0,l=i.length,f=[],h=e.length;if(!l)return f;t&&(e=_E(e,tM(t))),r?(s=qE,c=!1):e.length>=rM&&(s=eM,c=!1,e=new JE(e));t:for(;++n<l;){var m=i[n],u=t==null?m:t(m);if(m=r||m!==0?m:0,c&&u===u){for(var y=h;y--;)if(e[y]===u)continue t;f.push(m);}else s(e,u,r)||f.push(m);}return f;}var iM=nM,Fu=Qi,sM=th,oM=_i,Uu=Fu?Fu.isConcatSpreadable:void 0;function aM(i){return oM(i)||sM(i)||!!(Uu&&i&&i[Uu]);}var lM=aM,fM=Cl,cM=lM;function rd(i,e,t,r,n){var s=-1,c=i.length;for(t||(t=cM),n||(n=[]);++s<c;){var l=i[s];e>0&&t(l)?e>1?rd(l,e-1,t,r,n):fM(n,l):r||(n[n.length]=l);}return n;}var uM=rd;function hM(){}var dM=hM,nl=uh,pM=dM,vM=Ll,gM=1/0,mM=nl&&1/vM(new nl([,-0]))[1]==gM?function(i){return new nl(i);}:pM,yM=mM,SM=El,PM=td,xM=ed,TM=Ml,CM=yM,IM=Ll,OM=200;function wM(i,e,t){var r=-1,n=PM,s=i.length,c=!0,l=[],f=l;if(t)c=!1,n=xM;else if(s>=OM){var h=e?null:CM(i);if(h)return IM(h);c=!1,n=TM,f=new SM();}else f=e?[]:l;t:for(;++r<s;){var m=i[r],u=e?e(m):m;if(m=t||m!==0?m:0,c&&u===u){for(var y=f.length;y--;)if(f[y]===u)continue t;e&&f.push(u),l.push(m);}else n(f,u,t)||(f!==l&&f.push(u),l.push(m));}return l;}var AM=wM,EM=iM,MM=uM,Yu=AM;function LM(i,e,t){var r=i.length;if(r<2)return r?Yu(i[0]):[];for(var n=-1,s=Array(r);++n<r;)for(var c=i[n],l=-1;++l<r;)l!=n&&(s[n]=EM(s[n]||c,i[l],e,t));return Yu(MM(s,1),e,t);}var RM=LM,bM=Sl,DM=pn;function NM(i){return DM(i)&&bM(i);}var BM=NM,WM=sh,FM=DE,UM=RM,YM=BM,XM=FM(function(i){return UM(WM(i,YM));}),zM=XM,$M=/* @__PURE__ */Ln(zM);var nd=/*#__PURE__*/function(_Bl){function nd(t){var _this90;_classCallCheck(this,nd);_this90=_callSuper(this,nd,[t]);dt(_this90,"_type","full");dt(_this90,"combineTimerId");dt(_this90,"combineDrawResolve");dt(_this90,"combineDrawActiveId");dt(_this90,"drawWorkActiveId");dt(_this90,"effectSelectNodeData",/* @__PURE__ */new Set());return _this90;}_inherits(nd,_Bl);return _createClass(nd,[{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(_x57){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,s,c,l,f,h,m,u,y;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:n=t.op,s=t.workId,c=t.scenePath,l=t.postCount,f=t.smoothSync;if(!(n!=null&&n.length&&s)){_context37.next=48;break;}h=s.toString(),m=this.getWorkShape(h);if(m){_context37.next=5;break;}return _context37.abrupt("return");case 5:u=m.toolsType;if(!(u===Tt.LaserPen)){_context37.next=8;break;}return _context37.abrupt("return");case 8:_context37.t0=this.combineDrawActiveId&&this.combineDrawActiveId!==h;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:c,viewId:this.viewId,msgType:gt.DrawWork,dataType:Kt.Local},r);case 13:_context37.t1=this.drawWorkActiveId&&this.drawWorkActiveId!==h;if(!_context37.t1){_context37.next=18;break;}_context37.next=17;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:c,viewId:this.viewId,msgType:gt.DrawWork,dataType:Kt.Local},r);case 17:this.drawWorkActiveId=void 0;case 18:!this.drawWorkActiveId&&h!==Me&&(this.drawWorkActiveId=h);_e(l)&&(this.consumeCount=l);y=m.consume({data:t,isFullWork:!0,smoothSync:f});_context37.t2=u;_context37.next=_context37.t2===Tt.Selector?24:_context37.t2===Tt.PencilEraser?30:_context37.t2===Tt.BitMapEraser?30:_context37.t2===Tt.Eraser?32:_context37.t2===Tt.Arrow?35:_context37.t2===Tt.Straight?35:_context37.t2===Tt.Ellipse?35:_context37.t2===Tt.Rectangle?35:_context37.t2===Tt.Star?35:_context37.t2===Tt.Polygon?35:_context37.t2===Tt.SpeechBalloon?35:_context37.t2===Tt.Pencil?41:48;break;case 24:_context37.t3=y.type===gt.Select;if(!_context37.t3){_context37.next=29;break;}y.selectIds&&r.runReverseSelectWork(y.selectIds);_context37.next=29;return this.drawSelector(y);case 29:return _context37.abrupt("break",48);case 30:this.drawCount++,this.combineTimerId||(this.combineTimerId=1,this.combineDrawActiveId=h,this.drawEraserCombine(h,this.drawCount).then(function(){_this91.combineTimerId=void 0;}));return _context37.abrupt("break",48);case 32:_context37.next=34;return this.drawEraser(y);case 34:return _context37.abrupt("break",48);case 35:_context37.t4=y;if(!_context37.t4){_context37.next=40;break;}this.drawCount++;_context37.next=40;return this.drawShape(y);case 40:return _context37.abrupt("break",48);case 41:this.drawCount++;!this.combineTimerId&&this.combineUnitTime!==1/0&&new Promise(function(T){_this91.combineDrawActiveId=h,_this91.combineDrawResolve=T,_this91.combineTimerId=setTimeout(function(){_this91.combineTimerId=void 0,_this91.combineDrawResolve&&_this91.combineDrawResolve(!0);},_this91.combineUnitTime);}).then(function(T){T&&_this91.drawPencilCombine(h,_this91.drawCount),_this91.combineDrawResolve=void 0;});_context37.t5=y;if(!_context37.t5){_context37.next=47;break;}_context37.next=47;return this.drawPencil(y);case 47:return _context37.abrupt("break",48);case 48:case"end":return _context37.stop();}},_callee35,this);}));function consumeDraw(_x58,_x59){return _consumeDraw.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t,r){var l,f,h,n,s,c,m,u,y,T,w,I;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,s=t.scenePath,c=t.isLockSentEventCursor;if(!n){_context38.next=38;break;}m=n.toString();this.drawWorkActiveId===m&&(this.drawWorkActiveId=void 0);u=this.workShapes.get(m);if(u){_context38.next=8;break;}return _context38.abrupt("return");case 8:y=u.toolsType;if(!(y===Tt.LaserPen)){_context38.next=11;break;}return _context38.abrupt("return");case 11:T=this.workShapes.get(pi),w=(l=T==null?void 0:T.selectIds)==null?void 0:l[0],I=u.consumeAll({data:t,workerEngine:this});_context38.t0=y;_context38.next=_context38.t0===Tt.Selector?15:_context38.t0===Tt.PencilEraser?21:_context38.t0===Tt.BitMapEraser?21:_context38.t0===Tt.Eraser?26:_context38.t0===Tt.Arrow?28:_context38.t0===Tt.Straight?28:_context38.t0===Tt.Ellipse?28:_context38.t0===Tt.Rectangle?28:_context38.t0===Tt.Star?28:_context38.t0===Tt.Polygon?28:_context38.t0===Tt.SpeechBalloon?28:_context38.t0===Tt.Pencil?33:38;break;case 15:I.selectIds&&w&&(f=I.selectIds)!=null&&f.includes(w)&&T.cursorBlur();I.selectIds&&r.runReverseSelectWork(I.selectIds);_context38.next=19;return this.drawSelector(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c);case 19:(h=u.selectIds)!=null&&h.length?u.clearTmpPoints():this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 21:_context38.next=23;return this.drawEraserFull(u,_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 23:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 26:this.drawEraser(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker),u.clearTmpPoints();return _context38.abrupt("break",38);case 28:_context38.next=30;return this.drawPencilFull(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 30:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 33:_context38.next=35;return this.drawPencilFull(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 35:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context38.abrupt("break",38);case 38:case"end":return _context38.stop();}},_callee36,this);}));function consumeDrawAll(_x60,_x61){return _consumeDrawAll.apply(this,arguments);}return consumeDrawAll;}()},{key:"workShapesDone",value:function(){var _workShapesDone=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(t,r){var _iterator60,_step60,n;return _regeneratorRuntime().wrap(function _callee37$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:_iterator60=_createForOfIteratorHelper(this.workShapes.keys());_context39.prev=1;_iterator60.s();case 3:if((_step60=_iterator60.n()).done){_context39.next=9;break;}n=_step60.value;_context39.next=7;return this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:gt.DrawWork,dataType:Kt.Local},r);case 7:_context39.next=3;break;case 9:_context39.next=14;break;case 11:_context39.prev=11;_context39.t0=_context39["catch"](1);_iterator60.e(_context39.t0);case 14:_context39.prev=14;_iterator60.f();return _context39.finish(14);case 17:case"end":return _context39.stop();}},_callee37,this,[[1,11,14,17]]);}));function workShapesDone(_x62,_x63){return _workShapesDone.apply(this,arguments);}return workShapesDone;}()},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var s,c,r,n,l,f,h,m,u,y,T;return _regeneratorRuntime().wrap(function _callee38$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:r=this.setFullWork(t),n=t.ops&&Si(t.ops)||t.op;if(!r){_context40.next=30;break;}l=(s=t.workId)==null?void 0:s.toString();if(l){_context40.next=5;break;}return _context40.abrupt("return");case 5:f=(c=this.vNodes.get(l))==null?void 0:c.rect;if(!(r.toolsType===Tt.BackgroundSVG)){_context40.next=10;break;}h=r.consumeService({isFullWork:!0,replaceId:l});_context40.next=24;break;case 10:if(!(r.toolsType===Tt.Image)){_context40.next=17;break;}_context40.next=13;return r.consumeServiceAsync({isFullWork:!0,replaceId:l,worker:this});case 13:h=_context40.sent;m=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);_context40.next=24;break;case 17:if(!(r.toolsType===Tt.Text)){_context40.next=23;break;}_context40.next=20;return r.consumeServiceAsync({isFullWork:!0,replaceId:l,boxRect:this.thread.getSceneRect()});case 20:h=_context40.sent;_context40.next=24;break;case 23:h=r.consumeService({op:n,isFullWork:!0,replaceId:l}),m=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 24:h=Zt(h,m);u=[],y=[];if(!(t.workId&&this.workShapes["delete"](t.workId.toString()),h&&t.willRefresh&&(f&&(u.push({rect:ve(f),isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId}),h=Zt(h,f)),u.push({rect:ve(h),drawCanvas:Ut.Bg,viewId:this.viewId})),t.willSyncService&&y.push({opt:t.opt,toolsType:t.toolsType,type:gt.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),t.needUndoTicker&&y.push({type:gt.None,needUndoTicker:t.needUndoTicker}),u.length||y.length)){_context40.next=30;break;}T={render:u,sp:y};_context40.next=30;return this._post(T);case 30:case"end":return _context40.stop();}},_callee38,this);}));function consumeFull(_x64){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"removeSelector",value:function(){var _removeSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(t,r){var n,s,c,l,f,h,m,_iterator61,_step61,u,y,T;return _regeneratorRuntime().wrap(function _callee39$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:n=t.willSyncService,s=t.needUndoTicker,c=[],l=[],f=[],h=this.workShapes.get(Me);if(h){_context41.next=3;break;}return _context41.abrupt("return");case 3:m=h.selectIds&&_toConsumableArray(h.selectIds)||[];_iterator61=_createForOfIteratorHelper(m);_context41.prev=5;_iterator61.s();case 7:if((_step61=_iterator61.n()).done){_context41.next=22;break;}u=_step61.value;y=this.vNodes.get(u);if(!y){_context41.next=18;break;}_context41.t0=y.toolsType;_context41.next=_context41.t0===Tt.Text?14:_context41.t0===Tt.BackgroundSVG?16:18;break;case 14:c.push({type:gt.TextUpdate,toolsType:Tt.Text,workId:u,dataType:Kt.Local});return _context41.abrupt("break",18);case 16:c.push({type:gt.BackgroundSVGDelete,toolsType:Tt.BackgroundSVG,workId:u,dataType:Kt.Local,viewId:this.viewId});return _context41.abrupt("break",18);case 18:T=this._removeWork(u);T.length&&l.push.apply(l,_toConsumableArray(T)),r==null||r.deleteCachedImagesByWorkId(u),f.push(u);case 20:_context41.next=7;break;case 22:_context41.next=27;break;case 24:_context41.prev=24;_context41.t1=_context41["catch"](5);_iterator61.e(_context41.t1);case 27:_context41.prev=27;_iterator61.f();return _context41.finish(27);case 30:f.length&&c.push({type:gt.RemoveNode,removeIds:f});c.push({type:gt.Select,selectIds:[],willSyncService:n});_context41.next=34;return this.blurSelector();case 34:s&&c.push({type:gt.None,needUndoTicker:s});_context41.t2=l.length||c.length;if(!_context41.t2){_context41.next=39;break;}_context41.next=39;return this._post({render:l,sp:c});case 39:case"end":return _context41.stop();}},_callee39,this,[[5,24,27,30]]);}));function removeSelector(_x65,_x66){return _removeSelector.apply(this,arguments);}return removeSelector;}()},{key:"removeWork",value:function(){var _removeWork2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var r,n,s;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;}s=this._removeWork(n);_context42.t0=s.length;if(!_context42.t0){_context42.next=7;break;}_context42.next=7;return this._post({render:s});case 7:case"end":return _context42.stop();}},_callee40,this);}));function removeWork(_x67){return _removeWork2.apply(this,arguments);}return removeWork;}()},{key:"removeNode",value:function removeNode(t){var _this92=this;var s,c,l;var r=this.vNodes.get(t);r&&(r.toolsType===Tt.BackgroundSVG&&this._post({sp:[{type:gt.BackgroundSVGDelete,toolsType:Tt.BackgroundSVG,workId:t,dataType:Kt.Local,viewId:this.viewId}]}),(s=this.fullLayer)==null||s.getElementsByName(t).forEach(function(f){f.remove(),_vr(f,_this92.fullLayer.parent);}),this.vNodes["delete"](t));var n=this.drawLayer&&Xt.getRectFromLayer(this.drawLayer,t);if(n){var f=(c=this.drawLayer)==null?void 0:c.getElementsByName(t)[0];f&&(f.remove(),_vr(f,(l=this.drawLayer)==null?void 0:l.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,s=[];return r&&s.push({rect:ve(r),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(r),drawCanvas:Ut.Bg,viewId:this.viewId}),n&&s.push({rect:ve(n),clearCanvas:Ut.Float,isClear:!0,viewId:this.viewId},{rect:ve(n),drawCanvas:Ut.Float,viewId:this.viewId}),s;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(t){var r,n,s,c,l,f,h,_iterator62,_step62,_m13,u,y,T,w,m;return _regeneratorRuntime().wrap(function _callee41$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:r=t.op,n=t.viewId,s=t.dataType;if(!(r!=null&&r.length)){_context43.next=32;break;}f=r[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],h=r[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];_iterator62=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context43.prev=4;_iterator62.s();case 6:if((_step62=_iterator62.n()).done){_context43.next=14;break;}_m13=_step62.value;u=_m13.rect,y=_m13.name,T=_m13.toolsType,w=_m13.opt;if(!(T===Tt.Text&&w.workState===te.Done&&_A([f,h],u))){_context43.next=12;break;}c=y,l=this.setFullWork({workId:y,toolsType:T,opt:w});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);_iterator62.e(_context43.t0);case 19:_context43.prev=19;_iterator62.f();return _context43.finish(19);case 22:if(!c){_context43.next=32;break;}_context43.t1=l;if(!_context43.t1){_context43.next=28;break;}_context43.next=27;return l.consumeServiceAsync({isFullWork:!0,replaceId:l.getWorkId(),boxRect:this.thread.getSceneRect()});case 27:m=_context43.sent;case 28:_context43.next=30;return this.blurSelector({viewId:n,msgType:gt.Select,dataType:s,isSync:!0});case 30:_context43.next=32;return this._post({render:m&&[{rect:ve(m),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(m),drawCanvas:Ut.Bg,viewId:this.viewId}],sp:[{type:gt.GetTextActive,toolsType:Tt.Text,workId:c}]});case 32:case"end":return _context43.stop();}},_callee41,this,[[4,16,19,22]]);}));function checkTextActive(_x68){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,s;return _regeneratorRuntime().wrap(function _callee42$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:r=this.workShapes.get(Me),n=t.workId,s=t.msgType;if(!(r&&n&&r.selectIds&&r.selectIds.includes(n.toString()))){_context44.next=6;break;}s===gt.RemoveNode?r.selectIds=r.selectIds.filter(function(c){return c!==n.toString();}):this.effectSelectNodeData.add(t);_context44.next=5;return this.runEffectSelectWork(!0).then(function(){var c;(c=_this93.effectSelectNodeData)==null||c.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(_x69){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var _this94=this;var I,r,n,s,c,l,f,h,m,u,y,T,w;return _regeneratorRuntime().wrap(function _callee43$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:r=this.workShapes.get(Me);if((I=r==null?void 0:r.selectIds)!=null&&I.length){_context45.next=3;break;}return _context45.abrupt("return");case 3:n=t.callback;s=_objectWithoutProperties(t,_excluded2);c=s.updateSelectorOpt;l=s.willSerializeData;f=s.smoothSync;_context45.next=10;return r==null?void 0:r.updateSelector({updateSelectorOpt:c,selectIds:fr(r.selectIds),vNodes:this.vNodes,willSerializeData:l,worker:this});case 10:h=_context45.sent;m=/* @__PURE__ */new Map();h!=null&&h.selectIds&&(u=$M(r.selectIds,h.selectIds),h.selectIds.forEach(function(S){var O=_this94.vNodes.get(S);if(O){var _d48=O.toolsType,v=O.op,p=O.opt;m.set(S,{opt:p,toolsType:_d48,ops:(v==null?void 0:v.length)&&mr(v)||void 0});}}),r.selectIds=h.selectIds);y=[],T=[];h!=null&&h.rect&&y.push({rect:ve(h.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(h.rect),drawCanvas:Ut.Bg,viewId:this.viewId});w=n&&n({res:h,workShapeNode:r,param:s,postData:{render:y,sp:T},newServiceStore:m,smoothSync:f})||{render:y,sp:T};u&&w.sp.push({type:gt.RemoveNode,removeIds:u,viewId:this.viewId});_context45.t0=w.render.length||w.sp.length;if(!_context45.t0){_context45.next=21;break;}_context45.next=21;return this._post(w);case 21:case"end":return _context45.stop();}},_callee43,this);}));function updateSelector(_x70){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var s,r,n,c;return _regeneratorRuntime().wrap(function _callee44$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:r=this.workShapes.get(Me),n=r==null?void 0:r.blurSelector();if(!(this.clearWorkShapeNodeCache(Me),((s=this.fullLayer)==null?void 0:s.parent).children.forEach(function(c){c.name===Me&&c.remove();}),n)){_context46.next=6;break;}c=[];c.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:ve(n.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(n.rect),drawCanvas:Ut.Bg,viewId:this.viewId}],sp:c});case 6:case"end":return _context46.stop();}},_callee44,this);}));function blurSelector(_x71){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"hasSelector",value:function hasSelector(){return this.workShapes.has(Me);}},{key:"getSelector",value:function getSelector(){return this.workShapes.get(Me);}},{key:"reRenderSelector",value:function(){var _reRenderSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(){var t,c,r,n,s,l,_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(Me);if(r){_context47.next=4;break;}return _context47.abrupt("return");case 4:if(!(r&&!((c=r.selectIds)!=null&&c.length))){_context47.next=8;break;}_context47.next=7;return this.blurSelector();case 7:return _context47.abrupt("return");case 8:n=r.oldSelectRect,s=r.reRenderSelector();if(!s){_context47.next=13;break;}l=Zt(n,s)||s;_context47.next=13;return this._post({render:[{rect:ve(l),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(l),drawCanvas:Ut.Bg,viewId:this.viewId}],sp:[{type:gt.Select,selectIds:r.selectIds,selectRect:s,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 s,c,l,f,h,m,u,r,n,_r$updateSelectIds,y,T,w;return _regeneratorRuntime().wrap(function _callee46$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:r=this.workShapes.get(Me),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&&((s=this.tmpOpt)==null?void 0:s.toolsType)===Tt.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),y=_r$updateSelectIds.bgRect,T=_r$updateSelectIds.selectRect,w={render:[],sp:[]};y&&((c=w.render)==null||c.push({rect:ve(y),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(y),drawCanvas:Ut.Bg,viewId:this.viewId}));(u=w.sp)==null||u.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((l=t.opt)==null?void 0:l.strokeColor)||r.selectorColor,strokeColor:((f=t.opt)==null?void 0:f.strokeColor)||r.strokeColor,fillColor:((h=t.opt)==null?void 0:h.fillColor)||r.fillColor,textOpt:((m=t.opt)==null?void 0:m.textOpt)||r.textOpt,canTextEdit:r.canTextEdit,canRotate:r.canRotate,scaleType:r.scaleType,type:gt.Select,selectRect:T,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(w);case 16:case"end":return _context48.stop();}},_callee46,this);}));function updateFullSelectWork(_x72){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(nd,"destroy",this,3)([]),this.effectSelectNodeData.clear();}},{key:"drawEraserCombine",value:function(){var _drawEraserCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t,r){var s,c,l,f,n,h,m,u,y,_iterator63,_step63,_step63$value,_y5,T;return _regeneratorRuntime().wrap(function _callee47$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:n=(s=this.workShapes.get(t))==null?void 0:s.combineConsume({workerEngine:this});if(!n){_context49.next=7;break;}h=n.willDeleteNodes,m=n.willNewNodes,u={render:[],fullWorkerDrawCount:r,sp:[]};if(n!=null&&n.rect){y=ve(n.rect);(c=u.render)==null||c.push({rect:y,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:y,drawCanvas:Ut.Bg,viewId:this.viewId});}if(h!=null&&h.size&&((l=u.sp)==null||l.push({type:gt.RemoveNode,removeIds:_toConsumableArray(h),viewId:this.thread.viewId})),m!=null&&m.size){_iterator63=_createForOfIteratorHelper(m);try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){_step63$value=_slicedToArray(_step63.value,2),_y5=_step63$value[0],T=_step63$value[1];(f=u.sp)==null||f.push({type:gt.FullWork,dataType:Kt.Local,toolsType:Tt.Pencil,ops:mr(T.op),opt:T.opt,workId:_y5,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}}_context49.next=7;return this._post(u);case 7:case"end":return _context49.stop();}},_callee47,this);}));function drawEraserCombine(_x73,_x74){return _drawEraserCombine.apply(this,arguments);}return drawEraserCombine;}()},{key:"drawPencilCombine",value:function(){var _drawPencilCombine=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t,r){var s,c,l,n,f,h;return _regeneratorRuntime().wrap(function _callee48$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:n=(s=this.workShapes.get(t))==null?void 0:s.combineConsume();if(!n){_context50.next=6;break;}f={render:[],fullWorkerDrawCount:r};if(n!=null&&n.rect){h=ve(n.rect);(c=f.render)==null||c.push({rect:h,isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId}),(l=f.render)==null||l.push({rect:h,drawCanvas:Ut.Float,viewId:this.viewId});}_context50.next=6;return this._post(f);case 6:case"end":return _context50.stop();}},_callee48,this);}));function drawPencilCombine(_x75,_x76){return _drawPencilCombine.apply(this,arguments);}return drawPencilCombine;}()},{key:"drawSelector",value:function(){var _drawSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t,r){var s,c,n;return _regeneratorRuntime().wrap(function _callee49$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:n={render:[],sp:[t]};r&&((s=n.sp)==null||s.push({type:gt.None,isLockSentEventCursor:r}));t.rect&&((c=n.render)==null||c.push({rect:ve(t.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(t.rect),drawCanvas:Ut.Bg,viewId:this.viewId}));_context51.next=5;return this._post(n);case 5:case"end":return _context51.stop();}},_callee49,this);}));function drawSelector(_x77,_x78){return _drawSelector.apply(this,arguments);}return drawSelector;}()},{key:"drawPencilFull",value:function(){var _drawPencilFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee50(t,r,n){var c,l,f,s;return _regeneratorRuntime().wrap(function _callee50$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:s={fullWorkerDrawCount:1/0,render:[],sp:[t]};r&&((c=s.sp)==null||c.push({type:gt.None,isLockSentEventCursor:r}));t!=null&&t.rect&&((l=s.render)==null||l.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:t.rect,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Ut.Bg,viewId:this.viewId}));n&&((f=s.sp)==null||f.push({type:gt.None,needUndoTicker:n}));_context52.next=6;return this._post(s);case 6:case"end":return _context52.stop();}},_callee50,this);}));function drawPencilFull(_x79,_x80,_x81){return _drawPencilFull.apply(this,arguments);}return drawPencilFull;}()},{key:"drawEraserFull",value:function(){var _drawEraserFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t,r,n,s){var c,l,f,h,m,u,_iterator64,_step64,_step64$value,T,w,_iterator65,_step65,_step65$value,_T10,_w3,y;return _regeneratorRuntime().wrap(function _callee51$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:c=r.rect,l=r.willUpdateNodes,f=r.willDeleteNodes,h=r.willNewNodes,m=t.getWorkId(),u=[{type:gt.RemoveNode,removeIds:[m],viewId:this.viewId}];if(n&&u.push({type:gt.None,isLockSentEventCursor:n}),l!=null&&l.size||f!=null&&f.size||h!=null&&h.size){if(l!=null&&l.size){_iterator64=_createForOfIteratorHelper(l);try{for(_iterator64.s();!(_step64=_iterator64.n()).done;){_step64$value=_slicedToArray(_step64.value,2),T=_step64$value[0],w=_step64$value[1];u.push({type:gt.UpdateNode,dataType:Kt.Local,opt:w.opt,workId:T,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator64.e(err);}finally{_iterator64.f();}}if(f!=null&&f.size&&u.push({type:gt.RemoveNode,removeIds:_toConsumableArray(f),viewId:this.thread.viewId}),h!=null&&h.size){_iterator65=_createForOfIteratorHelper(h);try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){_step65$value=_slicedToArray(_step65.value,2),_T10=_step65$value[0],_w3=_step65$value[1];u.push({type:gt.FullWork,dataType:Kt.Local,toolsType:_w3.toolsType,ops:mr(_w3.op),opt:_w3.opt,workId:_T10,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}}}y=[{isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}];c&&y.push({rect:c,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:c,drawCanvas:Ut.Bg,viewId:this.viewId});s&&u.push({type:gt.None,needUndoTicker:s});_context53.next=7;return this._post({sp:u,render:y,fullWorkerDrawCount:1/0});case 7:case"end":return _context53.stop();}},_callee51,this);}));function drawEraserFull(_x82,_x83,_x84,_x85){return _drawEraserFull.apply(this,arguments);}return drawEraserFull;}()},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t,r,n){var s,c;return _regeneratorRuntime().wrap(function _callee52$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:s=[],c=[];r&&s.push({type:gt.None,isLockSentEventCursor:r});t.removeIds&&s.push(t);t.rect&&c.push({rect:t.rect,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Ut.Bg,viewId:this.viewId});n&&s.push({type:gt.None,needUndoTicker:n});_context54.next=7;return this._post({sp:s,render:c,consumeCount:this.consumeCount});case 7:case"end":return _context54.stop();}},_callee52,this);}));function drawEraser(_x86,_x87,_x88){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(_x89){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(_x90){return _drawPencil.apply(this,arguments);}return drawPencil;}()},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(t){var r,_iterator66,_step66,n,s,c,l;return _regeneratorRuntime().wrap(function _callee55$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:_iterator66=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context57.prev=1;_iterator66.s();case 3:if((_step66=_iterator66.n()).done){_context57.next=27;break;}n=_step66.value;s=this.setFullWork(n);if(!s){_context57.next=25;break;}c=(r=s.getWorkId())==null?void 0:r.toString();if(!(s.toolsType===Tt.BackgroundSVG)){_context57.next=12;break;}s.consumeService({isFullWork:!0,replaceId:c});_context57.next=24;break;case 12:if(!(s.toolsType===Tt.Image)){_context57.next=17;break;}_context57.next=15;return s.consumeServiceAsync({isFullWork:!0,replaceId:c,worker:this});case 15:_context57.next=24;break;case 17:if(!(s.toolsType===Tt.Text)){_context57.next=22;break;}_context57.next=20;return s.consumeServiceAsync({isFullWork:!0,replaceId:c,boxRect:this.thread.getSceneRect()});case 20:_context57.next=24;break;case 22:l=n.ops&&Si(n.ops);s.consumeService({op:l,isFullWork:!0,replaceId:c}),n!=null&&n.updateNodeOpt&&s.updataOptService(n.updateNodeOpt);case 24:n.workId&&this.workShapes["delete"](n.workId.toString());case 25:_context57.next=3;break;case 27:_context57.next=32;break;case 29:_context57.prev=29;_context57.t0=_context57["catch"](1);_iterator66.e(_context57.t0);case 32:_context57.prev=32;_iterator66.f();return _context57.finish(32);case 35:_context57.next=37;return this.reRenderSelector(t);case 37:case"end":return _context57.stop();}},_callee55,this,[[1,29,32,35]]);}));function runEffectSelectWork(_x91){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function(){var _cursorHover=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(t){var l,r,n,s,c,f,h;return _regeneratorRuntime().wrap(function _callee56$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:r=t.opt,n=t.toolsType,s=t.point,c=this.setFullWork({workId:pi,toolsType:n,opt:r});if(!(c&&s)){_context58.next=8;break;}f=c.cursorHover(s),h={render:[]};_context58.t0=f&&f.type===gt.CursorHover&&f.rect;if(!_context58.t0){_context58.next=8;break;}(l=h.render)==null||l.push({rect:ve(f.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(f.rect),drawCanvas:Ut.Bg,viewId:this.viewId});_context58.next=8;return this._post(h);case 8:case"end":return _context58.stop();}},_callee56,this);}));function cursorHover(_x92){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(pi);_context59.t0=t&&(n=t.selectIds)!=null&&n.length;if(!_context59.t0){_context59.next=10;break;}r=t.oldSelectRect;t.cursorBlur();this.clearWorkShapeNodeCache(pi);_context59.t1=r;if(!_context59.t1){_context59.next=10;break;}_context59.next=10;return this._post({render:[{rect:ve(r),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(r),drawCanvas:Ut.Bg,viewId:this.viewId}]});case 10:this.fullLayer.parent.children.forEach(function(s){s.name==="Cursor_Hover_Id"&&s.remove();});case 11:case"end":return _context59.stop();}},_callee57,this);}));function cursorBlur(){return _cursorBlur.apply(this,arguments);}return cursorBlur;}()}]);}(Bl);var id=/*#__PURE__*/function(){function id(e){_classCallCheck(this,id);dt(this,"viewId");dt(this,"vNodes");dt(this,"fullLayer");dt(this,"drawLayer");dt(this,"workShapes",/* @__PURE__ */new Map());dt(this,"selectorWorkShapes",/* @__PURE__ */new Map());dt(this,"thread");dt(this,"animationId");dt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());dt(this,"runEffectId");dt(this,"noAnimationRect");dt(this,"syncUnitTime",gr.syncOpt.interval);dt(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(id,[{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(_x93){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=Io({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 s;if((s=r.selectIds)!=null&&s.length){var c=r.selectIds.indexOf(t);c>-1&&(r.selectIds.splice(c,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(_x94){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,m,s,c,l,f,h,_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(Me)>-1&&this.removeSelectWork(t);s=r;c=(m=this.vNodes.get(e))==null?void 0:m.rect;c&&(s=Zt(c,s));l=this.fullLayer&&Xt.getRectFromLayer(this.fullLayer,e);s=Zt(s,l);f=this.drawLayer&&Xt.getRectFromLayer(this.drawLayer,e);s=Zt(s,f),this.fullLayer.getElementsByName(e).forEach(function(u){u.remove(),_vr(u,_this96.fullLayer.parent);}),this.drawLayer.getElementsByName(e).forEach(function(u){u.remove(),_vr(u,_this96.drawLayer.parent);});h=this.vNodes.get(e);h&&h.toolsType===Tt.BackgroundSVG&&this.post({sp:[{type:gt.BackgroundSVGDelete,toolsType:Tt.BackgroundSVG,workId:e,dataType:Kt.Service,viewId:this.viewId}]});this.vNodes["delete"](e);_context62.t0=s;if(!_context62.t0){_context62.next=16;break;}_context62.next=16;return this.post({render:[{rect:ve(s),isClear:!0,clearCanvas:n?Ut.Bg:Ut.ServiceFloat,workerType:n?void 0:Kt.Service,viewId:this.viewId},{rect:ve(s),drawCanvas:n?Ut.Bg:Ut.ServiceFloat,workerType:n?void 0:Kt.Service,viewId:this.viewId}]});case 16:case"end":return _context62.stop();}},_callee60,this);}));function removeNode(_x95,_x96,_x97){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"activeWorkShape",value:function activeWorkShape(e){var w,I,S,O;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,c=e.updateNodeOpt,l=e.ops,f=e.op,h=e.useAnimation,m=e.isEnableCursor;if(!t)return;var u=t.toString(),y=(w=this.vNodes.get(u))==null?void 0:w.rect;if(!((I=this.workShapes)!=null&&I.has(u))){var _d49={toolsType:n,animationWorkData:f||[],animationIndex:0,type:s,updateNodeOpt:c,ops:l,useAnimation:_typeof(h)<"u"?h:_typeof(c==null?void 0:c.useAnimation)<"u"?c==null?void 0:c.useAnimation:!0,oldRect:y,isDiff:!1,isEnableCursor:m};n&&r&&(_d49=this.setNodeKey(u,_d49,n,r)),(S=this.workShapes)==null||S.set(u,_d49);}var T=(O=this.workShapes)==null?void 0:O.get(u);T.isEnableCursor=m,s&&(T.type=s),l&&(T.animationWorkData=Si(l),T.ops=l),c&&(T.updateNodeOpt=c),f&&(T.isDiff=this.hasDiffData(T.animationWorkData||[],f,T.toolsType),T.animationWorkData=f),T.node&&T.node.getWorkId()!==u&&T.node.setWorkId(u),y&&(T.oldRect=y),n&&r&&(r.syncUnitTime&&(this.syncUnitTime=r.syncUnitTime),T.toolsType!==n&&n&&r&&this.setNodeKey(u,T,n,r),T.node&&T.node.setWorkOptions(r));}},{key:"hasDiffData",value:function hasDiffData(e,t,r){var n=e.length;if(t.length<n)return!0;switch(r){case Tt.Pencil:{for(var s=0;s<n;s+=3)if(t[s]!==e[s]||t[s+1]!==e[s+1])return!0;break;}case Tt.LaserPen:{for(var _s2=0;_s2<n;_s2+=2)if(t[_s2]!==e[_s2]||t[_s2+1]!==e[_s2+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee61(){var _this97=this;var n,s,c,l,f,h,m,u,y,T,w,I,S,O,d,v,p,x,E,R,D,U,M,W,X,B,N,$,J,tt,at,ut,V,Q,ft,mt,yt,wt,ht,Nt,Dt,G,k,rt,e,t,r,_iterator67,_step67,_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();_iterator67=_createForOfIteratorHelper(this.workShapes.entries());_context64.prev=4;_loop6=/*#__PURE__*/_regeneratorRuntime().mark(function _loop6(){var _step67$value,nt,Y,Z,C,_Z3,_C2,_Z4,_C3,_Z5,_C4,L,z,_Z6,_C5,_L,_z2,K,q,it,_q,_Z7,_C6,_L2,_z3;return _regeneratorRuntime().wrap(function _loop6$(_context63){while(1)switch(_context63.prev=_context63.next){case 0:_step67$value=_slicedToArray(_step67.value,2),nt=_step67$value[0],Y=_step67$value[1];_context63.t0=Y.toolsType;_context63.next=_context63.t0===Tt.BackgroundSVG?4:_context63.t0===Tt.Image?9:_context63.t0===Tt.Text?16:_context63.t0===Tt.Arrow?24:_context63.t0===Tt.Straight?24:_context63.t0===Tt.Rectangle?24:_context63.t0===Tt.Ellipse?24:_context63.t0===Tt.Star?24:_context63.t0===Tt.Polygon?24:_context63.t0===Tt.SpeechBalloon?24:_context63.t0===Tt.Pencil?27:43;break;case 4:Z=Y.oldRect;Z&&((n=t.render)==null||n.push({rect:Z,isClear:!0,clearCanvas:Ut.Bg,viewId:_this97.viewId}),(s=t.render)==null||s.push({rect:Z,drawCanvas:Ut.Bg,viewId:_this97.viewId}));C=(c=Y.node)==null?void 0:c.consumeService({isFullWork:!0,replaceId:nt});_this97.selectorWorkShapes.forEach(function(L,z){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this97.willRunEffectSelectorIds.add(z),_this97.noAnimationRect=Zt(_this97.noAnimationRect,Z),_this97.noAnimationRect=Zt(_this97.noAnimationRect,C),_this97.runEffect());}),_this97.workShapes["delete"](nt),(l=t.render)==null||l.push({rect:C,drawCanvas:Ut.Bg,viewId:_this97.viewId});return _context63.abrupt("break",43);case 9:_Z3=Y.oldRect;_Z3&&((f=t.render)==null||f.push({rect:_Z3,isClear:!0,clearCanvas:Ut.Bg,viewId:_this97.viewId}),(h=t.render)==null||h.push({rect:_Z3,drawCanvas:Ut.Bg,viewId:_this97.viewId}));_context63.next=13;return(m=Y.node)==null?void 0:m.consumeServiceAsync({isFullWork:!0,worker:_this97.thread});case 13:_C2=_context63.sent;_this97.selectorWorkShapes.forEach(function(L,z){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this97.willRunEffectSelectorIds.add(z),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_Z3),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_C2),_this97.runEffect());}),_this97.workShapes["delete"](nt),(u=t.render)==null||u.push({rect:_C2,drawCanvas:Ut.Bg,viewId:_this97.viewId});return _context63.abrupt("break",43);case 16:if(!Y.node){_context63.next=23;break;}_Z4=Y.oldRect;_Z4&&((y=t.render)==null||y.push({rect:_Z4,isClear:!0,clearCanvas:Ut.Bg,viewId:_this97.viewId}),(T=t.render)==null||T.push({rect:_Z4,drawCanvas:Ut.Bg,viewId:_this97.viewId}));_context63.next=21;return Y.node.consumeServiceAsync({isFullWork:!0,replaceId:nt,boxRect:_this97.thread.getSceneRect()});case 21:_C3=_context63.sent;_this97.selectorWorkShapes.forEach(function(L,z){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this97.willRunEffectSelectorIds.add(z),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_Z4),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_C3),_this97.runEffect());}),(w=Y.node)==null||w.clearTmpPoints(),_this97.workShapes["delete"](nt),(I=t.render)==null||I.push({rect:_C3,drawCanvas:Ut.Bg,viewId:_this97.viewId});case 23:return _context63.abrupt("break",43);case 24:_Z5=!!Y.ops;if((S=Y.animationWorkData)!=null&&S.length){_C4=Y.oldRect,L=Y.node.oldRect;_C4&&((O=t.render)==null||O.push({rect:_C4,isClear:!0,clearCanvas:Ut.Bg,viewId:_this97.viewId}),(d=t.render)==null||d.push({rect:_C4,drawCanvas:Ut.Bg,viewId:_this97.viewId})),L&&((v=t.render)==null||v.push({rect:L,isClear:!0,clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId}));z=(p=Y.node)==null?void 0:p.consumeService({op:Y.animationWorkData,isFullWork:_Z5});Y.isEnableCursor?r.set(nt,{workState:_C4?Y.ops?te.Done:te.Doing:te.Start,op:Y.animationWorkData.slice(-3,-1)}):_Z5&&!Y.useAnimation&&(x=Y.updateNodeOpt)!=null&&x.useAnimation&&r.set(nt,{workState:te.Done,op:Y.animationWorkData.slice(-3,-1),uid:(E=Y.updateNodeOpt)==null?void 0:E.uid}),_Z5?(_this97.selectorWorkShapes.forEach(function(K,q){var it;(it=K.selectIds)!=null&&it.includes(nt)&&(_this97.willRunEffectSelectorIds.add(q),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_C4),_this97.noAnimationRect=Zt(_this97.noAnimationRect,L),_this97.noAnimationRect=Zt(_this97.noAnimationRect,z),_this97.runEffect());}),(R=Y.node)==null||R.clearTmpPoints(),_this97.workShapes["delete"](nt),(D=t.render)==null||D.push({rect:z,drawCanvas:Ut.Bg,viewId:_this97.viewId})):(U=t.render)==null||U.push({rect:z,drawCanvas:Ut.ServiceFloat,workerType:_Z5?void 0:Kt.Service,viewId:_this97.viewId}),Y.animationWorkData.length=0;}return _context63.abrupt("break",43);case 27:if(!Y.useAnimation){_context63.next=38;break;}if(!Y.useAnimation){_context63.next=36;break;}if(!Y.isDel){_context63.next=32;break;}(ft=Y.node)==null||ft.clearTmpPoints(),_this97.workShapes["delete"](nt);return _context63.abrupt("break",43);case 32:_Z6=3,_C5=_this97.computNextAnimationIndex(Y,_Z6),_L=Y.isDiff?0:Math.max(0,(Y.animationIndex||0)-_Z6),_z2=(Y.animationWorkData||[]).slice(0,_C5),K=(yt=(mt=Y.node)==null?void 0:mt.getWorkId())==null?void 0:yt.toString();if((Y.animationIndex||0)<_C5||Y.isDiff){q=(wt=Y.node)==null?void 0:wt.consumeService({op:_z2,isFullWork:!1,replaceId:K});if((ht=t.render)==null||ht.push({isClear:!0,rect:q,clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),(Nt=t.render)==null||Nt.push({rect:q,drawCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),Y.animationIndex=_C5,Y.isDiff&&(Y.isDiff=!1),_z2.length&&Y.isEnableCursor){it=_z2.slice(-3,-1);r.set(nt,{workState:_L===0?te.Start:_C5===((Dt=Y.animationWorkData)==null?void 0:Dt.length)?te.Done:te.Doing,op:it});}}else if(Y.ops){_q=(G=Y.node)==null?void 0:G.consumeService({op:Y.animationWorkData||[],isFullWork:!0,replaceId:K});Y.isDel=!0,(k=t.render)==null||k.push({isClear:!0,rect:_q,clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId},{rect:_q,drawCanvas:Ut.ServiceFloat,viewId:_this97.viewId},{isClear:!0,rect:_q,clearCanvas:Ut.Bg,viewId:_this97.viewId},{rect:_q,drawCanvas:Ut.Bg,viewId:_this97.viewId}),Y.isEnableCursor&&r.set(nt,{workState:te.Done,op:_z2.slice(-3,-1)});}e=!0;return _context63.abrupt("break",43);case 36:_context63.next=42;break;case 38:_Z7=!!Y.ops;_C6=(M=Y.node)==null?void 0:M.consumeService({op:Y.animationWorkData||[],isFullWork:_Z7,replaceId:nt});_L2=(W=Y.node)==null?void 0:W.updataOptService(Y.updateNodeOpt);if(_Z7){if(_C6=Zt(_C6,_L2),(X=t.render)==null||X.push({isClear:!0,rect:Zt(Y.oldRect,_C6),clearCanvas:Ut.Bg,viewId:_this97.viewId}),(B=t.render)==null||B.push({rect:Zt(Y.oldRect,_C6),drawCanvas:Ut.Bg,viewId:_this97.viewId}),(N=Y.updateNodeOpt)!=null&&N.useAnimation&&(($=t.render)==null||$.push({isClear:!0,rect:Zt(Y.oldRect,_C6),clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),(J=t.render)==null||J.push({rect:Zt(Y.oldRect,_C6),drawCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),!Y.isEnableCursor&&(tt=Y.animationWorkData)!=null&&tt.length)){_z3=Y.animationWorkData.slice(-3,-1);r.set(nt,{workState:te.Done,op:_z3,uid:(at=Y.updateNodeOpt)==null?void 0:at.uid});}_this97.selectorWorkShapes.forEach(function(z,K){var q;(q=z.selectIds)!=null&&q.includes(nt)&&(_this97.willRunEffectSelectorIds.add(K),_this97.noAnimationRect=Zt(_this97.noAnimationRect,_C6),_this97.runEffect());}),(ut=Y.node)==null||ut.clearTmpPoints(),_this97.workShapes["delete"](nt);}else _C6=Zt(_C6,_L2),(V=t.render)==null||V.push({isClear:!0,rect:Zt(Y.oldRect,_C6),clearCanvas:Ut.ServiceFloat,viewId:_this97.viewId}),(Q=t.render)==null||Q.push({rect:Zt(Y.oldRect,_C6),drawCanvas:Ut.ServiceFloat,viewId:_this97.viewId});case 42:return _context63.abrupt("break",43);case 43:case"end":return _context63.stop();}},_loop6);});_iterator67.s();case 7:if((_step67=_iterator67.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);_iterator67.e(_context64.t1);case 16:_context64.prev=16;_iterator67.f();return _context64.finish(16);case 19:e&&this.runAnimation();r.size&&(t.sp=[],r.forEach(function(nt,Y){var Z;(Z=t.sp)==null||Z.push({type:gt.Cursor,uid:nt.uid||Y.split(yi)[0],op:nt.op,workState:nt.workState,viewId:_this97.viewId});}));_context64.t2=(rt=t.render)!=null&&rt.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 s,c;var r=_this99.selectorWorkShapes.get(t),n=r&&r.selectIds&&((s=r.node)==null?void 0:s.selectServiceNode(t,r,!0));e=Zt(e,n),(c=r==null?void 0:r.selectIds)!=null&&c.length||_this99.selectorWorkShapes["delete"](t);});_context65.t0=e;if(!_context65.t0){_context65.next=7;break;}_context65.next=7;return this.post({render:[{rect:ve(e),isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:ve(e),drawCanvas:Ut.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,u,y;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,c=e.selectIds,l=e.imageBitmap;if(!t)return;var f=t.toString();if(!((m=this.selectorWorkShapes)!=null&&m.has(f))){var T={toolsType:n,selectIds:c,type:s,opt:r,imageBitmap:l};n&&r&&(T=this.setNodeKey(f,T,n,r)),(u=this.selectorWorkShapes)==null||u.set(f,T);}var h=(y=this.selectorWorkShapes)==null?void 0:y.get(f);s&&(h.type=s),h.node&&h.node.getWorkId()!==f&&h.node.setWorkId(f),l&&(h.imageBitmap=l),h.selectIds=c||[];}}]);}();var jM=/*#__PURE__*/function(_Bl2){function jM(t){var _this100;_classCallCheck(this,jM);_this100=_callSuper(this,jM,[t]);dt(_this100,"drawWorkActiveId");return _this100;}_inherits(jM,_Bl2);return _createClass(jM,[{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 _iterator68=_createForOfIteratorHelper(this.workShapes.keys()),_step68;try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){var t=_step68.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}Lr(this.fullLayer,this.fullLayer.parent);}},{key:"consumeDraw",value:function(){var _consumeDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee63(t){var r,n,s,c,l,f,h;return _regeneratorRuntime().wrap(function _callee63$(_context66){while(1)switch(_context66.prev=_context66.next){case 0:r=t.workId,n=t.fullWorkerDrawCount,s=t.postCount,c=r==null?void 0:r.toString(),l=c&&this.workShapes.get(c);if(l){_context66.next=3;break;}return _context66.abrupt("return");case 3:_context66.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==c;if(!_context66.t0){_context66.next=8;break;}_context66.next=7;return this.consumeDrawAll({workId:this.drawWorkActiveId,viewId:this.viewId,msgType:gt.DrawWork,dataType:Kt.Local});case 7:this.drawWorkActiveId=void 0;case 8:!this.drawWorkActiveId&&c!==Me&&(this.drawWorkActiveId=c);f=l.toolsType;_e(s)&&(this.consumeCount=s);h=l.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0,removeDrawCount:n});_context66.t1=f;_context66.next=_context66.t1===Tt.Selector?15:_context66.t1===Tt.Ellipse?21:_context66.t1===Tt.Arrow?21:_context66.t1===Tt.Straight?21:_context66.t1===Tt.Rectangle?21:_context66.t1===Tt.Star?21:_context66.t1===Tt.Polygon?21:_context66.t1===Tt.SpeechBalloon?21:_context66.t1===Tt.Pencil?27:_context66.t1===Tt.BitMapEraser?33:_context66.t1===Tt.PencilEraser?33:39;break;case 15:_context66.t2=h;if(!_context66.t2){_context66.next=20;break;}this.drawCount++;_context66.next=20;return this.drawSelector(h);case 20:return _context66.abrupt("break",39);case 21:_context66.t3=h;if(!_context66.t3){_context66.next=26;break;}this.drawCount++;_context66.next=26;return this.drawShape(h);case 26:return _context66.abrupt("break",39);case 27:_context66.t4=h;if(!_context66.t4){_context66.next=32;break;}this.drawCount++;_context66.next=32;return this.drawPencil(h,r==null?void 0:r.toString());case 32:return _context66.abrupt("break",39);case 33:_context66.t5=h;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(_x98){return _consumeDraw3.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee64(t){var r,n,s;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);s=this.workShapes.get(n);if(s){_context67.next=7;break;}return _context67.abrupt("return");case 7:_context67.t0=s.toolsType;_context67.next=_context67.t0===Tt.Selector?10:_context67.t0===Tt.Arrow?12:_context67.t0===Tt.Straight?12:_context67.t0===Tt.Ellipse?12:_context67.t0===Tt.Pencil?12:_context67.t0===Tt.Rectangle?12:_context67.t0===Tt.Star?12:_context67.t0===Tt.Polygon?12:_context67.t0===Tt.SpeechBalloon?12:_context67.t0===Tt.BitMapEraser?12:_context67.t0===Tt.PencilEraser?12:14;break;case 10:this.drawCount=0,Lr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n),this._post({render:[{isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}]});return _context67.abrupt("break",14);case 12:this.drawCount=0,Lr(this.fullLayer,this.fullLayer.parent),this.clearWorkShapeNodeCache(n);return _context67.abrupt("break",14);case 14:case"end":return _context67.stop();}},_callee64,this);}));function consumeDrawAll(_x99){return _consumeDrawAll2.apply(this,arguments);}return consumeDrawAll;}()},{key:"removeWork",value:function(){var _removeWork4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee65(t){var r,n,s,c;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;}s=this.removeNode(n);if(!s){_context68.next=8;break;}c=[];c.push({rect:ve(s),clearCanvas:Ut.Float,isClear:!0,viewId:this.viewId},{rect:ve(s),drawCanvas:Ut.Float,viewId:this.viewId});_context68.next=8;return this._post({render:c});case 8:case"end":return _context68.stop();}},_callee65,this);}));function removeWork(_x100){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(s){var c=s.getBoundingClientRect();n=Zt(n,{x:c.x-Xt.SafeBorderPadding,y:c.y-Xt.SafeBorderPadding,w:c.width+Xt.SafeBorderPadding*2,h:c.height+Xt.SafeBorderPadding*2}),s.remove(),_vr(s,_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:Ut.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context69.stop();}},_callee66,this);}));function drawPencil(_x101,_x102){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)&&ve(t.rect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&ve(t.rect),drawCanvas:Ut.Float,viewId:this.viewId}]});case 2:case"end":return _context70.stop();}},_callee67,this);}));function drawShape(_x103){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)&&ve(t.rect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&ve(t.rect),drawCanvas:Ut.Float,viewId:this.viewId}]});case 2:case"end":return _context71.stop();}},_callee68,this);}));function drawSelector(_x104){return _drawSelector2.apply(this,arguments);}return drawSelector;}()}]);}(Bl);var GM=/*#__PURE__*/function(){function GM(e){_classCallCheck(this,GM);dt(this,"viewId");dt(this,"vNodes");dt(this,"topLayer");dt(this,"thread");dt(this,"post");dt(this,"serviceWorkShapes",/* @__PURE__ */new Map());dt(this,"localWorkShapes",/* @__PURE__ */new Map());dt(this,"tmpOpt");dt(this,"syncUnitTime",gr.syncOpt.interval);dt(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(GM,[{key:"canUseTopLayer",value:function canUseTopLayer(e){return e===Tt.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:te.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===Tt.LaserPen)return Io(_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===Kt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),s=n&&this.localWorkShapes.get(n);if(!s)return;var c=s.node.consume({data:e,isFullWork:!1,isSubWorker:!0});c.rect&&(s.totalRect=Zt(c.rect,s.totalRect),s.result=c,s.workState=te.Doing,n&&this.localWorkShapes.set(n,s));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(e){var t=e.workId,r=e.dataType;if(r===Kt.Service)this.activeServiceWorkShape(e);else{var n=t==null?void 0:t.toString(),s=n&&this.localWorkShapes.get(n);if(!s)return;var c=s.node.consumeAll({data:e});s.totalRect=Zt(c.rect,s.totalRect),s.result=c,s.workState=te.Done,n&&this.localWorkShapes.set(n,s);}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 y,T;var t=e.workId,r=e.opt,n=e.toolsType,s=e.type,c=e.updateNodeOpt,l=e.ops,f=e.op;if(!t)return;var h=t.toString(),m=(y=this.vNodes.get(h))==null?void 0:y.rect;if(!((T=this.serviceWorkShapes)!=null&&T.has(h))){var w={toolsType:n,animationWorkData:f||[],animationIndex:0,type:s,updateNodeOpt:c,ops:l,oldRect:m};n&&r&&(w=this.setNodeKey(h,w,n,r)),this.serviceWorkShapes.set(h,w);}var u=this.serviceWorkShapes.get(h);s&&(u.type=s),l&&(u.animationWorkData=Si(l),u.ops=l),c&&(u.updateNodeOpt=c),f&&(u.animationWorkData=f),u.node&&u.node.getWorkId()!==h&&u.node.setWorkId(h),m&&(u.oldRect=m),n&&r&&(u.toolsType!==n&&n&&r&&this.setNodeKey(h,u,n,r),u.node&&u.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 c,l,f,h,e,t,r,n,s,_iterator69,_step69,_step69$value,m,u,T,w,I,S,_iterator70,_step70,_step70$value,_m14,_u7,y,_T11,_w4,_I5,_S26;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=[],s=[];_iterator69=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context72.prev=4;_iterator69.s();case 6:if((_step69=_iterator69.n()).done){_context72.next=20;break;}_step69$value=_slicedToArray(_step69.value,2),m=_step69$value[0],u=_step69$value[1];_context72.t0=u.toolsType;_context72.next=_context72.t0===Tt.LaserPen?11:18;break;case 11:T=this.computNextAnimationIndex(u,8),w=Math.max(0,u.animationIndex||0),I=(u.animationWorkData||[]).slice(w,T);if((u.animationIndex||0)<T){S=(c=u.node)==null?void 0:c.consumeService({op:I,isFullWork:!1});u.totalRect=Zt(u.totalRect,S),u.animationIndex=T,I.length&&t.set(m,{workState:w===0?te.Start:T===((l=u.animationWorkData)==null?void 0:l.length)?te.Done:te.Doing,op:I.slice(-2)});}if(!(n.push({isClear:!0,rect:u.totalRect,clearCanvas:Ut.TopFloat,viewId:this.viewId}),r.push({rect:u.totalRect,drawCanvas:Ut.TopFloat,viewId:this.viewId}),u.isDel)){_context72.next=16;break;}(f=u.node)==null||f.clearTmpPoints(),this.serviceWorkShapes["delete"](m);return _context72.abrupt("break",18);case 16:u.ops&&u.animationIndex===((h=u.animationWorkData)==null?void 0:h.length)&&!u.isDel&&(this.topLayer.getElementsByName(m.toString())[0]||(u.isDel=!0,this.serviceWorkShapes.set(m,u))),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);_iterator69.e(_context72.t1);case 25:_context72.prev=25;_iterator69.f();return _context72.finish(25);case 28:_iterator70=_createForOfIteratorHelper(this.localWorkShapes.entries());_context72.prev=29;_iterator70.s();case 31:if((_step70=_iterator70.n()).done){_context72.next=44;break;}_step70$value=_slicedToArray(_step70.value,2),_m14=_step70$value[0],_u7=_step70$value[1];y=_u7.result,_T11=_u7.toolsType,_w4=_u7.totalRect,_I5=_u7.isDel,_S26=_u7.workState;_context72.t2=_T11;_context72.next=_context72.t2===Tt.LaserPen?37:42;break;case 37:if(!(_w4&&(n.push({isClear:!0,rect:_w4,clearCanvas:Ut.TopFloat,viewId:this.viewId}),r.push({rect:_w4,drawCanvas:Ut.TopFloat,viewId:this.viewId})),_I5)){_context72.next=40;break;}_u7.node.clearTmpPoints(),this.localWorkShapes["delete"](_m14),s.push({removeIds:[_m14.toString()],viewId:this.viewId,type:gt.RemoveNode});return _context72.abrupt("break",42);case 40:y&&((y.op||y.ops)&&s.push(y),_u7.result=void 0),!this.topLayer.getElementsByName(_m14.toString())[0]&&_S26===te.Done&&(_u7.isDel=!0,this.localWorkShapes.set(_m14,_u7)),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);_iterator70.e(_context72.t3);case 49:_context72.prev=49;_iterator70.f();return _context72.finish(49);case 52:e&&this.runAnimation(),t.size&&t.forEach(function(m,u){s.push({type:gt.Cursor,uid:u.split(yi)[0],op:m.op,workState:m.workState,viewId:_this102.viewId});}),(r.length||n.length||s.length)&&this.post({render:[].concat(n,r),sp:s});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 kM=/*#__PURE__*/function(_nd){function kM(t){var _this104;_classCallCheck(this,kM);_this104=_callSuper(this,kM,[t]);dt(_this104,"_type","simple");return _this104;}_inherits(kM,_nd);return _createClass(kM,[{key:"createWorkShapeNode",value:function createWorkShapeNode(t){var n;var r=t.toolsType;return r===Tt.Selector?this.vNodes?new ki(_objectSpread(_objectSpread({},t),{},{fullLayer:this.fullLayer,vNodes:this.vNodes,drawLayer:this.drawLayer})):void 0:Io(_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:Ut.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});case 2:case"end":return _context73.stop();}},_callee70,this);}));function drawPencil(_x105,_x106){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)&&ve(t.rect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&ve(t.rect),drawCanvas:Ut.Float,viewId:this.viewId}]});case 2:case"end":return _context74.stop();}},_callee71,this);}));function drawShape(_x107){return _drawShape3.apply(this,arguments);}return drawShape;}()},{key:"drawSelector",value:function(){var _drawSelector3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(t,r){var n,c,l,f,s,_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]:[];s={render:n,sp:[t],consumeCount:this.consumeCount};r&&((c=s.sp)==null||c.push({type:gt.None,isLockSentEventCursor:r}));t.subRect&&((l=s.render)==null||l.push({rect:ve(t.subRect),isClear:!0,clearCanvas:Ut.Float,viewId:this.viewId},{rect:ve(t.subRect),drawCanvas:Ut.Float,viewId:this.viewId}));t.rect&&((f=s.render)==null||f.push({rect:ve(t.rect),clearCanvas:Ut.Bg,isClear:!0,viewId:this.viewId},{rect:ve(t.rect),drawCanvas:Ut.Bg,viewId:this.viewId}));_context75.next=7;return this._post(s);case 7:case"end":return _context75.stop();}},_callee72,this);}));function drawSelector(_x108,_x109){return _drawSelector3.apply(this,arguments);}return drawSelector;}()},{key:"drawEraserCombine",value:function(){var _drawEraserCombine2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee73(t){var n,s,c,l,r,f,h,m,u,_iterator71,_step71,_step71$value,_u8,y;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;}f=r.willDeleteNodes,h=r.willNewNodes,m={render:[],sp:[]};if(r!=null&&r.rect){u=ve(r.rect);(s=m.render)==null||s.push({rect:u,isClear:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{rect:u,drawCanvas:Ut.Bg,viewId:this.viewId});}if(f!=null&&f.size&&((c=m.sp)==null||c.push({type:gt.RemoveNode,removeIds:_toConsumableArray(f),viewId:this.thread.viewId})),h!=null&&h.size){_iterator71=_createForOfIteratorHelper(h);try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){_step71$value=_slicedToArray(_step71.value,2),_u8=_step71$value[0],y=_step71$value[1];(l=m.sp)==null||l.push({type:gt.FullWork,dataType:Kt.Local,toolsType:Tt.Pencil,ops:mr(y.op),opt:y.opt,workId:_u8,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}}_context76.next=7;return this._post(m);case 7:case"end":return _context76.stop();}},_callee73,this);}));function drawEraserCombine(_x110){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,s,c,l,f,h,m,u,y;return _regeneratorRuntime().wrap(function _callee74$(_context77){while(1)switch(_context77.prev=_context77.next){case 0:n=t.op,s=t.workId,c=t.scenePath,l=t.postCount,f=t.smoothSync;if(!(n!=null&&n.length&&s)){_context77.next=42;break;}h=s.toString(),m=this.getWorkShape(h);if(m){_context77.next=5;break;}return _context77.abrupt("return");case 5:u=m.toolsType;if(!(u===Tt.LaserPen)){_context77.next=8;break;}return _context77.abrupt("return");case 8:_context77.t0=this.drawWorkActiveId&&this.drawWorkActiveId!==h;if(!_context77.t0){_context77.next=13;break;}_context77.next=12;return this.consumeDrawAll({workId:this.drawWorkActiveId,scenePath:c,viewId:this.viewId,msgType:gt.DrawWork,dataType:Kt.Local},r);case 12:this.drawWorkActiveId=void 0;case 13:!this.drawWorkActiveId&&h!==Me&&(this.drawWorkActiveId=h);_e(l)&&(this.consumeCount=l);y=m.consume({data:t,isSimpleWorker:!0,smoothSync:f});_context77.t1=u;_context77.next=_context77.t1===Tt.Selector?19:_context77.t1===Tt.PencilEraser?24:_context77.t1===Tt.BitMapEraser?24:_context77.t1===Tt.Eraser?29:_context77.t1===Tt.Arrow?32:_context77.t1===Tt.Straight?32:_context77.t1===Tt.Ellipse?32:_context77.t1===Tt.Rectangle?32:_context77.t1===Tt.Star?32:_context77.t1===Tt.Polygon?32:_context77.t1===Tt.SpeechBalloon?32:_context77.t1===Tt.Pencil?38:42;break;case 19:this.drawCount++;y.type===gt.Select&&y.selectIds&&r.runReverseSelectWork(y.selectIds);_context77.next=23;return this.drawSelector(y);case 23:return _context77.abrupt("break",42);case 24:this.drawCount++;this.combineTimerId||(this.combineTimerId=1,this.combineDrawActiveId=h,this.drawEraserCombine(h).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(y);case 31:return _context77.abrupt("break",42);case 32:_context77.t2=y;if(!_context77.t2){_context77.next=37;break;}this.drawCount++;_context77.next=37;return this.drawShape(y);case 37:return _context77.abrupt("break",42);case 38:this.drawCount++;_context77.next=41;return this.drawPencil(y,h);case 41:return _context77.abrupt("break",42);case 42:case"end":return _context77.stop();}},_callee74,this);}));function consumeDraw(_x111,_x112){return _consumeDraw4.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75(t,r){var l,f,h,n,s,c,m,u,y,T,w,I,S;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,s=t.scenePath,c=t.isLockSentEventCursor;if(!n){_context78.next=35;break;}m=n.toString();this.drawWorkActiveId===m&&(this.drawWorkActiveId=void 0);u=this.workShapes.get(m);if(u){_context78.next=8;break;}return _context78.abrupt("return");case 8:y=u.toolsType;if(!(y===Tt.LaserPen)){_context78.next=11;break;}return _context78.abrupt("return");case 11:T=this.workShapes.get(pi),w=(l=T==null?void 0:T.selectIds)==null?void 0:l[0],I=u.consumeAll({data:t,workerEngine:this});_context78.t0=y;_context78.next=_context78.t0===Tt.Selector?15:_context78.t0===Tt.PencilEraser?23:_context78.t0===Tt.BitMapEraser?23:_context78.t0===Tt.Eraser?28:_context78.t0===Tt.Arrow?30:_context78.t0===Tt.Straight?30:_context78.t0===Tt.Ellipse?30:_context78.t0===Tt.Rectangle?30:_context78.t0===Tt.Star?30:_context78.t0===Tt.Polygon?30:_context78.t0===Tt.SpeechBalloon?30:_context78.t0===Tt.Pencil?30:35;break;case 15:S=[];this.drawLayer&&(this.drawCount=0,Lr(this.drawLayer,this.drawLayer.parent),this.getWorkShape(m).clearSubTmpPoints(),S.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}));I.selectIds&&w&&(f=I.selectIds)!=null&&f.includes(w)&&T.cursorBlur();I.selectIds&&r.runReverseSelectWork(I.selectIds);_context78.next=21;return this.drawSelector(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,S);case 21:(h=u.selectIds)!=null&&h.length?u.clearTmpPoints():this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",35);case 23:_context78.next=25;return this.drawEraserFull(u,_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 25:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",35);case 28:this.drawEraser(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker),u.clearTmpPoints();return _context78.abrupt("break",35);case 30:_context78.next=32;return this.drawPencilFull(_objectSpread(_objectSpread({},I),{},{scenePath:s}),c,t.needUndoTicker);case 32:this.drawCount=0;this.clearWorkShapeNodeCache(m);return _context78.abrupt("break",35);case 35:case"end":return _context78.stop();}},_callee75,this);}));function consumeDrawAll(_x113,_x114){return _consumeDrawAll3.apply(this,arguments);}return consumeDrawAll;}()}]);}(nd);var HM=/*#__PURE__*/function(_id){function HM(t){var _this106;_classCallCheck(this,HM);_this106=_callSuper(this,HM,[t]);dt(_this106,"_type","simple");return _this106;}_inherits(HM,_id);return _createClass(HM,[{key:"animationDraw",value:function(){var _animationDraw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee76(){var _this107=this;var s,c,l,f,h,m,u,y,T,w,I,S,O,d,v,p,x,E,R,D,U,M,W,X,B,N,$,J,tt,at,ut,V,Q,ft,mt,yt,wt,ht,Nt,Dt,G,k,rt,t,r,n,_iterator72,_step72,_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();_iterator72=_createForOfIteratorHelper(this.workShapes.entries());_context80.prev=4;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var _step72$value,nt,Y,Z,C,_Z8,_C7,_Z9,_C8,_Z10,_C9,L,z,_Z11,_C10,_L3,_z4,K,q,it,_q2,_Z12,_C11,_L4,_z5;return _regeneratorRuntime().wrap(function _loop7$(_context79){while(1)switch(_context79.prev=_context79.next){case 0:_step72$value=_slicedToArray(_step72.value,2),nt=_step72$value[0],Y=_step72$value[1];_context79.t0=Y.toolsType;_context79.next=_context79.t0===Tt.BackgroundSVG?4:_context79.t0===Tt.Image?9:_context79.t0===Tt.Text?16:_context79.t0===Tt.Arrow?24:_context79.t0===Tt.Straight?24:_context79.t0===Tt.Rectangle?24:_context79.t0===Tt.Ellipse?24:_context79.t0===Tt.Star?24:_context79.t0===Tt.Polygon?24:_context79.t0===Tt.SpeechBalloon?24:_context79.t0===Tt.Pencil?27:43;break;case 4:Z=Y.oldRect;Z&&((s=r.render)==null||s.push({rect:Z,isClear:!0,clearCanvas:Ut.Bg,viewId:_this107.viewId}),(c=r.render)==null||c.push({rect:Z,drawCanvas:Ut.Bg,viewId:_this107.viewId}));C=Y.node.consumeService({isFullWork:!0,replaceId:nt});_this107.selectorWorkShapes.forEach(function(L,z){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this107.willRunEffectSelectorIds.add(z),_this107.noAnimationRect=Zt(_this107.noAnimationRect,Z),_this107.noAnimationRect=Zt(_this107.noAnimationRect,C),_this107.runEffect());}),_this107.workShapes["delete"](nt),(l=r.render)==null||l.push({rect:C,drawCanvas:Ut.Bg,viewId:_this107.viewId});return _context79.abrupt("break",43);case 9:_Z8=Y.oldRect;_Z8&&((f=r.render)==null||f.push({rect:_Z8,isClear:!0,clearCanvas:Ut.Bg,viewId:_this107.viewId}),(h=r.render)==null||h.push({rect:_Z8,drawCanvas:Ut.Bg,viewId:_this107.viewId}));_context79.next=13;return(m=Y.node)==null?void 0:m.consumeServiceAsync({isFullWork:!0,worker:_this107.thread});case 13:_C7=_context79.sent;_this107.selectorWorkShapes.forEach(function(L,z){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this107.willRunEffectSelectorIds.add(z),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_Z8),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_C7),_this107.runEffect());}),_this107.workShapes["delete"](nt),(u=r.render)==null||u.push({rect:_C7,drawCanvas:Ut.Bg,viewId:_this107.viewId});return _context79.abrupt("break",43);case 16:if(!Y.node){_context79.next=23;break;}_Z9=Y.oldRect;_Z9&&((y=r.render)==null||y.push({rect:_Z9,isClear:!0,clearCanvas:Ut.Bg,viewId:_this107.viewId}),(T=r.render)==null||T.push({rect:_Z9,drawCanvas:Ut.Bg,viewId:_this107.viewId}));_context79.next=21;return Y.node.consumeServiceAsync({isFullWork:!0,replaceId:nt,boxRect:_this107.thread.getSceneRect()});case 21:_C8=_context79.sent;_this107.selectorWorkShapes.forEach(function(L,z){var K;(K=L.selectIds)!=null&&K.includes(nt)&&(_this107.willRunEffectSelectorIds.add(z),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_Z9),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_C8),_this107.runEffect());}),(w=Y.node)==null||w.clearTmpPoints(),_this107.workShapes["delete"](nt),(I=r.render)==null||I.push({rect:_C8,drawCanvas:Ut.Bg,viewId:_this107.viewId});case 23:return _context79.abrupt("break",43);case 24:_Z10=!!Y.ops;if((S=Y.animationWorkData)!=null&&S.length){_C9=Y.oldRect,L=Y.node.oldRect;_C9&&((O=r.render)==null||O.push({rect:_C9,isClear:!0,clearCanvas:Ut.Bg,viewId:_this107.viewId}),(d=r.render)==null||d.push({rect:_C9,drawCanvas:Ut.Bg,viewId:_this107.viewId})),L&&((v=r.render)==null||v.push({rect:L,isClear:!0,clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId}));z=(p=Y.node)==null?void 0:p.consumeService({op:Y.animationWorkData,isFullWork:_Z10});Y.isEnableCursor?n.set(nt,{workState:_C9?Y.ops?te.Done:te.Doing:te.Start,op:Y.animationWorkData.slice(-3,-1)}):_Z10&&!Y.useAnimation&&(x=Y.updateNodeOpt)!=null&&x.useAnimation&&n.set(nt,{workState:te.Done,op:Y.animationWorkData.slice(-3,-1),uid:(E=Y.updateNodeOpt)==null?void 0:E.uid}),_Z10?(_this107.selectorWorkShapes.forEach(function(K,q){var it;(it=K.selectIds)!=null&&it.includes(nt)&&(_this107.willRunEffectSelectorIds.add(q),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_C9),_this107.noAnimationRect=Zt(_this107.noAnimationRect,L),_this107.noAnimationRect=Zt(_this107.noAnimationRect,z),_this107.runEffect());}),(R=Y.node)==null||R.clearTmpPoints(),_this107.workShapes["delete"](nt),(D=r.render)==null||D.push({rect:z,drawCanvas:Ut.Bg,viewId:_this107.viewId})):(U=r.render)==null||U.push({rect:z,drawCanvas:Ut.ServiceFloat,workerType:_Z10?void 0:Kt.Service,viewId:_this107.viewId}),Y.animationWorkData.length=0;}return _context79.abrupt("break",43);case 27:if(!Y.useAnimation){_context79.next=38;break;}if(!Y.useAnimation){_context79.next=36;break;}if(!Y.isDel){_context79.next=32;break;}(ft=Y.node)==null||ft.clearTmpPoints(),_this107.workShapes["delete"](nt);return _context79.abrupt("break",43);case 32:_Z11=3,_C10=_this107.computNextAnimationIndex(Y,_Z11),_L3=Y.isDiff?0:Math.max(0,(Y.animationIndex||0)-_Z11),_z4=(Y.animationWorkData||[]).slice(0,_C10),K=(yt=(mt=Y.node)==null?void 0:mt.getWorkId())==null?void 0:yt.toString();if((Y.animationIndex||0)<_C10||Y.isDiff){q=(wt=Y.node)==null?void 0:wt.consumeService({op:_z4,isFullWork:!1,replaceId:K});if((ht=r.render)==null||ht.push({isClear:!0,rect:q,clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),(Nt=r.render)==null||Nt.push({rect:q,drawCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),Y.animationIndex=_C10,Y.isDiff&&(Y.isDiff=!1),_z4.length&&Y.isEnableCursor){it=_z4.slice(-3,-1);n.set(nt,{workState:_L3===0?te.Start:_C10===((Dt=Y.animationWorkData)==null?void 0:Dt.length)?te.Done:te.Doing,op:it});}}else if(Y.ops){_q2=(G=Y.node)==null?void 0:G.consumeService({op:Y.animationWorkData||[],isFullWork:!0,replaceId:K});Y.isDel=!0,(k=r.render)==null||k.push({isClear:!0,rect:_q2,clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId},{rect:_q2,drawCanvas:Ut.ServiceFloat,viewId:_this107.viewId},{isClear:!0,rect:_q2,clearCanvas:Ut.Bg,viewId:_this107.viewId},{rect:_q2,drawCanvas:Ut.Bg,viewId:_this107.viewId}),Y.isEnableCursor&&n.set(nt,{workState:te.Done,op:_z4.slice(-3,-1)});}t=!0;return _context79.abrupt("break",43);case 36:_context79.next=42;break;case 38:_Z12=!!Y.ops;_C11=(M=Y.node)==null?void 0:M.consumeService({op:Y.animationWorkData||[],isFullWork:_Z12,replaceId:nt});_L4=(W=Y.node)==null?void 0:W.updataOptService(Y.updateNodeOpt);if(_Z12){if(_C11=Zt(_C11,_L4),(X=r.render)==null||X.push({isClear:!0,rect:Zt(Y.oldRect,_C11),clearCanvas:Ut.Bg,viewId:_this107.viewId}),(B=r.render)==null||B.push({rect:Zt(Y.oldRect,_C11),drawCanvas:Ut.Bg,viewId:_this107.viewId}),(N=Y.updateNodeOpt)!=null&&N.useAnimation&&(($=r.render)==null||$.push({isClear:!0,rect:Zt(Y.oldRect,_C11),clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),(J=r.render)==null||J.push({rect:Zt(Y.oldRect,_C11),drawCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),!Y.isEnableCursor&&(tt=Y.animationWorkData)!=null&&tt.length)){_z5=Y.animationWorkData.slice(-3,-1);n.set(nt,{workState:te.Done,op:_z5,uid:(at=Y.updateNodeOpt)==null?void 0:at.uid});}_this107.selectorWorkShapes.forEach(function(z,K){var q;(q=z.selectIds)!=null&&q.includes(nt)&&(_this107.willRunEffectSelectorIds.add(K),_this107.noAnimationRect=Zt(_this107.noAnimationRect,_C11),_this107.runEffect());}),(ut=Y.node)==null||ut.clearTmpPoints(),_this107.workShapes["delete"](nt);}else _C11=Zt(_C11,_L4),(V=r.render)==null||V.push({isClear:!0,rect:Zt(Y.oldRect,_C11),clearCanvas:Ut.ServiceFloat,viewId:_this107.viewId}),(Q=r.render)==null||Q.push({rect:Zt(Y.oldRect,_C11),drawCanvas:Ut.ServiceFloat,viewId:_this107.viewId});case 42:return _context79.abrupt("break",43);case 43:case"end":return _context79.stop();}},_loop7);});_iterator72.s();case 7:if((_step72=_iterator72.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);_iterator72.e(_context80.t1);case 16:_context80.prev=16;_iterator72.f();return _context80.finish(16);case 19:t&&this.runAnimation();n.size&&(r.sp=[],n.forEach(function(nt,Y){var Z;(Z=r.sp)==null||Z.push({type:gt.Cursor,uid:nt.uid||Y.split(yi)[0],op:nt.op,workState:nt.workState,viewId:_this107.viewId});}));_context80.t2=(rt=r.render)!=null&&rt.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;}()}]);}(id);var sd=/*#__PURE__*/function(_Bl3){function sd(t){var _this108;_classCallCheck(this,sd);_this108=_callSuper(this,sd,[t]);dt(_this108,"opt");dt(_this108,"scene");dt(_this108,"cameraOpt");dt(_this108,"vNodes");_this108.opt=t,_this108.vNodes=void 0;return _this108;}_inherits(sd,_Bl3);return _createClass(sd,[{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;Lr(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,s=t.centerY,c=t.width,l=t.height;if(!this.scene)throw new Error("SnapshotWork scene is not initialized");if(!this.fullLayer)throw new Error("SnapshotWork snapshotFullLayer is not initialized");(c!==this.scene.width||l!==this.scene.height)&&this.updateScene({width:c,height:l}),this.fullLayer.setAttribute("scale",[r,r]),this.fullLayer.setAttribute("translate",[-n,-s]);}},{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,s=this.thread.dpr,c=Math.floor(n.x*s),l=Math.floor(n.y*s),f=Math.floor(n.w*s),h=Math.floor(n.h*s);return createImageBitmap(this.getOffscreen(),c,l,f,h,r);}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(t){var r,n,s,c,l,_i4,_Object$entries,_Object$entries$_i,h,m,u,y,f,_m15;return _regeneratorRuntime().wrap(function _callee77$(_context81){while(1)switch(_context81.prev=_context81.next){case 0:r=t.scenePath,n=t.scenes,s=t.cameraOpt,c=t.w,l=t.h;if(!(r&&n&&s&&this.fullLayer)){_context81.next=27;break;}this.setCameraOpt(s);_i4=0,_Object$entries=Object.entries(n);case 4:if(!(_i4<_Object$entries.length)){_context81.next=17;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i4],2),h=_Object$entries$_i[0],m=_Object$entries$_i[1];if(!(m!=null&&m.type)){_context81.next=14;break;}_context81.t0=m==null?void 0:m.type;_context81.next=_context81.t0===gt.UpdateNode?10:_context81.t0===gt.FullWork?10:14;break;case 10:u=m.opt,y=_objectSpread(_objectSpread({},m),{},{opt:u,workId:h,msgType:gt.FullWork,dataType:Kt.Service,viewId:this.viewId});_context81.next=13;return this.runFullWork(y);case 13:return _context81.abrupt("break",14);case 14:_i4++;_context81.next=4;break;case 17:c&&l&&(f={resizeWidth:c,resizeHeight:l});_context81.prev=18;_context81.next=21;return this.getSnapshotRender({scenePath:r,options:f});case 21:_context81.next=27;break;case 23:_context81.prev=23;_context81.t1=_context81["catch"](18);_m15=_context81.t1&&_context81.t1 instanceof Error?_context81.t1.message:_context81.t1==null?void 0:_context81.t1.toString();console.error("[SnapshotWork] getSnapshotRender error",_m15),this.thread._post({sp:[{type:gt.ReportError,reportString:"[SnapshotWork] getSnapshotRender error: ".concat(_m15)}]});case 27:case"end":return _context81.stop();}},_callee77,this,[[18,23]]);}));function getSnapshot(_x115){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()},{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee78(t){var s,r,n,c,l,f;return _regeneratorRuntime().wrap(function _callee78$(_context82){while(1)switch(_context82.prev=_context82.next){case 0:r=this.setFullWork(t),n=t.ops&&Si(t.ops);if(!r){_context82.next=22;break;}f=(s=r.getWorkId())==null?void 0:s.toString();if(!(r.toolsType===Tt.BackgroundSVG)){_context82.next=7;break;}c=r.consumeService({isFullWork:!0,replaceId:f});_context82.next=20;break;case 7:if(!(r.toolsType===Tt.Image)){_context82.next=13;break;}_context82.next=10;return r.consumeServiceAsync({isFullWork:!0,worker:this.thread});case 10:c=_context82.sent;_context82.next=20;break;case 13:if(!(r.toolsType===Tt.Text)){_context82.next=19;break;}_context82.next=16;return r.consumeServiceAsync({isFullWork:!0,replaceId:f,isDrawLabel:!0});case 16:c=_context82.sent;_context82.next=20;break;case 19:c=r.consumeService({op:n,isFullWork:!0,replaceId:f}),l=(t==null?void 0:t.updateNodeOpt)&&r.updataOptService(t.updateNodeOpt);case 20:t.workId&&this.workShapes["delete"](t.workId.toString());return _context82.abrupt("return",Zt(c,l));case 22:case"end":return _context82.stop();}},_callee78,this);}));function runFullWork(_x116){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 c,r,n,s;return _regeneratorRuntime().wrap(function _callee79$(_context83){while(1)switch(_context83.prev=_context83.next){case 0:r=t.scenePath,n=t.options;((c=this.fullLayer)==null?void 0:c.parent).render();_context83.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Ut.None},n);case 4:s=_context83.sent;s&&(this.thread._post({sp:[{type:gt.Snapshot,scenePath:r,imageBitmap:s,viewId:this.viewId,index:0}]},[s]),s.close());case 6:case"end":return _context83.stop();}},_callee79,this);}));function getSnapshotRender(_x117){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee80(t){var r,n,s,c,_i5,_Object$entries2,_Object$entries2$_i,l,f,h;return _regeneratorRuntime().wrap(function _callee80$(_context84){while(1)switch(_context84.prev=_context84.next){case 0:r=t.scenePath,n=t.scenes,s=t.cameraOpt;if(!(r&&n&&s&&this.fullLayer)){_context84.next=19;break;}this.setCameraOpt(s);_i5=0,_Object$entries2=Object.entries(n);case 4:if(!(_i5<_Object$entries2.length)){_context84.next=18;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i5],2),l=_Object$entries2$_i[0],f=_Object$entries2$_i[1];if(!(f!=null&&f.type)){_context84.next=15;break;}_context84.t0=f==null?void 0:f.type;_context84.next=_context84.t0===gt.UpdateNode?10:_context84.t0===gt.FullWork?10:15;break;case 10:_context84.next=12;return this.runFullWork(_objectSpread(_objectSpread({},f),{},{workId:l,msgType:gt.FullWork,dataType:Kt.Service,viewId:this.viewId}));case 12:h=_context84.sent;c=Zt(c,h);return _context84.abrupt("break",15);case 15:_i5++;_context84.next=4;break;case 18:c&&this.thread._post({sp:[{type:gt.BoundingBox,scenePath:r,rect:c,viewId:this.viewId}]});case 19:case"end":return _context84.stop();}},_callee80,this);}));function getBoundingRect(_x118){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(Bl);var ho=/* @__PURE__ */function(i){return i.Full="full",i.Sub="sub",i;}(ho||{});var VM=/*#__PURE__*/function(){function VM(e,t){var _this109=this;_classCallCheck(this,VM);dt(this,"_self");dt(this,"version",yh);dt(this,"type");// protected hasPriorityDraw: boolean = true;
|
|
484
|
+
dt(this,"workThreadMap",/* @__PURE__ */new Map());dt(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(VM,[{key:"init",value:function init(e){var t=e.viewId,r=e.dpr,n=e.offscreenCanvasOpt,s=e.layerOpt,c=e.isSafari,l=e.combineUnitTime,f=e.syncUnitTime,h=e.maxCombineEraserTime,m=e.offscreenCanvas,u=e.isUseSimple;if(!r||!n||!s)return;var y;this.type==="full"&&(u?y=new KM(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,combineUnitTime:l,syncUnitTime:f,maxCombineEraserTime:h,offscreenCanvas:m},this.post):y=new ad(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,combineUnitTime:l,syncUnitTime:f,maxCombineEraserTime:h},this.post)),this.type==="sub"&&!u&&(y=new od(t,{dpr:r,offscreenCanvasOpt:n,layerOpt:s,isUseSimple:u},this.post)),y&&c&&y.setIsSafari(c),y&&e.cameraOpt&&y.setCameraOpt(e.cameraOpt),y&&this.workThreadMap.set(t,y);}},{key:"setFontFaces",value:function(){var _setFontFaces=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee81(e){var _this110=this;var t,r,_iterator73,_step73,_loop8;return _regeneratorRuntime().wrap(function _callee81$(_context86){while(1)switch(_context86.prev=_context86.next){case 0:t=[],r=[];_iterator73=_createForOfIteratorHelper(e);_context86.prev=2;_loop8=/*#__PURE__*/_regeneratorRuntime().mark(function _loop8(){var n,s,c,l,f,h,m,u,y;return _regeneratorRuntime().wrap(function _loop8$(_context85){while(1)switch(_context85.prev=_context85.next){case 0:n=_step73.value;s=n.fontFamily,c=n.buffer;_context85.prev=2;if(!(!c||c.byteLength===0)){_context85.next=5;break;}throw new Error("Invalid font data for ".concat(s,": empty buffer"));case 5:try{l=new FontFace(s,c);}catch(_unused29){f=new Uint8Array(c);l=new FontFace(s,f);}_context85.next=8;return _this110._self.fonts.add(l);case 8:_context85.prev=8;_context85.next=11;return l.loaded;case 11:t.push(s);_context85.next=49;break;case 14:_context85.prev=14;_context85.t0=_context85["catch"](8);h=_this110._self.fonts;if(!(h&&typeof h.load=="function")){_context85.next=42;break;}_context85.prev=18;m=h.load(s);u=new Promise(function(T,w){return setTimeout(function(){return w(new Error("Font load timeout for ".concat(s)));},5e3);});_context85.next=23;return Promise.race([m,u]);case 23:y=_context85.sent;if(!(y&&y.length>0)){_context85.next=28;break;}t.push(s);_context85.next=29;break;case 28:throw new Error("Font ".concat(s," 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(s);case 35:if(!_context85.sent){_context85.next=39;break;}t.push(s);_context85.next=40;break;case 39:throw _context85.t1;case 40:_context85.next=49;break;case 42:_context85.next=44;return _this110.isFontAvailable(s);case 44:if(!_context85.sent){_context85.next=48;break;}t.push(s);_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(s," load error: ").concat(_context85.t2)),r.push(s);case 54:case"end":return _context85.stop();}},_loop8,null,[[2,51],[8,14],[18,31]]);});_iterator73.s();case 5:if((_step73=_iterator73.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);_iterator73.e(_context86.t1);case 14:_context86.prev=14;_iterator73.f();return _context86.finish(14);case 17:this.post({sp:[{type:gt.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(_x119){return _setFontFaces.apply(this,arguments);}return setFontFaces;}()// 检查字体是否可用
|
|
485
|
+
},{key:"isFontAvailable",value:function(){var _isFontAvailable=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee82(e){var t,r,n,_iterator74,_step74,_s3,s;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;_iterator74=_createForOfIteratorHelper(t);_context87.prev=6;_iterator74.s();case 8:if((_step74=_iterator74.n()).done){_context87.next=15;break;}_s3=_step74.value;if(!(_s3.family===e)){_context87.next=13;break;}r=!0,n=_s3;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);_iterator74.e(_context87.t0);case 20:_context87.prev=20;_iterator74.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:s=_context87.sent;return _context87.abrupt("return",s&&s.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(_x120){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,s,c,l,f,_iterator75,_step75,_step75$value,m,u,y,_iterator76,_step76,_m16,h;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,s=r.viewId,c=r.tasksqueue,l=r.mainTasksqueueCount,f=r.fontBuffers;if(!f){_context88.next=14;break;}_this111.setFontFaces(f);return _context88.abrupt("continue",35);case 14:if(!(n===gt.Console)){_context88.next=17;break;}console.log(_this111);return _context88.abrupt("continue",35);case 17:if(!(n===gt.Init)){_context88.next=20;break;}_this111.init(r);return _context88.abrupt("continue",35);case 20:if(!(n===gt.TasksQueue&&c!=null&&c.size)){_context88.next=25;break;}_iterator75=_createForOfIteratorHelper(_this111.workThreadMap.entries());try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){_step75$value=_slicedToArray(_step75.value,2),m=_step75$value[0],u=_step75$value[1];y=c.get(m);y&&u.on(y);}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}_this111.type==="full"&&_e(l)&&_this111.post({workerTasksqueueCount:l});return _context88.abrupt("continue",35);case 25:if(!(s===n1)){_context88.next=29;break;}_iterator76=_createForOfIteratorHelper(_this111.workThreadMap.values());try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){_m16=_step76.value;_m16.on(r),n===gt.Destroy&&_this111.workThreadMap["delete"](s);}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}return _context88.abrupt("continue",35);case 29:h=_this111.workThreadMap.get(s);_context88.t0=h;if(!_context88.t0){_context88.next=35;break;}_context88.next=34;return h.on(r);case 34:n===gt.Destroy&&_this111.workThreadMap["delete"](s);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(_x121){return _ref171.apply(this,arguments);};}();}}]);}();var od=/*#__PURE__*/function(_qh){function od(t,r,n){var _this112;_classCallCheck(this,od);_this112=_callSuper(this,od,[t,r,"sub"/* Sub */]);dt(_this112,"type","sub");dt(_this112,"_post");dt(_this112,"topLayer");dt(_this112,"serviceWork");dt(_this112,"localWork");dt(_this112,"topLayerWork");dt(_this112,"snapshotWork");_this112._post=n;var s=gr.bufferSize.sub;_this112.topLayer=r.isUseSimple?void 0:_this112.createLayer("topLayer",_this112.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"}));var c={thread:_this112,viewId:_this112.viewId,vNodes:_this112.vNodes,fullLayer:_this112.fullLayer,topLayer:_this112.topLayer,isUseSimple:r.isUseSimple};_this112.localWork=new jM(c),r.isUseSimple||(_this112.topLayerWork=new GM(c)),_this112.snapshotWork=new sd(_objectSpread(_objectSpread({},c),{},{createScene:_this112.createScene.bind(_this112),createLayer:_this112.createLayer.bind(_this112)})),_this112.vNodes.init(_this112.fullLayer);return _this112;}_inherits(od,_qh);return _createClass(od,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee84(){var _this113=this;var c,l,_this$combinePostData,t,r,n,f,_iterator77,_step77,h,m,s;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;}f=[];_iterator77=_createForOfIteratorHelper(t);_context89.prev=4;_iterator77.s();case 6:if((_step77=_iterator77.n()).done){_context89.next=19;break;}h=_step77.value;if(!h.rect){_context89.next=17;break;}if(!(h.rect=Qh(fr(h.rect),this.scene,this.dpr),!h.rect)){_context89.next=11;break;}return _context89.abrupt("continue",17);case 11:if(!(h.drawCanvas&&h.rect&&h.rect.w>0&&h.rect.h>0)){_context89.next=16;break;}_context89.next=14;return this.getRectImageBitmap(h);case 14:m=_context89.sent;h.imageBitmap=m,n||(n=[]),n.push(m);case 16:f.push(h);case 17:_context89.next=6;break;case 19:_context89.next=24;break;case 21:_context89.prev=21;_context89.t0=_context89["catch"](4);_iterator77.e(_context89.t0);case 24:_context89.prev=24;_iterator77.f();return _context89.finish(24);case 27:r.render=f;case 28:s=(c=r.sp)==null?void 0:c.filter(function(f){return f.type!==gt.None||f.isLockSentEventCursor||f.needUndoTicker;});s!=null&&s.length?r.sp=s.map(function(f){return _objectSpread(_objectSpread({},f),{},{viewId:_this113.viewId});}):delete r.sp,r.consumeCount===void 0&&delete r.consumeCount,r.subWorkerDrawCount===void 0&&delete r.subWorkerDrawCount,(s!=null&&s.length||r.consumeCount||r.subWorkerDrawCount||(l=r==null?void 0:r.render)!=null&&l.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 h,m,r,n,s,c,l,f,u;return _regeneratorRuntime().wrap(function _callee85$(_context90){while(1)switch(_context90.prev=_context90.next){case 0:r=t.msgType,n=t.toolsType,s=t.opt,c=t.dataType,l=t.workState,f=t.isLockSentEventCursor;_context90.t0=r;_context90.next=_context90.t0===gt.UpdateTools?4:_context90.t0===gt.CreateWork?9:_context90.t0===gt.DrawWork?11:_context90.t0===gt.RemoveNode?19:_context90.t0===gt.FullWork?22:_context90.t0===gt.Snapshot?27:_context90.t0===gt.BoundingBox?32:37;break;case 4:if(!(n&&(h=this.topLayerWork)!=null&&h.canUseTopLayer(n)&&s)){_context90.next=8;break;}u={toolsType:n,toolsOpt:s};this.topLayerWork.setToolsOpt(u);return _context90.abrupt("return");case 8:return _context90.abrupt("break",37);case 9:this.createLocalWork(t);return _context90.abrupt("return");case 11:if(!(l===te.Done&&c===Kt.Local)){_context90.next=17;break;}_context90.next=14;return this.consumeDrawAll(c,t);case 14:n===Tt.LaserPen&&f&&this.post({sp:[{type:gt.None,isLockSentEventCursor:f}]});_context90.next=18;break;case 17:this.consumeDraw(c,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(c,t);case 26:return _context90.abrupt("return");case 27:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===jn?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===jn?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(od,"on",this,3)([t]);case 39:case"end":return _context90.stop();}},_callee85,this);}));function on(_x122){return _on2.apply(this,arguments);}return on;}()},{key:"createLocalWork",value:function createLocalWork(t){var c;var r=t.workId,n=t.toolsType,s=t.opt;if(n&&(c=this.topLayerWork)!=null&&c.canUseTopLayer(n)&&r&&s){this.topLayerWork.getToolsOpt()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:s}),this.topLayerWork.setWorkOptions(r.toString(),s);return;}n&&_superPropGet(od,"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===Kt.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(_x123){return _removeNode2.apply(this,arguments);}return removeNode;}()},{key:"getLayer",value:function getLayer(t){switch(t){case Ut.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 c,n,s;return _regeneratorRuntime().wrap(function _callee87$(_context92){while(1)switch(_context92.prev=_context92.next){case 0:n=r.workId,s=r.toolsType;if(!n){_context92.next=11;break;}if(!(s&&(c=this.topLayerWork)!=null&&c.canUseTopLayer(s))){_context92.next=5;break;}t===Kt.Local&&(this.topLayerWork.getWorkShape(n.toString())||this.createLocalWork(r)),this.topLayerWork.consumeDraw(r);return _context92.abrupt("return");case 5:_context92.t0=s;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(_x124,_x125){return _consumeDraw5.apply(this,arguments);}return consumeDraw;}()},{key:"consumeDrawAll",value:function(){var _consumeDrawAll4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(t,r){var l,n,s,c,f;return _regeneratorRuntime().wrap(function _callee88$(_context93){while(1)switch(_context93.prev=_context93.next){case 0:n=r.workId,s=r.toolsType,c=r.dataType;if(!n){_context93.next=8;break;}f=n.toString();if(!(s&&(l=this.topLayerWork)!=null&&l.canUseTopLayer(s))){_context93.next=6;break;}c===Kt.Local&&(this.topLayerWork.getWorkShape(f)||this.createLocalWork(r)),this.topLayerWork.consumeDrawAll(r);return _context93.abrupt("return");case 6:s&&(this.localWork.getWorkShape(f)||_superPropGet(od,"createLocalWork",this,3)([r]),this.localWork.consumeDrawAll(r));return _context93.abrupt("return");case 8:case"end":return _context93.stop();}},_callee88,this);}));function consumeDrawAll(_x126,_x127){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(od,"clearAll",this,3)([]);this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Lr(this.topLayer,this.topLayer.parent));_context94.next=5;return this.post({render:[{isClearAll:!0,clearCanvas:Ut.TopFloat,viewId:this.viewId}],sp:[{type:gt.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,s=t.drawCanvas,c=Math.floor(n.x*this.dpr),l=Math.floor(n.y*this.dpr),f=Math.floor(n.w*this.dpr||1),h=Math.floor(n.h*this.dpr||1);return createImageBitmap(this.getOffscreen(s),c,l,f,h,r);}},{key:"updateLayer",value:function updateLayer(t){var r=t.width,n=t.height;_superPropGet(od,"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,s;return _regeneratorRuntime().wrap(function _callee90$(_context95){while(1)switch(_context95.prev=_context95.next){case 0:_superPropGet(od,"updateDpr",this,3)([t]);r=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,n=!!this.localWork.getWorkShapes().size,s=[];n&&s.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId});r&&s.push({isClearAll:!0,clearCanvas:Ut.TopFloat,viewId:this.viewId});_context95.t0=s.length;if(!_context95.t0){_context95.next=8;break;}_context95.next=8;return this.post({render:s});case 8:case"end":return _context95.stop();}},_callee90,this);}));function updateDpr(_x128){return _updateDpr2.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(t){var _this114=this;var s,r,n,c,l,_iterator78,_step78,_loop9;return _regeneratorRuntime().wrap(function _callee91$(_context97){while(1)switch(_context97.prev=_context97.next){case 0:r=[],n=t.cameraOpt;if(!(n&&!Qr(this.cameraOpt,n))){_context97.next=25;break;}c=this.topLayerWork&&!!this.topLayerWork.localWorkShapes.size||!1,l=!!this.localWork.getWorkShapes().size;if(!(l&&this.localWork.workShapesDone(),this.setCameraOpt(n),l&&r.push({isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}),c&&this.topLayerWork)){_context97.next=21;break;}r.push({isClearAll:!0,clearCanvas:Ut.TopFloat,viewId:this.viewId});_iterator78=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries()||[]);_context97.prev=6;_loop9=/*#__PURE__*/_regeneratorRuntime().mark(function _loop9(){var _step78$value,f,h,m;return _regeneratorRuntime().wrap(function _loop9$(_context96){while(1)switch(_context96.prev=_context96.next){case 0:_step78$value=_slicedToArray(_step78.value,2),f=_step78$value[0],h=_step78$value[1];if(h.totalRect){(s=_this114.topLayer)==null||s.getElementsByName(f.toString()).forEach(function(u){var y=u.getBoundingClientRect(),T=ve({x:y.x,y:y.y,w:y.width,h:y.height});m=Zt(m,T);}),h.totalRect=m,_this114.topLayerWork.localWorkShapes.set(f,h);}case 2:case"end":return _context96.stop();}},_loop9);});_iterator78.s();case 9:if((_step78=_iterator78.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);_iterator78.e(_context97.t1);case 18:_context97.prev=18;_iterator78.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(_x129){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,r){var h,m;this.cameraOpt=t;var n=t.scale,s=t.centerX,c=t.centerY,l=t.width,f=t.height;(l!==this.scene.width||f!==this.scene.height)&&this.updateScene(this.scene,{width:l,height:f}),r?(r.setAttribute("scale",[n,n]),r.setAttribute("translate",[-s,-c])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-s,-c]),(h=this.topLayer)==null||h.setAttribute("scale",[n,n]),(m=this.topLayer)==null||m.setAttribute("translate",[-s,-c]));}}]);}(qh);var ad=/*#__PURE__*/function(_qh2){function ad(t,r,n){var _this115;_classCallCheck(this,ad);_this115=_callSuper(this,ad,[t,r,"full"/* Full */]);dt(_this115,"serviceDrawLayer");dt(_this115,"localDrawLayer");dt(_this115,"snapshotFullLayer");dt(_this115,"methodBuilder");dt(_this115,"localWork");dt(_this115,"serviceWork");dt(_this115,"_post");dt(_this115,"debounceUpdateCache",/* @__PURE__ */new Set());_this115._post=n;var s=gr.bufferSize.sub;_this115.serviceDrawLayer=_this115.createLayer("serviceDrawLayer",_this115.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"})),_this115.localDrawLayer=_this115.createLayer("localDrawLayer",_this115.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:s,contextType:"2d"}));var c={thread:_this115,viewId:_this115.viewId,vNodes:_this115.vNodes,fullLayer:_this115.fullLayer};_this115.localWork=new nd(_objectSpread(_objectSpread({},c),{},{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 id(_objectSpread(_objectSpread({},c),{},{drawLayer:_this115.serviceDrawLayer})),_this115.methodBuilder=new ju([pe.CopyNode,pe.SetColorNode,pe.DeleteNode,pe.RotateNode,pe.ScaleNode,pe.TranslateNode,pe.ZIndexNode,pe.SetFontStyle,pe.SetPoint,pe.SetLock,pe.SetShapeOpt]).registerForWorker(_this115),_this115.vNodes.init(_this115.fullLayer);return _this115;}_inherits(ad,_qh2);return _createClass(ad,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92(){var _this116=this;var c,l,_this$combinePostData2,t,r,n,f,_iterator79,_step79,h,m,s;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;}f=[];_iterator79=_createForOfIteratorHelper(t);_context98.prev=4;_iterator79.s();case 6:if((_step79=_iterator79.n()).done){_context98.next=19;break;}h=_step79.value;if(!h.rect){_context98.next=17;break;}if(!(h.rect=Qh(fr(h.rect),this.scene,this.dpr),!h.rect)){_context98.next=11;break;}return _context98.abrupt("continue",17);case 11:if(!(h.drawCanvas&&h.rect&&h.rect.w>0&&h.rect.h>0)){_context98.next=16;break;}_context98.next=14;return this.getRectImageBitmap(h);case 14:m=_context98.sent;h.imageBitmap=m,n||(n=[]),n.push(m);case 16:f.push(h);case 17:_context98.next=6;break;case 19:_context98.next=24;break;case 21:_context98.prev=21;_context98.t0=_context98["catch"](4);_iterator79.e(_context98.t0);case 24:_context98.prev=24;_iterator79.f();return _context98.finish(24);case 27:r.render=f;case 28:s=(c=r.sp)==null?void 0:c.filter(function(f){return f.type!==gt.None||f.isLockSentEventCursor||f.needUndoTicker;});s!=null&&s.length?r.sp=s.map(function(f){return _objectSpread(_objectSpread({},f),{},{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||s!=null&&s.length||(l=r.render)!=null&&l.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,s,c,l,f,h,m,_h8;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,s=t.workId,c=t.toolsType,l=t.workState,f=t.workIds;_context99.t0=r;_context99.next=_context99.t0===gt.AuthClear?6:_context99.t0===gt.CreateWork?9:_context99.t0===gt.DrawWork?11:_context99.t0===gt.Select?20:_context99.t0===gt.UpdateNode?27:_context99.t0===gt.FullWork?27:_context99.t0===gt.RemoveNode?29:_context99.t0===gt.GetTextActive?32:_context99.t0===gt.CursorHover?35:_context99.t0===gt.CursorBlur?38:_context99.t0===gt.GetVNodeInfo?41:43;break;case 6:h=t.clearUids,m=t.localUid;this.vNodes.setCanClearUids(h),this.vNodes.setLocalUid(m);return _context99.abrupt("break",43);case 9:c!==Tt.LaserPen&&this.createLocalWork(t);return _context99.abrupt("break",43);case 11:_context99.t1=c!==Tt.LaserPen;if(!_context99.t1){_context99.next=19;break;}if(!(l===te.Done&&n===Kt.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(!(s===Me)){_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(s&&f){_h8=f.map(function(m){return _this117.vNodes.get(m);});this.post({sp:[{type:gt.GetVNodeInfo,dataType:Kt.Worker,workId:s,vInfo:_h8}]});}return _context99.abrupt("break",43);case 43:_context99.next=45;return _superPropGet(ad,"on",this,3)([t]);case 45:case"end":return _context99.stop();}},_callee93,this);}));function on(_x130){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,s,c,l,_iterator80,_step80,_loop10;return _regeneratorRuntime().wrap(function _callee94$(_context101){while(1)switch(_context101.prev=_context101.next){case 0:r=t.dataType,n=t.workId,s=t.removeIds,c=[],l=s||[];if(!(n&&l.push(n.toString()),l.length)){_context101.next=20;break;}_iterator80=_createForOfIteratorHelper(l);_context101.prev=3;_loop10=/*#__PURE__*/_regeneratorRuntime().mark(function _loop10(){var f;return _regeneratorRuntime().wrap(function _loop10$(_context100){while(1)switch(_context100.prev=_context100.next){case 0:f=_step80.value;f===Me?c.push(_this118.localWork.removeSelector(t,_this118)):r===Kt.Local?c.push(_this118.localWork.removeWork(t).then(function(){_this118.localWork.colloctEffectSelectWork(t),_this118.deleteCachedImagesByWorkId(f);})):r===Kt.Service&&c.push(_this118.serviceWork.removeWork(t).then(function(){_this118.localWork.colloctEffectSelectWork(t),_this118.deleteCachedImagesByWorkId(f);}));case 2:case"end":return _context100.stop();}},_loop10);});_iterator80.s();case 6:if((_step80=_iterator80.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);_iterator80.e(_context101.t1);case 15:_context101.prev=15;_iterator80.f();return _context101.finish(15);case 18:_context101.next=20;return Promise.all(c);case 20:case"end":return _context101.stop();}},_callee94,null,[[3,12,15,18]]);}));function removeNode(_x131){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===Kt.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(_x132){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(ad,"clearAll",this,3)([]);this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Lr(this.localDrawLayer,this.localDrawLayer.parent));this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),Lr(this.serviceDrawLayer,this.serviceDrawLayer.parent));_context103.next=6;return this.post({render:[{isClearAll:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Ut.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Ut.Float,viewId:this.viewId}],sp:[{type:gt.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(ad,"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,s=t.centerY,c=t.width,l=t.height;(c!==this.scene.width||l!==this.scene.height)&&this.updateScene(this.scene,{width:c,height:l}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[r,r]),this.fullLayer.setAttribute("translate",[-n,-s])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[r,r]),this.localDrawLayer.setAttribute("translate",[-n,-s])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[r,r]),this.serviceDrawLayer.setAttribute("translate",[-n,-s]));}},{key:"getLayer",value:function getLayer(t){switch(t){case Ut.Bg:return this.fullLayer;case Ut.ServiceFloat:return this.serviceDrawLayer;case Ut.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===Kt.Local;if(!_context104.t0){_context104.next=7;break;}_context104.next=7;return this.localWork.consumeFull(n);case 7:n&&t===Kt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context104.stop();}},_callee97,this);}));function consumeFull(_x133,_x134){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===Kt.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===Kt.Service&&this.serviceWork.consumeDraw(r);case 7:case"end":return _context105.stop();}},_callee98,this);}));function consumeDraw(_x135,_x136){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===Kt.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(_x137,_x138){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(ad,"updateDpr",this,3)([t]);_context107.next=3;return this.post({render:[{isClearAll:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Ut.Bg,viewId:this.viewId}]});case 3:case"end":return _context107.stop();}},_callee100,this);}));function updateDpr(_x139){return _updateDpr3.apply(this,arguments);}return updateDpr;}()},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee101(t){var _this119=this;var c,l,f,h,m,r,n,s,u,S,_iterator81,_step81,_step81$value,_O54,_d50,y,_iterator82,_step82,_step82$value,_S31,_O59,_d53,_iterator83,_step83,_step83$value,_S32,_O60,_d54,T,w,_S27,_iterator84,_step84,_O55,I,_iterator85,_step85,_S28,_O56,_iterator86,_step86,_d51,_iterator87,_step87,_step87$value,_S30,_step87$value$,_O58,_d52,v,p,x,E,R,D,U,M,W,X,_iterator88,_step88,_step88$value,_S29,_O57;return _regeneratorRuntime().wrap(function _callee101$(_context108){while(1)switch(_context108.prev=_context108.next){case 0:r=[],n=t.cameraOpt,s=t.scenePath;if(!(n&&!Qr(this.cameraOpt,n))){_context108.next=42;break;}this.taskUpdateCameraId&&(clearTimeout(this.taskUpdateCameraId),this.taskUpdateCameraId=void 0);u=!!this.serviceDrawLayer.children.length;if(!s){_context108.next=30;break;}S=!1;_iterator81=_createForOfIteratorHelper(this.localWork.getWorkShapes().entries());_context108.prev=7;_iterator81.s();case 9:if((_step81=_iterator81.n()).done){_context108.next=19;break;}_step81$value=_slicedToArray(_step81.value,2),_O54=_step81$value[0],_d50=_step81$value[1];_context108.t0=_d50.toolsType;_context108.next=_context108.t0===Tt.Text?14:_context108.t0===Tt.PencilEraser?14:_context108.t0===Tt.Eraser?14:_context108.t0===Tt.Selector?14:_context108.t0===Tt.LaserPen?14:15;break;case 14:return _context108.abrupt("break",17);case 15:_O54!==pi&&_O54!==Me&&(S=!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);_iterator81.e(_context108.t1);case 24:_context108.prev=24;_iterator81.f();return _context108.finish(24);case 27:if(!S){_context108.next=30;break;}this.taskUpdateCameraId=setTimeout(function(){_this119.taskUpdateCameraId=void 0,_this119.updateCamera(t);},Eu);return _context108.abrupt("return");case 30:y=/* @__PURE__ */new Map();_iterator82=_createForOfIteratorHelper(this.vNodes.getNodesByType(Tt.Text).entries());try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){_step82$value=_slicedToArray(_step82.value,2),_S31=_step82$value[0],_O59=_step82$value[1];_d53=_O59.rect;y.set(_S31,{rect:fr(_d53),scale:(c=this.cameraOpt)==null?void 0:c.scale});}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}_iterator83=_createForOfIteratorHelper(this.vNodes.gethasEraserNodes().entries());try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){_step83$value=_slicedToArray(_step83.value,2),_S32=_step83$value[0],_O60=_step83$value[1];_d54=_O60.rect;y.set(_S32,{rect:fr(_d54),scale:(l=this.cameraOpt)==null?void 0:l.scale});}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}T=new Set(y.keys());w=!1;if(this.localWork.hasSelector()){_S27=(f=this.localWork.getSelector())==null?void 0:f.selectIds;if(_S27){w=!0;_iterator84=_createForOfIteratorHelper(_S27);try{for(_iterator84.s();!(_step84=_iterator84.n()).done;){_O55=_step84.value;T.add(_O55);}}catch(err){_iterator84.e(err);}finally{_iterator84.f();}}}I=!1;if(this.serviceWork.selectorWorkShapes.size){_iterator85=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.values());try{for(_iterator85.s();!(_step85=_iterator85.n()).done;){_S28=_step85.value;_O56=_S28.selectIds;if(_O56){I=!0;_iterator86=_createForOfIteratorHelper(_O56);try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){_d51=_step86.value;T.add(_d51);}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}}}}catch(err){_iterator85.e(err);}finally{_iterator85.f();}}if(this.setCameraOpt(n),this.vNodes.curNodeMap.size){this.vNodes.clearTarget(),this.vNodes.updateHighLevelNodesRect(T),this.debounceUpdateCameraId&&clearTimeout(this.debounceUpdateCameraId);_iterator87=_createForOfIteratorHelper(y.entries());try{for(_iterator87.s();!(_step87=_iterator87.n()).done;){_step87$value=_slicedToArray(_step87.value,2),_S30=_step87$value[0],_step87$value$=_step87$value[1],_O58=_step87$value$.rect,_d52=_step87$value$.scale;v=this.vNodes.get(_S30);if(v){p=_O58,x=v.rect,E=this.getSceneRect(),R=Ji(p,E),D=Ji(x,E),U=v.toolsType,M=v.opt;W=!1;(R!==D||p.w!==x.w||p.h!==x.h||D===Tr.intersect)&&(W=!0),U===Tt.Text&&// (opt as TextOptions).workState === EvevtWorkState.Done &&
|
|
486
|
+
W&&this.debounceUpdateCache.add(_S30);X=!1;_d52&&(h=this.cameraOpt)!=null&&h.scale&&_d52>this.cameraOpt.scale?D!==Tr.outside&&R!==Tr.inside&&(X=!0):_d52&&(m=this.cameraOpt)!=null&&m.scale&&_d52===this.cameraOpt.scale&&(p.x!==x.x||p.y!==x.y)&&(D===Tr.inside&&R!==Tr.inside||D===Tr.intersect&&R===Tr.intersect)&&(X=!0),M.eraserlines&&M.eraserlines.length&&X&&!this.debounceUpdateCache.has(_S30)&&this.debounceUpdateCache.add(_S30);}}}catch(err){_iterator87.e(err);}finally{_iterator87.f();}if(w&&this.localWork.reRenderSelector(),I){_iterator88=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator88.s();!(_step88=_iterator88.n()).done;){_step88$value=_slicedToArray(_step88.value,2),_S29=_step88$value[0],_O57=_step88$value[1];this.serviceWork.runSelectWork({workId:_S29,selectIds:_O57.selectIds,msgType:gt.Select,dataType:Kt.Service,viewId:this.viewId});}}catch(err){_iterator88.e(err);}finally{_iterator88.f();}}this.debounceUpdateCameraId=setTimeout(function(){var O;_this119.debounceUpdateCameraId=void 0;var S=[];var _iterator89=_createForOfIteratorHelper(_this119.debounceUpdateCache.values()),_step89;try{var _loop11=function _loop11(){var d=_step89.value;var v=_this119.vNodes.get(d);if(v){var p=v.toolsType,x=v.opt,E=v.op,R=_this119.localWork.setFullWork({toolsType:p,opt:x,workId:d});R&&(p===Tt.Text?(O=_this119.fullLayer)!=null&&O.getElementsByName(d)[0]&&R instanceof Vi&&S.push(R.consumeServiceAsync({isFullWork:!0,replaceId:d,boxRect:_this119.getSceneRect()})):x.eraserlines&&x.eraserlines.length&&S.push(new Promise(function(D){var U=R.consumeService({op:E,isFullWork:!0,replaceId:d,workState:te.Done});_this119.localWork.clearWorkShapeNodeCache(d),D(U);})));}_this119.debounceUpdateCache["delete"](d);};for(_iterator89.s();!(_step89=_iterator89.n()).done;){_loop11();}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}S.length?Promise.all(S).then(function(){var d=[];d.push({isClearAll:!0,clearCanvas:Ut.Bg,viewId:_this119.viewId},{isDrawAll:!0,drawCanvas:Ut.Bg,viewId:_this119.viewId}),d.length&&_this119.post({render:d}),_this119.vNodes.updateLowLevelNodesRect(),_this119.vNodes.clearHighLevelIds();}):(_this119.vNodes.updateLowLevelNodesRect(),_this119.vNodes.clearHighLevelIds());},Eu*5);}u&&r.push({isClearAll:!0,clearCanvas:Ut.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&r.push({isClearAll:!0,clearCanvas:Ut.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Ut.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(_x140){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var r=t.rect,n=t.drawCanvas,s=Math.floor(r.x*this.dpr),c=Math.floor(r.y*this.dpr),l=Math.floor(r.w*this.dpr||1),f=Math.floor(r.h*this.dpr||1);return createImageBitmap(this.getOffscreen(n),s,c,l,f,{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(_x141){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(ad,"destroy",this,3)([]);}}]);}(qh);var KM=/*#__PURE__*/function(_ad){function KM(t,r,n){var _this120;_classCallCheck(this,KM);var c,l,f,h;_this120=_callSuper(this,KM,[t,r,n]);dt(_this120,"snapshotWork");dt(_this120,"localDrawScene");dt(_this120,"serviceDrawScene");dt(_this120,"offscreenCanvas");dt(_this120,"localWork");dt(_this120,"serviceWork");if(_this120._post=n,r.offscreenCanvas){_this120.offscreenCanvas=r.offscreenCanvas,_this120.localDrawScene=_this120.createScene(r,(c=_this120.offscreenCanvas)==null?void 0:c.localCanvas),_this120.serviceDrawScene=_this120.createScene(r,(l=_this120.offscreenCanvas)==null?void 0:l.serviceCanvas);var m=gr.bufferSize.sub;_this120.serviceDrawLayer=_this120.createLayer("serviceDrawLayer",_this120.serviceDrawScene||_this120.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:m,contextType:"2d"}),(f=_this120.offscreenCanvas)==null?void 0:f.serviceCanvas),_this120.localDrawLayer=_this120.createLayer("localDrawLayer",_this120.localDrawScene||_this120.scene,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:m,contextType:"2d"}),(h=_this120.offscreenCanvas)==null?void 0:h.localCanvas);}var s={thread:_this120,viewId:_this120.viewId,vNodes:_this120.vNodes,fullLayer:_this120.fullLayer};_this120.localWork=new kM(_objectSpread(_objectSpread({},s),{},{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 HM(_objectSpread(_objectSpread({},s),{},{drawLayer:_this120.serviceDrawLayer})),_this120.snapshotWork=new sd(_objectSpread(_objectSpread({},s),{},{createScene:_this120.createScene.bind(_this120),createLayer:_this120.createLayer.bind(_this120)})),_this120.methodBuilder=new ju([pe.CopyNode,pe.SetColorNode,pe.DeleteNode,pe.RotateNode,pe.ScaleNode,pe.TranslateNode,pe.ZIndexNode,pe.SetFontStyle,pe.SetPoint,pe.SetLock,pe.SetShapeOpt]).registerForWorker(_this120);return _this120;}_inherits(KM,_ad);return _createClass(KM,[{key:"createRenderLayer",value:function createRenderLayer(t,r,n){var l;var s=gr.bufferSize.full,c=gr.bufferSize.sub;this.fullLayer=this.createLayer("fullLayer",t,_objectSpread(_objectSpread({},r.layerOpt),{},{bufferSize:this.viewId===jn?s:c*2}),n||((l=r.offscreenCanvas)==null?void 0:l.bgCanvas));}},{key:"createScene",value:function createScene(t,r){var n=t.offscreenCanvas,s=t.offscreenCanvasOpt,c=s.width,l=s.height,f=r||(n==null?void 0:n.bgCanvas)||new OffscreenCanvas(c,l);s.contextType&&delete s.contextType;var h=new zu(_objectSpread(_objectSpread({container:f,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},s),{},{contextType:this.contextType,id:this.viewId}));return h.setAttribute("id",this.viewId),h;}},{key:"combinePostData",value:function combinePostData(){var c,l;this.workerTaskId=void 0;var t=[],r=[];var n;var s=/* @__PURE__ */new Set();var _iterator90=_createForOfIteratorHelper(this.combinePostMsg.values()),_step90;try{for(_iterator90.s();!(_step90=_iterator90.n()).done;){var f=_step90.value;if((c=f.render)!=null&&c.length)try{if(this.offscreenCanvas){var _iterator91=_createForOfIteratorHelper(f.render),_step91;try{for(_iterator91.s();!(_step91=_iterator91.n()).done;){var h=_step91.value;h.workId&&s.add(h.workId);var m=h.drawCanvas||h.clearCanvas;if(m){var u=this.getLayer(m);if(!u||!(u.parent instanceof il))continue;u.parent.render();}}}catch(err){_iterator91.e(err);}finally{_iterator91.f();}}else{var _iterator92=_createForOfIteratorHelper(f.render),_step92;try{for(_iterator92.s();!(_step92=_iterator92.n()).done;){var _h9=_step92.value;var _m17=!1;if(_h9.workId&&s.add(_h9.workId),_h9.isClearAll&&(_h9.rect=this.getSceneRect(),_h9.isClear=!0,delete _h9.isClearAll),_h9.drawCanvas){var _u9=this.getLayer(_h9.drawCanvas);if(!_u9||!(_u9.parent instanceof il))continue;if(_u9.parent.render(),_h9.isDrawAll){var y=this.getSceneRect();_h9.rect=y,delete _h9.isDrawAll;}}var _iterator93=_createForOfIteratorHelper(t),_step93;try{for(_iterator93.s();!(_step93=_iterator93.n()).done;){var _u10=_step93.value;if(_h9.viewId===_u10.viewId){_h9.isClear&&_u10.clearCanvas&&_u10.isClear&&_u10.clearCanvas===_h9.clearCanvas&&(_u10.rect=Zt(_u10.rect,_h9.rect),_m17=!0),_u10.drawCanvas&&_u10.drawCanvas===_h9.drawCanvas&&(_u10.rect=Zt(_u10.rect,_h9.rect),_m17=!0);continue;}}}catch(err){_iterator93.e(err);}finally{_iterator93.f();}_m17||(_h9.isClear&&!_h9.drawCanvas?t.unshift(_h9):t.push(_h9));}}catch(err){_iterator92.e(err);}finally{_iterator92.f();}}}catch(h){var _m18=h&&h instanceof Error?h.message:h==null?void 0:h.toString();console.error("[WorkThreadEngineForSimpleWorker] combinePostData error",_m18),r.push({type:gt.ReportError,reportString:"[WorkThreadEngineForSimpleWorker] combinePostData error: ".concat(_m18)});}if((l=f.sp)!=null&&l.length){var _iterator94=_createForOfIteratorHelper(f.sp),_step94;try{for(_iterator94.s();!(_step94=_iterator94.n()).done;){var _h10=_step94.value;var _m19=!1;var _iterator95=_createForOfIteratorHelper(r),_step95;try{for(_iterator95.s();!(_step95=_iterator95.n()).done;){var _u11=_step95.value;if(Qr(_h10,_u11)){_m19=!0;break;}}}catch(err){_iterator95.e(err);}finally{_iterator95.f();}_m19||r.push(_h10);}}catch(err){_iterator94.e(err);}finally{_iterator94.f();}}_e(f.consumeCount)&&(n=f.consumeCount);}}catch(err){_iterator90.e(err);}finally{_iterator90.f();}return this.combinePostMsg.clear(),{render:t,sp:r,consumeCount:n,workIds:s,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===gt.Snapshot?6:_context111.t0===gt.BoundingBox?11:16;break;case 6:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===jn?6e3:3e3,contextType:"2d"}));_context111.next=9;return this.snapshotWork.getSnapshot(t);case 9:this.snapshotWork.destroySnapshotFullLayer();return _context111.abrupt("return");case 11:this.snapshotWork.createSnapshotFullLayer(this.opt,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId===jn?6e3:3e3,contextType:"2d"}));_context111.next=14;return this.snapshotWork.getBoundingRect(t);case 14:this.snapshotWork.destroySnapshotFullLayer();return _context111.abrupt("return");case 16:_context111.next=18;return _superPropGet(KM,"on",this,3)([t]);case 18:case"end":return _context111.stop();}},_callee104,this);}));function on(_x142){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(KM,"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(KM,"updateDpr",this,3)([t]);case 1:case"end":return _context112.stop();}},_callee105,this);}));function updateDpr(_x143){return _updateDpr4.apply(this,arguments);}return updateDpr;}()}]);}(ad);var Xu=self;Xu.sub=new VM(Xu,ho.Sub);
|