@netless/appliance-plugin 1.0.0-beta.0 → 1.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -15
- package/cdn/cdn.js +1 -0
- package/cdn/fullWorker-DkNRgu.js +468 -0
- package/cdn/subWorker-BvxT1L.js +468 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +22 -8637
- package/dist/cdn.d.ts +3 -0
- package/dist/collector/types.d.ts +0 -1
- package/dist/component/textEditor/manager.d.ts +2 -5
- package/dist/component/textEditor/types.d.ts +1 -0
- package/dist/component/textEditor/view.d.ts +9 -7
- package/dist/core/enum.d.ts +8 -9
- package/dist/core/mainEngine.d.ts +37 -15
- package/dist/core/mainThread/base.d.ts +81 -0
- package/dist/core/mainThread/index.d.ts +23 -0
- package/dist/core/mainThread/snapshotThread.d.ts +39 -0
- package/dist/core/mainThread/subLocalThread.d.ts +102 -0
- package/dist/core/mainThread/subServiceThread.d.ts +42 -0
- package/dist/core/mainThread/subTopThread.d.ts +46 -0
- package/dist/core/mainThread/vNodeManager.d.ts +32 -0
- package/dist/core/msgEvent/baseForMainThread.d.ts +13 -0
- package/dist/core/msgEvent/copyNode/forMain.d.ts +2 -0
- package/dist/core/msgEvent/copyNode/forMainThread.d.ts +8 -0
- package/dist/core/msgEvent/deleteNode/forMainThread.d.ts +13 -0
- package/dist/core/msgEvent/forMainThread.d.ts +14 -0
- package/dist/core/msgEvent/rotateNode/forMain.d.ts +0 -1
- package/dist/core/msgEvent/rotateNode/forMainThread.d.ts +9 -0
- package/dist/core/msgEvent/scaleNode/forMain.d.ts +2 -1
- package/dist/core/msgEvent/scaleNode/forMainThread.d.ts +9 -0
- package/dist/core/msgEvent/setColor/forMain.d.ts +2 -1
- package/dist/core/msgEvent/setColor/forMainThread.d.ts +9 -0
- package/dist/core/msgEvent/setFont/forMainThread.d.ts +9 -0
- package/dist/core/msgEvent/setLock/forMainThread.d.ts +9 -0
- package/dist/core/msgEvent/setPoint/forMainThread.d.ts +9 -0
- package/dist/core/msgEvent/setShape/forMainThread.d.ts +9 -0
- package/dist/core/msgEvent/setZIndex/forMainThread.d.ts +9 -0
- package/dist/core/msgEvent/translateNode/forMain.d.ts +0 -1
- package/dist/core/msgEvent/translateNode/forMainThread.d.ts +9 -0
- package/dist/core/tools/arrow.d.ts +3 -3
- package/dist/core/tools/base.d.ts +5 -5
- package/dist/core/tools/ellipse.d.ts +3 -3
- package/dist/core/tools/eraser.d.ts +3 -3
- package/dist/core/tools/image.d.ts +2 -0
- package/dist/core/tools/pencil.d.ts +3 -2
- package/dist/core/tools/polygon.d.ts +4 -3
- package/dist/core/tools/rectangle.d.ts +4 -3
- package/dist/core/tools/selector.d.ts +11 -9
- package/dist/core/tools/speechBalloon.d.ts +4 -3
- package/dist/core/tools/star.d.ts +3 -3
- package/dist/core/tools/straight.d.ts +4 -3
- package/dist/core/tools/text.d.ts +7 -4
- package/dist/core/tools/utils.d.ts +7 -3
- package/dist/core/types.d.ts +16 -4
- package/dist/core/utils/index.d.ts +1 -1
- package/dist/core/utils/math.d.ts +3 -0
- package/dist/core/utils/spriteNode.d.ts +2 -2
- package/dist/core/worker/base.d.ts +17 -34
- package/dist/core/worker/fullWorkerLocal.d.ts +1 -1
- package/dist/core/worker/fullWorkerService.d.ts +23 -7
- package/dist/core/worker/subWorkerLocal.d.ts +1 -6
- package/dist/core/worker/subWorkerTopLayer.d.ts +43 -0
- package/dist/core/worker/vNodeManager.d.ts +3 -2
- package/dist/core/worker/workerManager.d.ts +16 -16
- package/dist/displayer/floatBar/dragBox/index.d.ts +4 -0
- package/dist/displayer/floatBar/index.d.ts +1 -5
- package/dist/fullWorker.js +468 -0
- package/dist/index-B3tcgIQd.js +1 -0
- package/dist/index-BFpq0pIU.mjs +8844 -0
- package/dist/index-CP5_CnSG.mjs +5419 -0
- package/dist/index-ChX1QimR.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/plugin/applianceMultiPlugin.d.ts +1 -1
- package/dist/plugin/applianceSinglePlugin.d.ts +1 -1
- package/dist/plugin/baseApplianceManager.d.ts +5 -5
- package/dist/plugin/baseViewContainerManager.d.ts +6 -4
- package/dist/plugin/const.d.ts +13 -0
- package/dist/plugin/displayerView.d.ts +4 -11
- package/dist/plugin/index.d.ts +2 -3
- package/dist/plugin/multi/applianceMultiManager.d.ts +1 -1
- package/dist/plugin/multi/containerManager.d.ts +3 -1
- package/dist/plugin/multi/displayer/appViewDisplayerManager.d.ts +2 -1
- package/dist/plugin/multi/displayer/mainViewDisplayerManager.d.ts +3 -1
- package/dist/plugin/single/applianceSingleManager.d.ts +1 -1
- package/dist/plugin/single/containerManager.d.ts +1 -1
- package/dist/plugin/single/displayer/mainViewDisplayerManager.d.ts +3 -1
- package/dist/plugin/types.d.ts +9 -3
- package/dist/style.css +1 -1
- package/dist/subWorker.js +468 -0
- package/dist/undo/index.d.ts +1 -2
- package/package.json +15 -17
- package/cdn/appliance-plugin.js +0 -1
- package/cdn/appliance-plugin.mjs +0 -8639
- package/cdn/style.css +0 -1
- package/dist/core/msgEvent/activeZIndex/forMain.d.ts +0 -12
- package/dist/core/msgEvent/activeZIndex/forWorker.d.ts +0 -8
- /package/dist/displayer/{highlightBox → floatBar/highlightBox}/index.d.ts +0 -0
- /package/dist/displayer/{resizable → floatBar/resizable}/index.d.ts +0 -0
- /package/dist/displayer/{rotate → floatBar/rotate}/index.d.ts +0 -0
|
@@ -0,0 +1,468 @@
|
|
|
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 n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],t.indexOf(o)>=0||{}.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.indexOf(n)>=0)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 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 _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 _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 _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 _n7=0,F=function F(){};return{s:F,n:function n(){return _n7>=r.length?{done:!0}:{done:!1,value:r[_n7++]};},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 _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 _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 _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 _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 _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 _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 _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);}var ti=Object.defineProperty;var ei=function ei(h,r,t){return r in h?ti(h,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[r]=t;};var nt=function nt(h,r,t){return ei(h,_typeof(r)!="symbol"?r+"":r,t),t;};var De=(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 ye(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h["default"]:h;}function ri(){this.__data__=[],this.size=0;}var ni=ri;function ii(h,r){return h===r||h!==h&&r!==r;}var ar=ii,si=ar;function oi(h,r){for(var t=h.length;t--;)if(si(h[t][0],r))return t;return-1;}var ze=oi,ai=ze,li=Array.prototype,ci=li.splice;function fi(h){var r=this.__data__,t=ai(r,h);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():ci.call(r,t,1),--this.size,!0;}var ui=fi,hi=ze;function di(h){var r=this.__data__,t=hi(r,h);return t<0?void 0:r[t][1];}var gi=di,pi=ze;function vi(h){return pi(this.__data__,h)>-1;}var mi=vi,yi=ze;function Si(h,r){var t=this.__data__,e=yi(t,h);return e<0?(++this.size,t.push([h,r])):t[e][1]=r,this;}var xi=Si,Ti=ni,Mi=ui,Oi=gi,Ei=mi,Pi=xi;function Se(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r<t;){var e=h[r];this.set(e[0],e[1]);}}Se.prototype.clear=Ti;Se.prototype["delete"]=Mi;Se.prototype.get=Oi;Se.prototype.has=Ei;Se.prototype.set=Pi;var Ge=Se,Ai=Ge;function Ci(){this.__data__=new Ai(),this.size=0;}var Ri=Ci;function Ii(h){var r=this.__data__,t=r["delete"](h);return this.size=r.size,t;}var Li=Ii;function bi(h){return this.__data__.get(h);}var Di=bi;function wi(h){return this.__data__.has(h);}var Ni=wi,Wi=_typeof(De)=="object"&&De&&De.Object===Object&&De,ln=Wi,Bi=ln,Fi=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,ji=Bi||Fi||Function("return this")(),_t=ji,Ui=_t,$i=Ui.Symbol,He=$i,Mr=He,cn=Object.prototype,zi=cn.hasOwnProperty,Gi=cn.toString,Ae=Mr?Mr.toStringTag:void 0;function Hi(h){var r=zi.call(h,Ae),t=h[Ae];try{h[Ae]=void 0;var e=!0;}catch(_unused){}var n=Gi.call(h);return e&&(r?h[Ae]=t:delete h[Ae]),n;}var Ki=Hi,Vi=Object.prototype,Yi=Vi.toString;function Xi(h){return Yi.call(h);}var Ji=Xi,Or=He,Qi=Ki,Zi=Ji,ki="[object Null]",qi="[object Undefined]",Er=Or?Or.toStringTag:void 0;function _i(h){return h==null?h===void 0?qi:ki:Er&&Er in Object(h)?Qi(h):Zi(h);}var fe=_i;function ts(h){var r=_typeof(h);return h!=null&&(r=="object"||r=="function");}var ae=ts,es=fe,rs=ae,ns="[object AsyncFunction]",is="[object Function]",ss="[object GeneratorFunction]",os="[object Proxy]";function as(h){if(!rs(h))return!1;var r=es(h);return r==is||r==ss||r==ns||r==os;}var fn=as,ls=_t,cs=ls["__core-js_shared__"],fs=cs,Qe=fs,Pr=function(){var h=/[^.]+$/.exec(Qe&&Qe.keys&&Qe.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:"";}();function us(h){return!!Pr&&Pr in h;}var hs=us,ds=Function.prototype,gs=ds.toString;function ps(h){if(h!=null){try{return gs.call(h);}catch(_unused2){}try{return h+"";}catch(_unused3){}}return"";}var un=ps,vs=fn,ms=hs,ys=ae,Ss=un,xs=/[\\^$.*+?()[\]{}|]/g,Ts=/^\[object .+?Constructor\]$/,Ms=Function.prototype,Os=Object.prototype,Es=Ms.toString,Ps=Os.hasOwnProperty,As=RegExp("^"+Es.call(Ps).replace(xs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cs(h){if(!ys(h)||ms(h))return!1;var r=vs(h)?As:Ts;return r.test(Ss(h));}var Rs=Cs;function Is(h,r){return h==null?void 0:h[r];}var Ls=Is,bs=Rs,Ds=Ls;function ws(h,r){var t=Ds(h,r);return bs(t)?t:void 0;}var ue=ws,Ns=ue,Ws=_t,Bs=Ns(Ws,"Map"),lr=Bs,Fs=ue,js=Fs(Object,"create"),Ke=js,Ar=Ke;function Us(){this.__data__=Ar?Ar(null):{},this.size=0;}var $s=Us;function zs(h){var r=this.has(h)&&delete this.__data__[h];return this.size-=r?1:0,r;}var Gs=zs,Hs=Ke,Ks="__lodash_hash_undefined__",Vs=Object.prototype,Ys=Vs.hasOwnProperty;function Xs(h){var r=this.__data__;if(Hs){var t=r[h];return t===Ks?void 0:t;}return Ys.call(r,h)?r[h]:void 0;}var Js=Xs,Qs=Ke,Zs=Object.prototype,ks=Zs.hasOwnProperty;function qs(h){var r=this.__data__;return Qs?r[h]!==void 0:ks.call(r,h);}var _s=qs,to=Ke,eo="__lodash_hash_undefined__";function ro(h,r){var t=this.__data__;return this.size+=this.has(h)?0:1,t[h]=to&&r===void 0?eo:r,this;}var no=ro,io=$s,so=Gs,oo=Js,ao=_s,lo=no;function xe(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r<t;){var e=h[r];this.set(e[0],e[1]);}}xe.prototype.clear=io;xe.prototype["delete"]=so;xe.prototype.get=oo;xe.prototype.has=ao;xe.prototype.set=lo;var co=xe,Cr=co,fo=Ge,uo=lr;function ho(){this.size=0,this.__data__={hash:new Cr(),map:new(uo||fo)(),string:new Cr()};}var go=ho;function po(h){var r=_typeof(h);return r=="string"||r=="number"||r=="symbol"||r=="boolean"?h!=="__proto__":h===null;}var vo=po,mo=vo;function yo(h,r){var t=h.__data__;return mo(r)?t[typeof r=="string"?"string":"hash"]:t.map;}var Ve=yo,So=Ve;function xo(h){var r=So(this,h)["delete"](h);return this.size-=r?1:0,r;}var To=xo,Mo=Ve;function Oo(h){return Mo(this,h).get(h);}var Eo=Oo,Po=Ve;function Ao(h){return Po(this,h).has(h);}var Co=Ao,Ro=Ve;function Io(h,r){var t=Ro(this,h),e=t.size;return t.set(h,r),this.size+=t.size==e?0:1,this;}var Lo=Io,bo=go,Do=To,wo=Eo,No=Co,Wo=Lo;function Te(h){var r=-1,t=h==null?0:h.length;for(this.clear();++r<t;){var e=h[r];this.set(e[0],e[1]);}}Te.prototype.clear=bo;Te.prototype["delete"]=Do;Te.prototype.get=wo;Te.prototype.has=No;Te.prototype.set=Wo;var hn=Te,Bo=Ge,Fo=lr,jo=hn,Uo=200;function $o(h,r){var t=this.__data__;if(t instanceof Bo){var e=t.__data__;if(!Fo||e.length<Uo-1)return e.push([h,r]),this.size=++t.size,this;t=this.__data__=new jo(e);}return t.set(h,r),this.size=t.size,this;}var zo=$o,Go=Ge,Ho=Ri,Ko=Li,Vo=Di,Yo=Ni,Xo=zo;function Me(h){var r=this.__data__=new Go(h);this.size=r.size;}Me.prototype.clear=Ho;Me.prototype["delete"]=Ko;Me.prototype.get=Vo;Me.prototype.has=Yo;Me.prototype.set=Xo;var dn=Me;function Jo(h,r){for(var t=-1,e=h==null?0:h.length;++t<e&&r(h[t],t,h)!==!1;);return h;}var Qo=Jo,Zo=ue,ko=function(){try{var h=Zo(Object,"defineProperty");return h({},"",{}),h;}catch(_unused4){}}(),qo=ko,Rr=qo;function _o(h,r,t){r=="__proto__"&&Rr?Rr(h,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):h[r]=t;}var gn=_o,ta=gn,ea=ar,ra=Object.prototype,na=ra.hasOwnProperty;function ia(h,r,t){var e=h[r];(!(na.call(h,r)&&ea(e,t))||t===void 0&&!(r in h))&&ta(h,r,t);}var pn=ia,sa=pn,oa=gn;function aa(h,r,t,e){var n=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var s=r[i],o=e?e(t[s],h[s],s,t,h):void 0;o===void 0&&(o=h[s]),n?oa(t,s,o):sa(t,s,o);}return t;}var Ye=aa;function la(h,r){for(var t=-1,e=Array(h);++t<h;)e[t]=r(t);return e;}var ca=la;function fa(h){return h!=null&&_typeof(h)=="object";}var re=fa,ua=fe,ha=re,da="[object Arguments]";function ga(h){return ha(h)&&ua(h)==da;}var pa=ga,Ir=pa,va=re,vn=Object.prototype,ma=vn.hasOwnProperty,ya=vn.propertyIsEnumerable,Sa=Ir(/* @__PURE__ */function(){return arguments;}())?Ir:function(h){return va(h)&&ma.call(h,"callee")&&!ya.call(h,"callee");},xa=Sa,Ta=Array.isArray,Xe=Ta,We={exports:{}};function Ma(){return!1;}var Oa=Ma;We.exports;(function(h,r){var t=_t,e=Oa,n=r&&!r.nodeType&&r,i=n&&!0&&h&&!h.nodeType&&h,a=i&&i.exports===n,s=a?t.Buffer:void 0,o=s?s.isBuffer:void 0,f=o||e;h.exports=f;})(We,We.exports);var cr=We.exports,Ea=9007199254740991,Pa=/^(?:0|[1-9]\d*)$/;function Aa(h,r){var _r2;var t=_typeof(h);return r=(_r2=r)!==null&&_r2!==void 0?_r2:Ea,!!r&&(t=="number"||t!="symbol"&&Pa.test(h))&&h>-1&&h%1==0&&h<r;}var Ca=Aa,Ra=9007199254740991;function Ia(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=Ra;}var mn=Ia,La=fe,ba=mn,Da=re,wa="[object Arguments]",Na="[object Array]",Wa="[object Boolean]",Ba="[object Date]",Fa="[object Error]",ja="[object Function]",Ua="[object Map]",$a="[object Number]",za="[object Object]",Ga="[object RegExp]",Ha="[object Set]",Ka="[object String]",Va="[object WeakMap]",Ya="[object ArrayBuffer]",Xa="[object DataView]",Ja="[object Float32Array]",Qa="[object Float64Array]",Za="[object Int8Array]",ka="[object Int16Array]",qa="[object Int32Array]",_a="[object Uint8Array]",tl="[object Uint8ClampedArray]",el="[object Uint16Array]",rl="[object Uint32Array]",Ft={};Ft[Ja]=Ft[Qa]=Ft[Za]=Ft[ka]=Ft[qa]=Ft[_a]=Ft[tl]=Ft[el]=Ft[rl]=!0;Ft[wa]=Ft[Na]=Ft[Ya]=Ft[Wa]=Ft[Xa]=Ft[Ba]=Ft[Fa]=Ft[ja]=Ft[Ua]=Ft[$a]=Ft[za]=Ft[Ga]=Ft[Ha]=Ft[Ka]=Ft[Va]=!1;function nl(h){return Da(h)&&ba(h.length)&&!!Ft[La(h)];}var il=nl;function sl(h){return function(r){return h(r);};}var fr=sl,Be={exports:{}};Be.exports;(function(h,r){var t=ln,e=r&&!r.nodeType&&r,n=e&&!0&&h&&!h.nodeType&&h,i=n&&n.exports===e,a=i&&t.process,s=function(){try{var o=n&&n.require&&n.require("util").types;return o||a&&a.binding&&a.binding("util");}catch(_unused5){}}();h.exports=s;})(Be,Be.exports);var ur=Be.exports,ol=il,al=fr,Lr=ur,br=Lr&&Lr.isTypedArray,ll=br?al(br):ol,yn=ll,cl=ca,fl=xa,ul=Xe,hl=cr,dl=Ca,gl=yn,pl=Object.prototype,vl=pl.hasOwnProperty;function ml(h,r){var t=ul(h),e=!t&&fl(h),n=!t&&!e&&hl(h),i=!t&&!e&&!n&&gl(h),a=t||e||n||i,s=a?cl(h.length,String):[],o=s.length;for(var f in h)(r||vl.call(h,f))&&!(a&&(// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
2
|
+
f=="length"||// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
3
|
+
n&&(f=="offset"||f=="parent")||// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
4
|
+
i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||// Skip index properties.
|
|
5
|
+
dl(f,o)))&&s.push(f);return s;}var Sn=ml,yl=Object.prototype;function Sl(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||yl;return h===t;}var hr=Sl;function xl(h,r){return function(t){return h(r(t));};}var xn=xl,Tl=xn,Ml=Tl(Object.keys,Object),Ol=Ml,El=hr,Pl=Ol,Al=Object.prototype,Cl=Al.hasOwnProperty;function Rl(h){if(!El(h))return Pl(h);var r=[];for(var t in Object(h))Cl.call(h,t)&&t!="constructor"&&r.push(t);return r;}var Il=Rl,Ll=fn,bl=mn;function Dl(h){return h!=null&&bl(h.length)&&!Ll(h);}var Tn=Dl,wl=Sn,Nl=Il,Wl=Tn;function Bl(h){return Wl(h)?wl(h):Nl(h);}var dr=Bl,Fl=Ye,jl=dr;function Ul(h,r){return h&&Fl(r,jl(r),h);}var $l=Ul;function zl(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Gl=zl,Hl=ae,Kl=hr,Vl=Gl,Yl=Object.prototype,Xl=Yl.hasOwnProperty;function Jl(h){if(!Hl(h))return Vl(h);var r=Kl(h),t=[];for(var e in h)e=="constructor"&&(r||!Xl.call(h,e))||t.push(e);return t;}var Ql=Jl,Zl=Sn,kl=Ql,ql=Tn;function _l(h){return ql(h)?Zl(h,!0):kl(h);}var gr=_l,tc=Ye,ec=gr;function rc(h,r){return h&&tc(r,ec(r),h);}var nc=rc,Fe={exports:{}};Fe.exports;(function(h,r){var t=_t,e=r&&!r.nodeType&&r,n=e&&!0&&h&&!h.nodeType&&h,i=n&&n.exports===e,a=i?t.Buffer:void 0,s=a?a.allocUnsafe:void 0;function o(f,v){if(v)return f.slice();var l=f.length,p=s?s(l):new f.constructor(l);return f.copy(p),p;}h.exports=o;})(Fe,Fe.exports);var ic=Fe.exports;function sc(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t<e;)r[t]=h[t];return r;}var oc=sc;function ac(h,r){for(var t=-1,e=h==null?0:h.length,n=0,i=[];++t<e;){var a=h[t];r(a,t,h)&&(i[n++]=a);}return i;}var lc=ac;function cc(){return[];}var Mn=cc,fc=lc,uc=Mn,hc=Object.prototype,dc=hc.propertyIsEnumerable,Dr=Object.getOwnPropertySymbols,gc=Dr?function(h){return h==null?[]:(h=Object(h),fc(Dr(h),function(r){return dc.call(h,r);}));}:uc,pr=gc,pc=Ye,vc=pr;function mc(h,r){return pc(h,vc(h),r);}var yc=mc;function Sc(h,r){for(var t=-1,e=r.length,n=h.length;++t<e;)h[n+t]=r[t];return h;}var On=Sc,xc=xn,Tc=xc(Object.getPrototypeOf,Object),En=Tc,Mc=On,Oc=En,Ec=pr,Pc=Mn,Ac=Object.getOwnPropertySymbols,Cc=Ac?function(h){for(var r=[];h;)Mc(r,Ec(h)),h=Oc(h);return r;}:Pc,Pn=Cc,Rc=Ye,Ic=Pn;function Lc(h,r){return Rc(h,Ic(h),r);}var bc=Lc,Dc=On,wc=Xe;function Nc(h,r,t){var e=r(h);return wc(h)?e:Dc(e,t(h));}var An=Nc,Wc=An,Bc=pr,Fc=dr;function jc(h){return Wc(h,Fc,Bc);}var Cn=jc,Uc=An,$c=Pn,zc=gr;function Gc(h){return Uc(h,zc,$c);}var Hc=Gc,Kc=ue,Vc=_t,Yc=Kc(Vc,"DataView"),Xc=Yc,Jc=ue,Qc=_t,Zc=Jc(Qc,"Promise"),kc=Zc,qc=ue,_c=_t,tf=qc(_c,"Set"),ef=tf,rf=ue,nf=_t,sf=rf(nf,"WeakMap"),of=sf,_e=Xc,tr=lr,er=kc,rr=ef,nr=of,Rn=fe,Oe=un,wr="[object Map]",af="[object Object]",Nr="[object Promise]",Wr="[object Set]",Br="[object WeakMap]",Fr="[object DataView]",lf=Oe(_e),cf=Oe(tr),ff=Oe(er),uf=Oe(rr),hf=Oe(nr),le=Rn;(_e&&le(new _e(new ArrayBuffer(1)))!=Fr||tr&&le(new tr())!=wr||er&&le(er.resolve())!=Nr||rr&&le(new rr())!=Wr||nr&&le(new nr())!=Br)&&(le=function le(h){var r=Rn(h),t=r==af?h.constructor:void 0,e=t?Oe(t):"";if(e)switch(e){case lf:return Fr;case cf:return wr;case ff:return Nr;case uf:return Wr;case hf:return Br;}return r;});var Je=le,df=Object.prototype,gf=df.hasOwnProperty;function pf(h){var r=h.length,t=new h.constructor(r);return r&&typeof h[0]=="string"&&gf.call(h,"index")&&(t.index=h.index,t.input=h.input),t;}var vf=pf,mf=_t,yf=mf.Uint8Array,In=yf,jr=In;function Sf(h){var r=new h.constructor(h.byteLength);return new jr(r).set(new jr(h)),r;}var vr=Sf,xf=vr;function Tf(h,r){var t=r?xf(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.byteLength);}var Mf=Tf,Of=/\w*$/;function Ef(h){var r=new h.constructor(h.source,Of.exec(h));return r.lastIndex=h.lastIndex,r;}var Pf=Ef,Ur=He,$r=Ur?Ur.prototype:void 0,zr=$r?$r.valueOf:void 0;function Af(h){return zr?Object(zr.call(h)):{};}var Cf=Af,Rf=vr;function If(h,r){var t=r?Rf(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.length);}var Lf=If,bf=vr,Df=Mf,wf=Pf,Nf=Cf,Wf=Lf,Bf="[object Boolean]",Ff="[object Date]",jf="[object Map]",Uf="[object Number]",$f="[object RegExp]",zf="[object Set]",Gf="[object String]",Hf="[object Symbol]",Kf="[object ArrayBuffer]",Vf="[object DataView]",Yf="[object Float32Array]",Xf="[object Float64Array]",Jf="[object Int8Array]",Qf="[object Int16Array]",Zf="[object Int32Array]",kf="[object Uint8Array]",qf="[object Uint8ClampedArray]",_f="[object Uint16Array]",tu="[object Uint32Array]";function eu(h,r,t){var e=h.constructor;switch(r){case Kf:return bf(h);case Bf:case Ff:return new e(+h);case Vf:return Df(h,t);case Yf:case Xf:case Jf:case Qf:case Zf:case kf:case qf:case _f:case tu:return Wf(h,t);case jf:return new e();case Uf:case Gf:return new e(h);case $f:return wf(h);case zf:return new e();case Hf:return Nf(h);}}var ru=eu,nu=ae,Gr=Object.create,iu=/* @__PURE__ */function(){function h(){}return function(r){if(!nu(r))return{};if(Gr)return Gr(r);h.prototype=r;var t=new h();return h.prototype=void 0,t;};}(),su=iu,ou=su,au=En,lu=hr;function cu(h){return typeof h.constructor=="function"&&!lu(h)?ou(au(h)):{};}var fu=cu,uu=Je,hu=re,du="[object Map]";function gu(h){return hu(h)&&uu(h)==du;}var pu=gu,vu=pu,mu=fr,Hr=ur,Kr=Hr&&Hr.isMap,yu=Kr?mu(Kr):vu,Su=yu,xu=Je,Tu=re,Mu="[object Set]";function Ou(h){return Tu(h)&&xu(h)==Mu;}var Eu=Ou,Pu=Eu,Au=fr,Vr=ur,Yr=Vr&&Vr.isSet,Cu=Yr?Au(Yr):Pu,Ru=Cu,Iu=dn,Lu=Qo,bu=pn,Du=$l,wu=nc,Nu=ic,Wu=oc,Bu=yc,Fu=bc,ju=Cn,Uu=Hc,$u=Je,zu=vf,Gu=ru,Hu=fu,Ku=Xe,Vu=cr,Yu=Su,Xu=ae,Ju=Ru,Qu=dr,Zu=gr,ku=1,qu=2,_u=4,Ln="[object Arguments]",th="[object Array]",eh="[object Boolean]",rh="[object Date]",nh="[object Error]",bn="[object Function]",ih="[object GeneratorFunction]",sh="[object Map]",oh="[object Number]",Dn="[object Object]",ah="[object RegExp]",lh="[object Set]",ch="[object String]",fh="[object Symbol]",uh="[object WeakMap]",hh="[object ArrayBuffer]",dh="[object DataView]",gh="[object Float32Array]",ph="[object Float64Array]",vh="[object Int8Array]",mh="[object Int16Array]",yh="[object Int32Array]",Sh="[object Uint8Array]",xh="[object Uint8ClampedArray]",Th="[object Uint16Array]",Mh="[object Uint32Array]",Wt={};Wt[Ln]=Wt[th]=Wt[hh]=Wt[dh]=Wt[eh]=Wt[rh]=Wt[gh]=Wt[ph]=Wt[vh]=Wt[mh]=Wt[yh]=Wt[sh]=Wt[oh]=Wt[Dn]=Wt[ah]=Wt[lh]=Wt[ch]=Wt[fh]=Wt[Sh]=Wt[xh]=Wt[Th]=Wt[Mh]=!0;Wt[nh]=Wt[bn]=Wt[uh]=!1;function Ne(h,r,t,e,n,i){var a,s=r&ku,o=r&qu,f=r&_u;if(t&&(a=n?t(h,e,n,i):t(h)),a!==void 0)return a;if(!Xu(h))return h;var v=Ku(h);if(v){if(a=zu(h),!s)return Wu(h,a);}else{var l=$u(h),p=l==bn||l==ih;if(Vu(h))return Nu(h,s);if(l==Dn||l==Ln||p&&!n){if(a=o||p?{}:Hu(h),!s)return o?Fu(h,wu(a,h)):Bu(h,Du(a,h));}else{if(!Wt[l])return n?h:{};a=Gu(h,l,s);}}i||(i=new Iu());var y=i.get(h);if(y)return y;i.set(h,a),Ju(h)?h.forEach(function(m){a.add(Ne(m,r,t,m,h,i));}):Yu(h)&&h.forEach(function(m,T){a.set(T,Ne(m,r,t,T,h,i));});var O=f?o?Uu:ju:o?Zu:Qu,x=v?void 0:O(h);return Lu(x||h,function(m,T){x&&(T=m,m=h[T]),bu(a,T,Ne(m,r,t,T,h,i));}),a;}var Oh=Ne,Eh=Oh,Ph=1,Ah=4;function Ch(h){return Eh(h,Ph|Ah);}var Rh=Ch,Xt=/* @__PURE__ */ye(Rh),Vt=/* @__PURE__ */function(h){return h.Normal="Normal",h.Stroke="Stroke",h.Dotted="Dotted",h.LongDotted="LongDotted",h;}(Vt||{}),Lt=/* @__PURE__ */function(h){return h.None="None",h.ShowFloatBar="ShowFloatBar",h.ZIndexFloatBar="ZIndexFloatBar",h.DeleteNode="DeleteNode",h.CopyNode="CopyNode",h.ZIndexActive="ZIndexActive",h.ZIndexNode="ZIndexNode",h.RotateNode="RotateNode",h.SetColorNode="SetColorNode",h.TranslateNode="TranslateNode",h.ScaleNode="ScaleNode",h.OriginalEvent="OriginalEvent",h.CreateScene="CreateScene",h.ActiveCursor="ActiveCursor",h.MoveCursor="MoveCursor",h.CommandEditor="CommandEditor",h.SetEditorData="SetEditorData",h.SetFontStyle="SetFontStyle",h.SetPoint="SetPoint",h.SetLock="SetLock",h.SetShapeOpt="SetShapeOpt",h;}(Lt||{}),ht=/* @__PURE__ */function(h){return h[h.Pencil=1]="Pencil",h[h.Eraser=2]="Eraser",h[h.Selector=3]="Selector",h[h.Clicker=4]="Clicker",h[h.Arrow=5]="Arrow",h[h.Hand=6]="Hand",h[h.LaserPen=7]="LaserPen",h[h.Text=8]="Text",h[h.Straight=9]="Straight",h[h.Rectangle=10]="Rectangle",h[h.Ellipse=11]="Ellipse",h[h.Star=12]="Star",h[h.Triangle=13]="Triangle",h[h.Rhombus=14]="Rhombus",h[h.Polygon=15]="Polygon",h[h.SpeechBalloon=16]="SpeechBalloon",h[h.Image=17]="Image",h;}(ht||{}),Tt=/* @__PURE__ */function(h){return h[h.Local=1]="Local",h[h.Service=2]="Service",h[h.Worker=3]="Worker",h;}(Tt||{}),Rt=/* @__PURE__ */function(h){return h[h.Pending=0]="Pending",h[h.Start=1]="Start",h[h.Doing=2]="Doing",h[h.Done=3]="Done",h[h.Unwritable=4]="Unwritable",h;}(Rt||{}),ct=/* @__PURE__ */function(h){return h[h.None=0]="None",h[h.Init=1]="Init",h[h.UpdateCamera=2]="UpdateCamera",h[h.UpdateTools=3]="UpdateTools",h[h.CreateWork=4]="CreateWork",h[h.DrawWork=5]="DrawWork",h[h.FullWork=6]="FullWork",h[h.UpdateNode=7]="UpdateNode",h[h.RemoveNode=8]="RemoveNode",h[h.Clear=9]="Clear",h[h.Select=10]="Select",h[h.Destroy=11]="Destroy",h[h.Snapshot=12]="Snapshot",h[h.BoundingBox=13]="BoundingBox",h[h.Cursor=14]="Cursor",h[h.TextUpdate=15]="TextUpdate",h[h.GetTextActive=16]="GetTextActive",h[h.TasksQueue=17]="TasksQueue",h[h.CursorHover=18]="CursorHover",h;}(ct||{}),Mt=/* @__PURE__ */function(h){return h[h.None=0]="None",h[h.Bg=1]="Bg",h[h.ServiceFloat=2]="ServiceFloat",h[h.Float=3]="Float",h[h.TopFloat=4]="TopFloat",h;}(Mt||{}),zt=/* @__PURE__ */function(h){return h[h.none=1]="none",h[h.all=2]="all",h[h.both=3]="both",h[h.proportional=4]="proportional",h;}(zt||{});var te=/*#__PURE__*/function(){function te(){_classCallCheck(this,te);nt(this,"localWork");nt(this,"serviceWork");nt(this,"scene");}return _createClass(te,[{key:"registerForWorker",value:function registerForWorker(r,t,e){return this.localWork=r,this.serviceWork=t,this.scene=e,this;}}]);}();var Ih=/*#__PURE__*/function(_te){function Ih(){var _this;_classCallCheck(this,Ih);_this=_callSuper(this,Ih,arguments);nt(_this,"emitEventType",Lt.CopyNode);return _this;}_inherits(Ih,_te);return _createClass(Ih,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.FullWork&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var n,e;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:e=t.workId;_context.t0=e;if(!_context.t0){_context.next=5;break;}_context.next=5;return(n=this.localWork)==null?void 0:n.consumeFull(t,this.scene);case 5:case"end":return _context.stop();}},_callee,this);}));function consumeForLocalWorker(_x){return _consumeForLocalWorker.apply(this,arguments);}return consumeForLocalWorker;}()}]);}(te);var Lh={linear:function linear(h){return h;},easeInQuad:function easeInQuad(h){return h*h;},easeOutQuad:function easeOutQuad(h){return h*(2-h);},easeInOutQuad:function easeInOutQuad(h){return h<0.5?2*h*h:-1+(4-2*h)*h;},easeInCubic:function easeInCubic(h){return h*h*h;},easeOutCubic:function easeOutCubic(h){return--h*h*h+1;},easeInOutCubic:function easeInOutCubic(h){return h<0.5?4*h*h*h:(h-1)*(2*h-2)*(2*h-2)+1;},easeInQuart:function easeInQuart(h){return h*h*h*h;},easeOutQuart:function easeOutQuart(h){return 1- --h*h*h*h;},easeInOutQuart:function easeInOutQuart(h){return h<0.5?8*h*h*h*h:1-8*--h*h*h*h;},easeInQuint:function easeInQuint(h){return h*h*h*h*h;},easeOutQuint:function easeOutQuint(h){return 1+--h*h*h*h*h;},easeInOutQuint:function easeInOutQuint(h){return h<0.5?16*h*h*h*h*h:1+16*--h*h*h*h*h;},easeInSine:function easeInSine(h){return 1-Math.cos(h*Math.PI/2);},easeOutSine:function easeOutSine(h){return Math.sin(h*Math.PI/2);},easeInOutSine:function easeInOutSine(h){return-(Math.cos(Math.PI*h)-1)/2;},easeInExpo:function easeInExpo(h){return h<=0?0:Math.pow(2,10*h-10);},easeOutExpo:function easeOutExpo(h){return h>=1?1:1-Math.pow(2,-10*h);},easeInOutExpo:function easeInOutExpo(h){return h<=0?0:h>=1?1:h<0.5?Math.pow(2,20*h-10)/2:(2-Math.pow(2,-20*h+10))/2;}};var _=/*#__PURE__*/function(){function _(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;_classCallCheck(this,_);this.x=r,this.y=t,this.z=e;}return _createClass(_,[{key:"XY",get:function get(){return[this.x,this.y];}},{key:"setz",value:function setz(r){return this.z=r,this;}},{key:"setXY",value:function setXY(){var r=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=r,this.y=t,this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;return this.x=r,this.y=t,this.z=e,this;}},{key:"setTo",value:function setTo(_ref){var _ref$x=_ref.x,r=_ref$x===void 0?0:_ref$x,_ref$y=_ref.y,t=_ref$y===void 0?0:_ref$y,_ref$z=_ref.z,e=_ref$z===void 0?1:_ref$z;return this.x=r,this.y=t,this.z=e,this;}},{key:"rot",value:function rot(r){if(r===0)return this;var t=this.x,e=this.y,n=Math.sin(r),i=Math.cos(r);return this.x=t*i-e*n,this.y=t*n+e*i,this;}},{key:"rotWith",value:function rotWith(r,t){if(t===0)return this;var e=this.x-r.x,n=this.y-r.y,i=Math.sin(t),a=Math.cos(t);return this.x=r.x+(e*a-n*i),this.y=r.y+(e*i+n*a),this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z;return new _(r,t,e);}},{key:"sub",value:function sub(r){return this.x-=r.x,this.y-=r.y,this;}},{key:"subXY",value:function subXY(r,t){return this.x-=r,this.y-=t,this;}},{key:"subScalar",value:function subScalar(r){return this.x-=r,this.y-=r,this;}},{key:"add",value:function add(r){return this.x+=r.x,this.y+=r.y,this;}},{key:"addXY",value:function addXY(r,t){return this.x+=r,this.y+=t,this;}},{key:"addScalar",value:function addScalar(r){return this.x+=r,this.y+=r,this;}},{key:"clamp",value:function clamp(r,t){return this.x=Math.max(this.x,r),this.y=Math.max(this.y,r),t!==void 0&&(this.x=Math.min(this.x,t),this.y=Math.min(this.y,t)),this;}},{key:"div",value:function div(r){return this.x/=r,this.y/=r,this;}},{key:"divV",value:function divV(r){return this.x/=r.x,this.y/=r.y,this;}},{key:"mul",value:function mul(r){return this.x*=r,this.y*=r,this;}},{key:"mulV",value:function mulV(r){return this.x*=r.x,this.y*=r.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(r,t){var e=_.Tan(r,this);return this.add(e.mul(t));}},{key:"neg",value:function neg(){return this.x*=-1,this.y*=-1,this;}},{key:"cross",value:function cross(r){return this.x=this.y*r.z-this.z*r.y,this.y=this.z*r.x-this.x*r.z,this;}},{key:"dpr",value:function dpr(r){return _.Dpr(this,r);}},{key:"cpr",value:function cpr(r){return _.Cpr(this,r);}},{key:"len2",value:function len2(){return _.Len2(this);}},{key:"len",value:function len(){return _.Len(this);}},{key:"pry",value:function pry(r){return _.Pry(this,r);}},{key:"per",value:function per(){var r=this.x,t=this.y;return this.x=t,this.y=-r,this;}},{key:"uni",value:function uni(){return _.Uni(this);}},{key:"tan",value:function tan(r){return _.Tan(this,r);}},{key:"dist",value:function dist(r){return _.Dist(this,r);}},{key:"distanceToLineSegment",value:function distanceToLineSegment(r,t){return _.DistanceToLineSegment(r,t,this);}},{key:"slope",value:function slope(r){return _.Slope(this,r);}},{key:"snapToGrid",value:function snapToGrid(r){return this.x=Math.round(this.x/r)*r,this.y=Math.round(this.y/r)*r,this;}},{key:"angle",value:function angle(r){return _.Angle(this,r);}},{key:"toAngle",value:function toAngle(){return _.ToAngle(this);}},{key:"lrp",value:function lrp(r,t){return this.x=this.x+(r.x-this.x)*t,this.y=this.y+(r.y-this.y)*t,this;}},{key:"equals",value:function equals(r,t){return _.Equals(this,r,t);}},{key:"equalsXY",value:function equalsXY(r,t){return _.EqualsXY(this,r,t);}},{key:"norm",value:function norm(){var r=this.len();return this.x=r===0?0:this.x/r,this.y=r===0?0:this.y/r,this;}},{key:"toFixed",value:function toFixed(){return _.ToFixed(this);}},{key:"toString",value:function toString(){return _.ToString(_.ToFixed(this));}},{key:"toJson",value:function toJson(){return _.ToJson(this);}},{key:"toArray",value:function toArray(){return _.ToArray(this);}}],[{key:"Add",value:function Add(r,t){return new _(r.x+t.x,r.y+t.y);}},{key:"AddXY",value:function AddXY(r,t,e){return new _(r.x+t,r.y+e);}},{key:"Sub",value:function Sub(r,t){return new _(r.x-t.x,r.y-t.y);}},{key:"SubXY",value:function SubXY(r,t,e){return new _(r.x-t,r.y-e);}},{key:"AddScalar",value:function AddScalar(r,t){return new _(r.x+t,r.y+t);}},{key:"SubScalar",value:function SubScalar(r,t){return new _(r.x-t,r.y-t);}},{key:"Div",value:function Div(r,t){return new _(r.x/t,r.y/t);}},{key:"Mul",value:function Mul(r,t){return new _(r.x*t,r.y*t);}},{key:"DivV",value:function DivV(r,t){return new _(r.x/t.x,r.y/t.y);}},{key:"MulV",value:function MulV(r,t){return new _(r.x*t.x,r.y*t.y);}},{key:"Neg",value:function Neg(r){return new _(-r.x,-r.y);}},{key:"Per",value:function Per(r){return new _(r.y,-r.x);}},{key:"Dist2",value:function Dist2(r,t){return _.Sub(r,t).len2();}},{key:"Abs",value:function Abs(r){return new _(Math.abs(r.x),Math.abs(r.y));}},{key:"Dist",value:function Dist(r,t){return Math.hypot(r.y-t.y,r.x-t.x);}},{key:"Dpr",value:function Dpr(r,t){return r.x*t.x+r.y*t.y;}},{key:"Cross",value:function Cross(r,t){return new _(r.y*t.z-r.z*t.y,r.z*t.x-r.x*t.z// A.z = A.x * V.y - A.y * V.x
|
|
6
|
+
);}},{key:"Cpr",value:function Cpr(r,t){return r.x*t.y-t.x*r.y;}},{key:"Len2",value:function Len2(r){return r.x*r.x+r.y*r.y;}},{key:"Len",value:function Len(r){return Math.hypot(r.x,r.y);}},{key:"Pry",value:function Pry(r,t){return _.Dpr(r,t)/_.Len(t);}},{key:"Uni",value:function Uni(r){return _.Div(r,_.Len(r));}},{key:"Tan",value:function Tan(r,t){return _.Uni(_.Sub(r,t));}},{key:"Min",value:function Min(r,t){return new _(Math.min(r.x,t.x),Math.min(r.y,t.y));}},{key:"Max",value:function Max(r,t){return new _(Math.max(r.x,t.x),Math.max(r.y,t.y));}},{key:"From",value:function From(r){return new _().add(r);}},{key:"FromArray",value:function FromArray(r){return new _(r[0],r[1]);}},{key:"Rot",value:function Rot(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=Math.sin(t),n=Math.cos(t);return new _(r.x*n-r.y*e,r.x*e+r.y*n);}},{key:"RotWith",value:function RotWith(r,t,e){var n=r.x-t.x,i=r.y-t.y,a=Math.sin(e),s=Math.cos(e);return new _(t.x+(n*s-i*a),t.y+(n*a+i*s));}/**
|
|
7
|
+
* Get the nearest point on a line with a known unit vector that passes through point A
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* Vec.nearestPointOnLineThroughPoint(A, u, Point)
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param A - Any point on the line
|
|
14
|
+
* @param u - The unit vector for the line.
|
|
15
|
+
* @param P - A point not on the line to test.
|
|
16
|
+
*/},{key:"NearestPointOnLineThroughPoint",value:function NearestPointOnLineThroughPoint(r,t,e){return _.Mul(t,_.Sub(e,r).pry(t)).add(r);}},{key:"NearestPointOnLineSegment",value:function NearestPointOnLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var i=_.Tan(t,r),a=_.Add(r,_.Mul(i,_.Sub(e,r).pry(i)));if(n){if(a.x<Math.min(r.x,t.x))return _.Cast(r.x<t.x?r:t);if(a.x>Math.max(r.x,t.x))return _.Cast(r.x>t.x?r:t);if(a.y<Math.min(r.y,t.y))return _.Cast(r.y<t.y?r:t);if(a.y>Math.max(r.y,t.y))return _.Cast(r.y>t.y?r:t);}return a;}},{key:"DistanceToLineThroughPoint",value:function DistanceToLineThroughPoint(r,t,e){return _.Dist(e,_.NearestPointOnLineThroughPoint(r,t,e));}},{key:"DistanceToLineSegment",value:function DistanceToLineSegment(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return _.Dist(e,_.NearestPointOnLineSegment(r,t,e,n));}},{key:"Snap",value:function Snap(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}},{key:"Cast",value:function Cast(r){return r instanceof _?r:_.From(r);}},{key:"Slope",value:function Slope(r,t){return r.x===t.y?NaN:(r.y-t.y)/(r.x-t.x);}},{key:"Angle",value:function Angle(r,t){return Math.atan2(t.y-r.y,t.x-r.x);}},{key:"Lrp",value:function Lrp(r,t,e){return _.Sub(t,r).mul(e).add(r);}},{key:"Med",value:function Med(r,t){return new _((r.x+t.x)/2,(r.y+t.y)/2);}},{key:"Equals",value:function Equals(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(r.x-t.x)<e&&Math.abs(r.y-t.y)<e;}},{key:"EqualsXY",value:function EqualsXY(r,t,e){return r.x===t&&r.y===e;}},{key:"EqualsXYZ",value:function EqualsXYZ(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return _.Equals(r,t,e)&&Math.abs((r.z||0)-(t.z||0))<e;}},{key:"Clockwise",value:function Clockwise(r,t,e){return(e.x-r.x)*(t.y-r.y)-(t.x-r.x)*(e.y-r.y)<0;}},{key:"Rescale",value:function Rescale(r,t){var e=_.Len(r);return new _(t*r.x/e,t*r.y/e);}},{key:"ScaleWithOrigin",value:function ScaleWithOrigin(r,t,e){return _.Sub(r,e).mul(t).add(e);}},{key:"ScaleWOrigin",value:function ScaleWOrigin(r,t,e){return _.Sub(r,e).mulV(t).add(e);}},{key:"ToFixed",value:function ToFixed(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return new _(+r.x.toFixed(t),+r.y.toFixed(t),+r.z.toFixed(t));}},{key:"Nudge",value:function Nudge(r,t,e){return _.Add(r,_.Tan(t,r).mul(e));}},{key:"ToString",value:function ToString(r){return"".concat(r.x,", ").concat(r.y);}},{key:"ToAngle",value:function ToAngle(r){var t=Math.atan2(r.y,r.x);return t<0&&(t+=Math.PI*2),t;}},{key:"FromAngle",value:function FromAngle(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return new _(Math.cos(r)*t,Math.sin(r)*t);}},{key:"ToArray",value:function ToArray(r){return[r.x,r.y,r.z];}},{key:"ToJson",value:function ToJson(r){var t=r.x,e=r.y,n=r.z;return{x:t,y:e,z:n};}},{key:"Average",value:function Average(r){var t=r.length,e=new _(0,0);for(var n=0;n<t;n++)e.add(r[n]);return e.div(t);}},{key:"Clamp",value:function Clamp(r,t,e){return e===void 0?new _(Math.min(Math.max(r.x,t)),Math.min(Math.max(r.y,t))):new _(Math.min(Math.max(r.x,t),e),Math.min(Math.max(r.y,t),e));}/**
|
|
17
|
+
* Get an array of points (with simulated pressure) between two points.
|
|
18
|
+
*
|
|
19
|
+
* @param A - The first point.
|
|
20
|
+
* @param B - The second point.
|
|
21
|
+
* @param steps - The number of points to return.
|
|
22
|
+
*/},{key:"PointsBetween",value:function PointsBetween(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:6;var n=[];for(var i=0;i<e;i++){var a=Lh.easeInQuad(i/(e-1)),s=_.Lrp(r,t,a);s.z=Math.min(1,0.5+Math.abs(0.5-bh(a))*0.65),n.push(s);}return n;}},{key:"SnapToGrid",value:function SnapToGrid(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:8;return new _(Math.round(r.x/t)*t,Math.round(r.y/t)*t);}}]);}();var bh=function bh(h){return h<0.5?2*h*h:-1+(4-2*h)*h;};var xt=/*#__PURE__*/function(_ref2){function xt(){var _this2;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{x:0,y:0};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;_classCallCheck(this,xt);_this2=_callSuper(this,xt,[r,t,e]),_this2.x=r,_this2.y=t,_this2.z=e,_this2.v=n,_this2.t=i,_this2.a=a;return _this2;}_inherits(xt,_ref2);return _createClass(xt,[{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(r){this.a=r;}},{key:"setT",value:function setT(r){this.t=r;}},{key:"setv",value:function setv(r){return this.v={x:r.x,y:r.y},this;}},{key:"set",value:function set(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.x;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.y;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.z;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:this.v;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:this.t;var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:this.a;return this.x=r,this.y=t,this.z=e,this.v=n,this.t=i,this.a=a,this;}},{key:"clone",value:function clone(){var r=this.x,t=this.y,e=this.z,n=this.v,i=this.t,a=this.a,s={x:n.x,y:n.y};return new xt(r,t,e,s,i,a);}},{key:"distance",value:function distance(r){return xt.GetDistance(this,r);}},{key:"isNear",value:function isNear(r,t){return xt.IsNear(this,r,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(r,t){return xt.GetAngleByPoints(r,this,t);}}],[{key:"Sub",value:function Sub(r,t){return new xt(r.x-t.x,r.y-t.y);}},{key:"Add",value:function Add(r,t){return new xt(r.x+t.x,r.y+t.y);}},{key:"GetDistance",value:function GetDistance(r,t){return xt.Len(r.clone().sub(t));}},{key:"GetAngleByPoints",value:function GetAngleByPoints(r,t,e){var n=t.x-r.x,i=e.x-t.x,a=t.y-r.y,s=e.y-t.y;var o=0;var f=Math.sqrt(n*n+a*a),v=Math.sqrt(i*i+s*s);if(f&&v){var l=n*i+a*s;o=Math.acos(l/(f*v)),o=o/Math.PI*180;var p=n*s-a*i;p=p>0?1:-1,o=180+p*o;}return o;}},{key:"IsNear",value:function IsNear(r,t,e){return xt.Len(r.clone().sub(t))<e;}},{key:"RotWith",value:function RotWith(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:2;var i=r.x-t.x,a=r.y-t.y,s=Math.sin(e),o=Math.cos(e),f=Math.pow(10,n),v=Math.floor((t.x+(i*o-a*s))*f)/f,l=Math.floor((t.y+(i*s+a*o))*f)/f;return new xt(v,l);}/**
|
|
23
|
+
* 根据圆心和半径,获取圆上的等份点
|
|
24
|
+
* @param o 圆心
|
|
25
|
+
* @param radius 半径
|
|
26
|
+
* @param average 均分数
|
|
27
|
+
* @returns
|
|
28
|
+
*/},{key:"GetDotStroke",value:function GetDotStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:16;var n=new _(1,1),i=Math.PI+1e-3,a=xt.Add(r,xt.Sub(r,n).uni().per().mul(-t)),s=[];for(var o=1/e,f=o;f<=1;f+=o)s.push(xt.RotWith(a,r,i*2*f));return s;}/**
|
|
29
|
+
* 根据圆心和圆上的起始点,获取半圆上的等份点
|
|
30
|
+
* @param o 圆心
|
|
31
|
+
* @param p 圆弧起始点
|
|
32
|
+
* @param radian 1,逆时针180度 -1,顺时针
|
|
33
|
+
* @param average 均分数
|
|
34
|
+
* @returns
|
|
35
|
+
*/},{key:"GetSemicircleStroke",value:function GetSemicircleStroke(r,t){var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:8;var i=e*(Math.PI+1e-3),a=[];for(var s=1/n,o=s;o<=1;o+=s)a.push(xt.RotWith(t,r,i*o));return a;}}]);}(_);function Ot(h,r){if(h&&r){var t=Math.min(h.x,r.x),_e2=Math.min(h.y,r.y),n=Math.max(h.x+h.w,r.x+r.w),i=Math.max(h.y+h.h,r.y+r.h),a=n-t,s=i-_e2;return{x:t,y:_e2,w:a,h:s};}return r||h;}function Nt(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var t={x:0,y:0,w:0,h:0};var e=1/0,n=1/0,i=-1/0,a=-1/0;return h.forEach(function(s){var _s$XY=_slicedToArray(s.XY,2),o=_s$XY[0],f=_s$XY[1];e=Math.min(e,o-r),n=Math.min(n,f-r),i=Math.max(i,o+r),a=Math.max(a,f+r);}),t.x=e,t.y=n,t.w=i-e,t.h=a-n,t;}function Ce(h,r){return!(h.x+h.w<r.x||h.x>r.x+r.w||h.y+h.h<r.y||h.y>r.y+r.h);}function Bt(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10;return{x:Math.floor(h.x-r),y:Math.floor(h.y-r),w:Math.floor(h.w+r*2),h:Math.floor(h.h+r*2)};}function Re(h,r){return{x:h.x+r[0],y:h.y+r[1],w:h.w,h:h.h};}function wn(h,r){var t=new _(h.x,h.y),e=new _(h.x+h.w,h.y),n=new _(h.x+h.w,h.y+h.h),i=new _(h.x,h.y+h.h),a=new _(h.x+h.w/2,h.y+h.h/2),s=Math.PI*r/180,o=_.RotWith(t,a,s),f=_.RotWith(e,a,s),v=_.RotWith(n,a,s),l=_.RotWith(i,a,s);return[o,f,v,l];}function Nn(h,r){var t=wn(h,r);return Nt(t);}function Wn(h,r){var t=new _(h.x,h.y),e=new _(h.x+h.w,h.y),n=new _(h.x+h.w,h.y+h.h),i=new _(h.x,h.y+h.h),a=new _(h.x+h.w/2,h.y+h.h/2),s=new _(r[0],r[1]),o=_.ScaleWOrigin(t,s,a),f=_.ScaleWOrigin(e,s,a),v=_.ScaleWOrigin(n,s,a),l=_.ScaleWOrigin(i,s,a);return Nt([o,f,v,l]);}function Dh(h,r,t){var e=[];for(var n=0;n<h.length;n++){var i=h[n],a=new _(t[0],t[1]),s=_.ScaleWOrigin(i,a,r);e.push(s);}return e;}function wh(h,r,t){var e=[];for(var n=0;n<h.length;n++){var i=h[n],a=Math.PI*t/180,s=_.RotWith(i,r,a);e.push(s);}return e;}function Nh(h,r,t){var e=new _(r[0],r[1]);for(var n=0;n<h.length;n+=3){var i=new _(h[n],h[n+1]),a=Math.PI*t/180,s=_.RotWith(i,e,a);h[n]=s.x,h[n+1]=s.y;}}function Wh(h,r,t){var e=new _(r[0],r[1]);for(var n=0;n<h.length;n+=3){var i=new _(h[n],h[n+1]),a=new _(t[0],t[1]),s=_.ScaleWOrigin(i,a,e);h[n]=s.x,h[n+1]=s.y;}}function Bh(h,r){return h[0]>=r.x&&h[0]<=r.x+r.w&&h[1]>=r.y&&h[1]<=r.y+r.h;}function Bn(h,r){var t=h<=r?1:h/r,e=r<=h?1:r/h;return[t,e];}var Fh=function Fh(h){if(h.tagName==="GROUP"){var r=Object.getOwnPropertySymbols(h).find(function(t){return t.toString()==="Symbol(sealed)";});if(r&&h[r])return!0;}return!1;},jh=function jh(h){return!h.isHid;};function de(h){return"".concat(je(h.x),",").concat(je(h.y)," ");}function ge(h,r){return"".concat(je((h.x+r.x)/2),",").concat(je((h.y+r.y)/2)," ");}function je(h){return+h.toFixed(4);}var Uh=fe,$h=re,zh="[object Number]";function Gh(h){return typeof h=="number"||$h(h)&&Uh(h)==zh;}var Hh=Gh,Jt=/* @__PURE__ */ye(Hh);var Zt=/*#__PURE__*/function(){function Zt(r){_classCallCheck(this,Zt);nt(this,"syncUnitTime",1e3);nt(this,"vNodes");nt(this,"drawLayer");nt(this,"fullLayer");nt(this,"workId");var t=r.vNodes,e=r.fullLayer,n=r.drawLayer;this.vNodes=t,this.fullLayer=e,this.drawLayer=n;}/** 设置工作id */return _createClass(Zt,[{key:"setWorkId",value:function setWorkId(r){this.workId=r;}},{key:"getWorkId",value:function getWorkId(){return this.workId;}/** 获取工作选项配置 */},{key:"getWorkOptions",value:function getWorkOptions(){return this.workOptions;}/** 设置工作选项配置 */},{key:"setWorkOptions",value:function setWorkOptions(r){var n,i,a;this.workOptions=r,this.syncUnitTime=r.syncUnitTime||this.syncUnitTime;var t=(n=this.workId)==null?void 0:n.toString(),e=t&&((i=this.vNodes)==null?void 0:i.get(t))||void 0;t&&e&&(e.opt=r,(a=this.vNodes)==null||a.setInfo(t,e));}/** 更新服务端同步配置,返回绘制结果 */},{key:"updataOptService",value:function updataOptService(r){var n,i;var t;var e=(n=this.workId)==null?void 0:n.toString();if(e&&r){var a=this.fullLayer.getElementsByName(e)||this.drawLayer&&this.drawLayer.getElementsByName(e)||[];if(a.length!==1)return;var s=a[0],o=r.pos,f=r.zIndex,v=r.scale,l=r.angle,p=r.translate,y={};Jt(f)&&(y.zIndex=f),o&&(y.pos=[o[0],o[1]]),v&&(y.scale=v),l&&(y.rotate=l),p&&(y.translate=p),s.attr(y);var O=s==null?void 0:s.getBoundingClientRect();return O&&(t=Ot(t,{x:Math.floor(O.x-Zt.SafeBorderPadding),y:Math.floor(O.y-Zt.SafeBorderPadding),w:Math.floor(O.width+Zt.SafeBorderPadding*2),h:Math.floor(O.height+Zt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:o}),t;}}},{key:"replace",value:function replace(r,t,e){var s;var n=r.getElementsByName(t),i=n.length;if(i){if(i>1)for(var o=1;o<n.length;o++)n[o].remove();r.replaceChild(e,n[0]);}else r.append(e);this.fullLayer===r?(s=this.drawLayer)==null||s.getElementsByName(t).forEach(function(o){o.remove();}):this.fullLayer.getElementsByName(t).forEach(function(o){o.remove();});}}],[{key:"updateNodeOpt",value:function updateNodeOpt(r){var t=r.node,e=r.opt,n=r.vNodes,i=r.willSerializeData,a=r.targetNode,s=e.zIndex,o=e.translate,f=e.angle,v=e.box,l=e.boxScale,p=e.boxTranslate,y=e.pointMap;var O;var x=a&&Xt(a)||n.get(t.name);if(!x)return;Jt(s)&&(t.setAttribute("zIndex",s),x.opt.zIndex=s);var m=t.parent;if(m){if(v&&p&&l){var T=x.rect,c=[];for(var L=0;L<x.op.length;L+=3)c.push(new xt(x.op[L],x.op[L+1],x.op[L+2]));var d=Nt(c),u=[d.w*m.worldScaling[0],d.h*m.worldScaling[0]],g=[T.w-u[0],T.h-u[1]],M=[(T.w*l[0]-g[0])/u[0],(T.h*l[1]-g[1])/u[1]],A=[p[0]/m.worldScaling[0],p[1]/m.worldScaling[1]],I=x.op.map(function(L,D){var R=D%3;return R===0?L+A[0]:R===1?L+A[1]:L;}),b=[x.centerPos[0]+A[0],x.centerPos[1]+A[1]];Wh(I,b,M);var E=[];for(var _L=0;_L<I.length;_L+=3)E.push(new xt(I[_L],I[_L+1],I[_L+2]));x.op=I,x.centerPos=b;}else if(o){var _T=[o[0]/m.worldScaling[0],o[1]/m.worldScaling[1]];t.setAttribute("translate",_T),x.opt.translate=_T,a&&(O=Re(x.rect,o),x.rect=O);}else Jt(f)&&(t.setAttribute("rotate",f),x.opt.rotate=f,a&&(O=Nn(x.rect,f),x.rect=O));if(y){var _T2=y.get(t.name);if(_T2)for(var _c2=0,_d2=0;_c2<x.op.length;_c2+=3,_d2++)x.op[_c2]=_T2[_d2][0],x.op[_c2+1]=_T2[_d2][1];}if(i){if(o){var _T3=[o[0]/m.worldScaling[0],o[1]/m.worldScaling[1]],_c3=x.op.map(function(d,u){var g=u%3;return g===0?d+_T3[0]:g===1?d+_T3[1]:d;});x.op=_c3,x.centerPos=[x.centerPos[0]+_T3[0],x.centerPos[1]+_T3[1]],x!=null&&x.opt&&(x.opt.translate=void 0);}else if(Jt(f)){var _T4=x.op;Nh(_T4,x.centerPos,f),x.op=_T4,x!=null&&x.opt&&(x.opt.rotate=void 0);}}x&&n.setInfo(t.name,x);}}},{key:"getCenterPos",value:function getCenterPos(r,t){var e=t.worldPosition,n=t.worldScaling;return[(r.x+r.w/2-e[0])/n[0],(r.y+r.h/2-e[1])/n[1]];}},{key:"getRectFromLayer",value:function getRectFromLayer(r,t){var e=r.getElementsByName(t)[0];if(e){var n=e.getBoundingClientRect();return{x:Math.floor(n.x-Zt.SafeBorderPadding),y:Math.floor(n.y-Zt.SafeBorderPadding),w:Math.floor(n.width+Zt.SafeBorderPadding*2),h:Math.floor(n.height+Zt.SafeBorderPadding*2)};}}}]);}();nt(Zt,"SafeBorderPadding",10);var yt=Zt;var Dt=/******/function(h){var r={};function t(e){if(r[e])return r[e].exports;var n=r[e]={/******/i:e,/******/l:!1,/******/exports:{}/******/};return h[e].call(n.exports,n,n.exports,t),n.l=!0,n.exports;}return t.m=h,t.c=r,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i});},t.r=function(e){(typeof Symbol==="undefined"?"undefined":_typeof(Symbol))<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},t.t=function(e,n){if(n&1&&(e=t(e)),n&8||n&4&&_typeof(e)=="object"&&e&&e.__esModule)return e;var i=/* @__PURE__ */Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),n&2&&typeof e!="string")for(var a in e)t.d(i,a,function(s){return e[s];}.bind(null,a));return i;},t.n=function(e){var n=e&&e.__esModule?(/******/function(){return e["default"];}):(/******/function(){return e;});return t.d(n,"a",n),n;},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n);},t.p="/js/",t(t.s=0);}([/* 0 */ /***/function(h,r,t){t.r(r),t.d(r,"version",function(){return H;}),t.d(r,"helpers",function(){return W;}),t.d(r,"createElement",function(){return D;}),t.d(r,"isSpriteNode",function(){return R;}),t.d(r,"registerNode",function(){return C;});var e=t(12);t.d(r,"ENV",function(){return e.ENV;});var n=t(68);t.d(r,"requestAnimationFrame",function(){return n.requestAnimationFrame;}),t.d(r,"cancelAnimationFrame",function(){return n.cancelAnimationFrame;});var i=t(70);t.d(r,"Node",function(){return i["default"];});var a=t(217);t.d(r,"Cloud",function(){return a["default"];});var s=t(219);t.d(r,"Block",function(){return s["default"];});var o=t(224);t.d(r,"Sprite",function(){return o["default"];});var f=t(226);t.d(r,"Path",function(){return f["default"];});var v=t(229);t.d(r,"Rect",function(){return v["default"];});var l=t(231);t.d(r,"Triangle",function(){return l["default"];});var p=t(236);t.d(r,"Parallel",function(){return p["default"];});var y=t(238);t.d(r,"Regular",function(){return y["default"];});var O=t(240);t.d(r,"Star",function(){return O["default"];});var x=t(242);t.d(r,"Ellipse",function(){return x["default"];});var m=t(244);t.d(r,"Arc",function(){return m["default"];});var T=t(246);t.d(r,"Ring",function(){return T["default"];});var c=t(232);t.d(r,"Polyline",function(){return c["default"];});var d=t(248);t.d(r,"Label",function(){return d["default"];});var u=t(250);t.d(r,"Group",function(){return u["default"];});var g=t(286);t.d(r,"Layer",function(){return g["default"];});var M=t(287);t.d(r,"SpriteSvg",function(){return M["default"];});var A=t(289);t.d(r,"LayerWorker",function(){return A["default"];});var I=t(290);t.d(r,"Scene",function(){return I["default"];});var b=t(213),E=t(221);t.d(r,"Color",function(){return E.Color;}),t.d(r,"Gradient",function(){return E.Gradient;});var L=t(72);t(1).glMatrix.setMatrixArrayType(Array);var D=b["default"].createElement,R=b["default"].isSpriteNode,C=b["default"].registerNode,W={parseColor:E.parseColor,sizeToPixel:L.sizeToPixel,toArray:L.toArray,toString:L.toString,toNumber:L.toNumber};var z;z="3.8.3";var H=z;},/* 1 */ /***/function(h,r,t){t.r(r);var e=t(2);t.d(r,"glMatrix",function(){return e;});var n=t(3);t.d(r,"mat2",function(){return n;});var i=t(4);t.d(r,"mat2d",function(){return i;});var a=t(5);t.d(r,"mat3",function(){return a;});var s=t(6);t.d(r,"mat4",function(){return s;});var o=t(7);t.d(r,"quat",function(){return o;});var f=t(10);t.d(r,"quat2",function(){return f;});var v=t(11);t.d(r,"vec2",function(){return v;});var l=t(8);t.d(r,"vec3",function(){return l;});var p=t(9);t.d(r,"vec4",function(){return p;});},/* 2 */ /***/function(h,r,t){t.r(r),t.d(r,"EPSILON",function(){return e;}),t.d(r,"ARRAY_TYPE",function(){return n;}),t.d(r,"RANDOM",function(){return i;}),t.d(r,"setMatrixArrayType",function(){return a;}),t.d(r,"toRadian",function(){return o;}),t.d(r,"equals",function(){return f;});var e=1e-6,n=(typeof Float32Array==="undefined"?"undefined":_typeof(Float32Array))<"u"?Float32Array:Array,i=Math.random;function a(v){n=v;}var s=Math.PI/180;function o(v){return v*s;}function f(v,l){return Math.abs(v-l)<=e*Math.max(1,Math.abs(v),Math.abs(l));}Math.hypot||(Math.hypot=function(){for(var v=0,l=arguments.length;l--;)v+=arguments[l]*arguments[l];return Math.sqrt(v);});},/* 3 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"identity",function(){return s;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"set",function(){return f;}),t.d(r,"transpose",function(){return v;}),t.d(r,"invert",function(){return l;}),t.d(r,"adjoint",function(){return p;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return O;}),t.d(r,"rotate",function(){return x;}),t.d(r,"scale",function(){return m;}),t.d(r,"fromRotation",function(){return T;}),t.d(r,"fromScaling",function(){return c;}),t.d(r,"str",function(){return d;}),t.d(r,"frob",function(){return u;}),t.d(r,"LDU",function(){return g;}),t.d(r,"add",function(){return M;}),t.d(r,"subtract",function(){return A;}),t.d(r,"exactEquals",function(){return I;}),t.d(r,"equals",function(){return b;}),t.d(r,"multiplyScalar",function(){return E;}),t.d(r,"multiplyScalarAndAdd",function(){return L;}),t.d(r,"mul",function(){return D;}),t.d(r,"sub",function(){return R;});var e=t(2);function n(){var C=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(C[1]=0,C[2]=0),C[0]=1,C[3]=1,C;}function i(C){var W=new e.ARRAY_TYPE(4);return W[0]=C[0],W[1]=C[1],W[2]=C[2],W[3]=C[3],W;}function a(C,W){return C[0]=W[0],C[1]=W[1],C[2]=W[2],C[3]=W[3],C;}function s(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=1,C;}function o(C,W,z,H){var X=new e.ARRAY_TYPE(4);return X[0]=C,X[1]=W,X[2]=z,X[3]=H,X;}function f(C,W,z,H,X){return C[0]=W,C[1]=z,C[2]=H,C[3]=X,C;}function v(C,W){if(C===W){var z=W[1];C[1]=W[2],C[2]=z;}else C[0]=W[0],C[1]=W[2],C[2]=W[1],C[3]=W[3];return C;}function l(C,W){var z=W[0],H=W[1],X=W[2],Z=W[3],j=z*Z-X*H;return j?(j=1/j,C[0]=Z*j,C[1]=-H*j,C[2]=-X*j,C[3]=z*j,C):null;}function p(C,W){var z=W[0];return C[0]=W[3],C[1]=-W[1],C[2]=-W[2],C[3]=z,C;}function y(C){return C[0]*C[3]-C[2]*C[1];}function O(C,W,z){var H=W[0],X=W[1],Z=W[2],j=W[3],G=z[0],Q=z[1],tt=z[2],et=z[3];return C[0]=H*G+Z*Q,C[1]=X*G+j*Q,C[2]=H*tt+Z*et,C[3]=X*tt+j*et,C;}function x(C,W,z){var H=W[0],X=W[1],Z=W[2],j=W[3],G=Math.sin(z),Q=Math.cos(z);return C[0]=H*Q+Z*G,C[1]=X*Q+j*G,C[2]=H*-G+Z*Q,C[3]=X*-G+j*Q,C;}function m(C,W,z){var H=W[0],X=W[1],Z=W[2],j=W[3],G=z[0],Q=z[1];return C[0]=H*G,C[1]=X*G,C[2]=Z*Q,C[3]=j*Q,C;}function T(C,W){var z=Math.sin(W),H=Math.cos(W);return C[0]=H,C[1]=z,C[2]=-z,C[3]=H,C;}function c(C,W){return C[0]=W[0],C[1]=0,C[2]=0,C[3]=W[1],C;}function d(C){return"mat2("+C[0]+", "+C[1]+", "+C[2]+", "+C[3]+")";}function u(C){return Math.hypot(C[0],C[1],C[2],C[3]);}function g(C,W,z,H){return C[2]=H[2]/H[0],z[0]=H[0],z[1]=H[1],z[3]=H[3]-C[2]*z[1],[C,W,z];}function M(C,W,z){return C[0]=W[0]+z[0],C[1]=W[1]+z[1],C[2]=W[2]+z[2],C[3]=W[3]+z[3],C;}function A(C,W,z){return C[0]=W[0]-z[0],C[1]=W[1]-z[1],C[2]=W[2]-z[2],C[3]=W[3]-z[3],C;}function I(C,W){return C[0]===W[0]&&C[1]===W[1]&&C[2]===W[2]&&C[3]===W[3];}function b(C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=W[0],G=W[1],Q=W[2],tt=W[3];return Math.abs(z-j)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(j))&&Math.abs(H-G)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(G))&&Math.abs(X-Q)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(Q))&&Math.abs(Z-tt)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(tt));}function E(C,W,z){return C[0]=W[0]*z,C[1]=W[1]*z,C[2]=W[2]*z,C[3]=W[3]*z,C;}function L(C,W,z,H){return C[0]=W[0]+z[0]*H,C[1]=W[1]+z[1]*H,C[2]=W[2]+z[2]*H,C[3]=W[3]+z[3]*H,C;}var D=O,R=A;},/* 4 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"identity",function(){return s;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"set",function(){return f;}),t.d(r,"invert",function(){return v;}),t.d(r,"determinant",function(){return l;}),t.d(r,"multiply",function(){return p;}),t.d(r,"rotate",function(){return y;}),t.d(r,"scale",function(){return O;}),t.d(r,"translate",function(){return x;}),t.d(r,"fromRotation",function(){return m;}),t.d(r,"fromScaling",function(){return T;}),t.d(r,"fromTranslation",function(){return c;}),t.d(r,"str",function(){return d;}),t.d(r,"frob",function(){return u;}),t.d(r,"add",function(){return g;}),t.d(r,"subtract",function(){return M;}),t.d(r,"multiplyScalar",function(){return A;}),t.d(r,"multiplyScalarAndAdd",function(){return I;}),t.d(r,"exactEquals",function(){return b;}),t.d(r,"equals",function(){return E;}),t.d(r,"mul",function(){return L;}),t.d(r,"sub",function(){return D;});var e=t(2);function n(){var R=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(R[1]=0,R[2]=0,R[4]=0,R[5]=0),R[0]=1,R[3]=1,R;}function i(R){var C=new e.ARRAY_TYPE(6);return C[0]=R[0],C[1]=R[1],C[2]=R[2],C[3]=R[3],C[4]=R[4],C[5]=R[5],C;}function a(R,C){return R[0]=C[0],R[1]=C[1],R[2]=C[2],R[3]=C[3],R[4]=C[4],R[5]=C[5],R;}function s(R){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R[4]=0,R[5]=0,R;}function o(R,C,W,z,H,X){var Z=new e.ARRAY_TYPE(6);return Z[0]=R,Z[1]=C,Z[2]=W,Z[3]=z,Z[4]=H,Z[5]=X,Z;}function f(R,C,W,z,H,X,Z){return R[0]=C,R[1]=W,R[2]=z,R[3]=H,R[4]=X,R[5]=Z,R;}function v(R,C){var W=C[0],z=C[1],H=C[2],X=C[3],Z=C[4],j=C[5],G=W*X-z*H;return G?(G=1/G,R[0]=X*G,R[1]=-z*G,R[2]=-H*G,R[3]=W*G,R[4]=(H*j-X*Z)*G,R[5]=(z*Z-W*j)*G,R):null;}function l(R){return R[0]*R[3]-R[1]*R[2];}function p(R,C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=C[4],G=C[5],Q=W[0],tt=W[1],et=W[2],at=W[3],q=W[4],pt=W[5];return R[0]=z*Q+X*tt,R[1]=H*Q+Z*tt,R[2]=z*et+X*at,R[3]=H*et+Z*at,R[4]=z*q+X*pt+j,R[5]=H*q+Z*pt+G,R;}function y(R,C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=C[4],G=C[5],Q=Math.sin(W),tt=Math.cos(W);return R[0]=z*tt+X*Q,R[1]=H*tt+Z*Q,R[2]=z*-Q+X*tt,R[3]=H*-Q+Z*tt,R[4]=j,R[5]=G,R;}function O(R,C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=C[4],G=C[5],Q=W[0],tt=W[1];return R[0]=z*Q,R[1]=H*Q,R[2]=X*tt,R[3]=Z*tt,R[4]=j,R[5]=G,R;}function x(R,C,W){var z=C[0],H=C[1],X=C[2],Z=C[3],j=C[4],G=C[5],Q=W[0],tt=W[1];return R[0]=z,R[1]=H,R[2]=X,R[3]=Z,R[4]=z*Q+X*tt+j,R[5]=H*Q+Z*tt+G,R;}function m(R,C){var W=Math.sin(C),z=Math.cos(C);return R[0]=z,R[1]=W,R[2]=-W,R[3]=z,R[4]=0,R[5]=0,R;}function T(R,C){return R[0]=C[0],R[1]=0,R[2]=0,R[3]=C[1],R[4]=0,R[5]=0,R;}function c(R,C){return R[0]=1,R[1]=0,R[2]=0,R[3]=1,R[4]=C[0],R[5]=C[1],R;}function d(R){return"mat2d("+R[0]+", "+R[1]+", "+R[2]+", "+R[3]+", "+R[4]+", "+R[5]+")";}function u(R){return Math.hypot(R[0],R[1],R[2],R[3],R[4],R[5],1);}function g(R,C,W){return R[0]=C[0]+W[0],R[1]=C[1]+W[1],R[2]=C[2]+W[2],R[3]=C[3]+W[3],R[4]=C[4]+W[4],R[5]=C[5]+W[5],R;}function M(R,C,W){return R[0]=C[0]-W[0],R[1]=C[1]-W[1],R[2]=C[2]-W[2],R[3]=C[3]-W[3],R[4]=C[4]-W[4],R[5]=C[5]-W[5],R;}function A(R,C,W){return R[0]=C[0]*W,R[1]=C[1]*W,R[2]=C[2]*W,R[3]=C[3]*W,R[4]=C[4]*W,R[5]=C[5]*W,R;}function I(R,C,W,z){return R[0]=C[0]+W[0]*z,R[1]=C[1]+W[1]*z,R[2]=C[2]+W[2]*z,R[3]=C[3]+W[3]*z,R[4]=C[4]+W[4]*z,R[5]=C[5]+W[5]*z,R;}function b(R,C){return R[0]===C[0]&&R[1]===C[1]&&R[2]===C[2]&&R[3]===C[3]&&R[4]===C[4]&&R[5]===C[5];}function E(R,C){var W=R[0],z=R[1],H=R[2],X=R[3],Z=R[4],j=R[5],G=C[0],Q=C[1],tt=C[2],et=C[3],at=C[4],q=C[5];return Math.abs(W-G)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs(G))&&Math.abs(z-Q)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(Q))&&Math.abs(H-tt)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(tt))&&Math.abs(X-et)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(et))&&Math.abs(Z-at)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(at))&&Math.abs(j-q)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(q));}var L=p,D=M;},/* 5 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"fromMat4",function(){return i;}),t.d(r,"clone",function(){return a;}),t.d(r,"copy",function(){return s;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"set",function(){return f;}),t.d(r,"identity",function(){return v;}),t.d(r,"transpose",function(){return l;}),t.d(r,"invert",function(){return p;}),t.d(r,"adjoint",function(){return y;}),t.d(r,"determinant",function(){return O;}),t.d(r,"multiply",function(){return x;}),t.d(r,"translate",function(){return m;}),t.d(r,"rotate",function(){return T;}),t.d(r,"scale",function(){return c;}),t.d(r,"fromTranslation",function(){return d;}),t.d(r,"fromRotation",function(){return u;}),t.d(r,"fromScaling",function(){return g;}),t.d(r,"fromMat2d",function(){return M;}),t.d(r,"fromQuat",function(){return A;}),t.d(r,"normalFromMat4",function(){return I;}),t.d(r,"projection",function(){return b;}),t.d(r,"str",function(){return E;}),t.d(r,"frob",function(){return L;}),t.d(r,"add",function(){return D;}),t.d(r,"subtract",function(){return R;}),t.d(r,"multiplyScalar",function(){return C;}),t.d(r,"multiplyScalarAndAdd",function(){return W;}),t.d(r,"exactEquals",function(){return z;}),t.d(r,"equals",function(){return H;}),t.d(r,"mul",function(){return X;}),t.d(r,"sub",function(){return Z;});var e=t(2);function n(){var j=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(j[1]=0,j[2]=0,j[3]=0,j[5]=0,j[6]=0,j[7]=0),j[0]=1,j[4]=1,j[8]=1,j;}function i(j,G){return j[0]=G[0],j[1]=G[1],j[2]=G[2],j[3]=G[4],j[4]=G[5],j[5]=G[6],j[6]=G[8],j[7]=G[9],j[8]=G[10],j;}function a(j){var G=new e.ARRAY_TYPE(9);return G[0]=j[0],G[1]=j[1],G[2]=j[2],G[3]=j[3],G[4]=j[4],G[5]=j[5],G[6]=j[6],G[7]=j[7],G[8]=j[8],G;}function s(j,G){return j[0]=G[0],j[1]=G[1],j[2]=G[2],j[3]=G[3],j[4]=G[4],j[5]=G[5],j[6]=G[6],j[7]=G[7],j[8]=G[8],j;}function o(j,G,Q,tt,et,at,q,pt,dt){var B=new e.ARRAY_TYPE(9);return B[0]=j,B[1]=G,B[2]=Q,B[3]=tt,B[4]=et,B[5]=at,B[6]=q,B[7]=pt,B[8]=dt,B;}function f(j,G,Q,tt,et,at,q,pt,dt,B){return j[0]=G,j[1]=Q,j[2]=tt,j[3]=et,j[4]=at,j[5]=q,j[6]=pt,j[7]=dt,j[8]=B,j;}function v(j){return j[0]=1,j[1]=0,j[2]=0,j[3]=0,j[4]=1,j[5]=0,j[6]=0,j[7]=0,j[8]=1,j;}function l(j,G){if(j===G){var Q=G[1],tt=G[2],et=G[5];j[1]=G[3],j[2]=G[6],j[3]=Q,j[5]=G[7],j[6]=tt,j[7]=et;}else j[0]=G[0],j[1]=G[3],j[2]=G[6],j[3]=G[1],j[4]=G[4],j[5]=G[7],j[6]=G[2],j[7]=G[5],j[8]=G[8];return j;}function p(j,G){var Q=G[0],tt=G[1],et=G[2],at=G[3],q=G[4],pt=G[5],dt=G[6],B=G[7],F=G[8],V=F*q-pt*B,J=-F*at+pt*dt,N=B*at-q*dt,$=Q*V+tt*J+et*N;return $?($=1/$,j[0]=V*$,j[1]=(-F*tt+et*B)*$,j[2]=(pt*tt-et*q)*$,j[3]=J*$,j[4]=(F*Q-et*dt)*$,j[5]=(-pt*Q+et*at)*$,j[6]=N*$,j[7]=(-B*Q+tt*dt)*$,j[8]=(q*Q-tt*at)*$,j):null;}function y(j,G){var Q=G[0],tt=G[1],et=G[2],at=G[3],q=G[4],pt=G[5],dt=G[6],B=G[7],F=G[8];return j[0]=q*F-pt*B,j[1]=et*B-tt*F,j[2]=tt*pt-et*q,j[3]=pt*dt-at*F,j[4]=Q*F-et*dt,j[5]=et*at-Q*pt,j[6]=at*B-q*dt,j[7]=tt*dt-Q*B,j[8]=Q*q-tt*at,j;}function O(j){var G=j[0],Q=j[1],tt=j[2],et=j[3],at=j[4],q=j[5],pt=j[6],dt=j[7],B=j[8];return G*(B*at-q*dt)+Q*(-B*et+q*pt)+tt*(dt*et-at*pt);}function x(j,G,Q){var tt=G[0],et=G[1],at=G[2],q=G[3],pt=G[4],dt=G[5],B=G[6],F=G[7],V=G[8],J=Q[0],N=Q[1],$=Q[2],S=Q[3],P=Q[4],w=Q[5],U=Q[6],K=Q[7],Y=Q[8];return j[0]=J*tt+N*q+$*B,j[1]=J*et+N*pt+$*F,j[2]=J*at+N*dt+$*V,j[3]=S*tt+P*q+w*B,j[4]=S*et+P*pt+w*F,j[5]=S*at+P*dt+w*V,j[6]=U*tt+K*q+Y*B,j[7]=U*et+K*pt+Y*F,j[8]=U*at+K*dt+Y*V,j;}function m(j,G,Q){var tt=G[0],et=G[1],at=G[2],q=G[3],pt=G[4],dt=G[5],B=G[6],F=G[7],V=G[8],J=Q[0],N=Q[1];return j[0]=tt,j[1]=et,j[2]=at,j[3]=q,j[4]=pt,j[5]=dt,j[6]=J*tt+N*q+B,j[7]=J*et+N*pt+F,j[8]=J*at+N*dt+V,j;}function T(j,G,Q){var tt=G[0],et=G[1],at=G[2],q=G[3],pt=G[4],dt=G[5],B=G[6],F=G[7],V=G[8],J=Math.sin(Q),N=Math.cos(Q);return j[0]=N*tt+J*q,j[1]=N*et+J*pt,j[2]=N*at+J*dt,j[3]=N*q-J*tt,j[4]=N*pt-J*et,j[5]=N*dt-J*at,j[6]=B,j[7]=F,j[8]=V,j;}function c(j,G,Q){var tt=Q[0],et=Q[1];return j[0]=tt*G[0],j[1]=tt*G[1],j[2]=tt*G[2],j[3]=et*G[3],j[4]=et*G[4],j[5]=et*G[5],j[6]=G[6],j[7]=G[7],j[8]=G[8],j;}function d(j,G){return j[0]=1,j[1]=0,j[2]=0,j[3]=0,j[4]=1,j[5]=0,j[6]=G[0],j[7]=G[1],j[8]=1,j;}function u(j,G){var Q=Math.sin(G),tt=Math.cos(G);return j[0]=tt,j[1]=Q,j[2]=0,j[3]=-Q,j[4]=tt,j[5]=0,j[6]=0,j[7]=0,j[8]=1,j;}function g(j,G){return j[0]=G[0],j[1]=0,j[2]=0,j[3]=0,j[4]=G[1],j[5]=0,j[6]=0,j[7]=0,j[8]=1,j;}function M(j,G){return j[0]=G[0],j[1]=G[1],j[2]=0,j[3]=G[2],j[4]=G[3],j[5]=0,j[6]=G[4],j[7]=G[5],j[8]=1,j;}function A(j,G){var Q=G[0],tt=G[1],et=G[2],at=G[3],q=Q+Q,pt=tt+tt,dt=et+et,B=Q*q,F=tt*q,V=tt*pt,J=et*q,N=et*pt,$=et*dt,S=at*q,P=at*pt,w=at*dt;return j[0]=1-V-$,j[3]=F-w,j[6]=J+P,j[1]=F+w,j[4]=1-B-$,j[7]=N-S,j[2]=J-P,j[5]=N+S,j[8]=1-B-V,j;}function I(j,G){var Q=G[0],tt=G[1],et=G[2],at=G[3],q=G[4],pt=G[5],dt=G[6],B=G[7],F=G[8],V=G[9],J=G[10],N=G[11],$=G[12],S=G[13],P=G[14],w=G[15],U=Q*pt-tt*q,K=Q*dt-et*q,Y=Q*B-at*q,k=tt*dt-et*pt,rt=tt*B-at*pt,it=et*B-at*dt,lt=F*S-V*$,ut=F*P-J*$,ot=F*w-N*$,st=V*P-J*S,ft=V*w-N*S,vt=J*w-N*P,mt=U*vt-K*ft+Y*st+k*ot-rt*ut+it*lt;return mt?(mt=1/mt,j[0]=(pt*vt-dt*ft+B*st)*mt,j[1]=(dt*ot-q*vt-B*ut)*mt,j[2]=(q*ft-pt*ot+B*lt)*mt,j[3]=(et*ft-tt*vt-at*st)*mt,j[4]=(Q*vt-et*ot+at*ut)*mt,j[5]=(tt*ot-Q*ft-at*lt)*mt,j[6]=(S*it-P*rt+w*k)*mt,j[7]=(P*Y-$*it-w*K)*mt,j[8]=($*rt-S*Y+w*U)*mt,j):null;}function b(j,G,Q){return j[0]=2/G,j[1]=0,j[2]=0,j[3]=0,j[4]=-2/Q,j[5]=0,j[6]=-1,j[7]=1,j[8]=1,j;}function E(j){return"mat3("+j[0]+", "+j[1]+", "+j[2]+", "+j[3]+", "+j[4]+", "+j[5]+", "+j[6]+", "+j[7]+", "+j[8]+")";}function L(j){return Math.hypot(j[0],j[1],j[2],j[3],j[4],j[5],j[6],j[7],j[8]);}function D(j,G,Q){return j[0]=G[0]+Q[0],j[1]=G[1]+Q[1],j[2]=G[2]+Q[2],j[3]=G[3]+Q[3],j[4]=G[4]+Q[4],j[5]=G[5]+Q[5],j[6]=G[6]+Q[6],j[7]=G[7]+Q[7],j[8]=G[8]+Q[8],j;}function R(j,G,Q){return j[0]=G[0]-Q[0],j[1]=G[1]-Q[1],j[2]=G[2]-Q[2],j[3]=G[3]-Q[3],j[4]=G[4]-Q[4],j[5]=G[5]-Q[5],j[6]=G[6]-Q[6],j[7]=G[7]-Q[7],j[8]=G[8]-Q[8],j;}function C(j,G,Q){return j[0]=G[0]*Q,j[1]=G[1]*Q,j[2]=G[2]*Q,j[3]=G[3]*Q,j[4]=G[4]*Q,j[5]=G[5]*Q,j[6]=G[6]*Q,j[7]=G[7]*Q,j[8]=G[8]*Q,j;}function W(j,G,Q,tt){return j[0]=G[0]+Q[0]*tt,j[1]=G[1]+Q[1]*tt,j[2]=G[2]+Q[2]*tt,j[3]=G[3]+Q[3]*tt,j[4]=G[4]+Q[4]*tt,j[5]=G[5]+Q[5]*tt,j[6]=G[6]+Q[6]*tt,j[7]=G[7]+Q[7]*tt,j[8]=G[8]+Q[8]*tt,j;}function z(j,G){return j[0]===G[0]&&j[1]===G[1]&&j[2]===G[2]&&j[3]===G[3]&&j[4]===G[4]&&j[5]===G[5]&&j[6]===G[6]&&j[7]===G[7]&&j[8]===G[8];}function H(j,G){var Q=j[0],tt=j[1],et=j[2],at=j[3],q=j[4],pt=j[5],dt=j[6],B=j[7],F=j[8],V=G[0],J=G[1],N=G[2],$=G[3],S=G[4],P=G[5],w=G[6],U=G[7],K=G[8];return Math.abs(Q-V)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(V))&&Math.abs(tt-J)<=e.EPSILON*Math.max(1,Math.abs(tt),Math.abs(J))&&Math.abs(et-N)<=e.EPSILON*Math.max(1,Math.abs(et),Math.abs(N))&&Math.abs(at-$)<=e.EPSILON*Math.max(1,Math.abs(at),Math.abs($))&&Math.abs(q-S)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(S))&&Math.abs(pt-P)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(P))&&Math.abs(dt-w)<=e.EPSILON*Math.max(1,Math.abs(dt),Math.abs(w))&&Math.abs(B-U)<=e.EPSILON*Math.max(1,Math.abs(B),Math.abs(U))&&Math.abs(F-K)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(K));}var X=x,Z=R;},/* 6 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"copy",function(){return a;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return o;}),t.d(r,"identity",function(){return f;}),t.d(r,"transpose",function(){return v;}),t.d(r,"invert",function(){return l;}),t.d(r,"adjoint",function(){return p;}),t.d(r,"determinant",function(){return y;}),t.d(r,"multiply",function(){return O;}),t.d(r,"translate",function(){return x;}),t.d(r,"scale",function(){return m;}),t.d(r,"rotate",function(){return T;}),t.d(r,"rotateX",function(){return c;}),t.d(r,"rotateY",function(){return d;}),t.d(r,"rotateZ",function(){return u;}),t.d(r,"fromTranslation",function(){return g;}),t.d(r,"fromScaling",function(){return M;}),t.d(r,"fromRotation",function(){return A;}),t.d(r,"fromXRotation",function(){return I;}),t.d(r,"fromYRotation",function(){return b;}),t.d(r,"fromZRotation",function(){return E;}),t.d(r,"fromRotationTranslation",function(){return L;}),t.d(r,"fromQuat2",function(){return D;}),t.d(r,"getTranslation",function(){return R;}),t.d(r,"getScaling",function(){return C;}),t.d(r,"getRotation",function(){return W;}),t.d(r,"fromRotationTranslationScale",function(){return z;}),t.d(r,"fromRotationTranslationScaleOrigin",function(){return H;}),t.d(r,"fromQuat",function(){return X;}),t.d(r,"frustum",function(){return Z;}),t.d(r,"perspective",function(){return j;}),t.d(r,"perspectiveFromFieldOfView",function(){return G;}),t.d(r,"ortho",function(){return Q;}),t.d(r,"lookAt",function(){return tt;}),t.d(r,"targetTo",function(){return et;}),t.d(r,"str",function(){return at;}),t.d(r,"frob",function(){return q;}),t.d(r,"add",function(){return pt;}),t.d(r,"subtract",function(){return dt;}),t.d(r,"multiplyScalar",function(){return B;}),t.d(r,"multiplyScalarAndAdd",function(){return F;}),t.d(r,"exactEquals",function(){return V;}),t.d(r,"equals",function(){return J;}),t.d(r,"mul",function(){return N;}),t.d(r,"sub",function(){return $;});var e=t(2);function n(){var S=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=0,S[12]=0,S[13]=0,S[14]=0),S[0]=1,S[5]=1,S[10]=1,S[15]=1,S;}function i(S){var P=new e.ARRAY_TYPE(16);return P[0]=S[0],P[1]=S[1],P[2]=S[2],P[3]=S[3],P[4]=S[4],P[5]=S[5],P[6]=S[6],P[7]=S[7],P[8]=S[8],P[9]=S[9],P[10]=S[10],P[11]=S[11],P[12]=S[12],P[13]=S[13],P[14]=S[14],P[15]=S[15],P;}function a(S,P){return S[0]=P[0],S[1]=P[1],S[2]=P[2],S[3]=P[3],S[4]=P[4],S[5]=P[5],S[6]=P[6],S[7]=P[7],S[8]=P[8],S[9]=P[9],S[10]=P[10],S[11]=P[11],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15],S;}function s(S,P,w,U,K,Y,k,rt,it,lt,ut,ot,st,ft,vt,mt){var gt=new e.ARRAY_TYPE(16);return gt[0]=S,gt[1]=P,gt[2]=w,gt[3]=U,gt[4]=K,gt[5]=Y,gt[6]=k,gt[7]=rt,gt[8]=it,gt[9]=lt,gt[10]=ut,gt[11]=ot,gt[12]=st,gt[13]=ft,gt[14]=vt,gt[15]=mt,gt;}function o(S,P,w,U,K,Y,k,rt,it,lt,ut,ot,st,ft,vt,mt,gt){return S[0]=P,S[1]=w,S[2]=U,S[3]=K,S[4]=Y,S[5]=k,S[6]=rt,S[7]=it,S[8]=lt,S[9]=ut,S[10]=ot,S[11]=st,S[12]=ft,S[13]=vt,S[14]=mt,S[15]=gt,S;}function f(S){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function v(S,P){if(S===P){var w=P[1],U=P[2],K=P[3],Y=P[6],k=P[7],rt=P[11];S[1]=P[4],S[2]=P[8],S[3]=P[12],S[4]=w,S[6]=P[9],S[7]=P[13],S[8]=U,S[9]=Y,S[11]=P[14],S[12]=K,S[13]=k,S[14]=rt;}else S[0]=P[0],S[1]=P[4],S[2]=P[8],S[3]=P[12],S[4]=P[1],S[5]=P[5],S[6]=P[9],S[7]=P[13],S[8]=P[2],S[9]=P[6],S[10]=P[10],S[11]=P[14],S[12]=P[3],S[13]=P[7],S[14]=P[11],S[15]=P[15];return S;}function l(S,P){var w=P[0],U=P[1],K=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],ot=P[9],st=P[10],ft=P[11],vt=P[12],mt=P[13],gt=P[14],St=P[15],It=w*rt-U*k,Et=w*it-K*k,Pt=w*lt-Y*k,At=U*it-K*rt,Ct=U*lt-Y*rt,Gt=K*lt-Y*it,jt=ut*mt-ot*vt,Ut=ut*gt-st*vt,$t=ut*St-ft*vt,Ht=ot*gt-st*mt,Kt=ot*St-ft*mt,Yt=st*St-ft*gt,bt=It*Yt-Et*Kt+Pt*Ht+At*$t-Ct*Ut+Gt*jt;return bt?(bt=1/bt,S[0]=(rt*Yt-it*Kt+lt*Ht)*bt,S[1]=(K*Kt-U*Yt-Y*Ht)*bt,S[2]=(mt*Gt-gt*Ct+St*At)*bt,S[3]=(st*Ct-ot*Gt-ft*At)*bt,S[4]=(it*$t-k*Yt-lt*Ut)*bt,S[5]=(w*Yt-K*$t+Y*Ut)*bt,S[6]=(gt*Pt-vt*Gt-St*Et)*bt,S[7]=(ut*Gt-st*Pt+ft*Et)*bt,S[8]=(k*Kt-rt*$t+lt*jt)*bt,S[9]=(U*$t-w*Kt-Y*jt)*bt,S[10]=(vt*Ct-mt*Pt+St*It)*bt,S[11]=(ot*Pt-ut*Ct-ft*It)*bt,S[12]=(rt*Ut-k*Ht-it*jt)*bt,S[13]=(w*Ht-U*Ut+K*jt)*bt,S[14]=(mt*Et-vt*At-gt*It)*bt,S[15]=(ut*At-ot*Et+st*It)*bt,S):null;}function p(S,P){var w=P[0],U=P[1],K=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],ot=P[9],st=P[10],ft=P[11],vt=P[12],mt=P[13],gt=P[14],St=P[15];return S[0]=rt*(st*St-ft*gt)-ot*(it*St-lt*gt)+mt*(it*ft-lt*st),S[1]=-(U*(st*St-ft*gt)-ot*(K*St-Y*gt)+mt*(K*ft-Y*st)),S[2]=U*(it*St-lt*gt)-rt*(K*St-Y*gt)+mt*(K*lt-Y*it),S[3]=-(U*(it*ft-lt*st)-rt*(K*ft-Y*st)+ot*(K*lt-Y*it)),S[4]=-(k*(st*St-ft*gt)-ut*(it*St-lt*gt)+vt*(it*ft-lt*st)),S[5]=w*(st*St-ft*gt)-ut*(K*St-Y*gt)+vt*(K*ft-Y*st),S[6]=-(w*(it*St-lt*gt)-k*(K*St-Y*gt)+vt*(K*lt-Y*it)),S[7]=w*(it*ft-lt*st)-k*(K*ft-Y*st)+ut*(K*lt-Y*it),S[8]=k*(ot*St-ft*mt)-ut*(rt*St-lt*mt)+vt*(rt*ft-lt*ot),S[9]=-(w*(ot*St-ft*mt)-ut*(U*St-Y*mt)+vt*(U*ft-Y*ot)),S[10]=w*(rt*St-lt*mt)-k*(U*St-Y*mt)+vt*(U*lt-Y*rt),S[11]=-(w*(rt*ft-lt*ot)-k*(U*ft-Y*ot)+ut*(U*lt-Y*rt)),S[12]=-(k*(ot*gt-st*mt)-ut*(rt*gt-it*mt)+vt*(rt*st-it*ot)),S[13]=w*(ot*gt-st*mt)-ut*(U*gt-K*mt)+vt*(U*st-K*ot),S[14]=-(w*(rt*gt-it*mt)-k*(U*gt-K*mt)+vt*(U*it-K*rt)),S[15]=w*(rt*st-it*ot)-k*(U*st-K*ot)+ut*(U*it-K*rt),S;}function y(S){var P=S[0],w=S[1],U=S[2],K=S[3],Y=S[4],k=S[5],rt=S[6],it=S[7],lt=S[8],ut=S[9],ot=S[10],st=S[11],ft=S[12],vt=S[13],mt=S[14],gt=S[15],St=P*k-w*Y,It=P*rt-U*Y,Et=P*it-K*Y,Pt=w*rt-U*k,At=w*it-K*k,Ct=U*it-K*rt,Gt=lt*vt-ut*ft,jt=lt*mt-ot*ft,Ut=lt*gt-st*ft,$t=ut*mt-ot*vt,Ht=ut*gt-st*vt,Kt=ot*gt-st*mt;return St*Kt-It*Ht+Et*$t+Pt*Ut-At*jt+Ct*Gt;}function O(S,P,w){var U=P[0],K=P[1],Y=P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],ot=P[8],st=P[9],ft=P[10],vt=P[11],mt=P[12],gt=P[13],St=P[14],It=P[15],Et=w[0],Pt=w[1],At=w[2],Ct=w[3];return S[0]=Et*U+Pt*rt+At*ot+Ct*mt,S[1]=Et*K+Pt*it+At*st+Ct*gt,S[2]=Et*Y+Pt*lt+At*ft+Ct*St,S[3]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[4],Pt=w[5],At=w[6],Ct=w[7],S[4]=Et*U+Pt*rt+At*ot+Ct*mt,S[5]=Et*K+Pt*it+At*st+Ct*gt,S[6]=Et*Y+Pt*lt+At*ft+Ct*St,S[7]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[8],Pt=w[9],At=w[10],Ct=w[11],S[8]=Et*U+Pt*rt+At*ot+Ct*mt,S[9]=Et*K+Pt*it+At*st+Ct*gt,S[10]=Et*Y+Pt*lt+At*ft+Ct*St,S[11]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[12],Pt=w[13],At=w[14],Ct=w[15],S[12]=Et*U+Pt*rt+At*ot+Ct*mt,S[13]=Et*K+Pt*it+At*st+Ct*gt,S[14]=Et*Y+Pt*lt+At*ft+Ct*St,S[15]=Et*k+Pt*ut+At*vt+Ct*It,S;}function x(S,P,w){var U=w[0],K=w[1],Y=w[2],k,rt,it,lt,ut,ot,st,ft,vt,mt,gt,St;return P===S?(S[12]=P[0]*U+P[4]*K+P[8]*Y+P[12],S[13]=P[1]*U+P[5]*K+P[9]*Y+P[13],S[14]=P[2]*U+P[6]*K+P[10]*Y+P[14],S[15]=P[3]*U+P[7]*K+P[11]*Y+P[15]):(k=P[0],rt=P[1],it=P[2],lt=P[3],ut=P[4],ot=P[5],st=P[6],ft=P[7],vt=P[8],mt=P[9],gt=P[10],St=P[11],S[0]=k,S[1]=rt,S[2]=it,S[3]=lt,S[4]=ut,S[5]=ot,S[6]=st,S[7]=ft,S[8]=vt,S[9]=mt,S[10]=gt,S[11]=St,S[12]=k*U+ut*K+vt*Y+P[12],S[13]=rt*U+ot*K+mt*Y+P[13],S[14]=it*U+st*K+gt*Y+P[14],S[15]=lt*U+ft*K+St*Y+P[15]),S;}function m(S,P,w){var U=w[0],K=w[1],Y=w[2];return S[0]=P[0]*U,S[1]=P[1]*U,S[2]=P[2]*U,S[3]=P[3]*U,S[4]=P[4]*K,S[5]=P[5]*K,S[6]=P[6]*K,S[7]=P[7]*K,S[8]=P[8]*Y,S[9]=P[9]*Y,S[10]=P[10]*Y,S[11]=P[11]*Y,S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15],S;}function T(S,P,w,U){var K=U[0],Y=U[1],k=U[2],rt=Math.hypot(K,Y,k),it,lt,ut,ot,st,ft,vt,mt,gt,St,It,Et,Pt,At,Ct,Gt,jt,Ut,$t,Ht,Kt,Yt,bt,Qt;return rt<e.EPSILON?null:(rt=1/rt,K*=rt,Y*=rt,k*=rt,it=Math.sin(w),lt=Math.cos(w),ut=1-lt,ot=P[0],st=P[1],ft=P[2],vt=P[3],mt=P[4],gt=P[5],St=P[6],It=P[7],Et=P[8],Pt=P[9],At=P[10],Ct=P[11],Gt=K*K*ut+lt,jt=Y*K*ut+k*it,Ut=k*K*ut-Y*it,$t=K*Y*ut-k*it,Ht=Y*Y*ut+lt,Kt=k*Y*ut+K*it,Yt=K*k*ut+Y*it,bt=Y*k*ut-K*it,Qt=k*k*ut+lt,S[0]=ot*Gt+mt*jt+Et*Ut,S[1]=st*Gt+gt*jt+Pt*Ut,S[2]=ft*Gt+St*jt+At*Ut,S[3]=vt*Gt+It*jt+Ct*Ut,S[4]=ot*$t+mt*Ht+Et*Kt,S[5]=st*$t+gt*Ht+Pt*Kt,S[6]=ft*$t+St*Ht+At*Kt,S[7]=vt*$t+It*Ht+Ct*Kt,S[8]=ot*Yt+mt*bt+Et*Qt,S[9]=st*Yt+gt*bt+Pt*Qt,S[10]=ft*Yt+St*bt+At*Qt,S[11]=vt*Yt+It*bt+Ct*Qt,P!==S&&(S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S);}function c(S,P,w){var U=Math.sin(w),K=Math.cos(w),Y=P[4],k=P[5],rt=P[6],it=P[7],lt=P[8],ut=P[9],ot=P[10],st=P[11];return P!==S&&(S[0]=P[0],S[1]=P[1],S[2]=P[2],S[3]=P[3],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S[4]=Y*K+lt*U,S[5]=k*K+ut*U,S[6]=rt*K+ot*U,S[7]=it*K+st*U,S[8]=lt*K-Y*U,S[9]=ut*K-k*U,S[10]=ot*K-rt*U,S[11]=st*K-it*U,S;}function d(S,P,w){var U=Math.sin(w),K=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[8],ut=P[9],ot=P[10],st=P[11];return P!==S&&(S[4]=P[4],S[5]=P[5],S[6]=P[6],S[7]=P[7],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S[0]=Y*K-lt*U,S[1]=k*K-ut*U,S[2]=rt*K-ot*U,S[3]=it*K-st*U,S[8]=Y*U+lt*K,S[9]=k*U+ut*K,S[10]=rt*U+ot*K,S[11]=it*U+st*K,S;}function u(S,P,w){var U=Math.sin(w),K=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[4],ut=P[5],ot=P[6],st=P[7];return P!==S&&(S[8]=P[8],S[9]=P[9],S[10]=P[10],S[11]=P[11],S[12]=P[12],S[13]=P[13],S[14]=P[14],S[15]=P[15]),S[0]=Y*K+lt*U,S[1]=k*K+ut*U,S[2]=rt*K+ot*U,S[3]=it*K+st*U,S[4]=lt*K-Y*U,S[5]=ut*K-k*U,S[6]=ot*K-rt*U,S[7]=st*K-it*U,S;}function g(S,P){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=P[0],S[13]=P[1],S[14]=P[2],S[15]=1,S;}function M(S,P){return S[0]=P[0],S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=P[1],S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=P[2],S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function A(S,P,w){var U=w[0],K=w[1],Y=w[2],k=Math.hypot(U,K,Y),rt,it,lt;return k<e.EPSILON?null:(k=1/k,U*=k,K*=k,Y*=k,rt=Math.sin(P),it=Math.cos(P),lt=1-it,S[0]=U*U*lt+it,S[1]=K*U*lt+Y*rt,S[2]=Y*U*lt-K*rt,S[3]=0,S[4]=U*K*lt-Y*rt,S[5]=K*K*lt+it,S[6]=Y*K*lt+U*rt,S[7]=0,S[8]=U*Y*lt+K*rt,S[9]=K*Y*lt-U*rt,S[10]=Y*Y*lt+it,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S);}function I(S,P){var w=Math.sin(P),U=Math.cos(P);return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=U,S[6]=w,S[7]=0,S[8]=0,S[9]=-w,S[10]=U,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function b(S,P){var w=Math.sin(P),U=Math.cos(P);return S[0]=U,S[1]=0,S[2]=-w,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=w,S[9]=0,S[10]=U,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function E(S,P){var w=Math.sin(P),U=Math.cos(P);return S[0]=U,S[1]=w,S[2]=0,S[3]=0,S[4]=-w,S[5]=U,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function L(S,P,w){var U=P[0],K=P[1],Y=P[2],k=P[3],rt=U+U,it=K+K,lt=Y+Y,ut=U*rt,ot=U*it,st=U*lt,ft=K*it,vt=K*lt,mt=Y*lt,gt=k*rt,St=k*it,It=k*lt;return S[0]=1-(ft+mt),S[1]=ot+It,S[2]=st-St,S[3]=0,S[4]=ot-It,S[5]=1-(ut+mt),S[6]=vt+gt,S[7]=0,S[8]=st+St,S[9]=vt-gt,S[10]=1-(ut+ft),S[11]=0,S[12]=w[0],S[13]=w[1],S[14]=w[2],S[15]=1,S;}function D(S,P){var w=new e.ARRAY_TYPE(3),U=-P[0],K=-P[1],Y=-P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],ot=U*U+K*K+Y*Y+k*k;return ot>0?(w[0]=(rt*k+ut*U+it*Y-lt*K)*2/ot,w[1]=(it*k+ut*K+lt*U-rt*Y)*2/ot,w[2]=(lt*k+ut*Y+rt*K-it*U)*2/ot):(w[0]=(rt*k+ut*U+it*Y-lt*K)*2,w[1]=(it*k+ut*K+lt*U-rt*Y)*2,w[2]=(lt*k+ut*Y+rt*K-it*U)*2),L(S,P,w),S;}function R(S,P){return S[0]=P[12],S[1]=P[13],S[2]=P[14],S;}function C(S,P){var w=P[0],U=P[1],K=P[2],Y=P[4],k=P[5],rt=P[6],it=P[8],lt=P[9],ut=P[10];return S[0]=Math.hypot(w,U,K),S[1]=Math.hypot(Y,k,rt),S[2]=Math.hypot(it,lt,ut),S;}function W(S,P){var w=new e.ARRAY_TYPE(3);C(w,P);var U=1/w[0],K=1/w[1],Y=1/w[2],k=P[0]*U,rt=P[1]*K,it=P[2]*Y,lt=P[4]*U,ut=P[5]*K,ot=P[6]*Y,st=P[8]*U,ft=P[9]*K,vt=P[10]*Y,mt=k+ut+vt,gt=0;return mt>0?(gt=Math.sqrt(mt+1)*2,S[3]=0.25*gt,S[0]=(ot-ft)/gt,S[1]=(st-it)/gt,S[2]=(rt-lt)/gt):k>ut&&k>vt?(gt=Math.sqrt(1+k-ut-vt)*2,S[3]=(ot-ft)/gt,S[0]=0.25*gt,S[1]=(rt+lt)/gt,S[2]=(st+it)/gt):ut>vt?(gt=Math.sqrt(1+ut-k-vt)*2,S[3]=(st-it)/gt,S[0]=(rt+lt)/gt,S[1]=0.25*gt,S[2]=(ot+ft)/gt):(gt=Math.sqrt(1+vt-k-ut)*2,S[3]=(rt-lt)/gt,S[0]=(st+it)/gt,S[1]=(ot+ft)/gt,S[2]=0.25*gt),S;}function z(S,P,w,U){var K=P[0],Y=P[1],k=P[2],rt=P[3],it=K+K,lt=Y+Y,ut=k+k,ot=K*it,st=K*lt,ft=K*ut,vt=Y*lt,mt=Y*ut,gt=k*ut,St=rt*it,It=rt*lt,Et=rt*ut,Pt=U[0],At=U[1],Ct=U[2];return S[0]=(1-(vt+gt))*Pt,S[1]=(st+Et)*Pt,S[2]=(ft-It)*Pt,S[3]=0,S[4]=(st-Et)*At,S[5]=(1-(ot+gt))*At,S[6]=(mt+St)*At,S[7]=0,S[8]=(ft+It)*Ct,S[9]=(mt-St)*Ct,S[10]=(1-(ot+vt))*Ct,S[11]=0,S[12]=w[0],S[13]=w[1],S[14]=w[2],S[15]=1,S;}function H(S,P,w,U,K){var Y=P[0],k=P[1],rt=P[2],it=P[3],lt=Y+Y,ut=k+k,ot=rt+rt,st=Y*lt,ft=Y*ut,vt=Y*ot,mt=k*ut,gt=k*ot,St=rt*ot,It=it*lt,Et=it*ut,Pt=it*ot,At=U[0],Ct=U[1],Gt=U[2],jt=K[0],Ut=K[1],$t=K[2],Ht=(1-(mt+St))*At,Kt=(ft+Pt)*At,Yt=(vt-Et)*At,bt=(ft-Pt)*Ct,Qt=(1-(st+St))*Ct,Ee=(gt+It)*Ct,Pe=(vt+Et)*Gt,xr=(gt-It)*Gt,Tr=(1-(st+mt))*Gt;return S[0]=Ht,S[1]=Kt,S[2]=Yt,S[3]=0,S[4]=bt,S[5]=Qt,S[6]=Ee,S[7]=0,S[8]=Pe,S[9]=xr,S[10]=Tr,S[11]=0,S[12]=w[0]+jt-(Ht*jt+bt*Ut+Pe*$t),S[13]=w[1]+Ut-(Kt*jt+Qt*Ut+xr*$t),S[14]=w[2]+$t-(Yt*jt+Ee*Ut+Tr*$t),S[15]=1,S;}function X(S,P){var w=P[0],U=P[1],K=P[2],Y=P[3],k=w+w,rt=U+U,it=K+K,lt=w*k,ut=U*k,ot=U*rt,st=K*k,ft=K*rt,vt=K*it,mt=Y*k,gt=Y*rt,St=Y*it;return S[0]=1-ot-vt,S[1]=ut+St,S[2]=st-gt,S[3]=0,S[4]=ut-St,S[5]=1-lt-vt,S[6]=ft+mt,S[7]=0,S[8]=st+gt,S[9]=ft-mt,S[10]=1-lt-ot,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S;}function Z(S,P,w,U,K,Y,k){var rt=1/(w-P),it=1/(K-U),lt=1/(Y-k);return S[0]=Y*2*rt,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Y*2*it,S[6]=0,S[7]=0,S[8]=(w+P)*rt,S[9]=(K+U)*it,S[10]=(k+Y)*lt,S[11]=-1,S[12]=0,S[13]=0,S[14]=k*Y*2*lt,S[15]=0,S;}function j(S,P,w,U,K){var Y=1/Math.tan(P/2),k;return S[0]=Y/w,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Y,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,K!=null&&K!==1/0?(k=1/(U-K),S[10]=(K+U)*k,S[14]=2*K*U*k):(S[10]=-1,S[14]=-2*U),S;}function G(S,P,w,U){var K=Math.tan(P.upDegrees*Math.PI/180),Y=Math.tan(P.downDegrees*Math.PI/180),k=Math.tan(P.leftDegrees*Math.PI/180),rt=Math.tan(P.rightDegrees*Math.PI/180),it=2/(k+rt),lt=2/(K+Y);return S[0]=it,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=lt,S[6]=0,S[7]=0,S[8]=-((k-rt)*it*0.5),S[9]=(K-Y)*lt*0.5,S[10]=U/(w-U),S[11]=-1,S[12]=0,S[13]=0,S[14]=U*w/(w-U),S[15]=0,S;}function Q(S,P,w,U,K,Y,k){var rt=1/(P-w),it=1/(U-K),lt=1/(Y-k);return S[0]=-2*rt,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*it,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=2*lt,S[11]=0,S[12]=(P+w)*rt,S[13]=(K+U)*it,S[14]=(k+Y)*lt,S[15]=1,S;}function tt(S,P,w,U){var K,Y,k,rt,it,lt,ut,ot,st,ft,vt=P[0],mt=P[1],gt=P[2],St=U[0],It=U[1],Et=U[2],Pt=w[0],At=w[1],Ct=w[2];return Math.abs(vt-Pt)<e.EPSILON&&Math.abs(mt-At)<e.EPSILON&&Math.abs(gt-Ct)<e.EPSILON?f(S):(ut=vt-Pt,ot=mt-At,st=gt-Ct,ft=1/Math.hypot(ut,ot,st),ut*=ft,ot*=ft,st*=ft,K=It*st-Et*ot,Y=Et*ut-St*st,k=St*ot-It*ut,ft=Math.hypot(K,Y,k),ft?(ft=1/ft,K*=ft,Y*=ft,k*=ft):(K=0,Y=0,k=0),rt=ot*k-st*Y,it=st*K-ut*k,lt=ut*Y-ot*K,ft=Math.hypot(rt,it,lt),ft?(ft=1/ft,rt*=ft,it*=ft,lt*=ft):(rt=0,it=0,lt=0),S[0]=K,S[1]=rt,S[2]=ut,S[3]=0,S[4]=Y,S[5]=it,S[6]=ot,S[7]=0,S[8]=k,S[9]=lt,S[10]=st,S[11]=0,S[12]=-(K*vt+Y*mt+k*gt),S[13]=-(rt*vt+it*mt+lt*gt),S[14]=-(ut*vt+ot*mt+st*gt),S[15]=1,S);}function et(S,P,w,U){var K=P[0],Y=P[1],k=P[2],rt=U[0],it=U[1],lt=U[2],ut=K-w[0],ot=Y-w[1],st=k-w[2],ft=ut*ut+ot*ot+st*st;ft>0&&(ft=1/Math.sqrt(ft),ut*=ft,ot*=ft,st*=ft);var vt=it*st-lt*ot,mt=lt*ut-rt*st,gt=rt*ot-it*ut;return ft=vt*vt+mt*mt+gt*gt,ft>0&&(ft=1/Math.sqrt(ft),vt*=ft,mt*=ft,gt*=ft),S[0]=vt,S[1]=mt,S[2]=gt,S[3]=0,S[4]=ot*gt-st*mt,S[5]=st*vt-ut*gt,S[6]=ut*mt-ot*vt,S[7]=0,S[8]=ut,S[9]=ot,S[10]=st,S[11]=0,S[12]=K,S[13]=Y,S[14]=k,S[15]=1,S;}function at(S){return"mat4("+S[0]+", "+S[1]+", "+S[2]+", "+S[3]+", "+S[4]+", "+S[5]+", "+S[6]+", "+S[7]+", "+S[8]+", "+S[9]+", "+S[10]+", "+S[11]+", "+S[12]+", "+S[13]+", "+S[14]+", "+S[15]+")";}function q(S){return Math.hypot(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[8],S[9],S[10],S[11],S[12],S[13],S[14],S[15]);}function pt(S,P,w){return S[0]=P[0]+w[0],S[1]=P[1]+w[1],S[2]=P[2]+w[2],S[3]=P[3]+w[3],S[4]=P[4]+w[4],S[5]=P[5]+w[5],S[6]=P[6]+w[6],S[7]=P[7]+w[7],S[8]=P[8]+w[8],S[9]=P[9]+w[9],S[10]=P[10]+w[10],S[11]=P[11]+w[11],S[12]=P[12]+w[12],S[13]=P[13]+w[13],S[14]=P[14]+w[14],S[15]=P[15]+w[15],S;}function dt(S,P,w){return S[0]=P[0]-w[0],S[1]=P[1]-w[1],S[2]=P[2]-w[2],S[3]=P[3]-w[3],S[4]=P[4]-w[4],S[5]=P[5]-w[5],S[6]=P[6]-w[6],S[7]=P[7]-w[7],S[8]=P[8]-w[8],S[9]=P[9]-w[9],S[10]=P[10]-w[10],S[11]=P[11]-w[11],S[12]=P[12]-w[12],S[13]=P[13]-w[13],S[14]=P[14]-w[14],S[15]=P[15]-w[15],S;}function B(S,P,w){return S[0]=P[0]*w,S[1]=P[1]*w,S[2]=P[2]*w,S[3]=P[3]*w,S[4]=P[4]*w,S[5]=P[5]*w,S[6]=P[6]*w,S[7]=P[7]*w,S[8]=P[8]*w,S[9]=P[9]*w,S[10]=P[10]*w,S[11]=P[11]*w,S[12]=P[12]*w,S[13]=P[13]*w,S[14]=P[14]*w,S[15]=P[15]*w,S;}function F(S,P,w,U){return S[0]=P[0]+w[0]*U,S[1]=P[1]+w[1]*U,S[2]=P[2]+w[2]*U,S[3]=P[3]+w[3]*U,S[4]=P[4]+w[4]*U,S[5]=P[5]+w[5]*U,S[6]=P[6]+w[6]*U,S[7]=P[7]+w[7]*U,S[8]=P[8]+w[8]*U,S[9]=P[9]+w[9]*U,S[10]=P[10]+w[10]*U,S[11]=P[11]+w[11]*U,S[12]=P[12]+w[12]*U,S[13]=P[13]+w[13]*U,S[14]=P[14]+w[14]*U,S[15]=P[15]+w[15]*U,S;}function V(S,P){return S[0]===P[0]&&S[1]===P[1]&&S[2]===P[2]&&S[3]===P[3]&&S[4]===P[4]&&S[5]===P[5]&&S[6]===P[6]&&S[7]===P[7]&&S[8]===P[8]&&S[9]===P[9]&&S[10]===P[10]&&S[11]===P[11]&&S[12]===P[12]&&S[13]===P[13]&&S[14]===P[14]&&S[15]===P[15];}function J(S,P){var w=S[0],U=S[1],K=S[2],Y=S[3],k=S[4],rt=S[5],it=S[6],lt=S[7],ut=S[8],ot=S[9],st=S[10],ft=S[11],vt=S[12],mt=S[13],gt=S[14],St=S[15],It=P[0],Et=P[1],Pt=P[2],At=P[3],Ct=P[4],Gt=P[5],jt=P[6],Ut=P[7],$t=P[8],Ht=P[9],Kt=P[10],Yt=P[11],bt=P[12],Qt=P[13],Ee=P[14],Pe=P[15];return Math.abs(w-It)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(It))&&Math.abs(U-Et)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(Et))&&Math.abs(K-Pt)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(Pt))&&Math.abs(Y-At)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(At))&&Math.abs(k-Ct)<=e.EPSILON*Math.max(1,Math.abs(k),Math.abs(Ct))&&Math.abs(rt-Gt)<=e.EPSILON*Math.max(1,Math.abs(rt),Math.abs(Gt))&&Math.abs(it-jt)<=e.EPSILON*Math.max(1,Math.abs(it),Math.abs(jt))&&Math.abs(lt-Ut)<=e.EPSILON*Math.max(1,Math.abs(lt),Math.abs(Ut))&&Math.abs(ut-$t)<=e.EPSILON*Math.max(1,Math.abs(ut),Math.abs($t))&&Math.abs(ot-Ht)<=e.EPSILON*Math.max(1,Math.abs(ot),Math.abs(Ht))&&Math.abs(st-Kt)<=e.EPSILON*Math.max(1,Math.abs(st),Math.abs(Kt))&&Math.abs(ft-Yt)<=e.EPSILON*Math.max(1,Math.abs(ft),Math.abs(Yt))&&Math.abs(vt-bt)<=e.EPSILON*Math.max(1,Math.abs(vt),Math.abs(bt))&&Math.abs(mt-Qt)<=e.EPSILON*Math.max(1,Math.abs(mt),Math.abs(Qt))&&Math.abs(gt-Ee)<=e.EPSILON*Math.max(1,Math.abs(gt),Math.abs(Ee))&&Math.abs(St-Pe)<=e.EPSILON*Math.max(1,Math.abs(St),Math.abs(Pe));}var N=O,$=dt;},/* 7 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return s;}),t.d(r,"identity",function(){return o;}),t.d(r,"setAxisAngle",function(){return f;}),t.d(r,"getAxisAngle",function(){return v;}),t.d(r,"getAngle",function(){return l;}),t.d(r,"multiply",function(){return p;}),t.d(r,"rotateX",function(){return y;}),t.d(r,"rotateY",function(){return O;}),t.d(r,"rotateZ",function(){return x;}),t.d(r,"calculateW",function(){return m;}),t.d(r,"exp",function(){return T;}),t.d(r,"ln",function(){return c;}),t.d(r,"pow",function(){return d;}),t.d(r,"slerp",function(){return u;}),t.d(r,"random",function(){return g;}),t.d(r,"invert",function(){return M;}),t.d(r,"conjugate",function(){return A;}),t.d(r,"fromMat3",function(){return I;}),t.d(r,"fromEuler",function(){return b;}),t.d(r,"str",function(){return E;}),t.d(r,"clone",function(){return L;}),t.d(r,"fromValues",function(){return D;}),t.d(r,"copy",function(){return R;}),t.d(r,"set",function(){return C;}),t.d(r,"add",function(){return W;}),t.d(r,"mul",function(){return z;}),t.d(r,"scale",function(){return H;}),t.d(r,"dot",function(){return X;}),t.d(r,"lerp",function(){return Z;}),t.d(r,"length",function(){return j;}),t.d(r,"len",function(){return G;}),t.d(r,"squaredLength",function(){return Q;}),t.d(r,"sqrLen",function(){return tt;}),t.d(r,"normalize",function(){return et;}),t.d(r,"exactEquals",function(){return at;}),t.d(r,"equals",function(){return q;}),t.d(r,"rotationTo",function(){return pt;}),t.d(r,"sqlerp",function(){return dt;}),t.d(r,"setAxes",function(){return B;});var e=t(2),n=t(5),i=t(8),a=t(9);function s(){var F=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0),F[3]=1,F;}function o(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F;}function f(F,V,J){J=J*0.5;var N=Math.sin(J);return F[0]=N*V[0],F[1]=N*V[1],F[2]=N*V[2],F[3]=Math.cos(J),F;}function v(F,V){var J=Math.acos(V[3])*2,N=Math.sin(J/2);return N>e.EPSILON?(F[0]=V[0]/N,F[1]=V[1]/N,F[2]=V[2]/N):(F[0]=1,F[1]=0,F[2]=0),J;}function l(F,V){var J=X(F,V);return Math.acos(2*J*J-1);}function p(F,V,J){var N=V[0],$=V[1],S=V[2],P=V[3],w=J[0],U=J[1],K=J[2],Y=J[3];return F[0]=N*Y+P*w+$*K-S*U,F[1]=$*Y+P*U+S*w-N*K,F[2]=S*Y+P*K+N*U-$*w,F[3]=P*Y-N*w-$*U-S*K,F;}function y(F,V,J){J*=0.5;var N=V[0],$=V[1],S=V[2],P=V[3],w=Math.sin(J),U=Math.cos(J);return F[0]=N*U+P*w,F[1]=$*U+S*w,F[2]=S*U-$*w,F[3]=P*U-N*w,F;}function O(F,V,J){J*=0.5;var N=V[0],$=V[1],S=V[2],P=V[3],w=Math.sin(J),U=Math.cos(J);return F[0]=N*U-S*w,F[1]=$*U+P*w,F[2]=S*U+N*w,F[3]=P*U-$*w,F;}function x(F,V,J){J*=0.5;var N=V[0],$=V[1],S=V[2],P=V[3],w=Math.sin(J),U=Math.cos(J);return F[0]=N*U+$*w,F[1]=$*U-N*w,F[2]=S*U+P*w,F[3]=P*U-S*w,F;}function m(F,V){var J=V[0],N=V[1],$=V[2];return F[0]=J,F[1]=N,F[2]=$,F[3]=Math.sqrt(Math.abs(1-J*J-N*N-$*$)),F;}function T(F,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=Math.sqrt(J*J+N*N+$*$),w=Math.exp(S),U=P>0?w*Math.sin(P)/P:0;return F[0]=J*U,F[1]=N*U,F[2]=$*U,F[3]=w*Math.cos(P),F;}function c(F,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=Math.sqrt(J*J+N*N+$*$),w=P>0?Math.atan2(P,S)/P:0;return F[0]=J*w,F[1]=N*w,F[2]=$*w,F[3]=0.5*Math.log(J*J+N*N+$*$+S*S),F;}function d(F,V,J){return c(F,V),H(F,F,J),T(F,F),F;}function u(F,V,J,N){var $=V[0],S=V[1],P=V[2],w=V[3],U=J[0],K=J[1],Y=J[2],k=J[3],rt,it,lt,ut,ot;return it=$*U+S*K+P*Y+w*k,it<0&&(it=-it,U=-U,K=-K,Y=-Y,k=-k),1-it>e.EPSILON?(rt=Math.acos(it),lt=Math.sin(rt),ut=Math.sin((1-N)*rt)/lt,ot=Math.sin(N*rt)/lt):(ut=1-N,ot=N),F[0]=ut*$+ot*U,F[1]=ut*S+ot*K,F[2]=ut*P+ot*Y,F[3]=ut*w+ot*k,F;}function g(F){var V=e.RANDOM(),J=e.RANDOM(),N=e.RANDOM(),$=Math.sqrt(1-V),S=Math.sqrt(V);return F[0]=$*Math.sin(2*Math.PI*J),F[1]=$*Math.cos(2*Math.PI*J),F[2]=S*Math.sin(2*Math.PI*N),F[3]=S*Math.cos(2*Math.PI*N),F;}function M(F,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=J*J+N*N+$*$+S*S,w=P?1/P:0;return F[0]=-J*w,F[1]=-N*w,F[2]=-$*w,F[3]=S*w,F;}function A(F,V){return F[0]=-V[0],F[1]=-V[1],F[2]=-V[2],F[3]=V[3],F;}function I(F,V){var J=V[0]+V[4]+V[8],N;if(J>0)N=Math.sqrt(J+1),F[3]=0.5*N,N=0.5/N,F[0]=(V[5]-V[7])*N,F[1]=(V[6]-V[2])*N,F[2]=(V[1]-V[3])*N;else{var $=0;V[4]>V[0]&&($=1),V[8]>V[$*3+$]&&($=2);var S=($+1)%3,P=($+2)%3;N=Math.sqrt(V[$*3+$]-V[S*3+S]-V[P*3+P]+1),F[$]=0.5*N,N=0.5/N,F[3]=(V[S*3+P]-V[P*3+S])*N,F[S]=(V[S*3+$]+V[$*3+S])*N,F[P]=(V[P*3+$]+V[$*3+P])*N;}return F;}function b(F,V,J,N){var $=0.5*Math.PI/180;V*=$,J*=$,N*=$;var S=Math.sin(V),P=Math.cos(V),w=Math.sin(J),U=Math.cos(J),K=Math.sin(N),Y=Math.cos(N);return F[0]=S*U*Y-P*w*K,F[1]=P*w*Y+S*U*K,F[2]=P*U*K-S*w*Y,F[3]=P*U*Y+S*w*K,F;}function E(F){return"quat("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}var L=a.clone,D=a.fromValues,R=a.copy,C=a.set,W=a.add,z=p,H=a.scale,X=a.dot,Z=a.lerp,j=a.length,G=j,Q=a.squaredLength,tt=Q,et=a.normalize,at=a.exactEquals,q=a.equals,pt=function(){var F=i.create(),V=i.fromValues(1,0,0),J=i.fromValues(0,1,0);return function(N,$,S){var P=i.dot($,S);return P<-0.999999?(i.cross(F,V,$),i.len(F)<1e-6&&i.cross(F,J,$),i.normalize(F,F),f(N,F,Math.PI),N):P>0.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(F,$,S),N[0]=F[0],N[1]=F[1],N[2]=F[2],N[3]=1+P,et(N,N));};}(),dt=function(){var F=s(),V=s();return function(J,N,$,S,P,w){return u(F,N,P,w),u(V,$,S,w),u(J,F,V,2*w*(1-w)),J;};}(),B=function(){var F=n.create();return function(V,J,N,$){return F[0]=N[0],F[3]=N[1],F[6]=N[2],F[1]=$[0],F[4]=$[1],F[7]=$[2],F[2]=-J[0],F[5]=-J[1],F[8]=-J[2],et(V,I(V,F));};}();},/* 8 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"length",function(){return a;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"copy",function(){return o;}),t.d(r,"set",function(){return f;}),t.d(r,"add",function(){return v;}),t.d(r,"subtract",function(){return l;}),t.d(r,"multiply",function(){return p;}),t.d(r,"divide",function(){return y;}),t.d(r,"ceil",function(){return O;}),t.d(r,"floor",function(){return x;}),t.d(r,"min",function(){return m;}),t.d(r,"max",function(){return T;}),t.d(r,"round",function(){return c;}),t.d(r,"scale",function(){return d;}),t.d(r,"scaleAndAdd",function(){return u;}),t.d(r,"distance",function(){return g;}),t.d(r,"squaredDistance",function(){return M;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return I;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return E;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return R;}),t.d(r,"hermite",function(){return C;}),t.d(r,"bezier",function(){return W;}),t.d(r,"random",function(){return z;}),t.d(r,"transformMat4",function(){return H;}),t.d(r,"transformMat3",function(){return X;}),t.d(r,"transformQuat",function(){return Z;}),t.d(r,"rotateX",function(){return j;}),t.d(r,"rotateY",function(){return G;}),t.d(r,"rotateZ",function(){return Q;}),t.d(r,"angle",function(){return tt;}),t.d(r,"zero",function(){return et;}),t.d(r,"str",function(){return at;}),t.d(r,"exactEquals",function(){return q;}),t.d(r,"equals",function(){return pt;}),t.d(r,"sub",function(){return dt;}),t.d(r,"mul",function(){return B;}),t.d(r,"div",function(){return F;}),t.d(r,"dist",function(){return V;}),t.d(r,"sqrDist",function(){return J;}),t.d(r,"len",function(){return N;}),t.d(r,"sqrLen",function(){return $;}),t.d(r,"forEach",function(){return S;});var e=t(2);function n(){var P=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(P[0]=0,P[1]=0,P[2]=0),P;}function i(P){var w=new e.ARRAY_TYPE(3);return w[0]=P[0],w[1]=P[1],w[2]=P[2],w;}function a(P){var w=P[0],U=P[1],K=P[2];return Math.hypot(w,U,K);}function s(P,w,U){var K=new e.ARRAY_TYPE(3);return K[0]=P,K[1]=w,K[2]=U,K;}function o(P,w){return P[0]=w[0],P[1]=w[1],P[2]=w[2],P;}function f(P,w,U,K){return P[0]=w,P[1]=U,P[2]=K,P;}function v(P,w,U){return P[0]=w[0]+U[0],P[1]=w[1]+U[1],P[2]=w[2]+U[2],P;}function l(P,w,U){return P[0]=w[0]-U[0],P[1]=w[1]-U[1],P[2]=w[2]-U[2],P;}function p(P,w,U){return P[0]=w[0]*U[0],P[1]=w[1]*U[1],P[2]=w[2]*U[2],P;}function y(P,w,U){return P[0]=w[0]/U[0],P[1]=w[1]/U[1],P[2]=w[2]/U[2],P;}function O(P,w){return P[0]=Math.ceil(w[0]),P[1]=Math.ceil(w[1]),P[2]=Math.ceil(w[2]),P;}function x(P,w){return P[0]=Math.floor(w[0]),P[1]=Math.floor(w[1]),P[2]=Math.floor(w[2]),P;}function m(P,w,U){return P[0]=Math.min(w[0],U[0]),P[1]=Math.min(w[1],U[1]),P[2]=Math.min(w[2],U[2]),P;}function T(P,w,U){return P[0]=Math.max(w[0],U[0]),P[1]=Math.max(w[1],U[1]),P[2]=Math.max(w[2],U[2]),P;}function c(P,w){return P[0]=Math.round(w[0]),P[1]=Math.round(w[1]),P[2]=Math.round(w[2]),P;}function d(P,w,U){return P[0]=w[0]*U,P[1]=w[1]*U,P[2]=w[2]*U,P;}function u(P,w,U,K){return P[0]=w[0]+U[0]*K,P[1]=w[1]+U[1]*K,P[2]=w[2]+U[2]*K,P;}function g(P,w){var U=w[0]-P[0],K=w[1]-P[1],Y=w[2]-P[2];return Math.hypot(U,K,Y);}function M(P,w){var U=w[0]-P[0],K=w[1]-P[1],Y=w[2]-P[2];return U*U+K*K+Y*Y;}function A(P){var w=P[0],U=P[1],K=P[2];return w*w+U*U+K*K;}function I(P,w){return P[0]=-w[0],P[1]=-w[1],P[2]=-w[2],P;}function b(P,w){return P[0]=1/w[0],P[1]=1/w[1],P[2]=1/w[2],P;}function E(P,w){var U=w[0],K=w[1],Y=w[2],k=U*U+K*K+Y*Y;return k>0&&(k=1/Math.sqrt(k)),P[0]=w[0]*k,P[1]=w[1]*k,P[2]=w[2]*k,P;}function L(P,w){return P[0]*w[0]+P[1]*w[1]+P[2]*w[2];}function D(P,w,U){var K=w[0],Y=w[1],k=w[2],rt=U[0],it=U[1],lt=U[2];return P[0]=Y*lt-k*it,P[1]=k*rt-K*lt,P[2]=K*it-Y*rt,P;}function R(P,w,U,K){var Y=w[0],k=w[1],rt=w[2];return P[0]=Y+K*(U[0]-Y),P[1]=k+K*(U[1]-k),P[2]=rt+K*(U[2]-rt),P;}function C(P,w,U,K,Y,k){var rt=k*k,it=rt*(2*k-3)+1,lt=rt*(k-2)+k,ut=rt*(k-1),ot=rt*(3-2*k);return P[0]=w[0]*it+U[0]*lt+K[0]*ut+Y[0]*ot,P[1]=w[1]*it+U[1]*lt+K[1]*ut+Y[1]*ot,P[2]=w[2]*it+U[2]*lt+K[2]*ut+Y[2]*ot,P;}function W(P,w,U,K,Y,k){var rt=1-k,it=rt*rt,lt=k*k,ut=it*rt,ot=3*k*it,st=3*lt*rt,ft=lt*k;return P[0]=w[0]*ut+U[0]*ot+K[0]*st+Y[0]*ft,P[1]=w[1]*ut+U[1]*ot+K[1]*st+Y[1]*ft,P[2]=w[2]*ut+U[2]*ot+K[2]*st+Y[2]*ft,P;}function z(P,w){w=w||1;var U=e.RANDOM()*2*Math.PI,K=e.RANDOM()*2-1,Y=Math.sqrt(1-K*K)*w;return P[0]=Math.cos(U)*Y,P[1]=Math.sin(U)*Y,P[2]=K*w,P;}function H(P,w,U){var K=w[0],Y=w[1],k=w[2],rt=U[3]*K+U[7]*Y+U[11]*k+U[15];return rt=rt||1,P[0]=(U[0]*K+U[4]*Y+U[8]*k+U[12])/rt,P[1]=(U[1]*K+U[5]*Y+U[9]*k+U[13])/rt,P[2]=(U[2]*K+U[6]*Y+U[10]*k+U[14])/rt,P;}function X(P,w,U){var K=w[0],Y=w[1],k=w[2];return P[0]=K*U[0]+Y*U[3]+k*U[6],P[1]=K*U[1]+Y*U[4]+k*U[7],P[2]=K*U[2]+Y*U[5]+k*U[8],P;}function Z(P,w,U){var K=U[0],Y=U[1],k=U[2],rt=U[3],it=w[0],lt=w[1],ut=w[2],ot=Y*ut-k*lt,st=k*it-K*ut,ft=K*lt-Y*it,vt=Y*ft-k*st,mt=k*ot-K*ft,gt=K*st-Y*ot,St=rt*2;return ot*=St,st*=St,ft*=St,vt*=2,mt*=2,gt*=2,P[0]=it+ot+vt,P[1]=lt+st+mt,P[2]=ut+ft+gt,P;}function j(P,w,U,K){var Y=[],k=[];return Y[0]=w[0]-U[0],Y[1]=w[1]-U[1],Y[2]=w[2]-U[2],k[0]=Y[0],k[1]=Y[1]*Math.cos(K)-Y[2]*Math.sin(K),k[2]=Y[1]*Math.sin(K)+Y[2]*Math.cos(K),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function G(P,w,U,K){var Y=[],k=[];return Y[0]=w[0]-U[0],Y[1]=w[1]-U[1],Y[2]=w[2]-U[2],k[0]=Y[2]*Math.sin(K)+Y[0]*Math.cos(K),k[1]=Y[1],k[2]=Y[2]*Math.cos(K)-Y[0]*Math.sin(K),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function Q(P,w,U,K){var Y=[],k=[];return Y[0]=w[0]-U[0],Y[1]=w[1]-U[1],Y[2]=w[2]-U[2],k[0]=Y[0]*Math.cos(K)-Y[1]*Math.sin(K),k[1]=Y[0]*Math.sin(K)+Y[1]*Math.cos(K),k[2]=Y[2],P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function tt(P,w){var U=P[0],K=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2],lt=Math.sqrt(U*U+K*K+Y*Y),ut=Math.sqrt(k*k+rt*rt+it*it),ot=lt*ut,st=ot&&L(P,w)/ot;return Math.acos(Math.min(Math.max(st,-1),1));}function et(P){return P[0]=0,P[1]=0,P[2]=0,P;}function at(P){return"vec3("+P[0]+", "+P[1]+", "+P[2]+")";}function q(P,w){return P[0]===w[0]&&P[1]===w[1]&&P[2]===w[2];}function pt(P,w){var U=P[0],K=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2];return Math.abs(U-k)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(k))&&Math.abs(K-rt)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(rt))&&Math.abs(Y-it)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(it));}var dt=l,B=p,F=y,V=g,J=M,N=a,$=A,S=function(){var P=n();return function(w,U,K,Y,k,rt){var it,lt;for(U||(U=3),K||(K=0),Y?lt=Math.min(Y*U+K,w.length):lt=w.length,it=K;it<lt;it+=U)P[0]=w[it],P[1]=w[it+1],P[2]=w[it+2],k(P,P,rt),w[it]=P[0],w[it+1]=P[1],w[it+2]=P[2];return w;};}();},/* 9 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"fromValues",function(){return a;}),t.d(r,"copy",function(){return s;}),t.d(r,"set",function(){return o;}),t.d(r,"add",function(){return f;}),t.d(r,"subtract",function(){return v;}),t.d(r,"multiply",function(){return l;}),t.d(r,"divide",function(){return p;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return O;}),t.d(r,"min",function(){return x;}),t.d(r,"max",function(){return m;}),t.d(r,"round",function(){return T;}),t.d(r,"scale",function(){return c;}),t.d(r,"scaleAndAdd",function(){return d;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return g;}),t.d(r,"length",function(){return M;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return I;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return E;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return R;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat4",function(){return W;}),t.d(r,"transformQuat",function(){return z;}),t.d(r,"zero",function(){return H;}),t.d(r,"str",function(){return X;}),t.d(r,"exactEquals",function(){return Z;}),t.d(r,"equals",function(){return j;}),t.d(r,"sub",function(){return G;}),t.d(r,"mul",function(){return Q;}),t.d(r,"div",function(){return tt;}),t.d(r,"dist",function(){return et;}),t.d(r,"sqrDist",function(){return at;}),t.d(r,"len",function(){return q;}),t.d(r,"sqrLen",function(){return pt;}),t.d(r,"forEach",function(){return dt;});var e=t(2);function n(){var B=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(B[0]=0,B[1]=0,B[2]=0,B[3]=0),B;}function i(B){var F=new e.ARRAY_TYPE(4);return F[0]=B[0],F[1]=B[1],F[2]=B[2],F[3]=B[3],F;}function a(B,F,V,J){var N=new e.ARRAY_TYPE(4);return N[0]=B,N[1]=F,N[2]=V,N[3]=J,N;}function s(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B;}function o(B,F,V,J,N){return B[0]=F,B[1]=V,B[2]=J,B[3]=N,B;}function f(B,F,V){return B[0]=F[0]+V[0],B[1]=F[1]+V[1],B[2]=F[2]+V[2],B[3]=F[3]+V[3],B;}function v(B,F,V){return B[0]=F[0]-V[0],B[1]=F[1]-V[1],B[2]=F[2]-V[2],B[3]=F[3]-V[3],B;}function l(B,F,V){return B[0]=F[0]*V[0],B[1]=F[1]*V[1],B[2]=F[2]*V[2],B[3]=F[3]*V[3],B;}function p(B,F,V){return B[0]=F[0]/V[0],B[1]=F[1]/V[1],B[2]=F[2]/V[2],B[3]=F[3]/V[3],B;}function y(B,F){return B[0]=Math.ceil(F[0]),B[1]=Math.ceil(F[1]),B[2]=Math.ceil(F[2]),B[3]=Math.ceil(F[3]),B;}function O(B,F){return B[0]=Math.floor(F[0]),B[1]=Math.floor(F[1]),B[2]=Math.floor(F[2]),B[3]=Math.floor(F[3]),B;}function x(B,F,V){return B[0]=Math.min(F[0],V[0]),B[1]=Math.min(F[1],V[1]),B[2]=Math.min(F[2],V[2]),B[3]=Math.min(F[3],V[3]),B;}function m(B,F,V){return B[0]=Math.max(F[0],V[0]),B[1]=Math.max(F[1],V[1]),B[2]=Math.max(F[2],V[2]),B[3]=Math.max(F[3],V[3]),B;}function T(B,F){return B[0]=Math.round(F[0]),B[1]=Math.round(F[1]),B[2]=Math.round(F[2]),B[3]=Math.round(F[3]),B;}function c(B,F,V){return B[0]=F[0]*V,B[1]=F[1]*V,B[2]=F[2]*V,B[3]=F[3]*V,B;}function d(B,F,V,J){return B[0]=F[0]+V[0]*J,B[1]=F[1]+V[1]*J,B[2]=F[2]+V[2]*J,B[3]=F[3]+V[3]*J,B;}function u(B,F){var V=F[0]-B[0],J=F[1]-B[1],N=F[2]-B[2],$=F[3]-B[3];return Math.hypot(V,J,N,$);}function g(B,F){var V=F[0]-B[0],J=F[1]-B[1],N=F[2]-B[2],$=F[3]-B[3];return V*V+J*J+N*N+$*$;}function M(B){var F=B[0],V=B[1],J=B[2],N=B[3];return Math.hypot(F,V,J,N);}function A(B){var F=B[0],V=B[1],J=B[2],N=B[3];return F*F+V*V+J*J+N*N;}function I(B,F){return B[0]=-F[0],B[1]=-F[1],B[2]=-F[2],B[3]=-F[3],B;}function b(B,F){return B[0]=1/F[0],B[1]=1/F[1],B[2]=1/F[2],B[3]=1/F[3],B;}function E(B,F){var V=F[0],J=F[1],N=F[2],$=F[3],S=V*V+J*J+N*N+$*$;return S>0&&(S=1/Math.sqrt(S)),B[0]=V*S,B[1]=J*S,B[2]=N*S,B[3]=$*S,B;}function L(B,F){return B[0]*F[0]+B[1]*F[1]+B[2]*F[2]+B[3]*F[3];}function D(B,F,V,J){var N=V[0]*J[1]-V[1]*J[0],$=V[0]*J[2]-V[2]*J[0],S=V[0]*J[3]-V[3]*J[0],P=V[1]*J[2]-V[2]*J[1],w=V[1]*J[3]-V[3]*J[1],U=V[2]*J[3]-V[3]*J[2],K=F[0],Y=F[1],k=F[2],rt=F[3];return B[0]=Y*U-k*w+rt*P,B[1]=-(K*U)+k*S-rt*$,B[2]=K*w-Y*S+rt*N,B[3]=-(K*P)+Y*$-k*N,B;}function R(B,F,V,J){var N=F[0],$=F[1],S=F[2],P=F[3];return B[0]=N+J*(V[0]-N),B[1]=$+J*(V[1]-$),B[2]=S+J*(V[2]-S),B[3]=P+J*(V[3]-P),B;}function C(B,F){F=F||1;var V,J,N,$,S,P;do V=e.RANDOM()*2-1,J=e.RANDOM()*2-1,S=V*V+J*J;while(S>=1);do N=e.RANDOM()*2-1,$=e.RANDOM()*2-1,P=N*N+$*$;while(P>=1);var w=Math.sqrt((1-S)/P);return B[0]=F*V,B[1]=F*J,B[2]=F*N*w,B[3]=F*$*w,B;}function W(B,F,V){var J=F[0],N=F[1],$=F[2],S=F[3];return B[0]=V[0]*J+V[4]*N+V[8]*$+V[12]*S,B[1]=V[1]*J+V[5]*N+V[9]*$+V[13]*S,B[2]=V[2]*J+V[6]*N+V[10]*$+V[14]*S,B[3]=V[3]*J+V[7]*N+V[11]*$+V[15]*S,B;}function z(B,F,V){var J=F[0],N=F[1],$=F[2],S=V[0],P=V[1],w=V[2],U=V[3],K=U*J+P*$-w*N,Y=U*N+w*J-S*$,k=U*$+S*N-P*J,rt=-S*J-P*N-w*$;return B[0]=K*U+rt*-S+Y*-w-k*-P,B[1]=Y*U+rt*-P+k*-S-K*-w,B[2]=k*U+rt*-w+K*-P-Y*-S,B[3]=F[3],B;}function H(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=0,B;}function X(B){return"vec4("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+")";}function Z(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3];}function j(B,F){var V=B[0],J=B[1],N=B[2],$=B[3],S=F[0],P=F[1],w=F[2],U=F[3];return Math.abs(V-S)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(S))&&Math.abs(J-P)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(P))&&Math.abs(N-w)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(w))&&Math.abs($-U)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(U));}var G=v,Q=l,tt=p,et=u,at=g,q=M,pt=A,dt=function(){var B=n();return function(F,V,J,N,$,S){var P,w;for(V||(V=4),J||(J=0),N?w=Math.min(N*V+J,F.length):w=F.length,P=J;P<w;P+=V)B[0]=F[P],B[1]=F[P+1],B[2]=F[P+2],B[3]=F[P+3],$(B,B,S),F[P]=B[0],F[P+1]=B[1],F[P+2]=B[2],F[P+3]=B[3];return F;};}();},/* 10 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return a;}),t.d(r,"clone",function(){return s;}),t.d(r,"fromValues",function(){return o;}),t.d(r,"fromRotationTranslationValues",function(){return f;}),t.d(r,"fromRotationTranslation",function(){return v;}),t.d(r,"fromTranslation",function(){return l;}),t.d(r,"fromRotation",function(){return p;}),t.d(r,"fromMat4",function(){return y;}),t.d(r,"copy",function(){return O;}),t.d(r,"identity",function(){return x;}),t.d(r,"set",function(){return m;}),t.d(r,"getReal",function(){return T;}),t.d(r,"getDual",function(){return c;}),t.d(r,"setReal",function(){return d;}),t.d(r,"setDual",function(){return u;}),t.d(r,"getTranslation",function(){return g;}),t.d(r,"translate",function(){return M;}),t.d(r,"rotateX",function(){return A;}),t.d(r,"rotateY",function(){return I;}),t.d(r,"rotateZ",function(){return b;}),t.d(r,"rotateByQuatAppend",function(){return E;}),t.d(r,"rotateByQuatPrepend",function(){return L;}),t.d(r,"rotateAroundAxis",function(){return D;}),t.d(r,"add",function(){return R;}),t.d(r,"multiply",function(){return C;}),t.d(r,"mul",function(){return W;}),t.d(r,"scale",function(){return z;}),t.d(r,"dot",function(){return H;}),t.d(r,"lerp",function(){return X;}),t.d(r,"invert",function(){return Z;}),t.d(r,"conjugate",function(){return j;}),t.d(r,"length",function(){return G;}),t.d(r,"len",function(){return Q;}),t.d(r,"squaredLength",function(){return tt;}),t.d(r,"sqrLen",function(){return et;}),t.d(r,"normalize",function(){return at;}),t.d(r,"str",function(){return q;}),t.d(r,"exactEquals",function(){return pt;}),t.d(r,"equals",function(){return dt;});var e=t(2),n=t(7),i=t(6);function a(){var B=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(B[0]=0,B[1]=0,B[2]=0,B[4]=0,B[5]=0,B[6]=0,B[7]=0),B[3]=1,B;}function s(B){var F=new e.ARRAY_TYPE(8);return F[0]=B[0],F[1]=B[1],F[2]=B[2],F[3]=B[3],F[4]=B[4],F[5]=B[5],F[6]=B[6],F[7]=B[7],F;}function o(B,F,V,J,N,$,S,P){var w=new e.ARRAY_TYPE(8);return w[0]=B,w[1]=F,w[2]=V,w[3]=J,w[4]=N,w[5]=$,w[6]=S,w[7]=P,w;}function f(B,F,V,J,N,$,S){var P=new e.ARRAY_TYPE(8);P[0]=B,P[1]=F,P[2]=V,P[3]=J;var w=N*0.5,U=$*0.5,K=S*0.5;return P[4]=w*J+U*V-K*F,P[5]=U*J+K*B-w*V,P[6]=K*J+w*F-U*B,P[7]=-w*B-U*F-K*V,P;}function v(B,F,V){var J=V[0]*0.5,N=V[1]*0.5,$=V[2]*0.5,S=F[0],P=F[1],w=F[2],U=F[3];return B[0]=S,B[1]=P,B[2]=w,B[3]=U,B[4]=J*U+N*w-$*P,B[5]=N*U+$*S-J*w,B[6]=$*U+J*P-N*S,B[7]=-J*S-N*P-$*w,B;}function l(B,F){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=F[0]*0.5,B[5]=F[1]*0.5,B[6]=F[2]*0.5,B[7]=0,B;}function p(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B[4]=0,B[5]=0,B[6]=0,B[7]=0,B;}function y(B,F){var V=n.create();i.getRotation(V,F);var J=new e.ARRAY_TYPE(3);return i.getTranslation(J,F),v(B,V,J),B;}function O(B,F){return B[0]=F[0],B[1]=F[1],B[2]=F[2],B[3]=F[3],B[4]=F[4],B[5]=F[5],B[6]=F[6],B[7]=F[7],B;}function x(B){return B[0]=0,B[1]=0,B[2]=0,B[3]=1,B[4]=0,B[5]=0,B[6]=0,B[7]=0,B;}function m(B,F,V,J,N,$,S,P,w){return B[0]=F,B[1]=V,B[2]=J,B[3]=N,B[4]=$,B[5]=S,B[6]=P,B[7]=w,B;}var T=n.copy;function c(B,F){return B[0]=F[4],B[1]=F[5],B[2]=F[6],B[3]=F[7],B;}var d=n.copy;function u(B,F){return B[4]=F[0],B[5]=F[1],B[6]=F[2],B[7]=F[3],B;}function g(B,F){var V=F[4],J=F[5],N=F[6],$=F[7],S=-F[0],P=-F[1],w=-F[2],U=F[3];return B[0]=(V*U+$*S+J*w-N*P)*2,B[1]=(J*U+$*P+N*S-V*w)*2,B[2]=(N*U+$*w+V*P-J*S)*2,B;}function M(B,F,V){var J=F[0],N=F[1],$=F[2],S=F[3],P=V[0]*0.5,w=V[1]*0.5,U=V[2]*0.5,K=F[4],Y=F[5],k=F[6],rt=F[7];return B[0]=J,B[1]=N,B[2]=$,B[3]=S,B[4]=S*P+N*U-$*w+K,B[5]=S*w+$*P-J*U+Y,B[6]=S*U+J*w-N*P+k,B[7]=-J*P-N*w-$*U+rt,B;}function A(B,F,V){var J=-F[0],N=-F[1],$=-F[2],S=F[3],P=F[4],w=F[5],U=F[6],K=F[7],Y=P*S+K*J+w*$-U*N,k=w*S+K*N+U*J-P*$,rt=U*S+K*$+P*N-w*J,it=K*S-P*J-w*N-U*$;return n.rotateX(B,F,V),J=B[0],N=B[1],$=B[2],S=B[3],B[4]=Y*S+it*J+k*$-rt*N,B[5]=k*S+it*N+rt*J-Y*$,B[6]=rt*S+it*$+Y*N-k*J,B[7]=it*S-Y*J-k*N-rt*$,B;}function I(B,F,V){var J=-F[0],N=-F[1],$=-F[2],S=F[3],P=F[4],w=F[5],U=F[6],K=F[7],Y=P*S+K*J+w*$-U*N,k=w*S+K*N+U*J-P*$,rt=U*S+K*$+P*N-w*J,it=K*S-P*J-w*N-U*$;return n.rotateY(B,F,V),J=B[0],N=B[1],$=B[2],S=B[3],B[4]=Y*S+it*J+k*$-rt*N,B[5]=k*S+it*N+rt*J-Y*$,B[6]=rt*S+it*$+Y*N-k*J,B[7]=it*S-Y*J-k*N-rt*$,B;}function b(B,F,V){var J=-F[0],N=-F[1],$=-F[2],S=F[3],P=F[4],w=F[5],U=F[6],K=F[7],Y=P*S+K*J+w*$-U*N,k=w*S+K*N+U*J-P*$,rt=U*S+K*$+P*N-w*J,it=K*S-P*J-w*N-U*$;return n.rotateZ(B,F,V),J=B[0],N=B[1],$=B[2],S=B[3],B[4]=Y*S+it*J+k*$-rt*N,B[5]=k*S+it*N+rt*J-Y*$,B[6]=rt*S+it*$+Y*N-k*J,B[7]=it*S-Y*J-k*N-rt*$,B;}function E(B,F,V){var J=V[0],N=V[1],$=V[2],S=V[3],P=F[0],w=F[1],U=F[2],K=F[3];return B[0]=P*S+K*J+w*$-U*N,B[1]=w*S+K*N+U*J-P*$,B[2]=U*S+K*$+P*N-w*J,B[3]=K*S-P*J-w*N-U*$,P=F[4],w=F[5],U=F[6],K=F[7],B[4]=P*S+K*J+w*$-U*N,B[5]=w*S+K*N+U*J-P*$,B[6]=U*S+K*$+P*N-w*J,B[7]=K*S-P*J-w*N-U*$,B;}function L(B,F,V){var J=F[0],N=F[1],$=F[2],S=F[3],P=V[0],w=V[1],U=V[2],K=V[3];return B[0]=J*K+S*P+N*U-$*w,B[1]=N*K+S*w+$*P-J*U,B[2]=$*K+S*U+J*w-N*P,B[3]=S*K-J*P-N*w-$*U,P=V[4],w=V[5],U=V[6],K=V[7],B[4]=J*K+S*P+N*U-$*w,B[5]=N*K+S*w+$*P-J*U,B[6]=$*K+S*U+J*w-N*P,B[7]=S*K-J*P-N*w-$*U,B;}function D(B,F,V,J){if(Math.abs(J)<e.EPSILON)return O(B,F);var N=Math.hypot(V[0],V[1],V[2]);J=J*0.5;var $=Math.sin(J),S=$*V[0]/N,P=$*V[1]/N,w=$*V[2]/N,U=Math.cos(J),K=F[0],Y=F[1],k=F[2],rt=F[3];B[0]=K*U+rt*S+Y*w-k*P,B[1]=Y*U+rt*P+k*S-K*w,B[2]=k*U+rt*w+K*P-Y*S,B[3]=rt*U-K*S-Y*P-k*w;var it=F[4],lt=F[5],ut=F[6],ot=F[7];return B[4]=it*U+ot*S+lt*w-ut*P,B[5]=lt*U+ot*P+ut*S-it*w,B[6]=ut*U+ot*w+it*P-lt*S,B[7]=ot*U-it*S-lt*P-ut*w,B;}function R(B,F,V){return B[0]=F[0]+V[0],B[1]=F[1]+V[1],B[2]=F[2]+V[2],B[3]=F[3]+V[3],B[4]=F[4]+V[4],B[5]=F[5]+V[5],B[6]=F[6]+V[6],B[7]=F[7]+V[7],B;}function C(B,F,V){var J=F[0],N=F[1],$=F[2],S=F[3],P=V[4],w=V[5],U=V[6],K=V[7],Y=F[4],k=F[5],rt=F[6],it=F[7],lt=V[0],ut=V[1],ot=V[2],st=V[3];return B[0]=J*st+S*lt+N*ot-$*ut,B[1]=N*st+S*ut+$*lt-J*ot,B[2]=$*st+S*ot+J*ut-N*lt,B[3]=S*st-J*lt-N*ut-$*ot,B[4]=J*K+S*P+N*U-$*w+Y*st+it*lt+k*ot-rt*ut,B[5]=N*K+S*w+$*P-J*U+k*st+it*ut+rt*lt-Y*ot,B[6]=$*K+S*U+J*w-N*P+rt*st+it*ot+Y*ut-k*lt,B[7]=S*K-J*P-N*w-$*U+it*st-Y*lt-k*ut-rt*ot,B;}var W=C;function z(B,F,V){return B[0]=F[0]*V,B[1]=F[1]*V,B[2]=F[2]*V,B[3]=F[3]*V,B[4]=F[4]*V,B[5]=F[5]*V,B[6]=F[6]*V,B[7]=F[7]*V,B;}var H=n.dot;function X(B,F,V,J){var N=1-J;return H(F,V)<0&&(J=-J),B[0]=F[0]*N+V[0]*J,B[1]=F[1]*N+V[1]*J,B[2]=F[2]*N+V[2]*J,B[3]=F[3]*N+V[3]*J,B[4]=F[4]*N+V[4]*J,B[5]=F[5]*N+V[5]*J,B[6]=F[6]*N+V[6]*J,B[7]=F[7]*N+V[7]*J,B;}function Z(B,F){var V=tt(F);return B[0]=-F[0]/V,B[1]=-F[1]/V,B[2]=-F[2]/V,B[3]=F[3]/V,B[4]=-F[4]/V,B[5]=-F[5]/V,B[6]=-F[6]/V,B[7]=F[7]/V,B;}function j(B,F){return B[0]=-F[0],B[1]=-F[1],B[2]=-F[2],B[3]=F[3],B[4]=-F[4],B[5]=-F[5],B[6]=-F[6],B[7]=F[7],B;}var G=n.length,Q=G,tt=n.squaredLength,et=tt;function at(B,F){var V=tt(F);if(V>0){V=Math.sqrt(V);var J=F[0]/V,N=F[1]/V,$=F[2]/V,S=F[3]/V,P=F[4],w=F[5],U=F[6],K=F[7],Y=J*P+N*w+$*U+S*K;B[0]=J,B[1]=N,B[2]=$,B[3]=S,B[4]=(P-J*Y)/V,B[5]=(w-N*Y)/V,B[6]=(U-$*Y)/V,B[7]=(K-S*Y)/V;}return B;}function q(B){return"quat2("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+", "+B[6]+", "+B[7]+")";}function pt(B,F){return B[0]===F[0]&&B[1]===F[1]&&B[2]===F[2]&&B[3]===F[3]&&B[4]===F[4]&&B[5]===F[5]&&B[6]===F[6]&&B[7]===F[7];}function dt(B,F){var V=B[0],J=B[1],N=B[2],$=B[3],S=B[4],P=B[5],w=B[6],U=B[7],K=F[0],Y=F[1],k=F[2],rt=F[3],it=F[4],lt=F[5],ut=F[6],ot=F[7];return Math.abs(V-K)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(K))&&Math.abs(J-Y)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(Y))&&Math.abs(N-k)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(k))&&Math.abs($-rt)<=e.EPSILON*Math.max(1,Math.abs($),Math.abs(rt))&&Math.abs(S-it)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(it))&&Math.abs(P-lt)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(lt))&&Math.abs(w-ut)<=e.EPSILON*Math.max(1,Math.abs(w),Math.abs(ut))&&Math.abs(U-ot)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(ot));}},/* 11 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return n;}),t.d(r,"clone",function(){return i;}),t.d(r,"fromValues",function(){return a;}),t.d(r,"copy",function(){return s;}),t.d(r,"set",function(){return o;}),t.d(r,"add",function(){return f;}),t.d(r,"subtract",function(){return v;}),t.d(r,"multiply",function(){return l;}),t.d(r,"divide",function(){return p;}),t.d(r,"ceil",function(){return y;}),t.d(r,"floor",function(){return O;}),t.d(r,"min",function(){return x;}),t.d(r,"max",function(){return m;}),t.d(r,"round",function(){return T;}),t.d(r,"scale",function(){return c;}),t.d(r,"scaleAndAdd",function(){return d;}),t.d(r,"distance",function(){return u;}),t.d(r,"squaredDistance",function(){return g;}),t.d(r,"length",function(){return M;}),t.d(r,"squaredLength",function(){return A;}),t.d(r,"negate",function(){return I;}),t.d(r,"inverse",function(){return b;}),t.d(r,"normalize",function(){return E;}),t.d(r,"dot",function(){return L;}),t.d(r,"cross",function(){return D;}),t.d(r,"lerp",function(){return R;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat2",function(){return W;}),t.d(r,"transformMat2d",function(){return z;}),t.d(r,"transformMat3",function(){return H;}),t.d(r,"transformMat4",function(){return X;}),t.d(r,"rotate",function(){return Z;}),t.d(r,"angle",function(){return j;}),t.d(r,"zero",function(){return G;}),t.d(r,"str",function(){return Q;}),t.d(r,"exactEquals",function(){return tt;}),t.d(r,"equals",function(){return et;}),t.d(r,"len",function(){return at;}),t.d(r,"sub",function(){return q;}),t.d(r,"mul",function(){return pt;}),t.d(r,"div",function(){return dt;}),t.d(r,"dist",function(){return B;}),t.d(r,"sqrDist",function(){return F;}),t.d(r,"sqrLen",function(){return V;}),t.d(r,"forEach",function(){return J;});var e=t(2);function n(){var N=new e.ARRAY_TYPE(2);return e.ARRAY_TYPE!=Float32Array&&(N[0]=0,N[1]=0),N;}function i(N){var $=new e.ARRAY_TYPE(2);return $[0]=N[0],$[1]=N[1],$;}function a(N,$){var S=new e.ARRAY_TYPE(2);return S[0]=N,S[1]=$,S;}function s(N,$){return N[0]=$[0],N[1]=$[1],N;}function o(N,$,S){return N[0]=$,N[1]=S,N;}function f(N,$,S){return N[0]=$[0]+S[0],N[1]=$[1]+S[1],N;}function v(N,$,S){return N[0]=$[0]-S[0],N[1]=$[1]-S[1],N;}function l(N,$,S){return N[0]=$[0]*S[0],N[1]=$[1]*S[1],N;}function p(N,$,S){return N[0]=$[0]/S[0],N[1]=$[1]/S[1],N;}function y(N,$){return N[0]=Math.ceil($[0]),N[1]=Math.ceil($[1]),N;}function O(N,$){return N[0]=Math.floor($[0]),N[1]=Math.floor($[1]),N;}function x(N,$,S){return N[0]=Math.min($[0],S[0]),N[1]=Math.min($[1],S[1]),N;}function m(N,$,S){return N[0]=Math.max($[0],S[0]),N[1]=Math.max($[1],S[1]),N;}function T(N,$){return N[0]=Math.round($[0]),N[1]=Math.round($[1]),N;}function c(N,$,S){return N[0]=$[0]*S,N[1]=$[1]*S,N;}function d(N,$,S,P){return N[0]=$[0]+S[0]*P,N[1]=$[1]+S[1]*P,N;}function u(N,$){var S=$[0]-N[0],P=$[1]-N[1];return Math.hypot(S,P);}function g(N,$){var S=$[0]-N[0],P=$[1]-N[1];return S*S+P*P;}function M(N){var $=N[0],S=N[1];return Math.hypot($,S);}function A(N){var $=N[0],S=N[1];return $*$+S*S;}function I(N,$){return N[0]=-$[0],N[1]=-$[1],N;}function b(N,$){return N[0]=1/$[0],N[1]=1/$[1],N;}function E(N,$){var S=$[0],P=$[1],w=S*S+P*P;return w>0&&(w=1/Math.sqrt(w)),N[0]=$[0]*w,N[1]=$[1]*w,N;}function L(N,$){return N[0]*$[0]+N[1]*$[1];}function D(N,$,S){var P=$[0]*S[1]-$[1]*S[0];return N[0]=N[1]=0,N[2]=P,N;}function R(N,$,S,P){var w=$[0],U=$[1];return N[0]=w+P*(S[0]-w),N[1]=U+P*(S[1]-U),N;}function C(N,$){$=$||1;var S=e.RANDOM()*2*Math.PI;return N[0]=Math.cos(S)*$,N[1]=Math.sin(S)*$,N;}function W(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[2]*w,N[1]=S[1]*P+S[3]*w,N;}function z(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[2]*w+S[4],N[1]=S[1]*P+S[3]*w+S[5],N;}function H(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[3]*w+S[6],N[1]=S[1]*P+S[4]*w+S[7],N;}function X(N,$,S){var P=$[0],w=$[1];return N[0]=S[0]*P+S[4]*w+S[12],N[1]=S[1]*P+S[5]*w+S[13],N;}function Z(N,$,S,P){var w=$[0]-S[0],U=$[1]-S[1],K=Math.sin(P),Y=Math.cos(P);return N[0]=w*Y-U*K+S[0],N[1]=w*K+U*Y+S[1],N;}function j(N,$){var S=N[0],P=N[1],w=$[0],U=$[1],K=Math.sqrt(S*S+P*P)*Math.sqrt(w*w+U*U),Y=K&&(S*w+P*U)/K;return Math.acos(Math.min(Math.max(Y,-1),1));}function G(N){return N[0]=0,N[1]=0,N;}function Q(N){return"vec2("+N[0]+", "+N[1]+")";}function tt(N,$){return N[0]===$[0]&&N[1]===$[1];}function et(N,$){var S=N[0],P=N[1],w=$[0],U=$[1];return Math.abs(S-w)<=e.EPSILON*Math.max(1,Math.abs(S),Math.abs(w))&&Math.abs(P-U)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(U));}var at=M,q=v,pt=l,dt=p,B=u,F=g,V=A,J=function(){var N=n();return function($,S,P,w,U,K){var Y,k;for(S||(S=2),P||(P=0),w?k=Math.min(w*S+P,$.length):k=$.length,Y=P;Y<k;Y+=S)N[0]=$[Y],N[1]=$[Y+1],U(N,N,K),$[Y]=N[0],$[Y+1]=N[1];return $;};}();},/* 12 */ /***/function(h,r,t){t.r(r);var e=t(13);t.d(r,"Renderer",function(){return e["default"];});var n=t(40);t.d(r,"Figure2D",function(){return n["default"];});var i=t(56);t.d(r,"Mesh2D",function(){return i["default"];});var a=t(29);t.d(r,"MeshCloud",function(){return a["default"];});var s=t(23);t.d(r,"parseFont",function(){return s["default"];});var o=t(31);t.d(r,"parseColor",function(){return o["default"];});var f=t(21);t.d(r,"ENV",function(){return f["default"];}),t(1).glMatrix.setMatrixArrayType(Array);},/* 13 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return b;});var e=t(14),n=t(1),i=t(20),a=t(27),s=t(25),o=t(40),f=t(56),v=t(29),l=t(59),p=t(21),y=t(63);t(1).glMatrix.setMatrixArrayType(Array);var O={autoUpdate:!1,// premultipliedAlpha: true,
|
|
36
|
+
preserveDrawingBuffer:!1,// depth: false,
|
|
37
|
+
// antialias: false,
|
|
38
|
+
bufferSize:1500},x="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",m="precision mediump float;\nvarying vec3 vTextureCoord;\nuniform sampler2D u_texSampler;\nvoid main() {\n gl_FragColor = texture2D(u_texSampler, vTextureCoord.xy);\n}\n",T=Symbol("glRenderer"),c=Symbol("canvasRenderer"),d=Symbol("options"),u=Symbol("globalTransform"),g=Symbol("applyGlobalTransform"),M=Symbol("canvas");function A(E){var L=E.gl,D=E.fbo;D&&L.bindFramebuffer(L.FRAMEBUFFER,D),E._draw(),D&&L.bindFramebuffer(L.FRAMEBUFFER,null);}function I(E,L,D,R){var C=E.createTexture(L.canvas),W=[[[0,0],[D,0],[D,R],[0,R],[0,0]]];W.closed=!0;var z=new f["default"]({contours:W});z.setTexture(C),E.setMeshData([z.meshData]),A(E),C["delete"](),L.clearRect(0,0,D,R),delete L._filter;}var b=/*#__PURE__*/function(){function b(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,b);var R=D.contextType;if(R||(typeof WebGL2RenderingContext=="function"?R="webgl2":typeof WebGLRenderingContext=="function"?R="webgl":R="2d"),!L.getContext){var C=L;L={getContext:function getContext(){return C;},width:D.width,height:D.height},C.canvas=L,R="2d";}if(this[M]=L,R!=="webgl"&&R!=="webgl2"&&R!=="2d")throw new Error("Unknown context type ".concat(R));if(D.contextType=R,this[d]=Object.assign({},O,D),R==="webgl"||R==="webgl2"){R==="webgl2"&&(this[d].webgl2=!0);var _C=new e["default"](L,this[d]);R==="webgl2"&&!_C.isWebGL2&&(D.contextType="webgl"),Object(y.createShaders)(_C),Object(y.applyShader)(_C),Object(y.createCloudShaders)(_C);var W=_C.gl;W.clearColor(0,0,0,0),W.blendFuncSeparate(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA,W.ONE,W.ONE_MINUS_SRC_ALPHA),this[T]=_C;}else this[c]=new i["default"](L,this[d]);this[u]=[1,0,0,0,1,0,0,0,1],this.updateResolution();}return _createClass(b,[{key:"canvas",get:function get(){return this[M];}},{key:"canvasRenderer",get:function get(){return this[c];}},{key:"glRenderer",get:function get(){return this[T];}},{key:"isWebGL2",get:function get(){return this[T]&&this[T].isWebGL2;}},{key:"options",get:function get(){return this[d];}},{key:"globalTransformMatrix",get:function get(){var L=this[u];return[L[0],L[1],L[3],L[4],L[6],L[7]];}},{key:"viewMatrix",get:function get(){return this[u];}},{key:g,value:function value(){var L=this[T]||this[c];if(this[T]){var _this$canvas=this.canvas,D=_this$canvas.width,R=_this$canvas.height;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[D,R];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,L=_this$canvas2.width,D=_this$canvas2.height,R=[// translation
|
|
39
|
+
1,0,0,0,1,0,-L/2,-D/2,1],C=[// scale
|
|
40
|
+
2/L,0,0,0,-2/D,0,0,0,1],W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,R);this.projectionMatrix=W,this[T]&&this[T].gl.viewport(0,0,L,D);}},{key:"createTexture",value:function createTexture(L,D){return(this[T]||this[c]).createTexture(L,D);}/* async */},{key:"loadTexture",value:function loadTexture(L){var _ref3=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref3$useImageBitmap=_ref3.useImageBitmap,D=_ref3$useImageBitmap===void 0?!1:_ref3$useImageBitmap;return(this[T]||this[c]).loadTexture(L,{useImageBitmap:D});}},{key:"createText",value:function createText(L){var _ref4=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref4$font=_ref4.font,D=_ref4$font===void 0?"16px arial":_ref4$font,_ref4$fillColor=_ref4.fillColor,R=_ref4$fillColor===void 0?null:_ref4$fillColor,_ref4$strokeColor=_ref4.strokeColor,C=_ref4$strokeColor===void 0?null:_ref4$strokeColor,_ref4$strokeWidth=_ref4.strokeWidth,W=_ref4$strokeWidth===void 0?1:_ref4$strokeWidth;if(this[T]){var z=p["default"].createText(L,{font:D,fillColor:R,strokeColor:C,strokeWidth:W});return{image:this.createTexture(z.image),rect:z.rect};}return{_img:{font:D,fillColor:R,strokeColor:C,strokeWidth:W,text:L}};}},{key:"createProgram",value:function createProgram(){var _ref5=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},L=_ref5.vertex,D=_ref5.fragment,R=_ref5.options;if(this[T]){var C=this[T].compileSync(D,L);return C._attribOpts=R,C;}throw new Error("Context 2D cannot create webgl program.");}},{key:"createPassProgram",value:function createPassProgram(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref6$vertex=_ref6.vertex,L=_ref6$vertex===void 0?x:_ref6$vertex,_ref6$fragment=_ref6.fragment,D=_ref6$fragment===void 0?m:_ref6$fragment,R=_ref6.options;return this.createProgram({vertex:L,fragment:D,options:R});}},{key:"useProgram",value:function useProgram(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[T]){var R=Object.assign({},L._attribOpts,D);return this[T].useProgram(L,R);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(L){return(this[T]||this[c]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$c;if(this[T]){var D=this[T].gl;D.clear(D.COLOR_BUFFER_BIT);}else(_this$c=this[c]).clear.apply(_this$c,arguments);}},{key:"drawMeshCloud",value:function drawMeshCloud(L){var _ref7=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref7$clear=_ref7.clear,D=_ref7$clear===void 0?!1:_ref7$clear,_ref7$program=_ref7.program,R=_ref7$program===void 0?null:_ref7$program;var C=this[T]||this[c],W=R||L.program;if(this[T]){var z=C.gl;if(D&&z.clear(z.COLOR_BUFFER_BIT),W)C.program!==W&&this.useProgram(W,{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 H=L.mesh.meshData,X=!!H.uniforms.u_texSampler,Z=!!H.uniforms.u_filterFlag,j=!!H.uniforms.u_radialGradientVector,G=L.hasCloudColor,Q=L.hasCloudFilter,tt=!!H.uniforms.u_clipSampler;Object(y.applyCloudShader)(C,{hasTexture:X,hasFilter:Z,hasGradient:j,hasCloudColor:G,hasCloudFilter:Q,hasClipPath:tt});}this[g](),C.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(z,L),A(C),L.afterRender&&L.afterRender(z,L);}else C.setTransform(this.globalTransformMatrix),C.drawMeshCloud(L,{clear:D,hook:!1});}},{key:"drawMeshes",value:function drawMeshes(L){var _this3=this;var _ref8=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref8$clear=_ref8.clear,D=_ref8$clear===void 0?!1:_ref8$clear,_ref8$program=_ref8.program,R=_ref8$program===void 0?null:_ref8$program;var C=this[T]||this[c];if(this[T]){var W=C.fbo,z=Object(a["default"])(this,L,R==null),H=C.gl;D&&H.clear(H.COLOR_BUFFER_BIT);var X=!Object(l.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator=_createForOfIteratorHelper(z),_step;try{var _loop=function _loop(){var Z=_step.value;_this3._drawCalls++;var j=R||Z.program;if(Z instanceof v["default"])_this3.drawMeshCloud(Z,{clear:D,program:j});else{var _this3$canvas=_this3.canvas,G=_this3$canvas.width,Q=_this3$canvas.height;if(Z.beforeRender&&Z.beforeRender(H,Z),Z.pass.length&&((!_this3.fbo||_this3.fbo.width!==G||_this3.fbo.height!==Q)&&(_this3.fbo={width:G,height:Q,target:C.createFBO(),buffer:C.createFBO(),swap:function swap(){var _ref9=[this.buffer,this.target];this.target=_ref9[0];this.buffer=_ref9[1];}}),C.bindFBO(_this3.fbo.target)),!j&&Z.filterCanvas){Object(y.applyShader)(C,{hasTexture:!0});var tt=_this3.filterContext;tt||(tt=p["default"].createCanvas(G,Q).getContext("2d"),_this3.filterContext=tt);var et=L[Z.packIndex],at=et.filter,q=L[Z.packIndex+1],pt=L[Z.packIndex-1];(!pt||!pt.filterCanvas||pt.filter!==at)&&(!q||!q.filterCanvas||q.filter!==at)?(X?(tt.save(),Object(s.drawMesh2D)(et,tt,!1),tt.restore(),Object(s.applyFilter)(tt,at)):Object(s.drawMesh2D)(et,tt,!0),_this3[g](),I(C,tt,G,Q)):(X&&tt.save(),Object(s.drawMesh2D)(et,tt,!1),X&&tt.restore(),(!q||!q.filterCanvas||et.filter!==q.filter)&&(Object(s.applyFilter)(tt,at),_this3[g](),I(C,tt,G,Q)));}else{if(j)C.program!==j&&_this3.useProgram(j,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _tt=!!Z.uniforms.u_texSampler,_et=!!Z.uniforms.u_filterFlag,_at=!!Z.uniforms.u_radialGradientVector,_q=!!Z.uniforms.u_clipSampler;Object(y.applyShader)(C,{hasTexture:_tt,hasFilter:_et,hasGradient:_at,hasClipPath:_q});}Z.filterCanvas&&console.warn("User program ignored some filter effects."),_this3[g](),C.setMeshData([Z]),A(C);}if(Z.pass.length){var _tt2=Z.pass.length;Z.pass.forEach(function(et,at){et.blend=Z.enableBlend,et.setTexture(C.fbo.texture),at===_tt2-1?C.bindFBO(W):(_this3.fbo.swap(),C.bindFBO(_this3.fbo.target)),et.program?C.useProgram(et.program):(_this3.defaultPassProgram=_this3.defaultPassProgram||_this3.createPassProgram(),C.useProgram(_this3.defaultPassProgram)),C.setMeshData([et.meshData]),H.clear(H.COLOR_BUFFER_BIT),A(C);});}Z.afterRender&&Z.afterRender(H,Z);}};for(_iterator.s();!(_step=_iterator.n()).done;){_loop();}}catch(err){_iterator.e(err);}finally{_iterator.f();}}else C.setTransform(this.globalTransformMatrix),C.drawMeshes(L,{clear:D});}},{key:"drawImage",value:function drawImage(L){for(var _len=arguments.length,D=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){D[_key-1]=arguments[_key];}var R=D.length;if(R<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(D.length+1," present."));if(R!==2&&R!==4&&R!==8)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': Valid arities are: [3, 5, 9], but ".concat(D.length+1," arguments provided."));var C=null,W=null;R===2?C=[D[0],D[1],L.width,L.height]:R===4?C=D:R===8&&(W=D.slice(0,4),C=D.slice(4));var z=this.createTexture(L),_this$canvas3=this.canvas,H=_this$canvas3.width,X=_this$canvas3.height,Z=new o["default"]();Z.rect(C[0],C[1],H,X);var j=new f["default"](Z,{width:H,height:X});j.setTexture(z,{rect:C,srcRect:W}),this.drawMeshes([j]),this.deleteTexture(z);}},{key:"setGlobalTransform",value:function setGlobalTransform(){return this[u]=[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 D=this[u];for(var _len2=arguments.length,L=new Array(_len2),_key2=0;_key2<_len2;_key2++){L[_key2]=arguments[_key2];}return this[u]=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),D,L),this;}},{key:"globalTranslate",value:function globalTranslate(L,D){var R=n.mat3.create();return R=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),R,[L,D]),this.globalTransform.apply(this,_toConsumableArray(R));}},{key:"globalRotate",value:function globalRotate(L){var _ref10=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref11=_slicedToArray(_ref10,2),D=_ref11[0],R=_ref11[1];var C=n.mat3.create();return C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[D,R]),C=n.mat3.rotate(Array.of(0,0,0,0,0,0,0,0,0),C,L),C=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),C,[-D,-R]),this.globalTransform.apply(this,_toConsumableArray(C));}},{key:"globalScale",value:function globalScale(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref12=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref13=_slicedToArray(_ref12,2),R=_ref13[0],C=_ref13[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[R,C]),W=n.mat3.scale(Array.of(0,0,0,0,0,0,0,0,0),W,[L,D]),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-R,-C]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"globalSkew",value:function globalSkew(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:L;var _ref14=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref15=_slicedToArray(_ref14,2),R=_ref15[0],C=_ref15[1];var W=n.mat3.create();return W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[R,C]),W=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),W,n.mat3.fromValues(1,Math.tan(D),Math.tan(L),1,0,0)),W=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),W,[-R,-C]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(L,D,R){var C=this.globalTransformMatrix;R&&(C=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,R));var W=L*C[0]+D*C[2]+C[4],z=L*C[1]+D*C[3]+C[5];return[W,z];}}]);}();},/* 14 */ /***/function(h,r,t){t.r(r);var e=t(15);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e["default"];},/* 15 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(16),n=t(17),i=t(18),a=t(19);t(1).glMatrix.setMatrixArrayType(Array);function s(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O;}var o={};function f(O){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var m=[],T=O.length;for(var c=0;c<T;c++)c%x<2&&m.push(0.5*(O[c]+1));return m;}function v(O,x){var m=x._buffers;Object.values(m).forEach(function(T){O.deleteBuffer(T);}),x._buffers={};}function l(O,x,m){return O.activeTexture(O.TEXTURE0+m),Array.isArray(x._img)?O.bindTexture(O.TEXTURE_CUBE_MAP,x):O.bindTexture(O.TEXTURE_2D,x),x;}var p={"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 y=/*#__PURE__*/function(){function y(x){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,y);this.options=Object.assign({},y.defaultOptions,m),this.canvas=x;var T;this.options.webgl2&&(T=x.getContext("webgl2",this.options)),T==null&&(T=Object(e.setupWebGL)(x,this.options),this.aia_ext=T.getExtension("ANGLE_instanced_arrays")),this.gl=T,T.viewport(0,0,x.width,x.height),T.clearColor(0,0,0,0),T.blendFuncSeparate(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA,T.ONE,T.ONE_MINUS_SRC_ALPHA),this.programs=[],this._events={};}return _createClass(y,[{key:"program",get:function get(){var x=this.gl;return x.getParameter(x.CURRENT_PROGRAM);}// WebGLRenderingContext.uniform[1234][fi][v]()
|
|
41
|
+
// WebGLRenderingContext.uniformMatrix[234]fv()
|
|
42
|
+
},{key:"_declareUniform",value:function _declareUniform(x,m){var T=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"1f";var c=this.gl,d=c.getUniformLocation(x,m);var u;var g=this;if(/^sampler/.test(T)){var M=x._samplerMap,A=x._bindTextures;Object.defineProperty(x.uniforms,m,{get:function get(){return u;},set:function set(I){u=I;var b=M[m]!=null?M[m]:A.length;A[b]=I,l(c,I,b),M[m]||(M[m]=b,c.uniform1i(d,b)),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}else{var _M=T.indexOf("Matrix")===0,_A=!_M&&/v$/.test(T),I=c["uniform".concat(T)].bind(c);Object.defineProperty(x.uniforms,m,{get:function get(){return u;},set:function set(b){u=b,typeof b=="number"&&(b=[b]),_M?I(d,!1,b):_A?I(d,b):I.apply(void 0,[d].concat(_toConsumableArray(b))),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}}},{key:"_draw",value:function _draw(){var _this4=this;var x=this.program;x.meshData.forEach(function(m,T){var c=m.positions,d=m.cells,u=m.instanceCount,g=m.cellsCount,M=m.attributes,A=m.uniforms,I=m.textureCoord,b=m.enableBlend,E=_this4.gl;var L=m.mode!=null?m.mode:E.TRIANGLES;typeof L=="string"&&(L=E[L]),b?E.enable(E.BLEND):E.disable(E.BLEND),E.bindBuffer(E.ARRAY_BUFFER,x._buffers.verticesBuffer),E.bufferData(E.ARRAY_BUFFER,c,E.STATIC_DRAW),d&&(E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,x._buffers.cellsBuffer),E.bufferData(E.ELEMENT_ARRAY_BUFFER,d,E.STATIC_DRAW));var D=[];M&&Object.values(M).forEach(function(_ref16){var C=_ref16.name,W=_ref16.data,z=_ref16.divisor;if(E.bindBuffer(E.ARRAY_BUFFER,x._buffers[C]),E.bufferData(E.ARRAY_BUFFER,W,E.STATIC_DRAW),z!=null){var H=E.getAttribLocation(x,C);H>=0&&(E.enableVertexAttribArray(H),D.push(H),E.vertexAttribDivisor?E.vertexAttribDivisor(H,z):_this4.aia_ext&&_this4.aia_ext.vertexAttribDivisorANGLE(H,z));}}),A&&Object.entries(A).forEach(function(_ref17){var _ref18=_slicedToArray(_ref17,2),C=_ref18[0],W=_ref18[1];_this4.uniforms[C]=W;});var R;if(!d){var C=x._dimension;R=c.length/C;}if(x._enableTextures&&x._buffers.texCoordBuffer){var _C2=I||f(c,x._dimension);E.bindBuffer(E.ARRAY_BUFFER,x._buffers.texCoordBuffer),E.bufferData(E.ARRAY_BUFFER,y.FLOAT(_C2),E.STATIC_DRAW);}u!=null?(d?E.drawElementsInstanced?E.drawElementsInstanced(L,g,E.UNSIGNED_SHORT,0,u):_this4.aia_ext&&_this4.aia_ext.drawElementsInstancedANGLE(L,g,E.UNSIGNED_SHORT,0,u):E.drawArraysInstanced?E.drawArraysInstanced(L,0,R,u):_this4.aia_ext.drawArraysInstancedANGLE(L,0,R,u),D.forEach(function(C){E.vertexAttribDivisor?E.vertexAttribDivisor(C,null):_this4.aia_ext&&_this4.aia_ext.vertexAttribDivisorANGLE(C,null);})):d?E.drawElements(L,g,E.UNSIGNED_SHORT,0):E.drawArrays(L,0,R);});}},{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 x=this.program;if(!x||!x.uniforms)throw Error("No avaliable program.");return x.uniforms;}},{key:"deleteProgram",value:function deleteProgram(x){var m=this.gl;this.program===x&&(this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID),m.useProgram(null));var T=this.programs.indexOf(x);T>=0&&this.programs.splice(T,1),v(m,x),m.deleteProgram(x);}/**
|
|
43
|
+
[{
|
|
44
|
+
positions: ...
|
|
45
|
+
cells: ...
|
|
46
|
+
textureCoord: ...
|
|
47
|
+
attributes: {name: {data:..., normalize: true}},
|
|
48
|
+
uniforms: ...
|
|
49
|
+
}]
|
|
50
|
+
*/},{key:"setMeshData",value:function setMeshData(x){var _this5=this;Array.isArray(x)||(x=[x]);var m=this.program;m.meshData=x.map(function(_ref19){var T=_ref19.mode,c=_ref19.positions,d=_ref19.instanceCount,u=_ref19.cells,g=_ref19.cellsCount,M=_ref19.attributes,A=_ref19.uniforms,I=_ref19.textureCoord,b=_ref19.enableBlend;var E={positions:y.FLOAT(c),uniforms:A,enableBlend:!!b,textureCoord:y.FLOAT(I)};if(u&&(E.cells=y.USHORT(u),E.cellsCount=g||E.cells.length),T!=null&&(E.mode=T),d!=null){if(!_this5.isWebGL2&&!_this5.aia_ext)throw new Error("Cannot use instanceCount in this rendering context, use webgl2 context instead.");E.instanceCount=d;}if(M){var L={};Object.entries(M).forEach(function(_ref20){var _ref21=_slicedToArray(_ref20,2),D=_ref21[0],R=_ref21[1];if(!m._attribute[D])m._attribute[D]="ignored";else if(m._attribute[D]!=="ignored"){var _m$_attribute$D=m._attribute[D],C=_m$_attribute$D.name,W=_m$_attribute$D.type;var z=R.data||R;if(Array.isArray(z)&&(z=y[W](z)),L[D]={name:C,data:z},R.divisor!=null){if(!_this5.isWebGL2&&!_this5.aia_ext)throw new Error("Cannot use divisor in this rendering context, use webgl2 context instead.");L[D].divisor=R.divisor;}}}),E.attributes=L;}return E;}),this.options.autoUpdate&&this.update();}},{key:"createProgram",value:function createProgram(x,m){var _this6=this;var T=/^\s*uniform\s+sampler/mg.test(x);x==null&&(x=i["default"]),m==null&&(m=T?a["default"]:n["default"]);var c=this.gl,d=Object(e.createProgram)(c,m,x);d.shaderText={vertexShader:m,fragmentShader:x},d._buffers={},d._attribute={},d.uniforms={},d._samplerMap={},d._bindTextures=[];var u=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexPosition),"im");var g=m.match(u);g&&(d._dimension=Number(g[1]));var M=new RegExp("(?:attribute|in) vec(\\d) ".concat(this.options.vertexTextureCoord),"im");g=m.match(M),g&&(d._texCoordSize=Number(g[1]));var A=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/gim;if(g=m.match(A),g)for(var E=0;E<g.length;E++){var L=/^\s*(?:attribute|in) (\w+?)(\d*) (\w+)/im,D=g[E].match(L);if(D&&D[3]!==this.options.vertexPosition&&D[3]!==this.options.vertexTextureCoord){var _D=_slicedToArray(D,4),R=_D[1],C=_D[2],W=_D[3];R==="mat"&&(C=Math.pow(C,2)),d._buffers[W]=c.createBuffer(),d._attribute[W]={name:W,type:R,size:Number(C)||1};}}var I=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;g=m.match(I)||[],g=g.concat(x.match(I)||[]),g.forEach(function(E){var L=E.match(/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/);var _L$slice=L.slice(1),_L$slice2=_slicedToArray(_L$slice,3),D=_L$slice2[0],R=_L$slice2[1],C=_L$slice2[2];D=p[D],C=!!C,D.indexOf("Matrix")!==0&&C&&(D+="v"),_this6._declareUniform(d,R,D);}),d._buffers.verticesBuffer=c.createBuffer(),d._buffers.cellsBuffer=c.createBuffer();var b=c.getAttribLocation(d,this.options.vertexTextureCoord);return d._enableTextures=b>=0,d._enableTextures&&(d._buffers.texCoordBuffer=c.createBuffer()),this.programs.push(d),d;}},{key:"useProgram",value:function useProgram(x){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.startRender=!1,this._renderFrameID&&(cancelAnimationFrame(this._renderFrameID),delete this._renderFrameID);var T=this.gl;T.useProgram(x);var c=x._dimension;T.bindBuffer(T.ARRAY_BUFFER,x._buffers.verticesBuffer);var d=T.getAttribLocation(x,this.options.vertexPosition);if(T.vertexAttribPointer(d,c,T.FLOAT,!1,0,0),T.enableVertexAttribArray(d),x._enableTextures){T.bindBuffer(T.ARRAY_BUFFER,x._buffers.texCoordBuffer);var u=T.getAttribLocation(x,this.options.vertexTextureCoord);T.vertexAttribPointer(u,x._texCoordSize||2,T.FLOAT,!1,0,0),T.enableVertexAttribArray(u);}if(Object.entries(x._attribute).forEach(function(_ref22){var _ref23=_slicedToArray(_ref22,2),u=_ref23[0],g=_ref23[1];if(g!=="ignored"){var M=g.size,A=m[u]||{},I=!!A.normalize;var b=A.type||"FLOAT";var E=A.key||u;b==="UBYTE"&&(b="UNSIGNED_BYTE"),b==="USHORT"&&(b="UNSIGNED_SHORT"),g.type=b,E&&E!==u&&(x._attribute[E]=g),T.bindBuffer(T.ARRAY_BUFFER,x._buffers[u]);var L=T.getAttribLocation(x,u);L>=0&&(T.vertexAttribPointer(L,M,T[b],I,0,0),T.enableVertexAttribArray(L));}}),!x.meshData){var _u2=[[-1,-1,0,1].slice(0,c),[1,-1,0,1].slice(0,c),[1,1,0,1].slice(0,c),[-1,1,0,1].slice(0,c)],g=[[0,1,3],[3,1,2]];this.setMeshData({positions:_u2,cells:g});}return x;}},{key:"compileSync",value:function compileSync(x,m){x=x||i["default"];var T={};function c(M){M=M.replace(/^\s*/mg,"");var A=[],I=M.match(/^#pragma\s+include\s+.*/mg);if(I){for(var b=0;b<I.length;b++){var L=I[b].match(/(?:<|")(.*)(?:>|")/);if(L){var D=L[0].indexOf("<")===0?"lib":"link";var R=L[1];if(R==="graph"&&(R="graphics"),T[R])A.push("/* included ".concat(R," */"));else if(T[R]=!0,D==="lib"){var C=c(o[R]);A.push(C);}else if(D==="link")throw new Error("Cannot load external links synchronously. Use compile instead of compileSync.");}}A.forEach(function(b){M=M.replace(/^#pragma\s+include\s+.*/m,b);});}return M;}var d=c(x),u=m?c(m):null;return this.createProgram(d,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(x,m){var T,c,_c4,d,u;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_c4=function _c6(){_c4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(M){var A,I,b,L,D,R,C,_C3;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:M=M.replace(/^\s*/mg,"");A=[],I=M.match(/^#pragma\s+include\s+.*/mg);if(!I){_context2.next=32;break;}b=0;case 4:if(!(b<I.length)){_context2.next=31;break;}L=I[b].match(/(?:<|")(.*)(?:>|")/);if(!L){_context2.next=28;break;}D=L[0].indexOf("<")===0?"lib":"link";R=L[1];if(!(R==="graph"&&(R="graphics"),T[R])){_context2.next=13;break;}A.push("/* included ".concat(R," */"));_context2.next=28;break;case 13:if(!(T[R]=!0,D==="lib")){_context2.next=20;break;}_context2.next=16;return c(o[R]);case 16:C=_context2.sent;A.push(C);_context2.next=28;break;case 20:if(!(D==="link")){_context2.next=28;break;}_context2.next=23;return y.fetchShader(R);case 23:_C3=_context2.sent;_context2.next=26;return c(_C3);case 26:_C3=_context2.sent;A.push(_C3);case 28:b++;_context2.next=4;break;case 31:A.forEach(function(b){M=M.replace(/^#pragma\s+include\s+.*/m,b);});case 32:return _context2.abrupt("return",M);case 33:case"end":return _context2.stop();}},_callee2);}));return _c4.apply(this,arguments);};c=function _c5(_x4){return _c4.apply(this,arguments);};x=x||i["default"];T={};_context3.next=6;return c(x);case 6:d=_context3.sent;if(!m){_context3.next=13;break;}_context3.next=10;return c(m);case 10:_context3.t0=_context3.sent;_context3.next=14;break;case 13:_context3.t0=null;case 14:u=_context3.t0;return _context3.abrupt("return",this.createProgram(d,u));case 16:case"end":return _context3.stop();}},_callee3,this);}));function compile(_x2,_x3){return _compile.apply(this,arguments);}return compile;}()},{key:"load",value:function(){var _load=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(x){var m,_args4=arguments;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:m=_args4.length>1&&_args4[1]!==undefined?_args4[1]:null;_context4.next=3;return y.fetchShader(x);case 3:x=_context4.sent;_context4.t0=m;if(!_context4.t0){_context4.next=9;break;}_context4.next=8;return y.fetchShader(m);case 8:m=_context4.sent;case 9:return _context4.abrupt("return",this.compile(x,m));case 10:case"end":return _context4.stop();}},_callee4,this);}));function load(_x5){return _load.apply(this,arguments);}return load;}()},{key:"createTexture",value:function createTexture(){var _this7=this;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var _ref24=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref24$wrapS=_ref24.wrapS,m=_ref24$wrapS===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapS,_ref24$wrapT=_ref24.wrapT,T=_ref24$wrapT===void 0?this.gl.CLAMP_TO_EDGE:_ref24$wrapT,_ref24$minFilter=_ref24.minFilter,c=_ref24$minFilter===void 0?this.gl.LINEAR:_ref24$minFilter,_ref24$magFilter=_ref24.magFilter,d=_ref24$magFilter===void 0?this.gl.LINEAR:_ref24$magFilter;var u=this.gl,g=Array.isArray(x)?u.TEXTURE_CUBE_MAP:u.TEXTURE_2D;this._max_texture_image_units=this._max_texture_image_units||u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),u.activeTexture(u.TEXTURE0+this._max_texture_image_units-1);var M=u.createTexture();u.bindTexture(g,M),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!0);var _this$canvas4=this.canvas,A=_this$canvas4.width,I=_this$canvas4.height;if(x){if(g===u.TEXTURE_CUBE_MAP)for(var b=0;b<6;b++)u.texImage2D(u.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,x[b]);else u.texImage2D(g,0,u.RGBA,u.RGBA,u.UNSIGNED_BYTE,x);}else if(g===u.TEXTURE_CUBE_MAP)for(var _b=0;_b<6;_b++)this.gl.texImage2D(this.gl.TEXTURE_CUBE_MAP_POSITIVE_X+_b,0,u.RGBA,A,I,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(g,0,u.RGBA,A,I,0,u.RGBA,u.UNSIGNED_BYTE,null);return u.texParameteri(g,u.TEXTURE_MIN_FILTER,c),u.texParameteri(g,u.TEXTURE_MAG_FILTER,d),u.texParameteri(g,u.TEXTURE_WRAP_S,m),u.texParameteri(g,u.TEXTURE_WRAP_T,T),g===u.TEXTURE_CUBE_MAP&&(x.width=x[0].width,x.height=x[0].height),u.bindTexture(g,null),M._img=x||{width:A,height:I},M["delete"]=function(){_this7.deleteTexture(M);},M;}},{key:"deleteTexture",value:function deleteTexture(x){var m=x._img;this.gl.deleteTexture(x),typeof m.close=="function"&&m.close();}},{key:"loadTexture",value:function(){var _loadTexture=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(x){var _ref25,_ref25$useImageBitmap,m,T,_args5=arguments;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_ref25=_args5.length>1&&_args5[1]!==undefined?_args5[1]:{},_ref25$useImageBitmap=_ref25.useImageBitmap,m=_ref25$useImageBitmap===void 0?!0:_ref25$useImageBitmap;_context5.next=3;return y.loadImage(x,{useImageBitmap:m});case 3:T=_context5.sent;return _context5.abrupt("return",this.createTexture(T));case 5:case"end":return _context5.stop();}},_callee5,this);}));function loadTexture(_x6){return _loadTexture.apply(this,arguments);}return loadTexture;}()},{key:"createFBO",value:function createFBO(){var _ref26=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref26$color=_ref26.color,x=_ref26$color===void 0?1:_ref26$color,_ref26$blend=_ref26.blend,m=_ref26$blend===void 0?!1:_ref26$blend,_ref26$depth=_ref26.depth,T=_ref26$depth===void 0?this.options.depth!==!1:_ref26$depth,_ref26$stencil=_ref26.stencil,c=_ref26$stencil===void 0?!!this.options.stencil:_ref26$stencil;var d=this.gl,u=d.createFramebuffer();d.bindFramebuffer(d.FRAMEBUFFER,u);var g=[];for(var I=0;I<x;I++){var b=this.createTexture();d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0+I,d.TEXTURE_2D,b,0/* level */),g.push(b);}u.textures=g,u.texture=g[0],u.blend=m;var _this$canvas5=this.canvas,M=_this$canvas5.width,A=_this$canvas5.height;return T&&!c&&(u.depthBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.depthBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_COMPONENT16,M,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.RENDERBUFFER,u.depthBuffer)),c&&!T&&(u.stencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.stencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.STENCIL_INDEX8,M,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.STENCIL_ATTACHMENT,d.RENDERBUFFER,u.stencilBuffer)),T&&c&&(u.depthStencilBuffer=d.createRenderbuffer(),d.bindRenderbuffer(d.RENDERBUFFER,u.depthStencilBuffer),d.renderbufferStorage(d.RENDERBUFFER,d.DEPTH_STENCIL,M,A),d.framebufferRenderbuffer(d.FRAMEBUFFER,d.DEPTH_STENCIL_ATTACHMENT,d.RENDERBUFFER,u.depthStencilBuffer)),d.bindFramebuffer(d.FRAMEBUFFER,null),u;}},{key:"bindFBO",value:function bindFBO(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;this.fbo=x;}},{key:"render",value:function render(){var _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref27$clearBuffer=_ref27.clearBuffer,x=_ref27$clearBuffer===void 0?!0:_ref27$clearBuffer;this.startRender=!0;var m=this.gl;var T=this.program;T||(T=this.createProgram(),this.useProgram(T)),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,this.fbo);var c=this.options.depth;c&&m.enable(m.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(c?this.gl.DEPTH_BUFFER_BIT:0)|(this.options.stencil?this.gl.STENCIL_BUFFER_BIT:0));var d=this._renderFrameID;this._draw(),this.fbo&&m.bindFramebuffer(m.FRAMEBUFFER,null),this._renderFrameID===d&&(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 x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Object.assign(o,x);}},{key:"FLOAT",value:function FLOAT(x,m){return Object(e.pointsToBuffer)(x,Float32Array,m);}},{key:"UNSIGNED_BYTE",value:function UNSIGNED_BYTE(x,m){return Object(e.pointsToBuffer)(x,Uint8Array,m);}},{key:"UNSIGNED_SHORT",value:function UNSIGNED_SHORT(x,m){return Object(e.pointsToBuffer)(x,Uint16Array,m);}},{key:"BYTE",value:function BYTE(x,m){return Object(e.pointsToBuffer)(x,Int8Array,m);}},{key:"SHORT",value:function SHORT(x,m){return Object(e.pointsToBuffer)(x,Int16Array,m);}}]);}();s(y,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),s(y,"UBYTE",y.UNSIGNED_BYTE),s(y,"USHORT",y.UNSIGNED_SHORT),s(y,"fetchShader",e.fetchShader),s(y,"loadImage",e.loadImage);},/* 16 */ /***/function(h,r,t){t.r(r),t.d(r,"setupWebGL",function(){return n;}),t.d(r,"createProgram",function(){return i;}),t.d(r,"pointsToBuffer",function(){return a;}),t.d(r,"loadImage",function(){return o;}),t.d(r,"fetchShader",function(){return v;}),t(1).glMatrix.setMatrixArrayType(Array);function e(l,p){var y=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var O=null;for(var x=0;x<y.length;++x){try{O=l.getContext(y[x],p);}catch(_unused6){}if(O)break;}return O;}function n(l,p){var y=e(l,p);if(!y)throw new Error("Sorry, your browser doesn't support WebGL.");return y;}function i(l,p,y){var O=l.createShader(l.VERTEX_SHADER);if(l.shaderSource(O,p),l.compileShader(O),!l.getShaderParameter(O,l.COMPILE_STATUS)){var _T5="Vertex shader failed to compile. The error log is:".concat(l.getShaderInfoLog(O));throw new Error(_T5);}var x=l.createShader(l.FRAGMENT_SHADER);if(l.shaderSource(x,y),l.compileShader(x),!l.getShaderParameter(x,l.COMPILE_STATUS)){var _T6="Fragment shader failed to compile. The error log is:".concat(l.getShaderInfoLog(x));throw new Error(_T6);}var m=l.createProgram();if(l.attachShader(m,O),l.attachShader(m,x),l.linkProgram(m),!l.getProgramParameter(m,l.LINK_STATUS)){var _T7="Shader program failed to link. The error log is:".concat(l.getProgramInfoLog(m));throw new Error(_T7);}return l.deleteShader(O),l.deleteShader(x),m;}function a(l){var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(y&&!(y instanceof p))throw new TypeError("Wrong buffer type.");if(l==null||l instanceof p)return l;if(l[0]==null||l[0].length==null)return y?(y.set(l,0),y):new p(l);var O=l[0].length,x=l.length;y||(y=new p(O*x));var m=0;for(var _T8=0;_T8<x;_T8++)for(var _c7=0;_c7<O;_c7++)y[m++]=l[_T8][_c7];return y;}var s={};function o(l){var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$useImageBitmap=_ref28.useImageBitmap,p=_ref28$useImageBitmap===void 0?!0:_ref28$useImageBitmap,_ref28$alias=_ref28.alias,y=_ref28$alias===void 0?null:_ref28$alias;if(!s[l]){if(typeof Image=="function"){var O=new Image();typeof l=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(l)&&(O.crossOrigin="anonymous"),s[l]=new Promise(function(x){O.onload=function(){p&&typeof createImageBitmap=="function"?createImageBitmap(O,{imageOrientation:"flipY"}).then(function(m){s[l]=m,y&&(s[y]=m),x(m);}):(s[l]=O,y&&(s[y]=O),x(O));},O.src=l;}),y&&(s[y]=s[l]);}else if(typeof fetch=="function")return fetch(l,{method:"GET",mode:"cors",cache:"default"}).then(function(O){return O.blob();}).then(function(O){return createImageBitmap(O,{imageOrientation:"flipY"}).then(function(x){return s[l]=x,y&&(s[y]=x),x;});});}return s[l];}var f={};function v(_x7){return _v.apply(this,arguments);}function _v(){_v=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(l){var p,y;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:if(!f[l]){_context6.next=2;break;}return _context6.abrupt("return",f[l]);case 2:_context6.next=4;return fetch(l);case 4:p=_context6.sent;if(!(p.status>=200&&p.status<300)){_context6.next=10;break;}_context6.next=8;return p.text();case 8:y=_context6.sent;return _context6.abrupt("return",(f[l]=y,y));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context6.stop();}},_callee6);}));return _v.apply(this,arguments);}},/* 17 */ /***/function(h,r,t){t.r(r),r["default"]="attribute vec3 a_vertexPosition;\n\nvoid main() {\n gl_PointSize = 1.0;\n gl_Position = vec4(a_vertexPosition, 1);\n}";},/* 18 */ /***/function(h,r,t){t.r(r),r["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(h,r,t){t.r(r),r["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(h,r,t){t.r(r),t.d(r,"default",function(){return a;});var e=t(21),n=t(25);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol("transform");var a=/*#__PURE__*/function(){function a(o,f){_classCallCheck(this,a);this.context=o.getContext("2d"),this.options=f,this[i]=[1,0,0,1,0,0];}return _createClass(a,[{key:"createTexture",value:function createTexture(o){return{_img:o};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(o){var f;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e["default"].loadImage(o,{useImageBitmap:!1});case 2:f=_context7.sent;return _context7.abrupt("return",this.createTexture(f));case 4:case"end":return _context7.stop();}},_callee7,this);}));function loadTexture(_x8){return _loadTexture2.apply(this,arguments);}return loadTexture;}()},{key:"deleteTexture",value:function deleteTexture(o){return o;}},{key:"clear",value:function clear(o,f,v,l){var p=this.context;o=o||0,f=f||0,v=v||p.canvas.width-o,l=l||p.canvas.height-f,p.clearRect(o,f,v,l);}},{key:"drawMeshCloud",value:function drawMeshCloud(o){var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,f=_ref29$clear===void 0?!1:_ref29$clear;var v=[];for(var l=0;l<o.amount;l++){var p=o.getTransform(l);var y=o.getTextureFrame(l);y&&(y=y._img);var O=o.getFilter(l),_o$getCloudRGBA=o.getCloudRGBA(l),x=_o$getCloudRGBA.fill,m=_o$getCloudRGBA.stroke;v.push({mesh:o.mesh,_cloudOptions:[x,m,y,p,O]});}o.beforeRender&&o.beforeRender(this.context,o),this.drawMeshes(v,{clear:f,hook:!1}),o.afterRender&&o.afterRender(this.context,o);}},{key:"drawMeshes",value:function drawMeshes(o){var _this8=this;var _ref30=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref30$clear=_ref30.clear,f=_ref30$clear===void 0?!1:_ref30$clear,_ref30$hook=_ref30.hook,v=_ref30$hook===void 0?!0:_ref30$hook;var l=this.context;f&&l.clearRect(0,0,l.canvas.width,l.canvas.height);var p=null;var _l$canvas=l.canvas,y=_l$canvas.width,O=_l$canvas.height,x=o.length;o.forEach(function(m,T){var _m$_cloudOptions,_this8$filterBuffer;var c,d,u,g,M;v&&m.beforeRender&&m.beforeRender(l,m),m._cloudOptions&&((_m$_cloudOptions=_slicedToArray(m._cloudOptions,5),c=_m$_cloudOptions[0],d=_m$_cloudOptions[1],u=_m$_cloudOptions[2],g=_m$_cloudOptions[3],M=_m$_cloudOptions[4]),m=m.mesh);var A=m.filter;if(M&&(A=A?"".concat(A," ").concat(M):M),A&&!_this8.filterBuffer&&_this8.filterBuffer!==!1){var I=e["default"].createCanvas(y,O);I?_this8.filterBuffer=I.getContext("2d"):_this8.filterBuffer=!1;}p&&p!==A&&(Object(n.applyFilter)(_this8.filterBuffer,p),l.drawImage(_this8.filterBuffer.canvas,0,0,y,O),_this8.filterBuffer.clearRect(0,0,y,O),p=null),A&&_this8.filterBuffer?(_this8.filterBuffer.save(),(_this8$filterBuffer=_this8.filterBuffer).transform.apply(_this8$filterBuffer,_toConsumableArray(_this8[i])),Object(n.drawMesh2D)(m,_this8.filterBuffer,!1,c,d,u,g),_this8.filterBuffer.restore(),T===x-1?(Object(n.applyFilter)(_this8.filterBuffer,A),l.drawImage(_this8.filterBuffer.canvas,0,0,y,O),_this8.filterBuffer.clearRect(0,0,y,O)):p=A):(l.save(),l.transform.apply(l,_toConsumableArray(_this8[i])),Object(n.drawMesh2D)(m,l,!1,c,d,u,g),l.restore()),v&&m.afterRender&&m.afterRender(l,m);});}},{key:"setTransform",value:function setTransform(o){this[i]=o;}}]);}();},/* 21 */ /***/function(h,r,t){t.r(r),function(e){var n=t(14),i=t(23),a=t(24);t(1).glMatrix.setMatrixArrayType(Array);var s={};function o(y,O){var x=y.style,m=y.variant,T=y.weight,c=y.stretch,d=y.size,u=y.pxLineHeight,g=y.family;return c==="normal"?"".concat(x," ").concat(m," ").concat(T," ").concat(d*O,"px/").concat(u*O,"px ").concat(g):"".concat(x," ").concat(m," ").concat(T," ").concat(c," ").concat(d*O,"px/").concat(u*O,"px ").concat(g);}function f(y,_ref31){var O=_ref31.font,x=_ref31.fillColor,m=_ref31.strokeColor,T=_ref31.strokeWidth,_ref31$ratio=_ref31.ratio,c=_ref31$ratio===void 0?1:_ref31$ratio,d=_ref31.textCanvas,_ref31$cachable=_ref31.cachable,u=_ref31$cachable===void 0?!1:_ref31$cachable;var g;if(u){g=[y,O,String(x),String(m),String(T)].join("###");var z=s[g];if(z)return z;}d||(d=l(1,1));var M=d.getContext("2d");M.save(),M.font=O;var _M$measureText=M.measureText(y),A=_M$measureText.width;M.restore();var I=Object(i["default"])(O),b=Math.max(I.pxLineHeight,I.pxHeight*1.13);/italic|oblique/.test(O)&&(A+=b*Math.tan(15*Math.PI/180)),!x&&!m&&(x="#000");var E=M.canvas,L=Math.ceil(A),D=Math.ceil(b);E.width=Math.round(L*c),E.height=Math.round(D*c),M.save(),M.font=o(I,c),M.textAlign="center",M.textBaseline="middle";var R=E.height*0.5+I.pxHeight*0.05*c,C=E.width*0.5;if(x){if(Array.isArray(x))x=Object(a["default"])(x);else if(x.vector){var _z;var _x9=x,H=_x9.vector,X=_x9.colors;H.length===6?_z=M.createRadialGradient.apply(M,_toConsumableArray(H)):_z=M.createLinearGradient.apply(M,_toConsumableArray(H)),X.forEach(function(_ref32){var Z=_ref32.offset,j=_ref32.color;_z.addColorStop(Z,j);}),x=_z;}M.fillStyle=x,M.fillText(y,C,R);}if(m){if(M.lineWidth=T*c,Array.isArray(m))m=Object(a["default"])(m);else if(m.vector){var _z2;var _m=m,_H=_m.vector,_X=_m.colors;_H.length===6?_z2=M.createRadialGradient.apply(M,_toConsumableArray(_H)):_z2=M.createLinearGradient.apply(M,_toConsumableArray(_H)),_X.forEach(function(_ref33){var Z=_ref33.offset,j=_ref33.color;_z2.addColorStop(Z,j);}),m=_z2;}M.strokeStyle=m,M.strokeText(y,C,R);}M.restore();var W={image:d,rect:[0,0,L,D]};return u&&(s[g]=W),W;}var v=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var y=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);y&&(v=Number(y[1])<70);}function l(y,O){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var m=x.offscreen||!v&&x.offscreen!==!1;var T;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?T=e.createCanvas(y,O,x):m&&typeof OffscreenCanvas=="function"?T=new OffscreenCanvas(y,O):(T=document.createElement("canvas"),T.width=y,T.height=O),T;}var p={createCanvas:l,createText:f,loadImage:n["default"].loadImage};r["default"]=p;}.call(this,t(22));},/* 22 */ /***/function(h,r){var t;t=/* @__PURE__ */function(){return this;}();try{t=t||new Function("return this")();}catch(_unused7){(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&(t=window);}h.exports=t;},/* 23 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return x;}),t(1).glMatrix.setMatrixArrayType(Array);function e(m,T){if(typeof m=="string"){var u=m.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%)$/);u?m={size:parseFloat(u[1]),unit:u[2]}:m={size:parseInt(m,10),unit:"px"};}var _m2=m,c=_m2.size,d=_m2.unit;if(d==="pt")c/=0.75;else if(d==="pc")c*=16;else if(d==="in")c*=96;else if(d==="cm")c*=96/2.54;else if(d==="mm")c*=96/25.4;else if(d==="em"||d==="rem"||d==="ex"){if(!T&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u3=getComputedStyle(document.documentElement).fontSize;T=e(_u3,16);}c*=T,d==="ex"&&(c/=2);}else if(d==="q")c*=96/25.4/4;else if(d==="vw"||d==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u4=d==="vw"?document.documentElement.clientWidth:document.documentElement.clientHeight;c*=_u4/100;}}else if((d==="vmax"||d==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _u5=document.documentElement.clientWidth,g=document.documentElement.clientHeight;d==="vmax"?c*=Math.max(_u5,g)/100:c*=Math.min(_u5,g)/100;}return c;}var n="bold|bolder|lighter|[1-9]00",i="italic|oblique",a="small-caps",s="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",o="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",f="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",v=new RegExp("(".concat(n,") +"),"i"),l=new RegExp("(".concat(i,") +"),"i"),p=new RegExp("(".concat(a,") +"),"i"),y=new RegExp("(".concat(s,") +"),"i"),O=new RegExp("([\\d\\.]+)("+o+")(?:\\/([\\d\\.]+)("+o+"))? *((?:"+f+")( *, *(?:"+f+"))*)");function x(m,T){var c=O.exec(m);if(!c)return;var d=parseFloat(c[3]),u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(c[1]),unit:c[2],lineHeight:Number.isFinite(d)?d:void 0,lineHeightUnit:c[4],family:c[5].replace(/ *, */g,",")},g=m.substring(0,c.index),M=v.exec(g),A=l.exec(g),I=p.exec(g),b=y.exec(g);return M&&(u.weight=M[1]),A&&(u.style=A[1]),I&&(u.variant=I[1]),b&&(u.stretch=b[1]),u.pxHeight=e({size:u.size,unit:u.unit},T),u.pxLineHeight=e({size:u.lineHeight||u.size,unit:u.lineHeightUnit||u.unit},T),u;}},/* 24 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return"rgba(".concat(n.map(function(i,a){return a<3?Math.round(i*255):i;}).join(),")");}},/* 25 */ /***/function(h,r,t){t.r(r),t.d(r,"applyFilter",function(){return s;}),t.d(r,"drawMesh2D",function(){return f;});var e=t(1),n=t(24),i=t(23),a=t(26);t(1).glMatrix.setMatrixArrayType(Array);function s(v,l){var p=v.canvas;v.save(),v.filter=l,v.drawImage(p,0,0,p.width,p.height),v.restore();}function o(v,l){var p=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;v=v.match(p).slice(1,5).map(Number),l=l.match(p).slice(1,5).map(Number);var y=[],O=l[3];for(var x=0;x<4;x++)y[x]=Object(a.mix)(v[x],l[x],O);return"rgba(".concat(y.join(),")");}function f(v,l){var p=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var y=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var O=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;var x=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;var m=arguments.length>6&&arguments[6]!==undefined?arguments[6]:null;l.save();var T=!1,c=!1;if(l.globalAlpha=v.getOpacity(),v._updateMatrix&&v.transformScale/v.contours.scale>1.5&&v.accurate(v.transformScale),v.lineWidth){var g=v.gradient&&v.gradient.stroke;if(g){var _g=g,M=_g.vector,A=_g.colors;if(M.length===6)g=l.createRadialGradient.apply(l,_toConsumableArray(M));else if(M.length===4)g=l.createLinearGradient.apply(l,_toConsumableArray(M));else if(M.length===3)g=l.createCircularGradient.apply(l,_toConsumableArray(M));else throw new TypeError("Invalid vector dimension.");A.forEach(function(_ref34){var I=_ref34.offset,b=_ref34.color;var E=Object(n["default"])(b);O&&(E=o(E,O)),g.addColorStop(I,E);}),l.strokeStyle=g,T=!0;}else v.strokeStyle&&(O?l.strokeStyle=o(v.strokeStyle,O):l.strokeStyle=v.strokeStyle,T=!0);}T&&(l.lineWidth=v.lineWidth,l.lineJoin=v.lineJoin,l.lineCap=v.lineCap,l.miterLimit=v.miterLimit,v.lineDash&&(l.setLineDash(v.lineDash),v.lineDashOffset&&(l.lineDashOffset=v.lineDashOffset)));var d=v.gradient&&v.gradient.fill;if(d){var _d3=d,_g2=_d3.vector,_M2=_d3.colors;if(_g2.length===6)d=l.createRadialGradient.apply(l,_toConsumableArray(_g2));else if(_g2.length===4)d=l.createLinearGradient.apply(l,_toConsumableArray(_g2));else if(_g2.length===3)d=l.createCircularGradient.apply(l,_toConsumableArray(_g2));else throw new TypeError("Invalid vector dimension.");_M2.forEach(function(_ref35){var A=_ref35.offset,I=_ref35.color;var b=Object(n["default"])(I);O&&(b=o(b,O)),d.addColorStop(A,b);}),l.fillStyle=d,c=!0;}else v.fillStyle&&(y?l.fillStyle=o(v.fillStyle,y):l.fillStyle=v.fillStyle,c=!0);if(m&&l.transform.apply(l,_toConsumableArray(m)),l.transform.apply(l,_toConsumableArray(v.transformMatrix)),v.clipPath){var _g3=v.clipPath,_M3=new Path2D(_g3);l.clip(_M3);}var u=v.contours.length;if(v.contours.forEach(function(g,M){var A=g.length,I=A>1&&e.vec2.equals(g[0],g[A-1]),b=M===u-1&&v.texture;if(g&&A>0){if(c||T||b){l.beginPath(),l.moveTo.apply(l,_toConsumableArray(g[0]));for(var E=1;E<A;E++)E===A-1&&I?l.closePath():l.lineTo.apply(l,_toConsumableArray(g[E]));}if(c&&l.fill(v.fillRule),b){l.save(),l.clip();var _v$texture=v.texture,_E=_v$texture.image,L=_v$texture.options;if(x&&(_E=x),L.repeat&&console.warn("Context 2D not supported image repeat yet."),_E.font){L.scale&&console.warn("Context 2D not supported text scale yet."),L.srcRect&&console.warn("Context 2D not supported text srcRect yet.");var _E2=_E,D=_E2.font,R=_E2.fillColor,C=_E2.strokeColor,W=_E2.strokeWidth,z=_E2.text;!R&&!C&&(R="#000"),Array.isArray(R)&&(R=Object(n["default"])(R)),Array.isArray(C)&&(C=Object(n["default"])(C)),l.font=D;var _l$measureText=l.measureText(z),H=_l$measureText.width,X=Object(i["default"])(D),Z=Math.max(X.pxLineHeight,X.pxHeight*1.13);l.textAlign="center",l.textBaseline="middle";var j=L.rect,G=j[0]+Z*0.5+X.pxHeight*0.06,Q=j[1]+H*0.5;j[2]!=null&&l.scale(j[2]/H,j[3]/Z),R&&(l.fillStyle=R,l.fillText(z,Q,G)),C&&(l.lineWidth=W,l.strokeStyle=C,l.strokeText(z,Q,G));}else{var _D2=L.rect;var _R=L.srcRect;L.scale&&(_D2=[0,0,l.canvas.width,l.canvas.height]),L.rotated&&_D2&&(_D2=[-_D2[1],_D2[0],_D2[3],_D2[2]]),_R&&(_D2=_D2||[0,0,_R[2],_R[3]]),L.rotated&&(l.translate(0,_D2?_D2[2]:_E.width),l.rotate(-0.5*Math.PI)),_R?l.drawImage.apply(l,[_E].concat(_toConsumableArray(_R),_toConsumableArray(_D2))):_D2?l.drawImage.apply(l,[_E].concat(_toConsumableArray(_D2))):l.drawImage(_E,0,0);}l.restore();}T&&l.stroke();}}),l.restore(),p){var _g4=v.filter;_g4&&s(l,_g4);}}},/* 26 */ /***/function(h,r,t){t.r(r),t.d(r,"clamp",function(){return e;}),t.d(r,"mix",function(){return n;}),t.d(r,"transformPoint",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);function e(a,s,o){var _ref36;return s>o&&(_ref36=[o,s],s=_ref36[0],o=_ref36[1],_ref36),a<s?s:a>o?o:a;}function n(a,s,o){return a*(1-o)+s*o;}function i(a,s){var _a2=_slicedToArray(a,2),o=_a2[0],f=_a2[1];return[o*s[0]+f*s[2]+s[4],o*s[1]+f*s[3]+s[5]];}},/* 27 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(f,v,l){var p=f.uniforms||{},y=v.uniforms||{};if(p.u_texSampler&&y.u_texSampler&&p.u_texSampler!==y.u_texSampler)return!1;var O=Object.keys(p),x=Object.keys(y),m=O.indexOf("u_texSampler"),T=x.indexOf("u_texSampler");if(m>=0&&O.splice(m,1),T>=0&&x.splice(T,1),O.length!==x.length)return!1;var c=O.every(function(d){var u=p[d],g=y[d];if(u===g)return!0;if(u.length&&g.length&&u.length===g.length){for(var M=0;M<u.length;M++)if(u[M]!==g[M])return!1;return!0;}return!1;});if(c){if(p.u_texSampler&&!y.u_texSampler)v.setTexture(p.u_texSampler,{hidden:!0});else if(!p.u_texSampler&&y.u_texSampler)for(var d=0;d<l.length;d++)l[d].setTexture(y.u_texSampler,{hidden:!0});}return c;}var a={};function s(f,v){if(f.length){var l=Object(e["default"])(f,a);return l.enableBlend=v,f[0].filterCanvas&&(l.filterCanvas=!0),l.packIndex=f[0].packIndex,l.packLength=f.length,l.beforeRender=f[0].beforeRender,l.pass=f[0].pass,l.afterRender=f[f.length-1].afterRender,f.length=0,l;}}function o(f,v){var l=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var p,y,O,x,m,_T9,_c8,u,d,_u6,g;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:p=[],y=f.options.bufferSize;O=0,x=!1;m=0;case 3:if(!(m<v.length)){_context8.next=47;break;}_T9=v[m];if(!(_T9 instanceof n["default"])){_context8.next=16;break;}_context8.t0=p.length;if(!_context8.t0){_context8.next=10;break;}_context8.next=10;return s(p,x);case 10:O=0;x=!1;_context8.next=14;return _T9;case 14:_context8.next=44;break;case 16:_c8=_T9.meshData;if(_c8.clipPath&&!_c8.uniforms.u_clipSampler){u=f.createTexture(_c8.clipPath);_c8.uniforms.u_clipSampler=u;}d=0;if(!((!l||!_T9.canIgnore())&&_c8&&_c8.positions.length)){_context8.next=40;break;}_T9.packIndex=m;_u6=_T9.filterCanvas;if(!(d=_c8.positions.length,_u6||O+d>y)){_context8.next=31;break;}_context8.t1=p.length;if(!_context8.t1){_context8.next=27;break;}_context8.next=27;return s(p,x);case 27:O=0;x=!1;_context8.next=39;break;case 31:if(!O){_context8.next=39;break;}g=p[p.length-1];_context8.t2=g&&(g.filterCanvas||g.afterRender||_T9.beforeRender||g.pass.length||_T9.pass.length||g.program!==_T9.program||!i(g,_T9,p));if(!_context8.t2){_context8.next=39;break;}_context8.next=37;return s(p,x);case 37:O=0;x=!1;case 39:p.push(_T9),x=x||_T9.enableBlend,O+=d;case 40:_context8.t3=m===v.length-1&&p.length;if(!_context8.t3){_context8.next=44;break;}_context8.next=44;return s(p,x);case 44:m++;_context8.next=3;break;case 47:case"end":return _context8.stop();}},_callee8);})();}},/* 28 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;}),t(1).glMatrix.setMatrixArrayType(Array);var e={UNSIGNED_BYTE:Uint8Array,UNSIGNED_SHORT:Uint16Array,BYTE:Int8Array,SHORT:Int16Array,FLOAT:Float32Array};function n(a,s){var o=0,f=0,v=0,l=0,p=0,y=0,O=0;var x=a[0].program;for(var m=0;m<a.length;m++){var _T10=a[m].meshData;if(_T10){O+=_T10.positions.length;var _c9=_T10.positions[0].length;o+=_T10.positions.length*_c9,f+=_T10.cells.length*3,y+=_T10.attributes.a_color.length*4;var d=_T10.textureCoord;d&&(v+=d.length*d[0].length);var u=_T10.attributes.a_sourceRect;u&&(l+=u.length*4);var g=_T10.attributes.a_clipUV;g&&(p+=g.length*2);}}if((!s.positions||s.positions.length<o)&&(s.positions=new Float32Array(o)),(!s.cells||s.cells.length<f)&&(s.cells=new Uint16Array(f)),v&&(!s.textureCoord||s.textureCoord.length<v)&&(s.textureCoord=new Float32Array(v)),(!s.a_color||s.a_color.length<y)&&(s.a_color=new Uint8Array(y)),l&&(!s.a_sourceRect||s.a_sourceRect.length<l)&&(s.a_sourceRect=new Float32Array(l)),p&&(!s.a_clipUV||s.a_clipUV.length<p)&&(s.a_clipUV=new Float32Array(p)),x){var _m3=Object.entries(x._attribute),_T11=x._attribOpts||{};for(var _c10=0;_c10<_m3.length;_c10++){var _m3$_c=_slicedToArray(_m3[_c10],2),_d4=_m3$_c[0],_u7=_m3$_c[1];if(_d4!=="a_color"&&_d4!=="a_sourceRect"&&_u7!=="ignored"){var _g5=_T11[_d4]?_T11[_d4].type:"FLOAT",M=e[_g5],A=_u7.size*O;(!s[_d4]||s[_d4].length<A)&&(s[_d4]=new M(A));}}}return s;}function i(a,s){var o=[],f=[],v=[],l=[],p=[],y=[],O=0,x=0;var m=a[0]?a[0].uniforms||{}:{},T=a[0]?a[0].program:null;s&&(n(a,s),f=s.cells,o=s.positions,v=s.textureCoord,l=s.a_color,p=s.a_sourceRect,y=s.a_clipUV);var c=!1,d=!1;var u={};for(var M=0;M<a.length;M++){var A=a[M];if(A){var _o2,_l2,_p,_y,_v2;if(A.meshData&&(A=A.meshData),s){var b=A.positions;for(var E=0;E<b.length;E++){var L=b[E],D=3*(O+E);for(var R=0;R<L.length;R++)o[D+R]=L[R];}}else(_o2=o).push.apply(_o2,_toConsumableArray(A.positions));var I=A.cells;for(var _b2=0;_b2<I.length;_b2++){var _E3=I[_b2];if(s){var _L2=3*(x+_b2);f[_L2]=_E3[0]+O,f[_L2+1]=_E3[1]+O,f[_L2+2]=_E3[2]+O;}else f.push([_E3[0]+O,_E3[1]+O,_E3[2]+O]);}if(s){var _b3=A.attributes.a_color;for(var _E4=0;_E4<_b3.length;_E4++){var _L3=_b3[_E4],_D3=4*(O+_E4);l[_D3]=_L3[0],l[_D3+1]=_L3[1],l[_D3+2]=_L3[2],l[_D3+3]=_L3[3];}}else(_l2=l).push.apply(_l2,_toConsumableArray(A.attributes.a_color));if(A.attributes.a_sourceRect)if(c=!0,s){var _b4=A.attributes.a_sourceRect;for(var _E5=0;_E5<_b4.length;_E5++){var _L4=_b4[_E5],_D4=4*(O+_E5);p[_D4]=_L4[0],p[_D4+1]=_L4[1],p[_D4+2]=_L4[2],p[_D4+3]=_L4[3];}}else(_p=p).push.apply(_p,_toConsumableArray(A.attributes.a_sourceRect));if(A.attributes.a_clipUV)if(d=!0,s){var _b5=A.attributes.a_clipUV;for(var _E6=0;_E6<_b5.length;_E6++){var _L5=_b5[_E6],_D5=2*(O+_E6);y[_D5]=_L5[0],y[_D5+1]=_L5[1];}}else(_y=y).push.apply(_y,_toConsumableArray(A.attributes.a_clipUV));if(A.textureCoord)if(s){var _b6=A.textureCoord;for(var _E7=0;_E7<_b6.length;_E7++){var _L6=_b6[_E7],_D6=3*(O+_E7);for(var _R2=0;_R2<_L6.length;_R2++)v[_D6+_R2]=_L6[_R2];}}else(_v2=v).push.apply(_v2,_toConsumableArray(A.textureCoord));if(T){var _b7=Object.entries(T._attribute);for(var _E8=0;_E8<_b7.length;_E8++){var _u$_L;var _b7$_E=_slicedToArray(_b7[_E8],2),_L7=_b7$_E[0],_D7=_b7$_E[1];if(_L7!=="a_color"&&_L7!=="a_sourceRect"&&_D7!=="ignored")if(u[_L7]=[],s){u[_L7]=s[_L7];var _R3=A.attributes[_L7],C=_R3[0].length;for(var W=0;W<_R3.length;W++){var z=_R3[W],H=C*(O+W);for(var X=0;X<z.length;X++)u[_L7][H+X]=z[X];}}else(_u$_L=u[_L7]).push.apply(_u$_L,_toConsumableArray(A.attributes[_L7]));}}O+=A.positions.length,x+=A.cells.length;}}u.a_color=l,c&&p&&p.length>0&&(u.a_sourceRect=p);var g={positions:o,cells:f,attributes:u,uniforms:m,cellsCount:x*3,program:T};return v&&v.length&&(g.textureCoord=v),d&&y.length>0&&(u.a_clipUV=y),g;}},/* 29 */ /***/function(h,r,t){t.r(r);var e=t(1),n=t(30),i=t(26),a=t(31);t(1).glMatrix.setMatrixArrayType(Array);function s(u,g){var M=Object.keys(u);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(u);g&&(A=A.filter(function(I){return Object.getOwnPropertyDescriptor(u,I).enumerable;})),M.push.apply(M,A);}return M;}function o(u){for(var g=1;g<arguments.length;g++){var M=arguments[g]!=null?arguments[g]:{};g%2?s(Object(M),!0).forEach(function(A){f(u,A,M[A]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(M)):s(Object(M)).forEach(function(A){Object.defineProperty(u,A,Object.getOwnPropertyDescriptor(M,A));});}return u;}function f(u,g,M){return g in u?Object.defineProperty(u,g,{value:M,enumerable:!0,configurable:!0,writable:!0}):u[g]=M,u;}var v=Symbol("mesh"),l=Symbol("count"),p=Symbol("blend"),y=Symbol("filter"),O=Symbol("textures"),x=Symbol("textureOptions"),m=Symbol("cloudColor"),T=Symbol("cloudFilter"),c=Symbol("buffer");function d(u){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var M=new Float32Array(3*u),A=new Float32Array(3*u),I=new Float32Array(4*u),b=new Float32Array(4*u),E=new Float32Array(4*u),L=new Float32Array(4*u),D=new Float32Array(4*u),R=new Uint8Array(u),C=new Uint8Array(4*u),W=new Uint8Array(4*u);return g&&(M.set(g.transform0,0),A.set(g.transform1,0),I.set(g.color0,0),b.set(g.color1,0),E.set(g.color2,0),L.set(g.color3,0),D.set(g.color4,0),R.set(g.frameIndex,0),C.set(g.fillColor,0),W.set(g.strokeColor,0)),{bufferSize:u,transform0:M,transform1:A,color0:I,color1:b,color2:E,color3:L,color4:D,frameIndex:R,fillColor:C,strokeColor:W};}r["default"]=/*#__PURE__*/function(){function _class(u){var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _ref37=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref37$buffer=_ref37.buffer,M=_ref37$buffer===void 0?1e3:_ref37$buffer;_classCallCheck(this,_class);M=Math.max(M,g),this[l]=g,this[v]=u,this[c]=d(M),this[O]=[],this[y]=[],this[m]=!1,this[T]=!1,this[p]=!1,this.initBuffer();}return _createClass(_class,[{key:"initBuffer",value:function initBuffer(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var g=this[l];for(var M=u;M<g;M++)this[c].transform0.set([1,0,0],M*3),this[c].transform1.set([0,1,0],M*3),this[c].frameIndex.set([-1],M),this[c].fillColor.set([0,0,0,0],M*4),this[c].strokeColor.set([0,0,0,0],M*4),this.setColorTransform(M,null);}},{key:"bufferSize",get:function get(){return this[c].bufferSize;}},{key:"mesh",get:function get(){return this[v];},set:function set(u){this[v]=u,this[O]&&this.setTextureFrames(this[O],this[x]);}},{key:"hasCloudColor",get:function get(){return this[m];}},{key:"hasCloudFilter",get:function get(){return this[T];}},{key:"_getFilter",value:function _getFilter(u){return this[y][u]=this[y][u]||[],this[y][u];}},{key:"getFilter",value:function getFilter(u){return this._getFilter(u).join(" ");}},{key:"enableBlend",get:function get(){return this[v].enableBlend||this[p];}},{key:"canIgnore",value:function canIgnore(){return this[v].canIgnore();}},{key:"delete",value:function _delete(u){if(u>=this[l]||u<0)throw new Error("Out of range.");var _this$c2=this[c],g=_this$c2.transform0,M=_this$c2.transform1,A=_this$c2.color0,I=_this$c2.color1,b=_this$c2.color2,E=_this$c2.color3,L=_this$c2.color4,D=_this$c2.frameIndex,R=_this$c2.fillColor,C=_this$c2.strokeColor;g.set(g.subarray(3*(u+1)),3*u),M.set(M.subarray(3*(u+1)),3*u),A.set(A.subarray(4*(u+1)),4*u),I.set(I.subarray(4*(u+1)),4*u),b.set(b.subarray(4*(u+1)),4*u),E.set(E.subarray(4*(u+1)),4*u),L.set(L.subarray(4*(u+1)),4*u),D.set(D.subarray(u+1),u),R.set(R.subarray(4*(u+1)),4*u),C.set(C.subarray(4*(u+1)),4*u);for(var W in this[y])W===u?delete this[y][W]:W>u&&(this[y][W-1]=this[y][W],delete this[y][W]);this[l]--;}},{key:"setColorTransform",value:function setColorTransform(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=4;var _this$c3=this[c],M=_this$c3.color0,A=_this$c3.color1,I=_this$c3.color2,b=_this$c3.color3,E=_this$c3.color4;return g!=null?(M.set([g[0],g[5],g[10],g[15]],u),A.set([g[1],g[6],g[11],g[16]],u),I.set([g[2],g[7],g[12],g[17]],u),b.set([g[3],g[8],g[13],g[18]],u),E.set([g[4],g[9],g[14],g[19]],u),this[p]=this[p]||g[18]<1,this[T]=!0):(M.set([1,0,0,0],u),A.set([0,1,0,0],u),I.set([0,0,1,0],u),b.set([0,0,0,1],u),E.set([0,0,0,0],u)),this;}},{key:"getColorTransform",value:function getColorTransform(u){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=4;var _this$c4=this[c],g=_this$c4.color0,M=_this$c4.color1,A=_this$c4.color2,I=_this$c4.color3,b=_this$c4.color4;return[g[u],M[u],A[u],I[u],b[u],g[u+1],M[u+1],A[u+1],I[u+1],b[u+1],g[u+2],M[u+2],A[u+2],I[u+2],b[u+2],g[u+3],M[u+3],A[u+3],I[u+3],b[u+3]];}},{key:"transformColor",value:function transformColor(u,g){var M=this.getColorTransform(u);return M=Object(n.multiply)(M,g),this.setColorTransform(u,M),this;}},{key:"setFillColor",value:function setFillColor(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[c].fillColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"setStrokeColor",value:function setStrokeColor(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[c].strokeColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"getCloudRGBA",value:function getCloudRGBA(u){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=4;var _this$c5=this[c],g=_this$c5.fillColor,M=_this$c5.strokeColor,A=[g[u],g[u+1],g[u+2],g[u+3]],I=[M[u],M[u+1],M[u+2],M[u+3]];return A[3]/=255,I[3]/=255,{fill:"rgba(".concat(A.join(),")"),stroke:"rgba(".concat(I.join(),")")};}},{key:"grayscale",value:function grayscale(u,g){this.transformColor(u,Object(n.grayscale)(g)),this._getFilter(u).push("grayscale(".concat(100*g,"%)"));}},{key:"brightness",value:function brightness(u,g){this.transformColor(u,Object(n.brightness)(g)),this._getFilter(u).push("brightness(".concat(100*g,"%)"));}},{key:"saturate",value:function saturate(u,g){this.transformColor(u,Object(n.saturate)(g)),this._getFilter(u).push("saturate(".concat(100*g,"%)"));}},{key:"contrast",value:function contrast(u,g){this.transformColor(u,Object(n.contrast)(g)),this._getFilter(u).push("contrast(".concat(100*g,"%)"));}},{key:"invert",value:function invert(u,g){this.transformColor(u,Object(n.invert)(g)),this._getFilter(u).push("invert(".concat(100*g,"%)"));}},{key:"sepia",value:function sepia(u,g){this.transformColor(u,Object(n.sepia)(g)),this._getFilter(u).push("sepia(".concat(100*g,"%)"));}},{key:"opacity",value:function opacity(u,g){this.transformColor(u,Object(n.opacity)(g)),this._getFilter(u).push("opacity(".concat(100*g,"%)"));}},{key:"hueRotate",value:function hueRotate(u,g){this.transformColor(u,Object(n.hueRotate)(g)),this._getFilter(u).push("hue-rotate(".concat(g,"deg)"));}},{key:"setTransform",value:function setTransform(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=3,g==null&&(g=[1,0,0,1,0,0]);var _this$c6=this[c],M=_this$c6.transform0,A=_this$c6.transform1;return M.set([g[0],g[2],g[4]],u),A.set([g[1],g[3],g[5]],u),this;}},{key:"getTransform",value:function getTransform(u){if(u>=this[l]||u<0)throw new Error("Out of range.");u*=3;var _this$c7=this[c],g=_this$c7.transform0,M=_this$c7.transform1;return[g[u],M[u],g[u+1],M[u+1],g[u+2],M[u+2]];}},{key:"getTextureFrame",value:function getTextureFrame(u){return this[O][this[c].frameIndex[u]];}},{key:"setTextureFrames",value:function setTextureFrames(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var g=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(u.length>12)throw new Error("Max frames exceed. Allow 12 frames.");u.length&&this[v].setTexture(u[0],g),this[O]=u,this[x]=g;}},{key:"setFrameIndex",value:function setFrameIndex(u,g){if(u>=this[l]||u<0)throw new Error("Out of range.");var M=this[O].length;if(M<=0)throw new Error("No frames");this[c].frameIndex[u]=g%M;}},{key:"amount",get:function get(){return this[l];},set:function set(u){var g=this[l];u!==g&&(u>this[c].bufferSize&&(this[c]=d(Math.max(u,this[c].bufferSize+1e3),this[c])),this[l]=u,u>g&&this.initBuffer(g));}},{key:"meshData",get:function get(){var _this$v$meshData=this[v].meshData,u=_this$v$meshData.attributes,g=_this$v$meshData.cells,M=_this$v$meshData.positions,A=_this$v$meshData.textureCoord,I=_this$v$meshData.uniforms,b=this[O],E={attributes:o({},u),cells:g,positions:M,textureCoord:A,uniforms:o({},I),instanceCount:this[l],enableBlend:this.enableBlend};b.length&&b.forEach(function(G,Q){E.uniforms["u_texFrame".concat(Q)]=G;});var _this$c8=this[c],L=_this$c8.transform0,D=_this$c8.transform1,R=_this$c8.color0,C=_this$c8.color1,W=_this$c8.color2,z=_this$c8.color3,H=_this$c8.color4,X=_this$c8.fillColor,Z=_this$c8.strokeColor,j=_this$c8.frameIndex;return this[v].uniforms.u_texSampler&&(E.attributes.a_frameIndex={data:j,divisor:1}),E.attributes.a_transform0={data:L,divisor:1},E.attributes.a_transform1={data:D,divisor:1},E.attributes.a_colorCloud0={data:R,divisor:1},E.attributes.a_colorCloud1={data:C,divisor:1},E.attributes.a_colorCloud2={data:W,divisor:1},E.attributes.a_colorCloud3={data:z,divisor:1},E.attributes.a_colorCloud4={data:H,divisor:1},this.hasCloudColor&&(E.attributes.a_fillCloudColor={data:X,divisor:1},E.attributes.a_strokeCloudColor={data:Z,divisor:1}),E;}},{key:"setProgram",value:function setProgram(u){this[v].setProgram(u);}},{key:"program",get:function get(){return this[v].program;}},{key:"transform",value:function transform(u,g){var M=this.getTransform(u);return g=e.mat2d.multiply(Array.of(0,0,0,0,0,0),M,g),this.setTransform(u,g),this;}},{key:"translate",value:function translate(u,_ref38){var _ref39=_slicedToArray(_ref38,2),g=_ref39[0],M=_ref39[1];var A=e.mat2d.create();return A=e.mat2d.translate(Array.of(0,0,0,0,0,0),A,[g,M]),this.transform(u,A);}},{key:"rotate",value:function rotate(u,g){var _ref40=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref41=_slicedToArray(_ref40,2),M=_ref41[0],A=_ref41[1];var I=e.mat2d.create();return I=e.mat2d.translate(Array.of(0,0,0,0,0,0),I,[M,A]),I=e.mat2d.rotate(Array.of(0,0,0,0,0,0),I,g),I=e.mat2d.translate(Array.of(0,0,0,0,0,0),I,[-M,-A]),this.transform(u,I);}},{key:"scale",value:function scale(u,_ref42){var _ref43=_slicedToArray(_ref42,2),g=_ref43[0],_ref43$=_ref43[1],M=_ref43$===void 0?g:_ref43$;var _ref44=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref45=_slicedToArray(_ref44,2),A=_ref45[0],I=_ref45[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,I]),b=e.mat2d.scale(Array.of(0,0,0,0,0,0),b,[g,M]),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-I]),this.transform(u,b);}},{key:"skew",value:function skew(u,_ref46){var _ref47=_slicedToArray(_ref46,2),g=_ref47[0],_ref47$=_ref47[1],M=_ref47$===void 0?g:_ref47$;var _ref48=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref49=_slicedToArray(_ref48,2),A=_ref49[0],I=_ref49[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,I]),b=e.mat2d.multiply(Array.of(0,0,0,0,0,0),b,e.mat2d.fromValues(1,Math.tan(M),Math.tan(g),1,0,0)),b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[-A,-I]),this.transform(u,b);}},{key:"isPointCollision",value:function isPointCollision(u,_ref50){var _this$v;var _ref51=_slicedToArray(_ref50,2),g=_ref51[0],M=_ref51[1];var A=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var I=this.getTransform(u),b=Object(i.transformPoint)([g,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),I));return(_this$v=this[v]).isPointCollision.apply(_this$v,_toConsumableArray(b).concat([A]));}},{key:"isPointInFill",value:function isPointInFill(u,_ref52){var _ref53=_slicedToArray(_ref52,2),g=_ref53[0],M=_ref53[1];return this.isPointCollision(u,[g,M],"fill");}},{key:"isPointInStroke",value:function isPointInStroke(u,_ref54){var _ref55=_slicedToArray(_ref54,2),g=_ref55[0],M=_ref55[1];return this.isPointCollision(u,[g,M],"stroke");}}]);}();},/* 30 */ /***/function(h,r,t){t.r(r),t.d(r,"multiply",function(){return n;}),t.d(r,"grayscale",function(){return i;}),t.d(r,"brightness",function(){return a;}),t.d(r,"saturate",function(){return s;}),t.d(r,"contrast",function(){return o;}),t.d(r,"invert",function(){return f;}),t.d(r,"sepia",function(){return v;}),t.d(r,"opacity",function(){return l;}),t.d(r,"hueRotate",function(){return p;});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(y,O){var x=[],m=y[0],T=y[1],c=y[2],d=y[3],u=y[4],g=y[5],M=y[6],A=y[7],I=y[8],b=y[9],E=y[10],L=y[11],D=y[12],R=y[13],C=y[14],W=y[15],z=y[16],H=y[17],X=y[18],Z=y[19];var j=O[0],G=O[1],Q=O[2],tt=O[3],et=O[4];return x[0]=j*m+G*g+Q*E+tt*W,x[1]=j*T+G*M+Q*L+tt*z,x[2]=j*c+G*A+Q*D+tt*H,x[3]=j*d+G*I+Q*R+tt*X,x[4]=j*u+G*b+Q*C+tt*Z+et,j=O[5],G=O[6],Q=O[7],tt=O[8],et=O[9],x[5]=j*m+G*g+Q*E+tt*W,x[6]=j*T+G*M+Q*L+tt*z,x[7]=j*c+G*A+Q*D+tt*H,x[8]=j*d+G*I+Q*R+tt*X,x[9]=j*u+G*b+Q*C+tt*Z+et,j=O[10],G=O[11],Q=O[12],tt=O[13],et=O[14],x[10]=j*m+G*g+Q*E+tt*W,x[11]=j*T+G*M+Q*L+tt*z,x[12]=j*c+G*A+Q*D+tt*H,x[13]=j*d+G*I+Q*R+tt*X,x[14]=j*u+G*b+Q*C+tt*Z+et,j=O[15],G=O[16],Q=O[17],tt=O[18],et=O[19],x[15]=j*m+G*g+Q*E+tt*W,x[16]=j*T+G*M+Q*L+tt*z,x[17]=j*c+G*A+Q*D+tt*H,x[18]=j*d+G*I+Q*R+tt*X,x[19]=j*u+G*b+Q*C+tt*Z+et,x;}function i(y){y=Object(e.clamp)(0,1,y);var O=0.2126*y,x=0.7152*y,m=0.0722*y;return[O+1-y,x,m,0,0,O,x+1-y,m,0,0,O,x,m+1-y,0,0,0,0,0,1,0];}function a(y){return[y,0,0,0,0,0,y,0,0,0,0,0,y,0,0,0,0,0,1,0];}function s(y){var O=0.2126*(1-y),x=0.7152*(1-y),m=0.0722*(1-y);return[O+y,x,m,0,0,O,x+y,m,0,0,O,x,m+y,0,0,0,0,0,1,0];}function o(y){var O=0.5*(1-y);return[y,0,0,0,O,0,y,0,0,O,0,0,y,0,O,0,0,0,1,0];}function f(y){var O=1-2*y;return[O,0,0,0,y,0,O,0,0,y,0,0,O,0,y,0,0,0,1,0];}function v(y){return[1-0.607*y,0.769*y,0.189*y,0,0,0.349*y,1-0.314*y,0.168*y,0,0,0.272*y,0.534*y,1-0.869*y,0,0,0,0,0,1,0];}function l(y){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,y,0];}function p(y){var O=y/180*Math.PI,x=Math.cos(O),m=Math.sin(O),T=0.2126,c=0.7152,d=0.0722;return[T+x*(1-T)+m*-T,c+x*-c+m*-c,d+x*-d+m*(1-d),0,0,T+x*-T+m*0.143,c+x*(1-c)+m*0.14,d+x*-d+m*-0.283,0,0,T+x*-T+m*-(1-T),c+x*-c+m*c,d+x*(1-d)+m*d,0,0,0,0,0,1,0];}},/* 31 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);function i(a){var s=n()(a);if(!s||!s.length)throw new TypeError("Invalid color value.");return[s[0]/255,s[1]/255,s[2]/255,s[3]];}},/* 32 */ /***/function(h,r,t){var e=t(33),n=t(37),i=t(39);h.exports=function(s){var o,f=e(s);return f.space?(o=Array(3),o[0]=i(f.values[0],0,255),o[1]=i(f.values[1],0,255),o[2]=i(f.values[2],0,255),f.space[0]==="h"&&(o=n.rgb(o)),o.push(i(f.alpha,0,1)),o):[];};},/* 33 */ /***/function(h,r,t){(function(e){var n=t(34),i=t(35),a=t(36);h.exports=o;var s={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function o(f){var v,l=[],p=1,y;if(typeof f=="string"){if(n[f])l=n[f].slice(),y="rgb";else if(f==="transparent")p=0,y="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(f)){var O=f.slice(1),x=O.length,m=x<=4;p=1,m?(l=[parseInt(O[0]+O[0],16),parseInt(O[1]+O[1],16),parseInt(O[2]+O[2],16)],x===4&&(p=parseInt(O[3]+O[3],16)/255)):(l=[parseInt(O[0]+O[1],16),parseInt(O[2]+O[3],16),parseInt(O[4]+O[5],16)],x===8&&(p=parseInt(O[6]+O[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),y="rgb";}else if(v=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(f)){var T=v[1],c=T==="rgb",O=T.replace(/a$/,"");y=O;var x=O==="cmyk"?4:O==="gray"?1:3;l=v[2].trim().split(/\s*,\s*/).map(function(M,A){if(/%$/.test(M))return A===x?parseFloat(M)/100:O==="rgb"?parseFloat(M)*255/100:parseFloat(M);if(O[A]==="h"){if(/deg$/.test(M))return parseFloat(M);if(s[M]!==void 0)return s[M];}return parseFloat(M);}),T===O&&l.push(1),p=c||l[x]===void 0?1:l[x],l=l.slice(0,x);}else f.length>10&&/[0-9](?:\s|\/)/.test(f)&&(l=f.match(/([0-9]+)/g).map(function(u){return parseFloat(u);}),y=f.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(f))y="rgb",l=[f>>>16,(f&65280)>>>8,f&255];else if(i(f)){var d=a(f.r,f.red,f.R,null);d!==null?(y="rgb",l=[d,a(f.g,f.green,f.G),a(f.b,f.blue,f.B)]):(y="hsl",l=[a(f.h,f.hue,f.H),a(f.s,f.saturation,f.S),a(f.l,f.lightness,f.L,f.b,f.brightness)]),p=a(f.a,f.alpha,f.opacity,1),f.opacity!=null&&(p/=100);}else(Array.isArray(f)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(f))&&(l=[f[0],f[1],f[2]],y="rgb",p=f.length===4?f[3]:1);return{space:y,values:l,alpha:p};}}).call(this,t(22));},/* 34 */ /***/function(h,r,t){h.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(h,r,t){var e=Object.prototype.toString;h.exports=function(n){var i;return e.call(n)==="[object Object]"&&(i=Object.getPrototypeOf(n),i===null||i===Object.getPrototypeOf({}));};},/* 36 */ /***/function(h,r){h.exports=function(){for(var t=0;t<arguments.length;t++)if(arguments[t]!==void 0)return arguments[t];};},/* 37 */ /***/function(h,r,t){var e=t(38);h.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function rgb(n){var i=n[0]/360,a=n[1]/100,s=n[2]/100,o,f,v,l,p;if(a===0)return p=s*255,[p,p,p];s<0.5?f=s*(1+a):f=s+a-s*a,o=2*s-f,l=[0,0,0];for(var y=0;y<3;y++)v=i+1/3*-(y-1),v<0?v++:v>1&&v--,6*v<1?p=o+(f-o)*6*v:2*v<1?p=f:3*v<2?p=o+(f-o)*(2/3-v)*6:p=o,l[y]=p*255;return l;}},e.hsl=function(n){var i=n[0]/255,a=n[1]/255,s=n[2]/255,o=Math.min(i,a,s),f=Math.max(i,a,s),v=f-o,l,p,y;return f===o?l=0:i===f?l=(a-s)/v:a===f?l=2+(s-i)/v:s===f&&(l=4+(i-a)/v),l=Math.min(l*60,360),l<0&&(l+=360),y=(o+f)/2,f===o?p=0:y<=0.5?p=v/(f+o):p=v/(2-f-o),[l,p*100,y*100];};},/* 38 */ /***/function(h,r,t){h.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};},/* 39 */ /***/function(h,r){h.exports=t;function t(e,n,i){return n<i?e<n?n:e>i?i:e:e<i?i:e>n?n:e;}},/* 40 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return d;});var e=t(41),n=/* @__PURE__ */t.n(e),i=t(42),a=/* @__PURE__ */t.n(i),s=t(43),o=/* @__PURE__ */t.n(s),f=t(44),v=t(46),l=/* @__PURE__ */t.n(v),p=t(53),y=t(55);t(1).glMatrix.setMatrixArrayType(Array);var O=Symbol("contours"),x=Symbol("path"),m=Symbol("simplify"),T=Symbol("scale"),c=2*Math.PI;var d=/*#__PURE__*/function(){function d(){var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,d);typeof g=="string"&&(g={path:g}),g.path?this[x]=n()(g.path):this[x]=[],this[O]=null,this[m]=g.simplify!=null?g.simplify:0,this[T]=g.scale!=null?g.scale:2;}return _createClass(d,[{key:"contours",get:function get(){var g=null;if(!this[O]&&this[x]){var M=Object(f["default"])(o()(this[x]));this[O]=l()(M,this[T],this[m]),this[O].path=M,this[O].simplify=this[m],this[O].scale=this[T];}return this[O]&&(g=this[O].map(function(M){return _toConsumableArray(M);}),g.path=this[O].path,g.simplify=this[O].simplify,g.scale=this[O].scale),g;}},{key:"path",get:function get(){return this[x];}},{key:"simplify",get:function get(){return this[m];}},{key:"boundingBox",get:function get(){var g=this.contours;if(g&&g.length){var M=g.reduce(function(A,I){return[].concat(_toConsumableArray(A),_toConsumableArray(I));});return a()(M);}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var g=this.boundingBox;return g?[0.5*(g[0][0]+g[1][0]),0.5*(g[0][1]+g[1][1])]:[0,0];}},{key:"normalize",value:function normalize(){var _this$x;var g=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var M=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var A=Object(f["default"])(o()(this[x])).map(function(_ref56){var _ref57=_toArray(_ref56),I=_ref57[0],b=_ref57.slice(1);var E=[I];for(var L=0;L<b.length;L+=2){var D=b[L]-g,R=b[L+1]-M;E.push(D,R);}return E;});return this.beginPath(),(_this$x=this[x]).push.apply(_this$x,_toConsumableArray(A)),this;}},{key:"getPointAtLength",value:function getPointAtLength(g){return this.contours?Object(p.getPointAtLength)(this[O],g):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(p.getTotalLength)(this[O]):0;}},{key:"addPath",value:function addPath(g){var _this$x2;this[O]=null,typeof g=="string"&&(g=n()(g)),(_this$x2=this[x]).push.apply(_this$x2,_toConsumableArray(g));}},{key:"beginPath",value:function beginPath(){this[x]=[],this[O]=null;}},{key:"clear",value:function clear(){this.beginPath();}},{key:"ellipse",value:function ellipse(g,M,A,I,b,E,L){var D=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(E+=b,L+=b,A<=0||I<=0||L===E)return;L<E&&(L=E+c+(L-E)%c),L-E>c&&(L=E+c);var R=L-E;R>=c&&(L-=1e-3);var C=this[x].length>0&&R<c?"L":"M";var W=Object(y.getPoint)(g,M,A,I,E),z=Object(y.getPoint)(g,M,A,I,L),H=+!D;var X=R>Math.PI?1:0;D&&(X=1-X),C+=W.join(" "),C+="A".concat(A," ").concat(I," 0 ").concat(X," ").concat(H," ").concat(z.join(" ")),R>=c&&(C+="Z"),this.addPath(C);}},{key:"arc",value:function arc(g,M,A,I,b){var E=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(g,M,A,A,0,I,b,E);}},{key:"arcTo",value:function arcTo(g,M,A,I,b,E,L){this[O]=null,this[x].push(["A",g,M,A,I,b,E,L]);}},{key:"moveTo",value:function moveTo(g,M){this[O]=null,this[x].push(["M",g,M]);}},{key:"lineTo",value:function lineTo(g,M){this[O]=null,this[x].push(["L",g,M]);}},{key:"bezierCurveTo",value:function bezierCurveTo(g,M,A,I,b,E){this[O]=null,this[x].push(["C",g,M,A,I,b,E]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(g,M,A,I){this[O]=null,this[x].push(["Q",g,M,A,I]);}},{key:"rect",value:function rect(g,M,A,I){var b="M".concat(g," ").concat(M,"L").concat(g+A," ").concat(M,"L").concat(g+A," ").concat(M+I,"L").concat(g," ").concat(M+I,"Z");this.addPath(b);}},{key:"closePath",value:function closePath(){this[O]=null;var g=[];var M=this[x].length;M>0&&(g=this[x][M-1]),g[0]!=="Z"&&g[0]!=="z"&&this[x].push(["Z"]);}}]);}();},/* 41 */ /***/function(h,r){h.exports=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(s){var o=[];return s.replace(e,function(f,v,l){var p=v.toLowerCase();for(l=a(l),p=="m"&&l.length>2&&(o.push([v].concat(l.splice(0,2))),p="l",v=v=="m"?"l":"L");;){if(l.length==t[p])return l.unshift(v),o.push(l);if(l.length<t[p])throw new Error("malformed path data");o.push([v].concat(l.splice(0,t[p])));}}),o;}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function a(s){var o=s.match(i);return o?o.map(Number):[];}},/* 42 */ /***/function(h,r,t){h.exports=e;function e(n){var i=n.length;if(i===0)return[[],[]];for(var a=n[0].length,s=n[0].slice(),o=n[0].slice(),f=1;f<i;++f)for(var v=n[f],l=0;l<a;++l){var p=v[l];s[l]=Math.min(s[l],p),o[l]=Math.max(o[l],p);}return[s,o];}},/* 43 */ /***/function(h,r){h.exports=t;function t(e){var n=0,i=0,a=0,s=0;return e.map(function(o){o=o.slice();var f=o[0],v=f.toUpperCase();if(f!=v)switch(o[0]=v,f){case"a":o[6]+=a,o[7]+=s;break;case"v":o[1]+=s;break;case"h":o[1]+=a;break;default:for(var l=1;l<o.length;)o[l++]+=a,o[l++]+=s;}switch(v){case"Z":a=n,s=i;break;case"H":a=o[1];break;case"V":s=o[1];break;case"M":a=n=o[1],s=i=o[2];break;default:a=o[o.length-2],s=o[o.length-1];}return o;});}},/* 44 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(45);t(1).glMatrix.setMatrixArrayType(Array);function n(s){for(var o,f=[],v=0,l=0,p=0,y=0,O=null,x=null,m=0,T=0,c=0,d=s.length;c<d;c++){var u=s[c],g=u[0];switch(g){case"M":p=u[1],y=u[2];break;case"A":var M=Object(e["default"])(m,T,u[6],u[7],u[4],u[5],u[1],u[2],u[3]);if(!M.length)continue;M=M.map(function(L){var _L8=_slicedToArray(L,8),D=_L8[0],R=_L8[1],C=_L8[2],W=_L8[3],z=_L8[4],H=_L8[5],X=_L8[6],Z=_L8[7];return{x1:C,y1:W,x2:z,y2:H,x:X,y:Z};});for(var A=0,I;A<M.length;A++)I=M[A],u=["C",I.x1,I.y1,I.x2,I.y2,I.x,I.y],A<M.length-1&&f.push(u);break;case"S":var b=m,E=T;(o=="C"||o=="S")&&(b+=b-v,E+=E-l),u=["C",b,E,u[1],u[2],u[3],u[4]];break;case"T":o=="Q"||o=="T"?(O=m*2-O,x=T*2-x):(O=m,x=T),u=a(m,T,O,x,u[1],u[2]);break;case"Q":O=u[1],x=u[2],u=a(m,T,u[1],u[2],u[3],u[4]);break;case"L":u=i(m,T,u[1],u[2]);break;case"H":u=i(m,T,u[1],T);break;case"V":u=i(m,T,m,u[1]);break;case"Z":u=i(m,T,p,y);break;}o=g,m=u[u.length-2],T=u[u.length-1],u.length>4?(v=u[u.length-4],l=u[u.length-3]):(v=m,l=T),f.push(u);}return f;}function i(s,o,f,v){return["C",s,o,f,v,f,v];}function a(s,o,f,v,l,p){return["C",s/3+2/3*f,o/3+2/3*v,l/3+2/3*f,p/3+2/3*v,l,p];}},/* 45 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(o,f,v,l){var p=o*l-f*v<0?-1:1;var y=o*v+f*l;return y>1&&(y=1),y<-1&&(y=-1),p*Math.acos(y);}function i(o,f,v,l,p,y,O,x,m,T){var c=T*(o-v)/2+m*(f-l)/2,d=-m*(o-v)/2+T*(f-l)/2,u=O*O,g=x*x,M=c*c,A=d*d;var I=u*g-u*A-g*M;I<0&&(I=0),I/=u*A+g*M,I=Math.sqrt(I)*(p===y?-1:1);var b=I*O/x*d,E=I*-x/O*c,L=T*b-m*E+(o+v)/2,D=m*b+T*E+(f+l)/2,R=(c-b)/O,C=(d-E)/x,W=(-c-b)/O,z=(-d-E)/x,H=n(1,0,R,C);var X=n(R,C,W,z);return y===0&&X>0&&(X-=e),y===1&&X<0&&(X+=e),[L,D,H,X];}function a(o,f){var v=1.3333333333333333*Math.tan(f/4),l=Math.cos(o),p=Math.sin(o),y=Math.cos(o+f),O=Math.sin(o+f);return[l,p,l-p*v,p+l*v,y+O*v,O-y*v,y,O];}function s(o,f,v,l,p,y,O,x,m){var T=Math.sin(m*e/360),c=Math.cos(m*e/360),d=c*(o-v)/2+T*(f-l)/2,u=-T*(o-v)/2+c*(f-l)/2;if(d===0&&u===0)return[];if(O===0||x===0)return[];O=Math.abs(O),x=Math.abs(x);var g=d*d/(O*O)+u*u/(x*x);g>1&&(O*=Math.sqrt(g),x*=Math.sqrt(g));var M=i(o,f,v,l,p,y,O,x,T,c),A=[];var I=M[2],b=M[3];var E=Math.max(Math.ceil(Math.abs(b)/(e/4)),1);b/=E;for(var L=0;L<E;L++)A.push(a(I,b)),I+=b;return A.map(function(L){for(var D=0;D<L.length;D+=2){var R=L[D+0],C=L[D+1];R*=O,C*=x;var W=c*R-T*C,z=T*R+c*C;L[D+0]=W+M[0],L[D+1]=z+M[1];}return L;});}},/* 46 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(47),_t2=t(49),n=_t2.copy,i=t(50);function a(l,p,y){return l[0]=p,l[1]=y,l;}var s=[0,0],o=[0,0],f=[0,0];function v(l,p,y,O){e(y,a(s,O[1],O[2]),a(o,O[3],O[4]),a(f,O[5],O[6]),p,l);}h.exports=function(p,y,O){var x=[],m=[],T=[0,0];return p.forEach(function(c,d,u){if(c[0]==="M")n(T,c.slice(1)),m.length>0&&(x.push(m),m=[]);else if(c[0]==="C")v(m,y,T,c),a(T,c[5],c[6]);else throw new Error("illegal type in SVG: "+c[0]);}),m.length>0&&x.push(m),x.map(function(c){return i(c,O||0);});};},/* 47 */ /***/function(h,r,t){h.exports=t(48)();},/* 48 */ /***/function(h,r){function t(n){return[n[0],n[1]];}function e(n,i){return[n,i];}h.exports=function(i){i=i||{};var a=typeof i.recursion=="number"?i.recursion:8,s=typeof i.epsilon=="number"?i.epsilon:11920929e-14,o=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,f=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,v=i.angleTolerance||0,l=i.cuspLimit||0;return function(x,m,T,c,d,u){u||(u=[]),d=typeof d=="number"?d:1;var g=o/d;return g*=g,p(x,m,T,c,u,g),u;};function p(O,x,m,T,c,d){c.push(t(O));var u=O[0],g=O[1],M=x[0],A=x[1],I=m[0],b=m[1],E=T[0],L=T[1];y(u,g,M,A,I,b,E,L,c,d,0),c.push(t(T));}function y(O,x,m,T,c,d,u,g,M,A,I){if(!(I>a)){var b=Math.PI,E=(O+m)/2,L=(x+T)/2,D=(m+c)/2,R=(T+d)/2,C=(c+u)/2,W=(d+g)/2,z=(E+D)/2,H=(L+R)/2,X=(D+C)/2,Z=(R+W)/2,j=(z+X)/2,G=(H+Z)/2;if(I>0){var Q=u-O,tt=g-x,et=Math.abs((m-u)*tt-(T-g)*Q),at=Math.abs((c-u)*tt-(d-g)*Q),q,pt;if(et>s&&at>s){if((et+at)*(et+at)<=A*(Q*Q+tt*tt)){if(v<f){M.push(e(j,G));return;}var dt=Math.atan2(d-T,c-m);if(q=Math.abs(dt-Math.atan2(T-x,m-O)),pt=Math.abs(Math.atan2(g-d,u-c)-dt),q>=b&&(q=2*b-q),pt>=b&&(pt=2*b-pt),q+pt<v){M.push(e(j,G));return;}if(l!==0){if(q>l){M.push(e(m,T));return;}if(pt>l){M.push(e(c,d));return;}}}}else if(et>s){if(et*et<=A*(Q*Q+tt*tt)){if(v<f){M.push(e(j,G));return;}if(q=Math.abs(Math.atan2(d-T,c-m)-Math.atan2(T-x,m-O)),q>=b&&(q=2*b-q),q<v){M.push(e(m,T)),M.push(e(c,d));return;}if(l!==0&&q>l){M.push(e(m,T));return;}}}else if(at>s){if(at*at<=A*(Q*Q+tt*tt)){if(v<f){M.push(e(j,G));return;}if(q=Math.abs(Math.atan2(g-d,u-c)-Math.atan2(d-T,c-m)),q>=b&&(q=2*b-q),q<v){M.push(e(m,T)),M.push(e(c,d));return;}if(l!==0&&q>l){M.push(e(c,d));return;}}}else if(Q=j-(O+u)/2,tt=G-(x+g)/2,Q*Q+tt*tt<=A){M.push(e(j,G));return;}}y(O,x,E,L,z,H,j,G,M,A,I+1),y(j,G,X,Z,C,W,u,g,M,A,I+1);}}};},/* 49 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return i;}),t.d(r,"clone",function(){return n;}),t.d(r,"copy",function(){return a;}),t.d(r,"scaleAndAdd",function(){return s;}),t.d(r,"dot",function(){return o;}),t.d(r,"rotate",function(){return f;}),t.d(r,"cross",function(){return v;}),t.d(r,"sub",function(){return l;}),t.d(r,"add",function(){return p;}),t.d(r,"computeMiter",function(){return m;}),t.d(r,"normal",function(){return T;}),t.d(r,"direction",function(){return c;});var e=t(1);t(1).glMatrix.setMatrixArrayType(Array);function n(d){return[d[0],d[1]];}function i(){return[0,0];}var a=e.vec2.copy,s=e.vec2.scaleAndAdd,o=e.vec2.dot,f=e.vec2.rotate,v=e.vec2.cross,l=e.vec2.sub,p=e.vec2.add,y=e.vec2.normalize,O=e.vec2.set,x=i();function m(d,u,g,M,A){p(d,g,M),y(d,d),O(u,-d[1],d[0]),O(x,-g[1],g[0]);var I=A/o(u,x);return Math.abs(I);}function T(d,u){return O(d,-u[1],u[0]),d;}function c(d,u,g){return l(d,u,g),y(d,d),d;}},/* 50 */ /***/function(h,r,t){var e=t(51),n=t(52);h.exports=function(a,s){return a=e(a,s),a=n(a,s),a;},h.exports.radialDistance=e,h.exports.douglasPeucker=n;},/* 51 */ /***/function(h,r){function t(e,n){var i=e[0]-n[0],a=e[1]-n[1];return i*i+a*a;}h.exports=function(n,i){if(n.length<=1)return n;i=typeof i=="number"?i:1;for(var a=i*i,s=n[0],o=[s],f,v=1,l=n.length;v<l;v++)f=n[v],t(f,s)>a&&(o.push(f),s=f);return s!==f&&o.push(f),o;};},/* 52 */ /***/function(h,r){function t(n,i,a){var s=i[0],o=i[1],f=a[0]-s,v=a[1]-o;if(f!==0||v!==0){var l=((n[0]-s)*f+(n[1]-o)*v)/(f*f+v*v);l>1?(s=a[0],o=a[1]):l>0&&(s+=f*l,o+=v*l);}return f=n[0]-s,v=n[1]-o,f*f+v*v;}function e(n,i,a,s,o){for(var f=s,v,l=i+1;l<a;l++){var p=t(n[l],n[i],n[a]);p>f&&(v=l,f=p);}f>s&&(v-i>1&&e(n,i,v,s,o),o.push(n[v]),a-v>1&&e(n,v,a,s,o));}h.exports=function(i,a){if(i.length<=1)return i;a=typeof a=="number"?a:1;var s=a*a,o=i.length-1,f=[i[0]];return e(i,0,o,s,f),f.push(i[o]),f;};},/* 53 */ /***/function(h,r,t){t.r(r),t.d(r,"getTotalLength",function(){return n;}),t.d(r,"getPointAtLength",function(){return a;}),t.d(r,"getDashContours",function(){return s;});var e=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(o){if(o.totalLength!=null)return o.totalLength;var f=0;return o.forEach(function(v){var l=v[0];for(var p=1;p<v.length;p++){var y=v[p];f+=Object(e.distance)(l,y),l=y;}}),o.totalLength=f,f;}function i(o,f){var v=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;if(f=Number(f),!Number.isFinite(f))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(f<=0)throw new TypeError("Length must > 0");var l=n(o);if(f>=l){var y=o[o.length-1],O=y[y.length-2],x=y[y.length-1],m=Math.atan2(x[1]-O[1],x[0]-O[0]);return{current:o.map(function(T){return _toConsumableArray(T);}),point:{x:x[0],y:x[1],angle:m}};}var p=[];for(var _y2=0;_y2<o.length;_y2++){p[_y2]=[];var _O=o[_y2];var _x10=_O[0];for(var _m4=1;_m4<_O.length;_m4++){var _T12=_O[_m4],_c11=Object(e.distance)(_x10,_T12);if(f<_c11){var d=f/_c11,u=Math.atan2(_T12[1]-_x10[1],_T12[0]-_x10[0]),g={x:_x10[0]*(1-d)+_T12[0]*d,y:_x10[1]*(1-d)+_T12[1]*d,angle:u};if(p[_y2].push(_x10),f>0&&p[_y2].push([g.x,g.y]),!v)return{current:p,point:g};var M=[],A=_y2;for(;_y2<o.length;_y2++){for(M[_y2-A]=[],_y2===A&&M[0].push([g.x,g.y]);_m4<_O.length;_m4++)M[_y2-A].push(_O[_m4]);_m4=0;}return{current:p,point:g,rest:M};}f-=_c11,p[_y2].push(_x10),_x10=_T12;}}}function a(o,f){if(f=Number(f),!Number.isFinite(f))throw new TypeError("Failed to execute 'getPointAtLength' on figure: The provided float value is non-finite.");if(o.length<=0)return{x:0,y:0,angle:0};if(f<=0){var v=o[0][0],l=o[0][1],p=Math.atan2(l[1]-v[1],l[0]-v[0]);return{x:v[0],y:v[1],angle:p};}return i(o,f,!1).point;}function s(o,f,v){var l=0,p=f[0],y=o;var O=[],x=f.length;if(v>0){do v-=f[l%x],l++;while(v>0);v<0&&(p=-v,l--);}else if(v<0){l=-1;do v+=f[l%x+x-1],l--;while(v<0);v>=0&&(l++,p=f[l%x+x-1]-v);}do{var m=i(y,p);y=m.rest,++l%2&&O.push.apply(O,_toConsumableArray(m.current));var _T13=l%x;_T13<0&&(_T13+=x),p=f[_T13];}while(y);return O;}},/* 54 */ /***/function(h,r,t){t.r(r),t.d(r,"normalize",function(){return e;}),t.d(r,"distance",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(_ref58,o,f,v){var _ref59=_slicedToArray(_ref58,3),i=_ref59[0],a=_ref59[1],s=_ref59[2];return i=i*2/o-1,a=1-a*2/f,Number.isFinite(v)?(s=s*2/v-1,[i,a,s]):[i,a];}function n(_ref60,_ref61){var _ref62=_slicedToArray(_ref60,3),i=_ref62[0],a=_ref62[1],_ref62$=_ref62[2],s=_ref62$===void 0?0:_ref62$;var _ref63=_slicedToArray(_ref61,3),o=_ref63[0],f=_ref63[1],_ref63$=_ref63[2],v=_ref63$===void 0?0:_ref63$;return Math.hypot(o-i,f-a,v-s);}},/* 55 */ /***/function(h,r,t){t.r(r),t.d(r,"getPoint",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(i,a,s,o,f){f%=e,f<0&&(f+=e);var v=Math.tan(f);if(Math.abs(v)<1e5){var l=a-v*i,p=1/Math.pow(s,2)+Math.pow(v,2)/Math.pow(o,2);var y=-1;(f<=Math.PI/2||f>3*Math.PI/2)&&(y=1);var O=y*Math.sqrt(1/p)+i,x=v*O+l;return[O,x];}return f<Math.PI?[i,a+o]:[i,a-o];}},/* 56 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return V;});var e=t(1),n=t(42),i=/* @__PURE__ */t.n(n),a=t(57),s=t(28),o=t(24),f=t(30),v=t(59),l=t(53),p=t(60),y=/* @__PURE__ */t.n(p),O=t(46),x=/* @__PURE__ */t.n(O),m=t(31),T=t(40),c=t(21);t(1).glMatrix.setMatrixArrayType(Array);function d(J,N){if(J==null)return{};var $=u(J,N),S,P;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(J);for(P=0;P<w.length;P++)S=w[P],!(N.indexOf(S)>=0)&&Object.prototype.propertyIsEnumerable.call(J,S)&&($[S]=J[S]);}return $;}function u(J,N){if(J==null)return{};var $={},S=Object.keys(J),P,w;for(w=0;w<S.length;w++)P=S[w],!(N.indexOf(P)>=0)&&($[P]=J[P]);return $;}var g=Symbol("mesh"),M=Symbol("contours"),A=Symbol("stroke"),I=Symbol("fill"),b=Symbol("strokeColor"),E=Symbol("fillColor"),L=Symbol("transform"),D=Symbol("invertTransform"),R=Symbol("uniforms"),C=Symbol("texOptions"),W=Symbol("blend"),z=Symbol("applyTexture"),H=Symbol("applyTransform"),X=Symbol("applyGradientTransform"),Z=Symbol("applyProgram"),j=Symbol("gradient"),G=Symbol("filter"),Q=Symbol("opacity"),tt=Symbol("program"),et=Symbol("attributes"),at=Symbol("pass"),q=Symbol("clipContext"),pt=Symbol("applyClipPath");function dt(J,N){var $=J[1][0]-J[0][0],S=J[1][1]-J[0][1],P=[];for(var w=0;w<N.length;w++){var U=N[w],K=[(U[0]-J[0][0])/$,1-(U[1]-J[0][1])/S];P.push(K);}return P;}function B(_ref64,_ref65,_ref66){var _ref67=_slicedToArray(_ref64,2),J=_ref67[0],N=_ref67[1];var _ref68=_slicedToArray(_ref65,4),$=_ref68[0],S=_ref68[1],P=_ref68[2],w=_ref68[3];var U=_ref66.scale;return U||(J/=P,N=1-N/w,J-=$,N+=S),[J,N,0];}function F(J,N,$){var S=x()(J,N,$);return S.path=J,S.simplify=$,S.scale=N,S;}var V=/*#__PURE__*/function(){function V(N){_classCallCheck(this,V);this[A]=null,this[I]=null,this[L]=[1,0,0,1,0,0],this[Q]=1,this[R]={},this[G]=[],this[W]=null,this[C]={},this.contours=N.contours,this[tt]=null,this[et]={},this[at]=[];}return _createClass(V,[{key:"contours",get:function get(){return this[M];},set:function set(N){this[g]=null,this[M]=N;var $=N.scale;this.transformScale/$>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(N){this[tt]=N,this[g]&&this[Z](N);}},{key:"program",get:function get(){return this[tt];}},{key:"setAttribute",value:function setAttribute(N,$){$==null?delete this[et][N]:this[et][N]=$;}},{key:"getOpacity",value:function getOpacity(){return this[Q];}},{key:"setOpacity",value:function setOpacity(N){if(N<0||N>1)throw new TypeError("Invalid opacity value.");this[g]&&this[g].positions.forEach(function($){$[2]=1/$[2]>0?N:-N;}),this[Q]=N;}},{key:"setClipPath",value:function setClipPath(N){this.clipPath=N,this[R].u_clipSampler&&this[R].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[g]&&delete this[g].attributes.a_clipUV,N&&this[g]&&this[pt]();}},{key:pt,value:function value(){if(this.clipPath){this[q]||(this[q]=c["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),N=_this$boundingBox$[0],$=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),S=_this$boundingBox$2[0],P=_this$boundingBox$2[1];S&&P&&(this[q].width=S-N,this[q].height=P-$);var w=this[q].getContext("2d"),U=new Path2D(this.clipPath);w.clearRect(0,0,this[q].width,this[q].height),w.save(),w.translate(-N,-$),w.fillStyle="white",w.fill(U),w.restore(),this[g].clipPath=this[q];var K=dt(this.boundingBox,this[g].position0);this[g].attributes.a_clipUV=K;}}},{key:"getPointAtLength",value:function getPointAtLength(N){return Object(l.getPointAtLength)(this[M],N);}},{key:"getTotalLength",value:function getTotalLength(){return Object(l.getTotalLength)(this[M]);}},{key:"blend",get:function get(){return this[W]==null?"auto":this[W];}},{key:"blend",set:function set(N){this[W]=N,this[g]&&(this[g].enableBlend=this.enableBlend);}},{key:"boundingBox",get:function get(){if(this[g]&&this[g].boundingBox)return this[g].boundingBox;var N=this.meshData;if(N){var $=N.position0;if($.length)N.boundingBox=i()($);else return[[0,0],[0,0]];return N.boundingBox;}return[[0,0],[0,0]];}},{key:"boundingCenter",get:function get(){var N=this.boundingBox;return N?[0.5*(N[0][0]+N[1][0]),0.5*(N[0][1]+N[1][1])]:[0,0];}},{key:"fillRule",get:function get(){return this[I]?this[I].rule:"nonzero";}},{key:"lineWidth",get:function get(){return this[A]?this[A].lineWidth:0;}},{key:"lineCap",get:function get(){return this[A]?this[A].lineCap:"";}},{key:"lineJoin",get:function get(){return this[A]?this[A].lineJoin:"";}},{key:"miterLimit",get:function get(){return this[A]?this[A].miterLimit:0;}},{key:"strokeStyle",get:function get(){return this[b]&&this[b][3]!==0?Object(o["default"])(this[b]):"";}},{key:"lineDash",get:function get(){return this[A]?this[A].lineDash:null;}},{key:"lineDashOffset",get:function get(){return this[A]?this[A].lineDashOffset:0;}},{key:"fillStyle",get:function get(){return this[E]&&this[E][3]!==0?Object(o["default"])(this[E]):"";}},{key:"gradient",get:function get(){return this[j];}},{key:"texture",get:function get(){return this[R].u_texSampler?{image:this[R].u_texSampler._img,options:this[C]}:null;}},{key:"enableBlend",get:function get(){return this[W]===!0||this[W]===!1?this[W]:this[Q]<1||this[b]!=null&&this[b][3]<1||this[E]!=null&&this[E][3]<1||this[R].u_colorMatrix!=null&&this[R].u_colorMatrix[18]<1||this[R].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[G].join(" ");}},{key:"transformMatrix",get:function get(){return this[L];}},{key:"invertMatrix",get:function get(){if(!this[D]){var N=e.mat2d.invert(Array.of(0,0,0,0,0,0),this[L]);this[D]=N;}return this[D];}},{key:"transformScale",get:function get(){var N=this[L];return Math.max(Math.hypot(N[0],N[1]),Math.hypot(N[2],N[3]));}},{key:"uniforms",get:function get(){return this[R];}},{key:"pass",get:function get(){return this[at];}},{key:Z,value:function value(N){var $=this[et],S=this[g].position0,P=Object.entries(N._attribute);for(var w=0;w<P.length;w++){var _P$w=_slicedToArray(P[w],2),U=_P$w[0],K=_P$w[1];if(U!=="a_color"&&U!=="a_sourceRect"&&K!=="ignored"){var Y=$[U];if(U==="uv"&&!Y){var k=this[g].boundingBox||i()(S);this[g].attributes[U]=dt(k,S);}else{this[g].attributes[U]=[];for(var _k=0;_k<S.length;_k++){var rt=S[_k];this[g].attributes[U].push(Y?Y(rt,w,S):Array(K.size).fill(0));}}}}}// {stroke, fill}
|
|
51
|
+
},{key:"meshData",get:function get(){var _this9=this;if(this._updateMatrix&&this.transformScale/this.contours.scale>1.5&&this.accurate(this.transformScale),!this[g]){!this[I]&&!this[A]&&this.setFill();var N=this[M],$={};if(N&&N.length){if(this[I])try{var w=y()(N,this[I]);w.positions=w.positions.map(function(U){return U.push(_this9[Q]),U;}),w.attributes={a_color:Array.from({length:w.positions.length}).map(function(){return _this9[E].map(function(U){return Math.round(255*U);});})// a_sourceRect: Array.from({length: mesh.positions.length}).map(() => [0, 0, 0, 0]),
|
|
52
|
+
},$.fill=w;}catch(_unused8){}if(this[A]){var _w=this[A].lineDash;var U=N;if(_w){var Y=this[A].lineDashOffset;U=Object(l.getDashContours)(N,_w,Y);}var K=U.map(function(Y,k){var rt=Y.length>1&&e.vec2.equals(Y[0],Y[Y.length-1]),it=_this9[A].build(Y,rt);return y()([it]);});K.forEach(function(Y){Y.positions=Y.positions.map(function(k){return k.push(-_this9[Q]),k;}),Y.attributes={a_color:Array.from({length:Y.positions.length}).map(function(){return _this9[b].map(function(k){return Math.round(255*k);});})};}),$.stroke=Object(s["default"])(K);}}var S=Object(s["default"])([$.fill,$.stroke]);S.fillPointCount=$.fill?$.fill.positions.length:0,S.enableBlend=this.enableBlend,S.position0=S.positions.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),w=_ref70[0],U=_ref70[1],K=_ref70[2];return[w,U,K];}),S.uniforms=this[R],this[g]=S,this[R].u_texSampler&&this[z](S,this[C]);var P=this[L];Object(v.isUnitTransform)(P)||(this[H](S,P),this[R].u_radialGradientVector&&this[X]()),this.clipPath&&this[pt](),this[tt]&&this[Z](this[tt]);}return this._updateMatrix&&(this[g].matrix=this[L],this[H](this[g],this[L]),this[R].u_radialGradientVector&&this[X]()),this[g];}},{key:H,value:function value(N,$){var S=N.positions,P=N.position0;for(var w=0;w<S.length;w++){var _P$w2=_slicedToArray(P[w],2),U=_P$w2[0],K=_P$w2[1],Y=S[w];Y[0]=U*$[0]+K*$[2]+$[4],Y[1]=U*$[1]+K*$[3]+$[5];}this._updateMatrix=!1;}},{key:X,value:function value(){var N=this[L],$=_toConsumableArray(this._radialGradientVector);if($){var _$=_slicedToArray($,5),S=_$[0],P=_$[1],w=_$[3],U=_$[4];$[0]=S*N[0]+P*N[2]+N[4],$[1]=S*N[1]+P*N[3]+N[5],$[3]=w*N[0]+U*N[2]+N[4],$[4]=w*N[1]+U*N[3]+N[5],this[R].u_radialGradientVector=$;}}},{key:z,value:function value(N,$){function S(k,rt){return k==null&&rt==null?!0:k==null||rt==null?!1:k[0]===rt[0]&&k[1]===rt[1]&&k[2]===rt[2]&&k[3]===rt[3];}var P=this[R].u_texSampler;if(!P)return;var _P$_img=P._img,w=_P$_img.width,U=_P$_img.height,K=$.srcRect;var Y=$.rect||[0,0];if($.rotated&&(Y=[-Y[1],Y[0],Y[3],Y[2]]),Y[2]==null&&(Y[2]=K?K[2]:w),Y[3]==null&&(Y[3]=K?K[3]:U),$.hidden)N.textureCoord=N.positions.map(function(){return[-1,-1,-1];});else if(!N.textureCoord||!S(this[C].rect,$.rect)||this[C].hidden!==$.hidden||this[C].rotated!==$.rotated){var k=null;$.rotated&&(k=e.mat2d.rotate(Array.of(0,0,0,0,0,0),e.mat2d.fromValues(1,0,0,1,0,0),0.5*Math.PI),k=e.mat2d.translate(Array.of(0,0,0,0,0,0),k,[0,-Y[2]])),N.textureCoord=N.position0.map(function(_ref71){var _ref72=_slicedToArray(_ref71,3),rt=_ref72[0],it=_ref72[1],lt=_ref72[2];if(1/lt>0){if($.rotated){var ot=rt*k[0]+it*k[2]+k[4],st=rt*k[1]+it*k[3]+k[5];rt=ot;it=st;}var ut=B([rt,it],[Y[0]/Y[2],Y[1]/Y[3],Y[2],Y[3]],$);return $.repeat&&(ut[2]=1),ut;}return[-1,-1,-1];});}if(K){var _k2=[K[0]/w,K[1]/U,K[2]/w,K[3]/U];N.attributes.a_sourceRect=N.positions.map(function(){return[].concat(_k2);});}else N.attributes.a_sourceRect=N.positions.map(function(){return[0,0,0,0];});}},{key:"accurate",value:function accurate(N){if(!this.contours)return;if(this.contours.path){var S=this.contours.simplify,P=F(this.contours.path,2*N,S);this[g]=null,this[M]=P;}}},{key:"canIgnore",value:function canIgnore(){var N=this[A]==null||this[A].lineWidth===0||this[b][3]===0,$=this[I]==null||this[E][3]===0,S=this[R].u_radialGradientVector==null,P=this[R].u_texSampler==null;return this[Q]===0||this[tt]==null&&N&&$&&S&&P&&!this.beforeRender&&!this.afterRender;}// join: 'miter' or 'bevel'
|
|
53
|
+
// cap: 'butt' or 'square'
|
|
54
|
+
// lineDash: null
|
|
55
|
+
// lineDashOffset: 0
|
|
56
|
+
},{key:"setStroke",value:function setStroke(){var _ref73=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref73$thickness=_ref73.thickness,N=_ref73$thickness===void 0?1:_ref73$thickness,_ref73$cap=_ref73.cap,$=_ref73$cap===void 0?"butt":_ref73$cap,_ref73$join=_ref73.join,S=_ref73$join===void 0?"miter":_ref73$join,_ref73$miterLimit=_ref73.miterLimit,P=_ref73$miterLimit===void 0?10:_ref73$miterLimit,_ref73$color=_ref73.color,w=_ref73$color===void 0?[0,0,0,0]:_ref73$color,_ref73$lineDash=_ref73.lineDash,U=_ref73$lineDash===void 0?null:_ref73$lineDash,_ref73$lineDashOffset=_ref73.lineDashOffset,K=_ref73$lineDashOffset===void 0?0:_ref73$lineDashOffset,_ref73$roundSegments=_ref73.roundSegments,Y=_ref73$roundSegments===void 0?20:_ref73$roundSegments;return this[g]=null,this[A]=new a["default"]({lineWidth:N,lineCap:$,lineJoin:S,miterLimit:P,roundSegments:Y}),typeof w=="string"&&(w=Object(m["default"])(w)),this[b]=w,this[A].lineDash=U,this[A].lineDashOffset=K,this;}},{key:"setFill",value:function setFill(){var _ref74=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref74$rule=_ref74.rule,N=_ref74$rule===void 0?this.fillRule:_ref74$rule,_ref74$color=_ref74.color,$=_ref74$color===void 0?[0,0,0,0]:_ref74$color;return this[g]=null,this[I]={rule:N},typeof $=="string"&&($=Object(m["default"])($)),this[E]=$,this;}/**
|
|
57
|
+
options: {
|
|
58
|
+
scale: false,
|
|
59
|
+
repeat: false,
|
|
60
|
+
rotated: false,
|
|
61
|
+
rect: [10, 10],
|
|
62
|
+
srcRect: [...],
|
|
63
|
+
hidden: false,
|
|
64
|
+
}
|
|
65
|
+
*/},{key:"setTexture",value:function setTexture(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(N&&N.image){var _N=N,S=_N.image,P=_N.rect;if(N=S,$.rect)for(var w=0;w<$.rect.length;w++)P[w]=$.rect[w];$.rect=P;}return this[I]||this.setFill(),this.setUniforms({u_texSampler:N}),this[g]&&this[z](this[g],$),this[C]=$,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref75.vector,$=_ref75.colors,_ref75$type=_ref75.type,S=_ref75$type===void 0?"fill":_ref75$type;if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref76.vector,$=_ref76.colors,_ref76$type=_ref76.type,S=_ref76$type===void 0?"fill":_ref76$type;if(N.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:$,type:S});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref77.vector,$=_ref77.colors,_ref77$type=_ref77.type,S=_ref77$type===void 0?"fill":_ref77$type;if(N.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:$,type:S});}/**
|
|
66
|
+
vector: [x0, y0, r0, x1, y1, r1],
|
|
67
|
+
colors: [{offset:0, color}, {offset:1, color}, ...],
|
|
68
|
+
*/},{key:"setGradient",value:function setGradient(){var _ref78=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref78.vector,$=_ref78.colors,_ref78$type=_ref78.type,S=_ref78$type===void 0?"fill":_ref78$type;$=$.map(function(_ref79){var U=_ref79.offset,K=_ref79.color;return typeof K=="string"&&(K=Object(m["default"])(K)),{offset:U,color:K};}),this[j]=this[j]||{},this[j][S]={vector:N,colors:$},$.sort(function(U,K){return U.offset-K.offset;});var P=[];$.forEach(function(_ref80){var U=_ref80.offset,K=_ref80.color;P.push.apply(P,[U].concat(_toConsumableArray(K)));});var w;if(N.length===4?w=[N[0],N[1],0,N[2],N[3],0]:w=_toConsumableArray(N),P.length<40&&P.push(-1),P.length>40)throw new Error("Too many colors, should be less than 8 colors");return this._radialGradientVector=w,this[R].u_colorSteps=P,S==="fill"?this[R].u_gradientType=1:this[R].u_gradientType=0,this[X](),this;}},{key:"setUniforms",value:function setUniforms(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[R],N),this;}},{key:"setTransform",value:function setTransform(){var $=this[L];for(var _len3=arguments.length,N=new Array(_len3),_key3=0;_key3<_len3;_key3++){N[_key3]=arguments[_key3];}return e.mat2d.equals(N,$)||(this[L]=N,delete this[D],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var $=this[L];for(var _len4=arguments.length,N=new Array(_len4),_key4=0;_key4<_len4;_key4++){N[_key4]=arguments[_key4];}return this[L]=e.mat2d.multiply(Array.of(0,0,0,0,0,0),$,N),delete this[D],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(N,$){var S=e.mat2d.create();return S=e.mat2d.translate(Array.of(0,0,0,0,0,0),S,[N,$]),this.transform.apply(this,_toConsumableArray(S));}},{key:"rotate",value:function rotate(N){var _ref81=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref82=_slicedToArray(_ref81,2),$=_ref82[0],S=_ref82[1];var P=e.mat2d.create();return P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[$,S]),P=e.mat2d.rotate(Array.of(0,0,0,0,0,0),P,N),P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[-$,-S]),this.transform.apply(this,_toConsumableArray(P));}},{key:"scale",value:function scale(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref83=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref84=_slicedToArray(_ref83,2),S=_ref84[0],P=_ref84[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[S,P]),w=e.mat2d.scale(Array.of(0,0,0,0,0,0),w,[N,$]),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-S,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"skew",value:function skew(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:N;var _ref85=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref86=_slicedToArray(_ref85,2),S=_ref86[0],P=_ref86[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[S,P]),w=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,e.mat2d.fromValues(1,Math.tan($),Math.tan(N),1,0,0)),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-S,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[G].length=0,this;}},{key:"setColorTransform",value:function setColorTransform(){for(var _len5=arguments.length,N=new Array(_len5),_key5=0;_key5<_len5;_key5++){N[_key5]=arguments[_key5];}return N[0]===null?this.setUniforms({u_filterFlag:0,u_colorMatrix:0}):this.setUniforms({u_filterFlag:1,u_colorMatrix:N}),this;}// apply linear color transform
|
|
69
|
+
},{key:"transformColor",value:function transformColor(){var $=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,N=new Array(_len6),_key6=0;_key6<_len6;_key6++){N[_key6]=arguments[_key6];}return $?$=Object(f.multiply)($,N):$=N,this.setColorTransform.apply(this,_toConsumableArray($)),this;}},{key:"blur",value:function blur(N){return this[G].push("blur(".concat(N,"px)")),this;}},{key:"brightness",value:function brightness(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("brightness(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.brightness)(N)));}},{key:"contrast",value:function contrast(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("contrast(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.contrast)(N)));}},{key:"dropShadow",value:function dropShadow(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var P=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[0,0,0,1];return Array.isArray(P)&&(P=Object(o["default"])(P)),this[G].push("drop-shadow(".concat(N,"px ").concat($,"px ").concat(S,"px ").concat(P,")")),this;}},{key:"grayscale",value:function grayscale(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("grayscale(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.grayscale)(N)));}// https://github.com/phoboslab/WebGLImageFilter/blob/master/webgl-image-filter.js#L371
|
|
70
|
+
},{key:"hueRotate",value:function hueRotate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this[G].push("hue-rotate(".concat(N,"deg)")),this.transformColor.apply(this,_toConsumableArray(Object(f.hueRotate)(N)));}},{key:"invert",value:function invert(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("invert(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.invert)(N)));}},{key:"opacity",value:function opacity(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("opacity(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.opacity)(N)));}},{key:"saturate",value:function saturate(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("saturate(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.saturate)(N)));}},{key:"sepia",value:function sepia(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[G].push("sepia(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.sepia)(N)));}},{key:"url",value:function url(N){return this[G].push("url(".concat(N,")")),this;}},{key:"isPointCollision",value:function isPointCollision(N,$){var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var P=this.meshData,w=P.positions,U=P.cells,K=this.invertMatrix,Y=K[0]*N+K[2]*$+K[4],k=K[1]*N+K[3]*$+K[5],rt=this.boundingBox;if(Y<rt[0][0]||Y>rt[1][0]||k<rt[0][1]||k>rt[1][1])return!1;function it(_ref87,_ref88,_ref89){var _ref90=_slicedToArray(_ref87,2),lt=_ref90[0],ut=_ref90[1];var _ref91=_slicedToArray(_ref88,2),ot=_ref91[0],st=_ref91[1];var _ref92=_slicedToArray(_ref89,2),ft=_ref92[0],vt=_ref92[1];var mt=ft-ot,gt=vt-st,St=((lt-ot)*mt+(ut-st)*gt)/(Math.pow(mt,2)+Math.pow(gt,2));return St>=0&&St<=1;}for(var lt=0;lt<U.length;lt++){var ut=U[lt];if(S==="fill"&&ut[0]>=P.fillPointCount)break;if(S==="stroke"&&ut[0]<P.fillPointCount)continue;var _ut$map=ut.map(function(Pt){return w[Pt];}),_ut$map2=_slicedToArray(_ut$map,3),_ut$map2$=_slicedToArray(_ut$map2[0],2),ot=_ut$map2$[0],st=_ut$map2$[1],_ut$map2$2=_slicedToArray(_ut$map2[1],2),ft=_ut$map2$2[0],vt=_ut$map2$2[1],_ut$map2$3=_slicedToArray(_ut$map2[2],2),mt=_ut$map2$3[0],gt=_ut$map2$3[1],St=Math.sign((N-ot)*(vt-st)-(ft-ot)*($-st));if(St===0&&it([N,$],[ot,st],[ft,vt]))return!0;var It=Math.sign((N-ft)*(gt-vt)-(mt-ft)*($-vt));if(It===0&&it([N,$],[ft,vt],[mt,gt]))return!0;var Et=Math.sign((N-mt)*(st-gt)-(ot-mt)*($-gt));if(Et===0&&it([N,$],[mt,gt],[ot,st])||St===1&&It===1&&Et===1||St===-1&&It===-1&&Et===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(N,$){return this.isPointCollision(N,$,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(N,$){return this.isPointCollision(N,$,"stroke");}},{key:"addPass",value:function addPass(N){var $=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var S=$.width,P=$.height,w=d($,["width","height"]);var U=new T["default"]();U.rect(0,0,S,P);var K=new V(U,{width:S,height:P});K.setUniforms(w),K.setProgram(N),this[at].push(K);}}]);}();},/* 57 */ /***/function(h,r,t){t.r(r);var e=t(58);t(1).glMatrix.setMatrixArrayType(Array),r["default"]=e.Stroke;},/* 58 */ /***/function(h,r,t){t.r(r),t.d(r,"Stroke",function(){return v;});var e=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(e.create)(),i=Object(e.create)(),a=Object(e.create)(),s=Object(e.create)(),o=Object(e.create)(),f=1e20;var v=/*#__PURE__*/function(){function v(){var _ref93=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref93$lineWidth=_ref93.lineWidth,x=_ref93$lineWidth===void 0?1:_ref93$lineWidth,_ref93$lineJoin=_ref93.lineJoin,m=_ref93$lineJoin===void 0?"miter":_ref93$lineJoin,_ref93$miterLimit=_ref93.miterLimit,T=_ref93$miterLimit===void 0?10:_ref93$miterLimit,_ref93$lineCap=_ref93.lineCap,c=_ref93$lineCap===void 0?"butt":_ref93$lineCap,_ref93$roundSegments=_ref93.roundSegments,d=_ref93$roundSegments===void 0?20:_ref93$roundSegments;_classCallCheck(this,v);this.lineWidth=x,this.lineJoin=m,this.miterLimit=T,this.lineCap=c,this.roundSegments=d,this._normal=null;}return _createClass(v,[{key:"build",value:function build(x){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var T=x.length;if(x=_toConsumableArray(x),T<2)return x;m&&((x[0][0]!==x[T-1][0]||x[0][1]!==x[T-1][1])&&x.push(_toConsumableArray(x[0])),x.push(_toConsumableArray(x[1]))),T=x.length,this._normal=null;var c={left:[],right:[]},d=this.lineWidth/2,u=this.lineCap;if(!m&&u==="square"){Object(e.direction)(i,x[0],x[1]),Object(e.scaleAndAdd)(x[0],x[0],i,d);var M=x.length-1;Object(e.direction)(i,x[M],x[M-1]),Object(e.scaleAndAdd)(x[M],x[M],i,d);}for(var _M4=1;_M4<T;_M4++){var A=x[_M4-1],I=x[_M4],b=x[_M4+1];this._seg(c,A,I,b,d,m);}return!m&&u==="round"&&y(c,this.roundSegments),[].concat(_toConsumableArray(c.left),_toConsumableArray(c.right.reverse()));}},{key:"_seg",value:function _seg(x,m,T,c,d,u){var g=this.lineJoin==="bevel",M=this.lineJoin==="round";if(Object(e.direction)(i,T,m),this._normal||(this._normal=Object(e.create)(),Object(e.normal)(this._normal,i)),x.left.length||p(x,m,this._normal,d),!c)Object(e.normal)(this._normal,i),u?p(x,m,this._normal,d):p(x,T,this._normal,d);else{Object(e.direction)(a,c,T);var A=Object(e.computeMiter)(s,o,i,a,d);A=Math.min(A,f);var I=Object(e.dot)(s,this._normal)<0?-1:1;var b=g||M;if(!b&&this.lineJoin==="miter"&&A/d>this.miterLimit&&(b=!0),b){Object(e.scaleAndAdd)(n,T,this._normal,-d*I),l(x,n,I);var E=1/0;m&&(E=Math.min(E,Math.hypot(T[0]-m[0],T[1]-m[1]))),c&&(E=Math.min(E,Math.hypot(c[0]-T[0],c[1]-T[1])));var L=Math.max(d,Math.min(A,E));if(Object(e.scaleAndAdd)(n,T,o,L*I),l(x,n,-I),c)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,T,n,-d*I),M){var D=Object(e.clone)(n),R=I>0?x.left[x.left.length-1]:x.right[x.right.length-1],C=Object(e.clone)(T),W=Object(e.sub)(Object(e.create)(),R,C),z=Object(e.sub)(Object(e.create)(),D,C),H=Math.PI/this.roundSegments;for(var X=0;X<this.roundSegments&&(Object(e.rotate)(W,W,[0,0],I*H),Math.sign(Object(e.cross)(n,W,z)[2])===I);X++)Object(e.add)(n,W,C),l(x,n,I);l(x,D,I);}else l(x,n,I);}else p(x,T,o,A),Object(e.copy)(this._normal,o);}}}]);}();function l(O,x,m){m>0?O.left.push(Object(e.clone)(x)):O.right.push(Object(e.clone)(x));}function p(O,x,m,T){var c=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,x,m,-T),l(O,n,-c),Object(e.scaleAndAdd)(n,x,m,T),l(O,n,c);}function y(_ref94,m){var O=_ref94.left,x=_ref94.right;var T=Object(e.create)(),c=Object(e.create)();var d=O[0],u=x[0],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])];Object(e.sub)(c,d,g);for(var M=1;M<=m;M++){var A=-1*Math.PI*M/m;Object(e.rotate)(T,c,[0,0],A),Object(e.add)(n,g,T),O.unshift(Object(e.clone)(n));}d=x[x.length-1],u=O[O.length-1],g=[0.5*(d[0]+u[0]),0.5*(d[1]+u[1])],Object(e.sub)(c,d,g);for(var _M5=1;_M5<=m;_M5++){var _A2=-1*Math.PI*_M5/m;Object(e.rotate)(T,c,[0,0],_A2),Object(e.add)(n,g,T),x.push(Object(e.clone)(n));}}},/* 59 */ /***/function(h,r,t){t.r(r),t.d(r,"isUnitTransform",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[3]===1&&n[4]===0&&n[5]===0;}},/* 60 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e=t(61),n=t(62);h.exports=function(i,a){if(a=a||{},i=i.filter(function(m){return m.length>2;}),i.length===0)return{positions:[],cells:[]};typeof a.vertexSize!="number"&&(a.vertexSize=i[0][0].length),i=i.map(function(m){return m.reduce(function(T,c){return T.concat(c);});});var s=a.rule==="evenodd"?e.WINDING_ODD:e.WINDING_NONZERO;for(var o=e.tesselate(n({contours:i,windingRule:s,elementType:e.POLYGONS,polySize:3,vertexSize:2},a)),f=[],v=0;v<o.vertices.length;v+=a.vertexSize){var l=o.vertices.slice(v,v+a.vertexSize);f.push(l);}var p=[];for(v=0;v<o.elements.length;v+=3){var y=o.elements[v],O=o.elements[v+1],x=o.elements[v+2];p.push([y,O,x]);}return{positions:f,cells:p};};},/* 61 */ /***/function(h,r,t){t(1).glMatrix.setMatrixArrayType(Array);var e={},n={};h.exports=e,e.WINDING_ODD=0,e.WINDING_NONZERO=1,e.WINDING_POSITIVE=2,e.WINDING_NEGATIVE=3,e.WINDING_ABS_GEQ_TWO=4,e.POLYGONS=0,e.CONNECTED_POLYGONS=1,e.BOUNDARY_CONTOURS=2,e.tesselate=function(c){for(var d=c.debug||!1,u=new T(),g=0;g<c.contours.length;g++)u.addContour(c.vertexSize||2,c.contours[g]);return u.tesselate(c.windingRule||e.WINDING_ODD,c.elementType||e.POLYGONS,c.polySize||3,c.vertexSize||2,c.normal||[0,0,1]),{vertices:u.vertices,vertexIndices:u.vertexIndices,vertexCount:u.vertexCount,elements:u.elements,elementCount:u.elementCount,mesh:d?u.mesh:void 0};};var i=function i(c){if(!c)throw"Assertion Failed!";};function a(){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 s(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function o(c){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=c;}o.prototype={get Rface(){return this.Sym.Lface;},set Rface(c){this.Sym.Lface=c;},get Dst(){return this.Sym.Org;},set Dst(c){this.Sym.Org=c;},get Oprev(){return this.Sym.Lnext;},set Oprev(c){this.Sym.Lnext=c;},get Lprev(){return this.Onext.Sym;},set Lprev(c){this.Onext.Sym=c;},get Dprev(){return this.Lnext.Sym;},set Dprev(c){this.Lnext.Sym=c;},get Rprev(){return this.Sym.Onext;},set Rprev(c){this.Sym.Onext=c;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(c){this.Sym.Onext.Sym=c;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(c){this.Sym.Lnext.Sym=c;}/* 3 pointers */};function f(){var c=new a(),d=new s(),u=new o(0),g=new o(1);c.next=c.prev=c,c.anEdge=null,d.next=d.prev=d,d.anEdge=null,d.trail=null,d.marked=!1,d.inside=!1,u.next=u,u.Sym=g,u.Onext=null,u.Lnext=null,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,g.next=g,g.Sym=u,g.Onext=null,g.Lnext=null,g.Org=null,g.Lface=null,g.winding=0,g.activeRegion=null,this.vHead=c,this.fHead=d,this.eHead=u,this.eHeadSym=g;}f.prototype={/* MakeEdge creates a new pair of half-edges which form their own loop.
|
|
71
|
+
* No vertex or face structures are allocated, but these must be assigned
|
|
72
|
+
* before the current edge operation is completed.
|
|
73
|
+
*/ //static TESShalfEdge *MakeEdge( TESSmesh* mesh, TESShalfEdge *eNext )
|
|
74
|
+
makeEdge_:function makeEdge_(c){var d=new o(0),u=new o(1);c.Sym.side<c.side&&(c=c.Sym);var g=c.Sym.next;return u.next=g,g.Sym.next=d,d.next=c,c.Sym.next=u,d.Sym=u,d.Onext=d,d.Lnext=u,d.Org=null,d.Lface=null,d.winding=0,d.activeRegion=null,u.Sym=d,u.Onext=u,u.Lnext=d,u.Org=null,u.Lface=null,u.winding=0,u.activeRegion=null,d;},/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
|
|
75
|
+
* CS348a notes (see mesh.h). Basically it modifies the mesh so that
|
|
76
|
+
* a->Onext and b->Onext are exchanged. This can have various effects
|
|
77
|
+
* depending on whether a and b belong to different face or vertex rings.
|
|
78
|
+
* For more explanation see tessMeshSplice() below.
|
|
79
|
+
*/ // static void Splice( TESShalfEdge *a, TESShalfEdge *b )
|
|
80
|
+
splice_:function splice_(c,d){var u=c.Onext,g=d.Onext;u.Sym.Lnext=d,g.Sym.Lnext=c,c.Onext=g,d.Onext=u;},/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
|
|
81
|
+
* origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
|
|
82
|
+
* a place to insert the new vertex in the global vertex list. We insert
|
|
83
|
+
* the new vertex *before* vNext so that algorithms which walk the vertex
|
|
84
|
+
* list will not see the newly created vertices.
|
|
85
|
+
*/ //static void MakeVertex( TESSvertex *newVertex, TESShalfEdge *eOrig, TESSvertex *vNext )
|
|
86
|
+
makeVertex_:function makeVertex_(c,d,u){var g=c;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=d;var A=d;do A.Org=g,A=A.Onext;while(A!==d);},/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
|
|
87
|
+
* face of all edges in the face loop to which eOrig belongs. "fNext" gives
|
|
88
|
+
* a place to insert the new face in the global face list. We insert
|
|
89
|
+
* the new face *before* fNext so that algorithms which walk the face
|
|
90
|
+
* list will not see the newly created faces.
|
|
91
|
+
*/ // static void MakeFace( TESSface *newFace, TESShalfEdge *eOrig, TESSface *fNext )
|
|
92
|
+
makeFace_:function makeFace_(c,d,u){var g=c;i(g!==null);var M=u.prev;g.prev=M,M.next=g,g.next=u,u.prev=g,g.anEdge=d,g.trail=null,g.marked=!1,g.inside=u.inside;var A=d;do A.Lface=g,A=A.Lnext;while(A!==d);},/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
|
|
93
|
+
* and removes from the global edge list.
|
|
94
|
+
*/ //static void KillEdge( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
95
|
+
killEdge_:function killEdge_(c){c.Sym.side<c.side&&(c=c.Sym);var d=c.next,u=c.Sym.next;d.Sym.next=u,u.Sym.next=d;},/* KillVertex( vDel ) destroys a vertex and removes it from the global
|
|
96
|
+
* vertex list. It updates the vertex loop to point to a given new vertex.
|
|
97
|
+
*/ //static void KillVertex( TESSmesh *mesh, TESSvertex *vDel, TESSvertex *newOrg )
|
|
98
|
+
killVertex_:function killVertex_(c,d){var u=c.anEdge,g=u;do g.Org=d,g=g.Onext;while(g!==u);var M=c.prev,A=c.next;A.prev=M,M.next=A;},/* KillFace( fDel ) destroys a face and removes it from the global face
|
|
99
|
+
* list. It updates the face loop to point to a given new face.
|
|
100
|
+
*/ //static void KillFace( TESSmesh *mesh, TESSface *fDel, TESSface *newLface )
|
|
101
|
+
killFace_:function killFace_(c,d){var u=c.anEdge,g=u;do g.Lface=d,g=g.Lnext;while(g!==u);var M=c.prev,A=c.next;A.prev=M,M.next=A;},/****************** Basic Edge Operations **********************/ /* tessMeshMakeEdge creates one edge, two vertices, and a loop (face).
|
|
102
|
+
* The loop consists of the two new half-edges.
|
|
103
|
+
*/ //TESShalfEdge *tessMeshMakeEdge( TESSmesh *mesh )
|
|
104
|
+
makeEdge:function makeEdge(){var c=new a(),d=new a(),u=new s(),g=this.makeEdge_(this.eHead);return this.makeVertex_(c,g,this.vHead),this.makeVertex_(d,g.Sym,this.vHead),this.makeFace_(u,g,this.fHead),g;},/* tessMeshSplice( eOrg, eDst ) is the basic operation for changing the
|
|
105
|
+
* mesh connectivity and topology. It changes the mesh so that
|
|
106
|
+
* eOrg->Onext <- OLD( eDst->Onext )
|
|
107
|
+
* eDst->Onext <- OLD( eOrg->Onext )
|
|
108
|
+
* where OLD(...) means the value before the meshSplice operation.
|
|
109
|
+
*
|
|
110
|
+
* This can have two effects on the vertex structure:
|
|
111
|
+
* - if eOrg->Org != eDst->Org, the two vertices are merged together
|
|
112
|
+
* - if eOrg->Org == eDst->Org, the origin is split into two vertices
|
|
113
|
+
* In both cases, eDst->Org is changed and eOrg->Org is untouched.
|
|
114
|
+
*
|
|
115
|
+
* Similarly (and independently) for the face structure,
|
|
116
|
+
* - if eOrg->Lface == eDst->Lface, one loop is split into two
|
|
117
|
+
* - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
|
|
118
|
+
* In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
|
|
119
|
+
*
|
|
120
|
+
* Some special cases:
|
|
121
|
+
* If eDst == eOrg, the operation has no effect.
|
|
122
|
+
* If eDst == eOrg->Lnext, the new face will have a single edge.
|
|
123
|
+
* If eDst == eOrg->Lprev, the old face will have a single edge.
|
|
124
|
+
* If eDst == eOrg->Onext, the new vertex will have a single edge.
|
|
125
|
+
* If eDst == eOrg->Oprev, the old vertex will have a single edge.
|
|
126
|
+
*/ //int tessMeshSplice( TESSmesh* mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst )
|
|
127
|
+
splice:function splice(c,d){var u=!1,g=!1;if(c!==d){if(d.Org!==c.Org&&(g=!0,this.killVertex_(d.Org,c.Org)),d.Lface!==c.Lface&&(u=!0,this.killFace_(d.Lface,c.Lface)),this.splice_(d,c),!g){var M=new a();this.makeVertex_(M,d,c.Org),c.Org.anEdge=c;}if(!u){var A=new s();this.makeFace_(A,d,c.Lface),c.Lface.anEdge=c;}}},/* tessMeshDelete( eDel ) removes the edge eDel. There are several cases:
|
|
128
|
+
* if (eDel->Lface != eDel->Rface), we join two loops into one; the loop
|
|
129
|
+
* eDel->Lface is deleted. Otherwise, we are splitting one loop into two;
|
|
130
|
+
* the newly created loop will contain eDel->Dst. If the deletion of eDel
|
|
131
|
+
* would create isolated vertices, those are deleted as well.
|
|
132
|
+
*
|
|
133
|
+
* This function could be implemented as two calls to tessMeshSplice
|
|
134
|
+
* plus a few calls to memFree, but this would allocate and delete
|
|
135
|
+
* unnecessary vertices and faces.
|
|
136
|
+
*/ //int tessMeshDelete( TESSmesh *mesh, TESShalfEdge *eDel )
|
|
137
|
+
"delete":function _delete(c){var d=c.Sym,u=!1;if(c.Lface!==c.Rface&&(u=!0,this.killFace_(c.Lface,c.Rface)),c.Onext===c)this.killVertex_(c.Org,null);else if(c.Rface.anEdge=c.Oprev,c.Org.anEdge=c.Onext,this.splice_(c,c.Oprev),!u){var g=new s();this.makeFace_(g,c,c.Lface);}d.Onext===d?(this.killVertex_(d.Org,null),this.killFace_(d.Lface,null)):(c.Lface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),this.killEdge_(c);},/******************** Other Edge Operations **********************/ /* All these routines can be implemented with the basic edge
|
|
138
|
+
* operations above. They are provided for convenience and efficiency.
|
|
139
|
+
*/ /* tessMeshAddEdgeVertex( eOrg ) creates a new edge eNew such that
|
|
140
|
+
* eNew == eOrg->Lnext, and eNew->Dst is a newly created vertex.
|
|
141
|
+
* eOrg and eNew will have the same left face.
|
|
142
|
+
*/ // TESShalfEdge *tessMeshAddEdgeVertex( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
143
|
+
addEdgeVertex:function addEdgeVertex(c){var d=this.makeEdge_(c),u=d.Sym;this.splice_(d,c.Lnext),d.Org=c.Dst;var g=new a();return this.makeVertex_(g,u,d.Org),d.Lface=u.Lface=c.Lface,d;},/* tessMeshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
|
|
144
|
+
* such that eNew == eOrg->Lnext. The new vertex is eOrg->Dst == eNew->Org.
|
|
145
|
+
* eOrg and eNew will have the same left face.
|
|
146
|
+
*/ // TESShalfEdge *tessMeshSplitEdge( TESSmesh *mesh, TESShalfEdge *eOrg );
|
|
147
|
+
splitEdge:function splitEdge(c,d){var u=this.addEdgeVertex(c),g=u.Sym;return this.splice_(c.Sym,c.Sym.Oprev),this.splice_(c.Sym,g),c.Dst=g.Org,g.Dst.anEdge=g.Sym,g.Rface=c.Rface,g.winding=c.winding,g.Sym.winding=c.Sym.winding,g;},/* tessMeshConnect( eOrg, eDst ) creates a new edge from eOrg->Dst
|
|
148
|
+
* to eDst->Org, and returns the corresponding half-edge eNew.
|
|
149
|
+
* If eOrg->Lface == eDst->Lface, this splits one loop into two,
|
|
150
|
+
* and the newly created loop is eNew->Lface. Otherwise, two disjoint
|
|
151
|
+
* loops are merged into one, and the loop eDst->Lface is destroyed.
|
|
152
|
+
*
|
|
153
|
+
* If (eOrg == eDst), the new face will have only two edges.
|
|
154
|
+
* If (eOrg->Lnext == eDst), the old face is reduced to a single edge.
|
|
155
|
+
* If (eOrg->Lnext->Lnext == eDst), the old face is reduced to two edges.
|
|
156
|
+
*/ // TESShalfEdge *tessMeshConnect( TESSmesh *mesh, TESShalfEdge *eOrg, TESShalfEdge *eDst );
|
|
157
|
+
connect:function connect(c,d){var u=!1,g=this.makeEdge_(c),M=g.Sym;if(d.Lface!==c.Lface&&(u=!0,this.killFace_(d.Lface,c.Lface)),this.splice_(g,c.Lnext),this.splice_(M,d),g.Org=c.Dst,M.Org=d.Org,g.Lface=M.Lface=c.Lface,c.Lface.anEdge=M,!u){var A=new s();this.makeFace_(A,g,c.Lface);}return g;},/* tessMeshZapFace( fZap ) destroys a face and removes it from the
|
|
158
|
+
* global face list. All edges of fZap will have a NULL pointer as their
|
|
159
|
+
* left face. Any edges which also have a NULL pointer as their right face
|
|
160
|
+
* are deleted entirely (along with any isolated vertices this produces).
|
|
161
|
+
* An entire mesh can be deleted by zapping its faces, one at a time,
|
|
162
|
+
* in any order. Zapped faces cannot be used in further mesh operations!
|
|
163
|
+
*/zapFace:function zapFace(c){var d=c.anEdge,u,g,M,A,I;g=d.Lnext;do u=g,g=u.Lnext,u.Lface=null,u.Rface===null&&(u.Onext===u?this.killVertex_(u.Org,null):(u.Org.anEdge=u.Onext,this.splice_(u,u.Oprev)),M=u.Sym,M.Onext===M?this.killVertex_(M.Org,null):(M.Org.anEdge=M.Onext,this.splice_(M,M.Oprev)),this.killEdge_(u));while(u!=d);A=c.prev,I=c.next,I.prev=A,A.next=I;},countFaceVerts_:function countFaceVerts_(c){var d=c.anEdge,u=0;do u++,d=d.Lnext;while(d!==c.anEdge);return u;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
|
|
164
|
+
mergeConvexFaces:function mergeConvexFaces(c){var d,u,g,M,A,I,b;for(d=this.fHead.next;d!==this.fHead;d=d.next)if(d.inside)for(u=d.anEdge,A=u.Org;g=u.Lnext,M=u.Sym,M&&M.Lface&&M.Lface.inside&&(I=this.countFaceVerts_(d),b=this.countFaceVerts_(M.Lface),I+b-2<=c&&n.vertCCW(u.Lprev.Org,u.Org,M.Lnext.Lnext.Org)&&n.vertCCW(M.Lprev.Org,M.Org,u.Lnext.Lnext.Org)&&(g=M.Lnext,this["delete"](M),u=null,M=null)),!(u&&u.Lnext.Org===A);)u=g;return!0;},/* tessMeshCheckMesh( mesh ) checks a mesh for self-consistency.
|
|
165
|
+
*/check:function check(){var c=this.fHead,d=this.vHead,u=this.eHead,g,M,A,I,b,E;for(M=c,M=c;(g=M.next)!==c;M=g){i(g.prev===M),b=g.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Lface===g),b=b.Lnext;while(b!==g.anEdge);}for(i(g.prev===M&&g.anEdge===null),I=d,I=d;(A=I.next)!==d;I=A){i(A.prev===I),b=A.anEdge;do i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b),i(b.Org===A),b=b.Onext;while(b!==A.anEdge);}for(i(A.prev===I&&A.anEdge===null),E=u,E=u;(b=E.next)!==u;E=b)i(b.Sym.next===E.Sym),i(b.Sym!==b),i(b.Sym.Sym===b),i(b.Org!==null),i(b.Dst!==null),i(b.Lnext.Onext.Sym===b),i(b.Onext.Sym.Lnext===b);i(b.Sym.next===E.Sym&&b.Sym===this.eHeadSym&&b.Sym.Sym===b&&b.Org===null&&b.Dst===null&&b.Lface===null&&b.Rface===null);}},n.vertEq=function(c,d){return c.s===d.s&&c.t===d.t;},n.vertLeq=function(c,d){return c.s<d.s||c.s===d.s&&c.t<=d.t;},n.transLeq=function(c,d){return c.t<d.t||c.t===d.t&&c.s<=d.s;},n.edgeGoesLeft=function(c){return n.vertLeq(c.Dst,c.Org);},n.edgeGoesRight=function(c){return n.vertLeq(c.Org,c.Dst);},n.vertL1dist=function(c,d){return Math.abs(c.s-d.s)+Math.abs(c.t-d.t);},n.edgeEval=function(c,d,u){i(n.vertLeq(c,d)&&n.vertLeq(d,u));var g=d.s-c.s,M=u.s-d.s;return g+M>0?g<M?d.t-c.t+(c.t-u.t)*(g/(g+M)):d.t-u.t+(u.t-c.t)*(M/(g+M)):0;},n.edgeSign=function(c,d,u){i(n.vertLeq(c,d)&&n.vertLeq(d,u));var g=d.s-c.s,M=u.s-d.s;return g+M>0?(d.t-u.t)*g+(d.t-c.t)*M:0;},n.transEval=function(c,d,u){i(n.transLeq(c,d)&&n.transLeq(d,u));var g=d.t-c.t,M=u.t-d.t;return g+M>0?g<M?d.s-c.s+(c.s-u.s)*(g/(g+M)):d.s-u.s+(u.s-c.s)*(M/(g+M)):0;},n.transSign=function(c,d,u){i(n.transLeq(c,d)&&n.transLeq(d,u));var g=d.t-c.t,M=u.t-d.t;return g+M>0?(d.s-u.s)*g+(d.s-c.s)*M:0;},n.vertCCW=function(c,d,u){return c.s*(d.t-u.t)+d.s*(u.t-c.t)+u.s*(c.t-d.t)>=0;},n.interpolate=function(c,d,u,g){return c=c<0?0:c,u=u<0?0:u,c<=u?u===0?(d+g)/2:d+(g-d)*(c/(c+u)):g+(d-g)*(u/(c+u));},n.intersect=function(c,d,u,g,M){var A,I,b;n.vertLeq(c,d)||(b=c,c=d,d=b),n.vertLeq(u,g)||(b=u,u=g,g=b),n.vertLeq(c,u)||(b=c,c=u,u=b,b=d,d=g,g=b),n.vertLeq(u,d)?n.vertLeq(d,g)?(A=n.edgeEval(c,u,d),I=n.edgeEval(u,d,g),A+I<0&&(A=-A,I=-I),M.s=n.interpolate(A,u.s,I,d.s)):(A=n.edgeSign(c,u,d),I=-n.edgeSign(c,g,d),A+I<0&&(A=-A,I=-I),M.s=n.interpolate(A,u.s,I,g.s)):M.s=(u.s+d.s)/2,n.transLeq(c,d)||(b=c,c=d,d=b),n.transLeq(u,g)||(b=u,u=g,g=b),n.transLeq(c,u)||(b=c,c=u,u=b,b=d,d=g,g=b),n.transLeq(u,d)?n.transLeq(d,g)?(A=n.transEval(c,u,d),I=n.transEval(u,d,g),A+I<0&&(A=-A,I=-I),M.t=n.interpolate(A,u.t,I,d.t)):(A=n.transSign(c,u,d),I=-n.transSign(c,g,d),A+I<0&&(A=-A,I=-I),M.t=n.interpolate(A,u.t,I,g.t)):M.t=(u.t+d.t)/2;};function v(){this.key=null,this.next=null,this.prev=null;}function l(c,d){this.head=new v(),this.head.next=this.head,this.head.prev=this.head,this.frame=c,this.leq=d;}l.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(c){return this.insertBefore(this.head,c);},search:function search(c){var d=this.head;do d=d.next;while(d.key!==null&&!this.leq(this.frame,c,d.key));return d;},insertBefore:function insertBefore(c,d){do c=c.prev;while(c.key!==null&&!this.leq(this.frame,c.key,d));var u=new v();return u.key=d,u.next=c.next,c.next.prev=u,u.prev=c,c.next=u,u;},"delete":function _delete(c){c.next.prev=c.prev,c.prev.next=c.next;}};function p(){this.handle=null;}function y(){this.key=null,this.node=null;}function O(c,d){this.size=0,this.max=c,this.nodes=[],this.nodes.length=c+1;var u;for(u=0;u<this.nodes.length;u++)this.nodes[u]=new p();for(this.handles=[],this.handles.length=c+1,u=0;u<this.handles.length;u++)this.handles[u]=new y();this.initialized=!1,this.freeList=0,this.leq=d,this.nodes[1].handle=1,this.handles[1].key=null;}O.prototype={floatDown_:function floatDown_(c){var d=this.nodes,u=this.handles,g,M,A;for(g=d[c].handle;;){if(A=c<<1,A<this.size&&this.leq(u[d[A+1].handle].key,u[d[A].handle].key)&&++A,i(A<=this.max),M=d[A].handle,A>this.size||this.leq(u[g].key,u[M].key)){d[c].handle=g,u[g].node=c;break;}d[c].handle=M,u[M].node=c,c=A;}},floatUp_:function floatUp_(c){var d=this.nodes,u=this.handles,g,M,A;for(g=d[c].handle;;){if(A=c>>1,M=d[A].handle,A===0||this.leq(u[M].key,u[g].key)){d[c].handle=g,u[g].node=c;break;}d[c].handle=M,u[M].node=c,c=A;}},init:function init(){for(var c=this.size;c>=1;--c)this.floatDown_(c);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 )
|
|
166
|
+
insert:function insert(c){var d,u;if(d=++this.size,d*2>this.max){this.max*=2;var g,M;for(M=this.nodes.length,this.nodes.length=this.max+1,g=M;g<this.nodes.length;g++)this.nodes[g]=new p();for(M=this.handles.length,this.handles.length=this.max+1,g=M;g<this.handles.length;g++)this.handles[g]=new y();}return this.freeList===0?u=d:(u=this.freeList,this.freeList=this.handles[u].node),this.nodes[d].handle=u,this.handles[u].node=d,this.handles[u].key=c,this.initialized&&this.floatUp_(d),u;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
|
|
167
|
+
extractMin:function extractMin(){var c=this.nodes,d=this.handles,u=c[1].handle,g=d[u].key;return this.size>0&&(c[1].handle=c[this.size].handle,d[c[1].handle].node=1,d[u].key=null,d[u].node=this.freeList,this.freeList=u,--this.size,this.size>0&&this.floatDown_(1)),g;},"delete":function _delete(c){var d=this.nodes,u=this.handles,g;i(c>=1&&c<=this.max&&u[c].key!==null),g=u[c].node,d[g].handle=d[this.size].handle,u[d[g].handle].node=g,--this.size,g<=this.size&&(g<=1||this.leq(u[d[g>>1].handle].key,u[d[g].handle].key)?this.floatDown_(g):this.floatUp_(g)),u[c].key=null,u[c].node=this.freeList,this.freeList=c;}};function x(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1;}var m={};m.regionBelow=function(c){return c.nodeUp.prev.key;},m.regionAbove=function(c){return c.nodeUp.next.key;},m.debugEvent=function(c){},m.addWinding=function(c,d){c.winding+=d.winding,c.Sym.winding+=d.Sym.winding;},m.edgeLeq=function(c,d,u){var g=c.event,I,b,M=d.eUp,A=u.eUp;if(M.Dst===g)return A.Dst===g?n.vertLeq(M.Org,A.Org)?n.edgeSign(A.Dst,M.Org,A.Org)<=0:n.edgeSign(M.Dst,A.Org,M.Org)>=0:n.edgeSign(A.Dst,g,A.Org)<=0;if(A.Dst===g)return n.edgeSign(M.Dst,g,M.Org)>=0;var I=n.edgeEval(M.Dst,g,M.Org),b=n.edgeEval(A.Dst,g,A.Org);return I>=b;},m.deleteRegion=function(c,d){d.fixUpperEdge&&i(d.eUp.winding===0),d.eUp.activeRegion=null,c.dict["delete"](d.nodeUp);},m.fixUpperEdge=function(c,d,u){i(d.fixUpperEdge),c.mesh["delete"](d.eUp),d.fixUpperEdge=!1,d.eUp=u,u.activeRegion=d;},m.topLeftRegion=function(c,d){var u=d.eUp.Org,g;do d=m.regionAbove(d);while(d.eUp.Org===u);if(d.fixUpperEdge){if(g=c.mesh.connect(m.regionBelow(d).eUp.Sym,d.eUp.Lnext),g===null)return null;m.fixUpperEdge(c,d,g),d=m.regionAbove(d);}return d;},m.topRightRegion=function(c){var d=c.eUp.Dst;do c=m.regionAbove(c);while(c.eUp.Dst===d);return c;},m.addRegionBelow=function(c,d,u){var g=new x();return g.eUp=u,g.nodeUp=c.dict.insertBefore(d.nodeUp,g),g.fixUpperEdge=!1,g.sentinel=!1,g.dirty=!1,u.activeRegion=g,g;},m.isWindingInside=function(c,d){switch(c.windingRule){case e.WINDING_ODD:return(d&1)!==0;case e.WINDING_NONZERO:return d!==0;case e.WINDING_POSITIVE:return d>0;case e.WINDING_NEGATIVE:return d<0;case e.WINDING_ABS_GEQ_TWO:return d>=2||d<=-2;}return i(!1),!1;},m.computeWinding=function(c,d){d.windingNumber=m.regionAbove(d).windingNumber+d.eUp.winding,d.inside=m.isWindingInside(c,d.windingNumber);},m.finishRegion=function(c,d){var u=d.eUp,g=u.Lface;g.inside=d.inside,g.anEdge=u,m.deleteRegion(c,d);},m.finishLeftRegions=function(c,d,u){for(var g,I,M=null,A=d,I=d.eUp;A!==u;){if(A.fixUpperEdge=!1,M=m.regionBelow(A),g=M.eUp,g.Org!=I.Org){if(!M.fixUpperEdge){m.finishRegion(c,A);break;}g=c.mesh.connect(I.Lprev,g.Sym),m.fixUpperEdge(c,M,g);}I.Onext!==g&&(c.mesh.splice(g.Oprev,g),c.mesh.splice(I,g)),m.finishRegion(c,A),I=M.eUp,A=M;}return I;},m.addRightEdges=function(c,d,u,g,M,A){var I,b,E,L,D=!0;E=u;do i(n.vertLeq(E.Org,E.Dst)),m.addRegionBelow(c,d,E.Sym),E=E.Onext;while(E!==g);for(M===null&&(M=m.regionBelow(d).eUp.Rprev),b=d,L=M;I=m.regionBelow(b),E=I.eUp.Sym,E.Org===L.Org;)E.Onext!==L&&(c.mesh.splice(E.Oprev,E),c.mesh.splice(L.Oprev,E)),I.windingNumber=b.windingNumber-E.winding,I.inside=m.isWindingInside(c,I.windingNumber),b.dirty=!0,!D&&m.checkForRightSplice(c,b)&&(m.addWinding(E,L),m.deleteRegion(c,b),c.mesh["delete"](L)),D=!1,b=I,L=E;b.dirty=!0,i(b.windingNumber-E.winding===I.windingNumber),A&&m.walkDirtyRegions(c,b);},m.spliceMergeVertices=function(c,d,u){c.mesh.splice(d,u);},m.vertexWeights=function(c,d,u){var g=n.vertL1dist(d,c),M=n.vertL1dist(u,c),A=0.5*M/(g+M),I=0.5*g/(g+M);c.coords[0]+=A*d.coords[0]+I*u.coords[0],c.coords[1]+=A*d.coords[1]+I*u.coords[1],c.coords[2]+=A*d.coords[2]+I*u.coords[2];},m.getIntersectData=function(c,d,u,g,M,A){d.coords[0]=d.coords[1]=d.coords[2]=0,d.idx=-1,m.vertexWeights(d,u,g),m.vertexWeights(d,M,A);},m.checkForRightSplice=function(c,d){var u=m.regionBelow(d),g=d.eUp,M=u.eUp;if(n.vertLeq(g.Org,M.Org)){if(n.edgeSign(M.Dst,g.Org,M.Org)>0)return!1;n.vertEq(g.Org,M.Org)?g.Org!==M.Org&&(c.pq["delete"](g.Org.pqHandle),m.spliceMergeVertices(c,M.Oprev,g)):(c.mesh.splitEdge(M.Sym),c.mesh.splice(g,M.Oprev),d.dirty=u.dirty=!0);}else{if(n.edgeSign(g.Dst,M.Org,g.Org)<0)return!1;m.regionAbove(d).dirty=d.dirty=!0,c.mesh.splitEdge(g.Sym),c.mesh.splice(M.Oprev,g);}return!0;},m.checkForLeftSplice=function(c,d){var u=m.regionBelow(d),g=d.eUp,M=u.eUp,A;if(i(!n.vertEq(g.Dst,M.Dst)),n.vertLeq(g.Dst,M.Dst)){if(n.edgeSign(g.Dst,M.Dst,g.Org)<0)return!1;m.regionAbove(d).dirty=d.dirty=!0,A=c.mesh.splitEdge(g),c.mesh.splice(M.Sym,A),A.Lface.inside=d.inside;}else{if(n.edgeSign(M.Dst,g.Dst,M.Org)>0)return!1;d.dirty=u.dirty=!0,A=c.mesh.splitEdge(M),c.mesh.splice(g.Lnext,M.Sym),A.Rface.inside=d.inside;}return!0;},m.checkForIntersect=function(c,d){var u=m.regionBelow(d),g=d.eUp,M=u.eUp,A=g.Org,I=M.Org,b=g.Dst,E=M.Dst,L,D,R=new a(),C,W;if(i(!n.vertEq(E,b)),i(n.edgeSign(b,c.event,A)<=0),i(n.edgeSign(E,c.event,I)>=0),i(A!==c.event&&I!==c.event),i(!d.fixUpperEdge&&!u.fixUpperEdge),A===I||(L=Math.min(A.t,b.t),D=Math.max(I.t,E.t),L>D))return!1;if(n.vertLeq(A,I)){if(n.edgeSign(E,A,I)>0)return!1;}else if(n.edgeSign(b,I,A)<0)return!1;return m.debugEvent(c),n.intersect(b,A,E,I,R),i(Math.min(A.t,b.t)<=R.t),i(R.t<=Math.max(I.t,E.t)),i(Math.min(E.s,b.s)<=R.s),i(R.s<=Math.max(I.s,A.s)),n.vertLeq(R,c.event)&&(R.s=c.event.s,R.t=c.event.t),C=n.vertLeq(A,I)?A:I,n.vertLeq(C,R)&&(R.s=C.s,R.t=C.t),n.vertEq(R,A)||n.vertEq(R,I)?(m.checkForRightSplice(c,d),!1):!n.vertEq(b,c.event)&&n.edgeSign(b,c.event,R)>=0||!n.vertEq(E,c.event)&&n.edgeSign(E,c.event,R)<=0?E===c.event?(c.mesh.splitEdge(g.Sym),c.mesh.splice(M.Sym,g),d=m.topLeftRegion(c,d),g=m.regionBelow(d).eUp,m.finishLeftRegions(c,m.regionBelow(d),u),m.addRightEdges(c,d,g.Oprev,g,g,!0),!0):b===c.event?(c.mesh.splitEdge(M.Sym),c.mesh.splice(g.Lnext,M.Oprev),u=d,d=m.topRightRegion(d),W=m.regionBelow(d).eUp.Rprev,u.eUp=M.Oprev,M=m.finishLeftRegions(c,u,null),m.addRightEdges(c,d,M.Onext,g.Rprev,W,!0),!0):(n.edgeSign(b,c.event,R)>=0&&(m.regionAbove(d).dirty=d.dirty=!0,c.mesh.splitEdge(g.Sym),g.Org.s=c.event.s,g.Org.t=c.event.t),n.edgeSign(E,c.event,R)<=0&&(d.dirty=u.dirty=!0,c.mesh.splitEdge(M.Sym),M.Org.s=c.event.s,M.Org.t=c.event.t),!1):(c.mesh.splitEdge(g.Sym),c.mesh.splitEdge(M.Sym),c.mesh.splice(M.Oprev,g),g.Org.s=R.s,g.Org.t=R.t,g.Org.pqHandle=c.pq.insert(g.Org),m.getIntersectData(c,g.Org,A,b,I,E),m.regionAbove(d).dirty=d.dirty=u.dirty=!0,!1);},m.walkDirtyRegions=function(c,d){for(var u=m.regionBelow(d),g,M;;){for(;u.dirty;)d=u,u=m.regionBelow(u);if(!d.dirty&&(u=d,d=m.regionAbove(d),d===null||!d.dirty))return;if(d.dirty=!1,g=d.eUp,M=u.eUp,g.Dst!==M.Dst&&m.checkForLeftSplice(c,d)&&(u.fixUpperEdge?(m.deleteRegion(c,u),c.mesh["delete"](M),u=m.regionBelow(d),M=u.eUp):d.fixUpperEdge&&(m.deleteRegion(c,d),c.mesh["delete"](g),d=m.regionAbove(u),g=d.eUp)),g.Org!==M.Org)if(g.Dst!==M.Dst&&!d.fixUpperEdge&&!u.fixUpperEdge&&(g.Dst===c.event||M.Dst===c.event)){if(m.checkForIntersect(c,d))return;}else m.checkForRightSplice(c,d);g.Org===M.Org&&g.Dst===M.Dst&&(m.addWinding(M,g),m.deleteRegion(c,d),c.mesh["delete"](g),d=m.regionAbove(u));}},m.connectRightVertex=function(c,d,u){var g,M=u.Onext,A=m.regionBelow(d),I=d.eUp,b=A.eUp,E=!1;if(I.Dst!==b.Dst&&m.checkForIntersect(c,d),n.vertEq(I.Org,c.event)&&(c.mesh.splice(M.Oprev,I),d=m.topLeftRegion(c,d),M=m.regionBelow(d).eUp,m.finishLeftRegions(c,m.regionBelow(d),A),E=!0),n.vertEq(b.Org,c.event)&&(c.mesh.splice(u,b.Oprev),u=m.finishLeftRegions(c,A,null),E=!0),E){m.addRightEdges(c,d,u.Onext,M,M,!0);return;}n.vertLeq(b.Org,I.Org)?g=b.Oprev:g=I,g=c.mesh.connect(u.Lprev,g),m.addRightEdges(c,d,g,g.Onext,g.Onext,!1),g.Sym.activeRegion.fixUpperEdge=!0,m.walkDirtyRegions(c,d);},m.connectLeftDegenerate=function(c,d,u){var g,M,A,I,b;if(g=d.eUp,n.vertEq(g.Org,u)){i(!1/*TOLERANCE_NONZERO*/),m.spliceMergeVertices(c,g,u.anEdge);return;}if(!n.vertEq(g.Dst,u)){c.mesh.splitEdge(g.Sym),d.fixUpperEdge&&(c.mesh["delete"](g.Onext),d.fixUpperEdge=!1),c.mesh.splice(u.anEdge,g),m.sweepEvent(c,u);return;}i(!1/*TOLERANCE_NONZERO*/),d=m.topRightRegion(d),b=m.regionBelow(d),A=b.eUp.Sym,M=I=A.Onext,b.fixUpperEdge&&(i(M!==A),m.deleteRegion(c,b),c.mesh["delete"](A),A=M.Oprev),c.mesh.splice(u.anEdge,A),n.edgeGoesLeft(M)||(M=null),m.addRightEdges(c,d,A.Onext,I,M,!0);},m.connectLeftVertex=function(c,d){var u,g,M,A,I,b,E=new x();if(E.eUp=d.anEdge.Sym,u=c.dict.search(E).key,g=m.regionBelow(u),!!g){if(A=u.eUp,I=g.eUp,n.edgeSign(A.Dst,d,A.Org)===0){m.connectLeftDegenerate(c,u,d);return;}if(M=n.vertLeq(I.Dst,A.Dst)?u:g,u.inside||M.fixUpperEdge){if(M===u)b=c.mesh.connect(d.anEdge.Sym,A.Lnext);else{var L=c.mesh.connect(I.Dnext,d.anEdge);b=L.Sym;}M.fixUpperEdge?m.fixUpperEdge(c,M,b):m.computeWinding(c,m.addRegionBelow(c,u,b)),m.sweepEvent(c,d);}else m.addRightEdges(c,u,d.anEdge,d.anEdge,null,!0);}},m.sweepEvent=function(c,d){c.event=d,m.debugEvent(c);for(var u=d.anEdge;u.activeRegion===null;)if(u=u.Onext,u===d.anEdge){m.connectLeftVertex(c,d);return;}var g=m.topLeftRegion(c,u.activeRegion);i(g!==null);var M=m.regionBelow(g),A=M.eUp,I=m.finishLeftRegions(c,M,null);I.Onext===A?m.connectRightVertex(c,g,I):m.addRightEdges(c,g,I.Onext,A,A,!0);},m.addSentinel=function(c,d,u,g){var M=new x(),A=c.mesh.makeEdge();A.Org.s=u,A.Org.t=g,A.Dst.s=d,A.Dst.t=g,c.event=A.Dst,M.eUp=A,M.windingNumber=0,M.inside=!1,M.fixUpperEdge=!1,M.sentinel=!0,M.dirty=!1,M.nodeUp=c.dict.insert(M);},m.initEdgeDict=function(c){c.dict=new l(c,m.edgeLeq);var d=c.bmax[0]-c.bmin[0],u=c.bmax[1]-c.bmin[1],g=c.bmin[0]-d,M=c.bmax[0]+d,A=c.bmin[1]-u,I=c.bmax[1]+u;m.addSentinel(c,g,M,A),m.addSentinel(c,g,M,I);},m.doneEdgeDict=function(c){for(var d,u=0;(d=c.dict.min().key)!==null;)d.sentinel||(i(d.fixUpperEdge),i(++u===1)),i(d.windingNumber===0),m.deleteRegion(c,d);},m.removeDegenerateEdges=function(c){var d,u,g,M=c.mesh.eHead;for(d=M.next;d!==M;d=u)u=d.next,g=d.Lnext,n.vertEq(d.Org,d.Dst)&&d.Lnext.Lnext!==d&&(m.spliceMergeVertices(c,g,d),c.mesh["delete"](d),d=g,g=d.Lnext),g.Lnext===d&&(g!==d&&((g===u||g===u.Sym)&&(u=u.next),c.mesh["delete"](g)),(d===u||d===u.Sym)&&(u=u.next),c.mesh["delete"](d));},m.initPriorityQ=function(c){var d,u,g,M=0;for(g=c.mesh.vHead,u=g.next;u!==g;u=u.next)M++;for(M+=8,d=c.pq=new O(M,n.vertLeq),g=c.mesh.vHead,u=g.next;u!==g;u=u.next)u.pqHandle=d.insert(u);return u!==g?!1:(d.init(),!0);},m.donePriorityQ=function(c){c.pq=null;},m.removeDegenerateFaces=function(c,d){var u,g,M;for(u=d.fHead.next;u!==d.fHead;u=g)g=u.next,M=u.anEdge,i(M.Lnext!==M),M.Lnext.Lnext===M&&(m.addWinding(M.Onext,M),c.mesh["delete"](M));return!0;},m.computeInterior=function(c){var d,u;if(m.removeDegenerateEdges(c),!m.initPriorityQ(c))return!1;for(m.initEdgeDict(c);(d=c.pq.extractMin())!==null;){for(;u=c.pq.min(),!(u===null||!n.vertEq(u,d));)u=c.pq.extractMin(),m.spliceMergeVertices(c,d.anEdge,u.anEdge);m.sweepEvent(c,d);}return c.event=c.dict.min().key.eUp.Org,m.debugEvent(c),m.doneEdgeDict(c),m.donePriorityQ(c),m.removeDegenerateFaces(c,c.mesh)?(c.mesh.check(),!0):!1;};function T(){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=e.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;}T.prototype={dot_:function dot_(c,d){return c[0]*d[0]+c[1]*d[1]+c[2]*d[2];},normalize_:function normalize_(c){var d=c[0]*c[0]+c[1]*c[1]+c[2]*c[2];i(d>0),d=Math.sqrt(d),c[0]/=d,c[1]/=d,c[2]/=d;},longAxis_:function longAxis_(c){var d=0;return Math.abs(c[1])>Math.abs(c[0])&&(d=1),Math.abs(c[2])>Math.abs(c[d])&&(d=2),d;},computeNormal_:function computeNormal_(c){var d,u,g,M,A,I,b=[0,0,0],E=[0,0,0],L=[0,0,0],D=[0,0,0],R=[0,0,0],C=[null,null,null],W=[null,null,null],z=this.mesh.vHead,H;for(d=z.next,H=0;H<3;++H)M=d.coords[H],E[H]=M,W[H]=d,b[H]=M,C[H]=d;for(d=z.next;d!==z;d=d.next)for(H=0;H<3;++H)M=d.coords[H],M<E[H]&&(E[H]=M,W[H]=d),M>b[H]&&(b[H]=M,C[H]=d);if(H=0,b[1]-E[1]>b[0]-E[0]&&(H=1),b[2]-E[2]>b[H]-E[H]&&(H=2),E[H]>=b[H]){c[0]=0,c[1]=0,c[2]=1;return;}for(I=0,u=W[H],g=C[H],L[0]=u.coords[0]-g.coords[0],L[1]=u.coords[1]-g.coords[1],L[2]=u.coords[2]-g.coords[2],d=z.next;d!==z;d=d.next)D[0]=d.coords[0]-g.coords[0],D[1]=d.coords[1]-g.coords[1],D[2]=d.coords[2]-g.coords[2],R[0]=L[1]*D[2]-L[2]*D[1],R[1]=L[2]*D[0]-L[0]*D[2],R[2]=L[0]*D[1]-L[1]*D[0],A=R[0]*R[0]+R[1]*R[1]+R[2]*R[2],A>I&&(I=A,c[0]=R[0],c[1]=R[1],c[2]=R[2]);I<=0&&(c[0]=c[1]=c[2]=0,c[this.longAxis_(L)]=1);},checkOrientation_:function checkOrientation_(){var c,d,u=this.mesh.fHead,g,M=this.mesh.vHead,A;for(c=0,d=u.next;d!==u;d=d.next)if(A=d.anEdge,!(A.winding<=0))do c+=(A.Org.s-A.Dst.s)*(A.Org.t+A.Dst.t),A=A.Lnext;while(A!==d.anEdge);if(c<0){for(g=M.next;g!==M;g=g.next)g.t=-g.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2];}},/* #ifdef FOR_TRITE_TEST_PROGRAM
|
|
168
|
+
#include <stdlib.h>
|
|
169
|
+
extern int RandomSweep;
|
|
170
|
+
#define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0)
|
|
171
|
+
#define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0)
|
|
172
|
+
#else
|
|
173
|
+
#if defined(SLANTED_SWEEP) */ /* The "feature merging" is not intended to be complete. There are
|
|
174
|
+
* special cases where edges are nearly parallel to the sweep line
|
|
175
|
+
* which are not implemented. The algorithm should still behave
|
|
176
|
+
* robustly (ie. produce a reasonable tesselation) in the presence
|
|
177
|
+
* of such edges, however it may miss features which could have been
|
|
178
|
+
* merged. We could minimize this effect by choosing the sweep line
|
|
179
|
+
* direction to be something unusual (ie. not parallel to one of the
|
|
180
|
+
* coordinate axes).
|
|
181
|
+
*/ /* #define S_UNIT_X (TESSreal)0.50941539564955385 // Pre-normalized
|
|
182
|
+
#define S_UNIT_Y (TESSreal)0.86052074622010633
|
|
183
|
+
#else
|
|
184
|
+
#define S_UNIT_X (TESSreal)1.0
|
|
185
|
+
#define S_UNIT_Y (TESSreal)0.0
|
|
186
|
+
#endif
|
|
187
|
+
#endif*/ /* Determine the polygon normal and project vertices onto the plane
|
|
188
|
+
* of the polygon.
|
|
189
|
+
*/projectPolygon_:function projectPolygon_(){var c,d=this.mesh.vHead,u=[0,0,0],g,M,A,I,b=!1;for(u[0]=this.normal[0],u[1]=this.normal[1],u[2]=this.normal[2],u[0]===0&&u[1]===0&&u[2]===0&&(this.computeNormal_(u),b=!0),g=this.sUnit,M=this.tUnit,A=this.longAxis_(u),g[A]=0,g[(A+1)%3]=1,g[(A+2)%3]=0,M[A]=0,M[(A+1)%3]=0,M[(A+2)%3]=u[A]>0?1:-1,c=d.next;c!==d;c=c.next)c.s=this.dot_(c.coords,g),c.t=this.dot_(c.coords,M);for(b&&this.checkOrientation_(),I=!0,c=d.next;c!==d;c=c.next)I?(this.bmin[0]=this.bmax[0]=c.s,this.bmin[1]=this.bmax[1]=c.t,I=!1):(c.s<this.bmin[0]&&(this.bmin[0]=c.s),c.s>this.bmax[0]&&(this.bmax[0]=c.s),c.t<this.bmin[1]&&(this.bmin[1]=c.t),c.t>this.bmax[1]&&(this.bmax[1]=c.t));},addWinding_:function addWinding_(c,d){c.winding+=d.winding,c.Sym.winding+=d.Sym.winding;},/* tessMeshTessellateMonoRegion( face ) tessellates a monotone region
|
|
190
|
+
* (what else would it do??) The region must consist of a single
|
|
191
|
+
* loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
|
|
192
|
+
* case means that any vertical line intersects the interior of the
|
|
193
|
+
* region in a single interval.
|
|
194
|
+
*
|
|
195
|
+
* Tessellation consists of adding interior edges (actually pairs of
|
|
196
|
+
* half-edges), to split the region into non-overlapping triangles.
|
|
197
|
+
*
|
|
198
|
+
* The basic idea is explained in Preparata and Shamos (which I don''t
|
|
199
|
+
* have handy right now), although their implementation is more
|
|
200
|
+
* complicated than this one. The are two edge chains, an upper chain
|
|
201
|
+
* and a lower chain. We process all vertices from both chains in order,
|
|
202
|
+
* from right to left.
|
|
203
|
+
*
|
|
204
|
+
* The algorithm ensures that the following invariant holds after each
|
|
205
|
+
* vertex is processed: the untessellated region consists of two
|
|
206
|
+
* chains, where one chain (say the upper) is a single edge, and
|
|
207
|
+
* the other chain is concave. The left vertex of the single edge
|
|
208
|
+
* is always to the left of all vertices in the concave chain.
|
|
209
|
+
*
|
|
210
|
+
* Each step consists of adding the rightmost unprocessed vertex to one
|
|
211
|
+
* of the two chains, and forming a fan of triangles from the rightmost
|
|
212
|
+
* of two chain endpoints. Determining whether we can add each triangle
|
|
213
|
+
* to the fan is a simple orientation test. By making the fan as large
|
|
214
|
+
* as possible, we restore the invariant (check it yourself).
|
|
215
|
+
*/ // int tessMeshTessellateMonoRegion( TESSmesh *mesh, TESSface *face )
|
|
216
|
+
tessellateMonoRegion_:function tessellateMonoRegion_(c,d){var u,g;for(u=d.anEdge,i(u.Lnext!==u&&u.Lnext.Lnext!==u);n.vertLeq(u.Dst,u.Org);u=u.Lprev);for(;n.vertLeq(u.Org,u.Dst);u=u.Lnext);for(g=u.Lprev;u.Lnext!==g;)if(n.vertLeq(u.Dst,g.Org)){for(;g.Lnext!==u&&(n.edgeGoesLeft(g.Lnext)||n.edgeSign(g.Org,g.Dst,g.Lnext.Dst)<=0);){var M=c.connect(g.Lnext,g);g=M.Sym;}g=g.Lprev;}else{for(;g.Lnext!==u&&(n.edgeGoesRight(u.Lprev)||n.edgeSign(u.Dst,u.Org,u.Lprev.Org)>=0);){var M=c.connect(u,u.Lprev);u=M.Sym;}u=u.Lnext;}for(i(g.Lnext!==u);g.Lnext.Lnext!==u;){var M=c.connect(g.Lnext,g);g=M.Sym;}return!0;},/* tessMeshTessellateInterior( mesh ) tessellates each region of
|
|
217
|
+
* the mesh which is marked "inside" the polygon. Each such region
|
|
218
|
+
* must be monotone.
|
|
219
|
+
*/ //int tessMeshTessellateInterior( TESSmesh *mesh )
|
|
220
|
+
tessellateInterior_:function tessellateInterior_(c){var d,u;for(d=c.fHead.next;d!==c.fHead;d=u)if(u=d.next,d.inside&&!this.tessellateMonoRegion_(c,d))return!1;return!0;},/* tessMeshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
|
|
221
|
+
* which are not marked "inside" the polygon. Since further mesh operations
|
|
222
|
+
* on NULL faces are not allowed, the main purpose is to clean up the
|
|
223
|
+
* mesh so that exterior loops are not represented in the data structure.
|
|
224
|
+
*/ //void tessMeshDiscardExterior( TESSmesh *mesh )
|
|
225
|
+
discardExterior_:function discardExterior_(c){var d,u;for(d=c.fHead.next;d!==c.fHead;d=u)u=d.next,d.inside||c.zapFace(d);},/* tessMeshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
|
|
226
|
+
* winding numbers on all edges so that regions marked "inside" the
|
|
227
|
+
* polygon have a winding number of "value", and regions outside
|
|
228
|
+
* have a winding number of 0.
|
|
229
|
+
*
|
|
230
|
+
* If keepOnlyBoundary is TRUE, it also deletes all edges which do not
|
|
231
|
+
* separate an interior region from an exterior one.
|
|
232
|
+
*/ // int tessMeshSetWindingNumber( TESSmesh *mesh, int value, int keepOnlyBoundary )
|
|
233
|
+
setWindingNumber_:function setWindingNumber_(c,d,u){var g,M;for(g=c.eHead.next;g!==c.eHead;g=M)M=g.next,g.Rface.inside!==g.Lface.inside?g.winding=g.Lface.inside?d:-d:u?c["delete"](g):g.winding=0;},getNeighbourFace_:function getNeighbourFace_(c){return!c.Rface||!c.Rface.inside?-1:c.Rface.n;},outputPolymesh_:function outputPolymesh_(c,d,u,g){var M,A,I,b=0,E=0,L,D;for(u>3&&c.mergeConvexFaces(u),M=c.vHead.next;M!==c.vHead;M=M.next)M.n=-1;for(A=c.fHead.next;A!==c.fHead;A=A.next)if(A.n=-1,!!A.inside){I=A.anEdge,L=0;do M=I.Org,M.n===-1&&(M.n=E,E++),L++,I=I.Lnext;while(I!==A.anEdge);i(L<=u),A.n=b,++b;}for(this.elementCount=b,d===e.CONNECTED_POLYGONS&&(b*=2),this.elements=[],this.elements.length=b*u,this.vertexCount=E,this.vertices=[],this.vertices.length=E*g,this.vertexIndices=[],this.vertexIndices.length=E,M=c.vHead.next;M!==c.vHead;M=M.next)if(M.n!==-1){var R=M.n*g;this.vertices[R+0]=M.coords[0],this.vertices[R+1]=M.coords[1],g>2&&(this.vertices[R+2]=M.coords[2]),this.vertexIndices[M.n]=M.idx;}var C=0;for(A=c.fHead.next;A!==c.fHead;A=A.next)if(A.inside){I=A.anEdge,L=0;do M=I.Org,this.elements[C++]=M.n,L++,I=I.Lnext;while(I!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1;if(d===e.CONNECTED_POLYGONS){I=A.anEdge;do this.elements[C++]=this.getNeighbourFace_(I),I=I.Lnext;while(I!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
|
|
234
|
+
outputContours_:function outputContours_(c,d){var u,g,M,A=0,I=0;for(this.vertexCount=0,this.elementCount=0,u=c.fHead.next;u!==c.fHead;u=u.next)if(u.inside){M=g=u.anEdge;do this.vertexCount++,g=g.Lnext;while(g!==M);this.elementCount++;}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*d,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var b=0,E=0,L=0;for(A=0,u=c.fHead.next;u!==c.fHead;u=u.next)if(u.inside){I=0,M=g=u.anEdge;do this.vertices[b++]=g.Org.coords[0],this.vertices[b++]=g.Org.coords[1],d>2&&(this.vertices[b++]=g.Org.coords[2]),this.vertexIndices[E++]=g.Org.idx,I++,g=g.Lnext;while(g!==M);this.elements[L++]=A,this.elements[L++]=I,A+=I;}},addContour:function addContour(c,d){var u,g;for(this.mesh===null&&(this.mesh=new f()),c<2&&(c=2),c>3&&(c=3),u=null,g=0;g<d.length;g+=c)u===null?(u=this.mesh.makeEdge(),this.mesh.splice(u,u.Sym)):(this.mesh.splitEdge(u),u=u.Lnext),u.Org.coords[0]=d[g+0],u.Org.coords[1]=d[g+1],c>2?u.Org.coords[2]=d[g+2]:u.Org.coords[2]=0,u.Org.idx=this.vertexIndexCounter++,u.winding=1,u.Sym.winding=-1;},// int tessTesselate( TESStesselator *tess, int windingRule, int elementType, int polySize, int vertexSize, const TESSreal* normal )
|
|
235
|
+
tesselate:function tesselate(c,d,u,g,M){if(this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,M&&(this.normal[0]=M[0],this.normal[1]=M[1],this.normal[2]=M[2]),this.windingRule=c,g<2&&(g=2),g>3&&(g=3),!this.mesh)return!1;this.projectPolygon_(),m.computeInterior(this);var A=this.mesh;return d===e.BOUNDARY_CONTOURS?this.setWindingNumber_(A,1,!0):this.tessellateInterior_(A),A.check(),d===e.BOUNDARY_CONTOURS?this.outputContours_(A,g):this.outputPolymesh_(A,d,u,g),!0;}};},/* 62 */ /***/function(h,r){h.exports=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},i=0;i<arguments.length;i++){var a=arguments[i];for(var s in a)t.call(a,s)&&(n[s]=a[s]);}return n;}},/* 63 */ /***/function(h,r,t){t.r(r),t.d(r,"createShaders",function(){return o;}),t.d(r,"applyShader",function(){return f;}),t.d(r,"createCloudShaders",function(){return l;}),t.d(r,"applyCloudShader",function(){return p;});var e=t(64),n=t(65),i=t(66),a=t(67);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol("shaders");function o(y){y[s]=[];for(var O=0;O<16;O++){var x=[],m=!!(O&1),_T14=!!(O&2),_c12=!!(O&4),d=!!(O&8);m&&x.push("#define TEXTURE 1"),_T14&&x.push("#define FILTER 1"),_c12&&x.push("#define GRADIENT 1"),d&&x.push("#define CLIPPATH 1");var u="".concat(x.join("\n"),"\n"),g=[];m&&g.push("uniform sampler2D u_texSampler;"),d&&g.push("uniform sampler2D u_clipSampler;"),y[s][O]=[u+g.join("\n")+n["default"],u+e["default"]];}}function f(y){var _ref95=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref95$hasTexture=_ref95.hasTexture,O=_ref95$hasTexture===void 0?!1:_ref95$hasTexture,_ref95$hasFilter=_ref95.hasFilter,x=_ref95$hasFilter===void 0?!1:_ref95$hasFilter,_ref95$hasGradient=_ref95.hasGradient,m=_ref95$hasGradient===void 0?!1:_ref95$hasGradient,_ref95$hasClipPath=_ref95.hasClipPath,T=_ref95$hasClipPath===void 0?!1:_ref95$hasClipPath;var c=O|x<<1|m<<2|T<<3;var d=y[s][c];Array.isArray(d)&&(d=y.createProgram.apply(y,_toConsumableArray(d)),y[s][c]=d),y.program!==d&&y.useProgram(d,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var v=[];function l(y){for(var O=0;O<64;O++){var x=[],m=!!(O&1),_T15=!!(O&2),_c13=!!(O&4),d=!!(O&8),u=!!(O&16),g=!!(O&32);m&&x.push("#define TEXTURE 1"),_T15&&x.push("#define FILTER 1"),_c13&&x.push("#define GRADIENT 1"),d&&x.push("#define CLOUDCOLOR 1"),u&&x.push("#define CLOUDFILTER 1"),g&&x.push("#define CLIPPATH 1");var M="".concat(x.join("\n"),"\n"),A=[];if(m){A.push("uniform sampler2D u_texSampler;");for(var I=0;I<12;I++)A.push("uniform sampler2D u_texFrame".concat(I,";"));}g&&A.push("uniform sampler2D u_clipSampler;"),v[O]=[M+A.join("\n")+a["default"],M+i["default"]];}}function p(y){var _ref96=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref96$hasTexture=_ref96.hasTexture,O=_ref96$hasTexture===void 0?!1:_ref96$hasTexture,_ref96$hasFilter=_ref96.hasFilter,x=_ref96$hasFilter===void 0?!1:_ref96$hasFilter,_ref96$hasGradient=_ref96.hasGradient,m=_ref96$hasGradient===void 0?!1:_ref96$hasGradient,_ref96$hasCloudColor=_ref96.hasCloudColor,T=_ref96$hasCloudColor===void 0?!1:_ref96$hasCloudColor,_ref96$hasCloudFilter=_ref96.hasCloudFilter,c=_ref96$hasCloudFilter===void 0?!1:_ref96$hasCloudFilter,_ref96$hasClipPath=_ref96.hasClipPath,d=_ref96$hasClipPath===void 0?!1:_ref96$hasClipPath;var u=O|x<<1|m<<2|T<<3|c<<4|d<<5;var g=v[u];Array.isArray(g)&&(g=y.createProgram.apply(y,_toConsumableArray(g)),v[u]=g),y.program!==g&&y.useProgram(g,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});}},/* 64 */ /***/function(h,r,t){t.r(r),r["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(h,r,t){t.r(r),r["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(h,r,t){t.r(r),r["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(h,r,t){t.r(r),r["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(h,r,t){t.r(r),function(e,n){t.d(r,"requestAnimationFrame",function(){return a;}),t.d(r,"cancelAnimationFrame",function(){return s;}),t(1).glMatrix.setMatrixArrayType(Array);function i(){if((typeof performance==="undefined"?"undefined":_typeof(performance))<"u"&&performance.now)return performance.now();if(_typeof(e)<"u"&&e.hrtime){var _e$hrtime=e.hrtime(),_e$hrtime2=_slicedToArray(_e$hrtime,2),o=_e$hrtime2[0],f=_e$hrtime2[1];return o*1e3+f*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var a,s;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(a=n.requestAnimationFrame,s=n.cancelAnimationFrame):(a=function a(o){return setTimeout(function(){o(i());},16);},s=function s(o){return clearTimeout(o);});}.call(this,t(69),t(22));},/* 69 */ /***/function(h,r){var t=h.exports={},e,n;function i(){throw new Error("setTimeout has not been defined");}function a(){throw new Error("clearTimeout has not been defined");}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i;}catch(_unused9){e=i;}try{typeof clearTimeout=="function"?n=clearTimeout:n=a;}catch(_unused10){n=a;}})();function s(T){if(e===setTimeout)return setTimeout(T,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(T,0);try{return e(T,0);}catch(_unused11){try{return e.call(null,T,0);}catch(_unused12){return e.call(this,T,0);}}}function o(T){if(n===clearTimeout)return clearTimeout(T);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(T);try{return n(T);}catch(_unused13){try{return n.call(null,T);}catch(_unused14){return n.call(this,T);}}}var f=[],v=!1,l,p=-1;function y(){!v||!l||(v=!1,l.length?f=l.concat(f):p=-1,f.length&&O());}function O(){if(!v){var T=s(y);v=!0;for(var c=f.length;c;){for(l=f,f=[];++p<c;)l&&l[p].run();p=-1,c=f.length;}l=null,v=!1,o(T);}}t.nextTick=function(T){var c=new Array(arguments.length-1);if(arguments.length>1)for(var d=1;d<arguments.length;d++)c[d-1]=arguments[d];f.push(new x(T,c)),f.length===1&&!v&&s(O);};function x(T,c){this.fun=T,this.array=c;}x.prototype.run=function(){this.fun.apply(null,this.array);},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function m(){}t.on=m,t.addListener=m,t.once=m,t.off=m,t.removeListener=m,t.removeAllListeners=m,t.emit=m,t.prependListener=m,t.prependOnceListener=m,t.listeners=function(T){return[];},t.binding=function(T){throw new Error("process.binding is not supported");},t.cwd=function(){return"/";},t.chdir=function(T){throw new Error("process.chdir is not supported");},t.umask=function(){return 0;};},/* 70 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return I;});var e=t(1),n=t(71),i=t(73),a=t(213),s=t(214),o=t(215),f=t(216);t(1).glMatrix.setMatrixArrayType(Array);function v(b,E){var L=Object.keys(b);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(b);E&&(D=D.filter(function(R){return Object.getOwnPropertyDescriptor(b,R).enumerable;})),L.push.apply(L,D);}return L;}function l(b){for(var E=1;E<arguments.length;E++){var L=arguments[E]!=null?arguments[E]:{};E%2?v(Object(L),!0).forEach(function(D){p(b,D,L[D]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(L)):v(Object(L)).forEach(function(D){Object.defineProperty(b,D,Object.getOwnPropertyDescriptor(L,D));});}return b;}function p(b,E,L){return E in b?Object.defineProperty(b,E,{value:L,enumerable:!0,configurable:!0,writable:!0}):b[E]=L,b;}var y=Symbol["for"]("spritejs_changedAttrs"),O=Symbol["for"]("spritejs_attributes"),x=Symbol("resolution"),m=Symbol("animations"),T=Symbol("eventListeners"),c=Symbol("captureEventListeners"),d=Symbol("filters"),u=Symbol("display"),g=Symbol("program"),M=Symbol("shaderAttrs"),A=Symbol("uniforms");var I=/*#__PURE__*/function(){function I(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,I);this.attributes=new this.constructor.Attr(this),this[x]={width:300,height:150},Object.assign(this.attributes,E),this[m]=/* @__PURE__ */new Set(),this[T]={},this[c]={};}return _createClass(I,[{key:"ancestors",get:function get(){var E=this.parent;var L=[];for(;E;)L.push(E),E=E.parent;return L;}},{key:"animations",get:function get(){return this[m];}},{key:"filters",get:function get(){return this[d]||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 E=this.transformMatrix,_this$attributes=this.attributes,L=_this$attributes.x,D=_this$attributes.y;return E[4]+=L,E[5]+=D,E;}},{key:"opacity",get:function get(){var E=this.attributes.opacity;return this.parent&&this.parent.opacity!=null&&(E*=this.parent.opacity),E;}},{key:"parentNode",get:function get(){return this.parent;}},{key:"nextSibling",get:function get(){return this.getNodeNearBy(1);}},{key:"previousSibling",get:function get(){return this.getNodeNearBy(-1);}},{key:"program",get:function get(){return this[g];}/* get parent defined by connect method */},{key:"renderer",get:function get(){return this.parent?this.parent.renderer:null;}},{key:"renderMatrix",get:function get(){if(this.__cacheRenderMatrix)return this.__cacheRenderMatrix;var E=this.localMatrix;var L=this.parent;if(L){var D=L.__cacheRenderMatrix||L.renderMatrix;D&&(E=e.mat2d.multiply(Array.of(0,0,0,0,0,0),D,E));}return E;}},{key:"worldScaling",get:function get(){var E=this.renderMatrix;return[Math.hypot(E[0],E[1]),Math.hypot(E[2],E[3])];}},{key:"worldRotation",get:function get(){var E=this.renderMatrix;return Math.atan2(E[1],E[3]);}},{key:"worldPosition",get:function get(){var E=this.renderMatrix;return[E[4],E[5]];}},{key:"uniforms",get:function get(){return this[A];}/* get zOrder defined by connect method */ /* attributes */},{key:"className",get:function get(){return this.attributes.className;},set:function set(E){this.attributes.className=E;}},{key:"id",get:function get(){return this.attributes.id;},set:function set(E){this.attributes.id=E;}},{key:"name",get:function get(){return this.attributes.name;},set:function set(E){this.attributes.name=E;}},{key:"zIndex",get:function get(){return this.attributes.zIndex;},set:function set(E){this.attributes.zIndex=E;}},{key:"mesh",get:function get(){return null;}},{key:"shaderAttrs",get:function get(){return this[M]||{};}},{key:"activateAnimations",value:function activateAnimations(){var E=this.layer;if(E){var L=this[m];L.forEach(function(R){R.baseTimeline=E.timeline,R.play(),R.finished.then(function(){L["delete"](R);});});var D=this.children;D&&D.forEach(function(R){R.activateAnimations&&R.activateAnimations();});}}},{key:"addEventListener",value:function addEventListener(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};E==="mousewheel"&&(E="wheel"),typeof D=="boolean"&&(D={capture:D});var _D8=D,R=_D8.capture,C=_D8.once,W=R?c:T;return this[W][E]=this[W][E]||[],this[W][E].push({listener:L,once:C}),this;}},{key:"animate",value:function animate(E,L){var _this10=this;var D=new i["default"](this,E,L);return this.effects&&D.applyEffects(this.effects),this.layer&&(D.baseTimeline=this.layer.timeline,D.play(),D.finished.then(function(){_this10[m]["delete"](D);})),this[m].add(D),D;}},{key:"attr",value:function attr(){for(var _len7=arguments.length,E=new Array(_len7),_key7=0;_key7<_len7;_key7++){E[_key7]=arguments[_key7];}if(E.length===0)return this.attributes[O];if(E.length>1){var L=E[0],D=E[1];return typeof D=="function"&&(D=D(this.attr(L))),this.setAttribute(L,D),this;}return typeof E[0]=="string"?this.getAttribute(E[0]):(Object.assign(this.attributes,E[0]),this);}},{key:"cloneNode",value:function cloneNode(){var E=new this.constructor(),L=this.attributes[y];return E.attr(L),E;}},{key:"connect",value:function connect(E,L){Object.defineProperty(this,"parent",{value:E,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:L,writable:!1,configurable:!0}),E.timeline&&this.activateAnimations(),this.setResolution(E.getResolution()),this.forceUpdate(),this.dispatchEvent({type:"append",detail:{parent:E,zOrder:L}});}},{key:"contains",value:function contains(E){for(;E&&this!==E;)E=E.parent;return!!E;}},{key:"deactivateAnimations",value:function deactivateAnimations(){this[m].forEach(function(L){return L.cancel();});var E=this.children;E&&E.forEach(function(L){L.deactivateAnimations&&L.deactivateAnimations();});}},{key:"disconnect",value:function disconnect(){var E=this.parent,L=this.zOrder;delete this.parent,delete this.zOrder,this.deactivateAnimations(),this.dispatchEvent({type:"remove",detail:{parent:E,zOrder:L}}),E&&E.forceUpdate();}},{key:"dispatchEvent",value:function dispatchEvent(E){var _this11=this;E instanceof s["default"]||(E=new s["default"](E)),E.target=this;var L=E.type;L==="mousewheel"&&(L="wheel");var D=[this];var R=this.parent;for(;E.bubbles&&R;)D.push(R),R=R.parent;for(var C=D.length-1;C>=0;C--){var W=D[C],z=W[c]&&W[c][L];if(z&&z.length&&(E.currentTarget=W,z.forEach(function(_ref97){var H=_ref97.listener,X=_ref97.once;H.call(_this11,E),X&&D.removeEventListener(H);}),delete E.currentTarget),!E.bubbles&&E.cancelBubble)break;}if(!E.cancelBubble)for(var _C4=0;_C4<D.length;_C4++){var _W=D[_C4],_z3=_W[T]&&_W[T][L];if(_z3&&_z3.length&&(E.currentTarget=_W,_z3.forEach(function(_ref98){var H=_ref98.listener,X=_ref98.once;H.call(_this11,E),X&&D.removeEventListener(H);}),delete E.currentTarget),!E.bubbles||E.cancelBubble)break;}}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(E){var L=E.layerX,D=E.layerY;return this.isPointCollision(L,D)?(this.dispatchEvent(E),!0):!1;}},{key:"draw",value:function draw(){var _this12=this;var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var L=this.mesh;if(L){if(Object(o.applyFilters)(L,this.filters),E.push(L),this[g]){L.setProgram(this[g]);var D=this[M];D&&Object.entries(D).forEach(function(_ref99){var _ref100=_slicedToArray(_ref99,2),C=_ref100[0],W=_ref100[1];L.setAttribute(C,W);});var R=this[A];if(this[A]){var C={};Object.entries(R).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),W=_ref102[0],z=_ref102[1];typeof z=="function"&&(z=z(_this12,W)),C[W]=z;}),L.setUniforms(C);}}Object(f["default"])(this,L);}return E;}},{key:"forceUpdate",value:function forceUpdate(){this.parent&&this.parent.forceUpdate();}},{key:"getAttribute",value:function getAttribute(E){return this.attributes[E];}},{key:"getListeners",value:function getListeners(E){var _ref103=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref103$capture=_ref103.capture,L=_ref103$capture===void 0?!1:_ref103$capture;return _toConsumableArray(this[L?c:T][E]||[]);}},{key:"getNodeNearBy",value:function getNodeNearBy(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;if(!this.parent)return null;if(E===0)return this;var L=this.parent.children,D=L.indexOf(this);return L[D+E];}},{key:"getWorldPosition",value:function getWorldPosition(E,L){var D=this.renderMatrix,R=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[R,C];}},{key:"getOffsetPosition",value:function getOffsetPosition(E,L){var D=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),R=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[R,C];}},{key:"getResolution",value:function getResolution(){return l({},this[x]);}},{key:"isPointCollision",value:function isPointCollision(E,L){if(!this.mesh)return!1;var D=this.attributes.pointerEvents;if(D==="none"||D!=="all"&&!this.isVisible)return!1;var R="both";return D==="visibleFill"&&(R="fill"),D==="visibleStroke"&&(R="stroke"),this.mesh.isPointCollision(E,L,R);}},{key:"onPropertyChange",value:function onPropertyChange(E,L,D){E!=="id"&&E!=="name"&&E!=="className"&&E!=="pointerEvents"&&E!=="passEvents"&&this.forceUpdate(),E==="filter"&&(this[d]=Object(o.parseFilterString)(L)),E==="zIndex"&&this.parent&&this.parent.reorder();}},{key:"setAttribute",value:function setAttribute(E,L){E==="attrs"&&this.attr(L),this.attributes[E]=L;}},{key:"setMouseCapture",value:function setMouseCapture(){this.layer&&(this.layer.__mouseCapturedTarget=this);}// layer.renderer.createProgram(fragmentShader, vertexShader, attributeOptions)
|
|
236
|
+
},{key:"setProgram",value:function setProgram(E){this[g]=E,this.forceUpdate();}},{key:"setShaderAttribute",value:function setShaderAttribute(E,L){this[M]=this[M]||{},this[M][E]=L,this.forceUpdate();}},{key:"setUniforms",value:function setUniforms(E){this[A]=this[A]||{},Object.assign(this[A],E),this.forceUpdate();}},{key:"setResolution",value:function setResolution(_ref104){var E=_ref104.width,L=_ref104.height;var _this$x3=this[x],D=_this$x3.width,R=_this$x3.height;(D!==E||R!==L)&&(this[x]={width:E,height:L},this.forceUpdate(),this.dispatchEvent({type:"resolutionchange",detail:{width:E,height:L}}));}},{key:"show",value:function show(){this.attributes.display==="none"&&(this.attributes.display=this[u]||"");}},{key:"hide",value:function hide(){this.attributes.display!=="none"&&(this[u]=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(E){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};typeof L=="boolean"&&(L={capture:L});var R=L.capture?c:T;return this[R][E]&&(this[R][E]=[]),this;}},{key:"removeAttribute",value:function removeAttribute(E){this.setAttribute(E,null);}},{key:"removeEventListener",value:function removeEventListener(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};typeof D=="boolean"&&(D={capture:D});var C=D.capture?c:T;if(this[C][E]){var W=this[C][E];if(W)for(var z=0;z<W.length;z++){var H=W[z].listener;if(H===L){this[C][E].splice(z,1);break;}}}return this;}},{key:"transition",value:function transition(E){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var D=this,R=Symbol("animation");L=L||"linear";var C=0;return _typeof(E)=="object"&&(C=E.delay||0,E=E.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},R,null),"cancel",function cancel(){var W=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var z=this[R];z&&z.cancel(W);}),"end",function end(){var W=this[R];W&&(W.playState==="running"||W.playState==="pending")&&W.finish();}),"reverse",function reverse(){var W=this[R];if(W)if(W.playState==="running"||W.playState==="pending")W.playbackRate=-W.playbackRate;else{var z=W.timing.direction;W.timing.direction=z==="reverse"?"normal":"reverse",W.play();}return W.finished;}),"attr",function attr(W,z){return this.end(),typeof W=="string"&&(W=_defineProperty({},W,z)),Object.entries(W).forEach(function(_ref105){var _ref106=_slicedToArray(_ref105,2),H=_ref106[0],X=_ref106[1];typeof X=="function"&&(W[H]=X(D.attr(H)));}),this[R]=D.animate([W],{duration:E*1e3,delay:C*1e3,fill:"forwards",easing:L}),this[R].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();p(I,"Attr",n["default"]),a["default"].registerNode(I,"node");},/* 71 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return I;});var e=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_declareAlias"),o=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),v=Symbol["for"]("spritejs_attributes"),l=Symbol["for"]("spritejs_changedAttrs"),p=Symbol("subject"),y=Symbol("attr"),O=Symbol("default"),x=Symbol("alias");function m(b,_ref108){var _ref109=_slicedToArray(_ref108,2),E=_ref109[0],L=_ref109[1];var D=e.mat2d.fromValues(1,0,0,1,0,0);return _toConsumableArray(b).forEach(function(_ref110){var _ref111=_slicedToArray(_ref110,2),R=_ref111[0],C=_ref111[1];if((E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[E,L])),R==="matrix")D=e.mat2d.multiply(D,D,C);else if(R==="offsetTranslate")D[4]+=C[0],D[5]+=C[1];else if(R==="offsetRotate")D=e.mat2d.rotate(Array.of(0,0,0,0,0,0),D,C);else if(R==="skew"){var _C5=_slicedToArray(C,2),W=_C5[0],z=_C5[1];D=e.mat2d.multiply(D,D,e.mat2d.fromValues(1,Math.tan(z),Math.tan(W),1,0,0));}else e.mat2d[R](D,D,C);(E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[-E,-L]));}),D;}var T=Symbol("transformMatrix"),c=Symbol("transforms"),d=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),g=Symbol("offsetFigure");function M(b,E,L){var D=b[y][E];if(b[o](E,L,!1)||b[u]!==E){var C=b[c];C.has(E)&&C["delete"](E),L&&(E==="rotate"&&(L=Math.PI*L/180),E==="scale"&&(L=L.map(function(W){return Math.abs(W)>1e-5?W:1/W>0?1e-5:-1e-5;})),C.set(E,L)),b[T]=null,b[p].onPropertyChange(E,L,D,b);}}function A(b){var E=b[g],L=b.offsetDistance*E.getTotalLength(),D=E.getPointAtLength(L);if(D){var R=b[c];var C=b.offsetRotate;C==="auto"?C=D.angle:C==="reverse"?C=Math.PI+D.angle:C=Math.PI*C/180,R.set("offsetRotate",C),R.set("offsetTranslate",[D.x,D.y]),b[T]=null;}}var I=/*#__PURE__*/function(){function I(E){var _this13=this;_classCallCheck(this,I);this[p]=E,this[y]={},this[T]=e.mat2d.fromValues(1,0,0,1,0,0),this[c]=/* @__PURE__ */new Map(),this[O]={},this[x]=[],Object.defineProperty(E,"transformMatrix",{get:function get(){return _this13[T]||(_this13[T]=m(_this13[c],_this13.transformOrigin)),_toConsumableArray(_this13[T]);}}),this[a]({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
|
|
237
|
+
filter:"none",display:""}),this[s]("class","pos"),this[d]=/* @__PURE__ */new Set(),this[g]=new n.Figure2D({scale:5,simplify:0});}return _createClass(I,[{key:l,get:function get(){var _this14=this;var E={};return _toConsumableArray(this[d]).forEach(function(L){E[L]=_this14[y][L];}),E;}},{key:v,get:function get(){var E=Object.assign({},this[y]);for(var L=0;L<this[x].length;L++){var D=this[x][L];E[D]=this[D];}return E;}},{key:a,value:function value(E){Object.assign(this[O],E),Object.assign(this[y],E);}},{key:s,value:function value(){var _this$x4;(_this$x4=this[x]).push.apply(_this$x4,arguments);}},{key:o,value:function value(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var R=this[y][E],C=this[p];return L==null&&(L=this[O][E]),Object(i.compareValue)(R,L)?!1:(this[y][E]=L,this[d].has(E)&&this[d]["delete"](E),this[d].add(E),this[u]=E,D&&C.onPropertyChange(E,L,R,this),!0);}},{key:f,value:function value(E){return this[y][E];}},{key:"id",set:function set(E){this[o]("id",E);}},{key:"id",get:function get(){return this[f]("id");}},{key:"name",set:function set(E){this[o]("name",E);}},{key:"name",get:function get(){return this[f]("name");}},{key:"className",set:function set(E){this[o]("className",E);}},{key:"className",get:function get(){return this[f]("className");}},{key:"class",set:function set(E){this.className=E;}},{key:"class",get:function get(){return this.className;}},{key:"x",get:function get(){return this[f]("x");}},{key:"x",set:function set(E){this[o]("x",Object(i.toNumber)(E));}},{key:"y",get:function get(){return this[f]("y");}},{key:"y",set:function set(E){this[o]("y",Object(i.toNumber)(E));}},{key:"pos",get:function get(){return[this.x,this.y];}},{key:"pos",set:function set(E){E=Object(i.toArray)(E),Array.isArray(E)||(E=[E,E]),this.x=E[0],this.y=E[1];}},{key:"transform",get:function get(){return this[f]("transform");}},{key:"transform",set:function set(E){var L=null;if(Array.isArray(E)&&(L=E,E="matrix(".concat(E.map(i.toNumber).join(),")")),typeof E=="string")E=E.replace(/\s*,\s*/g,",");else if(E!=null)throw new TypeError("Invalid transform value.");var D=this[y].transform;if(this[o]("transform",E,!1)){var R=this[c];if(R.has("matrix")&&R["delete"]("matrix"),L)R.set("matrix",L);else if(E){var C=E.match(/(matrix|translate|rotate|scale|skew)\([^()]+\)/g);if(C){var W=e.mat2d.fromValues(1,0,0,1,0,0);for(var z=0;z<C.length;z++){var X=C[z].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(X){var _X2=_slicedToArray(X,3),Z=_X2[1],j=_X2[2];Z==="rotate"?j=Math.PI*parseFloat(j)/180:j=j.trim().split(/[\s,]+/).map(function(G){return Object(i.toNumber)(G);}),Z==="matrix"?W=e.mat2d.multiply(W,W,j):Z==="skew"?W=e.mat2d.multiply(W,W,e.mat2d.fromValues(1,Math.tan(j[1]),Math.tan(j[0]),1,0,0)):e.mat2d[Z](W,W,j),R.set("matrix",W);}}}else throw new TypeError("Invalid transform value.");}this[T]=null,this[p].onPropertyChange("transform",E,D,this);}}},{key:"transformOrigin",get:function get(){return this[f]("transformOrigin");}},{key:"transformOrigin",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),this[o]("transformOrigin",E)&&(this[T]=null);}},{key:"rotate",get:function get(){return this[f]("rotate");}},{key:"rotate",set:function set(E){M(this,"rotate",E);}},{key:"translate",get:function get(){return this[f]("translate");}},{key:"translate",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),M(this,"translate",E);}},{key:"scale",get:function get(){return this[f]("scale");}},{key:"scale",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),M(this,"scale",E);}},{key:"skew",get:function get(){return this[f]("skew");}},{key:"skew",set:function set(E){E=Object(i.toArray)(E,!0),E!=null&&!Array.isArray(E)&&(E=[E,E]),M(this,"skew",E);}},{key:"opacity",get:function get(){return this[f]("opacity");}},{key:"opacity",set:function set(E){E!=null&&(E=Number(E)),this[o]("opacity",E);}},{key:"zIndex",get:function get(){return this[f]("zIndex");}},{key:"zIndex",set:function set(E){E!=null&&(E=Number(E)),this[o]("zIndex",E);}},{key:"offsetPath",get:function get(){return this[f]("offsetPath");}},{key:"offsetPath",set:function set(E){this[o]("offsetPath",E)&&(this[g].beginPath(),E!=null&&this[g].addPath(E),A(this));}},{key:"offsetDistance",get:function get(){return this[f]("offsetDistance");}},{key:"offsetDistance",set:function set(E){this[o]("offsetDistance",Object(i.toNumber)(E))&&A(this);}},{key:"offsetRotate",get:function get(){return this[f]("offsetRotate");}},{key:"offsetRotate",set:function set(E){this[o]("offsetRotate",E),A(this);}},{key:"pointerEvents",get:function get(){return this[f]("pointerEvents");}},{key:"pointerEvents",set:function set(E){if(E!=null&&E!=="none"&&E!=="visible"&&E!=="visibleFill"&&E!=="visibleStroke"&&E!=="all")throw new TypeError("Invalid pointerEvents type.");this[o]("pointerEvents",E);}},{key:"filter",get:function get(){return this[f]("filter");}},{key:"filter",set:function set(E){this[o]("filter",E);}},{key:"display",get:function get(){return this[f]("display");}},{key:"display",set:function set(E){this[o]("display",E);}/* istanbul ignore next */},{key:"offset",set:function set(E){}}],[{key:"setDefault",value:function setDefault(E){for(var _len8=arguments.length,L=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){L[_key8-1]=arguments[_key8];}return E[a].apply(E,L);}},{key:"declareAlias",value:function declareAlias(E){for(var _len9=arguments.length,L=new Array(_len9>1?_len9-1:0),_key9=1;_key9<_len9;_key9++){L[_key9-1]=arguments[_key9];}return E[s].apply(E,L);}},{key:"setAttribute",value:function setAttribute(E){for(var _len10=arguments.length,L=new Array(_len10>1?_len10-1:0),_key10=1;_key10<_len10;_key10++){L[_key10-1]=arguments[_key10];}return E[o].apply(E,L);}},{key:"getAttribute",value:function getAttribute(E){for(var _len11=arguments.length,L=new Array(_len11>1?_len11-1:0),_key11=1;_key11<_len11;_key11++){L[_key11-1]=arguments[_key11];}return E[f].apply(E,L);}},{key:"getAttributes",value:function getAttributes(E){return E[v];}},{key:"getChangedAttributes",value:function getChangedAttributes(E){return E[l];}}]);}();},/* 72 */ /***/function(h,r,t){t.r(r),t.d(r,"sizeToPixel",function(){return e;}),t.d(r,"toString",function(){return n;}),t.d(r,"toNumber",function(){return i;}),t.d(r,"toArray",function(){return a;}),t.d(r,"compareValue",function(){return s;}),t(1).glMatrix.setMatrixArrayType(Array);function e(o,f){var v=o.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);v?o={size:parseFloat(v[1]),unit:v[2]}:o={size:parseFloat(o),unit:"px"};var _o3=o,l=_o3.size,p=_o3.unit;if(p==="pt")l/=0.75;else if(p==="pc")l*=16;else if(p==="in")l*=96;else if(p==="cm")l*=96/2.54;else if(p==="mm")l*=96/25.4;else if(p==="em"||p==="rem"||p==="ex"){if(!f&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var y=getComputedStyle(document.documentElement).fontSize;y?f=e(y,16):f=16;}l*=f,p==="ex"&&(l/=2);}else if(p==="q")l*=96/25.4/4;else if(p==="vw"||p==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y3=p==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;l*=_y3/100;}}else if((p==="vmax"||p==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _y4=window.innerWidth||document.documentElement.clientWidth,O=window.innerHeight||document.documentElement.clientHeight;p==="vmax"?l*=Math.max(_y4,O)/100:l*=Math.min(_y4,O)/100;}return l;}function n(o){return o==null?o:String(o);}function i(o){if(o==null)return o;if(typeof o=="string"&&(o=e(o)),!Number.isFinite(o))throw new TypeError("Invalid value");return o;}function a(o){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return o===""?null:(typeof o=="string"&&(o=o.split(/[\s,]+/g)),Array.isArray(o)&&(f&&(o=o.map(i)),o.length===1)?o[0]:o);}function s(o,f){if(Array.isArray(o)&&Array.isArray(f)){if(o.length!==f.length)return!1;for(var v=0;v<o.length;v++)if(o[v]!==f[v])return!1;return!0;}return o==null&&f==null||o===f;}},/* 73 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(74),n=t(32),i=/* @__PURE__ */t.n(n),a=t(68),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);function o(){return o=Object.assign||function(y){for(var O=1;O<arguments.length;O++){var x=arguments[O];for(var m in x)Object.prototype.hasOwnProperty.call(x,m)&&(y[m]=x[m]);}return y;},o.apply(this,arguments);}function f(y){if(typeof y=="string"){if(y=y.trim(),/^[0-9.]+%$/.test(y))return parseFloat(y)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(y))return Object(s.sizeToPixel)(y);}return y;}function v(y,O,x,m,T){return typeof y=="string"&&(y=i()(y)),typeof O=="string"&&(O=i()(O)),e.Effects["default"](y,O,x,m,T);}function l(y,O,x,m,T){return e.Effects["default"](y,O,x,m,T);}e.Effects["default"]=function(y,O,x,m,T){return Array.isArray(y)&&Array.isArray(O)?y.map(function(c,d){return c+(x-m)/(T-m)*(O[d]-c);}):typeof y=="number"&&typeof O=="number"?y+(x-m)/(T-m)*(O-y):x-m>T-x?O:y;},e.Effects.fillColor=v,e.Effects.strokeColor=v,e.Effects.bgcolor=v,e.Effects.borderColor=v,e.Effects.text=l;var p=/*#__PURE__*/function(_e$Animator){function p(O,x,m){var _this15;_classCallCheck(this,p);var T=O.attr();Object.entries(T).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),c=_ref113[0],d=_ref113[1];T[c]=e.Effects[c]?d:f(d);}),x=x.map(function(c){var d=o({},c);var u={};return Object.entries(d).forEach(function(_ref114){var _ref115=_slicedToArray(_ref114,2),g=_ref115[0],M=_ref115[1];u[g]=e.Effects[g]?M:f(M);}),u;}),_this15=_callSuper(this,p,[T,x,m]),_this15.target=O,_this15.setter=function(c,d){d.attr(c);};return _this15;}_inherits(p,_e$Animator);return _createClass(p,[{key:"playState",get:function get(){return this.target.parent?_get(_getPrototypeOf(p.prototype),"playState",this):"idle";}},{key:"finished",get:function get(){var _this16=this;return _get(_getPrototypeOf(p.prototype),"finished",this).then(function(){var O=_this16;return new Promise(function(x){function m(){O.setter(O.frame,O.target);var T=O.playState;T==="finished"||T==="idle"?(Object(a.cancelAnimationFrame)(O.requestId),x()):Object(a.requestAnimationFrame)(m);}m();});});}},{key:"finish",value:function finish(){_get(_getPrototypeOf(p.prototype),"finish",this).call(this),Object(a.cancelAnimationFrame)(this.requestId),this.setter(this.frame,this.target);}},{key:"play",value:function play(){if(!this.target.parent||this.playState==="running")return;_get(_getPrototypeOf(p.prototype),"play",this).call(this),this.setter(this.frame,this.target);var O=this;this.ready.then(function(){O.setter(O.frame,O.target),O.requestId=Object(a.requestAnimationFrame)(function x(){var m=O.target;if((typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.documentElement&&document.documentElement.contains&&m.layer&&m.layer.canvas&&!document.documentElement.contains(m.layer.canvas)){O.cancel();return;}var T=O.playState;O.setter(O.frame,O.target),T!=="idle"&&(T==="running"?O.requestId=Object(a.requestAnimationFrame)(x):(T==="paused"||T==="pending"&&O.timeline.currentTime<0)&&O.ready.then(function(){O.setter(O.frame,O.target),O.requestId=Object(a.requestAnimationFrame)(x);}));});});}},{key:"cancel",value:function cancel(){var O=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;Object(a.cancelAnimationFrame)(this.requestId),O?(this.setter(this.frame,this.target),_get(_getPrototypeOf(p.prototype),"cancel",this).call(this)):(_get(_getPrototypeOf(p.prototype),"cancel",this).call(this),this.setter(this.frame,this.target));}}]);}(e.Animator);},/* 74 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.Timeline=r.Effects=r.Easings=r.Animator=void 0;var e=t(75),n=v(e),i=t(187),a=v(i),s=t(188),o=t(190),f=v(o);function v(l){return l&&l.__esModule?l:{"default":l};}r.Animator=f["default"],r.Easings=s.Easings,r.Effects=a["default"],r.Timeline=n["default"];},/* 75 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=c(e),i=t(133),a=c(i),s=t(141),o=c(s),f=t(164),v=c(f),l=t(170),p=c(l),y=t(171),O=c(y),x=t(175),m=c(x),T=t(186);function c(D){return D&&D.__esModule?D:{"default":D};}var d=(0,T.createNowTime)(),u={originTime:0,playbackRate:1},g=(0,m["default"])("timeMark"),M=(0,m["default"])("playbackRate"),A=(0,m["default"])("timers"),I=(0,m["default"])("originTime"),b=(0,m["default"])("setTimer"),E=(0,m["default"])("parent"),L=function(){function D(R,C){(0,p["default"])(this,D),R instanceof D&&(C=R,R={}),R=(0,v["default"])({},u,R),C&&(this[E]=C);var W=R.nowtime||d;if(C)Object.defineProperty(this,"globalTime",{get:function get(){return C.currentTime;}});else{var z=W();Object.defineProperty(this,"globalTime",{get:function get(){return W()-z;}});}this[g]=[{globalTime:this.globalTime,localTime:-R.originTime,entropy:-R.originTime,playbackRate:R.playbackRate,globalEntropy:0}],this[E]&&(this[g][0].globalEntropy=this[E].entropy),this[I]=R.originTime,this[M]=R.playbackRate,this[A]=new o["default"]();}return(0,O["default"])(D,[{key:"markTime",value:function value(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=C.time,z=W===void 0?this.currentTime:W,H=C.entropy,X=H===void 0?this.entropy:H,Z=C.playbackRate,j=Z===void 0?this.playbackRate:Z,G={globalTime:this.globalTime,localTime:z,entropy:X,playbackRate:j,globalEntropy:this.globalEntropy};this[g].push(G);}},{key:"fork",value:function value(C){return new D(C,this);}},{key:"seekGlobalTime",value:function value(C){var W=this.seekTimeMark(C),z=this[g][W],H=z.entropy,X=z.playbackRate,Z=z.globalTime;return Z+(C-H)/Math.abs(X);}},{key:"seekLocalTime",value:function value(C){var W=this.seekTimeMark(C),z=this[g][W],H=z.localTime,X=z.entropy,Z=z.playbackRate;return Z>0?H+(C-X):H-(C-X);}},{key:"seekTimeMark",value:function value(C){var W=this[g],z=0,H=W.length-1;if(C<=W[z].entropy)return z;if(C>=W[H].entropy)return H;for(var X=Math.floor((z+H)/2);X>z&&X<H;){if(C===W[X].entropy)return X;C<W[X].entropy?H=X:C>W[X].entropy&&(z=X),X=Math.floor((z+H)/2);}return z;}},{key:"updateTimers",value:function value(){var C=this,W=[].concat((0,a["default"])(this[A]));W.forEach(function(z){var H=(0,n["default"])(z,2),X=H[0],Z=H[1];C[b](Z.handler,Z.time,X);});}},{key:"clearTimeout",value:function(R){function C(W){return R.apply(this,arguments);}return C.toString=function(){return R.toString();},C;}(function(R){var C=this[A].get(R);C&&C.timerID!=null&&(this[E]?this[E].clearTimeout(C.timerID):clearTimeout(C.timerID)),this[A]["delete"](R);})},{key:"clearInterval",value:function value(C){return this.clearTimeout(C);}},{key:"clear",value:function value(){var C=this,W=this[A];[].concat((0,a["default"])(W.keys())).forEach(function(z){C.clearTimeout(z);});}/*
|
|
238
|
+
setTimeout(func, {delay: 100, isEntropy: true})
|
|
239
|
+
setTimeout(func, {entropy: 100})
|
|
240
|
+
setTimeout(func, 100})
|
|
241
|
+
*/},{key:"setTimeout",value:function value(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0};return this[b](C,W);}},{key:"setInterval",value:function value(C){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{delay:0},z=this,H=this[b](function X(){z[b](X,W,H),C();},W);return H;}},{key:b,value:function value(C,W){var z=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,m["default"])("timerID");W=(0,T.formatDelay)(W);var X=this[A].get(H),Z=void 0,j=null,G=void 0,Q=void 0;X?(this.clearTimeout(H),W.isEntropy?Z=(W.delay-(this.entropy-X.startEntropy))/Math.abs(this.playbackRate):Z=(W.delay-(this.currentTime-X.startTime))/this.playbackRate,G=X.startTime,Q=X.startEntropy):(Z=W.delay/(W.isEntropy?Math.abs(this.playbackRate):this.playbackRate),G=this.currentTime,Q=this.entropy);var tt=this[E],et=tt?tt.setTimeout.bind(tt):setTimeout,at=W.heading;return!tt&&at===!1&&Z<0&&(Z=1/0),(isFinite(Z)||tt)&&(Z=Math.ceil(Z),et!==setTimeout&&(Z={delay:Z,heading:at}),j=et(function(){z[A]["delete"](H),C();},Z)),this[A].set(H,{timerID:j,handler:C,time:W,startTime:G,startEntropy:Q}),H;}},{key:"parent",get:function get(){return this[E];}},{key:"lastTimeMark",get:function get(){return this[g][this[g].length-1];}},{key:"currentTime",get:function get(){var C=this.lastTimeMark,W=C.localTime,z=C.globalTime;return W+(this.globalTime-z)*this.playbackRate;},set:function set(C){var W=this,z=this.currentTime,H=C,X=this[A];this.markTime({time:C}),[].concat((0,a["default"])(X)).forEach(function(Z){var j=(0,n["default"])(Z,2),G=j[0],Q=j[1];if(X.has(G)){var tt=Q.time,et=tt.isEntropy,at=tt.delay,q=tt.heading,pt=Q.handler,dt=Q.startTime;if(et)at===0&&(pt(),W.clearTimeout(G));else{var B=dt+at;(at===0||q!==!1&&(H-z)*at<=0||z<=B&&B<=H||z>=B&&B>=H)&&(pt(),W.clearTimeout(G));}}}),this.updateTimers();}// Both currentTime and entropy should be influenced by playbackRate.
|
|
242
|
+
// If current playbackRate is negative, the currentTime should go backwards
|
|
243
|
+
// while the entropy remain to go forwards.
|
|
244
|
+
// Both of the initial values is set to -originTime
|
|
245
|
+
},{key:"entropy",get:function get(){var C=this.lastTimeMark,W=C.entropy,z=C.globalEntropy;return W+Math.abs((this.globalEntropy-z)*this.playbackRate);},// get globalTime() {
|
|
246
|
+
// if(this[_parent]) {
|
|
247
|
+
// return this[_parent].currentTime;
|
|
248
|
+
// }
|
|
249
|
+
// return nowtime();
|
|
250
|
+
// }
|
|
251
|
+
// change entropy will NOT cause currentTime changing but may influence the pass
|
|
252
|
+
// and the future of the timeline. (It may change the result of seek***Time)
|
|
253
|
+
// While entropy is set, all the marks behind will be droped
|
|
254
|
+
set:function set(C){if(this.entropy>C){var W=this.seekTimeMark(C);this[g].length=W+1;}this.markTime({entropy:C}),this.updateTimers();}},{key:"globalEntropy",get:function get(){return this[E]?this[E].entropy:this.globalTime;}},{key:"playbackRate",get:function get(){return this[M];},set:function set(C){C!==this.playbackRate&&(this.markTime({playbackRate:C}),this[M]=C,this.updateTimers());}},{key:"paused",get:function get(){if(this.playbackRate===0)return!0;for(var C=this.parent;C;){if(C.playbackRate===0)return!0;C=C.parent;}return!1;}}]),D;}();r["default"]=L;},/* 76 */ /***/function(h,r,t){r.__esModule=!0;var e=t(77),n=s(e),i=t(129),a=s(i);function s(o){return o&&o.__esModule?o:{"default":o};}r["default"]=/* @__PURE__ */function(){function o(f,v){var l=[],p=!0,y=!1,O=void 0;try{for(var x=(0,a["default"])(f),m;!(p=(m=x.next()).done)&&(l.push(m.value),!(v&&l.length===v));p=!0);}catch(T){y=!0,O=T;}finally{try{!p&&x["return"]&&x["return"]();}finally{if(y)throw O;}}return l;}return function(f,v){if(Array.isArray(f))return f;if((0,n["default"])(Object(f)))return o(f,v);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}();},/* 77 */ /***/function(h,r,t){h.exports={"default":t(78),__esModule:!0};},/* 78 */ /***/function(h,r,t){t(79),t(125),h.exports=t(127);},/* 79 */ /***/function(h,r,t){t(80);for(var e=t(91),n=t(95),i=t(83),a=t(122)("toStringTag"),s="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(","),o=0;o<s.length;o++){var f=s[o],v=e[f],l=v&&v.prototype;l&&!l[a]&&n(l,a,f),i[f]=i.Array;}},/* 80 */ /***/function(h,r,t){var e=t(81),n=t(82),i=t(83),a=t(84);h.exports=t(88)(Array,"Array",function(s,o){this._t=a(s),this._i=0,this._k=o;},function(){var s=this._t,o=this._k,f=this._i++;return!s||f>=s.length?(this._t=void 0,n(1)):o=="keys"?n(0,f):o=="values"?n(0,s[f]):n(0,[f,s[f]]);},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries");},/* 81 */ /***/function(h,r){h.exports=function(){};},/* 82 */ /***/function(h,r){h.exports=function(t,e){return{value:e,done:!!t};};},/* 83 */ /***/function(h,r){h.exports={};},/* 84 */ /***/function(h,r,t){var e=t(85),n=t(87);h.exports=function(i){return e(n(i));};},/* 85 */ /***/function(h,r,t){var e=t(86);h.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return e(n)=="String"?n.split(""):Object(n);};},/* 86 */ /***/function(h,r){var t={}.toString;h.exports=function(e){return t.call(e).slice(8,-1);};},/* 87 */ /***/function(h,r){h.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t;};},/* 88 */ /***/function(h,r,t){var e=t(89),n=t(90),i=t(106),a=t(95),s=t(83),o=t(107),f=t(121),v=t(123),l=t(122)("iterator"),p=!([].keys&&"next"in[].keys()),y="@@iterator",O="keys",x="values",m=function m(){return this;};h.exports=function(T,c,d,u,g,M,A){o(d,c,u);var I=function I(j){if(!p&&j in D)return D[j];switch(j){case O:return function(){return new d(this,j);};case x:return function(){return new d(this,j);};}return function(){return new d(this,j);};},b=c+" Iterator",E=g==x,L=!1,D=T.prototype,R=D[l]||D[y]||g&&D[g],C=R||I(g),W=g?E?I("entries"):C:void 0,z=c=="Array"&&D.entries||R,H,X,Z;if(z&&(Z=v(z.call(new T())),Z!==Object.prototype&&Z.next&&(f(Z,b,!0),!e&&typeof Z[l]!="function"&&a(Z,l,m))),E&&R&&R.name!==x&&(L=!0,C=function C(){return R.call(this);}),(!e||A)&&(p||L||!D[l])&&a(D,l,C),s[c]=C,s[b]=m,g)if(H={values:E?C:I(x),keys:M?C:I(O),entries:W},A)for(X in H)X in D||i(D,X,H[X]);else n(n.P+n.F*(p||L),c,H);return H;};},/* 89 */ /***/function(h,r){h.exports=!0;},/* 90 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(93),a=t(95),s=t(105),o="prototype",f=function f(v,l,p){var y=v&f.F,O=v&f.G,x=v&f.S,m=v&f.P,T=v&f.B,c=v&f.W,d=O?n:n[l]||(n[l]={}),u=d[o],g=O?e:x?e[l]:(e[l]||{})[o],M,A,I;O&&(p=l);for(M in p)A=!y&&g&&g[M]!==void 0,!(A&&s(d,M))&&(I=A?g[M]:p[M],d[M]=O&&typeof g[M]!="function"?p[M]:T&&A?i(I,e):c&&g[M]==I?function(b){var E=function E(L,D,R){if(this instanceof b){switch(arguments.length){case 0:return new b();case 1:return new b(L);case 2:return new b(L,D);}return new b(L,D,R);}return b.apply(this,arguments);};return E[o]=b[o],E;}(I):m&&typeof I=="function"?i(Function.call,I):I,m&&((d.virtual||(d.virtual={}))[M]=I,v&f.R&&u&&!u[M]&&a(u,M,I)));};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,h.exports=f;},/* 91 */ /***/function(h,r){var t=h.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(h,r){var t=h.exports={version:"2.6.11"};typeof __e=="number"&&(__e=t);},/* 93 */ /***/function(h,r,t){var e=t(94);h.exports=function(n,i,a){if(e(n),i===void 0)return n;switch(a){case 1:return function(s){return n.call(i,s);};case 2:return function(s,o){return n.call(i,s,o);};case 3:return function(s,o,f){return n.call(i,s,o,f);};}return function(){return n.apply(i,arguments);};};},/* 94 */ /***/function(h,r){h.exports=function(t){if(typeof t!="function")throw TypeError(t+" is not a function!");return t;};},/* 95 */ /***/function(h,r,t){var e=t(96),n=t(104);h.exports=t(100)?function(i,a,s){return e.f(i,a,n(1,s));}:function(i,a,s){return i[a]=s,i;};},/* 96 */ /***/function(h,r,t){var e=t(97),n=t(99),i=t(103),a=Object.defineProperty;r.f=t(100)?Object.defineProperty:function(o,f,v){if(e(o),f=i(f,!0),e(v),n)try{return a(o,f,v);}catch(_unused15){}if("get"in v||"set"in v)throw TypeError("Accessors not supported!");return"value"in v&&(o[f]=v.value),o;};},/* 97 */ /***/function(h,r,t){var e=t(98);h.exports=function(n){if(!e(n))throw TypeError(n+" is not an object!");return n;};},/* 98 */ /***/function(h,r){h.exports=function(t){return _typeof(t)=="object"?t!==null:typeof t=="function";};},/* 99 */ /***/function(h,r,t){h.exports=!t(100)&&!t(101)(function(){return Object.defineProperty(t(102)("div"),"a",{get:function get(){return 7;}}).a!=7;});},/* 100 */ /***/function(h,r,t){h.exports=!t(101)(function(){return Object.defineProperty({},"a",{get:function get(){return 7;}}).a!=7;});},/* 101 */ /***/function(h,r){h.exports=function(t){try{return!!t();}catch(_unused16){return!0;}};},/* 102 */ /***/function(h,r,t){var e=t(98),n=t(91).document,i=e(n)&&e(n.createElement);h.exports=function(a){return i?n.createElement(a):{};};},/* 103 */ /***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n))return n;var a,s;if(i&&typeof(a=n.toString)=="function"&&!e(s=a.call(n))||typeof(a=n.valueOf)=="function"&&!e(s=a.call(n))||!i&&typeof(a=n.toString)=="function"&&!e(s=a.call(n)))return s;throw TypeError("Can't convert object to primitive value");};},/* 104 */ /***/function(h,r){h.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e};};},/* 105 */ /***/function(h,r){var t={}.hasOwnProperty;h.exports=function(e,n){return t.call(e,n);};},/* 106 */ /***/function(h,r,t){h.exports=t(95);},/* 107 */ /***/function(h,r,t){var e=t(108),n=t(104),i=t(121),a={};t(95)(a,t(122)("iterator"),function(){return this;}),h.exports=function(s,o,f){s.prototype=e(a,{next:n(1,f)}),i(s,o+" Iterator");};},/* 108 */ /***/function(h,r,t){var e=t(97),n=t(109),i=t(119),a=t(116)("IE_PROTO"),s=function s(){},o="prototype",_f2=function f(){var v=t(102)("iframe"),l=i.length,p="<",y=">",O;for(v.style.display="none",t(120).appendChild(v),v.src="javascript:",O=v.contentWindow.document,O.open(),O.write(p+"script"+y+"document.F=Object"+p+"/script"+y),O.close(),_f2=O.F;l--;)delete _f2[o][i[l]];return _f2();};h.exports=Object.create||function(l,p){var y;return l!==null?(s[o]=e(l),y=new s(),s[o]=null,y[a]=l):y=_f2(),p===void 0?y:n(y,p);};},/* 109 */ /***/function(h,r,t){var e=t(96),n=t(97),i=t(110);h.exports=t(100)?Object.defineProperties:function(s,o){n(s);for(var f=i(o),v=f.length,l=0,p;v>l;)e.f(s,p=f[l++],o[p]);return s;};},/* 110 */ /***/function(h,r,t){var e=t(111),n=t(119);h.exports=Object.keys||function(a){return e(a,n);};},/* 111 */ /***/function(h,r,t){var e=t(105),n=t(84),i=t(112)(!1),a=t(116)("IE_PROTO");h.exports=function(s,o){var f=n(s),v=0,l=[],p;for(p in f)p!=a&&e(f,p)&&l.push(p);for(;o.length>v;)e(f,p=o[v++])&&(~i(l,p)||l.push(p));return l;};},/* 112 */ /***/function(h,r,t){var e=t(84),n=t(113),i=t(115);h.exports=function(a){return function(s,o,f){var v=e(s),l=n(v.length),p=i(f,l),y;if(a&&o!=o){for(;l>p;)if(y=v[p++],y!=y)return!0;}else for(;l>p;p++)if((a||p in v)&&v[p]===o)return a||p||0;return!a&&-1;};};},/* 113 */ /***/function(h,r,t){var e=t(114),n=Math.min;h.exports=function(i){return i>0?n(e(i),9007199254740991):0;};},/* 114 */ /***/function(h,r){var t=Math.ceil,e=Math.floor;h.exports=function(n){return isNaN(n=+n)?0:(n>0?e:t)(n);};},/* 115 */ /***/function(h,r,t){var e=t(114),n=Math.max,i=Math.min;h.exports=function(a,s){return a=e(a),a<0?n(a+s,0):i(a,s);};},/* 116 */ /***/function(h,r,t){var e=t(117)("keys"),n=t(118);h.exports=function(i){return e[i]||(e[i]=n(i));};},/* 117 */ /***/function(h,r,t){var e=t(92),n=t(91),i="__core-js_shared__",a=n[i]||(n[i]={});(h.exports=function(s,o){return a[s]||(a[s]=o!==void 0?o:{});})("versions",[]).push({version:e.version,mode:t(89)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"});},/* 118 */ /***/function(h,r){var t=0,e=Math.random();h.exports=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++t+e).toString(36));};},/* 119 */ /***/function(h,r){h.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},/* 120 */ /***/function(h,r,t){var e=t(91).document;h.exports=e&&e.documentElement;},/* 121 */ /***/function(h,r,t){var e=t(96).f,n=t(105),i=t(122)("toStringTag");h.exports=function(a,s,o){a&&!n(a=o?a:a.prototype,i)&&e(a,i,{configurable:!0,value:s});};},/* 122 */ /***/function(h,r,t){var e=t(117)("wks"),n=t(118),i=t(91).Symbol,a=typeof i=="function",s=h.exports=function(o){return e[o]||(e[o]=a&&i[o]||(a?i:n)("Symbol."+o));};s.store=e;},/* 123 */ /***/function(h,r,t){var e=t(105),n=t(124),i=t(116)("IE_PROTO"),a=Object.prototype;h.exports=Object.getPrototypeOf||function(s){return s=n(s),e(s,i)?s[i]:typeof s.constructor=="function"&&s instanceof s.constructor?s.constructor.prototype:s instanceof Object?a:null;};},/* 124 */ /***/function(h,r,t){var e=t(87);h.exports=function(n){return Object(e(n));};},/* 125 */ /***/function(h,r,t){var e=t(126)(!0);t(88)(String,"String",function(n){this._t=String(n),this._i=0;},function(){var n=this._t,i=this._i,a;return i>=n.length?{value:void 0,done:!0}:(a=e(n,i),this._i+=a.length,{value:a,done:!1});});},/* 126 */ /***/function(h,r,t){var e=t(114),n=t(87);h.exports=function(i){return function(a,s){var o=String(n(a)),f=e(s),v=o.length,l,p;return f<0||f>=v?i?"":void 0:(l=o.charCodeAt(f),l<55296||l>56319||f+1===v||(p=o.charCodeAt(f+1))<56320||p>57343?i?o.charAt(f):l:i?o.slice(f,f+2):(l-55296<<10)+(p-56320)+65536);};};},/* 127 */ /***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).isIterable=function(a){var s=Object(a);return s[n]!==void 0||"@@iterator"in s||i.hasOwnProperty(e(s));};},/* 128 */ /***/function(h,r,t){var e=t(86),n=t(122)("toStringTag"),i=e(/* @__PURE__ */function(){return arguments;}())=="Arguments",a=function a(s,o){try{return s[o];}catch(_unused17){}};h.exports=function(s){var o,f,v;return s===void 0?"Undefined":s===null?"Null":typeof(f=a(o=Object(s),n))=="string"?f:i?e(o):(v=e(o))=="Object"&&typeof o.callee=="function"?"Arguments":v;};},/* 129 */ /***/function(h,r,t){h.exports={"default":t(130),__esModule:!0};},/* 130 */ /***/function(h,r,t){t(79),t(125),h.exports=t(131);},/* 131 */ /***/function(h,r,t){var e=t(97),n=t(132);h.exports=t(92).getIterator=function(i){var a=n(i);if(typeof a!="function")throw TypeError(i+" is not iterable!");return e(a.call(i));};},/* 132 */ /***/function(h,r,t){var e=t(128),n=t(122)("iterator"),i=t(83);h.exports=t(92).getIteratorMethod=function(a){if(a!=null)return a[n]||a["@@iterator"]||i[e(a)];};},/* 133 */ /***/function(h,r,t){r.__esModule=!0;var e=t(134),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=function(a){if(Array.isArray(a)){for(var s=0,o=Array(a.length);s<a.length;s++)o[s]=a[s];return o;}else return(0,n["default"])(a);};},/* 134 */ /***/function(h,r,t){h.exports={"default":t(135),__esModule:!0};},/* 135 */ /***/function(h,r,t){t(125),t(136),h.exports=t(92).Array.from;},/* 136 */ /***/function(h,r,t){var e=t(93),n=t(90),i=t(124),a=t(137),s=t(138),o=t(113),f=t(139),v=t(132);n(n.S+n.F*!t(140)(function(l){Array.from(l);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
|
|
255
|
+
from:function from(p){var y=i(p),O=typeof this=="function"?this:Array,x=arguments.length,m=x>1?arguments[1]:void 0,T=m!==void 0,c=0,d=v(y),u,g,M,A;if(T&&(m=e(m,x>2?arguments[2]:void 0,2)),d!=null&&!(O==Array&&s(d)))for(A=d.call(y),g=new O();!(M=A.next()).done;c++)f(g,c,T?a(A,m,[M.value,c],!0):M.value);else for(u=o(y.length),g=new O(u);u>c;c++)f(g,c,T?m(y[c],c):y[c]);return g.length=c,g;}});},/* 137 */ /***/function(h,r,t){var e=t(97);h.exports=function(n,i,a,s){try{return s?i(e(a)[0],a[1]):i(a);}catch(f){var o=n["return"];throw o!==void 0&&e(o.call(n)),f;}};},/* 138 */ /***/function(h,r,t){var e=t(83),n=t(122)("iterator"),i=Array.prototype;h.exports=function(a){return a!==void 0&&(e.Array===a||i[n]===a);};},/* 139 */ /***/function(h,r,t){var e=t(96),n=t(104);h.exports=function(i,a,s){a in i?e.f(i,a,n(0,s)):i[a]=s;};},/* 140 */ /***/function(h,r,t){var e=t(122)("iterator"),n=!1;try{var i=[7][e]();i["return"]=function(){n=!0;},Array.from(i,function(){throw 2;});}catch(_unused18){}h.exports=function(a,s){if(!s&&!n)return!1;var o=!1;try{var f=[7],v=f[e]();v.next=function(){return{done:o=!0};},f[e]=function(){return v;},a(f);}catch(_unused19){}return o;};},/* 141 */ /***/function(h,r,t){h.exports={"default":t(142),__esModule:!0};},/* 142 */ /***/function(h,r,t){t(143),t(125),t(79),t(144),t(157),t(160),t(162),h.exports=t(92).Map;},/* 143 */ /***/function(h,r){},/* 144 */ /***/function(h,r,t){var e=t(145),n=t(151),i="Map";h.exports=t(152)(i,function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0);};},{// 23.1.3.6 Map.prototype.get(key)
|
|
256
|
+
get:function get(s){var o=e.getEntry(n(this,i),s);return o&&o.v;},// 23.1.3.9 Map.prototype.set(key, value)
|
|
257
|
+
set:function set(s,o){return e.def(n(this,i),s===0?0:s,o);}},e,!0);},/* 145 */ /***/function(h,r,t){var e=t(96).f,n=t(108),i=t(146),a=t(93),s=t(147),o=t(148),f=t(88),v=t(82),l=t(149),p=t(100),y=t(150).fastKey,O=t(151),x=p?"_s":"size",m=function m(T,c){var d=y(c),u;if(d!=="F")return T._i[d];for(u=T._f;u;u=u.n)if(u.k==c)return u;};h.exports={getConstructor:function getConstructor(T,c,d,u){var g=T(function(M,A){s(M,g,c,"_i"),M._t=c,M._i=n(null),M._f=void 0,M._l=void 0,M[x]=0,A!=null&&o(A,d,M[u],M);});return i(g.prototype,{// 23.1.3.1 Map.prototype.clear()
|
|
258
|
+
// 23.2.3.2 Set.prototype.clear()
|
|
259
|
+
clear:function clear(){for(var A=O(this,c),I=A._i,b=A._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete I[b.i];A._f=A._l=void 0,A[x]=0;},// 23.1.3.3 Map.prototype.delete(key)
|
|
260
|
+
// 23.2.3.4 Set.prototype.delete(value)
|
|
261
|
+
"delete":function _delete(M){var A=O(this,c),I=m(A,M);if(I){var b=I.n,E=I.p;delete A._i[I.i],I.r=!0,E&&(E.n=b),b&&(b.p=E),A._f==I&&(A._f=b),A._l==I&&(A._l=E),A[x]--;}return!!I;},// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
|
|
262
|
+
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
|
|
263
|
+
forEach:function forEach(A){O(this,c);for(var I=a(A,arguments.length>1?arguments[1]:void 0,3),b;b=b?b.n:this._f;)for(I(b.v,b.k,this);b&&b.r;)b=b.p;},// 23.1.3.7 Map.prototype.has(key)
|
|
264
|
+
// 23.2.3.7 Set.prototype.has(value)
|
|
265
|
+
has:function has(A){return!!m(O(this,c),A);}}),p&&e(g.prototype,"size",{get:function get(){return O(this,c)[x];}}),g;},def:function def(T,c,d){var u=m(T,c),g,M;return u?u.v=d:(T._l=u={i:M=y(c,!0),// <- index
|
|
266
|
+
k:c,// <- key
|
|
267
|
+
v:d,// <- value
|
|
268
|
+
p:g=T._l,// <- previous entry
|
|
269
|
+
n:void 0,// <- next entry
|
|
270
|
+
r:!1// <- removed
|
|
271
|
+
},T._f||(T._f=u),g&&(g.n=u),T[x]++,M!=="F"&&(T._i[M]=u)),T;},getEntry:m,setStrong:function setStrong(T,c,d){f(T,c,function(u,g){this._t=O(u,c),this._k=g,this._l=void 0;},function(){for(var u=this,g=u._k,M=u._l;M&&M.r;)M=M.p;return!u._t||!(u._l=M=M?M.n:u._t._f)?(u._t=void 0,v(1)):g=="keys"?v(0,M.k):g=="values"?v(0,M.v):v(0,[M.k,M.v]);},d?"entries":"values",!d,!0),l(c);}};},/* 146 */ /***/function(h,r,t){var e=t(95);h.exports=function(n,i,a){for(var s in i)a&&n[s]?n[s]=i[s]:e(n,s,i[s]);return n;};},/* 147 */ /***/function(h,r){h.exports=function(t,e,n,i){if(!(t instanceof e)||i!==void 0&&i in t)throw TypeError(n+": incorrect invocation!");return t;};},/* 148 */ /***/function(h,l,t){var e=t(93),n=t(137),i=t(138),a=t(97),s=t(113),o=t(132),f={},v={},l=h.exports=function(p,y,O,x,m){var T=m?function(){return p;}:o(p),c=e(O,x,y?2:1),d=0,u,g,M,A;if(typeof T!="function")throw TypeError(p+" is not iterable!");if(i(T)){for(u=s(p.length);u>d;d++)if(A=y?c(a(g=p[d])[0],g[1]):c(p[d]),A===f||A===v)return A;}else for(M=T.call(p);!(g=M.next()).done;)if(A=n(M,c,g.value,y),A===f||A===v)return A;};l.BREAK=f,l.RETURN=v;},/* 149 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(96),a=t(100),s=t(122)("species");h.exports=function(o){var f=typeof n[o]=="function"?n[o]:e[o];a&&f&&!f[s]&&i.f(f,s,{configurable:!0,get:function get(){return this;}});};},/* 150 */ /***/function(h,r,t){var e=t(118)("meta"),n=t(98),i=t(105),a=t(96).f,s=0,o=Object.isExtensible||function(){return!0;},f=!t(101)(function(){return o(Object.preventExtensions({}));}),v=function v(x){a(x,e,{value:{i:"O"+ ++s,// object ID
|
|
272
|
+
w:{}// weak collections IDs
|
|
273
|
+
}});},l=function l(x,m){if(!n(x))return _typeof(x)=="symbol"?x:(typeof x=="string"?"S":"P")+x;if(!i(x,e)){if(!o(x))return"F";if(!m)return"E";v(x);}return x[e].i;},p=function p(x,m){if(!i(x,e)){if(!o(x))return!0;if(!m)return!1;v(x);}return x[e].w;},y=function y(x){return f&&O.NEED&&o(x)&&!i(x,e)&&v(x),x;},O=h.exports={KEY:e,NEED:!1,fastKey:l,getWeak:p,onFreeze:y};},/* 151 */ /***/function(h,r,t){var e=t(98);h.exports=function(n,i){if(!e(n)||n._t!==i)throw TypeError("Incompatible receiver, "+i+" required!");return n;};},/* 152 */ /***/function(h,r,t){var e=t(91),n=t(90),i=t(150),a=t(101),s=t(95),o=t(146),f=t(148),v=t(147),l=t(98),p=t(121),y=t(96).f,O=t(153)(0),x=t(100);h.exports=function(m,T,c,d,u,g){var M=e[m],A=M,I=u?"set":"add",b=A&&A.prototype,E={};return!x||typeof A!="function"||!(g||b.forEach&&!a(function(){new A().entries().next();}))?(A=d.getConstructor(T,m,u,I),o(A.prototype,c),i.NEED=!0):(A=T(function(L,D){v(L,A,m,"_c"),L._c=new M(),D!=null&&f(D,u,L[I],L);}),O("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(L){var D=L=="add"||L=="set";L in b&&!(g&&L=="clear")&&s(A.prototype,L,function(R,C){if(v(this,A,L),!D&&g&&!l(R))return L=="get"?void 0:!1;var W=this._c[L](R===0?0:R,C);return D?this:W;});}),g||y(A.prototype,"size",{get:function get(){return this._c.size;}})),p(A,m),E[m]=A,n(n.G+n.W+n.F,E),g||d.setStrong(A,m,u),A;};},/* 153 */ /***/function(h,r,t){var e=t(93),n=t(85),i=t(124),a=t(113),s=t(154);h.exports=function(o,f){var v=o==1,l=o==2,p=o==3,y=o==4,O=o==6,x=o==5||O,m=f||s;return function(T,c,d){for(var u=i(T),g=n(u),M=e(c,d,3),A=a(g.length),I=0,b=v?m(T,A):l?m(T,0):void 0,E,L;A>I;I++)if((x||I in g)&&(E=g[I],L=M(E,I,u),o)){if(v)b[I]=L;else if(L)switch(o){case 3:return!0;case 5:return E;case 6:return I;case 2:b.push(E);}else if(y)return!1;}return O?-1:p||y?y:b;};};},/* 154 */ /***/function(h,r,t){var e=t(155);h.exports=function(n,i){return new(e(n))(i);};},/* 155 */ /***/function(h,r,t){var e=t(98),n=t(156),i=t(122)("species");h.exports=function(a){var s;return n(a)&&(s=a.constructor,typeof s=="function"&&(s===Array||n(s.prototype))&&(s=void 0),e(s)&&(s=s[i],s===null&&(s=void 0))),s===void 0?Array:s;};},/* 156 */ /***/function(h,r,t){var e=t(86);h.exports=Array.isArray||function(i){return e(i)=="Array";};},/* 157 */ /***/function(h,r,t){var e=t(90);e(e.P+e.R,"Map",{toJSON:t(158)("Map")});},/* 158 */ /***/function(h,r,t){var e=t(128),n=t(159);h.exports=function(i){return function(){if(e(this)!=i)throw TypeError(i+"#toJSON isn't generic");return n(this);};};},/* 159 */ /***/function(h,r,t){var e=t(148);h.exports=function(n,i){var a=[];return e(n,!1,a.push,a,i),a;};},/* 160 */ /***/function(h,r,t){t(161)("Map");},/* 161 */ /***/function(h,r,t){var e=t(90);h.exports=function(n){e(e.S,n,{of:function of(){for(var a=arguments.length,s=new Array(a);a--;)s[a]=arguments[a];return new this(s);}});};},/* 162 */ /***/function(h,r,t){t(163)("Map");},/* 163 */ /***/function(h,r,t){var e=t(90),n=t(94),i=t(93),a=t(148);h.exports=function(s){e(e.S,s,{from:function from(f){var v=arguments[1],l,p,y,O;return n(this),l=v!==void 0,l&&n(v),f==null?new this():(p=[],l?(y=0,O=i(v,arguments[2],2),a(f,!1,function(x){p.push(O(x,y++));})):a(f,!1,p.push,p),new this(p));}});};},/* 164 */ /***/function(h,r,t){h.exports={"default":t(165),__esModule:!0};},/* 165 */ /***/function(h,r,t){t(166),h.exports=t(92).Object.assign;},/* 166 */ /***/function(h,r,t){var e=t(90);e(e.S+e.F,"Object",{assign:t(167)});},/* 167 */ /***/function(h,r,t){var e=t(100),n=t(110),i=t(168),a=t(169),s=t(124),o=t(85),f=Object.assign;h.exports=!f||t(101)(function(){var v={},l={},p=Symbol(),y="abcdefghijklmnopqrst";return v[p]=7,y.split("").forEach(function(O){l[O]=O;}),f({},v)[p]!=7||Object.keys(f({},l)).join("")!=y;})?function(l,p){for(var y=s(l),O=arguments.length,x=1,m=i.f,T=a.f;O>x;)for(var c=o(arguments[x++]),d=m?n(c).concat(m(c)):n(c),u=d.length,g=0,M;u>g;)M=d[g++],(!e||T.call(c,M))&&(y[M]=c[M]);return y;}:f;},/* 168 */ /***/function(h,r){r.f=Object.getOwnPropertySymbols;},/* 169 */ /***/function(h,r){r.f={}.propertyIsEnumerable;},/* 170 */ /***/function(h,r,t){r.__esModule=!0,r["default"]=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function");};},/* 171 */ /***/function(h,r,t){r.__esModule=!0;var e=t(172),n=i(e);function i(a){return a&&a.__esModule?a:{"default":a};}r["default"]=/* @__PURE__ */function(){function a(s,o){for(var f=0;f<o.length;f++){var v=o[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),(0,n["default"])(s,v.key,v);}}return function(s,o,f){return o&&a(s.prototype,o),f&&a(s,f),s;};}();},/* 172 */ /***/function(h,r,t){h.exports={"default":t(173),__esModule:!0};},/* 173 */ /***/function(h,r,t){t(174);var e=t(92).Object;h.exports=function(i,a,s){return e.defineProperty(i,a,s);};},/* 174 */ /***/function(h,r,t){var e=t(90);e(e.S+e.F*!t(100),"Object",{defineProperty:t(96).f});},/* 175 */ /***/function(h,r,t){h.exports={"default":t(176),__esModule:!0};},/* 176 */ /***/function(h,r,t){t(177),t(143),t(184),t(185),h.exports=t(92).Symbol;},/* 177 */ /***/function(h,r,t){var e=t(91),n=t(105),i=t(100),a=t(90),s=t(106),o=t(150).KEY,f=t(101),v=t(117),l=t(121),p=t(118),y=t(122),O=t(178),x=t(179),m=t(180),T=t(156),c=t(97),d=t(98),u=t(124),g=t(84),M=t(103),A=t(104),I=t(108),b=t(181),E=t(183),L=t(168),D=t(96),R=t(110),C=E.f,W=D.f,z=b.f,_H2=e.Symbol,X=e.JSON,Z=X&&X.stringify,j="prototype",G=y("_hidden"),Q=y("toPrimitive"),tt={}.propertyIsEnumerable,et=v("symbol-registry"),at=v("symbols"),q=v("op-symbols"),pt=Object[j],dt=typeof _H2=="function"&&!!L.f,B=e.QObject,F=!B||!B[j]||!B[j].findChild,V=i&&f(function(){return I(W({},"a",{get:function get(){return W(this,"a",{value:7}).a;}})).a!=7;})?function(ot,st,ft){var vt=C(pt,st);vt&&delete pt[st],W(ot,st,ft),vt&&ot!==pt&&W(pt,st,vt);}:W,J=function J(ot){var st=at[ot]=I(_H2[j]);return st._k=ot,st;},N=dt&&_typeof(_H2.iterator)=="symbol"?function(ot){return _typeof(ot)=="symbol";}:function(ot){return ot instanceof _H2;},$=function $(st,ft,vt){return st===pt&&$(q,ft,vt),c(st),ft=M(ft,!0),c(vt),n(at,ft)?(vt.enumerable?(n(st,G)&&st[G][ft]&&(st[G][ft]=!1),vt=I(vt,{enumerable:A(0,!1)})):(n(st,G)||W(st,G,A(1,{})),st[G][ft]=!0),V(st,ft,vt)):W(st,ft,vt);},S=function S(st,ft){c(st);for(var vt=m(ft=g(ft)),mt=0,gt=vt.length,St;gt>mt;)$(st,St=vt[mt++],ft[St]);return st;},P=function P(st,ft){return ft===void 0?I(st):S(I(st),ft);},w=function w(st){var ft=tt.call(this,st=M(st,!0));return this===pt&&n(at,st)&&!n(q,st)?!1:ft||!n(this,st)||!n(at,st)||n(this,G)&&this[G][st]?ft:!0;},U=function U(st,ft){if(st=g(st),ft=M(ft,!0),!(st===pt&&n(at,ft)&&!n(q,ft))){var vt=C(st,ft);return vt&&n(at,ft)&&!(n(st,G)&&st[G][ft])&&(vt.enumerable=!0),vt;}},K=function K(st){for(var ft=z(g(st)),vt=[],mt=0,gt;ft.length>mt;)!n(at,gt=ft[mt++])&>!=G&>!=o&&vt.push(gt);return vt;},Y=function Y(st){for(var ft=st===pt,vt=z(ft?q:g(st)),mt=[],gt=0,St;vt.length>gt;)n(at,St=vt[gt++])&&(!ft||n(pt,St))&&mt.push(at[St]);return mt;};dt||(_H2=function H(){if(this instanceof _H2)throw TypeError("Symbol is not a constructor!");var st=p(arguments.length>0?arguments[0]:void 0),ft=function ft(vt){this===pt&&ft.call(q,vt),n(this,G)&&n(this[G],st)&&(this[G][st]=!1),V(this,st,A(1,vt));};return i&&F&&V(pt,st,{configurable:!0,set:ft}),J(st);},s(_H2[j],"toString",function(){return this._k;}),E.f=U,D.f=$,t(182).f=b.f=K,t(169).f=w,L.f=Y,i&&!t(89)&&s(pt,"propertyIsEnumerable",w,!0),O.f=function(ot){return J(y(ot));}),a(a.G+a.W+a.F*!dt,{Symbol:_H2});for(var k=// 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
|
|
274
|
+
"hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;k.length>rt;)y(k[rt++]);for(var it=R(y.store),lt=0;it.length>lt;)x(it[lt++]);a(a.S+a.F*!dt,"Symbol",{// 19.4.2.1 Symbol.for(key)
|
|
275
|
+
"for":function _for(ot){return n(et,ot+="")?et[ot]:et[ot]=_H2(ot);},// 19.4.2.5 Symbol.keyFor(sym)
|
|
276
|
+
keyFor:function keyFor(st){if(!N(st))throw TypeError(st+" is not a symbol!");for(var ft in et)if(et[ft]===st)return ft;},useSetter:function useSetter(){F=!0;},useSimple:function useSimple(){F=!1;}}),a(a.S+a.F*!dt,"Object",{// 19.1.2.2 Object.create(O [, Properties])
|
|
277
|
+
create:P,// 19.1.2.4 Object.defineProperty(O, P, Attributes)
|
|
278
|
+
defineProperty:$,// 19.1.2.3 Object.defineProperties(O, Properties)
|
|
279
|
+
defineProperties:S,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
|
280
|
+
getOwnPropertyDescriptor:U,// 19.1.2.7 Object.getOwnPropertyNames(O)
|
|
281
|
+
getOwnPropertyNames:K,// 19.1.2.8 Object.getOwnPropertySymbols(O)
|
|
282
|
+
getOwnPropertySymbols:Y});var ut=f(function(){L.f(1);});a(a.S+a.F*ut,"Object",{getOwnPropertySymbols:function getOwnPropertySymbols(st){return L.f(u(st));}}),X&&a(a.S+a.F*(!dt||f(function(){var ot=_H2();return Z([ot])!="[null]"||Z({a:ot})!="{}"||Z(Object(ot))!="{}";})),"JSON",{stringify:function stringify(st){for(var ft=[st],vt=1,mt,gt;arguments.length>vt;)ft.push(arguments[vt++]);if(gt=mt=ft[1],!(!d(mt)&&st===void 0||N(st)))return T(mt)||(mt=function mt(St,It){if(typeof gt=="function"&&(It=gt.call(this,St,It)),!N(It))return It;}),ft[1]=mt,Z.apply(X,ft);}}),_H2[j][Q]||t(95)(_H2[j],Q,_H2[j].valueOf),l(_H2,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0);},/* 178 */ /***/function(h,r,t){r.f=t(122);},/* 179 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(89),a=t(178),s=t(96).f;h.exports=function(o){var f=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});o.charAt(0)!="_"&&!(o in f)&&s(f,o,{value:a.f(o)});};},/* 180 */ /***/function(h,r,t){var e=t(110),n=t(168),i=t(169);h.exports=function(a){var s=e(a),o=n.f;if(o)for(var f=o(a),v=i.f,l=0,p;f.length>l;)v.call(a,p=f[l++])&&s.push(p);return s;};},/* 181 */ /***/function(h,r,t){var e=t(84),n=t(182).f,i={}.toString,a=(typeof window==="undefined"?"undefined":_typeof(window))=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function s(o){try{return n(o);}catch(_unused20){return a.slice();}};h.exports.f=function(f){return a&&i.call(f)=="[object Window]"?s(f):n(e(f));};},/* 182 */ /***/function(h,r,t){var e=t(111),n=t(119).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(a){return e(a,n);};},/* 183 */ /***/function(h,r,t){var e=t(169),n=t(104),i=t(84),a=t(103),s=t(105),o=t(99),f=Object.getOwnPropertyDescriptor;r.f=t(100)?f:function(l,p){if(l=i(l),p=a(p,!0),o)try{return f(l,p);}catch(_unused21){}if(s(l,p))return n(!e.f.call(l,p),l[p]);};},/* 184 */ /***/function(h,r,t){t(179)("asyncIterator");},/* 185 */ /***/function(h,r,t){t(179)("observable");},/* 186 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.createNowTime=e,r.formatDelay=n;function e(){var i=null;return Date.now?i=Date.now:i=function i(){return(/* @__PURE__ */new Date()).getTime();},i;}function n(i){return typeof i=="number"?i={delay:i}:"entropy"in i&&(i={delay:i.entropy,isEntropy:!0}),i;}},/* 187 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={// s - startFrame, e - endFrame
|
|
283
|
+
"default":function _default(n,i,a,s,o){return typeof n=="number"&&typeof i=="number"?n+(a-s)/(o-s)*(i-n):a-s>o-a?i:n;}};},/* 188 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.parseEasing=r.Easings=void 0;var e=t(76),n=f(e),i=t(133),a=f(i),s=t(141),o=f(s);function f(T){return T&&T.__esModule?T:{"default":T};}var v=t(189),l=new o["default"]();function p(){for(var T=arguments.length,c=Array(T),d=0;d<T;d++)c[d]=arguments[d];var u=l.get(c);return u||(u=v.apply(void 0,c),l.set(c,u),u);}function y(T){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"end";return function(d,u){for(var g=1;g<u.length;g++){var M=u[g].offset;if(d<=M){var A=u[g-1].offset,I=M,b=(d-A)/(I-A),E=1/T,L=b/E;return c==="end"?L=Math.floor(L):L=Math.ceil(L),E*L*(I-A)+A;}}return 0;};}function O(T){var c=/^cubic-bezier\((.*)\)/,d=T.match(c);if(d){var u=d[1].trim();return u=u.split(",").map(function(E){return parseFloat(E.trim());}),p.apply(void 0,(0,a["default"])(u));}if(c=/^steps\((.*)\)/,d=T.match(c),d){var g=d[1].trim();g=g.split(",").map(function(E){return E.trim();});var M=g,A=(0,n["default"])(M,2),I=A[0],b=A[1];return y(parseInt(I,10),b);}return T;}var x={linear:function linear(c){return c;},ease:p(0.25,0.1,0.25,1),"ease-in":p(0.42,0,1,1),"ease-out":p(0,0,0.58,1),"ease-in-out":p(0.42,0,0.58,1),// 'step-start': function(p, frames){
|
|
284
|
+
// let ret = 0
|
|
285
|
+
// for(let i = 0; i < frames.length; i++){
|
|
286
|
+
// const {offset} = frames[i]
|
|
287
|
+
// ret = offset
|
|
288
|
+
// if(p < offset){
|
|
289
|
+
// break
|
|
290
|
+
// }
|
|
291
|
+
// }
|
|
292
|
+
// return ret
|
|
293
|
+
// },
|
|
294
|
+
// 'step-end': function(p, frames){
|
|
295
|
+
// let ret = 0
|
|
296
|
+
// for(let i = 0; i < frames.length; i++){
|
|
297
|
+
// const {offset} = frames[i]
|
|
298
|
+
// if(p < offset){
|
|
299
|
+
// break
|
|
300
|
+
// }
|
|
301
|
+
// ret = offset
|
|
302
|
+
// }
|
|
303
|
+
// return ret
|
|
304
|
+
// }
|
|
305
|
+
"step-start":y(1,"start"),"step-end":y(1,"end")};function m(T){return typeof T=="string"?x[T]?T=x[T]:T=O(T):T.type==="cubic-bezier"?T=p.apply(void 0,(0,a["default"])(T.value)):T.type==="steps"&&(T=y(T.step,T.pos)),T;}r.Easings=x,r.parseEasing=m;},/* 189 */ /***/function(h,r){var t=4,e=1e-3,n=1e-7,i=10,a=11,s=1/(a-1),o=typeof Float32Array=="function";function f(T,c){return 1-3*c+3*T;}function v(T,c){return 3*c-6*T;}function l(T){return 3*T;}function p(T,c,d){return((f(c,d)*T+v(c,d))*T+l(c))*T;}function y(T,c,d){return 3*f(c,d)*T*T+2*v(c,d)*T+l(c);}function O(T,c,d,u,g){var M,A,I=0;do A=c+(d-c)/2,M=p(A,u,g)-T,M>0?d=A:c=A;while(Math.abs(M)>n&&++I<i);return A;}function x(T,c,d,u){for(var g=0;g<t;++g){var M=y(c,d,u);if(M===0)return c;var A=p(c,d,u)-T;c-=A/M;}return c;}function m(T){return T;}h.exports=function(c,d,u,g){if(!(0<=c&&c<=1&&0<=u&&u<=1))throw new Error("bezier x values must be in [0, 1] range");if(c===d&&u===g)return m;for(var M=o?new Float32Array(a):new Array(a),A=0;A<a;++A)M[A]=p(A*s,c,u);function I(b){for(var E=0,L=1,D=a-1;L!==D&&M[L]<=b;++L)E+=s;--L;var R=(b-M[L])/(M[L+1]-M[L]),C=E+R*s,W=y(C,c,u);return W>=e?x(b,C,c,u):W===0?C:O(b,E,E+s,c,u);}return function(E){return E===0?0:E===1?1:p(I(E),d,g);};};},/* 190 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(191),n=d(e),i=t(204),a=d(i),s=t(164),o=d(s),f=t(170),v=d(f),l=t(171),p=d(l),y=t(175),O=d(y),x=t(75),m=d(x),T=t(208),c=t(188);function d(W){return W&&W.__esModule?W:{"default":W};}var u=(0,O["default"])("timing"),g=(0,O["default"])("keyframes"),M=(0,O["default"])("initState"),A=(0,O["default"])("readyDefer"),I=(0,O["default"])("finishedDefer"),b=(0,O["default"])("effects"),E=(0,O["default"])("activeReadyTimer"),L=(0,O["default"])("activeFinishTimer"),D=(0,O["default"])("removeDefer"),R={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},C=function(){function W(z,H,X){var Z=this;if((0,v["default"])(this,W),Array.isArray(z)){var j=[z[0],z,H];z=j[0],H=j[1],X=j[2];}typeof X=="number"&&(X={duration:X}),this[u]=(0,o["default"])({},R,X),this[u].easing=(0,c.parseEasing)(this[u].easing),this[g]=(0,T.calculateFramesOffset)(H);var G=this[g][this[g].length-1];this[M]={},(0,a["default"])(G).forEach(function(Q){Object.prototype.hasOwnProperty.call(z,Q)&&Q!=="easing"&&Q!=="offset"&&(Z[M][Q]=z[Q]);}),this[g]=this[g].map(function(Q){return(0,o["default"])({},Z[M],Q);}),this[g][0].offset!==0&&this[g].unshift((0,o["default"])({},this[M],{offset:0})),G.offset<1&&this[g].push((0,o["default"])({},G,{offset:1})),this[b]={},this.timeline=null;}return(0,p["default"])(W,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:E,value:function value(){var H=this;this[A]&&!this[A].timerID&&(this.timeline.currentTime<0?this[A].timerID=this.timeline.setTimeout(function(){H[A].resolve(),delete H[A];},{delay:-this.timeline.currentTime,heading:!1}):this[A].timerID=this.timeline.setTimeout(function(){H[A].resolve(),delete H[A];},{delay:0,isEntropy:!0}));}},{key:L,value:function value(){var H=this,X=this[u],Z=X.duration,j=X.iterations,G=X.endDelay,Q=Math.ceil(Z*j+G-this.timeline.currentTime)+1;this[I]&&!this[I].timerID&&(this[I].timerID=this.timeline.setTimeout(function(){H[I].resolve(),H[D](A),H[D](I);},{delay:Q,heading:!1}),this[I].reverseTimerID=this.timeline.setTimeout(function(){H[I].resolve(),H[D](A),H[D](I),H.timeline=null;},{delay:-this[u].delay-1,heading:!1}));}},{key:"play",value:function value(){if(this.playState==="finished"&&this.cancel(),this.playState==="idle"){if(this.playbackRate<=0)return;var H=this[u],X=H.delay,Z=H.playbackRate,j=H.timeline;this.timeline=new m["default"]({originTime:X,playbackRate:Z},j),this[E](),this[L]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[E]());}},{key:D,value:function value(H){var X=this[H],Z=this.timeline;X&&Z&&(Z.clearTimeout(X.timerID),X.reverseTimerID&&Z.clearTimeout(X.reverseTimerID)),delete this[H];}},{key:"cancel",value:function value(){this[D](A),this[D](I),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[D](A),this[D](I);}},{key:"applyEffects",value:function value(H){return(0,o["default"])(this[b],H);}},{key:"playbackRate",get:function get(){return this[u].playbackRate;},set:function set(H){this.timeline&&(this.timeline.playbackRate=H),this[u].playbackRate=H;}},{key:"playState",get:function get(){var H=this.timeline,X=this[u],Z=X.iterations,j=X.duration,G=X.endDelay,Q="running";if(H==null)Q="idle";else if(H.paused)Q="paused";else if(H.currentTime<0)Q="pending";else{var tt=H.currentTime-Z*j;tt>0&&tt<G?Q="pending":tt>=G&&(Q="finished");}return Q;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var H=this[u],X=H.duration,Z=H.iterations,j=this.timeline,G=this.playState,Q=void 0;if(G==="idle")Q=0;else if(G==="paused"&&j.currentTime<0)Q=0;else if(G==="pending"){if(j.currentTime<0)Q=0;else{var tt=j.seekLocalTime(Z*X);Q=(0,T.periodicity)(tt,X)[1]/X;}}else(G==="running"||G==="paused")&&(Q=(0,T.periodicity)(j.currentTime,X)[1]/X);return G==="finished"&&(Q=(0,T.periodicity)(Z,1)[1]),Q;}},{key:"frame",get:function get(){var H=this.playState,X=this[M],Z=this[u].fill;if(H==="idle")return X;var j=this.timeline.currentTime,G=this[g].slice(0),Q=(0,T.getProgress)(this.timeline,this[u],this.progress),tt=Q.p,et=Q.inverted,at=X;return j<0&&H==="pending"?(Z==="backwards"||Z==="both")&&(at=et?G[G.length-1]:G[0]):(H!=="pending"&&H!=="finished"||Z==="forwards"||Z==="both")&&(at=(0,T.getCurrentFrame)(this[u],G,this[b],tt)),at;}},{key:"timing",get:function get(){return this[u];}},{key:"effects",get:function get(){return this[b];}},{key:"baseTimeline",set:function set(H){this[u].timeline=H;},get:function get(){return this[u].timeline;}},{key:"ready",get:function get(){return this[A]?this[A].promise:this.timeline&&this.timeline.currentTime>=0&&this.playState!=="paused"?n["default"].resolve():(this[A]=(0,T.defer)(),this.timeline&&this[E](),this[A]?this[A].promise:n["default"].resolve());}},{key:"finished",get:function get(){return this.playState==="finished"?n["default"].resolve():(this[I]||(this[I]=(0,T.defer)(),this.timeline&&this[L]()),this[I].promise);}}]),W;}();r["default"]=C;},/* 191 */ /***/function(h,r,t){h.exports={"default":t(192),__esModule:!0};},/* 192 */ /***/function(h,r,t){t(143),t(125),t(79),t(193),t(202),t(203),h.exports=t(92).Promise;},/* 193 */ /***/function(h,r,t){var e=t(89),n=t(91),i=t(93),a=t(128),s=t(90),o=t(98),f=t(94),v=t(147),l=t(148),p=t(194),y=t(195).set,O=t(197)(),x=t(198),m=t(199),T=t(200),c=t(201),d="Promise",u=n.TypeError,g=n.process,M=g&&g.versions,A=M&&M.v8||"",_I=n[d],b=a(g)=="process",E=function E(){},L,D,R,C,W=D=x.f,z=!!function(){try{var et=_I.resolve(1),at=(et.constructor={})[t(122)("species")]=function(q){q(E,E);};return(b||typeof PromiseRejectionEvent=="function")&&et.then(E)instanceof at&&A.indexOf("6.6")!==0&&T.indexOf("Chrome/66")===-1;}catch(_unused22){}}(),H=function H(et){var at;return o(et)&&typeof(at=et.then)=="function"?at:!1;},X=function X(et,at){if(!et._n){et._n=!0;var q=et._c;O(function(){for(var pt=et._v,dt=et._s==1,B=0,F=function F(V){var J=dt?V.ok:V.fail,N=V.resolve,$=V.reject,S=V.domain,P,w,U;try{J?(dt||(et._h==2&&G(et),et._h=1),J===!0?P=pt:(S&&S.enter(),P=J(pt),S&&(S.exit(),U=!0)),P===V.promise?$(u("Promise-chain cycle")):(w=H(P))?w.call(P,N,$):N(P)):$(pt);}catch(K){S&&!U&&S.exit(),$(K);}};q.length>B;)F(q[B++]);et._c=[],et._n=!1,at&&!et._h&&Z(et);});}},Z=function Z(et){y.call(n,function(){var at=et._v,q=j(et),pt,dt,B;if(q&&(pt=m(function(){b?g.emit("unhandledRejection",at,et):(dt=n.onunhandledrejection)?dt({promise:et,reason:at}):(B=n.console)&&B.error&&B.error("Unhandled promise rejection",at);}),et._h=b||j(et)?2:1),et._a=void 0,q&&pt.e)throw pt.v;});},j=function j(et){return et._h!==1&&(et._a||et._c).length===0;},G=function G(et){y.call(n,function(){var at;b?g.emit("rejectionHandled",et):(at=n.onrejectionhandled)&&at({promise:et,reason:et._v});});},Q=function Q(et){var at=this;at._d||(at._d=!0,at=at._w||at,at._v=et,at._s=2,at._a||(at._a=at._c.slice()),X(at,!0));},tt=function tt(et){var at=this,q;if(!at._d){at._d=!0,at=at._w||at;try{if(at===et)throw u("Promise can't be resolved itself");(q=H(et))?O(function(){var pt={_w:at,_d:!1};try{q.call(et,i(tt,pt,1),i(Q,pt,1));}catch(dt){Q.call(pt,dt);}}):(at._v=et,at._s=1,X(at,!1));}catch(pt){Q.call({_w:at,_d:!1},pt);}}};z||(_I=function I(at){v(this,_I,d,"_h"),f(at),L.call(this);try{at(i(tt,this,1),i(Q,this,1));}catch(q){Q.call(this,q);}},L=function L(at){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},L.prototype=t(146)(_I.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
|
|
306
|
+
then:function then(at,q){var pt=W(p(this,_I));return pt.ok=typeof at=="function"?at:!0,pt.fail=typeof q=="function"&&q,pt.domain=b?g.domain:void 0,this._c.push(pt),this._a&&this._a.push(pt),this._s&&X(this,!1),pt.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
|
|
307
|
+
"catch":function _catch(et){return this.then(void 0,et);}}),R=function R(){var et=new L();this.promise=et,this.resolve=i(tt,et,1),this.reject=i(Q,et,1);},x.f=W=function W(et){return et===_I||et===C?new R(et):D(et);}),s(s.G+s.W+s.F*!z,{Promise:_I}),t(121)(_I,d),t(149)(d),C=t(92)[d],s(s.S+s.F*!z,d,{// 25.4.4.5 Promise.reject(r)
|
|
308
|
+
reject:function reject(at){var q=W(this),pt=q.reject;return pt(at),q.promise;}}),s(s.S+s.F*(e||!z),d,{// 25.4.4.6 Promise.resolve(x)
|
|
309
|
+
resolve:function resolve(at){return c(e&&this===C?_I:this,at);}}),s(s.S+s.F*!(z&&t(140)(function(et){_I.all(et)["catch"](E);})),d,{// 25.4.4.1 Promise.all(iterable)
|
|
310
|
+
all:function all(at){var q=this,pt=W(q),dt=pt.resolve,B=pt.reject,F=m(function(){var V=[],J=0,N=1;l(at,!1,function($){var S=J++,P=!1;V.push(void 0),N++,q.resolve($).then(function(w){P||(P=!0,V[S]=w,--N||dt(V));},B);}),--N||dt(V);});return F.e&&B(F.v),pt.promise;},// 25.4.4.4 Promise.race(iterable)
|
|
311
|
+
race:function race(at){var q=this,pt=W(q),dt=pt.reject,B=m(function(){l(at,!1,function(F){q.resolve(F).then(pt.resolve,dt);});});return B.e&&dt(B.v),pt.promise;}});},/* 194 */ /***/function(h,r,t){var e=t(97),n=t(94),i=t(122)("species");h.exports=function(a,s){var o=e(a).constructor,f;return o===void 0||(f=e(o)[i])==null?s:n(f);};},/* 195 */ /***/function(h,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),s=t(91),o=s.process,f=s.setImmediate,v=s.clearImmediate,l=s.MessageChannel,p=s.Dispatch,y=0,O={},x="onreadystatechange",m,T,c,d=function d(){var g=+this;if(O.hasOwnProperty(g)){var M=O[g];delete O[g],M();}},u=function u(g){d.call(g.data);};(!f||!v)&&(f=function f(M){for(var A=[],I=1;arguments.length>I;)A.push(arguments[I++]);return O[++y]=function(){n(typeof M=="function"?M:Function(M),A);},m(y),y;},v=function v(M){delete O[M];},t(86)(o)=="process"?m=function m(g){o.nextTick(e(d,g,1));}:p&&p.now?m=function m(g){p.now(e(d,g,1));}:l?(T=new l(),c=T.port2,T.port1.onmessage=u,m=e(c.postMessage,c,1)):s.addEventListener&&typeof postMessage=="function"&&!s.importScripts?(m=function m(g){s.postMessage(g+"","*");},s.addEventListener("message",u,!1)):x in a("script")?m=function m(g){i.appendChild(a("script"))[x]=function(){i.removeChild(this),d.call(g);};}:m=function m(g){setTimeout(e(d,g,1),0);}),h.exports={set:f,clear:v};},/* 196 */ /***/function(h,r){h.exports=function(t,e,n){var i=n===void 0;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3]);}return t.apply(n,e);};},/* 197 */ /***/function(h,r,t){var e=t(91),n=t(195).set,i=e.MutationObserver||e.WebKitMutationObserver,a=e.process,s=e.Promise,o=t(86)(a)=="process";h.exports=function(){var f,v,l,p=function p(){var m,T;for(o&&(m=a.domain)&&m.exit();f;){T=f.fn,f=f.next;try{T();}catch(c){throw f?l():v=void 0,c;}}v=void 0,m&&m.enter();};if(o)l=function l(){a.nextTick(p);};else if(i&&!(e.navigator&&e.navigator.standalone)){var y=!0,O=document.createTextNode("");new i(p).observe(O,{characterData:!0}),l=function l(){O.data=y=!y;};}else if(s&&s.resolve){var x=s.resolve(void 0);l=function l(){x.then(p);};}else l=function l(){n.call(e,p);};return function(m){var T={fn:m,next:void 0};v&&(v.next=T),f||(f=T,l()),v=T;};};},/* 198 */ /***/function(h,r,t){var e=t(94);function n(i){var a,s;this.promise=new i(function(o,f){if(a!==void 0||s!==void 0)throw TypeError("Bad Promise constructor");a=o,s=f;}),this.resolve=e(a),this.reject=e(s);}h.exports.f=function(i){return new n(i);};},/* 199 */ /***/function(h,r){h.exports=function(t){try{return{e:!1,v:t()};}catch(e){return{e:!0,v:e};}};},/* 200 */ /***/function(h,r,t){var e=t(91),n=e.navigator;h.exports=n&&n.userAgent||"";},/* 201 */ /***/function(h,r,t){var e=t(97),n=t(98),i=t(198);h.exports=function(a,s){if(e(a),n(s)&&s.constructor===a)return s;var o=i.f(a),f=o.resolve;return f(s),o.promise;};},/* 202 */ /***/function(h,r,t){var e=t(90),n=t(92),i=t(91),a=t(194),s=t(201);e(e.P+e.R,"Promise",{"finally":function _finally(o){var f=a(this,n.Promise||i.Promise),v=typeof o=="function";return this.then(v?function(l){return s(f,o()).then(function(){return l;});}:o,v?function(l){return s(f,o()).then(function(){throw l;});}:o);}});},/* 203 */ /***/function(h,r,t){var e=t(90),n=t(198),i=t(199);e(e.S,"Promise",{"try":function _try(a){var s=n.f(this),o=i(a);return(o.e?s.reject:s.resolve)(o.v),s.promise;}});},/* 204 */ /***/function(h,r,t){h.exports={"default":t(205),__esModule:!0};},/* 205 */ /***/function(h,r,t){t(206),h.exports=t(92).Object.keys;},/* 206 */ /***/function(h,r,t){var e=t(124),n=t(110);t(207)("keys",function(){return function(a){return n(e(a));};});},/* 207 */ /***/function(h,r,t){var e=t(90),n=t(92),i=t(101);h.exports=function(a,s){var o=(n.Object||{})[a]||Object[a],f={};f[a]=s(o),e(e.S+e.F*i(function(){o(1);}),"Object",f);};},/* 208 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e=t(76),n=O(e),i=t(209),a=O(i),s=t(164),o=O(s),f=t(191),v=O(f);r.defer=x,r.periodicity=m,r.calculateFramesOffset=T,r.getProgress=c,r.getCurrentFrame=u;var l=t(188),p=t(187),y=O(p);function O(g){return g&&g.__esModule?g:{"default":g};}function x(){var g={};return g.promise=new v["default"](function(M,A){g.resolve=M,g.reject=A;}),g;}function m(g,M){var A=Math.floor(g/M),I=g-A*M;return I===0&&A>0&&(I=M,A--),[A,I];}function T(g){g=g.slice(0);var M=g[0],A=g[g.length-1];A.offset=A.offset||1,M.offset=M.offset||0;for(var I=0,b=-1,E=0;E<g.length;E++){var L=g[E];if(L.offset!=null){var D=E-b;if(D>1)for(var R=(L.offset-I)/D,C=0;C<D-1;C++)g[b+C+1].offset=I+R*(C+1);I=L.offset,b=E;}if(L.easing!=null&&(L.easing=(0,l.parseEasing)(L.easing)),E>0){var W=g[E].easing!=null;g[E]=(0,o["default"])({},g[E-1],g[E]),W||delete g[E].easing;}}return g;}function c(g,M,A){var I=g.currentTime,b=M.direction,E=M.duration,L=!1;if(b==="reverse")A=1-A,L=!0;else if(b==="alternate"||b==="alternate-reverse"){var D=Math.floor(I/E);A===1&&D--,D%2^b==="alternate-reverse"&&(A=1-A,L=!0);}return{p:A,inverted:L};}function d(g,M,A,I){var b={};return(0,a["default"])(M).forEach(function(E){var L=(0,n["default"])(E,2),D=L[0],R=L[1];if(D!=="offset"&&D!=="easing"){var C=A[D]||A["default"],W=C(g[D],R,I,g.offset,M.offset);W!=null&&(b[D]=W);}}),b;}function u(g,M,A,I){var b=g.easing,E=g.effect;E||(A=(0,o["default"])({},y["default"],A));var L={};I=b(I,M);for(var D=1;D<M.length;D++){var R=M[D],C=R.offset;if(C>=I||D===M.length-1){var W=M[D-1],z=W.offset,H=W.easing,X=I;if(H){var Z=C-z;X=H((I-z)/Z)*Z+z;}E?L=E(W,R,X,z,C):L=d(W,R,A,X);break;}}return L;}},/* 209 */ /***/function(h,r,t){h.exports={"default":t(210),__esModule:!0};},/* 210 */ /***/function(h,r,t){t(211),h.exports=t(92).Object.entries;},/* 211 */ /***/function(h,r,t){var e=t(90),n=t(212)(!0);e(e.S,"Object",{entries:function entries(a){return n(a);}});},/* 212 */ /***/function(h,r,t){var e=t(100),n=t(110),i=t(84),a=t(169).f;h.exports=function(s){return function(o){for(var f=i(o),v=n(f),l=v.length,p=0,y=[],O;l>p;)O=v[p++],(!e||a.call(f,O))&&y.push(s?[O,f[O]]:f[O]);return y;};};},/* 213 */ /***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array);var e=/* @__PURE__ */new Map();function n(a){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];a=a.toLowerCase();var f=e.get(a);if(!f)throw new TypeError("Invalid node: ".concat(a));var v=new f(s);return o.forEach(function(l){v.appendChild(l);}),v;}var i={registerNode:function registerNode(a,s){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(s=s.toLowerCase(),e.has(s))throw new TypeError("Cannot registerNode, ".concat(s," has been taken."));e.set(s,a),Object.defineProperties(a.prototype,{nodeType:{value:o},tagName:{value:s.toUpperCase()},nodeName:{value:s},ownerDocument:{value:i},namespaceURI:{value:"http://spritejs.com/".concat(s)}});},createElement:n,createElementNS:function createElementNS(a,s){return n(s);},isSpriteNode:function isSpriteNode(a){return e.has(a.toLowerCase());}};r["default"]=i;},/* 214 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),a=Symbol("detail");var s=/*#__PURE__*/function(){function s(f){var _ref116=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref116$bubbles=_ref116.bubbles,v=_ref116$bubbles===void 0?null:_ref116$bubbles;_classCallCheck(this,s);if(typeof f=="string"?(this[e]=f,this[n]=!!v):(this[e]=f.type,this[i]=f,this[n]=v!=null?!!v:!!f.bubbles,f.detail&&(this[a]=f.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(s,[{key:"setOriginalEvent",value:function setOriginalEvent(f){this[i]=f;}},{key:"originalEvent",get:function get(){return this[i];}},{key:"type",get:function get(){return this[e];}},{key:"bubbles",get:function get(){return this[n];}},{key:"detail",get:function get(){return this[a];}},{key:"stopPropagation",value:function stopPropagation(){this.cancelBubble=!0;}}]);}();},/* 215 */ /***/function(h,r,t){t.r(r),t.d(r,"parseFilterString",function(){return n;}),t.d(r,"applyFilters",function(){return i;});var e=t(72);t(1).glMatrix.setMatrixArrayType(Array);function n(a){if(a=a.trim(),!a||a==="none")return null;var s=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,o=a.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),f=[];return o&&o.forEach(function(v){var l=v.match(s);if(!l)throw new TypeError("Invalid fitler string.");var _l3=_slicedToArray(l,3),p=_l3[1],y=_l3[2];p=p.toLowerCase(),y=y.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(O,x){var m;return p==="url"||p==="drop-shadow"&&x===3?m=O:m=Object(e.toNumber)(O),/%$/.test(O)&&(m/=100),m;}),f.push({type:p,args:y});}),f;}function i(a,s){a.clearFilter(),s&&s.forEach(function(_ref117){var o=_ref117.type,f=_ref117.args;var v=o;v==="drop-shadow"?v="dropShadow":v==="hue-rotate"&&(v="hueRotate"),a[v].apply(a,_toConsumableArray(f));});}},/* 216 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n,i){if(!i)return;var a=n.getListeners("beforerender"),s=n.getListeners("afterrender");a.length&&!i.beforeRender?i.beforeRender=function(o){n.dispatchEvent({type:"beforerender",detail:{context:o}});}:a.length||(i.beforeRender=null),s.length&&!i.afterRender?i.afterRender=function(o){n.dispatchEvent({type:"afterrender",detail:{context:o}});}:s.length||(i.afterRender=null);}},/* 217 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(12),n=t(218),i=t(70),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol("amount"),o=Symbol("meshCloud");var f=/*#__PURE__*/function(_i$default){function f(l){var _this17;var p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,f);_this17=_callSuper(this,f),_this17.meshNode=l,l.connect(_assertThisInitialized(_this17)),_this17[s]=p,_this17[o]=null;return _this17;}_inherits(f,_i$default);return _createClass(f,[{key:"meshCloud",get:function get(){var l=this.meshNode,p=this[s];return!this[o]&&l.mesh&&(this[o]=new e.MeshCloud(l.mesh,p)),this[o];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[s];},set:function set(l){this[s]=l,this[o]&&(this[o].amount=l);}},{key:"brightness",value:function brightness(l,p){this.meshCloud&&(this.meshCloud.brightness(l,p),this.forceUpdate());}},{key:"contrast",value:function contrast(l,p){this.meshCloud&&(this.meshCloud.contrast(l,p),this.forceUpdate());}},{key:"delete",value:function _delete(l){this.meshCloud&&(this.meshCloud["delete"](l),this[s]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this18=this;var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_get(_getPrototypeOf(f.prototype),"draw",this).call(this,l),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var p=this.shaderAttrs;p&&Object.entries(p).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),O=_ref119[0],x=_ref119[1];_this18.meshCloud.mesh.setAttribute(O,x);});var y=this.uniforms;if(this.uniforms){var O={};Object.entries(y).forEach(function(_ref120){var _ref121=_slicedToArray(_ref120,2),x=_ref121[0],m=_ref121[1];typeof m=="function"&&(m=m(_this18,x)),O[x]=m;}),this.meshCloud.mesh.setUniforms(O);}}this.meshNode.textureImage&&Object(n.drawTexture)(this.meshNode,this.meshNode.mesh),l.push(this.meshCloud);}return l;}},{key:"getTransform",value:function getTransform(l){if(this.meshCloud)return this.meshCloud.getTransform(l);}},{key:"grayscale",value:function grayscale(l,p){this.meshCloud&&(this.meshCloud.grayscale(l,p),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(l,p){this.meshCloud&&(this.meshCloud.hueRotate(l,p),this.forceUpdate());}},{key:"invert",value:function invert(l,p){this.meshCloud&&(this.meshCloud.invert(l,p),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(l,p){if(!this.meshCloud)return!1;var y=this.attributes.pointerEvents;if(y==="none"||y!=="all"&&!this.isVisible)return!1;var O="both";y==="visibleFill"&&(O="fill"),y==="visibleStroke"&&(O="stroke");for(var x=0;x<this[s];x++)if(!this.meshCloud.isPointCollision(x,[l,p],O))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(l,p){this.meshCloud&&(this.meshCloud.opacity(l,p),this.forceUpdate());}},{key:"rotate",value:function rotate(l,p){var _ref122=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref123=_slicedToArray(_ref122,2),y=_ref123[0],O=_ref123[1];var x=Math.PI*p/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,m=_this$meshNode$attrib.x,_T16=_this$meshNode$attrib.y;this.meshCloud.rotate(l,x,[y+m,O+_T16]),this.forceUpdate();}}},{key:"saturate",value:function saturate(l,p){this.meshCloud&&(this.meshCloud.saturate(l,p),this.forceUpdate());}},{key:"scale",value:function scale(l,_ref124){var _ref125=_slicedToArray(_ref124,2),p=_ref125[0],_ref125$=_ref125[1],y=_ref125$===void 0?p:_ref125$;var _ref126=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref127=_slicedToArray(_ref126,2),O=_ref127[0],x=_ref127[1];if(this.meshCloud){var _this$meshNode$attrib2=this.meshNode.attributes,m=_this$meshNode$attrib2.x,_T17=_this$meshNode$attrib2.y,_c14=1e-5;Math.abs(p)<_c14&&(p=1/p>0?_c14:-_c14),Math.abs(y)<_c14&&(y=1/y>0?_c14:-_c14),this.meshCloud.scale(l,[p,y],[O+m,x+_T17]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(l,p){this.meshCloud&&(this.meshCloud.setColorTransform(l,p),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(l,p){this.meshCloud&&(Array.isArray(p)&&(p=_toConsumableArray(p),p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setFillColor(l,p),this.forceUpdate());}},{key:"sepia",value:function sepia(l,p){this.meshCloud&&(this.meshCloud.sepia(l,p),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref128){var l=_ref128.width,p=_ref128.height;_get(_getPrototypeOf(f.prototype),"setResolution",this).call(this,{width:l,height:p}),this.meshNode.setResolution({width:l,height:p});}},{key:"setStrokeColor",value:function setStrokeColor(l,p){this.meshCloud&&(Array.isArray(p)&&(p=_toConsumableArray(p),p[0]/=255,p[1]/=255,p[2]/=255),this.meshCloud.setStrokeColor(l,p),this.forceUpdate());}},{key:"setTransform",value:function setTransform(l,p){this.meshCloud&&(this.meshCloud.setTransform(l,p),this.forceUpdate());}},{key:"skew",value:function skew(l,_ref129){var _ref130=_slicedToArray(_ref129,2),p=_ref130[0],_ref130$=_ref130[1],y=_ref130$===void 0?p:_ref130$;var _ref131=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref132=_slicedToArray(_ref131,2),O=_ref132[0],x=_ref132[1];if(this.meshCloud){var _this$meshNode$attrib3=this.meshNode.attributes,m=_this$meshNode$attrib3.x,_T18=_this$meshNode$attrib3.y;this.meshCloud.skew(l,[p,y],[O+m,x+_T18]),this.forceUpdate();}}},{key:"transform",value:function transform(l,p){this.meshCloud&&(this.meshCloud.transform(l,p),this.forceUpdate());}},{key:"transformColor",value:function transformColor(l,p){this.meshCloud&&(this.meshCloud.transformColor(l,p),this.forceUpdate());}},{key:"translate",value:function translate(l,_ref133){var _ref134=_slicedToArray(_ref133,2),p=_ref134[0],y=_ref134[1];this.meshCloud&&(this.meshCloud.translate(l,[p,y]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[o]&&(this[o].mesh=this.meshNode.mesh,this.forceUpdate());}}]);}(i["default"]);a["default"].registerNode(f,"cloud");},/* 218 */ /***/function(h,r,t){t.r(r),t.d(r,"loadTexture",function(){return a;}),t.d(r,"applyTexture",function(){return s;}),t.d(r,"createTexture",function(){return f;}),t.d(r,"deleteTexture",function(){return v;}),t.d(r,"drawTexture",function(){return p;}),t.d(r,"loadFrames",function(){return y;});var e=t(12),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i={};function a(O,x){if(i[O])return i[O];var m=e.ENV.loadImage(O,{alias:x,useImageBitmap:!1});return m!==null&&m!==void 0?m:O;}function s(_x11,_x12,_x13){return _s2.apply(this,arguments);}function _s2(){_s2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(O,x,m){var T,_O$attributes,_c15,d,u,g;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:T=x;typeof x=="string"&&(T=a(x));_context9.t0=T&&typeof T.then=="function";if(!_context9.t0){_context9.next=7;break;}_context9.next=6;return T;case 6:T=_context9.sent;case 7:if(!(x===O.attributes.texture)){_context9.next=11;break;}T&&T.image&&(T.sourceRect&&(O.attributes.sourceRect=T.sourceRect),O.textureImageRotated=!!T.rotated,T=T.image);_O$attributes=O.attributes,_c15=_O$attributes.width,d=_O$attributes.height,u=_O$attributes.textureRect,g=O.textureImage;O.textureImage=T,m&&g!==T&&!u&&(_c15==null||d==null)&&O.updateContours(),O.forceUpdate();case 11:return _context9.abrupt("return",T);case 12:case"end":return _context9.stop();}},_callee9);}));return _s2.apply(this,arguments);}var o=Symbol("textureMap");function f(O,x){if(x[o]=x[o]||/* @__PURE__ */new Map(),x[o].has(O))return x[o].get(O);var m=x.createTexture(O);return!/^blob:/.test(O.src)&&typeof O.getContext!="function"&&x[o].set(O,m),m;}function v(O,x){if(x[o]&&x[o].has(O)){var m=x[o].get(O);return x.deleteTexture(m),x[o]["delete"](O),!0;}return!1;}var l=Symbol("textureContext");function p(O,x){var m=O.textureImage instanceof String?String(O.textureImage):O.textureImage,T=O.textureImageRotated,c=x.texture,d=O.renderer;if(m){var u=O.originalContentRect;var g=O.attributes.textureRect;var M=O.attributes.textureRepeat,A=O.attributes.sourceRect;if(!c||O[l]&&O[l]!==d||c.image!==m||c.options.repeat!==M||!Object(n.compareValue)(c.options.rect,g)||!Object(n.compareValue)(c.options.srcRect,A)){var I=f(m,d);g?(g[0]+=u[0],g[1]+=u[1]):g=u;var b=null;c&&!d[o].has(c.image)&&(!c.options||!c.options.hidden)&&(b=x.uniforms.u_texSampler),x.setTexture(I,{rect:g,repeat:M,srcRect:A,rotated:T}),b&&b["delete"]&&b["delete"](),O[l]=d;}}else if(c){var _u8=null;!d[o].has(c.image)&&(!c.options||!c.options.hidden)&&(_u8=x.uniforms.u_texSampler),x.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function y(_x14,_x15){return _y5.apply(this,arguments);}function _y5(){_y5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(O,x){var m,T;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.t0=typeof x=="string";if(!_context10.t0){_context10.next=7;break;}_context10.next=4;return fetch(x,{method:"GET",mode:"cors",cache:"default"});case 4:_context10.next=6;return _context10.sent.json();case 6:x=_context10.sent;case 7:_context10.next=9;return a(O);case 9:m=_context10.sent;T=x.frames;return _context10.abrupt("return",(Object.entries(T).forEach(function(_ref135){var _ref136=_slicedToArray(_ref135,2),c=_ref136[0],d=_ref136[1];var _d$frame=d.frame,u=_d$frame.x,g=_d$frame.y,M=_d$frame.w,A=_d$frame.h;var I=[u,g,M,A];var b=d.rotated;b&&(I=[I[0],I[1],I[3],I[2]]),i[c]={image:m,sourceRect:I,rotated:b};}),m));case 12:case"end":return _context10.stop();}},_callee10);}));return _y5.apply(this,arguments);}},/* 219 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(1),n=t(12),i=t(70),a=t(220),s=t(221),o=t(222),f=t(213),v=t(223);t(1).glMatrix.setMatrixArrayType(Array);function l(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O;}var p=Symbol("mesh");var y=/*#__PURE__*/function(_i$default2){function y(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);return _callSuper(this,y,[x]);}_inherits(y,_i$default2);return _createClass(y,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,x=_this$attributes2.paddingTop,m=_this$attributes2.paddingRight,T=_this$attributes2.paddingBottom,c=_this$attributes2.paddingLeft,d=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),u=_this$contentSize[0],g=_this$contentSize[1];return[c+u+m+d,x+g+T+d];}// content + padding
|
|
312
|
+
},{key:"clientSize",get:function get(){var _this$attributes3=this.attributes,x=_this$attributes3.paddingTop,m=_this$attributes3.paddingRight,T=_this$attributes3.paddingBottom,c=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),d=_this$contentSize2[0],u=_this$contentSize2[1];return[c+d+m,x+u+T];}},{key:"contentSize",get:function get(){var _this$attributes4=this.attributes,x=_this$attributes4.width,m=_this$attributes4.height,T=_this$attributes4.boxSizing,c=_this$attributes4.paddingTop,d=_this$attributes4.paddingRight,u=_this$attributes4.paddingBottom,g=_this$attributes4.paddingLeft;if(x=x||0,m=m||0,T==="border-box"){var M=2*this.attributes.borderWidth;x-=M+d+g,m-=M+c+u,x=Math.max(0,x),m=Math.max(0,m);}return[x,m];}},{key:"hasBorder",get:function get(){return this.attributes.borderWidth>0;}/* override */},{key:"isVisible",get:function get(){var _this$borderSize=_slicedToArray(this.borderSize,2),x=_this$borderSize[0],m=_this$borderSize[1];return x>0&&m>0;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var x=this.clientBox;if(x){var _m5;var m=this[p];if(m)m.box!==x&&(m.contours=x.contours,m.box=x);else{m=new n.Mesh2D(x),m.box=x;var _c16=this.attributes.bgcolor;if(Object(s.setFillColor)(m,{color:_c16}),this.hasBorder){var _this$attributes5=this.attributes,u=_this$attributes5.borderColor,g=_this$attributes5.borderWidth,M=_this$attributes5.borderDash,A=_this$attributes5.borderDashOffset;Object(s.setStrokeColor)(m,{color:u,lineWidth:g,lineDash:M,lineDashOffset:A});}this[p]=m;var d=this.attributes.clipPath;d&&this[p].setClipPath(d);}var _T19=this.opacity;return m.getOpacity()!==_T19&&m.setOpacity(_T19),(_m5=m).setTransform.apply(_m5,_toConsumableArray(this.renderMatrix)),m;}return null;}// content + padding + border
|
|
313
|
+
},{key:"offsetSize",get:function get(){var _this$attributes6=this.attributes,x=_this$attributes6.paddingTop,m=_this$attributes6.paddingRight,T=_this$attributes6.paddingBottom,c=_this$attributes6.paddingLeft,d=_this$attributes6.borderWidth,_this$contentSize3=_slicedToArray(this.contentSize,2),u=_this$contentSize3[0],g=_this$contentSize3[1],M=2*d;return[c+u+m+M,x+g+T+M];}},{key:"originalClientRect",get:function get(){if(this.mesh){var x=this.mesh.boundingBox;return[x[0][0],x[0][1],x[1][0]-x[0][0],x[1][1]-x[0][1]];}return[0,0,0,0];}},{key:"originalContentRect",get:function get(){var _this$originalClientR=_slicedToArray(this.originalClientRect,4),x=_this$originalClientR[0],m=_this$originalClientR[1],T=_this$originalClientR[2],c=_this$originalClientR[3],d=this.attributes.padding;return[x+d[0],m+d[1],T-d[0]-d[2],c-d[1]-d[3]];}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var x=this.renderMatrix;this.layer&&this.layer.layerTransformInvert&&(x=e.mat2d.multiply(Array.of(0,0,0,0,0,0),this.layer.transformMatrix,x));var m=null;if(this.mesh){m=_toConsumableArray(this.mesh.boundingBox);var _T20=this.attributes.borderWidth;_T20&&(m[0]=[m[0][0]-_T20,m[0][1]-_T20],m[1]=[m[1][0]+_T20,m[1][1]+_T20]);}return Object(v["default"])(m,x);}// transformPoint(x, y) {
|
|
314
|
+
// const m = mat2d.invert(this.renderMatrix);
|
|
315
|
+
// const newX = x * m[0] + y * m[2] + m[4];
|
|
316
|
+
// const newY = x * m[1] + y * m[3] + m[5];
|
|
317
|
+
// return [newX, newY];
|
|
318
|
+
// }
|
|
319
|
+
/* override */},{key:"onPropertyChange",value:function onPropertyChange(x,m,T){if(_get(_getPrototypeOf(y.prototype),"onPropertyChange",this).call(this,x,m,T),(x==="anchorX"||x==="anchorY"||x==="boxSizing"||x==="width"||x==="height"||x==="borderWidth"||x==="paddingLeft"||x==="paddingRight"||x==="paddingTop"||x==="paddingBottom"||/^border(TopLeft|TopRight|BottomRight|BottomLeft)Radius$/.test(x))&&this.updateContours(),this[p]&&x==="clipPath"&&this[p].setClipPath(m),this[p]&&x==="bgcolor"&&Object(s.setFillColor)(this[p],{color:m}),this[p]&&(x==="borderColor"||x==="borderWidth"||x==="borderDash"||x==="borderDashOffset")){var _this$attributes7=this.attributes,_c17=_this$attributes7.borderColor,d=_this$attributes7.borderWidth,u=_this$attributes7.borderDash,g=_this$attributes7.borderDashOffset;Object(s.setStrokeColor)(this[p],{color:_c17,lineWidth:d,lineDash:d?u:0,lineDashOffset:g});}}/* override */},{key:"updateContours",value:function updateContours(){var _this$attributes8=this.attributes,x=_this$attributes8.anchorX,m=_this$attributes8.anchorY,T=_this$attributes8.borderWidth,c=_this$attributes8.borderRadius,_this$borderSize2=_slicedToArray(this.borderSize,2),d=_this$borderSize2[0],u=_this$borderSize2[1],g=this.offsetSize,M=0.5*T,A=-x*g[0]+M,I=-m*g[1]+M;this.clientBox=new n.Figure2D(),Object(o.createRadiusBox)(this.clientBox,[A,I,d,u],c);}}]);}(i["default"]);l(y,"Attr",a["default"]),f["default"].registerNode(y,"block");},/* 220 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return v;});var e=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),o=Symbol["for"]("spritejs_setAttributeDefault"),f=Symbol["for"]("spritejs_declareAlias");var v=/*#__PURE__*/function(_e$default){function v(p){var _this19;_classCallCheck(this,v);_this19=_callSuper(this,v,[p]),_this19[o]({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}),_this19[f]("anchor","size","border","borderRadius","padding");return _this19;}_inherits(v,_e$default);return _createClass(v,[{key:"anchorX",get:function get(){return this[s]("anchorX");},set:function set(p){this[a]("anchorX",Object(n.toNumber)(p));}},{key:"anchorY",get:function get(){return this[s]("anchorY");},set:function set(p){this[a]("anchorY",Object(n.toNumber)(p));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.anchorX=p[0],this.anchorY=p[1];}},{key:"width",get:function get(){return this[s]("width");},set:function set(p){this[a]("width",Object(n.toNumber)(p));}},{key:"height",get:function get(){return this[s]("height");},set:function set(p){this[a]("height",Object(n.toNumber)(p));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1];}},{key:"borderWidth",get:function get(){return this[s]("borderWidth");},set:function set(p){this[a]("borderWidth",Object(n.toNumber)(p));}},{key:"borderColor",get:function get(){return this[s]("borderColor");},set:function set(p){this[a]("borderColor",Object(i.parseColor)(p));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p]),this.borderWidth=p[0],p[1]!=null&&(this.borderColor=p[1]);}},{key:"borderDash",get:function get(){return this[s]("borderDash");},set:function set(p){p=Object(n.toArray)(p,!0),p!=null&&!Array.isArray(p)&&(p=[p]),this[a]("borderDash",p?p.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[s]("borderDashOffset");},set:function set(p){this[a]("borderDashOffset",Object(n.toNumber)(p));}},{key:"borderTopLeftRadius",get:function get(){return this[s]("borderTopLeftRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopLeftRadius",p.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[s]("borderTopRightRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderTopRightRadius",p.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[s]("borderBottomRightRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomRightRadius",p.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[s]("borderBottomLeftRadius");},set:function set(p){p=Object(n.toArray)(p,!0),Array.isArray(p)||(p=[p,p]),this[a]("borderBottomLeftRadius",p.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(p){if(p=Object(n.toArray)(p),!Array.isArray(p))p=Array(8).fill(p);else if(p.length===2)p=[p[0],p[1],p[0],p[1],p[0],p[1],p[0],p[1]];else if(p.length===4)p=[p[0],p[1],p[2],p[3],p[0],p[1],p[2],p[3]];else if(p.length===6)p=[p[0],p[1],p[2],p[3],p[4],p[5],p[2],p[3]];else if(p.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[p[0],p[1]],this.borderTopRightRadius=[p[2],p[3]],this.borderBottomRightRadius=[p[4],p[5]],this.borderBottomLeftRadius=[p[6],p[7]];}},{key:"bgcolor",get:function get(){return this[s]("bgcolor");},set:function set(p){this[a]("bgcolor",Object(i.parseColor)(p));}},{key:"paddingTop",get:function get(){return this[s]("paddingTop");},set:function set(p){this[a]("paddingTop",Object(n.toNumber)(p));}},{key:"paddingRight",get:function get(){return this[s]("paddingRight");},set:function set(p){this[a]("paddingRight",Object(n.toNumber)(p));}},{key:"paddingBottom",get:function get(){return this[s]("paddingBottom");},set:function set(p){this[a]("paddingBottom",Object(n.toNumber)(p));}},{key:"paddingLeft",get:function get(){return this[s]("paddingLeft");},set:function set(p){this[a]("paddingLeft",Object(n.toNumber)(p));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)?p.length===2?p=[p[0],p[1],p[0],p[1]]:p.length===3&&(p=[p[0],p[1],p[2],p[1]]):p=[p,p,p,p],this.paddingTop=p[0],this.paddingRight=p[1],this.paddingBottom=p[2],this.paddingLeft=p[3];}},{key:"clipPath",get:function get(){return this[s]("clipPath");},set:function set(p){this[a]("clipPath",p);}},{key:"boxSizing",get:function get(){return this[s]("boxSizing");},set:function set(p){if(p!=null&&p!=="border-box"&&p!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",p);}}]);}(e["default"]);},/* 221 */ /***/function(h,r,t){t.r(r),t.d(r,"Gradient",function(){return i;}),t.d(r,"isTransparent",function(){return a;}),t.d(r,"parseColor",function(){return s;}),t.d(r,"setFillColor",function(){return f;}),t.d(r,"setStrokeColor",function(){return v;}),t.d(r,"Color",function(){return l;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref137){var y=_ref137.vector,O=_ref137.colors;_classCallCheck(this,i);if(!Array.isArray(y)||y.length!==4&&y.length!==6&&y.length!==3)throw new TypeError("Invalid gradient");this.vector=y,this.colors=O.map(function(_ref138){var x=_ref138.offset,m=_ref138.color;return{offset:x,color:s(m)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function a(p){return p instanceof i?!1:p==null?!0:n()(p)[3]===0;}function s(p){if(p==null||(p||(p="transparent"),p instanceof i))return p;var y=n()(p);if(!y||!y.length)throw new TypeError("Invalid color value.");return"rgba(".concat(y.join(),")");}function o(p,y,O){var x=p.boundingBox[0];if(O.vector){var m=O.vector,_T21=O.colors;m.length===4?(m=[m[0]+x[0],m[1]+x[1],m[2]+x[0],m[3]+x[1]],p.setLinearGradient({vector:m,colors:_T21,type:y})):m.length===3?(m=[m[0]+x[0],m[1]+x[1],m[2]],p.setCircularGradient({vector:m,colors:_T21,type:y})):(m=[m[0]+x[0],m[1]+x[1],m[2],m[3]+x[0],m[4]+x[1],m[5]],p.setRadialGradient({vector:m,colors:_T21,type:y}));}else p.gradient&&p.gradient[y]&&(delete p.gradient[y],delete p.uniforms.u_radialGradientVector);}function f(p,_ref139){var y=_ref139.color,_ref139$rule=_ref139.rule,O=_ref139$rule===void 0?"nonzero":_ref139$rule;return o(p,"fill",y),y.vector||p.setFill({color:y,rule:O}),p;}function v(p,_ref140){var y=_ref140.color,O=_ref140.lineWidth,x=_ref140.lineCap,m=_ref140.lineJoin,T=_ref140.lineDash,c=_ref140.lineDashOffset,d=_ref140.miterLimit,u=_ref140.roundSegments;o(p,"stroke",y),y.vector&&(y=[0,0,0,1]),p.setStroke({color:y,thickness:O,cap:x,join:m,miterLimit:d,lineDash:T,lineDashOffset:c,roundSegments:u});}var l=/*#__PURE__*/function(_Array){function l(){var _y6,_y7,_n2,_n3;var _this20;var y=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var O=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var m=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,l);return _possibleConstructorReturn(_this20,(Array.isArray(y)&&(_y6=y,_y7=_slicedToArray(_y6,4),y=_y7[0],O=_y7[1],x=_y7[2],m=_y7[3],_y6),typeof y=="string"&&((_n2=n()(y),_n3=_slicedToArray(_n2,4),y=_n3[0],O=_n3[1],x=_n3[2],m=_n3[3]),y/=255,O/=255,x/=255),_this20=_callSuper(this,l,[y,O,x,m]),_assertThisInitialized(_this20)));}_inherits(l,_Array);return _createClass(l,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(y){this[0]=y/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(y){this[1]=y/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(y){this[2]=y/255;}},{key:"a",get:function get(){return this[3];},set:function set(y){this[3]=y;}},{key:"hex",get:function get(){var y="0".concat(this.r.toString(16)).slice(-2),O="0".concat(this.g.toString(16)).slice(-2),x="0".concat(this.b.toString(16)).slice(-2);var m;return this.a<1&&(m=Math.round(this[3]*255),m="0".concat(m.toString(16)).slice(-2)),"#".concat(y).concat(O).concat(x).concat(m||"");}},{key:"rgba",get:function get(){return"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")");}},{key:"fromColor",value:function fromColor(y){return typeof y=="string"&&(y=n()(y),y[0]/=255,y[1]/=255,y[2]/=255),this[0]=y[0],this[1]=y[1],this[2]=y[2],this[3]=y[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 */ /***/function(h,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,s,o,f){var v=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var l=0.5522848,p=o/2*l,y=f/2*l,O=a+o,x=s+f,m=a+o/2,T=s+f/2;v==="leftTop"?(i.moveTo(a,T),i.bezierCurveTo(a,T-y,m-p,s,m,s)):v==="rightTop"?i.bezierCurveTo(m+p,s,O,T-y,O,T):v==="rightBottom"?i.bezierCurveTo(O,T+y,m+p,x,m,x):v==="leftBottom"&&i.bezierCurveTo(m-p,x,a,T+y,a,T);}function n(i,_ref141,v){var _ref142=_slicedToArray(_ref141,4),a=_ref142[0],s=_ref142[1],o=_ref142[2],f=_ref142[3];if(!v||Array.isArray(v)&&v.every(function(l){return l===0;}))i.beginPath(),i.rect(a,s,o,f);else{typeof v=="number"&&(v=Array(8).fill(v));var _v$map=v.map(function(d,u){return u%2?Math.min(d,f/2):Math.min(d,o/2);}),_v$map2=_slicedToArray(_v$map,8),l=_v$map2[0],p=_v$map2[1],y=_v$map2[2],O=_v$map2[3],x=_v$map2[4],m=_v$map2[5],_T22=_v$map2[6],_c18=_v$map2[7];i.beginPath(),i.moveTo(a,s+p),e(i,a,s,l*2,p*2,"leftTop"),i.lineTo(a+o-y,s),e(i,a+o-y*2,s,y*2,O*2,"rightTop"),i.lineTo(a+o,s+f-m),e(i,a+o-x*2,s+f-m*2,x*2,m*2,"rightBottom"),i.lineTo(a+_T22,s+f),e(i,a,s+f-_c18*2,_T22*2,_c18*2,"leftBottom"),i.closePath();}return i;}},/* 223 */ /***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array),r["default"]=function(e,n){if(!e)return{x:0,y:0,width:0,height:0,left:0,top:0,right:0,bottom:0};var _e3=_slicedToArray(e,2),_e3$=_slicedToArray(_e3[0],2),i=_e3$[0],a=_e3$[1],_e3$2=_slicedToArray(_e3[1],2),s=_e3$2[0],o=_e3$2[1],f=i*n[0]+a*n[2]+n[4],v=i*n[1]+a*n[3]+n[5],l=s*n[0]+a*n[2]+n[4],p=s*n[1]+a*n[3]+n[5],y=s*n[0]+o*n[2]+n[4],O=s*n[1]+o*n[3]+n[5],x=i*n[0]+o*n[2]+n[4],m=i*n[1]+o*n[3]+n[5],T=Math.min(f,l,y,x),c=Math.min(v,p,O,m),d=Math.max(f,l,y,x),u=Math.max(v,p,O,m);return{x:T,y:c,width:d-T,height:u-c,left:T,top:c,right:d,bottom:u};};},/* 224 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(218),n=t(219),i=t(225),a=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(v,l,p){return l in v?Object.defineProperty(v,l,{value:p,enumerable:!0,configurable:!0,writable:!0}):v[l]=p,v;}var o=Symbol("textureTask");var f=/*#__PURE__*/function(_n$default){function f(){var _this21;var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,f);typeof l=="string"&&(l={texture:l}),_this21=_callSuper(this,f,[l]);return _this21;}/* override */_inherits(f,_n$default);return _createClass(f,[{key:"contentSize",get:function get(){var _get2=_get(_getPrototypeOf(f.prototype),"contentSize",this),_get3=_slicedToArray(_get2,2),l=_get3[0],p=_get3[1];var _this$attributes9=this.attributes,y=_this$attributes9.width,O=_this$attributes9.height;if(y==null||O==null){var x=this.textureImage,m=this.attributes.textureRect,_T23=this.attributes.sourceRect;if(m)y==null&&(l=m[0]+m[2]),O==null&&(p=m[1]+m[3]);else if(_T23){var _c19=this.layer?this.layer.displayRatio:1;y==null&&(l=_T23[2]/_c19),O==null&&(p=_T23[3]/_c19);}else if(x){var _c20=this.layer?this.layer.displayRatio:1;y==null&&(l=x.width/_c20),O==null&&(p=x.height/_c20);}}return[l,p];}},{key:"textureImageReady",get:function get(){return this[o]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(f.prototype),"draw",this).call(this,l);var p=this.mesh;return p&&Object(e.drawTexture)(this,p),l;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(l,p,y){if(_get(_getPrototypeOf(f.prototype),"onPropertyChange",this).call(this,l,p,y),l==="texture"&&(this[o]=Object(e.applyTexture)(this,p,!0)),l==="textureRect"){var _this$attributes10=this.attributes,O=_this$attributes10.width,x=_this$attributes10.height;(O==null||x==null)&&this.updateContours();}}}]);}(n["default"]);s(f,"Attr",i["default"]),a["default"].registerNode(f,"sprite");},/* 225 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_setAttributeDefault"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_getAttribute");var s=/*#__PURE__*/function(_e$default2){function s(f){var _this22;_classCallCheck(this,s);_this22=_callSuper(this,s,[f]),_this22[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this22;}_inherits(s,_e$default2);return _createClass(s,[{key:"texture",get:function get(){return this[a]("texture");},set:function set(f){this[i]("texture",f);}},{key:"textureRect",get:function get(){return this[a]("textureRect");},set:function set(f){this[i]("textureRect",f);}},{key:"sourceRect",get:function get(){return this[a]("sourceRect");},set:function set(f){this[i]("sourceRect",f);}},{key:"textureRepeat",get:function get(){return this[a]("textureRepeat");},set:function set(f){this[i]("textureRepeat",!!f);}}]);}(e["default"]);},/* 226 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return O;});var e=t(12),n=t(227),i=/* @__PURE__ */t.n(n),a=t(70),s=t(228),o=t(221),f=t(218),v=t(213),l=t(223);t(1).glMatrix.setMatrixArrayType(Array);function p(x,m,T){return m in x?Object.defineProperty(x,m,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[m]=T,x;}var y=Symbol("mesh");var O=/*#__PURE__*/function(_a$default){function O(){var _this23;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);typeof m=="string"&&(m={d:m}),_this23=_callSuper(this,O,[m]),_this23.effects={d:function d(T,c,_d5,u,g){var _i$a;var M=(_d5-u)/(g-u);if(M<=0)return T;if(M>=1)return c;var A=i.a._preprocessing(i.a.path2shapes(T),i.a.path2shapes(c)),I=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(A).concat([M]))[0];return I.reduce(function(E,L){return"".concat(E).concat(L.slice(2).join(" ")," ");},"M".concat(I[0][0]," ").concat(I[0][1],"C")).trim();}};return _this23;}/* override */_inherits(O,_a$default);return _createClass(O,[{key:"isVisible",get:function get(){return!!this.d;}},{key:"mesh",get:function get(){if(this.attributes.display==="none")return null;var m=this.path;if(m){var _T25;var _T24=this[y];if(_T24)_T24.path!==m&&(_T24.contours=m.contours,_T24.path=m);else{_T24=new e.Mesh2D(this.path),_T24.path=m;var d=this.attributes.fillColor,u=this.attributes.fillRule;d&&Object(o.setFillColor)(_T24,{color:d,rule:u});var g=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&g>0){var _this$attributes11=this.attributes,I=_this$attributes11.lineCap,b=_this$attributes11.lineJoin,E=_this$attributes11.miterLimit,L=_this$attributes11.lineDash,D=_this$attributes11.lineDashOffset,R=_this$attributes11.roundSegments;Object(o.setStrokeColor)(_T24,{color:M,lineWidth:g,lineCap:I,lineJoin:b,miterLimit:E,lineDash:L,lineDashOffset:D,roundSegments:R});}this[y]=_T24;var A=this.attributes.clipPath;A&&this[y].setClipPath(A);}var _c21=this.opacity;return _T24.getOpacity()!==_c21&&_T24.setOpacity(_c21),(_T25=_T24).setTransform.apply(_T25,_toConsumableArray(this.renderMatrix)),_T24;}return null;}},{key:"originalContentRect",get:function get(){if(this.path){var m=this.path.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[0][1]];}return[0,0,0,0];}},{key:"originalClientRect",get:function get(){if(this.mesh){var m=this.mesh.boundingBox;return[m[0][0],m[0][1],m[1][0]-m[0][0],m[1][1]-m[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(m){this.attributes.d=m;}},{key:"draw",value:function draw(){var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(O.prototype),"draw",this).call(this,m);var T=this.mesh;return T&&Object(f.drawTexture)(this,T),m;}},{key:"getBoundingClientRect",value:function getBoundingClientRect(){var m=null;return this.mesh&&(m=this.mesh.boundingBox),Object(l["default"])(m,this.renderMatrix);}},{key:"getPathLength",value:function getPathLength(){return this.mesh?this.mesh.getTotalLength():0;}},{key:"getPointAtLength",value:function getPointAtLength(m){if(this.mesh){var _T26=this.mesh.getPointAtLength(m);if(_T26)return[_T26.x,_T26.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,T,c){if(_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,m,T,c),(m==="d"||m==="normalize")&&this.updateContours(),this[y]&&(m==="fillColor"||m==="fillRule")){var _this$attributes12=this.attributes,d=_this$attributes12.fillColor,u=_this$attributes12.fillRule;Object(o.setFillColor)(this[y],{color:d,rule:u});}if(this[y]&&(m==="strokeColor"||m==="lineWidth"||m==="lineCap"||m==="lineJoin"||m==="lineDash"||m==="lineDashOffset"||m==="roundSegments")){var _this$attributes13=this.attributes,_d6=_this$attributes13.strokeColor,_u9=_this$attributes13.lineWidth;if(_d6&&_u9>0){var _this$attributes14=this.attributes,g=_this$attributes14.lineCap,M=_this$attributes14.lineJoin,A=_this$attributes14.lineDash,I=_this$attributes14.lineDashOffset,b=_this$attributes14.miterLimit,E=_this$attributes14.roundSegments;Object(o.setStrokeColor)(this[y],{color:_d6,lineCap:g,lineJoin:M,lineWidth:_u9,lineDash:A,lineDashOffset:I,miterLimit:b,roundSegments:E});}}this[y]&&m==="clipPath"&&this[y].setClipPath(T),m==="texture"&&Object(f.applyTexture)(this,T);}/* override */},{key:"updateContours",value:function updateContours(){var _this$path;this.path=new e.Figure2D(),this.path.addPath(this.attributes.d),this.attributes.normalize&&(_this$path=this.path).normalize.apply(_this$path,_toConsumableArray(this.path.boundingCenter));}}]);}(a["default"]);p(O,"Attr",s["default"]),v["default"].registerNode(O,"path");},/* 227 */ /***/function(h,r,t){(function(e,n){h.exports=n();})(this,function(){var e=/* @__PURE__ */function(){function L(D,R){var C=[],W=!0,z=!1,H=void 0;try{for(var X=D[Symbol.iterator](),Z;!(W=(Z=X.next()).done)&&(C.push(Z.value),!(R&&C.length===R));W=!0);}catch(j){z=!0,H=j;}finally{try{!W&&X["return"]&&X["return"]();}finally{if(z)throw H;}}return C;}return function(D,R){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return L(D,R);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(D,R,C,W,z,H,X){var Z=D.x,j=D.y;Z*=R,j*=C;var G=W*Z-z*j,Q=z*Z+W*j;return{x:G+H,y:Q+X};},a=function a(D,R){var C=1.3333333333333333*Math.tan(R/4),W=Math.cos(D),z=Math.sin(D),H=Math.cos(D+R),X=Math.sin(D+R);return[{x:W-z*C,y:z+W*C},{x:H+X*C,y:X-H*C},{x:H,y:X}];},s=function s(D,R,C,W){var z=D*W-R*C<0?-1:1,H=Math.sqrt(D*D+R*R),X=Math.sqrt(D*D+R*R),Z=D*C+R*W,j=Z/(H*X);return j>1&&(j=1),j<-1&&(j=-1),z*Math.acos(j);},o=function o(D,R,C,W,z,H,X,Z,j,G,Q,tt){var et=Math.pow(z,2),at=Math.pow(H,2),q=Math.pow(Q,2),pt=Math.pow(tt,2),dt=et*at-et*pt-at*q;dt<0&&(dt=0),dt/=et*pt+at*q,dt=Math.sqrt(dt)*(X===Z?-1:1);var B=dt*z/H*tt,F=dt*-H/z*Q,V=G*B-j*F+(D+C)/2,J=j*B+G*F+(R+W)/2,N=(Q-B)/z,$=(tt-F)/H,S=(-Q-B)/z,P=(-tt-F)/H,w=s(1,0,N,$),U=s(N,$,S,P);return Z===0&&U>0&&(U-=n),Z===1&&U<0&&(U+=n),[V,J,w,U];},f=function f(D){var R=D.px,C=D.py,W=D.cx,z=D.cy,H=D.rx,X=D.ry,Z=D.xAxisRotation,j=Z===void 0?0:Z,G=D.largeArcFlag,Q=G===void 0?0:G,tt=D.sweepFlag,et=tt===void 0?0:tt,at=[];if(H===0||X===0)return[];var q=Math.sin(j*n/360),pt=Math.cos(j*n/360),dt=pt*(R-W)/2+q*(C-z)/2,B=-q*(R-W)/2+pt*(C-z)/2;if(dt===0&&B===0)return[];H=Math.abs(H),X=Math.abs(X);var F=Math.pow(dt,2)/Math.pow(H,2)+Math.pow(B,2)/Math.pow(X,2);F>1&&(H*=Math.sqrt(F),X*=Math.sqrt(F));var V=o(R,C,W,z,H,X,Q,et,q,pt,dt,B),J=e(V,4),N=J[0],$=J[1],S=J[2],P=J[3],w=Math.max(Math.ceil(Math.abs(P)/(n/4)),1);P/=w;for(var U=0;U<w;U++)at.push(a(S,P)),S+=P;return at.map(function(K){var Y=i(K[0],H,X,pt,q,N,$),k=Y.x,rt=Y.y,it=i(K[1],H,X,pt,q,N,$),lt=it.x,ut=it.y,ot=i(K[2],H,X,pt,q,N,$),st=ot.x,ft=ot.y;return{x1:k,y1:rt,x2:lt,y2:ut,x:st,y:ft};});},v={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0/**
|
|
320
|
+
* segment pattern
|
|
321
|
+
* @type {RegExp}
|
|
322
|
+
*/},l=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function p(L){var D=[];return L.replace(l,function(R,C,W){var z=C.toLowerCase();for(W=O(W),z=="m"&&W.length>2&&(D.push([C].concat(W.splice(0,2))),z="l",C=C=="m"?"l":"L");;){if(W.length==v[z])return W.unshift(C),D.push(W);if(W.length<v[z])throw new Error("malformed path data");D.push([C].concat(W.splice(0,v[z])));}}),D;}var y=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function O(L){var D=L.match(y);return D?D.map(Number):[];}function x(L){var D=L[0][0],R=L[0][1],C=D,W=R;return L.forEach(function(z){var H=z[0],X=z[2],Z=z[4],j=z[6],G=z[1],Q=z[3],tt=z[5],et=z[7];D=Math.min(D,H,X,Z,j),R=Math.min(R,G,Q,tt,et),C=Math.max(C,H,X,Z,j),W=Math.max(W,G,Q,tt,et);}),[D,R,C,W];}function m(L,D){return Math.sqrt(Math.pow(L[0]-D[0],2)+Math.pow(L[1]-D[1],2))+Math.sqrt(Math.pow(L[2]-D[2],2)+Math.pow(L[3]-D[3],2));}function T(L,D){var R=L[0],C=L[2],W=L[4],z=L[6],H=L[1],X=L[3],Z=L[5],j=L[7],G=D[0],Q=D[2],tt=D[4],et=D[6],at=D[1],q=D[3],pt=D[5],dt=D[7];return Math.sqrt(Math.pow(G-R,2)+Math.pow(at-H,2))+Math.sqrt(Math.pow(Q-C,2)+Math.pow(q-X,2))+Math.sqrt(Math.pow(tt-W,2)+Math.pow(pt-Z,2))+Math.sqrt(Math.pow(et-z,2)+Math.pow(dt-j,2));}function c(L,D){var R=u(L.length),C=[];R.forEach(function(z){var H=0,X=0;z.forEach(function(Z){H+=T(L[Z],D[X++]);}),C.push({index:z,distance:H});}),C.sort(function(z,H){return z.distance-H.distance;});var W=[];return C[0].index.forEach(function(z){W.push(L[z]);}),W;}function d(L,D){var R=g(L.length),C=[];R.forEach(function(z){var H=0;z.forEach(function(X){H+=m(x(L[X]),x(D[X]));}),C.push({index:z,distance:H});}),C.sort(function(z,H){return z.distance-H.distance;});var W=[];return C[0].index.forEach(function(z){W.push(L[z]);}),W;}function u(L){for(var D=[],R=0;R<L;R++){for(var C=[],W=0;W<L;W++){var z=W+R;z>L-1&&(z-=L),C[z]=W;}D.push(C);}return D;}function g(L){for(var D=[],R=0;R<L;R++)D.push(R);return M(D);}function M(L){var D=[],R=[];function C(W){var z,H;for(z=0;z<W.length;z++)H=W.splice(z,1)[0],R.push(H),W.length==0&&D.push(R.slice()),C(W),W.splice(z,0,H),R.pop();return D;}return C(L);}var A={};A.parser=p,A.lerpCurve=function(L,D,R){return A.lerpPoints(L[0],L[1],D[0],D[1],R).concat(A.lerpPoints(L[2],L[3],D[2],D[3],R)).concat(A.lerpPoints(L[4],L[5],D[4],D[5],R)).concat(A.lerpPoints(L[6],L[7],D[6],D[7],R));},A.lerpPoints=function(L,D,R,C,W){return[L+(R-L)*W,D+(C-D)*W];},A.q2b=function(L,D,R,C,W,z){return[L,D,(L+2*R)/3,(D+2*C)/3,(W+2*R)/3,(z+2*C)/3,W,z];},A.path2shapes=function(L){for(var D=A.parser(L),R=0,C=0,W=0,z=D.length,H=[],X=null,Z=void 0,j=void 0,G=void 0,Q=void 0,tt=void 0,et=void 0,at=void 0;W<z;W++){var q=D[W],pt=q[0],dt=D[W-1];switch(pt){case"m":tt=H.length,H[tt]=[],X=H[tt],R=R+q[1],C=C+q[2];break;case"M":tt=H.length,H[tt]=[],X=H[tt],R=q[1],C=q[2];break;case"l":X.push([R,C,R,C,R,C,R+q[1],C+q[2]]),R+=q[1],C+=q[2];break;case"L":X.push([R,C,q[1],q[2],q[1],q[2],q[1],q[2]]),R=q[1],C=q[2];break;case"h":X.push([R,C,R,C,R,C,R+q[1],C]),R+=q[1];break;case"H":X.push([R,C,q[1],C,q[1],C,q[1],C]),R=q[1];break;case"v":X.push([R,C,R,C,R,C,R,C+q[1]]),C+=q[1];break;case"V":X.push([R,C,R,q[1],R,q[1],R,q[1]]),C=q[1];break;case"C":X.push([R,C,q[1],q[2],q[3],q[4],q[5],q[6]]),R=q[5],C=q[6];break;case"S":dt[0]==="C"||dt[0]==="c"?X.push([R,C,R+dt[5]-dt[3],C+dt[6]-dt[4],q[1],q[2],q[3],q[4]]):(dt[0]==="S"||dt[0]==="s")&&X.push([R,C,R+dt[3]-dt[1],C+dt[4]-dt[2],q[1],q[2],q[3],q[4]]),R=q[3],C=q[4];break;case"c":X.push([R,C,R+q[1],C+q[2],R+q[3],C+q[4],R+q[5],C+q[6]]),R=R+q[5],C=C+q[6];break;case"s":dt[0]==="C"||dt[0]==="c"?X.push([R,C,R+dt[5]-dt[3],C+dt[6]-dt[4],R+q[1],C+q[2],R+q[3],C+q[4]]):(dt[0]==="S"||dt[0]==="s")&&X.push([R,C,R+dt[3]-dt[1],C+dt[4]-dt[2],R+q[1],C+q[2],R+q[3],C+q[4]]),R=R+q[3],C=C+q[4];break;case"a":et=f({rx:q[1],ry:q[2],px:R,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:R+q[6],cy:C+q[7]}),at=et[et.length-1],et.forEach(function(B,F){F===0?X.push([R,C,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):X.push([et[F-1].x,et[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),R=at.x,C=at.y;break;case"A":et=f({rx:q[1],ry:q[2],px:R,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:q[6],cy:q[7]}),at=et[et.length-1],et.forEach(function(B,F){F===0?X.push([R,C,B.x1,B.y1,B.x2,B.y2,B.x,B.y]):X.push([et[F-1].x,et[F-1].y,B.x1,B.y1,B.x2,B.y2,B.x,B.y]);}),R=at.x,C=at.y;break;case"Q":X.push(A.q2b(R,C,q[1],q[2],q[3],q[4])),R=q[3],C=q[4];break;case"q":X.push(A.q2b(R,C,R+q[1],C+q[2],q[3]+R,q[4]+C)),R+=q[3],C+=q[4];break;case"T":dt[0]==="Q"||dt[0]==="q"?(G=R+dt[3]-dt[1],Q=C+dt[4]-dt[2],X.push(A.q2b(R,C,G,Q,q[1],q[2]))):(dt[0]==="T"||dt[0]==="t")&&(X.push(A.q2b(R,C,R+R-G,C+C-Q,q[1],q[2])),G=R+R-G,Q=C+C-Q),R=q[1],C=q[2];break;case"t":dt[0]==="Q"||dt[0]==="q"?(G=R+dt[3]-dt[1],Q=C+dt[4]-dt[2],X.push(A.q2b(R,C,G,Q,R+q[1],C+q[2]))):(dt[0]==="T"||dt[0]==="t")&&(X.push(A.q2b(R,C,R+R-G,C+C-Q,R+q[1],C+q[2])),G=R+R-G,Q=C+C-Q),R+=q[1],C+=q[2];break;case"Z":Z=X[0][0],j=X[0][1],X.push([R,C,Z,j,Z,j,Z,j]);break;case"z":Z=X[0][0],j=X[0][1],X.push([R,C,Z,j,Z,j,Z,j]);break;}}return H;},A._upCurves=function(L,D){for(var R=0,C=0,W=L.length;R<D;R++)L.push(L[C].slice(0)),C++,C>W-1&&(C-=W);};function I(L,D,R,C,W,z,H,X,Z){return{left:b(L,D,R,C,W,z,H,X,Z),right:b(H,X,W,z,R,C,L,D,1-Z,!0)};}function b(L,D,R,C,W,z,H,X,Z,j){var G=(R-L)*Z+L,Q=(C-D)*Z+D,tt=(W-R)*Z+R,et=(z-C)*Z+C,at=(H-W)*Z+W,q=(X-z)*Z+z,pt=(tt-G)*Z+G,dt=(et-Q)*Z+Q,B=(at-tt)*Z+tt,F=(q-et)*Z+et,V=(B-pt)*Z+pt,J=(F-dt)*Z+dt;return j?[V,J,pt,dt,G,Q,L,D]:[L,D,G,Q,pt,dt,V,J];}A._splitCurves=function(L,D){for(var R=0,C=0;R<D;R++){var W=L[C],z=I(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],0.5);L.splice(C,1),L.splice(C,0,z.left,z.right),C+=2,C>=L.length-1&&(C=0);}};function E(L,D){for(var R=function R(z){var H=L[L.length-1],X=[];H.forEach(function(Z){X.push(Z.slice(0));}),L.push(X);},C=0;C<D;C++)R();}return A.lerp=function(L,D,R){return A._lerp(A.path2shapes(L),A.path2shapes(D),R);},A.MIM_CURVES_COUNT=100,A._preprocessing=function(L,D){var R=L.length,C=D.length,W=JSON.parse(JSON.stringify(L)),z=JSON.parse(JSON.stringify(D));return R>C?E(z,R-C):R<C&&E(W,C-R),W=d(W,z),W.forEach(function(H,X){var Z=H.length,j=z[X].length;Z>j?Z<A.MIM_CURVES_COUNT?(A._splitCurves(H,A.MIM_CURVES_COUNT-Z),A._splitCurves(z[X],A.MIM_CURVES_COUNT-j)):A._splitCurves(z[X],Z-j):Z<j&&(j<A.MIM_CURVES_COUNT?(A._splitCurves(H,A.MIM_CURVES_COUNT-Z),A._splitCurves(z[X],A.MIM_CURVES_COUNT-j)):A._splitCurves(H,j-Z));}),W.forEach(function(H,X){W[X]=c(H,z[X]);}),[W,z];},A._lerp=function(L,D,R){var C=[];return L.forEach(function(W,z){var H=[];W.forEach(function(X,Z){H.push(A.lerpCurve(X,D[z][Z],R));}),C.push(H);}),C;},A.animate=function(L){var D=A.path2shapes(L.from),R=A.path2shapes(L.to),C=A._preprocessing(D,R),W=/* @__PURE__ */new Date(),z=L.end||function(){},H=L.progress||function(){},X=L.begin||function(){},Z=L.easing||function(et){return et;},j=null,G=null,Q=L.time;X(D);var tt=function et(){var at=/* @__PURE__ */new Date()-W;if(at>=Q){G=R,H(G,1),z(G),cancelAnimationFrame(j);return;}var q=Z(at/Q);G=A._lerp(C[0],C[1],q),H(G,q),j=requestAnimationFrame(et);};tt();},A;});},/* 228 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(71),n=t(221),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute");var f=/*#__PURE__*/function(_e$default3){function f(l){var _this24;_classCallCheck(this,f);_this24=_callSuper(this,f,[l]),_this24[a]({d:"",normalize:!1,fillColor:void 0,fillRule:"nonzero",strokeColor:void 0,lineWidth:1,lineJoin:"miter",// 'miter' or 'bevel' or 'round'
|
|
323
|
+
lineCap:"butt",// 'butt' or 'square' or 'round'
|
|
324
|
+
roundSegments:20,// default roundSegment if lineJoin or lineCap is round
|
|
325
|
+
lineDash:void 0,lineDashOffset:0,miterLimit:10,texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0,clipPath:void 0});return _this24;}_inherits(f,_e$default3);return _createClass(f,[{key:"d",get:function get(){return this[o]("d");},set:function set(l){this[s]("d",l);}},{key:"normalize",get:function get(){return this[o]("normalize");},set:function set(l){this[s]("normalize",!!l);}},{key:"fillColor",get:function get(){return this[o]("fillColor");},set:function set(l){this[s]("fillColor",Object(n.parseColor)(l));}},{key:"fillRule",get:function get(){return this[o]("fillRule");},set:function set(l){if(l!=null&&l!=="nonzero"&&l!=="evenodd")throw new TypeError("Invalid fill rule.");this[s]("fillRule",l);}},{key:"strokeColor",get:function get(){return this[o]("strokeColor");},set:function set(l){this[s]("strokeColor",Object(n.parseColor)(l));}},{key:"lineWidth",get:function get(){return this[o]("lineWidth");},set:function set(l){this[s]("lineWidth",Object(i.toNumber)(l));}},{key:"lineJoin",get:function get(){return this[o]("lineJoin");},set:function set(l){if(l!=null&&l!=="miter"&&l!=="bevel"&&l!=="round")throw new TypeError("Invalid lineJoin type.");this[s]("lineJoin",l);}},{key:"lineCap",get:function get(){return this[o]("lineCap");},set:function set(l){if(l!=null&&l!=="butt"&&l!=="square"&&l!=="round")throw new TypeError("Invalid lineCap type.");this[s]("lineCap",l);}},{key:"lineDash",get:function get(){return this[o]("lineDash");},set:function set(l){l=Object(i.toArray)(l,!0),l!=null&&!Array.isArray(l)&&(l=[l]),this[s]("lineDash",l?l.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[o]("lineDashOffset");},set:function set(l){this[s]("lineDashOffset",Object(i.toNumber)(l));}},{key:"miterLimit",get:function get(){return this[o]("miterLimit");},set:function set(l){this[s]("miterLimit",Object(i.toNumber)(l));}},{key:"roundSegments",get:function get(){return this[o]("roundSegments");},set:function set(l){this[s]("roundSegments",l);}},{key:"texture",get:function get(){return this[o]("texture");},set:function set(l){this[s]("texture",l);}},{key:"textureRect",get:function get(){return this[o]("textureRect");},set:function set(l){this[s]("textureRect",l);}},{key:"sourceRect",get:function get(){return this[o]("sourceRect");},set:function set(l){this[s]("sourceRect",l);}},{key:"textureRepeat",get:function get(){return this[o]("textureRepeat");},set:function set(l){this[s]("textureRepeat",!!l);}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(l){this[s]("clipPath",l);}}]);}(e["default"]);},/* 229 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o;}var s=/*#__PURE__*/function(_e$default4){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_e$default4);return _createClass(s,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,f=_this$attributes15.width,v=_this$attributes15.height;return f>0&&v>0&&_get(_getPrototypeOf(s.prototype),"isVisible",this);}}]);}(e["default"]);a(s,"Attr",i["default"]),n["default"].registerNode(s,"rect");},/* 230 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return v;});var e=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),o=Symbol["for"]("spritejs_declareAlias");function f(l){var p=l.width,y=l.height;return"M0 0L".concat(p," 0L").concat(p," ").concat(y,"L0 ").concat(y,"Z");}var v=/*#__PURE__*/function(_e$default5){function v(p){var _this25;_classCallCheck(this,v);_this25=_callSuper(this,v,[p]),_this25[i]({width:0,height:0/* size */}),_this25[o]("size");return _this25;}// readonly
|
|
326
|
+
_inherits(v,_e$default5);return _createClass(v,[{key:"d",get:function get(){return this[s]("d");},set:function set(p){}// eslint-disable-line no-empty-function
|
|
327
|
+
},{key:"width",get:function get(){return this[s]("width");},set:function set(p){if(p=Object(n.toNumber)(p),this[a]("width",p)){var y=f(this);this[a]("d",y);}}},{key:"height",get:function get(){return this[s]("height");},set:function set(p){if(p=Object(n.toNumber)(p),this[a]("height",p)){var y=f(this);this[a]("d",y);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(p){p=Object(n.toArray)(p),Array.isArray(p)||(p=[p,p]),this.width=p[0],this.height=p[1];}}]);}(e["default"]);},/* 231 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o;}var s=/*#__PURE__*/function(_e$default6){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_e$default6);return _createClass(s,[{key:"isVisible",get:function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_get(_getPrototypeOf(s.prototype),"isVisible",this);}}]);}(e["default"]);a(s,"Attr",i["default"]),n["default"].registerNode(s,"triangle");},/* 232 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o;}var s=/*#__PURE__*/function(_e$default7){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_e$default7);return _createClass(s,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.points;return f.length>0&&_get(_getPrototypeOf(s.prototype),"isVisible",this);}}]);}(e["default"]);a(s,"Attr",i["default"]),n["default"].registerNode(s,"polyline");},/* 233 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function v(p){var y=p.points,O=p.smooth,x=p.smoothRange,m=p.close,T=[];for(var d=0;d<y.length;d+=2)T.push([y[d],y[d+1]]);var c="";return O?c=Object(i.makeSmoothCurveLine)(T,x):T.length&&(c="M".concat(T.map(function(d){return d.join(" ");}).join("L"))),c&&m&&(c+="Z"),c;}var l=/*#__PURE__*/function(_e$default8){function l(y){var _this26;_classCallCheck(this,l);_this26=_callSuper(this,l,[y]),_this26[a]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
|
|
328
|
+
/* close */}),_this26[f]("close");return _this26;}// readonly
|
|
329
|
+
_inherits(l,_e$default8);return _createClass(l,[{key:"d",get:function get(){return this[o]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
330
|
+
},{key:"close",get:function get(){return this.closeType!=="none";},set:function set(y){y=y?"normal":"none",this.closeType=y;}},{key:"closeType",get:function get(){return this[o]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[s]("closeType",y)){var O=v(this);this[s]("d",O);}}},{key:"smooth",get:function get(){return this[o]("smooth");},set:function set(y){if(this[s]("smooth",y)){var O=v(this);this[s]("d",O);}}},{key:"smoothRange",get:function get(){return this[o]("smoothRange");},set:function set(y){if(y&&!Array.isArray(y)&&(y=[y]),this[s]("smoothRange",y)&&this.smooth){var O=v(this);this[s]("d",O);}}},{key:"points",get:function get(){return this[o]("points");},set:function set(y){if(y=Object(n.toArray)(y),Array.isArray(y)&&(y=y.reduce(function(O,x){return Array.isArray(x)?[].concat(_toConsumableArray(O),_toConsumableArray(x.map(function(m){return Object(n.toNumber)(m);}))):[].concat(_toConsumableArray(O),[Object(n.toNumber)(x)]);},[])),this[s]("points",y)){var O=v(this);this[s]("d",O);}}}]);}(e["default"]);},/* 234 */ /***/function(h,r,t){t.r(r),t.d(r,"makeSmoothCurveLine",function(){return e;}),t(1).glMatrix.setMatrixArrayType(Array);function e(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];function a(f){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var l=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var p,y,O,x;if((n[f].x===n[f+1].x||n[f].y===n[f+1].y)&&(v=0,l=0),f<1?(p=n[0].x+(n[1].x-n[0].x)*v,y=n[0].y+(n[1].y-n[0].y)*v):(p=n[f].x+(n[f+1].x-n[f-1].x)*v,y=n[f].y+(n[f+1].y-n[f-1].y)*v),f>n.length-3){var m=n.length-1;O=n[m].x-(n[m].x-n[m-1].x)*l,x=n[m].y-(n[m].y-n[m-1].y)*l;}else O=n[f+1].x-(n[f+2].x-n[f].x)*l,x=n[f+1].y-(n[f+2].y-n[f].y)*l;return[{x:p,y:y},{x:O,y:x}];}n=n.map(function(_ref143){var _ref144=_slicedToArray(_ref143,2),f=_ref144[0],v=_ref144[1];return{x:f,y:v};});var s="",o=0;return n.forEach(function(f,v){if(v===0)s+="M".concat(f.x," ").concat(f.y);else{for(;v>i[o];)o++;if(o%2){var _a3=a(v-1),_a4=_slicedToArray(_a3,2),l=_a4[0],p=_a4[1];s+="C".concat([l.x,l.y,p.x,p.y,f.x,f.y].join(" "));}else s+="L".concat(f.x," ").concat(f.y);}}),s;}},/* 235 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");function o(v){var _v$sides=_slicedToArray(v.sides,2),l=_v$sides[0],p=_v$sides[1];var y=v.angle%360;return y<0&&(y+=360),y=Math.PI*y/180,[0,0,l,0,p*Math.cos(y),p*Math.sin(y)];}var f=/*#__PURE__*/function(_e$default9){function f(l){var _this27;_classCallCheck(this,f);_this27=_callSuper(this,f,[l]),_this27[i]({sides:[0,0],angle:60,closeType:"normal"});return _this27;}// readonly
|
|
331
|
+
_inherits(f,_e$default9);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(l){}// eslint-disable-line no-empty-function
|
|
332
|
+
},{key:"sides",get:function get(){return this[s]("sides");},set:function set(l){if(l=Object(n.toArray)(l,!0),l!=null&&!Array.isArray(l)&&(l=[l,l]),this[a]("sides",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}},{key:"angle",get:function get(){return this[s]("angle");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("angle",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}}]);}(e["default"]);},/* 236 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o;}var s=/*#__PURE__*/function(_e$default10){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_e$default10);return _createClass(s,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_get(_getPrototypeOf(s.prototype),"isVisible",this);}}]);}(e["default"]);a(s,"Attr",i["default"]),n["default"].registerNode(s,"parallel");},/* 237 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");function o(v){var _v$sides2=_slicedToArray(v.sides,2),l=_v$sides2[0],p=_v$sides2[1];var y=v.angle%360;y<0&&(y+=360),y=Math.PI*y/180;var O=p*Math.cos(y),x=p*Math.sin(y);return[0,0,l,0,O+l,x,O,x];}var f=/*#__PURE__*/function(_e$default11){function f(l){var _this28;_classCallCheck(this,f);_this28=_callSuper(this,f,[l]),_this28[i]({sides:[0,0],angle:90,closeType:"normal"});return _this28;}// readonly
|
|
333
|
+
_inherits(f,_e$default11);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(l){}// eslint-disable-line no-empty-function
|
|
334
|
+
},{key:"sides",get:function get(){return this[s]("sides");},set:function set(l){if(l=Object(n.toArray)(l,!0),l!=null&&!Array.isArray(l)&&(l=[l,l]),this[a]("sides",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}},{key:"angle",get:function get(){return this[s]("angle");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("angle",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}}]);}(e["default"]);},/* 238 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o;}var s=/*#__PURE__*/function(_e$default12){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_e$default12);return _createClass(s);}(e["default"]);a(s,"Attr",i["default"]),n["default"].registerNode(s,"regular");},/* 239 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");function o(v){var l=v.edges,p=v.radius,y=v.offsetAngle,O=Math.PI*y/180-0.5*Math.PI;if(l<3||p<=0)return[];var x=[];for(var m=0;m<l;m++){var _T27=m*2*Math.PI/l+O,_c22=p*Math.cos(_T27),d=p*Math.sin(_T27);x.push(_c22,d);}return x;}var f=/*#__PURE__*/function(_e$default13){function f(l){var _this29;_classCallCheck(this,f);_this29=_callSuper(this,f,[l]),_this29[i]({edges:3,radius:0,offsetAngle:0,closeType:"normal"});return _this29;}// readonly
|
|
335
|
+
_inherits(f,_e$default13);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(l){}// eslint-disable-line no-empty-function
|
|
336
|
+
},{key:"edges",get:function get(){return this[s]("edges");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("edges",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}},{key:"radius",get:function get(){return this[s]("radius");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("radius",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}},{key:"offsetAngle",get:function get(){return this[s]("offsetAngle");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("offsetAngle",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}}]);}(e["default"]);},/* 240 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(232),n=t(213),i=t(241);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o;}var s=/*#__PURE__*/function(_e$default14){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_e$default14);return _createClass(s);}(e["default"]);a(s,"Attr",i["default"]),n["default"].registerNode(s,"star");},/* 241 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return f;});var e=t(233),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");function o(v){var l=v.angles,p=v.innerRadius,y=v.outerRadius,O=v.offsetAngle,x=Math.PI*O/180-0.5*Math.PI;if(l<3||p<=0||y<=0)return[];var m=[];for(var _T28=0;_T28<l*2;_T28++){var _c23=_T28*Math.PI/l+x,d=_T28%2?p:y,u=d*Math.cos(_c23),g=d*Math.sin(_c23);m.push(u,g);}return m;}var f=/*#__PURE__*/function(_e$default15){function f(l){var _this30;_classCallCheck(this,f);_this30=_callSuper(this,f,[l]),_this30[i]({angles:5,innerRadius:0,outerRadius:0,/* radius */offsetAngle:0,closeType:"normal"});return _this30;}// readonly
|
|
337
|
+
_inherits(f,_e$default15);return _createClass(f,[{key:"points",get:function get(){return _get(_getPrototypeOf(f.prototype),"points",this);},set:function set(l){}// eslint-disable-line no-empty-function
|
|
338
|
+
},{key:"angles",get:function get(){return this[s]("angles");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("angles",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}},{key:"innerRadius",get:function get(){return this[s]("innerRadius");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("innerRadius",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}},{key:"outerRadius",get:function get(){return this[s]("outerRadius");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("outerRadius",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(l){l=Object(n.toArray)(l,!0),Array.isArray(l)||(l=[l,l]),this.innerRadius=l[0],this.outerRadius=l[1];}},{key:"offsetAngle",get:function get(){return this[s]("offsetAngle");},set:function set(l){if(l=Object(n.toNumber)(l),this[a]("offsetAngle",l)){var p=o(this);_set(_getPrototypeOf(f.prototype),"points",p,this,true);}}}]);}(e["default"]);},/* 242 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(226),n=t(213),i=t(243);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o;}var s=/*#__PURE__*/function(_e$default16){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_e$default16);return _createClass(s,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,f=_this$attributes16.radiusX,v=_this$attributes16.radiusY,l=_this$attributes16.startAngle,p=_this$attributes16.endAngle;return f>0&&v>0&&l!==p&&_get(_getPrototypeOf(s.prototype),"isVisible",this);}}]);}(e["default"]);a(s,"Attr",i["default"]),n["default"].registerNode(s,"ellipse");},/* 243 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function v(p){var y=p.radiusX,O=p.radiusY,x=p.startAngle,m=p.endAngle,T=p.direction,c=p.closeType,d=T==="anitclockwise",u=new e.Figure2D();return c==="sector"&&u.moveTo(0,0),u.ellipse(0,0,y,O,0,Math.PI*x/180,Math.PI*m/180,d),c!=="none"&&u.closePath(),u.path.reduce(function(A,I){return A+I.join(" ");},"");}var l=/*#__PURE__*/function(_n$default2){function l(y){var _this31;_classCallCheck(this,l);_this31=_callSuper(this,l,[y]),_this31[a]({radiusX:0,radiusY:0,/* radius */startAngle:0,endAngle:360,/* angle */direction:"clockwise",// clockwise | anticlockwise
|
|
339
|
+
closeType:"none"// none | sector | normal
|
|
340
|
+
}),_this31[f]("radius","angle");return _this31;}// readonly
|
|
341
|
+
_inherits(l,_n$default2);return _createClass(l,[{key:"d",get:function get(){return this[o]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
342
|
+
},{key:"radiusX",get:function get(){return this[o]("radiusX");},set:function set(y){if(y=Object(i.toNumber)(y),this[s]("radiusX",y)){var O=v(this);this[s]("d",O);}}},{key:"radiusY",get:function get(){return this[o]("radiusY");},set:function set(y){if(y=Object(i.toNumber)(y),this[s]("radiusY",y)){var O=v(this);this[s]("d",O);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.radiusX=y[0],this.radiusY=y[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}},{key:"direction",get:function get(){return this[o]("direction");},set:function set(y){if(y!=null&&y!=="clockwise"&&y!=="anticlockwise")throw new TypeError("Invalid direction type.");this[s]("direction",y);}},{key:"startAngle",get:function get(){return this[o]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[s]("startAngle",y)){var O=v(this);this[s]("d",O);}}},{key:"endAngle",get:function get(){return this[o]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[s]("endAngle",y)){var O=v(this);this[s]("d",O);}}},{key:"closeType",get:function get(){return this[o]("closeType");},set:function set(y){if(y!=null&&y!=="none"&&y!=="sector"&&y!=="normal")throw new TypeError("Invalid closeType type.");if(this[s]("closeType",y)){var O=v(this);this[s]("d",O);}}}]);}(n["default"]);},/* 244 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o;}var s=/*#__PURE__*/function(_e$default17){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_e$default17);return _createClass(s);}(e["default"]);a(s,"Attr",i["default"]),n["default"].registerNode(s,"arc");},/* 245 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return i;});var e=t(243),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(_e$default18){function i(){_classCallCheck(this,i);return _callSuper(this,i,arguments);}_inherits(i,_e$default18);return _createClass(i,[{key:"radius",get:function get(){return _get(_getPrototypeOf(i.prototype),"radiusX",this);},set:function set(s){s=Object(n.toNumber)(s),_set(_getPrototypeOf(i.prototype),"radiusX",s,this,true),_set(_getPrototypeOf(i.prototype),"radiusY",s,this,true);}}]);}(e["default"]);},/* 246 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function a(o,f,v){return f in o?Object.defineProperty(o,f,{value:v,enumerable:!0,configurable:!0,writable:!0}):o[f]=v,o;}var s=/*#__PURE__*/function(_e$default19){function s(){_classCallCheck(this,s);return _callSuper(this,s,arguments);}_inherits(s,_e$default19);return _createClass(s,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,f=_this$attributes17.innerRadius,v=_this$attributes17.outerRadius,l=_this$attributes17.startAngle,p=_this$attributes17.endAngle;return(f>0||v>0)&&l!==p&&_get(_getPrototypeOf(s.prototype),"isVisible",this);}}]);}(e["default"]);a(s,"Attr",i["default"]),n["default"].registerNode(s,"ring");},/* 247 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function v(p){var _ref145;var y=p.innerRadius,O=p.outerRadius,x=p.startAngle,m=p.endAngle;var T=new e.Figure2D();if(x=Math.PI*x/180,m=Math.PI*m/180,y>O&&(_ref145=[O,y],y=_ref145[0],O=_ref145[1],_ref145),y<=0&&T.moveTo(0,0),T.arc(0,0,O,x,m,!1),y>0){var u=Math.PI*2;m<x&&(m=x+u+(m-x)%u),m-x>=u&&(m=x+u-1e-6),T.arc(0,0,y,m,x,!0);}return T.closePath(),T.path.reduce(function(u,g){return u+g.join(" ");},"");}var l=/*#__PURE__*/function(_n$default3){function l(y){var _this32;_classCallCheck(this,l);_this32=_callSuper(this,l,[y]),_this32[a]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this32[f]("radius","angle");return _this32;}// readonly
|
|
343
|
+
_inherits(l,_n$default3);return _createClass(l,[{key:"d",get:function get(){return this[o]("d");},set:function set(y){}// eslint-disable-line no-empty-function
|
|
344
|
+
},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[s]("innerRadius",y)){var O=v(this);this[s]("d",O);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(y){if(y=Object(i.toNumber)(y),this[s]("outerRadius",y)){var O=v(this);this[s]("d",O);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(y){y=Object(i.toArray)(y,!0),Array.isArray(y)||(y=[y,y]),this.innerRadius=y[0],this.outerRadius=y[1];}},{key:"startAngle",get:function get(){return this[o]("startAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[s]("startAngle",y)){var O=v(this);this[s]("d",O);}}},{key:"endAngle",get:function get(){return this[o]("endAngle");},set:function set(y){if(y=Object(i.toNumber)(y),this[s]("endAngle",y)){var O=v(this);this[s]("d",O);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(y){y=Object(i.toArray)(y),Array.isArray(y)||(y=[y,y]),this.startAngle=y[0],this.endAngle=y[1];}}]);}(n["default"]);},/* 248 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return O;});var e=t(12),n=t(218),i=t(219),a=t(249),s=t(213);t(1).glMatrix.setMatrixArrayType(Array);function o(x,m,T){return m in x?Object.defineProperty(x,m,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[m]=T,x;}var f=Symbol("textImage"),v=Symbol("textImageTask"),l=Symbol("textureContext"),p=Symbol("updateTextureRect"),y=Symbol("textCanvas");var O=/*#__PURE__*/function(_i$default3){function O(){var _this33;var m=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,O);typeof m=="string"&&(m={text:m}),_this33=_callSuper(this,O,[m]);return _this33;}/* override */_inherits(O,_i$default3);return _createClass(O,[{key:"contentSize",get:function get(){var _get4=_get(_getPrototypeOf(O.prototype),"contentSize",this),_get5=_slicedToArray(_get4,2),m=_get5[0],T=_get5[1];var _this$attributes18=this.attributes,c=_this$attributes18.width,d=_this$attributes18.height;if(c==null||d==null){var u=this[f];u&&(c==null&&(m=u.rect[2]),d==null&&(T=u.rect[3]));}return[m,T];}},{key:"text",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textContent",get:function get(){return this.attributes.text;},set:function set(m){this.attributes.text=m;}},{key:"textImage",get:function get(){return this[f]||{};}},{key:"textImageReady",get:function get(){return this[v]||Promise.resolve();}/* override */},{key:"draw",value:function draw(m){_get(_getPrototypeOf(O.prototype),"draw",this).call(this,m);var T=this.mesh;if(T){var _c24=this[f];if(_c24){var d=T.texture;if(!d||this[l]&&this[l]!==this.renderer||_c24.needsUpdate?(_c24.needsUpdate=!1,Object(n.deleteTexture)(_c24.image,this.renderer),d=Object(n.createTexture)(_c24.image,this.renderer),this[p]=!0):d=T.uniforms.u_texSampler,this[p]){var _c24$rect$slice=_c24.rect.slice(2),_c24$rect$slice2=_slicedToArray(_c24$rect$slice,2),u=_c24$rect$slice2[0],g=_c24$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),M=_this$contentSize4[0],A=_this$contentSize4[1],I=this.attributes.textAlign,b=this.attributes.verticalAlign;var E=0;I==="center"?E=(M-u)/2:(I==="right"||I==="end")&&(E=M-u);var L=this.attributes.fontSize,D=this.attributes.lineHeight;var R=0;b==="top"?R=(L-D)/2:b==="bottom"&&(R=(D-L)/2);var _this$attributes19=this.attributes,C=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,z=this.attributes.borderWidth;E+=C+z,R+=W+z;var _this$attributes20=this.attributes,H=_this$attributes20.anchorX,X=_this$attributes20.anchorY;E-=this.offsetSize[0]*H,R-=this.offsetSize[1]*X,T.setTexture(d,{rect:[E,R,u,g]}),this[p]=!1,this[l]=this.renderer;}}}return m;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,T,c){m==="text"||m==="fontSize"||m==="fontFamily"||m==="fontStyle"||m==="fontVariant"||m==="fontWeight"||m==="fontStretch"||m==="lineHeight"||m==="strokeColor"||m==="fillColor"||m==="strokeWidth"?this.updateText():((m==="textAlign"||m==="verticalAlign")&&(this[p]=!0),_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,m,T,c));}/* override */},{key:"updateContours",value:function updateContours(){_get(_getPrototypeOf(O.prototype),"updateContours",this).call(this),this[p]=!0;}},{key:"updateText",value:function updateText(){var _this34=this;this[v]||(this[v]=Promise.resolve().then(function(){_this34[v]=null;var _this34$attributes=_this34.attributes,m=_this34$attributes.text,T=_this34$attributes.font,c=_this34$attributes.fillColor,d=_this34$attributes.strokeColor,u=_this34$attributes.strokeWidth,g=_this34.layer?_this34.layer.displayRatio:1;return _this34[y]=_this34[y]||e.ENV.createCanvas(1,1),_this34[f]=e.ENV.createText(m,{font:T,fillColor:c,strokeColor:d,strokeWidth:u,parseFont:e.parseFont,ratio:g,textCanvas:_this34[y]}),_this34[f].needsUpdate=!0,_this34.updateContours(),_this34.forceUpdate(),_this34[f];}));}}]);}(i["default"]);o(O,"Attr",a["default"]),s["default"].registerNode(O,"label");},/* 249 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return l;});var e=t(12),n=t(72),i=t(221),a=t(220);t(1).glMatrix.setMatrixArrayType(Array);var s=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),v=Symbol["for"]("spritejs_declareAlias");var l=/*#__PURE__*/function(_a$default2){function l(y){var _this35;_classCallCheck(this,l);_this35=_callSuper(this,l,[y]),_this35[s]({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"}),_this35[v]("font");return _this35;}_inherits(l,_a$default2);return _createClass(l,[{key:"text",get:function get(){return this[f]("text")||" ";},set:function set(y){this[o]("text",y);}},{key:"fontSize",get:function get(){return this[f]("fontSize");},set:function set(y){this[o]("fontSize",Object(n.toNumber)(y));}},{key:"fontFamily",get:function get(){return this[f]("fontFamily");},set:function set(y){this[o]("fontFamily",y);}},{key:"fontStyle",get:function get(){return this[f]("fontStyle");},set:function set(y){this[o]("fontStyle",y);}},{key:"fontVariant",get:function get(){return this[f]("fontVariant");},set:function set(y){this[o]("fontVariant",y);}},{key:"fontWeight",get:function get(){return this[f]("fontWeight");},set:function set(y){this[o]("fontWeight",y);}},{key:"fontStretch",get:function get(){return this[f]("fontStretch");},set:function set(y){this[o]("fontStretch",y);}},{key:"lineHeight",get:function get(){return this[f]("lineHeight")||this.fontSize;},set:function set(y){this[o]("lineHeight",Object(n.toNumber)(y));}},{key:"textAlign",get:function get(){return this[f]("textAlign");},set:function set(y){this[o]("textAlign",y);}},{key:"strokeColor",get:function get(){return this[f]("strokeColor");},set:function set(y){this[o]("strokeColor",Object(i.parseColor)(y));}},{key:"strokeWidth",get:function get(){return this[f]("strokeWidth");},set:function set(y){this[o]("strokeWidth",Object(n.toNumber)(y));}},{key:"verticalAlign",get:function get(){return this[f]("verticalAlign");},set:function set(y){this[o]("verticalAlign",y);}},{key:"fillColor",get:function get(){return this[f]("fillColor");},set:function set(y){this[o]("fillColor",Object(i.parseColor)(y));}},{key:"font",get:function get(){var y=this.fontStyle,O=this.fontVariant,x=this.fontWeight,m=this.fontStretch,T=this.fontSize,c=this.lineHeight,d=this.fontFamily;return"".concat(y," ").concat(O," ").concat(x," ").concat(m," ").concat(T,"px/").concat(c,"px ").concat(d);},set:function set(y){if(y==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var O=Object(e.parseFont)(y);this.fontStyle=O.style,this.fontVariant=O.variant,this.fontWeight=O.weight,this.fontStretch=O.stretch,this.fontSize=Object(n.toNumber)("".concat(O.size).concat(O.unit)),O.lineHeight&&(this.lineHeight=O.pxLineHeight),this.fontFamily=O.family;}}}]);}(a["default"]);},/* 250 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return y;});var e=t(12),n=t(219),i=t(251),a=t(213),s=t(252);t(1).glMatrix.setMatrixArrayType(Array);function o(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O;}var f=Symbol("zOrder"),v=Symbol("ordered"),l=Symbol("children"),p=Symbol("sealed");var y=/*#__PURE__*/function(_n$default4){function y(){var _this36;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,y);_this36=_callSuper(this,y,[x]),_this36[l]=[],_this36[v]=null,_this36[f]=0;return _this36;}_inherits(y,_n$default4);return _createClass(y,[{key:"childNodes",get:function get(){return this[l];}},{key:"children",get:function get(){return this[l];}},{key:"orderedChildren",get:function get(){return this[v]||(this[v]=_toConsumableArray(this[l]),this[v].sort(function(x,m){return x.zIndex-m.zIndex||x.zOrder-m.zOrder;})),this[v];}},{key:"append",value:function append(){var _this37=this;for(var _len12=arguments.length,x=new Array(_len12),_key12=0;_key12<_len12;_key12++){x[_key12]=arguments[_key12];}return x.map(function(m){return _this37.appendChild(m);});}},{key:"appendChild",value:function appendChild(x){return x.remove(),this[l].push(x),x.connect(this,this[f]++),this[v]&&(this[v].length&&x.zIndex<this[v][this[v].length-1].zIndex?this.reorder():this[v].push(x)),x;}/* override */ // get isVisible() {
|
|
345
|
+
// return this.attributes.opacity > 0 && this[_children].length > 0;
|
|
346
|
+
// }
|
|
347
|
+
/* override */},{key:"cloneNode",value:function cloneNode(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var m=_get(_getPrototypeOf(y.prototype),"cloneNode",this).call(this);return x&&this[l].forEach(function(T){var c=T.cloneNode(x);m.appendChild(c);}),m;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(x){var m=this.orderedChildren;for(var _T29=m.length-1;_T29>=0;_T29--)if(m[_T29].dispatchPointerEvent(x))return!0;return _get(_getPrototypeOf(y.prototype),"dispatchPointerEvent",this).call(this,x);}/* override */},{key:"draw",value:function draw(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(this.__cacheRenderMatrix=this.renderMatrix,_get(_getPrototypeOf(y.prototype),"draw",this).call(this,x),!this[p]&&this.attributes.display!=="none"){var m=this.orderedChildren;for(var _T30=0;_T30<m.length;_T30++)m[_T30].draw(x);}return this.__cacheRenderMatrix=null,x;}},{key:"getElementById",value:function getElementById(x){return Object(s.querySelector)("#".concat(x),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(x){return Object(s.querySelectorAll)(".".concat(x),this);}},{key:"getElementsByName",value:function getElementsByName(x){return Object(s.querySelectorAll)("[name=\"".concat(x,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(x){return Object(s.querySelectorAll)(x,this);}},{key:"insertBefore",value:function insertBefore(x,m){if(m==null)return this.appendChild(x);x.remove();var T=this[l].indexOf(m);if(T<0)throw new Error("Invalid reference node.");var c=m.zOrder;for(var d=T;d<this[l].length;d++){var u=this[l][d].zOrder,g=this[l][d];delete g.zOrder,Object.defineProperty(g,"zOrder",{value:u+1,writable:!1,configurable:!0});}if(this[l].splice(T,0,x),x.connect(this,c),this[v])if(x.zIndex!==m.zIndex)this.reorder();else{var _d7=this[v].indexOf(m);this[v].splice(_d7,0,x);}return x;}},{key:"querySelector",value:function querySelector(x){return Object(s.querySelector)(x,this);}},{key:"querySelectorAll",value:function querySelectorAll(x){return Object(s.querySelectorAll)(x,this);}},{key:"replaceChild",value:function replaceChild(x,m){x.remove();var T=this[l].indexOf(m);if(T<0)throw new Error("Invalid reference node.");if(this[l][T]=x,x.connect(this,m.zOrder),this[v])if(x.zIndex!==m.zIndex)this.reorder();else{var _c25=this[v].indexOf(m);this[v][_c25]=x;}return m.disconnect(this),x;}},{key:"removeAllChildren",value:function removeAllChildren(){var x=this[l];for(var m=x.length-1;m>=0;m--)x[m].remove();}},{key:"removeChild",value:function removeChild(x){var m=this[l].indexOf(x);if(m>=0){if(this[l].splice(m,1),this[v]){var _T31=this[v].indexOf(x);this[v].splice(_T31,1);}return x.disconnect(this),x;}return null;}},{key:"reorder",value:function reorder(){this[v]=null;}},{key:"seal",value:function seal(){function x(d,u){var g=[];for(var M=0;M<d.length;M++){var A=_toConsumableArray(d[M]);for(var I=1;I<A.length;I+=2){var b=A[I],E=A[I+1];A[I]=b*u[0]+E*u[2]+u[4],A[I+1]=b*u[1]+E*u[3]+u[5];}g.push(A);}return g;}var m=this.orderedChildren,T=new e.Figure2D(),c=this.localMatrix;for(var d=0;d<m.length;d++){var u=m[d];if(u instanceof y&&(u=u.seal()),u.clientBox){var g=u.clientBox.contours.path;g=x(g,u.localMatrix),T.addPath(g);}if(u.path){var _g6=u.path.contours.path;_g6=x(_g6,u.localMatrix),T.addPath(_g6);}}return this[p]=!0,this.clientBox=T,{clientBox:T,localMatrix:c};}/* override */},{key:"setResolution",value:function setResolution(_ref146){var x=_ref146.width,m=_ref146.height;_get(_getPrototypeOf(y.prototype),"setResolution",this).call(this,{width:x,height:m}),this[l].forEach(function(T){T.setResolution({width:x,height:m});});}/* override */},{key:"updateContours",value:function updateContours(){this[p]||_get(_getPrototypeOf(y.prototype),"updateContours",this).call(this);}}]);}(n["default"]);o(y,"Attr",i["default"]),a["default"].registerNode(y,"group");},/* 251 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(220);t(1).glMatrix.setMatrixArrayType(Array);var n=/*#__PURE__*/function(_e$default20){function n(){_classCallCheck(this,n);return _callSuper(this,n,arguments);}_inherits(n,_e$default20);return _createClass(n);}(e["default"]);},/* 252 */ /***/function(h,r,t){t.r(r),t.d(r,"querySelectorAll",function(){return p;}),t.d(r,"querySelector",function(){return y;}),t.d(r,"isMatched",function(){return O;}),t.d(r,"compile",function(){return x;});var e=t(221),n=t(213);t(1).glMatrix.setMatrixArrayType(Array);var i=t(253);function a(m){return m.nodeType===1||n["default"].isSpriteNode(m.nodeName);}function s(m){return Array.from(m.childNodes||[]);}function o(m){return n["default"].isSpriteNode(m.nodeName)?m.parent||m.canvas||m.container:m.parentElement;}function f(m){var T=m.length,c,d,u;for(;--T>-1;){for(c=d=m[T],m[T]=null,u=!0;d;){if(m.indexOf(d)>-1){u=!1,m.splice(T,1);break;}d=o(d);}u&&(m[T]=c);}return m;}var v={isTag:a,existsOne:function existsOne(m,T){return T.some(function(c){return a(c)?m(c)||v.existsOne(m,s(c)):!1;});},getSiblings:function getSiblings(m){var T=o(m);return T&&s(T);},getChildren:s,getParent:o,getAttributeValue:function getAttributeValue(m,T){if(m.nodeType===1&&T==="class"||T==="id")return m[T];if(this.hasAttrib(m,T)){var _c26=m.attributes[T];return Array.isArray(_c26)&&(_c26="[".concat(_c26.join(),"]")),String(_c26);}},hasAttrib:function hasAttrib(m,T){return m.attributes[T]!=null;},removeSubsets:f,getName:function getName(m){return m.tagName?m.tagName.toLowerCase():null;},findOne:function m(T,c){var d=null;for(var u=0,g=c.length;u<g&&!d;u++)if(T(c[u]))d=c[u];else{var M=s(c[u]);M&&M.length>0&&(d=m(T,M));}return d;},findAll:function m(T,c){var d=[];for(var u=0,g=c.length;u<g;u++){if(!a(c[u]))continue;T(c[u])&&d.push(c[u]);var M=s(c[u]);M&&(d=d.concat(m(T,M)));}return d;},getText:function m(T){return Array.isArray(T)?T.map(m).join(""):a(T)?m(s(T)):T.nodeType===3?T.nodeValue:n["default"].isSpriteNode(T.nodeName)?T.text:"";}};function l(m){if(typeof m!="string")return m;var T=m.match(/\[(bgcolor|fillColor|strokeColor|color)\s*=\s*['"]?\w+['"]?\]/g);return T&&(T=T.map(function(c){var d=c.slice(1,-1).split("="),u=Object(e.parseColor)(d[1].replace(/['"]/g,""));return[c,"[".concat(d[0],"=\"").concat(u,"\"]")];}),T.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),c=_ref148[0],d=_ref148[1];m=m.replace(c,d);})),T=m.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),T&&(T=T.map(function(c){var d=c.slice(1,-1).split("="),u=d[1].slice(2,-2).split(/,/g).map(function(g){return g.trim();});return[c,"[".concat(d[0],"=\"[").concat(u,"]\"]")];}),T.forEach(function(_ref149){var _ref150=_slicedToArray(_ref149,2),c=_ref150[0],d=_ref150[1];m=m.replace(c,d);})),m;}function p(m,T){return i.selectAll(l(m),T,{adapter:v});}function y(m,T){return i.selectOne(l(m),T,{adapter:v});}function O(m,T){return i.is(m,l(T),{adapter:v});}function x(m){return i.compile(l(m),{adapter:v});}},/* 253 */ /***/function(h,r,t){h.exports=x;var e=t(254),n=t(273).falseFunc,i=t(274);function a(m){return function(c,d,u){return d=d||{},d.adapter=d.adapter||e,m(c,d,u);};}var s=a(i),o=a(i.compileUnsafe);function f(m){return function(c,d,u){return u=u||{},u.adapter=u.adapter||e,typeof c!="function"&&(c=o(c,u,d)),c.shouldTestNextSiblings&&(d=l(u&&u.context||d,u.adapter)),Array.isArray(d)?d=u.adapter.removeSubsets(d):d=u.adapter.getChildren(d),m(c,d,u);};}function v(m,T){var c=T.getSiblings(m);if(!Array.isArray(c))return[];for(c=c.slice(0);c.shift()!==m;);return c;}function l(m,T){Array.isArray(m)||(m=[m]);for(var c=m.slice(0),d=0,u=m.length;d<u;d++){var g=v(c[d],T);c.push.apply(c,g);}return c;}var p=f(function(T,c,d){return T===n||!c||c.length===0?[]:d.adapter.findAll(T,c);}),y=f(function(T,c,d){return T===n||!c||c.length===0?null:d.adapter.findOne(T,c);});function O(m,T,c){return c=c||{},c.adapter=c.adapter||e,(typeof T=="function"?T:s(T,c))(m);}function x(m,T,c){return p(m,T,c);}x.compile=s,x.filters=i.Pseudos.filters,x.pseudos=i.Pseudos.pseudos,x.selectAll=p,x.selectOne=y,x.is=O,x.parse=s,x.iterate=p,x._compileUnsafe=o,x._compileToken=i.compileToken;},/* 254 */ /***/function(h,r,t){var e=h.exports;[t(255),t(268),t(269),t(270),t(271),t(272)].forEach(function(n){Object.keys(n).forEach(function(i){e[i]=n[i].bind(e);});});},/* 255 */ /***/function(h,r,t){var e=t(256),n=t(257),i=e.isTag;h.exports={getInnerHTML:a,getOuterHTML:n,getText:s};function a(o,f){return o.children?o.children.map(function(v){return n(v,f);}).join(""):"";}function s(o){return Array.isArray(o)?o.map(s).join(""):i(o)?o.name==="br"?"\n":s(o.children):o.type===e.CDATA?s(o.children):o.type===e.Text?o.data:"";}},/* 256 */ /***/function(h,r){h.exports={Text:"text",//Text
|
|
348
|
+
Directive:"directive",//<? ... ?>
|
|
349
|
+
Comment:"comment",//<!-- ... -->
|
|
350
|
+
Script:"script",//<script> tags
|
|
351
|
+
Style:"style",//<style> tags
|
|
352
|
+
Tag:"tag",//Any tag
|
|
353
|
+
CDATA:"cdata",//<![CDATA[ ... ]]>
|
|
354
|
+
Doctype:"doctype",isTag:function isTag(t){return t.type==="tag"||t.type==="script"||t.type==="style";}};},/* 257 */ /***/function(h,r,t){var e=t(258),n=t(259),i=t(267);i.elementNames.__proto__=null,i.attributeNames.__proto__=null;var a={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};function s(m,T){if(m){var c="",d;for(var u in m)d=m[u],c&&(c+=" "),T.xmlMode==="foreign"&&(u=i.attributeNames[u]||u),c+=u,(d!==null&&d!==""||T.xmlMode)&&(c+='="'+(T.decodeEntities?n.encodeXML(d):d.replace(/\"/g,"""))+'"');return c;}}var o={__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},f=h.exports=function(m,T){!Array.isArray(m)&&!m.cheerio&&(m=[m]),T=T||{};for(var c="",d=0;d<m.length;d++){var u=m[d];u.type==="root"?c+=f(u.children,T):e.isTag(u)?c+=l(u,T):u.type===e.Directive?c+=p(u):u.type===e.Comment?c+=x(u):u.type===e.CDATA?c+=O(u):c+=y(u,T);}return c;},v=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function l(m,T){T.xmlMode==="foreign"&&(m.name=i.elementNames[m.name]||m.name,m.parent&&v.indexOf(m.parent.name)>=0&&(T=Object.assign({},T,{xmlMode:!1}))),!T.xmlMode&&["svg","math"].indexOf(m.name)>=0&&(T=Object.assign({},T,{xmlMode:"foreign"}));var c="<"+m.name,d=s(m.attribs,T);return d&&(c+=" "+d),T.xmlMode&&(!m.children||m.children.length===0)?c+="/>":(c+=">",m.children&&(c+=f(m.children,T)),(!o[m.name]||T.xmlMode)&&(c+="</"+m.name+">")),c;}function p(m){return"<"+m.data+">";}function y(m,T){var c=m.data||"";return T.decodeEntities&&!(m.parent&&m.parent.name in a)&&(c=n.encodeXML(c)),c;}function O(m){return"<![CDATA["+m.children[0].data+"]]>";}function x(m){return"<!--"+m.data+"-->";}},/* 258 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});function e(n){return n.type==="tag"||n.type==="script"||n.type==="style";}r.isTag=e,r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype";},/* 259 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decodeStrict=r.decode=void 0;var e=t(260),n=t(266);function i(v,l){return(!l||l<=0?e.decodeXML:e.decodeHTML)(v);}r.decode=i;function a(v,l){return(!l||l<=0?e.decodeXML:e.decodeHTMLStrict)(v);}r.decodeStrict=a;function s(v,l){return(!l||l<=0?n.encodeXML:n.encodeHTML)(v);}r.encode=s;var o=t(266);Object.defineProperty(r,"encodeXML",{enumerable:!0,get:function get(){return o.encodeXML;}}),Object.defineProperty(r,"encodeHTML",{enumerable:!0,get:function get(){return o.encodeHTML;}}),Object.defineProperty(r,"escape",{enumerable:!0,get:function get(){return o.escape;}}),Object.defineProperty(r,"encodeHTML4",{enumerable:!0,get:function get(){return o.encodeHTML;}}),Object.defineProperty(r,"encodeHTML5",{enumerable:!0,get:function get(){return o.encodeHTML;}});var f=t(260);Object.defineProperty(r,"decodeXML",{enumerable:!0,get:function get(){return f.decodeXML;}}),Object.defineProperty(r,"decodeHTML",{enumerable:!0,get:function get(){return f.decodeHTML;}}),Object.defineProperty(r,"decodeHTMLStrict",{enumerable:!0,get:function get(){return f.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML4",{enumerable:!0,get:function get(){return f.decodeHTML;}}),Object.defineProperty(r,"decodeHTML5",{enumerable:!0,get:function get(){return f.decodeHTML;}}),Object.defineProperty(r,"decodeHTML4Strict",{enumerable:!0,get:function get(){return f.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeHTML5Strict",{enumerable:!0,get:function get(){return f.decodeHTMLStrict;}}),Object.defineProperty(r,"decodeXMLStrict",{enumerable:!0,get:function get(){return f.decodeXML;}});},/* 260 */ /***/function(h,r,t){var e=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{"default":l};};Object.defineProperty(r,"__esModule",{value:!0}),r.decodeHTML=r.decodeHTMLStrict=r.decodeXML=void 0;var n=e(t(261)),i=e(t(262)),a=e(t(263)),s=e(t(264));r.decodeXML=o(a["default"]),r.decodeHTMLStrict=o(n["default"]);function o(l){var p=Object.keys(l).join("|"),y=v(l);p+="|#[xX][\\da-fA-F]+|#\\d+";var O=new RegExp("&(?:"+p+");","g");return function(x){return String(x).replace(O,y);};}var f=function f(l,p){return l<p?1:-1;};r.decodeHTML=function(){for(var l=Object.keys(i["default"]).sort(f),p=Object.keys(n["default"]).sort(f),y=0,O=0;y<p.length;y++)l[O]===p[y]?(p[y]+=";?",O++):p[y]+=";";var x=new RegExp("&(?:"+p.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),m=v(n["default"]);function T(c){return c.substr(-1)!==";"&&(c+=";"),m(c);}return function(c){return String(c).replace(x,T);};}();function v(l){return function(y){if(y.charAt(1)==="#"){var O=y.charAt(2);return O==="X"||O==="x"?s["default"](parseInt(y.substr(3),16)):s["default"](parseInt(y.substr(2),10));}return l[y.slice(1,-1)];};}},/* 261 */ /***/function(h){h.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(h){h.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(h){h.exports=JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}");},/* 264 */ /***/function(h,r,t){var e=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{"default":a};};Object.defineProperty(r,"__esModule",{value:!0});var n=e(t(265));function i(a){if(a>=55296&&a<=57343||a>1114111)return"�";a in n["default"]&&(a=n["default"][a]);var s="";return a>65535&&(a-=65536,s+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),s+=String.fromCharCode(a),s;}r["default"]=i;},/* 265 */ /***/function(h){h.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(h,r,t){var e=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{"default":T};};Object.defineProperty(r,"__esModule",{value:!0}),r.escape=r.encodeHTML=r.encodeXML=void 0;var n=e(t(263)),i=v(n["default"]),a=l(i);r.encodeXML=O(i,a);var s=e(t(261)),o=v(s["default"]),f=l(o);r.encodeHTML=O(o,f);function v(T){return Object.keys(T).sort().reduce(function(c,d){return c[T[d]]="&"+d+";",c;},{});}function l(T){for(var c=[],d=[],u=0,g=Object.keys(T);u<g.length;u++){var M=g[u];M.length===1?c.push("\\"+M):d.push(M);}c.sort();for(var A=0;A<c.length-1;A++){for(var I=A;I<c.length-1&&c[I].charCodeAt(1)+1===c[I+1].charCodeAt(1);)I+=1;var b=1+I-A;b<3||c.splice(A,b,c[A]+"-"+c[I]);}return d.unshift("["+c.join("")+"]"),new RegExp(d.join("|"),"g");}var p=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function y(T){return"&#x"+T.codePointAt(0).toString(16).toUpperCase()+";";}function O(T,c){return function(d){return d.replace(c,function(u){return T[u];}).replace(p,y);};}var x=l(i);function m(T){return T.replace(x,y).replace(p,y);}r.escape=m;},/* 267 */ /***/function(h){h.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(h,r){var t=r.getChildren=function(n){return n.children;},e=r.getParent=function(n){return n.parent;};r.getSiblings=function(n){var i=e(n);return i?t(i):[n];},r.getAttributeValue=function(n,i){return n.attribs&&n.attribs[i];},r.hasAttrib=function(n,i){return!!n.attribs&&hasOwnProperty.call(n.attribs,i);},r.getName=function(n){return n.name;};},/* 269 */ /***/function(h,r){r.removeElement=function(t){if(t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t.parent){var e=t.parent.children;e.splice(e.lastIndexOf(t),1);}},r.replaceElement=function(t,e){var n=e.prev=t.prev;n&&(n.next=e);var i=e.next=t.next;i&&(i.prev=e);var a=e.parent=t.parent;if(a){var s=a.children;s[s.lastIndexOf(t)]=e;}},r.appendChild=function(t,e){if(e.parent=t,t.children.push(e)!==1){var n=t.children[t.children.length-2];n.next=e,e.prev=n,e.next=null;}},r.append=function(t,e){var n=t.parent,i=t.next;if(e.next=i,e.prev=t,t.next=e,e.parent=n,i){if(i.prev=e,n){var a=n.children;a.splice(a.lastIndexOf(i),0,e);}}else n&&n.children.push(e);},r.prepend=function(t,e){var n=t.parent;if(n){var i=n.children;i.splice(i.lastIndexOf(t),0,e);}t.prev&&(t.prev.next=e),e.parent=n,e.prev=t.prev,e.next=t,t.prev=e;};},/* 270 */ /***/function(h,r,t){var e=t(256).isTag;h.exports={filter:n,find:i,findOneChild:a,findOne:s,existsOne:o,findAll:f};function n(v,l,p,y){return Array.isArray(l)||(l=[l]),(typeof y!="number"||!isFinite(y))&&(y=1/0),i(v,l,p!==!1,y);}function i(v,l,p,y){for(var O=[],x,m=0,T=l.length;m<T&&!(v(l[m])&&(O.push(l[m]),--y<=0)||(x=l[m].children,p&&x&&x.length>0&&(x=i(v,x,p,y),O=O.concat(x),y-=x.length,y<=0)));m++);return O;}function a(v,l){for(var p=0,y=l.length;p<y;p++)if(v(l[p]))return l[p];return null;}function s(v,l){for(var p=null,y=0,O=l.length;y<O&&!p;y++)if(e(l[y]))v(l[y])?p=l[y]:l[y].children.length>0&&(p=s(v,l[y].children));else continue;return p;}function o(v,l){for(var p=0,y=l.length;p<y;p++)if(e(l[p])&&(v(l[p])||l[p].children.length>0&&o(v,l[p].children)))return!0;return!1;}function f(v,l){for(var p=[],y=l.slice();y.length;){var O=y.shift();e(O)&&(O.children&&O.children.length>0&&y.unshift.apply(y,O.children),v(O)&&p.push(O));}return p;}},/* 271 */ /***/function(h,r,t){var e=t(256),n=r.isTag=e.isTag;r.testElement=function(o,f){for(var v in o)if(o.hasOwnProperty(v)){if(v==="tag_name"){if(!n(f)||!o.tag_name(f.name))return!1;}else if(v==="tag_type"){if(!o.tag_type(f.type))return!1;}else if(v==="tag_contains"){if(n(f)||!o.tag_contains(f.data))return!1;}else if(!f.attribs||!o[v](f.attribs[v]))return!1;}return!0;};var i={tag_name:function tag_name(o){return typeof o=="function"?function(f){return n(f)&&o(f.name);}:o==="*"?n:function(f){return n(f)&&f.name===o;};},tag_type:function tag_type(o){return typeof o=="function"?function(f){return o(f.type);}:function(f){return f.type===o;};},tag_contains:function tag_contains(o){return typeof o=="function"?function(f){return!n(f)&&o(f.data);}:function(f){return!n(f)&&f.data===o;};}};function a(o,f){return typeof f=="function"?function(v){return v.attribs&&f(v.attribs[o]);}:function(v){return v.attribs&&v.attribs[o]===f;};}function s(o,f){return function(v){return o(v)||f(v);};}r.getElements=function(o,f,v,l){var p=Object.keys(o).map(function(y){var O=o[y];return y in i?i[y](O):a(y,O);});return p.length===0?[]:this.filter(p.reduce(s),f,v,l);},r.getElementById=function(o,f,v){return Array.isArray(f)||(f=[f]),this.findOne(a("id",o),f,v!==!1);},r.getElementsByTagName=function(o,f,v,l){return this.filter(i.tag_name(o),f,v,l);},r.getElementsByTagType=function(o,f,v,l){return this.filter(i.tag_type(o),f,v,l);};},/* 272 */ /***/function(h,r){r.removeSubsets=function(n){for(var i=n.length,a,s,o;--i>-1;){for(a=s=n[i],n[i]=null,o=!0;s;){if(n.indexOf(s)>-1){o=!1,n.splice(i,1);break;}s=s.parent;}o&&(n[i]=a);}return n;};var t={DISCONNECTED:1,PRECEDING:2,FOLLOWING:4,CONTAINS:8,CONTAINED_BY:16},e=r.compareDocumentPosition=function(n,i){var a=[],s=[],o,f,v,l,p,y;if(n===i)return 0;for(o=n;o;)a.unshift(o),o=o.parent;for(o=i;o;)s.unshift(o),o=o.parent;for(y=0;a[y]===s[y];)y++;return y===0?t.DISCONNECTED:(f=a[y-1],v=f.children,l=a[y],p=s[y],v.indexOf(l)>v.indexOf(p)?f===i?t.FOLLOWING|t.CONTAINED_BY:t.FOLLOWING:f===n?t.PRECEDING|t.CONTAINS:t.PRECEDING);};r.uniqueSort=function(n){var i=n.length,a,s;for(n=n.slice();--i>-1;)a=n[i],s=n.indexOf(a),s>-1&&s<i&&n.splice(i,1);return n.sort(function(o,f){var v=e(o,f);return v&t.PRECEDING?-1:v&t.FOLLOWING?1:0;}),n;};},/* 273 */ /***/function(h,r){h.exports={trueFunc:function trueFunc(){return!0;},falseFunc:function falseFunc(){return!1;}};},/* 274 */ /***/function(h,r,t){h.exports=p;var e=t(275).parse,n=t(273),i=t(278),a=t(279),s=t(280),o=t(282),f=n.trueFunc,v=n.falseFunc,l=o.filters;function p(E,L,D){var R=O(E,L,D);return y(R,L);}function y(E,L){var D=L.adapter;return function(C){return D.isTag(C)&&E(C);};}function O(E,L,D){var R=e(E,L);return g(R,L,D);}function x(E){return E.type==="pseudo"&&(E.name==="scope"||Array.isArray(E.data)&&E.data.some(function(L){return L.some(x);}));}var m={type:"descendant"},T={type:"_flexibleDescendant"},c={type:"pseudo",name:"scope"},d={};function u(E,L,D){var R=L.adapter,C=!!D&&!!D.length&&D.every(function(W){return W===d||!!R.getParent(W);});E.forEach(function(W){if(!(W.length>0&&M(W[0])&&W[0].type!=="descendant"))if(C&&!(Array.isArray(W)?W.some(x):x(W)))W.unshift(m);else return;W.unshift(c);});}function g(E,L,D){E=E.filter(function(z){return z.length>0;}),E.forEach(i);var R=Array.isArray(D);D=L&&L.context||D,D&&!R&&(D=[D]),u(E,L,D);var C=!1,W=E.map(function(z){if(z[0]&&z[1]&&z[0].name==="scope"){var H=z[1].type;R&&H==="descendant"?z[1]=T:(H==="adjacent"||H==="sibling")&&(C=!0);}return A(z,L,D);}).reduce(I,v);return W.shouldTestNextSiblings=C,W;}function M(E){return a[E.type]<0;}function A(E,L,D){return E.reduce(function(R,C){if(R===v)return R;if(!(C.type in s))throw new Error("Rule type "+C.type+" is not supported by css-select");return s[C.type](R,C,L,D);},L&&L.rootFunc||f);}function I(E,L){return L===v||E===f?E:E===v||L===f?L:function(R){return E(R)||L(R);};}function b(E){return E.some(M);}l.not=function(E,L,D,R){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:D.adapter};if(C.strict&&(L.length>1||L.some(b)))throw new Error("complex selectors in :not aren't allowed in strict mode");var W=g(L,C,R);return W===v?E:W===f?v:function(H){return!W(H)&&E(H);};},l.has=function(E,L,D){var R=D.adapter,C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:R},W=L.some(b)?[d]:null,z=g(L,C,W);return z===v?v:z===f?function(X){return R.getChildren(X).some(R.isTag)&&E(X);}:(z=y(z,D),W?function(X){return E(X)&&(W[0]=X,R.existsOne(z,R.getChildren(X)));}:function(X){return E(X)&&R.existsOne(z,R.getChildren(X));});},l.matches=function(E,L,D,R){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),rootFunc:E,adapter:D.adapter};return g(L,C,R);},p.compileToken=g,p.compileUnsafe=O,p.Pseudos=o;},/* 275 */ /***/function(h,r,t){var e=this&&this.__createBinding||(Object.create?function(s,o,f,v){v===void 0&&(v=f),Object.defineProperty(s,v,{enumerable:!0,get:function get(){return o[f];}});}:function(s,o,f,v){v===void 0&&(v=f),s[v]=o[f];}),n=this&&this.__exportStar||function(s,o){for(var f in s)f!=="default"&&!o.hasOwnProperty(f)&&e(o,s,f);};Object.defineProperty(r,"__esModule",{value:!0}),n(t(276),r);var i=t(276);Object.defineProperty(r,"parse",{enumerable:!0,get:function get(){return i["default"];}});var a=t(277);Object.defineProperty(r,"stringify",{enumerable:!0,get:function get(){return a["default"];}});},/* 276 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=x;var e=/^[^\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,n=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,i=/^\s*((?:\\.|[\w\u00b0-\uFFFF-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF-])*)|)|)\s*(i)?\]/,a={undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},s={">":"child","<":"parent","~":"sibling","+":"adjacent"},o={"#":["id","equals"],".":["class","element"]},f=/* @__PURE__ */new Set(["has","not","matches"]),v=/* @__PURE__ */new Set(["contains","icontains"]),l=/* @__PURE__ */new Set(['"',"'"]);function p(c,d,u){var g=parseInt(d,16)-65536;return g!==g||u?d:g<0?// BMP codepoint
|
|
355
|
+
String.fromCharCode(g+65536):// Supplemental Plane codepoint (surrogate pair)
|
|
356
|
+
String.fromCharCode(g>>10|55296,g&1023|56320);}function y(c){return c.replace(n,p);}function O(c){return c===" "||c==="\n"||c===" "||c==="\f"||c==="\r";}function x(c,d){var u=[];if(c=m(u,""+c,d),c!=="")throw new Error("Unmatched selector: "+c);return u;}function m(c,d,u){var g=[],M=!1;function A(){var Q=d.match(e);if(!Q)throw new Error("Expected name, found "+d);var tt=Q[0];return d=d.substr(tt.length),y(tt);}function I(Q){for(;O(d.charAt(Q));)Q++;d=d.substr(Q);}function b(Q){for(var tt=0;d.charAt(--Q)==="\\";)tt++;return(tt&1)===1;}for(I(0);d!=="";){var E=d.charAt(0);if(O(E))M=!0,I(1);else if(E in s)g.push({type:s[E]}),M=!1,I(1);else if(E===","){if(g.length===0)throw new Error("Empty sub-selector");c.push(g),g=[],M=!1,I(1);}else if(M&&(g.length>0&&g.push({type:"descendant"}),M=!1),E==="*")d=d.substr(1),g.push({type:"universal"});else if(E in o){var L=o[E],D=L[0],R=L[1];d=d.substr(1),g.push({type:"attribute",name:D,action:R,value:A(),ignoreCase:!1});}else if(E==="["){d=d.substr(1);var C=d.match(i);if(!C)throw new Error("Malformed attribute selector: "+d);d=d.substr(C[0].length);var W=y(C[1]);(!u||("lowerCaseAttributeNames"in u?u.lowerCaseAttributeNames:!u.xmlMode))&&(W=W.toLowerCase()),g.push({type:"attribute",name:W,action:a[C[2]],value:y(C[4]||C[5]||""),ignoreCase:!!C[6]});}else if(E===":"){if(d.charAt(1)===":"){d=d.substr(2),g.push({type:"pseudo-element",name:A().toLowerCase()});continue;}d=d.substr(1);var z=A().toLowerCase(),C=null;if(d.charAt(0)==="(")if(f.has(z)){var H=d.charAt(1),X=l.has(H);if(d=d.substr(X?2:1),C=[],d=m(C,d,u),X){if(d.charAt(0)!==H)throw new Error("Unmatched quotes in :"+z);d=d.substr(1);}if(d.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+z+" ("+d+")");d=d.substr(1);}else{for(var Z=1,j=1;j>0&&Z<d.length;Z++)d.charAt(Z)==="("&&!b(Z)?j++:d.charAt(Z)===")"&&!b(Z)&&j--;if(j)throw new Error("Parenthesis not matched");if(C=d.substr(1,Z-2),d=d.substr(Z),v.has(z)){var H=C.charAt(0);H===C.slice(-1)&&l.has(H)&&(C=C.slice(1,-1)),C=y(C);}}g.push({type:"pseudo",name:z,data:C});}else if(e.test(d)){var G=A();(!u||("lowerCaseTags"in u?u.lowerCaseTags:!u.xmlMode))&&(G=G.toLowerCase()),g.push({type:"tag",name:G});}else return g.length&&g[g.length-1].type==="descendant"&&g.pop(),T(c,g),d;}return T(c,g),d;}function T(c,d){if(c.length>0&&d.length===0)throw new Error("Empty sub-selector");c.push(d);}},/* 277 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(o){return o.map(i).join(", ");}r["default"]=n;function i(o){return o.map(a).join("");}function a(o){switch(o.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return o.name;case"pseudo-element":return"::"+o.name;case"pseudo":return o.data===null?":"+o.name:typeof o.data=="string"?":"+o.name+"("+o.data+")":":"+o.name+"("+n(o.data)+")";case"attribute":return o.action==="exists"?"["+o.name+"]":o.name==="id"&&o.action==="equals"&&!o.ignoreCase?"#"+o.value:o.name==="class"&&o.action==="element"&&!o.ignoreCase?"."+o.value:"["+o.name+e[o.action]+"='"+o.value+"'"+(o.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function s(o){return o;}},/* 278 */ /***/function(h,r,t){h.exports=i;var e=t(279),n={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function i(s){for(var o=s.map(a),f=1;f<s.length;f++){var v=o[f];if(!(v<0))for(var l=f-1;l>=0&&v<o[l];l--){var p=s[l+1];s[l+1]=s[l],s[l]=p,o[l+1]=o[l],o[l]=v;}}}function a(s){var o=e[s.type];if(o===e.attribute)o=n[s.action],o===n.equals&&s.name==="id"&&(o=9),s.ignoreCase&&(o>>=1);else if(o===e.pseudo)if(!s.data)o=3;else if(s.name==="has"||s.name==="contains")o=0;else if(s.name==="matches"||s.name==="not"){o=0;for(var f=0;f<s.data.length;f++)if(s.data[f].length===1){var v=a(s.data[f][0]);if(v===0){o=0;break;}v>o&&(o=v);}s.data.length>1&&o>0&&(o-=1);}else o=1;return o;}},/* 279 */ /***/function(h){h.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}');},/* 280 */ /***/function(h,r,t){var e=t(281),n=t(282);h.exports={__proto__:null,attribute:e.compile,pseudo:n.compile,//tags
|
|
357
|
+
tag:function tag(i,a,s){var o=a.name,f=s.adapter;return function(l){return f.getName(l)===o&&i(l);};},//traversal
|
|
358
|
+
descendant:function descendant(i,a,s){var o=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,f=s.adapter;return function(l){for(var p=!1;!p&&(l=f.getParent(l));)(!o||!o.has(l))&&(p=i(l),!p&&o&&o.add(l));return p;};},_flexibleDescendant:function _flexibleDescendant(i,a,s){var o=s.adapter;return function(v){for(var l=i(v);!l&&(v=o.getParent(v));)l=i(v);return l;};},parent:function parent(i,a,s){if(s&&s.strict)throw new Error("Parent selector isn't part of CSS3");var o=s.adapter;return function(l){return o.getChildren(l).some(f);};function f(v){return o.isTag(v)&&i(v);}},child:function child(i,a,s){var o=s.adapter;return function(v){var l=o.getParent(v);return!!l&&i(l);};},sibling:function sibling(i,a,s){var o=s.adapter;return function(v){for(var l=o.getSiblings(v),p=0;p<l.length;p++)if(o.isTag(l[p])){if(l[p]===v)break;if(i(l[p]))return!0;}return!1;};},adjacent:function adjacent(i,a,s){var o=s.adapter;return function(v){for(var l=o.getSiblings(v),p,y=0;y<l.length;y++)if(o.isTag(l[y])){if(l[y]===v)break;p=l[y];}return!!p&&i(p);};},universal:function universal(i){return i;}};},/* 281 */ /***/function(h,r,t){var e=t(273).falseFunc,n=/[-[\]{}()*+?.,\\^$|#\s]/g,i={__proto__:null,equals:function equals(a,s,o){var f=s.name,v=s.value,l=o.adapter;return s.ignoreCase?(v=v.toLowerCase(),function(y){var O=l.getAttributeValue(y,f);return O!=null&&O.toLowerCase()===v&&a(y);}):function(y){return l.getAttributeValue(y,f)===v&&a(y);};},hyphen:function hyphen(a,s,o){var f=s.name,v=s.value,l=v.length,p=o.adapter;return s.ignoreCase?(v=v.toLowerCase(),function(O){var x=p.getAttributeValue(O,f);return x!=null&&(x.length===l||x.charAt(l)==="-")&&x.substr(0,l).toLowerCase()===v&&a(O);}):function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(0,l)===v&&(x.length===l||x.charAt(l)==="-")&&a(O);};},element:function element(a,s,o){var f=s.name,v=s.value,l=o.adapter;if(/\s/.test(v))return e;v=v.replace(n,"\\$&");var p="(?:^|\\s)"+v+"(?:$|\\s)",y=s.ignoreCase?"i":"",O=new RegExp(p,y);return function(m){var T=l.getAttributeValue(m,f);return T!=null&&O.test(T)&&a(m);};},exists:function exists(a,s,o){var f=s.name,v=o.adapter;return function(p){return v.hasAttrib(p,f)&&a(p);};},start:function start(a,s,o){var f=s.name,v=s.value,l=v.length,p=o.adapter;return l===0?e:s.ignoreCase?(v=v.toLowerCase(),function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(0,l).toLowerCase()===v&&a(O);}):function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(0,l)===v&&a(O);};},end:function end(a,s,o){var f=s.name,v=s.value,l=-v.length,p=o.adapter;return l===0?e:s.ignoreCase?(v=v.toLowerCase(),function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(l).toLowerCase()===v&&a(O);}):function(O){var x=p.getAttributeValue(O,f);return x!=null&&x.substr(l)===v&&a(O);};},any:function any(a,s,o){var f=s.name,v=s.value,l=o.adapter;if(v==="")return e;if(s.ignoreCase){var p=new RegExp(v.replace(n,"\\$&"),"i");return function(O){var x=l.getAttributeValue(O,f);return x!=null&&p.test(x)&&a(O);};}return function(O){var x=l.getAttributeValue(O,f);return x!=null&&x.indexOf(v)>=0&&a(O);};},not:function not(a,s,o){var f=s.name,v=s.value,l=o.adapter;return v===""?function(y){return!!l.getAttributeValue(y,f)&&a(y);}:s.ignoreCase?(v=v.toLowerCase(),function(y){var O=l.getAttributeValue(y,f);return O!=null&&O.toLowerCase()!==v&&a(y);}):function(y){return l.getAttributeValue(y,f)!==v&&a(y);};}};h.exports={compile:function compile(a,s,o){if(o&&o.strict&&(s.ignoreCase||s.action==="not"))throw new Error("Unsupported attribute selector");return i[s.action](a,s,o);},rules:i};},/* 282 */ /***/function(h,r,t){var e=t(283),n=t(273),i=t(281),a=n.trueFunc,s=n.falseFunc,o=i.rules.equals;function f(T,c){var d={name:T,value:c};return function(g,M,A){return o(g,d,A);};}function v(T,c){return function(d){return!!c.getParent(d)&&T(d);};}var l={contains:function contains(T,c,d){var u=d.adapter;return function(M){return T(M)&&u.getText(M).indexOf(c)>=0;};},icontains:function icontains(T,c,d){var u=c.toLowerCase(),g=d.adapter;return function(A){return T(A)&&g.getText(A).toLowerCase().indexOf(u)>=0;};},//location specific methods
|
|
359
|
+
"nth-child":function nthChild(T,c,d){var u=e(c),g=d.adapter;return u===s?u:u===a?v(T,g):function(A){for(var I=g.getSiblings(A),b=0,E=0;b<I.length;b++)if(g.isTag(I[b])){if(I[b]===A)break;E++;}return u(E)&&T(A);};},"nth-last-child":function nthLastChild(T,c,d){var u=e(c),g=d.adapter;return u===s?u:u===a?v(T,g):function(A){for(var I=g.getSiblings(A),b=0,E=I.length-1;E>=0;E--)if(g.isTag(I[E])){if(I[E]===A)break;b++;}return u(b)&&T(A);};},"nth-of-type":function nthOfType(T,c,d){var u=e(c),g=d.adapter;return u===s?u:u===a?v(T,g):function(A){for(var I=g.getSiblings(A),b=0,E=0;E<I.length;E++)if(g.isTag(I[E])){if(I[E]===A)break;g.getName(I[E])===g.getName(A)&&b++;}return u(b)&&T(A);};},"nth-last-of-type":function nthLastOfType(T,c,d){var u=e(c),g=d.adapter;return u===s?u:u===a?v(T,g):function(A){for(var I=g.getSiblings(A),b=0,E=I.length-1;E>=0;E--)if(g.isTag(I[E])){if(I[E]===A)break;g.getName(I[E])===g.getName(A)&&b++;}return u(b)&&T(A);};},//TODO determine the actual root element
|
|
360
|
+
root:function root(T,c,d){var u=d.adapter;return function(g){return!u.getParent(g)&&T(g);};},scope:function scope(T,c,d,u){var g=d.adapter;if(!u||u.length===0)return l.root(T,c,d);function M(A,I){return typeof g.equals=="function"?g.equals(A,I):A===I;}return u.length===1?function(A){return M(u[0],A)&&T(A);}:function(A){return u.indexOf(A)>=0&&T(A);};},//jQuery extensions (others follow as pseudos)
|
|
361
|
+
checkbox:f("type","checkbox"),file:f("type","file"),password:f("type","password"),radio:f("type","radio"),reset:f("type","reset"),image:f("type","image"),submit:f("type","submit"),//dynamic state pseudos. These depend on optional Adapter methods.
|
|
362
|
+
hover:function hover(T,c,d){var u=d.adapter;return typeof u.isHovered=="function"?function(M){return T(M)&&u.isHovered(M);}:s;},visited:function visited(T,c,d){var u=d.adapter;return typeof u.isVisited=="function"?function(M){return T(M)&&u.isVisited(M);}:s;},active:function active(T,c,d){var u=d.adapter;return typeof u.isActive=="function"?function(M){return T(M)&&u.isActive(M);}:s;}};function p(T,c){for(var d=0;T&&d<T.length;d++)if(c.isTag(T[d]))return T[d];}var y={empty:function empty(T,c){return!c.getChildren(T).some(function(d){return c.isTag(d)||d.type==="text";});},"first-child":function firstChild(T,c){return p(c.getSiblings(T),c)===T;},"last-child":function lastChild(T,c){for(var d=c.getSiblings(T),u=d.length-1;u>=0;u--){if(d[u]===T)return!0;if(c.isTag(d[u]))break;}return!1;},"first-of-type":function firstOfType(T,c){for(var d=c.getSiblings(T),u=0;u<d.length;u++)if(c.isTag(d[u])){if(d[u]===T)return!0;if(c.getName(d[u])===c.getName(T))break;}return!1;},"last-of-type":function lastOfType(T,c){for(var d=c.getSiblings(T),u=d.length-1;u>=0;u--)if(c.isTag(d[u])){if(d[u]===T)return!0;if(c.getName(d[u])===c.getName(T))break;}return!1;},"only-of-type":function onlyOfType(T,c){for(var d=c.getSiblings(T),u=0,g=d.length;u<g;u++)if(c.isTag(d[u])){if(d[u]===T)continue;if(c.getName(d[u])===c.getName(T))return!1;}return!0;},"only-child":function onlyChild(T,c){for(var d=c.getSiblings(T),u=0;u<d.length;u++)if(c.isTag(d[u])&&d[u]!==T)return!1;return!0;},//:matches(a, area, link)[href]
|
|
363
|
+
link:function link(T,c){return c.hasAttrib(T,"href");},//TODO: :any-link once the name is finalized (as an alias of :link)
|
|
364
|
+
//forms
|
|
365
|
+
//to consider: :target
|
|
366
|
+
//:matches([selected], select:not([multiple]):not(> option[selected]) > option:first-of-type)
|
|
367
|
+
selected:function selected(T,c){if(c.hasAttrib(T,"selected"))return!0;if(c.getName(T)!=="option")return!1;var d=c.getParent(T);if(!d||c.getName(d)!=="select"||c.hasAttrib(d,"multiple"))return!1;for(var u=c.getChildren(d),g=!1,M=0;M<u.length;M++)if(c.isTag(u[M]))if(u[M]===T)g=!0;else if(g){if(c.hasAttrib(u[M],"selected"))return!1;}else return!1;return g;},//https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
|
|
368
|
+
//:matches(
|
|
369
|
+
// :matches(button, input, select, textarea, menuitem, optgroup, option)[disabled],
|
|
370
|
+
// optgroup[disabled] > option),
|
|
371
|
+
// fieldset[disabled] * //TODO not child of first <legend>
|
|
372
|
+
//)
|
|
373
|
+
disabled:function disabled(T,c){return c.hasAttrib(T,"disabled");},enabled:function enabled(T,c){return!c.hasAttrib(T,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
|
|
374
|
+
checked:function checked(T,c){return c.hasAttrib(T,"checked")||y.selected(T,c);},//:matches(input, select, textarea)[required]
|
|
375
|
+
required:function required(T,c){return c.hasAttrib(T,"required");},//:matches(input, select, textarea):not([required])
|
|
376
|
+
optional:function optional(T,c){return!c.hasAttrib(T,"required");},//jQuery extensions
|
|
377
|
+
//:not(:empty)
|
|
378
|
+
parent:function parent(T,c){return!y.empty(T,c);},//:matches(h1, h2, h3, h4, h5, h6)
|
|
379
|
+
header:O(["h1","h2","h3","h4","h5","h6"]),//:matches(button, input[type=button])
|
|
380
|
+
button:function button(T,c){var d=c.getName(T);return d==="button"||d==="input"&&c.getAttributeValue(T,"type")==="button";},//:matches(input, textarea, select, button)
|
|
381
|
+
input:O(["input","textarea","select","button"]),//input:matches(:not([type!='']), [type='text' i])
|
|
382
|
+
text:function text(T,c){var d;return c.getName(T)==="input"&&(!(d=c.getAttributeValue(T,"type"))||d.toLowerCase()==="text");}};function O(T){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var c=new Set(T);return function(d,u){return c.has(u.getName(d));};}return function(d,u){return T.indexOf(u.getName(d))>=0;};}function x(T,c,d){if(d===null){if(T.length>2&&c!=="scope")throw new Error("pseudo-selector :"+c+" requires an argument");}else if(T.length===2)throw new Error("pseudo-selector :"+c+" doesn't have any arguments");}var m=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;h.exports={compile:function compile(T,c,d,u){var g=c.name,M=c.data,A=d.adapter;if(d&&d.strict&&!m.test(g))throw new Error(":"+g+" isn't part of CSS3");if(typeof l[g]=="function")return l[g](T,M,d,u);if(typeof y[g]=="function"){var I=y[g];return x(I,g,M),I===s?I:T===a?function(E){return I(E,A,M);}:function(E){return I(E,A,M)&&T(E);};}else throw new Error("unmatched pseudo-class :"+g);},filters:l,pseudos:y};},/* 283 */ /***/function(h,r,t){var e=t(284),n=t(285);h.exports=function(a){return n(e(a));},h.exports.parse=e,h.exports.compile=n;},/* 284 */ /***/function(h,r){h.exports=e;var t=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/;function e(n){if(n=n.trim().toLowerCase(),n==="even")return[2,0];if(n==="odd")return[2,1];var i=n.match(t);if(!i)throw new SyntaxError("n-th rule couldn't be parsed ('"+n+"')");var a;return i[1]?(a=parseInt(i[1],10),isNaN(a)&&(i[1].charAt(0)==="-"?a=-1:a=1)):a=0,[a,i[3]?parseInt((i[2]||"")+i[3],10):0];}},/* 285 */ /***/function(h,r,t){h.exports=a;var e=t(273),n=e.trueFunc,i=e.falseFunc;function a(s){var o=s[0],f=s[1]-1;if(f<0&&o<=0)return i;if(o===-1)return function(l){return l<=f;};if(o===0)return function(l){return l===f;};if(o===1)return f<0?n:function(l){return l>=f;};var v=f%o;return v<0&&(v+=o),o>1?function(l){return l>=f&&l%o===v;}:(o*=-1,function(l){return l<=f&&l%o===v;});}},/* 286 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return M;});var e=t(12),n=t(74),i=t(1),a=t(68),s=t(250),o=t(213),f=t(218);t(1).glMatrix.setMatrixArrayType(Array);function v(A,I){if(A==null)return{};var b=l(A,I),E,L;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(A);for(L=0;L<D.length;L++)E=D[L],!(I.indexOf(E)>=0)&&Object.prototype.propertyIsEnumerable.call(A,E)&&(b[E]=A[E]);}return b;}function l(A,I){if(A==null)return{};var b={},E=Object.keys(A),L,D;for(D=0;D<E.length;D++)L=E[D],!(I.indexOf(L)>=0)&&(b[L]=A[L]);return b;}var p={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
|
|
383
|
+
},y=Symbol("autoRender"),O=Symbol("renderer"),x=Symbol("timeline"),m=Symbol("prepareRender"),T=Symbol("tickRender"),c=Symbol("pass"),d=Symbol("fbo"),u=Symbol("tickers"),g=Symbol("layerTransformInvert");var M=/*#__PURE__*/function(_s$default){function M(){var _this38;var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this38=_callSuper(this,M),!I.canvas){var _this38$getResolution=_this38.getResolution(),D=_this38$getResolution.width,R=_this38$getResolution.height,C=e.ENV.createCanvas(D,R,{offscreen:!!I.offscreen,id:I.id,extra:I.extra});C.style&&(C.style.position="absolute"),C.dataset&&(C.dataset.layerId=I.id),C.contextType&&(I.contextType=C.contextType),I.canvas=C;}var b=I.canvas,E=Object.assign({},p,I);_this38[y]=E.autoRender,delete I.autoRender;var L=E.Renderer||e.Renderer;_this38[O]=new L(b,E),_this38.options=I,_this38.id=I.id,_this38[c]=[],_this38.setResolution(b),_this38.canvas=b,_this38[x]=new n.Timeline(),_this38.__mouseCapturedTarget=null,_this38[g]=null;return _assertThisInitialized(_this38);}_inherits(M,_s$default);return _createClass(M,[{key:"autoRender",get:function get(){return this[y];}},{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(),I=_this$getResolution.height;return I/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[c];}},{key:"prepareRender",get:function get(){return this[m]?this[m]:Promise.resolve();}/* override */},{key:"renderer",get:function get(){return this[O];}},{key:"renderOffset",get:function get(){if(this.parent&&this.parent.options){var _this$parent$options=this.parent.options,I=_this$parent$options.left,b=_this$parent$options.top;return[I,b];}return[this.options.left|0,this.options.top|0];}},{key:"timeline",get:function get(){return this[x];}},{key:"width",get:function get(){var _this$getResolution2=this.getResolution(),I=_this$getResolution2.width;return I/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,I=_this$attributes21.x,b=_this$attributes21.y;return[1,0,0,1,I,b];}},{key:"layerTransformInvert",get:function get(){if(this[g])return this[g];var I=this.transformMatrix;return I[0]===1&&I[1]===0&&I[2]===0&&I[3]===1&&I[4]===0&&I[5]===0?null:(this[g]=i.mat2d.invert(Array.of(0,0,0,0,0,0),I),this[g]);}},{key:"forceContextLoss",value:function forceContextLoss(){var I=this.renderer.glRenderer;if(I){var b=I.getExtension("WEBGL_lose_context");if(b)return b.loseContext(),!0;}return!1;}// isPointCollision(x, y) {
|
|
384
|
+
// return true;
|
|
385
|
+
// }
|
|
386
|
+
},{key:"addPass",value:function addPass(){var _ref151=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},I=_ref151.vertex,b=_ref151.fragment,E=_ref151.options,L=_ref151.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),D=_this$getResolution3.width,R=_this$getResolution3.height,C=this.renderer.createPassProgram({vertex:I,fragment:b,options:E}),W=new e.Figure2D();W.rect(0,0,D/this.displayRatio,R/this.displayRatio);var z=new e.Mesh2D(W);return z.setUniforms(L),z.setProgram(C),this[c].push(z),this.forceUpdate(),z;}return null;}// delete unused texture to release memory.
|
|
387
|
+
},{key:"deleteTexture",value:function deleteTexture(I){return Object(f.deleteTexture)(I,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(I){var b=I.type;if(b==="mousedown"||b==="mouseup"||b==="mousemove"){var C=this.__mouseCapturedTarget;if(C){if(C.layer===this)return C.dispatchEvent(I),!0;this.__mouseCapturedTarget=null;}}var E,L;var D=this.layerTransformInvert;if(D){E=I.x,L=I.y;var _C6=D,W=_C6[0]*E+_C6[2]*L+_C6[4],z=_C6[1]*E+_C6[3]*L+_C6[5];delete I.x,delete I.y,delete I.layerX,delete I.layerY,Object.defineProperties(I,{layerX:{value:W,configurable:!0},layerY:{value:z,configurable:!0},x:{value:W,configurable:!0},y:{value:z,configurable:!0}});}var R=_get(_getPrototypeOf(M.prototype),"dispatchPointerEvent",this).call(this,I);return D&&Object.defineProperties(I,{layerX:{value:E,configurable:!0},layerY:{value:L,configurable:!0},x:{value:E,configurable:!0},y:{value:L,configurable:!0}}),R;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this39=this;if(!this[m])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var I=null;var b=new Promise(function(E){I=E;});b._resolve=I,this[m]=b;}else{var _I2=null,_b8=null;var E=new Promise(function(L){_I2=L,_this39[y]&&(_b8=Object(a.requestAnimationFrame)(function(){delete E._requestID,_this39.render();}));});E._resolve=_I2,E._requestID=_b8,this[m]=E;}}},{key:"getFBO",value:function getFBO(){var I=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),b=_this$getResolution4.width,E=_this$getResolution4.height;return I&&(!this[d]||this[d].width!==b||this[d].height!==E)?(this[d]={width:b,height:E,target:I.createFBO(),buffer:I.createFBO(),swap:function swap(){var _ref152=[this.buffer,this.target];this.target=_ref152[0];this.buffer=_ref152[1];}},this[d]):this[d]?this[d]:null;}},{key:"updateGlobalTransform",value:function updateGlobalTransform(){if(this.layerTransformInvert){var I=this.renderer,b=I.__globalTransformMatrix||I.globalTransformMatrix;I.__globalTransformMatrix=b;var E=i.mat2d.fromValues(1,0,0,1,0,0);I.setGlobalTransform.apply(I,_toConsumableArray(i.mat2d.multiply(E,b,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(I,b,E){if(_get(_getPrototypeOf(M.prototype),"onPropertyChange",this).call(this,I,b,E),I==="zIndex"&&(this.canvas.style.zIndex=b),I==="transform"||I==="translate"||I==="rotate"||I==="scale"||I==="skew"){var L=this[g];if(this[g]=null,this.updateGlobalTransform(),L&&!this.layerTransformInvert){var D=this.renderer,R=D.__globalTransformMatrix||D.globalTransformMatrix;D.setGlobalTransform.apply(D,_toConsumableArray(R));}}}},{key:"_prepareRenderFinished",value:function _prepareRenderFinished(){this[m]&&(this[m]._requestID&&Object(a.cancelAnimationFrame)(this[m]._requestID),this[m]._resolve(),delete this[m]);}},{key:"render",value:function render(){var _this40=this;var _ref153=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref153$clear=_ref153.clear,I=_ref153$clear===void 0?!0:_ref153$clear;var b=this[c].length?this.getFBO():null;b&&this.renderer.glRenderer.bindFBO(b.target),I&&this[O].clear();var E=this.draw();if(E&&E.length&&(this.renderer.drawMeshes(E),this.canvas.draw&&this.canvas.draw()),b){var L=this.renderer.glRenderer,D=this[c].length,_this$getResolution5=this.getResolution(),R=_this$getResolution5.width,C=_this$getResolution5.height,W=[0,0,R/this.displayRatio,C/this.displayRatio];this[c].forEach(function(z,H){z.blend=!0,z.setTexture(b.target.texture,{rect:W}),H===D-1?L.bindFBO(null):(b.swap(),L.bindFBO(b.target)),_this40[O].clear(),_this40.renderer.drawMeshes([z]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref154){var _this41=this;var I=_ref154.width,b=_ref154.height;var E=this.renderer,L=E.__globalTransformMatrix||E.globalTransformMatrix,D=L[4],R=L[5],C=L[0],_this$getResolution6=this.getResolution(),W=_this$getResolution6.width,z=_this$getResolution6.height;(W!==I||z!==b)&&(_get(_getPrototypeOf(M.prototype),"setResolution",this).call(this,{width:I,height:b}),this.canvas&&(this.canvas.width=I,this.canvas.height=b,E.updateResolution&&E.updateResolution()),this.attributes.size=[I,b],this[c].length&&this[c].forEach(function(j){var G=new e.Figure2D();G.rect(0,0,I/_this41.displayRatio,b/_this41.displayRatio),j.contours=G.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),H=_this$renderOffset[0],X=_this$renderOffset[1],Z=this.displayRatio;(D!==H||R!==X||C!==Z)&&(E.setGlobalTransform(Z,0,0,Z,H,X),E.__globalTransformMatrix=null,this[g]=null,this.updateGlobalTransform(),this.forceUpdate());}/**
|
|
388
|
+
* tick(handler, {originTime = 0, playbackRate = 1.0, duration = Infinity})
|
|
389
|
+
* @param {*} handler
|
|
390
|
+
* @param {*} options
|
|
391
|
+
*/},{key:"tick",value:function tick(){var _this42=this;var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _b$duration=b.duration,E=_b$duration===void 0?1/0:_b$duration,L=v(b,["duration"]);var D=this.timeline.fork(L),R=this;this[u]=this[u]||[],this[u].push({handler:I,duration:E});var C=function C(){var W=null,z=null;var H=function H(){var X=_this42[u].map(function(_ref155){var Z=_ref155.handler,j=_ref155.duration;var G=Math.min(1,D.currentTime/j);return{value:Z?Z(D.currentTime,G):null,p:G};});R[T]||(R[T]=Promise.resolve().then(function(){R[y]&&R.render(),delete R[T];for(var Z=X.length-1;Z>=0;Z--){var _X$Z=X[Z],j=_X$Z.value,G=_X$Z.p;(j===!1||G>=1)&&_this42[u].splice(Z,1);}_this42[u].length>0&&C();}));};if(_this42[m]&&_this42[m]._type!=="ticker"&&(Object(a.cancelAnimationFrame)(_this42[m]._requestID),delete _this42[m]),!_this42[m]){var X=new Promise(function(Z){W=Z,z=Object(a.requestAnimationFrame)(H);});X._resolve=W,X._requestID=z,X._type="ticker",_this42[m]=X;}};C();}},{key:"toGlobalPos",value:function toGlobalPos(I,b){if(this.layerTransformInvert){var W=this.transformMatrix;I=W[0]*I+W[2]*b+W[4],b=W[1]*I+W[3]*b+W[5];}var _this$getResolution7=this.getResolution(),E=_this$getResolution7.width,L=_this$getResolution7.height,D=this.renderOffset,R=[this.canvas.clientWidth,this.canvas.clientHeight];I=I*R[0]/E+D[0],b=b*R[1]/L+D[1];var C=this.displayRatio;return I*=C,b*=C,[I,b];}},{key:"toLocalPos",value:function toLocalPos(I,b){var _this$getResolution8=this.getResolution(),E=_this$getResolution8.width,L=_this$getResolution8.height,D=this.renderOffset,R=[this.canvas.clientWidth,this.canvas.clientHeight];I=I*E/R[0]-D[0],b=b*L/R[1]-D[1];var C=this.displayRatio;I/=C,b/=C;var W=this.layerTransformInvert;return W&&(I=W[0]*I+W[2]*b+W[4],b=W[1]*I+W[3]*b+W[5]),[I,b];}}]);}(s["default"]);o["default"].registerNode(M,"layer");},/* 287 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return m;});var e=t(224),n=t(288),i=t(213),a=t(252),s=t(72);t(1).glMatrix.setMatrixArrayType(Array);function o(T,c){if(T==null)return{};var d=f(T,c),u,g;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);for(g=0;g<M.length;g++)u=M[g],!(c.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(T,u)&&(d[u]=T[u]);}return d;}function f(T,c){if(T==null)return{};var d={},u=Object.keys(T),g,M;for(M=0;M<u.length;M++)g=u[M],!(c.indexOf(g)>=0)&&(d[g]=T[g]);return d;}function v(T,c,d){return c in T?Object.defineProperty(T,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):T[c]=d,T;}var l="http://www.w3.org/2000/svg",p=Symbol["for"]("spritejs_setAttribute"),y=Symbol("root"),O=Symbol("task");function x(T){var c=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var d=T[y];if(d&&d.children[0]){var u=T.svg,g=T.layer?T.layer.displayRatio:1;if(!u.hasAttribute("data-original-width")){var I=u.getAttribute("width");I=I?Object(s.sizeToPixel)(I):300;var b=u.getAttribute("height");b=b?Object(s.sizeToPixel)(b):150,u.hasAttribute("viewBox")||u.setAttribute("viewBox","0 0 ".concat(Math.round(I)," ").concat(Math.round(b))),u.setAttribute("data-original-width",I),u.setAttribute("data-original-height",b);}var M=T.attributes.width||Number(u.getAttribute("data-original-width")),A=T.attributes.height||Number(u.getAttribute("data-original-height"));if(M*=g,A*=g,c&&T.attributes.flexible){var _I3=T.attributes.scale[0];if(M*=_I3,A*=_I3,u.setAttribute("width",M),u.setAttribute("height",A),M&&A&&T.textureImage){var _b9=T.textureImage.width,E=T.textureImage.height,L=T.clientSize;T.attributes.textureRect=[0,0,Math.round(L[0]*_b9/M),Math.round(L[1]*E/A)];}}else T[O]||(u.setAttribute("width",M),u.setAttribute("height",A),T[O]=Promise.resolve().then(function(){delete T[O];var I=d.innerHTML,b=new Blob([I],{type:"image/svg+xml"}),E=URL.createObjectURL(b),L=new Image();L.onload=function(){L.width&&L.height?(T.attributes[p]("texture",L),T.attributes.flexible&&(T.attributes.textureRect=null)):T.attributes[p]("texture",null);},L.src=E;}));}}var m=/*#__PURE__*/function(_e$default21){function m(){var _this43;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,m);typeof c=="string"&&(c={svgText:c});var _c27=c,d=_c27.svgText,u=o(c,["svgText"]);if(_this43=_callSuper(this,m,[u]),_this43[y]=document.createElement("div"),d){_this43[y].innerHTML=d;var g=_this43[y].children[0];g?g.setAttribute("xmlns",l):(fetch(d).then(function(M){return M.text();}).then(function(M){_this43[y].innerHTML=M,(!_this43.observer||_this43.attributes.flexible)&&x(_assertThisInitialized(_this43));}),d=null);}if(!d){var _g7=document.createElementNS(l,"svg");_g7.setAttribute("xmlns",l),_this43[y].appendChild(_g7);}if(typeof MutationObserver=="function"){var _g8=new MutationObserver(function(M){x(_assertThisInitialized(_this43),!1);});_g8.observe(_this43[y],{attributes:!0,subtree:!0,characterData:!0,childList:!0}),_this43.observer=_g8;}return _assertThisInitialized(_this43);}_inherits(m,_e$default21);return _createClass(m,[{key:"children",get:function get(){return[this.svg];}},{key:"childNodes",get:function get(){return[this.svg];}},{key:"svg",get:function get(){return this[y]?this[y].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref156){var c=_ref156.width,d=_ref156.height;_get(_getPrototypeOf(m.prototype),"setResolution",this).call(this,{width:c,height:d}),x(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(c){var d=_get(_getPrototypeOf(m.prototype),"dispatchPointerEvent",this).call(this,c);if(d&&this.attributes.passEvents&&typeof MouseEvent=="function"){var u=c.x,g=c.y;var _this$getOffsetPositi=this.getOffsetPosition(u,g),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),M=_this$getOffsetPositi2[0],A=_this$getOffsetPositi2[1];var I=c.originalEvent,b=this.attributes.anchor,E=this.clientSize;M=(M+b[0]*E[0])/2,A=(A+b[1]*E[1])/2;var L=c.type;if(L===I.type){var D=null;if(I instanceof MouseEvent)D=new MouseEvent(L,{screenX:M,screenY:A,clientX:M,clientY:A,bubbles:I.bubbles,button:I.button,buttons:I.buttons,cancelBubble:I.cancelBubble,cancelable:I.cancelable,currentTarget:I.currentTarget,fromElement:I.fromElement,relatedTarget:I.relatedTarget,returnValue:I.returnValue,srcElement:I.srcElement,target:I.target,toElement:I.toElement,// view: originalEvent.view,
|
|
392
|
+
which:I.witch});else if(I instanceof TouchEvent){var R=null;var C=I.changedTouches||[I];for(var W=0;W<C.length;W++){var z=C[W];if(c.identifier===z.identifier){R=z;break;}}if(R){var _W3=new Touch({identifier:R.identifier,target:R.target,clientX:M,clientY:A,screenX:M,screenY:A,pageX:M,pageY:A,radiusX:R.radiusX,radiusY:R.radiusY,rotationAngle:R.rotationAngle,force:R.force});D=new TouchEvent(L,{cancelable:I.cancelable,bubbles:I.bubbles,composed:I.composed,touches:[_W3],targetTouches:[_W3],changedTouches:[_W3]});}}else D=I;D&&this.svg.dispatchEvent(D);}}return d;}},{key:"getElementById",value:function getElementById(c){return Object(a.querySelector)("#".concat(c),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(c){return Object(a.querySelectorAll)(".".concat(c),this);}},{key:"getElementsByName",value:function getElementsByName(c){return Object(a.querySelectorAll)("[name=\"".concat(c,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(c){return Object(a.querySelectorAll)(c,this);}},{key:"querySelector",value:function querySelector(c){return Object(a.querySelector)(c,this);}},{key:"querySelectorAll",value:function querySelectorAll(c){return Object(a.querySelectorAll)(c,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(c,d,u){_get(_getPrototypeOf(m.prototype),"onPropertyChange",this).call(this,c,d,u),c==="flexible"&&x(this),this.attributes.flexible&&(c==="width"||c==="height"||c==="scale"||c==="transform")&&x(this);}}]);}(e["default"]);v(m,"Attr",n["default"]),i["default"].registerNode(m,"spritesvg");},/* 288 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(225);t(1).glMatrix.setMatrixArrayType(Array);var n=Symbol["for"]("spritejs_getAttribute"),i=Symbol["for"]("spritejs_setAttribute"),a=Symbol["for"]("spritejs_setAttributeDefault");var s=/*#__PURE__*/function(_e$default22){function s(f){var _this44;_classCallCheck(this,s);_this44=_callSuper(this,s,[f]),_this44[a]({passEvents:!1,flexible:!1});return _this44;}// readonly
|
|
393
|
+
_inherits(s,_e$default22);return _createClass(s,[{key:"texture",get:function get(){return this[n]("texture");},set:function set(f){}// eslint-disable-line no-empty-function
|
|
394
|
+
},{key:"passEvents",get:function get(){return this[n]("passEvents");},set:function set(f){return this[i]("passEvents",f);}},{key:"flexible",get:function get(){return this[n]("flexible");},set:function set(f){return this[i]("flexible",f);}}]);}(e["default"]);},/* 289 */ /***/function(h,r,t){t.r(r);var e=t(12);t(1).glMatrix.setMatrixArrayType(Array);function n(f,v){var l=Object.keys(f);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(f);v&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(f,y).enumerable;})),l.push.apply(l,p);}return l;}function i(f){for(var v=1;v<arguments.length;v++){var l=arguments[v]!=null?arguments[v]:{};v%2?n(Object(l),!0).forEach(function(p){a(f,p,l[p]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(l)):n(Object(l)).forEach(function(p){Object.defineProperty(f,p,Object.getOwnPropertyDescriptor(l,p));});}return f;}function a(f,v,l){return v in f?Object.defineProperty(f,v,{value:l,enumerable:!0,configurable:!0,writable:!0}):f[v]=l,f;}var s=Symbol("inited");var o=null;typeof Worker=="function"&&(o=/*#__PURE__*/function(_Worker){function o(f){var _this45;_classCallCheck(this,o);if(f.worker===!0&&(f.worker="./".concat(f.id,".worker.js")),_this45=_callSuper(this,o,[f.worker]),_this45.options=f,!f.canvas){var _this45$getResolution=_this45.getResolution(),v=_this45$getResolution.width,l=_this45$getResolution.height,p=e.ENV.createCanvas(v,l,{offscreen:!1});p.style&&(p.style.position="absolute"),p.dataset&&(p.dataset.layerId=f.id),f.canvas=p;}_this45.canvas=f.canvas;return _assertThisInitialized(_this45);}_inherits(o,_Worker);return _createClass(o,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref157){var f=_ref157.width,v=_ref157.height;if(this[s])this.postMessage({type:"resolution_change",width:f,height:v});else{this.canvas.width=f,this.canvas.height=v;var l=this.options,p=l.canvas.transferControlToOffscreen(),y=i({},l);delete y.container,y.canvas=p,this.postMessage({type:"create",options:y},[p]),this[s]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas6=this.canvas,f=_this$canvas6.width,v=_this$canvas6.height;return{width:f,height:v};}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(f,v){Object.defineProperty(this,"parent",{value:f,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:v,writable:!1,configurable:!0});}},{key:"disconnect",value:function disconnect(){delete this.parent,delete this.zOrder;}},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(f){this.postMessage({type:"event",event:{cancelBubble:f.cancelBubble,bubbles:f.bubbles,detail:f.detail,identifier:f.identifier,layerX:f.layerX,layerY:f.layerY,originalX:f.originalX,originalY:f.originalY,type:f.type,x:f.x,y:f.y}});}}]);}(/*#__PURE__*/_wrapNativeSuper(Worker))),r["default"]=o;},/* 290 */ /***/function(h,r,t){t.r(r),function(e){t.d(r,"default",function(){return M;});var n=t(12),i=t(68),a=t(70),s=t(286),o=t(289),f=t(250),v=t(291),l=t(214),p=t(218),y=t(213);t(1).glMatrix.setMatrixArrayType(Array);var O=Symbol("enteredTargets");function x(A){return A.id=A.id||"_layer".concat(Math.random().toString(36).slice(2,12)),A.dataset||(A.dataset={}),A.dataset.layerId=A.id,A.connect=function(I,b){A.parent=I,Object.defineProperty(A,"zOrder",{value:b,writable:!1,configurable:!0});},A.disconnect=function(I){delete A.zOrder;},A.canvas=A,A.getResolution=function(){return{width:0,height:0};},A.setResolution=function(){return!1;},A.options={handleEvent:!1},A;}function m(A,I){var b=A.children;var E=null;for(var L=0;L<b.length;L++){var D=b[L];if((I===D||E!=null)&&(E=D),E&&E!==I&&!E.offscreen)return E.canvas;}return null;}function T(A,I){var _A$renderOffset=_slicedToArray(A.renderOffset,2),b=_A$renderOffset[0],E=_A$renderOffset[1],_A$getResolution=A.getResolution(),L=_A$getResolution.width,D=_A$getResolution.height,R=A.displayRatio;A.renderer.drawImage(I.canvas,-b/R,-E/R,L/R,D/R);}var c={};function d(A){var I=["mousedown","mouseup","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel","click","dblclick","longpress","tap","contextmenu"],b=A.container;b.addEventListener("mouseleave",function(E){var L=A[O];if(L.size){var D=new l["default"]("mouseleave");D.setOriginalEvent(E),_toConsumableArray(L).forEach(function(R){R.dispatchEvent(D);}),A[O].clear();}},{passive:!0}),I.forEach(function(E){b.addEventListener(E,function(L){var _A$options=A.options,D=_A$options.left,R=_A$options.top,C=_A$options.displayRatio,W=A.orderedChildren;Object(v["default"])(L,{offsetLeft:D,offsetTop:R,displayRatio:C}).forEach(function(H){var X=H.identifier;if(H.type==="touchmove"||H.type==="touchend"){var j=c[X];j&&j.dispatchEvent(H),H.type==="touchend"&&delete c[X];}else{for(var _j=W.length-1;_j>=0;_j--){var G=W[_j];if(G.options.handleEvent!==!1){if(G.dispatchPointerEvent(H)&&H.target!==G)break;H.cancelBubble=!1;}}if(H.target===W[0])for(var _j2=W.length-1;_j2>=0;_j2--){var _G=W[_j2];if(_G.options.handleEvent!==!1){H.target=_G;break;}}}var Z=H.target;if(H.type==="touchstart"&&(c[X]=H.target),H.type==="mousemove"){var _j3=A[O];var _G2;if(Z){var et=Z.ancestors||[];_G2=/* @__PURE__ */new Set([Z].concat(_toConsumableArray(et)));}else _G2=/* @__PURE__ */new Set();var Q=Object.entries(L);if(!_j3.has(Z)&&Z){var _et2=new l["default"]("mouseenter");_et2.setOriginalEvent(L),Q.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),q=_ref159[0],pt=_ref159[1];_et2[q]=pt;}),_j3.add(Z),Z.dispatchEvent(_et2);var at=Z.ancestors;at&&at.forEach(function(q){q instanceof a["default"]&&!_j3.has(q)&&(_j3.add(q),q.dispatchEvent(_et2));});}var tt=new l["default"]("mouseleave");tt.setOriginalEvent(L),Q.forEach(function(_ref160){var _ref161=_slicedToArray(_ref160,2),et=_ref161[0],at=_ref161[1];tt[et]=at;}),_toConsumableArray(_j3).forEach(function(et){_G2.has(et)||(_j3["delete"](et),et.dispatchEvent(tt));});}});},{passive:E!=="contextmenu"});});}function u(A,I){if(I&&I.style){var b=A.width,E=A.height,L=A.mode,D=A.container;var R=D.clientWidth,C=D.clientHeight;b=b||R,E=E||C,L==="static"?(I.style.width="".concat(b,"px"),I.style.height="".concat(E,"px")):(I.style.top="0",I.style.left="0",I.style.width="".concat(R,"px"),I.style.height="".concat(C,"px"),I.style.transform="",I.style.webkitTransform="");}}var g=Symbol("offscreenLayerCount");var M=/*#__PURE__*/function(_f$default){/**
|
|
395
|
+
width
|
|
396
|
+
height
|
|
397
|
+
mode: 'static', 'scale', 'stickyWidth', 'stickyHeight', 'stickyTop', 'stickyBottom', 'stickyLeft', 'stickyRight'
|
|
398
|
+
*/function M(){var _this46;var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this46=_callSuper(this,M),!I.container)if(typeof n.ENV.Container=="function")I.container=new n.ENV.Container(I.width||300,I.height||150);else throw new Error("No container specified.");if(_this46.container=I.container,_this46.container.style&&(_this46.container.style.overflow||(_this46.container.style.overflow="hidden"),_this46.container.style.position||(_this46.container.style.position="relative")),_this46.options=I,I.displayRatio=I.displayRatio||1,I.mode=I.mode||"scale",I.left=0,I.top=0,I.autoResize=I.autoResize!==!1,I.autoResize){var b;if((typeof globalThis==="undefined"?"undefined":_typeof(globalThis))<"u"?b=globalThis:b=(typeof window==="undefined"?"undefined":_typeof(window))<"u"?window:e,b.addEventListener){var E=_assertThisInitialized(_this46);b.addEventListener("resize",function L(){(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&document.contains(E.container)?E.resize():b.removeEventListener("resize",L);});}}_this46[O]=/* @__PURE__ */new Set(),_this46.setResolution(I),d(_assertThisInitialized(_this46)),_this46[g]=0;return _assertThisInitialized(_this46);}_inherits(M,_f$default);return _createClass(M,[{key:"hasOffscreenCanvas",get:function get(){return this[g]>0;}},{key:"displayRatio",get:function get(){return this.options.displayRatio;},set:function set(I){this.options.displayRatio!==I&&(this.options.displayRatio=I,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(I){this.options.height!==I&&(this.options.height=I,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(I){this.options.mode!==I&&(this.options.mode=I,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(I){this.options.width!==I&&(this.options.width=I,this.resize());}},{key:"appendChild",value:function appendChild(I){!(I instanceof s["default"])&&!(I instanceof o["default"])&&x(I);var b=_get(_getPrototypeOf(M.prototype),"appendChild",this).call(this,I),E=I.canvas;return I.offscreen?this[g]++:this.container.appendChild(E),u(this.options,E),I.setResolution(this.getResolution()),b;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this47=this;this.hasOffscreenCanvas&&!this._requestID&&(this._requestID=Object(i.requestAnimationFrame)(function(){delete _this47._requestID,_this47.render();}));}/* override */},{key:"insertBefore",value:function insertBefore(I,b){!(I instanceof s["default"])&&!(I instanceof o["default"])&&x(I);var E=_get(_getPrototypeOf(M.prototype),"insertBefore",this).call(this,I,b),L=I.canvas;if(!I.offscreen){var D=m(this,I);this.container.insertBefore(L,D);}return u(this.options,L),I.setResolution(this.getResolution()),E;}},{key:"layer",value:function layer(){var I=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"default";var b=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};b=Object.assign({},this.options,b),b.id=I;var E=this.orderedChildren;for(var R=0;R<E.length;R++)if(E[R].id===I)return E[R];var L=b.worker;var D;return L?D=new o["default"](b):D=new s["default"](b),this.appendChild(D),D;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var _this48=this;var _len13,I,_key13,b,E,L,_loop2,D,_args12=arguments;return _regeneratorRuntime().wrap(function _callee11$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:for(_len13=_args12.length,I=new Array(_len13),_key13=0;_key13<_len13;_key13++){I[_key13]=_args12[_key13];}b=[],E=[],L=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(D){var R,C,W,z;return _regeneratorRuntime().wrap(function _loop2$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:R=I[D];if(typeof R=="string")C=Object(p.loadTexture)(R);else if(Array.isArray(R))C=Object(p.loadFrames).apply(void 0,_toConsumableArray(R));else{W=R.id,z=R.src;C=Object(p.loadTexture)(z,W);}C instanceof Promise||(C=Promise.resolve(C)),E.push(C.then(function(W){b.push(W),L[D]=W;var z=new l["default"]({type:"preload",detail:{current:W,loaded:b,resources:I}});_this48.dispatchEvent(z);}));case 3:case"end":return _context11.stop();}},_loop2);});D=0;case 4:if(!(D<I.length)){_context12.next=9;break;}return _context12.delegateYield(_loop2(D),"t0",6);case 6:D++;_context12.next=4;break;case 9:_context12.next=11;return Promise.all(E);case 11:return _context12.abrupt("return",L);case 12:case"end":return _context12.stop();}},_callee11);}));function preload(){return _preload.apply(this,arguments);}return preload;}()/* override */},{key:"removeChild",value:function removeChild(I){var b=_get(_getPrototypeOf(M.prototype),"removeChild",this).call(this,I);if(b){I._prepareRenderFinished&&I._prepareRenderFinished();var E=I.canvas;E&&E.remove&&E.remove(),I.offscreen&&this[g]--;}return b;}// for offscreen mode rendering
|
|
399
|
+
},{key:"render",value:function render(){var I=this.orderedChildren;var b=null;var E=[];for(var L=0;L<I.length;L++){var D=I[L],R=E.length>0;if(D instanceof s["default"]&&!D.offscreen){if(!D.autoRender)R&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);else if(b=D,R){D.renderer.clear();for(var C=0;C<E.length;C++){var W=E[C];W.render(),T(D,W);}E.length=0,D.render({clear:!1});}else D.prepareRender&&D.render();}else D.offscreen?b?(D.prepareRender&&D.render(),T(b,D)):E.push(D):D instanceof o["default"]&&R&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(I,b){var E=_get(_getPrototypeOf(M.prototype),"replaceChild",this).call(this,I,b);b.canvas.remove&&b.canvas.remove(),b.offscreen&&this[g]--;var L=I.canvas;if(!I.offscreen){var D=m(this,I);this.container.insertBefore(L,D);}return u(this.options,L),I.setResolution(this.getResolution()),E;}},{key:"resize",value:function resize(){var I=this.options;this.children.forEach(function(b){u(I,b.canvas);}),this.setResolution(I),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _I4,_b10;var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},I=_ref162.width,b=_ref162.height;var E=this.container,L=E.clientWidth,D=E.clientHeight;(I==null||b==null)&&(I=(_I4=I)!==null&&_I4!==void 0?_I4:L,b=(_b10=b)!==null&&_b10!==void 0?_b10:D);var _this$options=this.options,R=_this$options.mode,C=_this$options.displayRatio;if(I*=C,b*=C,this.options.left=0,this.options.top=0,R==="stickyHeight"||R==="stickyLeft"||R==="stickyRight"){var W=I;I=L*b/D,R==="stickyHeight"&&(this.options.left=0.5*(I-W)),R==="stickyRight"&&(this.options.left=I-W);}else if(R==="stickyWidth"||R==="stickyTop"||R==="stickyBottom"){var _W4=b;b=D*I/L,R==="stickyWidth"&&(this.options.top=0.5*(b-_W4)),R==="stickyBottom"&&(this.options.top=b-_W4);}_get(_getPrototypeOf(M.prototype),"setResolution",this).call(this,{width:I,height:b});}},{key:"snapshot",value:function snapshot(){var _ref163=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref163$offscreen=_ref163.offscreen,I=_ref163$offscreen===void 0?!1:_ref163$offscreen,b=_ref163.layers;var E=I?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),L=_this$getResolution9.width,D=_this$getResolution9.height;this[E]=this[E]||n.ENV.createCanvas(L,D,{offscreen:I});var R=this[E].getContext("2d");b=b||this.orderedChildren,this[E].width=L,this[E].height=D;for(var C=0;C<b.length;C++){var W=b[C];if(!W.options.ignoreSnapshot){W.render&&W.render();var z=W.canvas;z&&z!==W&&R.drawImage(z,0,0,L,D);}}return this[E];}}]);}(f["default"]);(typeof document==="undefined"?"undefined":_typeof(document))<"u"&&(M.prototype.layer3d=function(A){var _this49=this;var I=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var b=I.url||"https://unpkg.com/sprite-extend-3d/dist/sprite-extend-3d.min.js";return new Promise(function(E,L){var D=document.createElement("script");D.async=!1,D.src=b,D.onload=function(){try{E(_this49.layer3d(A,I));}catch(R){L(R);}},document.documentElement.appendChild(D);});}),y["default"].registerNode(M,"scene");}.call(this,t(22));},/* 291 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return n;});var e=t(214);t(1).glMatrix.setMatrixArrayType(Array);function n(i){var _ref164=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref164$offsetTop=_ref164.offsetTop,a=_ref164$offsetTop===void 0?0:_ref164$offsetTop,_ref164$offsetLeft=_ref164.offsetLeft,s=_ref164$offsetLeft===void 0?0:_ref164$offsetLeft,_ref164$displayRatio=_ref164.displayRatio,o=_ref164$displayRatio===void 0?1:_ref164$displayRatio;var f,v;var l=[],_i$target$getBounding=i.target.getBoundingClientRect(),p=_i$target$getBounding.left,y=_i$target$getBounding.top,O=_i$target$getBounding.width,x=_i$target$getBounding.height,m=i.target.width,T=i.target.height,c=i.changedTouches||[i];for(var u=0;u<c.length;u++){var g=c[u],M=g.identifier,A=g.clientX,I=g.clientY;A!=null&&I!=null&&l.push({x:Math.round((A|0)-p),y:Math.round((I|0)-y),identifier:M});}l.length<=0&&l.push({x:f,y:v});var d=[];return l.forEach(function(u){u.x!=null&&u.y!=null&&(f=(u.x*m/O-s)/o,v=(u.y*T/x-a)/o);var g=new e["default"](i);Object.defineProperties(g,{layerX:{value:f,configurable:!0},layerY:{value:v,configurable:!0},originalX:{value:u.x},originalY:{value:u.y},x:{value:f,configurable:!0},y:{value:v,configurable:!0},identifier:{value:u.identifier}}),d.push(g);}),d;}}/******/]);Dt.version;Dt.Arc;Dt.Block;Dt.Cloud;Dt.Color;var Kh=Dt.Ellipse;Dt.Gradient;var ne=Dt.Group,Vh=Dt.Label;Dt.Layer;Dt.LayerWorker;Dt.Node;Dt.Parallel;var he=Dt.Path,ce=Dt.Polyline,ir=Dt.Rect;Dt.Regular;Dt.Ring;var Yh=Dt.Scene,Xh=Dt.Sprite;Dt.SpriteSvg;Dt.Star;Dt.Triangle;Dt.helpers;Dt.createElement;Dt.isSpriteNode;Dt.registerNode;Dt.requestAnimationFrame;Dt.cancelAnimationFrame;Dt.ENV;function me(h){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var t=h.length;if(t<2)return"";var e=h[0],n=h[1];if(t===2)return"M".concat(de(e),"L").concat(de(n));var i="";for(var a=2,s=t-1;a<s;a++)e=h[a],n=h[a+1],i+=ge(e,n);return r?"M".concat(ge(h[0],h[1]),"Q").concat(de(h[1])).concat(ge(h[1],h[2]),"T").concat(i).concat(ge(h[t-1],h[0])).concat(ge(h[0],h[1]),"Z"):"M".concat(de(h[0]),"Q").concat(de(h[1])).concat(ge(h[1],h[2])).concat(h.length>3?"T":"").concat(i,"L").concat(de(h[t-1]));}var mr={exports:{}};mr.exports;(function(h){var r=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(o,f){if(!i[o]){i[o]={};for(var v=0;v<o.length;v++)i[o][o.charAt(v)]=v;}return i[o][f];}var s={compressToBase64:function compressToBase64(o){if(o==null)return"";var f=s._compress(o,6,function(v){return e.charAt(v);});switch(f.length%4){default:case 0:return f;case 1:return f+"===";case 2:return f+"==";case 3:return f+"=";}},decompressFromBase64:function decompressFromBase64(o){return o==null?"":o==""?null:s._decompress(o.length,32,function(f){return a(e,o.charAt(f));});},compressToUTF16:function compressToUTF16(o){return o==null?"":s._compress(o,15,function(f){return t(f+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(o){return o==null?"":o==""?null:s._decompress(o.length,16384,function(f){return o.charCodeAt(f)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
400
|
+
compressToUint8Array:function compressToUint8Array(o){for(var f=s.compress(o),v=new Uint8Array(f.length*2),l=0,p=f.length;l<p;l++){var y=f.charCodeAt(l);v[l*2]=y>>>8,v[l*2+1]=y%256;}return v;},//decompress from uint8array (UCS-2 big endian format)
|
|
401
|
+
decompressFromUint8Array:function decompressFromUint8Array(o){if(o==null)return s.decompress(o);for(var f=new Array(o.length/2),v=0,l=f.length;v<l;v++)f[v]=o[v*2]*256+o[v*2+1];var p=[];return f.forEach(function(y){p.push(t(y));}),s.decompress(p.join(""));},//compress into a string that is already URI encoded
|
|
402
|
+
compressToEncodedURIComponent:function compressToEncodedURIComponent(o){return o==null?"":s._compress(o,6,function(f){return n.charAt(f);});},//decompress from an output of compressToEncodedURIComponent
|
|
403
|
+
decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(o){return o==null?"":o==""?null:(o=o.replace(/ /g,"+"),s._decompress(o.length,32,function(f){return a(n,o.charAt(f));}));},compress:function compress(o){return s._compress(o,16,function(f){return t(f);});},_compress:function _compress(o,f,v){if(o==null)return"";var l,p,y={},O={},x="",m="",T="",c=2,d=3,u=2,g=[],M=0,A=0,I;for(I=0;I<o.length;I+=1)if(x=o.charAt(I),Object.prototype.hasOwnProperty.call(y,x)||(y[x]=d++,O[x]=!0),m=T+x,Object.prototype.hasOwnProperty.call(y,m))T=m;else{if(Object.prototype.hasOwnProperty.call(O,T)){if(T.charCodeAt(0)<256){for(l=0;l<u;l++)M=M<<1,A==f-1?(A=0,g.push(v(M)),M=0):A++;for(p=T.charCodeAt(0),l=0;l<8;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;}else{for(p=1,l=0;l<u;l++)M=M<<1|p,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=0;for(p=T.charCodeAt(0),l=0;l<16;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;}c--,c==0&&(c=Math.pow(2,u),u++),delete O[T];}else for(p=y[T],l=0;l<u;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;c--,c==0&&(c=Math.pow(2,u),u++),y[m]=d++,T=String(x);}if(T!==""){if(Object.prototype.hasOwnProperty.call(O,T)){if(T.charCodeAt(0)<256){for(l=0;l<u;l++)M=M<<1,A==f-1?(A=0,g.push(v(M)),M=0):A++;for(p=T.charCodeAt(0),l=0;l<8;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;}else{for(p=1,l=0;l<u;l++)M=M<<1|p,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=0;for(p=T.charCodeAt(0),l=0;l<16;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;}c--,c==0&&(c=Math.pow(2,u),u++),delete O[T];}else for(p=y[T],l=0;l<u;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;c--,c==0&&(c=Math.pow(2,u),u++);}for(p=2,l=0;l<u;l++)M=M<<1|p&1,A==f-1?(A=0,g.push(v(M)),M=0):A++,p=p>>1;for(;;)if(M=M<<1,A==f-1){g.push(v(M));break;}else A++;return g.join("");},decompress:function decompress(o){return o==null?"":o==""?null:s._decompress(o.length,32768,function(f){return o.charCodeAt(f);});},_decompress:function _decompress(o,f,v){var l=[],p=4,y=4,O=3,x="",m=[],T,c,d,u,g,M,A,I={val:v(0),position:f,index:1};for(T=0;T<3;T+=1)l[T]=T;for(d=0,g=Math.pow(2,2),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),d|=(u>0?1:0)*M,M<<=1;switch(d){case 0:for(d=0,g=Math.pow(2,8),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),d|=(u>0?1:0)*M,M<<=1;A=t(d);break;case 1:for(d=0,g=Math.pow(2,16),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),d|=(u>0?1:0)*M,M<<=1;A=t(d);break;case 2:return"";}for(l[3]=A,c=A,m.push(A);;){if(I.index>o)return"";for(d=0,g=Math.pow(2,O),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),d|=(u>0?1:0)*M,M<<=1;switch(A=d){case 0:for(d=0,g=Math.pow(2,8),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),d|=(u>0?1:0)*M,M<<=1;l[y++]=t(d),A=y-1,p--;break;case 1:for(d=0,g=Math.pow(2,16),M=1;M!=g;)u=I.val&I.position,I.position>>=1,I.position==0&&(I.position=f,I.val=v(I.index++)),d|=(u>0?1:0)*M,M<<=1;l[y++]=t(d),A=y-1,p--;break;case 2:return m.join("");}if(p==0&&(p=Math.pow(2,O),O++),l[A])x=l[A];else if(A===y)x=c+c.charAt(0);else return null;m.push(x),l[y++]=c+x.charAt(0),p--,c=x,p==0&&(p=Math.pow(2,O),O++);}}};return s;}();h!=null?h.exports=r:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return r;});})(mr);var Fn=mr.exports;function Ie(h){return JSON.parse(Fn.decompress(h));}function qt(h){return Fn.compress(JSON.stringify(h));}var jn=/*#__PURE__*/function(_yt){function jn(t){var _this50;_classCallCheck(this,jn);_this50=_callSuper(this,jn,[t]);nt(_this50,"canRotate",!0);nt(_this50,"scaleType",zt.all);nt(_this50,"toolsType",ht.Pencil);nt(_this50,"syncTimestamp");nt(_this50,"syncIndex",0);nt(_this50,"tmpPoints",[]);nt(_this50,"MAX_REPEAR",10);/** 合并原始点的灵敏度 */nt(_this50,"uniThickness");nt(_this50,"workOptions");nt(_this50,"centerPos",[0,0]);_this50.workOptions=t.toolsOpt,_this50.uniThickness=_this50.MAX_REPEAR/_this50.workOptions.thickness/10,_this50.syncTimestamp=0;return _this50;}/** 批量合并消费本地数据,返回绘制结果 */_inherits(jn,_yt);return _createClass(jn,[{key:"combineConsume",value:function combineConsume(){var s;var t=(s=this.workId)==null?void 0:s.toString(),e=this.transformDataAll(!0),n={name:t};var i;var a=this.drawLayer||this.fullLayer;return e.length&&(i=this.draw({attrs:n,tasks:e,replaceId:t,layer:a})),{rect:i,type:ct.DrawWork,dataType:Tt.Local};}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(jn.prototype),"setWorkOptions",this).call(this,t),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var _this51=this;var c;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,s=t.drawCount,o=t.replaceId;if(((c=e.op)==null?void 0:c.length)===0)return{type:ct.None};var f=e.workId,_this$transformData=this.transformData(e,!1),v=_this$transformData.tasks,l=_this$transformData.effects,p=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,p,Math.max(0,this.tmpPoints.length-2));var y={name:f==null?void 0:f.toString(),id:s==null?void 0:s.toString()};var O,x=!1;var m=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),v.length&&(v[0].taskId-this.syncTimestamp>this.syncUnitTime&&(x=!0,this.syncTimestamp=v[0].taskId,this.syncIndex=this.tmpPoints.length),i||a)){var d=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({attrs:y,tasks:v,effects:l,layer:d,replaceId:o});}if(i)return p>10&&this.tmpPoints.splice(0,p-10),{rect:O,type:ct.DrawWork,dataType:Tt.Local};var T=[];return this.tmpPoints.slice(m).forEach(function(d){T.push(d.x,d.y,_this51.computRadius(d.z,_this51.workOptions.thickness));}),{rect:O,type:ct.DrawWork,dataType:Tt.Local,workId:x?f:void 0,op:x?T:void 0,index:x?m*3:void 0};}},{key:"consumeAll",value:function consumeAll(t){var _this52=this;var v,l;if(t.data){var _t$data=t.data,p=_t$data.op,y=_t$data.workState;p!=null&&p.length&&y===Rt.Done&&this.workOptions.strokeType===Vt.Stroke&&this.updateTempPointsWithPressureWhenDone(p);}var e=(v=this.workId)==null?void 0:v.toString();if(!e)return{type:ct.None};var n=this.transformDataAll(!0),i={name:e};var a;var s=this.fullLayer;n.length&&(a=this.draw({attrs:i,tasks:n,replaceId:e,layer:s}));var o=[];this.tmpPoints.map(function(p){o.push(p.x,p.y,_this52.computRadius(p.z,_this52.workOptions.thickness));}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var f=qt(o);return(l=this.vNodes)==null||l.setInfo(e,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,s)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:e,ops:f,updateNodeOpt:{pos:this.centerPos,useAnimation:!0},opt:this.workOptions};}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var v,l;var e=t.op,n=t.isFullWork,i=t.replaceId;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3){var y=new xt(e[p],e[p+1],e[p+2]);if(this.tmpPoints.length>0){var O=this.tmpPoints[this.tmpPoints.length-1],x=_.Sub(y,O).uni();y.setv(x);}this.tmpPoints.push(y);}var a=this.transformDataAll(!1),s=(v=this.workId)==null?void 0:v.toString(),o={name:s};var f;if(s&&a.length){var _p2=n?this.fullLayer:this.drawLayer||this.fullLayer;f=this.draw({attrs:o,tasks:a,replaceId:i,layer:_p2}),(l=this.vNodes)==null||l.setInfo(s,{rect:f,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&yt.getCenterPos(f,_p2)});}return f;}},{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 _this53=this;var e=t.attrs,n=t.tasks,i=t.replaceId,a=t.effects,s=t.layer,_this$workOptions=this.workOptions,o=_this$workOptions.strokeColor,f=_this$workOptions.strokeType,v=_this$workOptions.thickness,l=_this$workOptions.zIndex,p=_this$workOptions.scale,y=_this$workOptions.rotate,O=_this$workOptions.translate;a!=null&&a.size&&(a.forEach(function(u){var g;(g=s.getElementById(u+""))==null||g.remove();}),a.clear());var x;var m=[],T=s.worldPosition,c=s.worldScaling;for(var u=0;u<n.length;u++){var _n$u=n[u],g=_n$u.pos,M=_n$u.points,_this$computDrawPoint=this.computDrawPoints(M),A=_this$computDrawPoint.ps,I=_this$computDrawPoint.rect;var b=void 0;var E=M.length===1;f===Vt.Stroke||E?b=me(A,!0):b=me(A,!1);var L={pos:g,d:b,fillColor:f===Vt.Stroke||E?o:void 0,lineDash:f===Vt.Dotted&&!E?[1,v*2]:f===Vt.LongDotted&&!E?[v,v*2]:void 0,strokeColor:o,lineCap:f===Vt.Stroke||E?void 0:"round",lineWidth:f===Vt.Stroke||E?0:v};x=Ot(x,{x:Math.floor((I.x+g[0])*c[0]+T[0]-yt.SafeBorderPadding),y:Math.floor((I.y+g[1])*c[1]+T[1]-yt.SafeBorderPadding),w:Math.floor(I.w*c[0]+2*yt.SafeBorderPadding),h:Math.floor(I.h*c[1]+2*yt.SafeBorderPadding)}),m.push(L);}p&&(e.scale=p),y&&(e.rotate=y),O&&(e.translate=O);var d=new ne();if(x){this.centerPos=yt.getCenterPos(x,s),d.attr(_objectSpread(_objectSpread({},e),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:f===Vt.Stroke?o:void 0,pos:this.centerPos,size:[(x.w-2*yt.SafeBorderPadding)/c[0],(x.h-2*yt.SafeBorderPadding)/c[1]],zIndex:l}));var _u10=m.map(function(g){return g.pos=[g.pos[0]-_this53.centerPos[0],g.pos[1]-_this53.centerPos[1]],new he(g);});d.append.apply(d,_toConsumableArray(_u10)),f===Vt.Stroke&&d.seal(),this.replace(s,i||e.workId,d);}if(p||y||O){var _u11=d==null?void 0:d.getBoundingClientRect();if(_u11)return{x:Math.floor(_u11.x-yt.SafeBorderPadding),y:Math.floor(_u11.y-yt.SafeBorderPadding),w:Math.floor(_u11.width+yt.SafeBorderPadding*2),h:Math.floor(_u11.height+yt.SafeBorderPadding*2)};}return x;}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.workOptions.strokeType===Vt.Stroke||t.length===1?this.computStroke(t):this.computNomal(t);}},{key:"computNomal",value:function computNomal(t){var e=this.workOptions.thickness;var n=t.map(function(i){return e=Math.max(e,i.radius),i.point;});return{ps:n,rect:Nt(n,e)};}},{key:"computStroke",value:function computStroke(t){return t.length===1?this.computDotStroke(t[0]):this.computLineStroke(t);}},{key:"computLineStroke",value:function computLineStroke(t){var e=[],n=[];for(var f=0;f<t.length;f++){var _t$f=t[f],v=_t$f.point,l=_t$f.radius;var p=v.v;f===0&&t.length>1&&(p=t[f+1].point.v);var y=_.Per(p).mul(l);e.push(xt.Sub(v,y)),n.push(xt.Add(v,y));}var i=t[t.length-1],a=xt.GetSemicircleStroke(i.point,e[e.length-1],-1,8),s=xt.GetSemicircleStroke(t[0].point,n[0],-1,8),o=e.concat(a,n.reverse(),s);return{ps:o,rect:Nt(o)};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:xt.GetDotStroke(e,n,8),rect:i};}},{key:"transformData",value:function transformData(t,e){var n=t.op,i=t.workState;var a=this.tmpPoints.length-1,s=[];if(n!=null&&n.length&&i){var _this$workOptions2=this.workOptions,o=_this$workOptions2.strokeType,f=_this$workOptions2.thickness,v=/* @__PURE__ */new Set();a=o===Vt.Stroke?this.updateTempPointsWithPressure(n,f,v):this.updateTempPoints(n,f,v);var l=e?this.tmpPoints:this.tmpPoints.slice(a);return s=this.getTaskPoints(l,f),{tasks:s,effects:v,consumeIndex:a};}return{tasks:s,consumeIndex:a};}/** 压力渐变公式 */},{key:"computRadius",value:function computRadius(t,e){return t*0.03*e+e*0.5;}},{key:"getMinZ",value:function getMinZ(t,e){return((e||Math.max(1,Math.floor(t*0.3)))-t*0.5)*100/t/3;}},{key:"getTaskPoints",value:function getTaskPoints(t,e){var l;var n=[];if(t.length===0)return[];var i=0,a=t[0].x,s=t[0].y,o=[a,s],f=[],v=t[0].t;for(;i<t.length;){var p=t[i],y=p.x-a,O=p.y-s,x=p.z,m=e?this.computRadius(x,e):x;if(f.push({point:new xt(y,O,x,t[i].v),radius:m}),i>0&&i<t.length-1){var _T32=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_T32<90||_T32>270){var _c28=(l=f.pop())==null?void 0:l.point.clone();_c28&&n.push({taskId:v,pos:o,points:[].concat(_toConsumableArray(f),[{point:_c28,radius:m}])}),a=t[i].x,s=t[i].y,o=[a,s];var d=p.x-a,u=p.y-s;f=[{point:new xt(d,u,x),radius:m}],v=Date.now();}}i++;}return n.push({taskId:v,pos:o,points:f}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,e,n){var i=Date.now(),a=this.tmpPoints.length;var s=a;for(var f=0;f<t.length;f+=2){s=Math.min(s,a);var v=this.tmpPoints.length,l=new xt(t[f],t[f+1]);if(v===0){this.tmpPoints.push(l);continue;}var p=v-1,y=this.tmpPoints[p],O=_.Sub(l,y).uni();if(l.isNear(y,e)){if(y.z<this.MAX_REPEAR){if(y.setz(Math.min(y.z+1,this.MAX_REPEAR)),s=Math.min(s,p),v>1){var _T33=v-1;for(;_T33>0;){var _c29=this.tmpPoints[_T33].distance(this.tmpPoints[_T33-1]),d=Math.max(this.tmpPoints[_T33].z-this.uniThickness*_c29,0);if(this.tmpPoints[_T33-1].z>=d)break;this.tmpPoints[_T33-1].setz(d),s=Math.min(s,_T33-1),_T33--;}}}else s=1/0;continue;}l.setv(O);var x=l.distance(y),m=Math.max(y.z-this.uniThickness*x,0);v>1&&_.Equals(O,y.v,0.02)&&(m>0||y.z<=0)&&(n&&y.t&&n.add(y.t),this.tmpPoints.pop(),s=Math.min(p,s)),l.setz(m),this.tmpPoints.push(l);}if(s===1/0)return this.tmpPoints.length;var o=a;if(s===a){o=Math.max(o-1,0);var _f3=this.tmpPoints[o].t;_f3&&(n==null||n.add(_f3));}else{var _f4=a-1;for(o=s;_f4>=0;){var _v3=this.tmpPoints[_f4].t;if(_v3&&(n==null||n.add(_v3),_f4<=s)){o=_f4,_f4=-1;break;}_f4--;}}return this.tmpPoints[o].setT(i),o;}},{key:"updateTempPoints",value:function updateTempPoints(t,e,n){var f;var i=Date.now(),a=this.tmpPoints.length;var s=a;for(var v=0;v<t.length;v+=2){var l=this.tmpPoints.length,p=new xt(t[v],t[v+1]);if(l===0){this.tmpPoints.push(p);continue;}var y=l-1,O=this.tmpPoints[y],x=_.Sub(p,O).uni();if(p.isNear(O,e/2)){s=Math.min(y,s);continue;}_.Equals(x,O.v,0.02)&&(n&&O.t&&n.add(O.t),this.tmpPoints.pop(),s=Math.min(y,s)),p.setv(x),this.tmpPoints.push(p);}var o=a;if(s===a){o=Math.max(o-1,0);var _v4=this.tmpPoints[o].t;_v4&&(n==null||n.add(_v4));}else{var _v5=Math.min(a-1,s);for(o=s;_v5>=0;){var _l4=(f=this.tmpPoints[_v5])==null?void 0:f.t;if(_l4&&(n==null||n.add(_l4),_v5<=s)){o=_v5,_v5=-1;break;}_v5--;}}return this.tmpPoints[o].setT(i),o;}},{key:"updateTempPointsWithPressureWhenDone",value:function updateTempPointsWithPressureWhenDone(t){var e=this.workOptions.thickness,n=t.length,i=this.getMinZ(e);for(var a=0;a<n;a+=2){var s=this.tmpPoints.length,o=new xt(t[a],t[a+1]);if(s===0){this.tmpPoints.push(o);continue;}var f=s-1,v=this.tmpPoints[f],l=_.Sub(o,v).uni(),p=o.distance(v);if(s>1&&v.z===i)break;if(o.isNear(v,e/2)){if(n<3&&v.z<this.MAX_REPEAR&&(v.setz(Math.min(v.z+1,this.MAX_REPEAR)),s>1)){var O=s-1;for(;O>0;){var x=this.tmpPoints[O].distance(this.tmpPoints[O-1]),m=Math.max(this.tmpPoints[O].z-this.uniThickness*x,-e/4);if(this.tmpPoints[O-1].z>=m)break;this.tmpPoints[O-1].setz(m),O--;}}continue;}o.setv(l);var y=Math.max(v.z-this.uniThickness*p,i);s>1&&_.Equals(l,v.v,0.02)&&v.z<=0&&this.tmpPoints.pop(),o.setz(y),this.tmpPoints.push(o);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var o;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,s=i.get(e.name);return a&&(e.tagName==="GROUP"?Fh(e)?e.setAttribute("bgcolor",a):e.children.forEach(function(f){f.setAttribute("strokeColor",a),f.getAttribute("fillColor")&&f.setAttribute("fillColor",a);}):(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a)),(o=s==null?void 0:s.opt)!=null&&o.strokeColor&&(s.opt.strokeColor=a)),s&&i.setInfo(e.name,s),yt.updateNodeOpt(t);}// static getRectFromLayer(layer: Group, name:string): IRectType|undefined {
|
|
404
|
+
// const node = layer.getElementsByName(name)[0] as ShapeNodes;
|
|
405
|
+
// if (node) {
|
|
406
|
+
// const r = node.getBoundingClientRect();
|
|
407
|
+
// console.log('r', r.x, r.y, r.width, r.height)
|
|
408
|
+
// return {
|
|
409
|
+
// x: Math.floor(r.x - BaseShapeTool.SafeBorderPadding),
|
|
410
|
+
// y: Math.floor(r.y - BaseShapeTool.SafeBorderPadding),
|
|
411
|
+
// w: Math.floor(r.width + BaseShapeTool.SafeBorderPadding * 2),
|
|
412
|
+
// h: Math.floor(r.height + BaseShapeTool.SafeBorderPadding * 2)
|
|
413
|
+
// }
|
|
414
|
+
// }
|
|
415
|
+
// return undefined
|
|
416
|
+
// }
|
|
417
|
+
}]);}(yt);var Un=/*#__PURE__*/function(_yt2){function Un(t){var _this54;_classCallCheck(this,Un);_this54=_callSuper(this,Un,[t]);nt(_this54,"toolsType",ht.LaserPen);nt(_this54,"canRotate",!1);nt(_this54,"scaleType",zt.none);nt(_this54,"syncTimestamp");nt(_this54,"syncIndex",0);nt(_this54,"tmpPoints",[]);nt(_this54,"workOptions");nt(_this54,"consumeIndex",0);_this54.workOptions=t.toolsOpt,_this54.syncTimestamp=0;return _this54;}_inherits(Un,_yt2);return _createClass(Un,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(Un.prototype),"setWorkOptions",this).call(this,t),this.syncTimestamp=Date.now();}},{key:"consume",value:function consume(t){var e=t.data,n=t.isSubWorker,i=e.workId,a=e.op;if((a==null?void 0:a.length)===0)return{type:ct.None};if(this.updateTempPoints(a||[]),this.consumeIndex>this.tmpPoints.length-4)return{type:ct.None};var _this$workOptions3=this.workOptions,s=_this$workOptions3.strokeColor,o=_this$workOptions3.thickness,f=_this$workOptions3.strokeType,v=Nt(this.tmpPoints,o);var l=!1;var p=this.syncIndex,y=this.tmpPoints.slice(this.consumeIndex);this.consumeIndex=this.tmpPoints.length-1,this.syncTimestamp===0&&(this.syncTimestamp=Date.now());var O={name:i==null?void 0:i.toString(),opacity:1,lineDash:f===Vt.Dotted?[1,o*2]:f===Vt.LongDotted?[o,o*2]:void 0,strokeColor:s,lineCap:"round",lineWidth:o,anchor:[0.5,0.5]},x=this.getTaskPoints(y);if(x.length){var _T34=Date.now();_T34-this.syncTimestamp>this.syncUnitTime&&(l=!0,this.syncTimestamp=_T34,this.syncIndex=this.tmpPoints.length),n&&this.draw({attrs:O,tasks:x,isDot:!1,layer:this.drawLayer||this.fullLayer});}var m=[];return this.tmpPoints.slice(p).forEach(function(T){m.push(T.x,T.y);}),{rect:{x:v.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:v.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:v.w*this.fullLayer.worldScaling[0],h:v.h*this.fullLayer.worldScaling[1]},type:ct.DrawWork,dataType:Tt.Local,workId:l?i:void 0,op:l?m:void 0,index:l?p*2:void 0};}},{key:"consumeAll",value:function consumeAll(){var a;var t=(a=this.workId)==null?void 0:a.toString();var e;if(this.tmpPoints.length-1>this.consumeIndex){var s=this.tmpPoints.slice(this.consumeIndex);var o=s.length===1,_this$workOptions4=this.workOptions,f=_this$workOptions4.strokeColor,v=_this$workOptions4.thickness,l=_this$workOptions4.strokeType;if(o){var O=this.computDotStroke({point:s[0],radius:v/2});s=O.ps,e=O.rect;}else e=Nt(this.tmpPoints,v);var p={name:t==null?void 0:t.toString(),fillColor:o?f:void 0,opacity:1,lineDash:l===Vt.Dotted&&!o?[1,v*2]:l===Vt.LongDotted&&!o?[v,v*2]:void 0,strokeColor:f,lineCap:o?void 0:"round",lineWidth:o?0:v,anchor:[0.5,0.5]},y=this.getTaskPoints(s);y.length&&this.draw({attrs:p,tasks:y,isDot:o,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(s){n.push(s.x,s.y);});var i=qt(n);return{rect:e&&{x:e.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:e.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:e.w*this.fullLayer.worldScaling[0],h:e.h*this.fullLayer.worldScaling[1]},type:ct.FullWork,dataType:Tt.Local,workId:t,ops:i,index:this.syncIndex*2};}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0,this.syncTimestamp=0,this.syncIndex=0;}},{key:"consumeService",value:function consumeService(t){var x;var e=t.op,n=t.replaceId,i=t.isFullWork,_this$workOptions5=this.workOptions,a=_this$workOptions5.strokeColor,s=_this$workOptions5.thickness,o=_this$workOptions5.strokeType;if(!e.length){var m=Nt(this.tmpPoints,s);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]};}var f=Math.max(0,this.tmpPoints.length-1);this.updateTempPoints(e||[]);var v,l=this.tmpPoints.slice(f);var p=l.length===1;if(p){var _m6=this.computDotStroke({point:l[0],radius:s/2});l=_m6.ps,v=_m6.rect;}else v=Nt(this.tmpPoints,s);var y={name:(x=this.workId)==null?void 0:x.toString(),fillColor:p?a:void 0,opacity:1,lineDash:o===Vt.Dotted&&!p?[1,s*2]:o===Vt.LongDotted&&!p?[s,s*2]:void 0,strokeColor:a,lineCap:p?void 0:"round",lineWidth:p?0:s,anchor:[0.5,0.5]},O=this.getTaskPoints(l);if(O.length){var _m7=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:y,tasks:O,isDot:p,replaceId:n,layer:_m7});}return{x:v.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:v.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:v.w*this.fullLayer.worldScaling[0],h:v.h*this.fullLayer.worldScaling[1]};}},{key:"computDotStroke",value:function computDotStroke(t){var e=t.point,n=t.radius,i={x:e.x-n,y:e.y-n,w:n*2,h:n*2};return{ps:xt.GetDotStroke(e,n,8),rect:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length;for(var n=0;n<t.length;n+=2){if(e){var i=this.tmpPoints.slice(-1)[0];i&&i.x===t[n]&&i.y===t[n+1]&&this.tmpPoints.pop();}this.tmpPoints.push(new xt(t[n],t[n+1]));}}},{key:"draw",value:function(){var _draw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(t){var _this55=this;var e,n,i,a,s,_iterator2,_step2,_loop3;return _regeneratorRuntime().wrap(function _callee12$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:e=t.attrs,n=t.tasks,i=t.isDot,a=t.layer,s=this.workOptions.duration;_iterator2=_createForOfIteratorHelper(n);_context14.prev=2;_loop3=/*#__PURE__*/_regeneratorRuntime().mark(function _loop3(){var o,f,v,l,p,_this55$workOptions,y,O,x,_a$getResolution,m,_T35;return _regeneratorRuntime().wrap(function _loop3$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:o=_step2.value;f=new he(),v=o.pos,l=o.points;i?p=me(l,!0):p=me(l,!1),f.attr(_objectSpread(_objectSpread({},e),{},{pos:v,d:p}));_this55$workOptions=_this55.workOptions,y=_this55$workOptions.vertex,O=_this55$workOptions.fragment;if(y&&O){x=a.renderer.createProgram({vertex:y,fragment:O}),_a$getResolution=a.getResolution(),m=_a$getResolution.width,_T35=_a$getResolution.height;f.setUniforms({u_time:0,u_resolution:[m,_T35]}),f.setProgram(x);}a.appendChild(f),f.transition(s).attr({scale:i?[0.1,0.1]:[1,1],lineWidth:i?0:1}).then(function(){f.remove();});case 6:case"end":return _context13.stop();}},_loop3);});_iterator2.s();case 5:if((_step2=_iterator2.n()).done){_context14.next=9;break;}return _context14.delegateYield(_loop3(),"t0",7);case 7:_context14.next=5;break;case 9:_context14.next=14;break;case 11:_context14.prev=11;_context14.t1=_context14["catch"](2);_iterator2.e(_context14.t1);case 14:_context14.prev=14;_iterator2.f();return _context14.finish(14);case 17:case"end":return _context14.stop();}},_callee12,this,[[2,11,14,17]]);}));function draw(_x16){return _draw2.apply(this,arguments);}return draw;}()},{key:"getTaskPoints",value:function getTaskPoints(t){var f;var e=[];if(t.length===0)return[];var n=0,i=t[0].x,a=t[0].y,s=[i,a],o=[];for(;n<t.length;){var v=t[n],l=v.x-i,p=v.y-a;if(o.push(new xt(l,p)),n>0&&n<t.length-1){var y=t[n].getAngleByPoints(t[n-1],t[n+1]);if(y<90||y>270){var O=(f=o.pop())==null?void 0:f.clone();O&&e.push({pos:s,points:[].concat(_toConsumableArray(o),[O])}),i=t[n].x,a=t[n].y,s=[i,a];var x=v.x-i,m=v.y-a;o=[new xt(x,m)];}}n++;}return e.push({pos:s,points:o}),e;}},{key:"removeLocal",value:function removeLocal(){}},{key:"removeService",value:function removeService(t){var e;var n=[];return this.fullLayer.getElementsByName(t).forEach(function(i){if(i.name===t){var a=i.getBoundingClientRect();e=Ot(e,{x:a.x,y:a.y,w:a.width,h:a.height}),n.push(i);}}),n.length&&n.forEach(function(i){return i.remove();}),e;}}]);}(yt);var Jh=Ue;Ue.polyline=Ue;Ue.polygon=Qh;function Ue(h,r,t){var e=h.length,n=pe(h[0],r),i=[],a,s,o,f,v;for(t||(t=[]),a=1;a<e;a++){for(s=h[a-1],o=h[a],f=v=pe(o,r);;)if(n|f){if(n&f)break;n?(s=sr(s,o,n,r),n=pe(s,r)):(o=sr(s,o,f,r),f=pe(o,r));}else{i.push(s),f!==v?(i.push(o),a<e-1&&(t.push(i),i=[])):a===e-1&&i.push(o);break;}n=v;}return i.length&&t.push(i),t;}function Qh(h,r){var t,e,n,i,a,s,o;for(e=1;e<=8;e*=2){for(t=[],n=h[h.length-1],i=!(pe(n,r)&e),a=0;a<h.length;a++)s=h[a],o=!(pe(s,r)&e),o!==i&&t.push(sr(n,s,e,r)),o&&t.push(s),n=s,i=o;if(h=t,!h.length)break;}return t;}function sr(h,r,t,e){return t&8?[h[0]+(r[0]-h[0])*(e[3]-h[1])/(r[1]-h[1]),e[3]]:// top
|
|
418
|
+
t&4?[h[0]+(r[0]-h[0])*(e[1]-h[1])/(r[1]-h[1]),e[1]]:// bottom
|
|
419
|
+
t&2?[e[2],h[1]+(r[1]-h[1])*(e[2]-h[0])/(r[0]-h[0])]:// right
|
|
420
|
+
t&1?[e[0],h[1]+(r[1]-h[1])*(e[0]-h[0])/(r[0]-h[0])]:// left
|
|
421
|
+
null;}function pe(h,r){var t=0;return h[0]<r[0]?t|=1:h[0]>r[2]&&(t|=2),h[1]<r[1]?t|=4:h[1]>r[3]&&(t|=8),t;}var Zh=/* @__PURE__ */ye(Jh);var ve=/*#__PURE__*/function(_yt3){function ve(t,e){var _this56;_classCallCheck(this,ve);_this56=_callSuper(this,ve,[t]);nt(_this56,"canRotate",!1);nt(_this56,"scaleType",zt.none);nt(_this56,"toolsType",ht.Eraser);nt(_this56,"serviceWork");nt(_this56,"tmpPoints",[]);nt(_this56,"workOptions");nt(_this56,"worldPosition");nt(_this56,"worldScaling");nt(_this56,"eraserRect");nt(_this56,"eraserPolyline");_this56.serviceWork=e,_this56.workOptions=t.toolsOpt,_this56.worldPosition=_this56.fullLayer.worldPosition,_this56.worldScaling=_this56.fullLayer.worldScaling;return _this56;}_inherits(ve,_yt3);return _createClass(ve,[{key:"combineConsume",value:function combineConsume(){}},{key:"consumeService",value:function consumeService(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(ve.prototype),"setWorkOptions",this).call(this,t);}},{key:"createEraserRect",value:function createEraserRect(t){var e=t[0]*this.worldScaling[0]+this.worldPosition[0],n=t[1]*this.worldScaling[1]+this.worldPosition[1],_ve$eraserSizes$this$=ve.eraserSizes[this.workOptions.thickness],i=_ve$eraserSizes$this$.width,a=_ve$eraserSizes$this$.height;this.eraserRect={x:e-i*0.5,y:n-a*0.5,w:i,h:a},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 _e4=new _(this.tmpPoints[0],this.tmpPoints[1]),n=new _(this.tmpPoints[2],this.tmpPoints[3]),i=_.Sub(n,_e4).uni(),a=_.Dist(_e4,n),_ve$eraserSizes$this$2=ve.eraserSizes[this.workOptions.thickness],s=_ve$eraserSizes$this$2.width,o=_ve$eraserSizes$this$2.height,f=Math.min(s,o),v=Math.round(a/f);if(v>1){var l=[];for(var p=0;p<v;p++){var y=_.Mul(i,p*f);l.push(this.tmpPoints[0]+y.x,this.tmpPoints[1]+y.y);}return l.concat(t);}}return t;}},{key:"isNear",value:function isNear(t,e){var n=new _(t[0],t[1]),i=new _(e[0],e[1]),_ve$eraserSizes$this$3=ve.eraserSizes[this.workOptions.thickness],a=_ve$eraserSizes$this$3.width,s=_ve$eraserSizes$this$3.height;return _.Dist(n,i)<Math.hypot(a,s)*0.5;}},{key:"cutPolyline",value:function cutPolyline(t,e){var n=[e],i=0;for(;i<t.length;){var o=t[i];if(o.length<2)break;n=a(n,o),i++;}return n;function a(o,f){var v=o;var _loop4=function _loop4(){var p=o[l],y=p.findIndex(function(O,x){return x<p.length-1?s([O,p[x+1]],[f[0],f[1]]):!1;});if(y!==-1&&y>-1){var O=[],x=p.slice(0,y+1);if(_.Equals(p[y],f[0])||x.push(f[0].clone().setz(p[y].z)),x.length>1&&O.push(x),y+f.length-1<p.length-1){var m=y+f.length-1,_T36=p.slice(m),_c30=f[f.length-1];_.Equals(p[m],_c30)||_T36.unshift(_c30.clone().setz(p[m].z)),_T36.length>1&&O.push(_T36);}return{v:(v.splice.apply(v,[l,1].concat(O)),v)};}},_ret;for(var l=0;l<o.length;l++){_ret=_loop4();if(_ret)return _ret.v;}return v;}function s(o,f){var v=_.Sub(o[1],o[0]),l=_.Sub(f[1],f[0]),p=_.Sub(f[0],o[0]);return Math.abs(_.Cpr(v,l))<0.1&&Math.abs(_.Cpr(v,p))<0.1;}}},{key:"isSamePoint",value:function isSamePoint(t,e){return t[0]===e[0]&&t[1]===e[1];}},{key:"translateIntersect",value:function translateIntersect(t){var _this57=this;var e=[];for(var n=0;n<t.length;n++){var i=t[n].filter(function(o,f,v){return!(f>0&&_this57.isSamePoint(o,v[f-1]));}),a=[];var s=0;for(;s<i.length;){var o=i[s],f=new _(o[0],o[1]);a.push(f),s++;}e.push(a);}return e;}},{key:"isLineEraser",value:function isLineEraser(t,e){return!(t===ht.Pencil&&!e);}},{key:"remove",value:function remove(t){var _this58=this;var e=t.curNodeMap,n=t.removeIds,i=t.newWorkDatas,a=this.workOptions.isLine;var s;var _iterator3=_createForOfIteratorHelper(e.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),o=_step3$value[0],f=_step3$value[1];if(f.rect&&this.eraserRect&&this.eraserPolyline&&Ce(this.eraserRect,f.rect)){var v=f.op,l=f.toolsType,p=this.isLineEraser(l,a),y=[],O=[];for(var m=0;m<v.length;m+=3){var _T37=new _(v[m]*this.worldScaling[0]+this.worldPosition[0],v[m+1]*this.worldScaling[1]+this.worldPosition[1],v[m+2]);O.push(_T37),y.push(new xt(_T37.x,_T37.y));}var x=y.length&&Nt(y)||f.rect;if(Ce(x,this.eraserRect)){if(O.length>1){var _m8=Zh.polyline(O.map(function(T){return T.XY;}),this.eraserPolyline);if(_m8.length&&(n.add(f.name),!p)){var _T38=this.translateIntersect(_m8),_c31=this.cutPolyline(_T38,O);var _loop5=function _loop5(){var u="".concat(o,"_s_").concat(d),g=[];_c31[d].forEach(function(M){g.push((M.x-_this58.worldPosition[0])/_this58.worldScaling[0],(M.y-_this58.worldPosition[1])/_this58.worldScaling[1],M.z);}),f.opt&&f.toolsType&&_this58.vNodes&&(_this58.vNodes.setInfo(u,{rect:x,op:g,opt:f.opt,canRotate:f.canRotate,scaleType:f.scaleType,toolsType:f.toolsType}),i.set(u,{workId:u,op:g,opt:f.opt,toolsType:f.toolsType}));};for(var d=0;d<_c31.length;d++){_loop5();}}}else n.add(f.name);s=Ot(s,x);}}}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}return n.forEach(function(o){var f;return(f=_this58.vNodes)==null?void 0:f["delete"](o);}),s&&(s.x-=yt.SafeBorderPadding,s.y-=yt.SafeBorderPadding,s.w+=yt.SafeBorderPadding*2,s.h+=yt.SafeBorderPadding*2),s;}},{key:"consume",value:function consume(t){var e=t.data.op;if(!e||e.length===0)return{type:ct.None};var n=this.tmpPoints.length;if(n>1&&this.isNear([e[0],e[1]],[this.tmpPoints[n-2],this.tmpPoints[n-1]]))return{type:ct.None};n===4&&(this.tmpPoints.shift(),this.tmpPoints.shift()),this.tmpPoints.push(e[0],e[1]);var i=this.computRectCenterPoints();var a;var s=/* @__PURE__ */new Set(),o=/* @__PURE__ */new Map();if(!this.vNodes)return{type:ct.None};this.vNodes.setTarget();var f=this.getUnLockNodeMap(this.vNodes.getLastTarget());for(var v=0;v<i.length-1;v+=2){this.createEraserRect(i.slice(v,v+2));var l=this.remove({curNodeMap:f,removeIds:s,newWorkDatas:o});a=Ot(a,l);}if(this.vNodes.deleteLastTarget(),a&&s.size){var _iterator4=_createForOfIteratorHelper(o.keys()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _v6=_step4.value;s.has(_v6)&&o["delete"](_v6);}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}return{type:ct.RemoveNode,dataType:Tt.Local,rect:a,removeIds:_toConsumableArray(s),newWorkDatas:o};}return{type:ct.None};}},{key:"consumeAll",value:function consumeAll(t){return this.consume(t);}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"getUnLockNodeMap",value:function getUnLockNodeMap(t){var e;if(this.serviceWork){var n=Xt(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;var _iterator5=_createForOfIteratorHelper(i.values()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var s=_step5.value;if((e=s.selectIds)!=null&&e.length){var _iterator7=_createForOfIteratorHelper(s.selectIds),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var o=_step7.value;n["delete"](o);}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}var _iterator6=_createForOfIteratorHelper(a.keys()),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _s3=_step6.value;n["delete"](_s3);}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}return n;}return t;}}]);}(yt);nt(ve,"eraserSizes",Object.freeze([Object.freeze({width:18,height:26}),Object.freeze({width:26,height:34}),Object.freeze({width:34,height:50})]));var ie=ve;var yr="++",kh="selector",qh="all";var _h="__lodash_hash_undefined__";function td(h){return this.__data__.set(h,_h),this;}var ed=td;function rd(h){return this.__data__.has(h);}var nd=rd,id=hn,sd=ed,od=nd;function $e(h){var r=-1,t=h==null?0:h.length;for(this.__data__=new id();++r<t;)this.add(h[r]);}$e.prototype.add=$e.prototype.push=sd;$e.prototype.has=od;var ad=$e;function ld(h,r){for(var t=-1,e=h==null?0:h.length;++t<e;)if(r(h[t],t,h))return!0;return!1;}var cd=ld;function fd(h,r){return h.has(r);}var ud=fd,hd=ad,dd=cd,gd=ud,pd=1,vd=2;function md(h,r,t,e,n,i){var a=t&pd,s=h.length,o=r.length;if(s!=o&&!(a&&o>s))return!1;var f=i.get(h),v=i.get(r);if(f&&v)return f==r&&v==h;var l=-1,p=!0,y=t&vd?new hd():void 0;for(i.set(h,r),i.set(r,h);++l<s;){var O=h[l],x=r[l];if(e)var m=a?e(x,O,l,r,h,i):e(O,x,l,h,r,i);if(m!==void 0){if(m)continue;p=!1;break;}if(y){if(!dd(r,function(T,c){if(!gd(y,c)&&(O===T||n(O,T,t,e,i)))return y.push(c);})){p=!1;break;}}else if(!(O===x||n(O,x,t,e,i))){p=!1;break;}}return i["delete"](h),i["delete"](r),p;}var $n=md;function yd(h){var r=-1,t=Array(h.size);return h.forEach(function(e,n){t[++r]=[n,e];}),t;}var Sd=yd;function xd(h){var r=-1,t=Array(h.size);return h.forEach(function(e){t[++r]=e;}),t;}var Td=xd,Xr=He,Jr=In,Md=ar,Od=$n,Ed=Sd,Pd=Td,Ad=1,Cd=2,Rd="[object Boolean]",Id="[object Date]",Ld="[object Error]",bd="[object Map]",Dd="[object Number]",wd="[object RegExp]",Nd="[object Set]",Wd="[object String]",Bd="[object Symbol]",Fd="[object ArrayBuffer]",jd="[object DataView]",Qr=Xr?Xr.prototype:void 0,Ze=Qr?Qr.valueOf:void 0;function Ud(h,r,t,e,n,i,a){switch(t){case jd:if(h.byteLength!=r.byteLength||h.byteOffset!=r.byteOffset)return!1;h=h.buffer,r=r.buffer;case Fd:return!(h.byteLength!=r.byteLength||!i(new Jr(h),new Jr(r)));case Rd:case Id:case Dd:return Md(+h,+r);case Ld:return h.name==r.name&&h.message==r.message;case wd:case Wd:return h==r+"";case bd:var s=Ed;case Nd:var o=e&Ad;if(s||(s=Pd),h.size!=r.size&&!o)return!1;var f=a.get(h);if(f)return f==r;e|=Cd,a.set(h,r);var v=Od(s(h),s(r),e,n,i,a);return a["delete"](h),v;case Bd:if(Ze)return Ze.call(h)==Ze.call(r);}return!1;}var $d=Ud,Zr=Cn,zd=1,Gd=Object.prototype,Hd=Gd.hasOwnProperty;function Kd(h,r,t,e,n,i){var a=t&zd,s=Zr(h),o=s.length,f=Zr(r),v=f.length;if(o!=v&&!a)return!1;for(var l=o;l--;){var p=s[l];if(!(a?p in r:Hd.call(r,p)))return!1;}var y=i.get(h),O=i.get(r);if(y&&O)return y==r&&O==h;var x=!0;i.set(h,r),i.set(r,h);for(var m=a;++l<o;){p=s[l];var T=h[p],c=r[p];if(e)var d=a?e(c,T,p,r,h,i):e(T,c,p,h,r,i);if(!(d===void 0?T===c||n(T,c,t,e,i):d)){x=!1;break;}m||(m=p=="constructor");}if(x&&!m){var u=h.constructor,g=r.constructor;u!=g&&"constructor"in h&&"constructor"in r&&!(typeof u=="function"&&u instanceof u&&typeof g=="function"&&g instanceof g)&&(x=!1);}return i["delete"](h),i["delete"](r),x;}var Vd=Kd,ke=dn,Yd=$n,Xd=$d,Jd=Vd,kr=Je,qr=Xe,_r=cr,Qd=yn,Zd=1,tn="[object Arguments]",en="[object Array]",we="[object Object]",kd=Object.prototype,rn=kd.hasOwnProperty;function qd(h,r,t,e,n,i){var a=qr(h),s=qr(r),o=a?en:kr(h),f=s?en:kr(r);o=o==tn?we:o,f=f==tn?we:f;var v=o==we,l=f==we,p=o==f;if(p&&_r(h)){if(!_r(r))return!1;a=!0,v=!1;}if(p&&!v)return i||(i=new ke()),a||Qd(h)?Yd(h,r,t,e,n,i):Xd(h,r,o,t,e,n,i);if(!(t&Zd)){var y=v&&rn.call(h,"__wrapped__"),O=l&&rn.call(r,"__wrapped__");if(y||O){var x=y?h.value():h,m=O?r.value():r;return i||(i=new ke()),n(x,m,t,e,i);}}return p?(i||(i=new ke()),Jd(h,r,t,e,n,i)):!1;}var _d=qd,t0=_d,nn=re;function zn(h,r,t,e,n){return h===r?!0:h==null||r==null||!nn(h)&&!nn(r)?h!==h&&r!==r:t0(h,r,t,e,zn,n);}var e0=zn,r0=e0;function n0(h,r){return r0(h,r);}var i0=n0,oe=/* @__PURE__ */ye(i0);var ee=/*#__PURE__*/function(_yt4){function ee(t){var _this59;_classCallCheck(this,ee);_this59=_callSuper(this,ee,[t]);nt(_this59,"toolsType",ht.Selector);nt(_this59,"tmpPoints",[]);nt(_this59,"workOptions");nt(_this59,"vNodes");nt(_this59,"selectIds");nt(_this59,"selectorColor");nt(_this59,"strokeColor");nt(_this59,"fillColor");nt(_this59,"oldSelectRect");nt(_this59,"canRotate",!1);nt(_this59,"canTextEdit",!1);nt(_this59,"canLock",!1);nt(_this59,"scaleType",zt.all);nt(_this59,"toolsTypes");nt(_this59,"shapeOpt");nt(_this59,"textOpt");nt(_this59,"isLocked");_this59.workOptions=t.toolsOpt,_this59.vNodes=t.vNodes;return _this59;}_inherits(ee,_yt4);return _createClass(ee,[{key:"computSelector",value:function computSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;var e=Nt(this.tmpPoints);if(e.w===0||e.h===0)return{selectIds:[],intersectRect:void 0,subNodeMap:/* @__PURE__ */new Map()};var _this$vNodes$getRectI=this.vNodes.getRectIntersectRange(e,t),n=_this$vNodes$getRectI.rectRange,i=_this$vNodes$getRectI.nodeRange;return{selectIds:_toConsumableArray(i.keys()),intersectRect:n,subNodeMap:i};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=this.tmpPoints.length,n=t.length;if(n>1){var i=new xt(t[n-2]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[n-1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]);e===2?this.tmpPoints.splice(1,1,i):this.tmpPoints.push(i);}}},{key:"drawSelector",value:function drawSelector(t){var _this60=this;var e=t.drawRect,n=t.subNodeMap,i=t.selectorId,a=t.layer,s=t.isService,o=new ne({pos:[e.x,e.y],anchor:[0,0],size:[e.w,e.h],id:i,name:i,zIndex:1e3}),f=[];if(s){var v=new ir({normalize:!0,pos:[e.w/2,e.h/2],lineWidth:1,strokeColor:this.selectorColor||this.workOptions.strokeColor,width:e.w,height:e.h,name:ee.selectorBorderId});f.push(v);}n.forEach(function(v,l){var p=[v.rect.x+v.rect.w/2-e.x,v.rect.y+v.rect.h/2-e.y],y=new ir({normalize:!0,pos:p,lineWidth:1,strokeColor:n.size>1?_this60.selectorColor||_this60.workOptions.strokeColor:void 0,width:v.rect.w,height:v.rect.h,id:"selector-".concat(l),name:"selector-".concat(l)});f.push(y);}),f&&o.append.apply(o,f),(a==null?void 0:a.parent).appendChild(o);}},{key:"draw",value:function draw(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var o,f;var a=n.intersectRect,s=n.subNodeMap;(f=(o=e.parent)==null?void 0:o.getElementById(t))==null||f.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:s,selectorId:t,layer:e,isService:i});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=zt.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;var e=/* @__PURE__ */new Set();var n;var _iterator8=_createForOfIteratorHelper(t.values()),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var i=_step8.value;var a=i.opt,s=i.canRotate,o=i.scaleType,f=i.toolsType;this.selectorColor=this.workOptions.strokeColor,a.strokeColor&&(this.strokeColor=a.strokeColor),a.fillColor&&(this.fillColor=a.fillColor),a.textOpt&&(this.textOpt=a.textOpt),f===ht.SpeechBalloon&&(e.add(f),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.placement=a.placement),f===ht.Polygon&&(e.add(f),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices),f===ht.Star&&(e.add(f),this.shapeOpt||(this.shapeOpt={}),this.shapeOpt.vertices=a.vertices,this.shapeOpt.innerRatio=a.innerRatio,this.shapeOpt.innerVerticeStep=a.innerVerticeStep),f===ht.Text&&(this.textOpt=a),t.size===1&&(this.textOpt&&(this.canTextEdit=!0),this.canRotate=s,this.scaleType=o),o===zt.none&&(this.scaleType=o),f===ht.Image&&(n=i);}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}e.size&&(this.toolsTypes=_toConsumableArray(e)),n&&(t.size===1?(this.canLock=!0,n.opt.locked&&(this.isLocked=!0,this.scaleType=zt.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)):t.size>1&&!n.opt.locked&&(this.canLock=!1,this.canRotate=!1));}},{key:"getChildrenPoints",value:function getChildrenPoints(){var t,e;if(this.scaleType===zt.both&&((t=this.selectIds)==null?void 0:t.length)===1){var n=this.selectIds[0],i=(e=this.vNodes.get(n))==null?void 0:e.op;if(i){var a=[];for(var s=0;s<i.length;s+=3)a.push([i[s],i[s+1]]);return a;}}}},{key:"consume",value:function consume(t){var _t$data2=t.data,e=_t$data2.op,n=_t$data2.workState;var i=this.oldSelectRect;if(n===Rt.Start&&(i=this.unSelectedAllIds()),!(e!=null&&e.length)||!this.vNodes.curNodeMap.size)return{type:ct.None};this.updateTempPoints(e);var a=this.computSelector();if(this.selectIds&&oe(this.selectIds,a.selectIds))return{type:ct.None};this.selectIds=a.selectIds;var s=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(ee.selectorId,this.fullLayer,a),this.oldSelectRect=s;var o=this.getChildrenPoints();return{type:ct.Select,dataType:Tt.Local,rect:Ot(s,i),selectIds:a.selectIds,opt:this.workOptions,selectRect:s,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:o,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt};}},{key:"consumeAll",value:function consumeAll(){var e,n;var t=this.oldSelectRect;if(!((e=this.selectIds)!=null&&e.length)&&this.tmpPoints[0]&&this.selectSingleTool(this.tmpPoints[0].XY,ee.selectorId,!1),(n=this.selectIds)!=null&&n.length&&(t=this.selectedByIds(this.selectIds)),t){var i=this.getChildrenPoints();return{type:ct.Select,dataType:Tt.Local,rect:this.oldSelectRect,selectIds:this.selectIds,opt:this.workOptions,selectorColor:this.selectorColor,selectRect:this.oldSelectRect,strokeColor:this.strokeColor,fillColor:this.fillColor,textOpt:this.textOpt,canTextEdit:this.canTextEdit,canRotate:this.canRotate,canLock:this.canLock,scaleType:this.scaleType,willSyncService:!0,points:i,isLocked:this.isLocked,toolsTypes:this.toolsTypes,shapeOpt:this.shapeOpt};}return{type:ct.None};}},{key:"consumeService",value:function consumeService(){}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}},{key:"clearSelectData",value:function clearSelectData(){this.selectIds=void 0,this.oldSelectRect=void 0;}},{key:"selectSingleTool",value:function selectSingleTool(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ee.selectorId;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(t.length===2){var i=t[0],a=t[1];var s;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:i,y:a,w:0,h:0},!1),o=_this$vNodes$getRectI2.nodeRange,f=_toConsumableArray(o.values()).sort(function(v,l){return(l.opt.zIndex||0)-(v.opt.zIndex||0);});var _iterator9=_createForOfIteratorHelper(f),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _v7=_step9.value;var _l5=this.fullLayer.getElementsByName(_v7.name);if(Zn(_l5).find(function(y){return y.isPointCollision(i,a);})){s=_v7;break;}}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}if(s){var v=s.name;if(!oe(this.oldSelectRect,s.rect)){var l=/* @__PURE__ */new Map([[v,s]]);this.getSelecteorInfo(l),this.draw(e,this.fullLayer,{intersectRect:s.rect,subNodeMap:l,selectIds:this.selectIds||[]},n);}this.selectIds=[v],this.oldSelectRect=s.rect;}}}},{key:"unSelectedAllIds",value:function unSelectedAllIds(){var t;var _iterator10=_createForOfIteratorHelper(this.vNodes.curNodeMap.entries()),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _step10$value=_slicedToArray(_step10.value,2),_e5=_step10$value[0],n=_step10$value[1];n.isSelected&&(t=Ot(t,n.rect),this.vNodes.unSelected(_e5));}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}return t;}},{key:"unSelectedByIds",value:function unSelectedByIds(t){var e;var _iterator11=_createForOfIteratorHelper(t),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var n=_step11.value;var i=this.vNodes.get(n);i&&i.isSelected&&(e=Ot(e,i.rect),this.vNodes.unSelected(n));}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}return e;}},{key:"selectedByIds",value:function selectedByIds(t){var e;var _iterator12=_createForOfIteratorHelper(t),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var n=_step12.value;var i=this.vNodes.get(n);i&&(e=Ot(e,i.rect),this.vNodes.selected(n));}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}return e;}},{key:"getSelectorRect",value:function getSelectorRect(t,e){var s;var n;var i=(s=t.parent)==null?void 0:s.getElementById(e),a=i==null?void 0:i.getBoundingClientRect();return a&&(n=Ot(n,{x:Math.floor(a.x),y:Math.floor(a.y),w:Math.floor(a.width+1),h:Math.floor(a.height+1)})),n;}},{key:"isCanFillColor",value:function isCanFillColor(t){return t===ht.Ellipse||t===ht.Triangle||t===ht.Rectangle||t===ht.Polygon||t===ht.Star||t===ht.SpeechBalloon;}},{key:"updateSelector",value:function(){var _updateSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(t){var e,n,i,a,s,o,f,v,l,p,y,O,x,m,T,c,d,u,g,M,b,_iterator13,_step13,_b11,E,L,D,R,C,z,H,W,_z4,_H3,A,_b12,_E9,_E10,_E11,_E12,_E13,_E14,_E15,I;return _regeneratorRuntime().wrap(function _callee13$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:e=t.updateSelectorOpt,n=t.selectIds,i=t.vNodes,a=t.willSerializeData,s=t.worker,o=t.offset,f=t.scene,v=t.isMainThread,l=this.fullLayer;if(l){_context15.next=3;break;}return _context15.abrupt("return");case 3:y=/* @__PURE__ */new Map(),O=e.box,x=e.workState,m=e.angle,T=e.translate;c=[0,0],d=[1,1],u=[0,0];if(!(O||T||Jt(m))){_context15.next=9;break;}if(!(x===Rt.Start)){_context15.next=8;break;}return _context15.abrupt("return",(i.setTarget(),{type:ct.Select,dataType:Tt.Local,selectRect:this.oldSelectRect,rect:this.oldSelectRect}));case 8:if(g=i.getLastTarget(),g&&O){n==null||n.forEach(function(E){var L=g==null?void 0:g.get(E);b=Ot(b,L==null?void 0:L.rect);}),b&&(d=[O.w/b.w,O.h/b.h],c=[O.x+O.w/2-(b.x+b.w/2),O.y+O.h/2-(b.y+b.h/2)],u=[b.x+b.w/2,b.y+b.h/2]),M=b;}case 9:if(!n){_context15.next=55;break;}_iterator13=_createForOfIteratorHelper(n);_context15.prev=11;_iterator13.s();case 13:if((_step13=_iterator13.n()).done){_context15.next=47;break;}_b11=_step13.value;E=i.get(_b11);if(!E){_context15.next=45;break;}L=E.toolsType;D=(l==null?void 0:l.getElementsByName(_b11))[0];if(!D){_context15.next=45;break;}R=_objectSpread({},e);C=void 0;if(!L){_context15.next=45;break;}if(g&&(C=g.get(_b11),C&&O)){R.boxScale=d;z=[C.rect.x+C.rect.w/2,C.rect.y+C.rect.h/2],H=[z[0]-u[0],z[1]-u[1]];R.boxTranslate=[H[0]*(d[0]-1)+c[0]+(o&&o[0]||0),H[1]*(d[1]-1)+c[1]+(o&&o[1]||0)];}W=Qn(L);if(!(W==null||W.updateNodeOpt({node:D,opt:R,vNodes:i,willSerializeData:a,targetNode:C}),E&&s&&(a&&(R.angle||R.translate)||R.box&&R.workState!==Rt.Start||R.pointMap&&R.pointMap.has(_b11)||L===ht.Text&&(R.fontSize||R.translate||R.textInfos&&R.textInfos.get(_b11))||L===ht.Image&&(R.angle||R.translate||R.boxScale)||L===R.toolsType&&R.willRefresh))){_context15.next=44;break;}_z4=s.createWorkShapeNode({toolsType:L,toolsOpt:E.opt});_z4==null||_z4.setWorkId(_b11);_H3=void 0;if(!(L===ht.Image&&f)){_context15.next=35;break;}_context15.next=32;return _z4.consumeServiceAsync({isFullWork:!0,replaceId:_b11,scene:f,isMainThread:v});case 32:_H3=_context15.sent;_context15.next=42;break;case 35:if(!(L===ht.Text)){_context15.next=41;break;}_context15.next=38;return _z4.consumeServiceAsync({isFullWork:!0,replaceId:_b11});case 38:_H3=_context15.sent;_context15.next=42;break;case 41:_H3=_z4==null?void 0:_z4.consumeService({op:E.op,isFullWork:!0,replaceId:_b11});case 42:_H3&&(E.rect=_H3);D=(l==null?void 0:l.getElementsByName(_b11))[0];case 44:E&&(y.set(_b11,E),p=Ot(p,E.rect));case 45:_context15.next=13;break;case 47:_context15.next=52;break;case 49:_context15.prev=49;_context15.t0=_context15["catch"](11);_iterator13.e(_context15.t0);case 52:_context15.prev=52;_iterator13.f();return _context15.finish(52);case 55:g&&x===Rt.Done&&i.deleteLastTarget();A=p;if(!(M&&e.dir&&A&&!o)){_context15.next=89;break;}_b12=[0,0];_context15.t1=e.dir;_context15.next=_context15.t1==="top"?62:_context15.t1==="topLeft"?65:_context15.t1==="topRight"?68:_context15.t1==="bottom"?71:_context15.t1==="bottomLeft"?74:_context15.t1==="bottomRight"?77:_context15.t1==="right"?80:83;break;case 62:_E9=[M.x,M.y+M.h];e.reverseY?_b12[1]=_E9[1]-A.y:_b12[1]=_E9[1]-(A.y+A.h);return _context15.abrupt("break",83);case 65:_E10=[M.x+M.w,M.y+M.h];e.reverseY?_b12[1]=_E10[1]-A.y:_b12[1]=_E10[1]-(A.y+A.h),e.reverseX?_b12[0]=_E10[0]-A.x:_b12[0]=_E10[0]-(A.x+A.w);return _context15.abrupt("break",83);case 68:_E11=[M.x,M.y+M.h];e.reverseY?_b12[1]=_E11[1]-A.y:_b12[1]=_E11[1]-(A.y+A.h),e.reverseX?_b12[0]=_E11[0]-(A.x+A.w):_b12[0]=_E11[0]-A.x;return _context15.abrupt("break",83);case 71:_E12=[M.x,M.y];e.reverseY?_b12[1]=_E12[1]-(A.y+A.h):_b12[1]=_E12[1]-A.y;return _context15.abrupt("break",83);case 74:_E13=[M.x+M.w,M.y];e.reverseY?_b12[1]=_E13[1]-(A.y+A.h):_b12[1]=_E13[1]-A.y,e.reverseX?_b12[0]=_E13[0]-A.x:_b12[0]=_E13[0]-(A.x+A.w);return _context15.abrupt("break",83);case 77:_E14=[M.x,M.y];e.reverseY?_b12[1]=_E14[1]-(A.y+A.h):_b12[1]=_E14[1]-A.y,e.reverseX?_b12[0]=_E14[0]-(A.x+A.w):_b12[0]=_E14[0]-A.x;return _context15.abrupt("break",83);case 80:_E15=[M.x,M.y];e.reverseX?_b12[0]=_E15[0]-(A.x+A.w):_b12[0]=_E15[0]-A.x;return _context15.abrupt("break",83);case 83:if(!(_b12[0]||_b12[1])){_context15.next=89;break;}A.x=A.x+_b12[0];A.y=A.y+_b12[1];_context15.next=88;return this.updateSelector(_objectSpread(_objectSpread({},t),{},{offset:_b12}));case 88:return _context15.abrupt("return",_context15.sent);case 89:this.getSelecteorInfo(y),this.draw(ee.selectorId,l,{selectIds:n||[],subNodeMap:y,intersectRect:A});I=Ot(this.oldSelectRect,A);return _context15.abrupt("return",(this.oldSelectRect=A,{type:ct.Select,dataType:Tt.Local,selectRect:A,renderRect:p,rect:Ot(I,A)}));case 92:case"end":return _context15.stop();}},_callee13,this,[[11,49,52,55]]);}));function updateSelector(_x17){return _updateSelector.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function blurSelector(){var t=this.unSelectedAllIds();return{type:ct.Select,dataType:Tt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(yr,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,e,n){var _this61=this;var i=e.selectIds,a=this.getRightServiceId(t),s=this.getSelectorRect(this.fullLayer,a);var o;var f=/* @__PURE__ */new Map();return i==null||i.forEach(function(v){var l=_this61.vNodes.get(v);l&&(o=Ot(o,l.rect),f.set(v,l));}),this.getSelecteorInfo(f),this.draw(a,this.fullLayer,{intersectRect:o,selectIds:i||[],subNodeMap:f},n),Ot(o,s);}},{key:"reRenderSelector",value:function reRenderSelector(){var _this62=this;var n;var t;var e=/* @__PURE__ */new Map();return(n=this.selectIds)==null||n.forEach(function(i){var a=_this62.vNodes.get(i);a&&(t=Ot(t,a.rect),e.set(i,a));},this),this.getSelecteorInfo(e),this.draw(ee.selectorId,this.fullLayer,{intersectRect:t,subNodeMap:e,selectIds:this.selectIds||[]}),this.oldSelectRect=t,t;}},{key:"updateSelectIds",value:function updateSelectIds(t){var a;var e;var n=(a=this.selectIds)==null?void 0:a.filter(function(s){return!t.includes(s);});if(n!=null&&n.length&&(e=this.unSelectedByIds(n)),t.length){var s=this.selectedByIds(t);e=Ot(e,s);}this.selectIds=t;var i=this.reRenderSelector();return{bgRect:e,selectRect:i};}},{key:"cursorHover",value:function cursorHover(t){var a,s;var e=this.oldSelectRect;this.selectIds=[];var n=(a=this.workId)==null?void 0:a.toString(),i=[t[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],t[1]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[1]];if(this.selectSingleTool(i,n,!0),this.oldSelectRect&&!oe(e,this.oldSelectRect))return{type:ct.CursorHover,dataType:Tt.Local,rect:Ot(e,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((s=this.selectIds)!=null&&s.length||(this.oldSelectRect=void 0),e&&!this.oldSelectRect)return this.cursorBlur(),{type:ct.CursorHover,dataType:Tt.Local,rect:e,selectorColor:this.selectorColor,willSyncService:!1};}},{key:"cursorBlur",value:function cursorBlur(){var e,n;this.selectIds=[];var t=(e=this.workId)==null?void 0:e.toString();((n=this.fullLayer)==null?void 0:n.parent).children.forEach(function(i){i.name===t&&i.remove();});}}]);}(yt);nt(ee,"selectorId",kh),nt(ee,"selectorBorderId","selector-border");var wt=ee;var Gn=/*#__PURE__*/function(_yt5){function Gn(t){var _this63;_classCallCheck(this,Gn);_this63=_callSuper(this,Gn,[t]);nt(_this63,"canRotate",!1);nt(_this63,"scaleType",zt.both);nt(_this63,"toolsType",ht.Arrow);nt(_this63,"tmpPoints",[]);nt(_this63,"workOptions");nt(_this63,"oldRect");nt(_this63,"arrowTipWidth");nt(_this63,"syncTimestamp");_this63.workOptions=t.toolsOpt,_this63.arrowTipWidth=_this63.workOptions.thickness*4,_this63.syncTimestamp=0,_this63.syncUnitTime=50;return _this63;}_inherits(Gn,_yt5);return _createClass(Gn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};var o=e.op,f=e.workState,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};var l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};var p;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x});}if(!i){var _x18=Date.now();return _x18-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x18,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s};}},{key:"consumeAll",value:function consumeAll(t){var f,v;var e=t.data,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};var i=this.fullLayer,a=this.draw({workId:n,layer:i});this.oldRect=a;var s=this.tmpPoints.map(function(l){return[].concat(_toConsumableArray(l.XY),[0]);}).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions6=this.workOptions,i=_this$workOptions6.strokeColor,a=_this$workOptions6.thickness,s=_this$workOptions6.zIndex,o=_this$workOptions6.scale,f=_this$workOptions6.rotate,v=_this$workOptions6.translate,l=n.worldPosition,p=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(a),y=_this$computDrawPoint2.points,O=_this$computDrawPoint2.rect,m={pos:[O.x+O.w/2,O.y+O.h/2],name:e,id:e,close:!0,points:y,fillColor:i,strokeColor:i,lineWidth:0,normalize:!0,zIndex:s};o&&(m.scale=o),f&&(m.rotate=f),v&&(m.translate=v);var T=new ce(m);if(this.replace(n,e,T),o||f||v){var _c32=T.getBoundingClientRect();return{x:Math.floor(_c32.x-yt.SafeBorderPadding),y:Math.floor(_c32.y-yt.SafeBorderPadding),w:Math.floor(_c32.width+yt.SafeBorderPadding*2),h:Math.floor(_c32.height+yt.SafeBorderPadding*2)};}return{x:Math.floor(O.x*p[0]+l[0]-yt.SafeBorderPadding),y:Math.floor(O.y*p[1]+l[1]-yt.SafeBorderPadding),w:Math.floor(O.w*p[0]+2*yt.SafeBorderPadding),h:Math.floor(O.h*p[1]+2*yt.SafeBorderPadding)};}},{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 _this64=this;var e=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=_.Per(e).mul(t/2),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),s=_.Mul(e,this.arrowTipWidth),o=_.Sub(this.tmpPoints[1],s),f=xt.Sub(o,n),v=xt.Add(o,n),l=_.Per(e).mul(t*1.5),p=xt.Sub(o,l),y=xt.Add(o,l),O=[i,f,p,this.tmpPoints[1],y,v,a];return{points:O.map(function(x){return xt.Sub(x,_this64.tmpPoints[0]).XY;}).flat(1),rect:Nt(O),isTriangle:!1,pos:this.tmpPoints[0].XY};}},{key:"computTrianglePoints",value:function computTrianglePoints(){var _this65=this;var t=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),e=this.tmpPoints[1].distance(this.tmpPoints[0]),n=_.Per(t).mul(Math.floor(e*3/8)),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),s=[i,this.tmpPoints[1],a];return{points:s.map(function(o){return xt.Sub(o,_this65.tmpPoints[0]).XY;}).flat(1),rect:Nt(s),isTriangle:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))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 o,f;var e=t.op,n=t.isFullWork,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(s,a)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var o;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,s=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(o=s==null?void 0:s.opt)!=null&&o.strokeColor&&(s.opt.strokeColor=a),s&&i.setInfo(e.name,s)),yt.updateNodeOpt(t);}}]);}(yt);var Hn=/*#__PURE__*/function(_yt6){function Hn(t){var _this66;_classCallCheck(this,Hn);_this66=_callSuper(this,Hn,[t]);nt(_this66,"canRotate",!1);nt(_this66,"scaleType",zt.all);nt(_this66,"toolsType",ht.Ellipse);nt(_this66,"tmpPoints",[]);nt(_this66,"workOptions");nt(_this66,"oldRect");nt(_this66,"syncTimestamp");_this66.workOptions=t.toolsOpt,_this66.syncTimestamp=0,_this66.syncUnitTime=50;return _this66;}_inherits(Hn,_yt6);return _createClass(Hn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};var o=e.op,f=e.workState,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};var l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};var p;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x,isDrawing:!0});}if(!i){var _x19=Date.now();return _x19-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x19,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s};}},{key:"consumeAll",value:function consumeAll(t){var f,v;var e=t.data,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};var i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;var s=this.tmpPoints.map(function(l){return[].concat(_toConsumableArray(l.XY),[0]);}).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions7=this.workOptions,a=_this$workOptions7.strokeColor,s=_this$workOptions7.fillColor,o=_this$workOptions7.thickness,f=_this$workOptions7.zIndex,v=_this$workOptions7.scale,l=_this$workOptions7.rotate,p=_this$workOptions7.translate,y=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(o),O=_this$computDrawPoint3.radius,x=_this$computDrawPoint3.rect,m=_this$computDrawPoint3.pos,T={pos:m,name:e,id:e,radius:O,lineWidth:o,fillColor:s!=="transparent"&&s||void 0,strokeColor:a,normalize:!0},c={name:e,id:e,zIndex:f,pos:m,anchor:[0.5,0.5],size:[x.w,x.h]};v&&(c.scale=v),l&&(c.rotate=l),p&&(c.translate=p);var d=new ne(c);if(i){var M=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/y[0],1/y[1]]});d.append(M);}var u=new Kh(_objectSpread(_objectSpread({},T),{},{pos:[0,0]}));d.append(u),this.replace(n,e,d);var g=d.getBoundingClientRect();return{x:Math.floor(g.x-yt.SafeBorderPadding),y:Math.floor(g.y-yt.SafeBorderPadding),w:Math.floor(g.width+yt.SafeBorderPadding*2),h:Math.floor(g.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t){var e=Nt(this.tmpPoints),n=Nt(this.tmpPoints,t),i=[Math.floor(e.x+e.w/2),Math.floor(e.y+e.h/2)];return{rect:n,pos:i,radius:[Math.floor(e.w/2),Math.floor(e.h/2)]};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))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 o,f;var e=t.op,n=t.isFullWork,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(s,a)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var v,l;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,s=n.fillColor,o=i.get(e.name);var f=e;return e.tagName==="GROUP"&&(f=e.children[0]),a&&(f.setAttribute("strokeColor",a),(v=o==null?void 0:o.opt)!=null&&v.strokeColor&&(o.opt.strokeColor=a)),s&&(s==="transparent"?f.setAttribute("fillColor","rgba(0,0,0,0)"):f.setAttribute("fillColor",s),(l=o==null?void 0:o.opt)!=null&&l.fillColor&&(o.opt.fillColor=s)),o&&i.setInfo(e.name,o),yt.updateNodeOpt(t);}}]);}(yt);var s0=fe,o0=re,a0="[object Boolean]";function l0(h){return h===!0||h===!1||o0(h)&&s0(h)==a0;}var c0=l0,se=/* @__PURE__ */ye(c0);var Kn=/*#__PURE__*/function(_yt7){function Kn(t){var _this67;_classCallCheck(this,Kn);_this67=_callSuper(this,Kn,[t]);nt(_this67,"canRotate",!0);nt(_this67,"scaleType",zt.all);nt(_this67,"toolsType",ht.Rectangle);nt(_this67,"tmpPoints",[]);nt(_this67,"workOptions");nt(_this67,"oldRect");nt(_this67,"syncTimestamp");_this67.workOptions=t.toolsOpt,_this67.syncTimestamp=0,_this67.syncUnitTime=50;return _this67;}_inherits(Kn,_yt7);return _createClass(Kn,[{key:"transformData",value:function transformData(){var t=Nt(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 e=this.workOptions.thickness,n=[];var _iterator14=_createForOfIteratorHelper(t),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var s=_step14.value;n.push(_construct(_,_toConsumableArray(s)));}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}var i=Nt(n,e),a=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:a,points:n.map(function(s){return s.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var x;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,s=(x=e==null?void 0:e.workId)==null?void 0:x.toString();if(!s)return{type:ct.None};var o=e.op,f=e.workState,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};var l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};var p=this.transformData();var y;if(i||a){var m=n?this.fullLayer:this.drawLayer||this.fullLayer;y=this.draw({ps:p,workId:s,layer:m,isDrawing:!0});}if(!i){var _m9=Date.now();return _m9-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_m9,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:p.flat(1),isSync:!0,index:0}):{type:ct.None};}var O=Ot(y,this.oldRect);return this.oldRect=y,{rect:O,type:ct.DrawWork,dataType:Tt.Local,workId:s};}},{key:"consumeAll",value:function consumeAll(t){var v,l;var e=t.data,n=(v=e==null?void 0:e.workId)==null?void 0:v.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};var i=this.transformData(),a=this.fullLayer,s=this.draw({ps:i,workId:n,layer:a,isDrawing:!1});this.oldRect=s;var o=i.flat(1),f=qt(o);return(l=this.vNodes)==null||l.setInfo(n,{rect:s,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),{rect:s,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:f,opt:this.workOptions,isSync:!0};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,a=t.ps,s=t.replaceId,_this$workOptions8=this.workOptions,o=_this$workOptions8.strokeColor,f=_this$workOptions8.fillColor,v=_this$workOptions8.thickness,l=_this$workOptions8.zIndex,p=_this$workOptions8.scale,y=_this$workOptions8.rotate,O=_this$workOptions8.translate,x=_this$workOptions8.textOpt,m=n.worldPosition,T=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(a),c=_this$computDrawPoint4.points,d=_this$computDrawPoint4.rect,u=_this$computDrawPoint4.pos,g={close:!0,normalize:!0,points:c,lineWidth:v,fillColor:f!=="transparent"&&f||void 0,strokeColor:o,lineJoin:"round"},M={x:Math.floor(d.x*T[0]+m[0]-yt.SafeBorderPadding),y:Math.floor(d.y*T[1]+m[1]-yt.SafeBorderPadding),w:Math.floor(d.w*T[0]+2*yt.SafeBorderPadding),h:Math.floor(d.h*T[0]+2*yt.SafeBorderPadding)},A=new ne({name:e,id:e,zIndex:l,pos:u,anchor:[0.5,0.5],size:[d.w,d.h],scale:p,rotate:y,translate:O}),I=new ce(_objectSpread(_objectSpread({},g),{},{pos:[0,0]}));if(A.appendChild(I),i){var b=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:o,lineWidth:1,scale:[1/T[0],1/T[1]]});A.appendChild(b);}if(this.replace(n,s||e,A),p||y||O){var _b13=A.getBoundingClientRect();return{x:Math.floor(_b13.x-yt.SafeBorderPadding),y:Math.floor(_b13.y-yt.SafeBorderPadding),w:Math.floor(_b13.width+2*yt.SafeBorderPadding),h:Math.floor(_b13.height+2*yt.SafeBorderPadding)};}return M;}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))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 v,l;var e=t.op,n=t.isFullWork,i=t.replaceId,a=(v=this.workId)==null?void 0:v.toString();if(!a)return;var s=[];for(var p=0;p<e.length;p+=3)s.push([e[p],e[p+1],e[p+2]]);var o=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({ps:s,workId:a,layer:o,isDrawing:!1,replaceId:i});return this.oldRect=f,(l=this.vNodes)==null||l.setInfo(a,{rect:f,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&yt.getCenterPos(f,o)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var T,c;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,s=n.fillColor,o=n.fontColor,f=n.fontBgColor,v=n.bold,l=n.italic,p=n.lineThrough,y=n.underline,O=n.fontSize,x=i.get(e.name);var m=e;if(e.tagName==="GROUP"&&(m=e.children[0]),a&&(m.setAttribute("strokeColor",a),(T=x==null?void 0:x.opt)!=null&&T.strokeColor&&(x.opt.strokeColor=a)),s&&(s==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",s),(c=x==null?void 0:x.opt)!=null&&c.fillColor&&(x.opt.fillColor=s)),x!=null&&x.opt.textOpt){var d=x.opt.textOpt;o&&d.fontColor&&(d.fontColor=o),f&&d.fontBgColor&&(d.fontBgColor=f),v&&(d.bold=v),l&&(d.italic=l),se(p)&&(d.lineThrough=p),se(y)&&(d.underline=y),O&&(d.fontSize=O);}return x&&i.setInfo(e.name,x),yt.updateNodeOpt(t);}}]);}(yt);var Vn=/*#__PURE__*/function(_yt8){function Vn(t){var _this68;_classCallCheck(this,Vn);_this68=_callSuper(this,Vn,[t]);nt(_this68,"canRotate",!1);nt(_this68,"scaleType",zt.all);nt(_this68,"toolsType",ht.Star);nt(_this68,"tmpPoints",[]);nt(_this68,"workOptions");nt(_this68,"oldRect");nt(_this68,"syncTimestamp");_this68.workOptions=t.toolsOpt,_this68.syncTimestamp=0,_this68.syncUnitTime=50;return _this68;}_inherits(Vn,_yt8);return _createClass(Vn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};var o=e.op,f=e.workState,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};var l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};var p;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x,isDrawing:!0});}if(!i){var _x20=Date.now();return _x20-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x20,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s// op: this.tmpPoints.map(c=>[...c.XY,0]).flat(1)
|
|
422
|
+
};}},{key:"consumeAll",value:function consumeAll(t){var f,v;var e=t.data,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};var i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;var s=this.tmpPoints.map(function(l){return[].concat(_toConsumableArray(l.XY),[0]);}).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions9=this.workOptions,a=_this$workOptions9.strokeColor,s=_this$workOptions9.fillColor,o=_this$workOptions9.thickness,f=_this$workOptions9.zIndex,v=_this$workOptions9.vertices,l=_this$workOptions9.innerVerticeStep,p=_this$workOptions9.innerRatio,y=_this$workOptions9.scale,O=_this$workOptions9.rotate,x=_this$workOptions9.translate,m=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(o,v,l,p),T=_this$computDrawPoint5.rect,c=_this$computDrawPoint5.pos,d=_this$computDrawPoint5.points,u={close:!0,points:d,lineWidth:o,fillColor:s!=="transparent"&&s||void 0,strokeColor:a,normalize:!0,lineJoin:"round"},g={name:e,id:e,zIndex:f,pos:c,anchor:[0.5,0.5],size:[T.w,T.h],className:"".concat(c[0],",").concat(c[1])};y&&(g.scale=y),O&&(g.rotate=O),x&&(g.translate=x);var M=new ne(g);if(i){var b=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/m[0],1/m[1]]});M.append(b);}var A=new ce(_objectSpread(_objectSpread({},u),{},{pos:[0,0]}));M.append(A),this.replace(n,e,M);var I=M.getBoundingClientRect();return{x:Math.floor(I.x-yt.SafeBorderPadding),y:Math.floor(I.y-yt.SafeBorderPadding),w:Math.floor(I.width+yt.SafeBorderPadding*2),h:Math.floor(I.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e,n,i){var a=Nt(this.tmpPoints),s=[Math.floor(a.x+a.w/2),Math.floor(a.y+a.h/2)],o=Bn(a.w,a.h),f=Math.floor(Math.min(a.w,a.h)/2),v=i*f,l=[],p=2*Math.PI/e;for(var O=0;O<e;O++){var x=O*p-0.5*Math.PI;var m=void 0,_T39=void 0;O%n===1?(m=v*o[0]*Math.cos(x),_T39=v*o[1]*Math.sin(x)):(m=f*o[0]*Math.cos(x),_T39=f*o[1]*Math.sin(x),l.push(m,_T39)),l.push(m,_T39);}return{rect:Nt(this.tmpPoints,t),pos:s,points:l};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||xt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var o,f;var e=t.op,n=t.isFullWork,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,s=n.fillColor,o=n.toolsType,f=n.vertices,v=n.innerVerticeStep,l=n.innerRatio,p=i.get(e.name),y=p==null?void 0:p.opt;var O=e;return e.tagName==="GROUP"&&(O=e.children[0]),a&&(O.setAttribute("strokeColor",a),y!=null&&y.strokeColor&&(y.strokeColor=a)),s&&(s==="transparent"?O.setAttribute("fillColor","rgba(0,0,0,0)"):O.setAttribute("fillColor",s),y!=null&&y.fillColor&&(y.fillColor=s)),o===ht.Star&&(f&&(y.vertices=f),v&&(y.innerVerticeStep=v),l&&(y.innerRatio=l)),p&&i.setInfo(e.name,_objectSpread(_objectSpread({},p),{},{opt:y})),yt.updateNodeOpt(t);}}]);}(yt);var Yn=/*#__PURE__*/function(_yt9){function Yn(t){var _this69;_classCallCheck(this,Yn);_this69=_callSuper(this,Yn,[t]);nt(_this69,"canRotate",!1);nt(_this69,"scaleType",zt.all);nt(_this69,"toolsType",ht.Polygon);nt(_this69,"tmpPoints",[]);nt(_this69,"workOptions");nt(_this69,"oldRect");nt(_this69,"syncTimestamp");_this69.workOptions=t.toolsOpt,_this69.syncTimestamp=0,_this69.syncUnitTime=50;return _this69;}_inherits(Yn,_yt9);return _createClass(Yn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};var o=e.op,f=e.workState,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};var l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};var p;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x,isDrawing:!0});}if(!i){var _x21=Date.now();return _x21-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x21,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s};}},{key:"consumeAll",value:function consumeAll(t){var f,v;var e=t.data,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};var i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;var s=this.tmpPoints.map(function(l){return[].concat(_toConsumableArray(l.XY),[0]);}).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,i=t.isDrawing,_this$workOptions10=this.workOptions,a=_this$workOptions10.strokeColor,s=_this$workOptions10.fillColor,o=_this$workOptions10.thickness,f=_this$workOptions10.zIndex,v=_this$workOptions10.vertices,l=_this$workOptions10.scale,p=_this$workOptions10.rotate,y=_this$workOptions10.translate,O=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(o,v),x=_this$computDrawPoint6.rect,m=_this$computDrawPoint6.pos,T=_this$computDrawPoint6.points,c={close:!0,points:T,lineWidth:o,fillColor:s!=="transparent"&&s||void 0,strokeColor:a,normalize:!0,lineJoin:"round"},d={name:e,id:e,zIndex:f,pos:m,anchor:[0.5,0.5],size:[x.w,x.h]};l&&(d.scale=l),p&&(d.rotate=p),y&&(d.translate=y);var u=new ne(d);if(i){var A=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/O[0],1/O[1]]});u.append(A);}var g=new ce(_objectSpread(_objectSpread({},c),{},{pos:[0,0]}));u.append(g),this.replace(n,e,u);var M=u.getBoundingClientRect();return{x:Math.floor(M.x-yt.SafeBorderPadding),y:Math.floor(M.y-yt.SafeBorderPadding),w:Math.floor(M.width+yt.SafeBorderPadding*2),h:Math.floor(M.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Nt(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],a=Bn(n.w,n.h),s=Math.floor(Math.min(n.w,n.h)/2),o=[],f=2*Math.PI/e;for(var l=0;l<e;l++){var p=l*f-0.5*Math.PI,y=s*a[0]*Math.cos(p),O=s*a[1]*Math.sin(p);o.push(y,O);}return{rect:Nt(this.tmpPoints,t),pos:i,points:o};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||xt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var o,f;var e=t.op,n=t.isFullWork,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,s=n.fillColor,o=n.toolsType,f=n.vertices,v=i.get(e.name),l=v==null?void 0:v.opt;var p=e;return e.tagName==="GROUP"&&(p=e.children[0]),a&&(p.setAttribute("strokeColor",a),l!=null&&l.strokeColor&&(l.strokeColor=a)),s&&(s==="transparent"?p.setAttribute("fillColor","rgba(0,0,0,0)"):p.setAttribute("fillColor",s),l!=null&&l.fillColor&&(l.fillColor=s)),o===ht.Polygon&&f&&(l.vertices=f),v&&i.setInfo(e.name,_objectSpread(_objectSpread({},v),{},{opt:l})),yt.updateNodeOpt(t);}}]);}(yt);var kt=/*#__PURE__*/function(){function kt(){_classCallCheck(this,kt);}return _createClass(kt,null,[{key:"bezier",value:function bezier(r,t){var e=[];for(var n=0;n<t.length;n+=4){var i=t[n],a=t[n+1],s=t[n+2],o=t[n+3];i&&a&&s&&o?e.push.apply(e,_toConsumableArray(kt.getBezierPoints(r,i,a,s,o))):i&&a&&s?e.push.apply(e,_toConsumableArray(kt.getBezierPoints(r,i,a,s))):i&&a?e.push.apply(e,_toConsumableArray(kt.getBezierPoints(r,i,a))):i&&e.push(i);}return e;}/**
|
|
423
|
+
* @desc 获取点,这里可以设置点的个数
|
|
424
|
+
* @param {number} num 点个数
|
|
425
|
+
* @param {Vec2d} p1 点坐标
|
|
426
|
+
* @param {Vec2d} p2 点坐标
|
|
427
|
+
* @param {Vec2d} p3 点坐标
|
|
428
|
+
* @param {Vec2d} p4 点坐标
|
|
429
|
+
* 如果参数是 num, p1, p2 为一阶贝塞尔
|
|
430
|
+
* 如果参数是 num, p1, c1, p2 为二阶贝塞尔
|
|
431
|
+
* 如果参数是 num, p1, c1, c2, p2 为三阶贝塞尔
|
|
432
|
+
*/},{key:"getBezierPoints",value:function getBezierPoints(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:10;var t=arguments.length>1?arguments[1]:undefined;var e=arguments.length>2?arguments[2]:undefined;var n=arguments.length>3?arguments[3]:undefined;var i=arguments.length>4?arguments[4]:undefined;var a=null;var s=[];!n&&!i?a=kt.oneBezier:n&&!i?a=kt.twoBezier:n&&i&&(a=kt.threeBezier);for(var o=0;o<r;o++)a&&s.push(a(o/r,t,e,n,i));return i?s.push(i):n&&s.push(n),s;}/**
|
|
433
|
+
* @desc 一阶贝塞尔
|
|
434
|
+
* @param {number} t 当前百分比
|
|
435
|
+
* @param {Vec2d} p1 起点坐标
|
|
436
|
+
* @param {Vec2d} p2 终点坐标
|
|
437
|
+
*/},{key:"oneBezier",value:function oneBezier(r,t,e){var n=t.x+(e.x-t.x)*r,i=t.y+(e.y-t.y)*r;return new _(n,i);}/**
|
|
438
|
+
* @desc 二阶贝塞尔
|
|
439
|
+
* @param {number} t 当前百分比
|
|
440
|
+
* @param {Array} p1 起点坐标
|
|
441
|
+
* @param {Array} p2 终点坐标
|
|
442
|
+
* @param {Array} cp 控制点
|
|
443
|
+
*/},{key:"twoBezier",value:function twoBezier(r,t,e,n){var i=(1-r)*(1-r)*t.x+2*r*(1-r)*e.x+r*r*n.x,a=(1-r)*(1-r)*t.y+2*r*(1-r)*e.y+r*r*n.y;return new _(i,a);}/**
|
|
444
|
+
* @desc 三阶贝塞尔
|
|
445
|
+
* @param {number} t 当前百分比
|
|
446
|
+
* @param {Array} p1 起点坐标
|
|
447
|
+
* @param {Array} p2 终点坐标
|
|
448
|
+
* @param {Array} cp1 控制点1
|
|
449
|
+
* @param {Array} cp2 控制点2
|
|
450
|
+
*/},{key:"threeBezier",value:function threeBezier(r,t,e,n,i){var a=t.x*(1-r)*(1-r)*(1-r)+3*e.x*r*(1-r)*(1-r)+3*n.x*r*r*(1-r)+i.x*r*r*r,s=t.y*(1-r)*(1-r)*(1-r)+3*e.y*r*(1-r)*(1-r)+3*n.y*r*r*(1-r)+i.y*r*r*r;return new _(a,s);}}]);}();var Xn=/*#__PURE__*/function(_yt10){function Xn(t){var _this70;_classCallCheck(this,Xn);_this70=_callSuper(this,Xn,[t]);nt(_this70,"canRotate",!1);nt(_this70,"scaleType",zt.all);nt(_this70,"toolsType",ht.SpeechBalloon);nt(_this70,"ratio",0.8);nt(_this70,"tmpPoints",[]);nt(_this70,"workOptions");nt(_this70,"oldRect");nt(_this70,"syncTimestamp");_this70.workOptions=t.toolsOpt,_this70.syncTimestamp=0,_this70.syncUnitTime=50;return _this70;}_inherits(Xn,_yt10);return _createClass(Xn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};var o=e.op,f=e.workState,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};var l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};var p;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x,isDrawing:!0});}if(!i){var _x22=Date.now();return _x22-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x22,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s};}},{key:"consumeAll",value:function consumeAll(t){var f,v;var e=t.data,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};var i=this.fullLayer,a=this.draw({workId:n,layer:i,isDrawing:!1});this.oldRect=a;var s=this.tmpPoints.map(function(l){return[].concat(_toConsumableArray(l.XY),[0]);}).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions11=this.workOptions,i=_this$workOptions11.strokeColor,a=_this$workOptions11.fillColor,s=_this$workOptions11.thickness,o=_this$workOptions11.zIndex,f=_this$workOptions11.placement,v=_this$workOptions11.scale,l=_this$workOptions11.rotate,p=_this$workOptions11.translate,_this$computDrawPoint7=this.computDrawPoints(s,f),y=_this$computDrawPoint7.rect,O=_this$computDrawPoint7.pos,x=_this$computDrawPoint7.points,m={points:x.map(function(g){return g.XY;}),lineWidth:s,fillColor:a!=="transparent"&&a||void 0,strokeColor:i,normalize:!0,className:"".concat(O[0],",").concat(O[1]),lineJoin:"round",close:!0},T={name:e,id:e,zIndex:o,pos:O,anchor:[0.5,0.5],size:[y.w,y.h]};v&&(T.scale=v),l&&(T.rotate=l),p&&(T.translate=p);var c=new ne(T),d=new ce(_objectSpread(_objectSpread({},m),{},{pos:[0,0]}));c.append(d),this.replace(n,e,c);var u=c.getBoundingClientRect();return{x:Math.floor(u.x-yt.SafeBorderPadding),y:Math.floor(u.y-yt.SafeBorderPadding),w:Math.floor(u.width+yt.SafeBorderPadding*2),h:Math.floor(u.height+yt.SafeBorderPadding*2)};}},{key:"transformControlPoints",value:function transformControlPoints(t){var e=Nt(this.tmpPoints);switch(t){case"bottom":case"bottomLeft":case"bottomRight":{var n=e.y+e.h*this.ratio;return[new _(e.x,e.y,0),new _(e.x+e.w,e.y,0),new _(e.x+e.w,n,0),new _(e.x,n,0)];}case"top":case"topLeft":case"topRight":{var _n4=e.y+e.h*(1-this.ratio);return[new _(e.x,_n4,0),new _(e.x+e.w,_n4,0),new _(e.x+e.w,e.y+e.h,0),new _(e.x,e.y+e.h,0)];}case"left":case"leftBottom":case"leftTop":{var _n5=e.x+e.w*(1-this.ratio);return[new _(_n5,e.y,0),new _(e.x+e.w,e.y,0),new _(e.x+e.w,e.y+e.h,0),new _(_n5,e.y+e.h,0)];}case"right":case"rightBottom":case"rightTop":{var _n6=e.x+e.w*this.ratio;return[new _(e.x,e.y,0),new _(_n6,e.y,0),new _(_n6,e.y+e.h,0),new _(e.x,e.y+e.h,0)];}}}},{key:"computDrawPoints",value:function computDrawPoints(t,e){var n=Nt(this.tmpPoints),i=this.transformControlPoints(e),a=Math.floor(n.w*0.1),s=Math.floor(n.h*0.1),o=[],f=_.Add(i[0],new _(0,s,0)),v=_.Add(i[0],new _(a,0,0)),l=kt.getBezierPoints(10,f,i[0],v),p=_.Sub(i[1],new _(a,0,0)),y=_.Add(i[1],new _(0,s,0)),O=kt.getBezierPoints(10,p,i[1],y),x=_.Sub(i[2],new _(0,s,0)),m=_.Sub(i[2],new _(a,0,0)),T=kt.getBezierPoints(10,x,i[2],m),c=_.Add(i[3],new _(a,0,0)),d=_.Sub(i[3],new _(0,s,0)),u=kt.getBezierPoints(10,c,i[3],d),g=a*(1-this.ratio)*10,M=s*(1-this.ratio)*10;switch(e){case"bottom":{var b=_.Sub(i[2],new _(a*5-g/2,0,0)),E=_.Sub(i[2],new _(a*5,-M,0)),L=_.Sub(i[2],new _(a*5+g/2,0,0));o.push.apply(o,[E,L].concat(_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(O),_toConsumableArray(T),[b]));break;}case"bottomRight":{var _b14=_.Sub(i[2],new _(a*1.1,0,0)),_E16=_.Sub(i[2],new _(a*1.1+g/2,-M,0)),_L9=_.Sub(i[2],new _(a*1.1+g,0,0));o.push.apply(o,[_E16,_L9].concat(_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(O),_toConsumableArray(T),[_b14]));break;}case"bottomLeft":{var _b15=_.Add(i[3],new _(a*1.1+g,0,0)),_E17=_.Add(i[3],new _(a*1.1+g/2,M,0)),_L10=_.Add(i[3],new _(a*1.1,0,0));o.push.apply(o,[_E17,_L10].concat(_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(O),_toConsumableArray(T),[_b15]));break;}case"top":{var _b16=_.Sub(i[1],new _(a*5-g/2,0,0)),_E18=_.Sub(i[1],new _(a*5,M,0)),_L11=_.Sub(i[1],new _(a*5+g/2,0,0));o.push.apply(o,[_E18,_b16].concat(_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),[_L11]));break;}case"topRight":{var _b17=_.Sub(i[1],new _(a*1.1,0,0)),_E19=_.Sub(i[1],new _(a*1.1+g/2,M,0)),_L12=_.Sub(i[1],new _(a*1.1+g,0,0));o.push.apply(o,[_E19,_b17].concat(_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),[_L12]));break;}case"topLeft":{var _b18=_.Add(i[0],new _(a*1.1+g,0,0)),_E20=_.Add(i[0],new _(a*1.1+g/2,-M,0)),_L13=_.Add(i[0],new _(a*1.1,0,0));o.push.apply(o,[_E20,_b18].concat(_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),[_L13]));break;}case"left":{var _b19=_.Add(i[0],new _(0,s*5-M/2,0)),_E21=_.Add(i[0],new _(-g,s*5,0)),_L14=_.Add(i[0],new _(0,s*5+M/2,0));o.push.apply(o,[_E21,_b19].concat(_toConsumableArray(l),_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),[_L14]));break;}case"leftTop":{var _b20=_.Add(i[0],new _(0,s*1.1,0)),_E22=_.Add(i[0],new _(-g,s*1.1+M/2,0)),_L15=_.Add(i[0],new _(0,s*1.1+M,0));o.push.apply(o,[_E22,_b20].concat(_toConsumableArray(l),_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),[_L15]));break;}case"leftBottom":{var _b21=_.Sub(i[3],new _(0,s*1.1+M,0)),_E23=_.Sub(i[3],new _(g,s*1.1+M/2,0)),_L16=_.Sub(i[3],new _(0,s*1.1,0));o.push.apply(o,[_E23,_b21].concat(_toConsumableArray(l),_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),[_L16]));break;}case"right":{var _b22=_.Add(i[1],new _(0,s*5-M/2,0)),_E24=_.Add(i[1],new _(g,s*5,0)),_L17=_.Add(i[1],new _(0,s*5+M/2,0));o.push.apply(o,[_E24,_L17].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(O),[_b22]));break;}case"rightTop":{var _b23=_.Add(i[1],new _(0,s*1.1,0)),_E25=_.Add(i[1],new _(g,s*1.1+M/2,0)),_L18=_.Add(i[1],new _(0,s*1.1+M,0));o.push.apply(o,[_E25,_L18].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(O),[_b23]));break;}case"rightBottom":{var _b24=_.Sub(i[2],new _(0,s*1.1+M,0)),_E26=_.Sub(i[2],new _(-g,s*1.1+M/2,0)),_L19=_.Sub(i[2],new _(0,s*1.1,0));o.push.apply(o,[_E26,_L19].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(l),_toConsumableArray(O),[_b24]));break;}}var A=Nt(this.tmpPoints,t),I=[Math.floor(A.x+A.w/2),Math.floor(A.y+A.h/2)];return{rect:A,pos:I,points:o};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||xt.Sub(i,n).XY.includes(0))return!1;if(this.tmpPoints.length===2){if(n.isNear(this.tmpPoints[1],1))return!1;this.tmpPoints[1]=n;}else this.tmpPoints.push(n);return!0;}},{key:"consumeService",value:function consumeService(t){var o,f;var e=t.op,n=t.isFullWork,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,s=n.fillColor,o=n.toolsType,f=n.placement,v=i.get(e.name),l=v==null?void 0:v.opt;var p=e;return e.tagName==="GROUP"&&(p=e.children[0]),a&&(p.setAttribute("strokeColor",a),l!=null&&l.strokeColor&&(l.strokeColor=a)),s&&(s==="transparent"?p.setAttribute("fillColor","rgba(0,0,0,0)"):p.setAttribute("fillColor",s),l!=null&&l.fillColor&&(l.fillColor=s)),o===ht.SpeechBalloon&&f&&(l.placement=f),v&&i.setInfo(e.name,_objectSpread(_objectSpread({},v),{},{opt:l})),yt.updateNodeOpt(t);}}]);}(yt);var Le=/*#__PURE__*/function(_yt11){function Le(t){var _this71;_classCallCheck(this,Le);_this71=_callSuper(this,Le,[t]);nt(_this71,"canRotate",!0);nt(_this71,"scaleType",zt.all);nt(_this71,"toolsType",ht.Image);nt(_this71,"tmpPoints",[]);nt(_this71,"workOptions");nt(_this71,"oldRect");_this71.workOptions=t.toolsOpt,_this71.scaleType=Le.getScaleType(_this71.workOptions);return _this71;}_inherits(Le,_yt11);return _createClass(Le,[{key:"consume",value:function consume(){return{type:ct.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ct.None};}},{key:"draw",value:function draw(t){var e=t.layer,n=t.workId,i=t.replaceId,a=t.imageBitmap,s=t.isMainThread,_this$workOptions12=this.workOptions,o=_this$workOptions12.centerX,f=_this$workOptions12.centerY,v=_this$workOptions12.width,l=_this$workOptions12.height,p=_this$workOptions12.rotate,y=_this$workOptions12.zIndex,O={anchor:[0.5,0.5],pos:[o,f],name:n,size:[v,l],zIndex:y,rotate:!s&&180+(p||0)||p,texture:a},x=new Xh(O);this.replace(e,i||n,x);var m=x.getBoundingClientRect();if(m)return{x:Math.floor(m.x-yt.SafeBorderPadding),y:Math.floor(m.y-yt.SafeBorderPadding),w:Math.floor(m.width+yt.SafeBorderPadding*2),h:Math.floor(m.height+yt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(t){var l,p,y,O,e,n,i,a,_this$workOptions13,s,o,f,v,x,m;return _regeneratorRuntime().wrap(function _callee14$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:e=t.isFullWork,n=t.replaceId,i=t.scene,a=t.isMainThread,_this$workOptions13=this.workOptions,s=_this$workOptions13.src,o=_this$workOptions13.uuid,f=((l=this.workId)==null?void 0:l.toString())||o,v=e?this.fullLayer:this.drawLayer||this.fullLayer;if(!s){_context16.next=7;break;}_context16.next=4;return i.preload({id:o,src:this.workOptions.src});case 4:x=_context16.sent;m=this.draw({workId:f,layer:v,replaceId:n,imageBitmap:x[0],isMainThread:a});return _context16.abrupt("return",(this.oldRect=f&&((y=(p=this.vNodes)==null?void 0:p.get(f))==null?void 0:y.rect)||void 0,(O=this.vNodes)==null||O.setInfo(f,{rect:m,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:m&&yt.getCenterPos(m,v)}),m));case 7:case"end":return _context16.stop();}},_callee14,this);}));function consumeServiceAsync(_x23){return _consumeServiceAsync.apply(this,arguments);}return consumeServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getScaleType",value:function getScaleType(t){var e=t.uniformScale,n=t.rotate;return e!==!1||n&&Math.abs(n)%90>0?zt.proportional:zt.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,s=n.translate,o=n.box,f=n.boxScale,v=n.boxTranslate,l=n.angle,p=n.isLocked,y=n.zIndex,O=a&&Xt(a)||i.get(e.name);if(!O)return;var x=e.parent;if(x){if(Jt(y)&&(e.setAttribute("zIndex",y),O.opt.zIndex=y),se(p)&&(O.opt.locked=p),o&&v&&f){var _O$opt=O.opt,m=_O$opt.centerX,_T40=_O$opt.centerY,_c33=_O$opt.width,d=_O$opt.height,u=_O$opt.uniformScale,g=_O$opt.rotate,M=Math.min(f[0],f[1]),A=u!==!1?[M,M]:f,I=wn({x:m-_c33/2,y:_T40-d/2,w:_c33,h:d},g||0),b=Dh(I,new _(m,_T40),A),E=wh(b,new _(m,_T40),-(g||0)),L=Nt(E);O.opt.width=Math.round(L.w),O.opt.height=Math.round(L.h);var D=[v[0]/x.worldScaling[0],v[1]/x.worldScaling[1]];O.opt.centerX=m+D[0],O.opt.centerY=_T40+D[1];var R=[O.centerPos[0]+D[0],O.centerPos[1]+D[1]];if(O.centerPos=R,a){var C=Wn(O.rect,f);C=Re(C,D),O.rect=C;}}else if(s){var _m10=[s[0]/x.worldScaling[0],s[1]/x.worldScaling[1]];if(O.opt.centerX=O.opt.centerX+_m10[0],O.opt.centerY=O.opt.centerY+_m10[1],O.centerPos=[O.centerPos[0]+_m10[0],O.centerPos[1]+_m10[1]],a){var _T41=Re(O.rect,_m10);O.rect=_T41;}}else if(Jt(l)&&(O.opt.rotate=l,O.scaleType=Le.getScaleType(O.opt),a)){var _m11=Nn(O.rect,l);O.rect=_m11;}return O&&i.setInfo(e.name,O),O==null?void 0:O.rect;}}}]);}(yt);var Jn=/*#__PURE__*/function(_yt12){function Jn(t){var _this72;_classCallCheck(this,Jn);_this72=_callSuper(this,Jn,[t]);nt(_this72,"canRotate",!1);nt(_this72,"scaleType",zt.both);nt(_this72,"toolsType",ht.Straight);nt(_this72,"tmpPoints",[]);nt(_this72,"workOptions");nt(_this72,"oldRect");nt(_this72,"straightTipWidth");nt(_this72,"syncTimestamp");_this72.workOptions=t.toolsOpt,_this72.straightTipWidth=_this72.workOptions.thickness/2,_this72.syncTimestamp=0,_this72.syncUnitTime=50;return _this72;}_inherits(Jn,_yt12);return _createClass(Jn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,s=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!s)return{type:ct.None};var o=e.op,f=e.workState,v=o==null?void 0:o.length;if(!v||v<2)return{type:ct.None};var l;if(f===Rt.Start?(this.tmpPoints=[new xt(o[0],o[1])],l=!1):l=this.updateTempPoints(o),!l)return{type:ct.None};var p;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;p=this.draw({workId:s,layer:x});}if(!i){var _x24=Date.now();return _x24-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x24,{type:ct.DrawWork,dataType:Tt.Local,workId:s,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var y=Ot(p,this.oldRect);return this.oldRect=p,{rect:y,type:ct.DrawWork,dataType:Tt.Local,workId:s};}},{key:"consumeAll",value:function consumeAll(t){var f,v;var e=t.data,n=(f=e==null?void 0:e.workId)==null?void 0:f.toString();if(!n)return{type:ct.None};if(this.tmpPoints.length<2)return{type:ct.RemoveNode,removeIds:[n]};var i=this.fullLayer,a=this.draw({workId:n,layer:i});this.oldRect=a;var s=this.tmpPoints.map(function(l){return[].concat(_toConsumableArray(l.XY),[0]);}).flat(1),o=qt(s);return(v=this.vNodes)==null||v.setInfo(n,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Tt.Local,workId:n,ops:o,isSync:!0,opt:this.workOptions};}},{key:"draw",value:function draw(t){var e=t.workId,n=t.layer,_this$workOptions14=this.workOptions,i=_this$workOptions14.strokeColor,a=_this$workOptions14.thickness,s=_this$workOptions14.zIndex,o=_this$workOptions14.scale,f=_this$workOptions14.rotate,v=_this$workOptions14.translate,l=n.worldPosition,p=n.worldScaling,_this$computDrawPoint8=this.computDrawPoints(a),y=_this$computDrawPoint8.d,O=_this$computDrawPoint8.rect,x=[O.x+O.w/2,O.y+O.h/2],m={pos:x,name:e,id:e,d:y,fillColor:i,strokeColor:i,lineWidth:0,className:"".concat(x[0],",").concat(x[1]),normalize:!0,zIndex:s};o&&(m.scale=o),f&&(m.rotate=f),v&&(m.translate=v);var T=new he(m);if(this.replace(n,e,T),f||o||v){var d=T.getBoundingClientRect();return{x:Math.floor(d.x-yt.SafeBorderPadding),y:Math.floor(d.y-yt.SafeBorderPadding),w:Math.floor(d.width+yt.SafeBorderPadding*2),h:Math.floor(d.height+yt.SafeBorderPadding*2)};}return{x:Math.floor(O.x*p[0]+l[0]-yt.SafeBorderPadding),y:Math.floor(O.y*p[1]+l[1]-yt.SafeBorderPadding),w:Math.floor(O.w*p[0]+2*yt.SafeBorderPadding),h:Math.floor(O.h*p[1]+2*yt.SafeBorderPadding)};}},{key:"computDrawPoints",value:function computDrawPoints(t){return this.tmpPoints[1].distance(this.tmpPoints[0])>this.straightTipWidth?this.computFullPoints(t):this.computDotPoints(t);}},{key:"computFullPoints",value:function computFullPoints(t){var e=_.Sub(this.tmpPoints[1],this.tmpPoints[0]).uni(),n=_.Per(e).mul(t/2),i=xt.Sub(this.tmpPoints[0],n),a=xt.Add(this.tmpPoints[0],n),s=xt.Sub(this.tmpPoints[1],n),o=xt.Add(this.tmpPoints[1],n),f=xt.GetSemicircleStroke(this.tmpPoints[1],s,-1,8),v=xt.GetSemicircleStroke(this.tmpPoints[0],a,-1,8),l=[i,s].concat(_toConsumableArray(f),[o,a],_toConsumableArray(v));return{d:me(l,!0),rect:Nt(l),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var e=xt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:me(e,!0),rect:Nt(e),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new xt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a))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 o,f;var e=t.op,n=t.isFullWork,i=(o=this.workId)==null?void 0:o.toString();if(!i)return;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3)this.tmpPoints.push(new xt(e[v],e[v+1],e[v+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,s=this.draw({workId:i,layer:a});return this.oldRect=s,(f=this.vNodes)==null||f.setInfo(i,{rect:s,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,a)}),s;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var o;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,s=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(o=s==null?void 0:s.opt)!=null&&o.strokeColor&&(s.opt.strokeColor=a)),s&&i.setInfo(e.name,s),yt.updateNodeOpt(t);}}]);}(yt);var be=/*#__PURE__*/function(_yt13){function be(t){var _this73;_classCallCheck(this,be);_this73=_callSuper(this,be,[t]);nt(_this73,"canRotate",!1);nt(_this73,"scaleType",zt.all);nt(_this73,"toolsType",ht.Text);nt(_this73,"tmpPoints",[]);nt(_this73,"workOptions");nt(_this73,"oldRect");_this73.workOptions=t.toolsOpt;return _this73;}_inherits(be,_yt13);return _createClass(be,[{key:"consume",value:function consume(){return{type:ct.None};}},{key:"consumeAll",value:function consumeAll(){return{type:ct.None};}},{key:"consumeService",value:function consumeService(){}},{key:"draw",value:function(){var _draw3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(t){var e,n,i,_this$workOptions15,a,s,o,f,v,l,p,y,O,x;return _regeneratorRuntime().wrap(function _callee15$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:e=t.workId,n=t.layer,i=t.isDrawLabel,_this$workOptions15=this.workOptions,a=_this$workOptions15.boxSize,s=_this$workOptions15.boxPoint,o=_this$workOptions15.zIndex,f=n.worldPosition,v=n.worldScaling;if(!(!s||!a)){_context17.next=3;break;}return _context17.abrupt("return");case 3:l={name:e,id:e,pos:[s[0]+a[0]/2,s[1]+a[1]/2],anchor:[0.5,0.5],size:a,zIndex:o// bgcolor:"rgba(109,212,0,0.5)"
|
|
451
|
+
},p=new ne(l),y={x:s[0],y:s[1],w:a[0],h:a[1]},O=new ir({normalize:!0,pos:[0,0],size:a}),x=i&&be.createLabels(this.workOptions,n)||[];p.append.apply(p,_toConsumableArray(x).concat([O]));this.replace(n,e,p);_context17.t0=i;if(!_context17.t0){_context17.next=11;break;}_context17.next=10;return new Promise(function(m){setTimeout(m,0);});case 10:this.updateLabelsWidth(p);case 11:return _context17.abrupt("return",{x:Math.floor(y.x*v[0]+f[0]),y:Math.floor(y.y*v[1]+f[1]),w:Math.floor(y.w*v[0]),h:Math.floor(y.h*v[1])});case 12:case"end":return _context17.stop();}},_callee15,this);}));function draw(_x25){return _draw3.apply(this,arguments);}return draw;}()},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(t){var f,v,l,p,e,n,i,a,s,o;return _regeneratorRuntime().wrap(function _callee16$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:e=(f=this.workId)==null?void 0:f.toString();if(e){_context18.next=3;break;}return _context18.abrupt("return");case 3:n=t.isFullWork,i=t.replaceId,a=t.isDrawLabel;this.oldRect=i&&((l=(v=this.vNodes)==null?void 0:v.get(i))==null?void 0:l.rect)||void 0;s=n?this.fullLayer:this.drawLayer||this.fullLayer;_context18.next=8;return this.draw({workId:e,layer:s,isDrawLabel:a||this.workOptions.workState===Rt.Done});case 8:o=_context18.sent;return _context18.abrupt("return",((p=this.vNodes)==null||p.setInfo(e,{rect:o,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,s)}),o));case 10:case"end":return _context18.stop();}},_callee16,this);}));function consumeServiceAsync(_x26){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updateLabelsWidth",value:function updateLabelsWidth(t){var _this74=this;t.children.forEach(function(e){if(e.tagName==="LABEL"){var n=e.name,_e$getBoundingClientR=e.getBoundingClientRect(),i=_e$getBoundingClientR.width,_t$worldScaling=_slicedToArray(t.worldScaling,1),a=_t$worldScaling[0],_this74$getWorkOption=_this74.getWorkOptions(),s=_this74$getWorkOption.underline,o=_this74$getWorkOption.lineThrough;s&&t.getElementsByName("".concat(n,"_underline"))[0].attr({points:[0,0,i/a,0]}),o&&t.getElementsByName("".concat(n,"_lineThrough"))[0].attr({points:[0,0,i/a,0]});}});}},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(t){var y,O,e,n,i,a,s,o,f,v,l,p;return _regeneratorRuntime().wrap(function _callee17$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:if(this.workId){_context19.next=2;break;}return _context19.abrupt("return");case 2:e=this.workId.toString(),n=t.fontColor,i=t.fontBgColor,a=t.bold,s=t.italic,o=t.lineThrough,f=t.underline,v=t.zIndex,l=(y=this.vNodes)==null?void 0:y.get(e);if(l){_context19.next=5;break;}return _context19.abrupt("return");case 5:n&&(l.opt.fontColor=n),i&&(l.opt.fontBgColor=i),a&&(l.opt.bold=a),s&&(l.opt.italic=s),se(o)&&(l.opt.lineThrough=o),se(f)&&(l.opt.underline=f),i&&(l.opt.fontBgColor=i),Jt(v)&&(l.opt.zIndex=v),this.oldRect=l.rect;_context19.next=8;return this.draw({workId:e,layer:this.fullLayer,isDrawLabel:this.workOptions.workState===Rt.Done});case 8:p=_context19.sent;return _context19.abrupt("return",((O=this.vNodes)==null||O.setInfo(e,{rect:p,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:p&&yt.getCenterPos(p,this.fullLayer)}),p));case 10:case"end":return _context19.stop();}},_callee17,this);}));function updataOptServiceAsync(_x27){return _updataOptServiceAsync.apply(this,arguments);}return updataOptServiceAsync;}()},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"getFontWidth",value:function getFontWidth(t){var e=t.ctx,n=t.opt,i=t.text,a=n.bold,s=n.italic,o=n.fontSize,f=n.fontFamily;return e.font="".concat(a," ").concat(s," ").concat(o,"px ").concat(f),e.measureText(i).width;}},{key:"createLabels",value:function createLabels(t,e){var n=[],i=t.text.split(","),a=i.length;for(var s=0;s<a;s++){var o=i[s],f=t.fontSize,v=t.lineHeight,l=t.bold,p=t.textAlign,y=t.italic,O=t.boxSize,x=t.fontFamily,m=t.verticalAlign,_T42=t.fontColor,_c34=t.underline,d=t.lineThrough,u=v||f*1.2,g=e&&e.parent.canvas.getContext("2d"),M=g&&be.getFontWidth({text:o,opt:t,ctx:g,worldScaling:e.worldScaling});if(M){var A={anchor:[0,0.5],text:o,fontSize:f,lineHeight:u,fontFamily:x,fontWeight:l,fillColor:_T42,textAlign:p,fontStyle:y,name:s.toString(),className:"label"},I=[0,0];if(m==="middle"){var E=(a-1)/2;I[1]=(s-E)*u;}if(p==="left"){var _E27=O&&-O[0]/2||0;I[0]=y==="italic"&&_E27||_E27+5,console.log("text-left",I);}A.pos=I;var b=new Vh(A);if(n.push(b),_c34){var _E28={normalize:!1,pos:[A.pos[0],A.pos[1]+f/2],lineWidth:Math.floor(f/10),points:[0,0,M,0],strokeColor:_T42,name:"".concat(s,"_underline"),className:"underline"},L=new ce(_E28);n.push(L);}if(d){var _E29={normalize:!1,pos:A.pos,lineWidth:Math.floor(f/10),points:[0,0,M,0],strokeColor:_T42,name:"".concat(s,"_lineThrough"),className:"lineThrough"},_L20=new ce(_E29);n.push(_L20);}}}return n;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,s=n.fontBgColor,o=n.fontColor,f=n.translate,v=n.box,l=n.boxScale,p=n.boxTranslate,y=n.bold,O=n.italic,x=n.lineThrough,m=n.underline,T=n.fontSize,c=n.textInfos,d=n.zIndex,u=a&&Xt(a)||i.get(e.name);if(!u)return;var g=e.parent;if(!g)return;var M=u.opt;if(Jt(d)&&(e.setAttribute("zIndex",d),u.opt.zIndex=d),o&&M.fontColor&&(M.fontColor=o,e.children.forEach(function(A){A.tagName==="LABEL"?A.setAttribute("fillColor",o):A.tagName==="POLYLINE"&&A.setAttribute("strokeColor",o);})),s&&M.fontBgColor&&(M.fontBgColor=s),y&&(M.bold=y),O&&(M.italic=O),se(x)&&(M.lineThrough=x),se(m)&&(M.underline=m),T&&(M.fontSize=T),v&&p&&l){var A=c==null?void 0:c.get(e.name);if(A){var E=A.fontSize,L=A.boxSize;M.boxSize=L||M.boxSize,M.fontSize=E||M.fontSize;}var I=u.rect,b=Re(Wn(I,l),p);M.boxPoint=b&&[(b.x-g.worldPosition[0])/g.worldScaling[0],(b.y-g.worldPosition[1])/g.worldScaling[1]];}else if(f&&M.boxPoint){var _A3=[f[0]/g.worldScaling[0],f[1]/g.worldScaling[1]];M.boxPoint=[M.boxPoint[0]+_A3[0],M.boxPoint[1]+_A3[1]],u.centerPos=[u.centerPos[0]+_A3[0],u.centerPos[1]+_A3[1]],u.rect=Re(u.rect,_A3);}return u&&i.setInfo(e.name,u),u==null?void 0:u.rect;}},{key:"getRectFromLayer",value:function getRectFromLayer(t,e){var n=t.getElementsByName(e)[0];if(n){var i=n.getBoundingClientRect();return{x:Math.floor(i.x),y:Math.floor(i.y),w:Math.floor(i.width),h:Math.floor(i.height)};}}}]);}(yt);function Qn(h){switch(h){case ht.Arrow:return Gn;case ht.Pencil:return jn;case ht.Straight:return Jn;case ht.Ellipse:return Hn;case ht.Polygon:case ht.Triangle:return Yn;case ht.Star:case ht.Rhombus:return Vn;case ht.Rectangle:return Kn;case ht.SpeechBalloon:return Xn;case ht.Text:return be;case ht.LaserPen:return Un;case ht.Eraser:return ie;case ht.Selector:return wt;case ht.Image:return Le;}}function Sr(h,r){var t=h.toolsType,e=_objectWithoutProperties(h,_excluded);switch(t){case ht.Arrow:return new Gn(e);case ht.Pencil:return new jn(e);case ht.Straight:return new Jn(e);case ht.Ellipse:return new Hn(e);case ht.Polygon:case ht.Triangle:return new Yn(e);case ht.Star:case ht.Rhombus:return new Vn(e);case ht.Rectangle:return new Kn(e);case ht.SpeechBalloon:return new Xn(e);case ht.Text:return new be(e);case ht.LaserPen:return new Un(e);case ht.Eraser:return new ie(e,r);case ht.Selector:return e.vNodes?new wt(_objectSpread(_objectSpread({},e),{},{vNodes:e.vNodes,drawLayer:e.fullLayer})):void 0;case ht.Image:return new Le(e);default:return;}}function Zn(h){var r=[],t=["PATH","SPRITE","POLYLINE","RECT","ELLIPSE"];var _iterator15=_createForOfIteratorHelper(h),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var _e6=_step15.value;if(_e6.tagName==="GROUP"&&_e6.children.length)return Zn(_e6.children);_e6.tagName&&t.includes(_e6.tagName)&&r.push(_e6);}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}return r;}var f0=/*#__PURE__*/function(_te2){function f0(){var _this75;_classCallCheck(this,f0);_this75=_callSuper(this,f0,arguments);nt(_this75,"emitEventType",Lt.SetColorNode);return _this75;}_inherits(f0,_te2);return _createClass(f0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(t){var f,e,n,i,a,s,o;return _regeneratorRuntime().wrap(function _callee18$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,o=t.textUpdateForWoker;_context20.t0=e===wt.selectorId&&n;if(!_context20.t0){_context20.next=5;break;}_context20.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,textUpdateForWoker:o,callback:this.updateSelectorCallback});case 5:case"end":return _context20.stop();}},_callee18,this);}));function consumeForLocalWorker(_x28){return _consumeForLocalWorker2.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,s=e.isSync,o=e.textUpdateForWoker,f=n.render||[],v=n.sp||[];if(a){var _iterator16=_createForOfIteratorHelper(i.entries()),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var _step16$value=_slicedToArray(_step16.value,2),l=_step16$value[0],p=_step16$value[1];o&&p.toolsType===ht.Text?v.push(_objectSpread(_objectSpread({},p),{},{workId:l,type:ct.TextUpdate,dataType:Tt.Local,willSyncService:!0})):v.push(_objectSpread(_objectSpread({},p),{},{workId:l,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}));}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}}return{render:f,sp:v};}}]);}(te);var u0=/*#__PURE__*/function(_te3){function u0(){var _this76;_classCallCheck(this,u0);_this76=_callSuper(this,u0,arguments);nt(_this76,"emitEventType",Lt.ZIndexNode);return _this76;}_inherits(u0,_te3);return _createClass(u0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(t){var o,e,n,i,a,s;return _regeneratorRuntime().wrap(function _callee19$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData;_context21.t0=e===wt.selectorId&&n;if(!_context21.t0){_context21.next=5;break;}_context21.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return _context21.stop();}},_callee19,this);}));function consumeForLocalWorker(_x29){return _consumeForLocalWorker3.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,s=e.isSync,o=n.render||[],f=n.sp||[];if(a&&f){var _iterator17=_createForOfIteratorHelper(i.entries()),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var _step17$value=_slicedToArray(_step17.value,2),v=_step17$value[0],l=_step17$value[1];f.push(_objectSpread(_objectSpread({},l),{},{workId:v,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}));}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}}return{render:o,sp:f};}}]);}(te);var h0=/*#__PURE__*/function(_te4){function h0(){var _this77;_classCallCheck(this,h0);_this77=_callSuper(this,h0,arguments);nt(_this77,"emitEventType",Lt.TranslateNode);return _this77;}_inherits(h0,_te4);return _createClass(h0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(t){var v,l,e,n,i,a,s,o,f;return _regeneratorRuntime().wrap(function _callee20$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,o=t.textUpdateForWoker,f=t.emitEventType;_context22.t0=e===wt.selectorId&&n;if(!_context22.t0){_context22.next=9;break;}if(!(n.workState===Rt.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Rt.Done)){_context22.next=8;break;}_context22.next=6;return(v=this.localWork)==null?void 0:v.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,isSync:!0,textUpdateForWoker:o,emitEventType:f,scene:this.scene,callback:this.updateSelectorCallback});case 6:_context22.next=9;break;case 8:n.workState===Rt.Done&&((l=this.localWork)==null||l.vNodes.deleteLastTarget());case 9:case"end":return _context22.stop();}},_callee20,this);}));function consumeForLocalWorker(_x30){return _consumeForLocalWorker4.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,s=t.res,o=e.willSyncService,f=e.isSync,v=e.updateSelectorOpt,l=e.textUpdateForWoker,p=v.workState,y=n.render||[],O=n.sp||[];if(p===Rt.Start)return{sp:[],render:[]};var x=s==null?void 0:s.selectRect;if(o){p===Rt.Doing&&O.push({type:ct.Select,selectIds:a.selectIds,selectRect:x,willSyncService:!0,isSync:!0,points:a.getChildrenPoints(),textOpt:a.textOpt});var _iterator18=_createForOfIteratorHelper(i.entries()),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var _step18$value=_slicedToArray(_step18.value,2),m=_step18$value[0],_T43=_step18$value[1];l&&_T43.toolsType===ht.Text?O.push(_objectSpread(_objectSpread({},_T43),{},{workId:m,type:ct.TextUpdate,dataType:Tt.Local,willSyncService:!0})):O.push(_objectSpread(_objectSpread({},_T43),{},{workId:m,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}}return{render:y,sp:O};}}]);}(te);var d0=/*#__PURE__*/function(_te5){function d0(){var _this78;_classCallCheck(this,d0);_this78=_callSuper(this,d0,arguments);nt(_this78,"emitEventType",Lt.DeleteNode);return _this78;}_inherits(d0,_te5);return _createClass(d0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.RemoveNode){if(n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;if(n===Tt.Service&&i===this.emitEventType)return this.consumeForServiceWorker(t),!0;}}},{key:"consumeForLocalWorker",value:function consumeForLocalWorker(t){if(!this.localWork)return;var e=t.removeIds,n=t.willRefresh,i=t.willSyncService,a=t.viewId;if(!(e!=null&&e.length))return;var s;var o=[],f=[],v=[];var _iterator19=_createForOfIteratorHelper(e),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var l=_step19.value;if(l===wt.selectorId){var y=this.localWork.workShapes.get(wt.selectorId);if(!y)return;var O=y.selectIds&&_toConsumableArray(y.selectIds)||[];var _iterator20=_createForOfIteratorHelper(O),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var m=_step20.value;if(this.localWork.vNodes.get(m)){var _c35=this.commandDeleteText(m);_c35&&o.push(_c35);}s=Ot(s,this.localWork.removeNode(m)),v.push(m);}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}var x=y==null?void 0:y.updateSelectIds([]);s=Ot(s,x.bgRect),this.localWork.clearWorkShapeNodeCache(wt.selectorId),this.localWork.workShapes["delete"](wt.selectorId),o.push({type:ct.Select,selectIds:[],willSyncService:i});continue;}var p=this.commandDeleteText(l);p&&o.push(p),s=Ot(s,this.localWork.removeNode(l)),v.push(l);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}i&&o.push({type:ct.RemoveNode,removeIds:v}),s&&n&&f.push({rect:Bt(s),clearCanvas:Mt.Bg,isClear:!0,viewId:a},{rect:Bt(s),drawCanvas:Mt.Bg,viewId:a}),(f.length||o.length)&&this.localWork._post({render:f,sp:o});}},{key:"consumeForServiceWorker",value:function consumeForServiceWorker(t){this.serviceWork&&this.serviceWork.removeSelectWork(t);}},{key:"commandDeleteText",value:function commandDeleteText(t){var n;var e=(n=this.localWork)==null?void 0:n.vNodes.get(t);if(e&&e.toolsType===ht.Text)return{type:ct.TextUpdate,toolsType:ht.Text,workId:t,dataType:Tt.Local};}}]);}(te);var g0=/*#__PURE__*/function(_te6){function g0(){var _this79;_classCallCheck(this,g0);_this79=_callSuper(this,g0,arguments);nt(_this79,"emitEventType",Lt.ScaleNode);return _this79;}_inherits(g0,_te6);return _createClass(g0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var s,e,n,i,a;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willSyncService,a=t.willSerializeData;_context23.t0=e===wt.selectorId&&n;if(!_context23.t0){_context23.next=5;break;}_context23.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:a,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return _context23.stop();}},_callee21,this);}));function consumeForLocalWorker(_x31){return _consumeForLocalWorker5.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,s=t.newServiceStore,o=e.updateSelectorOpt,f=e.willSyncService,v=e.willSerializeData,l=o.workState,p=n.render||[],y=n.sp||[],O=a==null?void 0:a.selectRect;if(l===Rt.Start)return{sp:[],render:[]};if(f){l===Rt.Doing&&y.push({type:ct.Select,selectIds:i.selectIds,selectRect:O,willSyncService:!0,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt}),v&&l===Rt.Done&&y.push({type:ct.Select,selectIds:i.selectIds,selectRect:O,willSyncService:!1,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt});var _iterator21=_createForOfIteratorHelper(s.entries()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _step21$value=_slicedToArray(_step21.value,2),x=_step21$value[0],m=_step21$value[1];m.toolsType===ht.Text?y.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.TextUpdate,dataType:Tt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}}return{render:p,sp:y};}}]);}(te);var p0=/*#__PURE__*/function(_te7){function p0(){var _this80;_classCallCheck(this,p0);_this80=_callSuper(this,p0,arguments);nt(_this80,"emitEventType",Lt.RotateNode);return _this80;}_inherits(p0,_te7);return _createClass(p0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var f,e,n,i,a,s,o;return _regeneratorRuntime().wrap(function _callee22$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,o=t.emitEventType;_context24.t0=e===wt.selectorId&&n;if(!_context24.t0){_context24.next=5;break;}_context24.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,emitEventType:o,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback});case 5:case"end":return _context24.stop();}},_callee22,this);}));function consumeForLocalWorker(_x32){return _consumeForLocalWorker6.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.workShapeNode,a=t.res,s=t.newServiceStore,o=e.updateSelectorOpt,f=e.willSyncService,v=e.willSerializeData,l=e.isSync,p=o.workState,y=n.render||[],O=n.sp||[],x=a==null?void 0:a.selectRect;if(f){v&&p===Rt.Done&&O.push({type:ct.Select,selectIds:i.selectIds,selectRect:x,willSyncService:!0,isSync:l,points:i.getChildrenPoints(),textOpt:i.textOpt,selectorColor:i.selectorColor,strokeColor:i.strokeColor,fillColor:i.fillColor,canTextEdit:i.canTextEdit,canRotate:i.canRotate,scaleType:i.scaleType,opt:i.getWorkOptions()||void 0,canLock:i.canLock,isLocked:i.isLocked,toolsTypes:i.toolsTypes,shapeOpt:i.shapeOpt});var _iterator22=_createForOfIteratorHelper(s.entries()),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _step22$value=_slicedToArray(_step22.value,2),m=_step22$value[0],_T44=_step22$value[1];O.push(_objectSpread(_objectSpread({},_T44),{},{workId:m,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:l}));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}return{render:y,sp:O};}}]);}(te);var v0=/*#__PURE__*/function(_te8){function v0(){var _this81;_classCallCheck(this,v0);_this81=_callSuper(this,v0,arguments);nt(_this81,"emitEventType",Lt.SetFontStyle);return _this81;}_inherits(v0,_te8);return _createClass(v0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var f,e,n,i,a,s,o;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,o=t.textUpdateForWoker;_context25.t0=e===wt.selectorId&&n;if(!_context25.t0){_context25.next=5;break;}_context25.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,textUpdateForWoker:o,callback:this.updateSelectorCallback});case 5:case"end":return _context25.stop();}},_callee23,this);}));function consumeForLocalWorker(_x33){return _consumeForLocalWorker7.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,s=t.res,o=e.willSyncService,f=e.isSync,v=e.updateSelectorOpt,l=e.textUpdateForWoker,p=n.render||[],y=n.sp||[],O=s==null?void 0:s.selectRect;if(o&&y){v.fontSize&&y.push({type:ct.Select,selectIds:a.selectIds,selectRect:O,willSyncService:o,isSync:f,points:a.getChildrenPoints()});var _iterator23=_createForOfIteratorHelper(i.entries()),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _step23$value=_slicedToArray(_step23.value,2),x=_step23$value[0],m=_step23$value[1];l&&m.toolsType===ht.Text?y.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.TextUpdate,dataType:Tt.Local,willSyncService:!0})):y.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}}return{render:p,sp:y};}}]);}(te);var m0=/*#__PURE__*/function(_te9){function m0(){var _this82;_classCallCheck(this,m0);_this82=_callSuper(this,m0,arguments);nt(_this82,"emitEventType",Lt.SetPoint);return _this82;}_inherits(m0,_te9);return _createClass(m0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var f,e,n,i,a,s,o;return _regeneratorRuntime().wrap(function _callee24$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData,o=t.textUpdateForWoker;_context26.t0=e===wt.selectorId&&n;if(!_context26.t0){_context26.next=5;break;}_context26.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:s,isSync:!0,textUpdateForWoker:o,callback:this.updateSelectorCallback});case 5:case"end":return _context26.stop();}},_callee24,this);}));function consumeForLocalWorker(_x34){return _consumeForLocalWorker8.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,s=t.res,o=e.willSyncService,f=e.isSync,v=n.render||[],l=n.sp||[],p=s==null?void 0:s.selectRect;if(o&&l){var _iterator24=_createForOfIteratorHelper(i.entries()),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _step24$value=_slicedToArray(_step24.value,2),y=_step24$value[0],O=_step24$value[1];l.push(_objectSpread(_objectSpread({},O),{},{workId:y,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}l.push({type:ct.Select,selectIds:a.selectIds,selectRect:p,willSyncService:o,isSync:f,points:a.getChildrenPoints()});}return{render:v,sp:l};}}]);}(te);var y0=/*#__PURE__*/function(_te10){function y0(){var _this83;_classCallCheck(this,y0);_this83=_callSuper(this,y0,arguments);nt(_this83,"emitEventType",Lt.SetLock);return _this83;}_inherits(y0,_te10);return _createClass(y0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var o,e,n,i,a,s;return _regeneratorRuntime().wrap(function _callee25$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData;_context27.t0=e===wt.selectorId&&n;if(!_context27.t0){_context27.next=5;break;}_context27.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return _context27.stop();}},_callee25,this);}));function consumeForLocalWorker(_x35){return _consumeForLocalWorker9.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=t.workShapeNode,s=t.res,o=e.willSyncService,f=e.isSync,v=e.updateSelectorOpt,l=n.render||[],p=n.sp||[],y=s==null?void 0:s.selectRect;if(o&&p){var _iterator25=_createForOfIteratorHelper(i.entries()),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _step25$value=_slicedToArray(_step25.value,2),O=_step25$value[0],x=_step25$value[1];p.push(_objectSpread(_objectSpread({},x),{},{workId:O,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}p.push({isLocked:v.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:ct.Select,selectIds:a.selectIds,selectRect:y,willSyncService:o,isSync:f});}return{render:l,sp:p};}}]);}(te);var S0=/*#__PURE__*/function(_te11){function S0(){var _this84;_classCallCheck(this,S0);_this84=_callSuper(this,S0,arguments);nt(_this84,"emitEventType",Lt.SetShapeOpt);return _this84;}_inherits(S0,_te11);return _createClass(S0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Tt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(t){var o,e,n,i,a,s;return _regeneratorRuntime().wrap(function _callee26$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,s=t.willSerializeData;_context28.t0=e===wt.selectorId&&n;if(!_context28.t0){_context28.next=5;break;}_context28.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:s,callback:this.updateSelectorCallback});case 5:case"end":return _context28.stop();}},_callee26,this);}));function consumeForLocalWorker(_x36){return _consumeForLocalWorker10.apply(this,arguments);}return consumeForLocalWorker;}()},{key:"updateSelectorCallback",value:function updateSelectorCallback(t){var e=t.param,n=t.postData,i=t.newServiceStore,a=e.willSyncService,s=e.isSync,o=n.render||[],f=n.sp||[];if(a&&f){var _iterator26=_createForOfIteratorHelper(i.entries()),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _step26$value=_slicedToArray(_step26.value,2),v=_step26$value[0],l=_step26$value[1];f.push(_objectSpread(_objectSpread({},l),{},{workId:v,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:s}));}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}}return{render:o,sp:f};}}]);}(te);var x0=/*#__PURE__*/function(){function x0(r){var _this85=this;_classCallCheck(this,x0);nt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this85.build(t)];}));}return _createClass(x0,[{key:"build",value:function build(r){switch(r){case Lt.TranslateNode:return new h0();case Lt.ZIndexNode:return new u0();case Lt.CopyNode:return new Ih();case Lt.SetColorNode:return new f0();case Lt.DeleteNode:return new d0();case Lt.ScaleNode:return new g0();case Lt.RotateNode:return new p0();case Lt.SetFontStyle:return new v0();case Lt.SetPoint:return new m0();case Lt.SetLock:return new y0();case Lt.SetShapeOpt:return new S0();}}},{key:"registerForWorker",value:function registerForWorker(r,t,e){return this.builders.forEach(function(n){n&&n.registerForWorker(r,t,e);}),this;}},{key:"consumeForWorker",value:function consumeForWorker(r){var _iterator27=_createForOfIteratorHelper(this.builders.values()),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var t=_step27.value;if(t!=null&&t.consume(r))return!0;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return!1;}}]);}();var or="cursorhover";var T0=/*#__PURE__*/function(){function T0(r,t){_classCallCheck(this,T0);nt(this,"viewId");nt(this,"scene");nt(this,"scenePath");nt(this,"fullLayer");nt(this,"curNodeMap",/* @__PURE__ */new Map());nt(this,"targetNodeMap",[]);this.viewId=r,this.scene=t;}return _createClass(T0,[{key:"init",value:function init(r){this.fullLayer=r;}},{key:"get",value:function get(r){return this.curNodeMap.get(r);}},{key:"hasRenderNodes",value:function hasRenderNodes(){var r=!1;var _iterator28=_createForOfIteratorHelper(this.curNodeMap.values()),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var t=_step28.value;jh(t)&&(r=!0);}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"has",value:function has(r){this.curNodeMap.has(r);}},{key:"setInfo",value:function setInfo(r,t){var e=this.curNodeMap.get(r)||{name:r,rect:t.rect};t.rect&&(e.rect=Xt(t.rect)),t.op&&(e.op=Xt(t.op)),t.canRotate&&(e.canRotate=t.canRotate),t.scaleType&&(e.scaleType=t.scaleType),t.opt&&(e.opt=Xt(t.opt)),t.toolsType&&(e.toolsType=t.toolsType),t.centerPos&&(e.centerPos=Xt(t.centerPos)),se(t.isSelected)&&(e.isSelected=t.isSelected),e.rect?this.curNodeMap.set(r,e):this.curNodeMap["delete"](r);}},{key:"selected",value:function selected(r){this.setInfo(r,{isSelected:!0});}},{key:"unSelected",value:function unSelected(r){this.setInfo(r,{isSelected:!1});}},{key:"delete",value:function _delete(r){this.curNodeMap["delete"](r);}},{key:"clear",value:function clear(){this.curNodeMap.clear(),this.targetNodeMap.length=0;}},{key:"hasRectIntersectRange",value:function hasRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var _iterator29=_createForOfIteratorHelper(this.curNodeMap.values()),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _e7=_step29.value;if(Ce(r,_e7.rect)){if(t&&_e7.toolsType===ht.Image&&_e7.opt.locked||t&&_e7.toolsType===ht.Text&&(_e7.opt.workState===Rt.Doing||_e7.opt.workState===Rt.Start))continue;return!0;}}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}return!1;}},{key:"getRectIntersectRange",value:function getRectIntersectRange(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var e;var n=/* @__PURE__ */new Map();var _iterator30=_createForOfIteratorHelper(this.curNodeMap.entries()),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _step30$value=_slicedToArray(_step30.value,2),i=_step30$value[0],a=_step30$value[1];if(Ce(r,a.rect)){if(t&&a.toolsType===ht.Image&&a.opt.locked||t&&a.toolsType===ht.Text&&(a.opt.workState===Rt.Doing||a.opt.workState===Rt.Start))continue;e=Ot(e,a.rect),n.set(i,a);}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}return{rectRange:e,nodeRange:n};}},{key:"getNodeRectFormShape",value:function getNodeRectFormShape(r,t){var e=Qn(t.toolsType);return this.fullLayer&&(e==null?void 0:e.getRectFromLayer(this.fullLayer,r));}},{key:"updateNodesRect",value:function updateNodesRect(){var _this86=this;this.curNodeMap.forEach(function(r,t){var e=_this86.getNodeRectFormShape(t,r);e?(r.rect=e,_this86.curNodeMap.set(t,r)):_this86.curNodeMap["delete"](t);});}},{key:"combineIntersectRect",value:function combineIntersectRect(r){var t=r;return this.curNodeMap.forEach(function(e){Ce(t,e.rect)&&(t=Ot(t,e.rect));}),t;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(Xt(this.curNodeMap)),this.targetNodeMap.length-1;}},{key:"getLastTarget",value:function getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1];}},{key:"deleteLastTarget",value:function deleteLastTarget(){this.targetNodeMap.length=this.targetNodeMap.length-1;}},{key:"getTarget",value:function getTarget(r){return this.targetNodeMap[r];}},{key:"deleteTarget",value:function deleteTarget(r){this.targetNodeMap.length=r;}}]);}();var kn=/*#__PURE__*/function(){function kn(r,t){_classCallCheck(this,kn);nt(this,"viewId");nt(this,"fullLayer");// readonly topLayer: Group;
|
|
452
|
+
nt(this,"vNodes");nt(this,"dpr");nt(this,"opt");// protected scenePath?: string;
|
|
453
|
+
nt(this,"cameraOpt");nt(this,"scene");nt(this,"isSafari",!1);nt(this,"combinePostMsg",/* @__PURE__ */new Set());nt(this,"workerTaskId");this.viewId=r,this.opt=t,this.dpr=t.dpr,this.scene=this.createScene(t.offscreenCanvasOpt),this.fullLayer=this.createLayer("fullLayer",this.scene,_objectSpread(_objectSpread({},t.layerOpt),{},{bufferSize:this.viewId==="mainView"?6e3:3e3})),this.vNodes=new T0(r,this.scene);}return _createClass(kn,[{key:"setIsSafari",value:function setIsSafari(r){this.isSafari=r;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(r,t){var e,n,i,a,s,o,f;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:e=r.msgType,n=r.toolsType,i=r.opt,a=r.workId,s=r.workState,o=r.dataType;_context29.t0=(Jt(t)&&this.post({workerTasksqueueCount:t}),e);_context29.next=_context29.t0===ct.Destroy?4:_context29.t0===ct.Clear?6:_context29.t0===ct.UpdateTools?8:_context29.t0===ct.CreateWork?10:_context29.t0===ct.DrawWork?12:14;break;case 4:this.destroy();return _context29.abrupt("break",14);case 6:this.clearAll();return _context29.abrupt("break",14);case 8:if(n&&i){f={toolsType:n,toolsOpt:i};this.localWork.setToolsOpt(f);}return _context29.abrupt("break",14);case 10:a&&i&&(!this.localWork.getTmpWorkShapeNode()&&n&&this.setToolsOpt({toolsType:n,toolsOpt:i}),this.setWorkOpt({workId:a,toolsOpt:i}));return _context29.abrupt("break",14);case 12:s===Rt.Done&&o===Tt.Local?this.consumeDrawAll(o,r):this.consumeDraw(o,r);return _context29.abrupt("break",14);case 14:case"end":return _context29.stop();}},_callee27,this);}));function on(_x37,_x38){return _on.apply(this,arguments);}return on;}()},{key:"updateScene",value:function updateScene(r){this.scene.attr(_objectSpread({},r));var t=r.width,e=r.height;this.scene.container.width=t,this.scene.container.height=e,this.scene.width=t,this.scene.height=e,this.updateLayer({width:t,height:e});}},{key:"updateLayer",value:function updateLayer(r){var t=r.width,e=r.height;this.fullLayer&&(this.fullLayer.parent.setAttribute("width",t),this.fullLayer.parent.setAttribute("height",e),this.fullLayer.setAttribute("size",[t,e]),this.fullLayer.setAttribute("pos",[t*0.5,e*0.5]));}},{key:"createScene",value:function createScene(r){var t=r.width,e=r.height,n=new OffscreenCanvas(t,e);return new Yh(_objectSpread({container:n,displayRatio:this.dpr,depth:!1,desynchronized:!0},r));}},{key:"createLayer",value:function createLayer(r,t,e){var n=e.width,i=e.height,a="offscreen-".concat(r),s=t.layer(a,e),o=new ne({anchor:[0.5,0.5],pos:[n*0.5,i*0.5],size:[n,i],name:"viewport",id:r});return s.append(o),o;}},{key:"clearAll",value:function clearAll(){var r;this.fullLayer&&(this.fullLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.fullLayer.removeAllChildren()),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();}},{key:"setToolsOpt",value:function setToolsOpt(r){this.localWork.setToolsOpt(r);}},{key:"setWorkOpt",value:function setWorkOpt(r){var t=r.workId,e=r.toolsOpt;t&&e&&this.localWork.setWorkOptions(t,e);}},{key:"destroy",value:function destroy(){var r;this.vNodes.clear(),this.fullLayer.remove(),this.scene.remove(),this.localWork.destroy(),(r=this.serviceWork)==null||r.destroy();}},{key:"post",value:function post(r){this.combinePostMsg.add(r),this.runBatchPostData();}},{key:"runBatchPostData",value:function runBatchPostData(){this.workerTaskId||(this.workerTaskId=requestAnimationFrame(this.combinePost.bind(this)));}},{key:"combinePostData",value:function combinePostData(){var _this87=this;var a,s;this.workerTaskId=void 0;var r=[],t=[];var e,n;var i=/* @__PURE__ */new Set();var _iterator31=_createForOfIteratorHelper(this.combinePostMsg.values()),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var o=_step31.value;if((a=o.render)!=null&&a.length){var _iterator32=_createForOfIteratorHelper(o.render),_step32;try{var _loop6=function _loop6(){var f=_step32.value;var v=!1;if(f.workId&&i.add(f.workId),f.isClearAll&&(f.rect=_this87.getSceneRect(),f.isClear=!0,delete f.isClearAll),f.drawCanvas){var l=_this87.getLayer(f.drawCanvas);if(!l)return 1;// continue
|
|
454
|
+
if(l.parent.render(),f.isDrawAll){var p=_this87.getSceneRect(),_this87$vNodes$getRec=_this87.vNodes.getRectIntersectRange(p,!1),y=_this87$vNodes$getRec.rectRange;f.rect=y,delete f.isDrawAll;}}var _iterator33=_createForOfIteratorHelper(r),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _l7=_step33.value;if(f.viewId===_l7.viewId){f.isClear&&_l7.clearCanvas&&_l7.isClear&&_l7.clearCanvas===f.clearCanvas&&(_l7.rect=Ot(_l7.rect,f.rect),v=!0),_l7.drawCanvas&&_l7.drawCanvas===f.drawCanvas&&(_l7.rect=Ot(_l7.rect,f.rect),v=!0);continue;}}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}if(!v)if(f.isClear&&!f.drawCanvas){var _l6=r.find(function(p){return p.drawCanvas===f.clearCanvas&&oe(p.rect,f.rect);});_l6!=null&&_l6.rect&&(_l6.rect=Bt(_l6.rect,2)),r.unshift(f);}else f.drawCanvas&&!f.clearCanvas&&f.rect&&r.find(function(l){return l.isClear&&l.clearCanvas===f.drawCanvas&&oe(l.rect,f.rect);})&&(f.rect=Bt(f.rect,2)),r.push(f);};for(_iterator32.s();!(_step32=_iterator32.n()).done;){if(_loop6())continue;}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}}if((s=o.sp)!=null&&s.length){var _iterator34=_createForOfIteratorHelper(o.sp),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var f=_step34.value;var v=!1;var _iterator35=_createForOfIteratorHelper(t),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var l=_step35.value;if(oe(f,l)){v=!0;break;}}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}v||t.push(f);}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}}Jt(o.drawCount)&&(e=o.drawCount),Jt(o.workerTasksqueueCount)&&(n=o.workerTasksqueueCount);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}return this.combinePostMsg.clear(),{render:r,sp:t,drawCount:e,workerTasksqueueCount:n,workIds:i};}},{key:"safariFixRect",value:function safariFixRect(r){if(r.w+r.x<=0||r.h+r.y<=0||r.w<=0||r.h<=0)return;var t=this.scene.width,e=this.scene.height,n={x:Math.floor(Math.max(0,r.x)),y:Math.floor(Math.max(0,r.y)),w:Math.floor(Math.min(t,r.w)),h:Math.floor(Math.min(e,r.h))};return n.x+n.w>t&&(n.w=Math.floor(t-n.x)),n.y+n.h>e&&(n.h=Math.floor(e-n.y)),n;}},{key:"getSceneRect",value:function getSceneRect(){var _this$scene=this.scene,r=_this$scene.width,t=_this$scene.height;return{x:0,y:0,w:Math.floor(r),h:Math.floor(t)};}}]);}();var qn=/*#__PURE__*/function(){function qn(r){_classCallCheck(this,qn);nt(this,"viewId");nt(this,"vNodes");nt(this,"thread");nt(this,"fullLayer");nt(this,"drawLayer");nt(this,"_post");nt(this,"tmpWorkShapeNode");nt(this,"tmpOpt");nt(this,"workShapes",/* @__PURE__ */new Map());nt(this,"workShapeState",/* @__PURE__ */new Map());nt(this,"effectWorkId");nt(this,"drawCount",0);this.thread=r.thread,this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this._post=this.thread.post.bind(r.thread);}return _createClass(qn,[{key:"destroy",value:function destroy(){this.workShapeState.clear(),this.workShapes.clear();}},{key:"getWorkShape",value:function getWorkShape(r){return this.workShapes.get(r);}},{key:"getTmpWorkShapeNode",value:function getTmpWorkShapeNode(){return this.tmpWorkShapeNode;}},{key:"setTmpWorkId",value:function setTmpWorkId(r){if(r&&this.tmpWorkShapeNode){this.tmpWorkShapeNode.setWorkId(r),this.workShapes.set(r,this.tmpWorkShapeNode),this.tmpOpt&&this.setToolsOpt(this.tmpOpt);return;}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var n;this.workShapes.get(r)||this.setTmpWorkId(r),(n=this.workShapes.get(r))==null||n.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t;return Sr(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer}),(t=this.thread)==null?void 0:t.serviceWork);}},{key:"setToolsOpt",value:function setToolsOpt(r){var t,e;((t=this.tmpOpt)==null?void 0:t.toolsType)!==r.toolsType&&(e=this.tmpOpt)!=null&&e.toolsType&&this.clearAllWorkShapesCache(),this.tmpOpt=r,this.tmpWorkShapeNode=this.createWorkShapeNode(r);}},{key:"clearWorkShapeNodeCache",value:function clearWorkShapeNodeCache(r){var t;(t=this.getWorkShape(r))==null||t.clearTmpPoints(),this.workShapes["delete"](r),this.workShapeState["delete"](r);}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.workShapes.forEach(function(r){return r.clearTmpPoints();}),this.workShapes.clear(),this.workShapeState.clear();}},{key:"setFullWork",value:function setFullWork(r){var t=r.workId,e=r.opt,n=r.toolsType;if(t&&e&&n){var i=t&&this.workShapes.get(t)||this.createWorkShapeNode({toolsOpt:e,toolsType:n,workId:t});return i?(i.setWorkId(t),this.workShapes.set(t,i),i):void 0;}}// abstract consumeDraw(data:IWorkerMessage): IMainMessage | undefined;
|
|
455
|
+
// abstract consumeDrawAll(data:IWorkerMessage): IMainMessage | undefined;
|
|
456
|
+
}]);}();var M0=_t,O0=function O0(){return M0.Date.now();},E0=O0,P0=/\s/;function A0(h){for(var r=h.length;r--&&P0.test(h.charAt(r)););return r;}var C0=A0,R0=C0,I0=/^\s+/;function L0(h){return h&&h.slice(0,R0(h)+1).replace(I0,"");}var b0=L0,D0=fe,w0=re,N0="[object Symbol]";function W0(h){return _typeof(h)=="symbol"||w0(h)&&D0(h)==N0;}var B0=W0,F0=b0,sn=ae,j0=B0,on=NaN,U0=/^[-+]0x[0-9a-f]+$/i,$0=/^0b[01]+$/i,z0=/^0o[0-7]+$/i,G0=parseInt;function H0(h){if(typeof h=="number")return h;if(j0(h))return on;if(sn(h)){var r=typeof h.valueOf=="function"?h.valueOf():h;h=sn(r)?r+"":r;}if(typeof h!="string")return h===0?h:+h;h=F0(h);var t=$0.test(h);return t||z0.test(h)?G0(h.slice(2),t?2:8):U0.test(h)?on:+h;}var K0=H0,V0=ae,qe=E0,an=K0,Y0="Expected a function",X0=Math.max,J0=Math.min;function Q0(h,r,t){var e,n,i,a,s,o,f=0,v=!1,l=!1,p=!0;if(typeof h!="function")throw new TypeError(Y0);r=an(r)||0,V0(t)&&(v=!!t.leading,l="maxWait"in t,i=l?X0(an(t.maxWait)||0,r):i,p="trailing"in t?!!t.trailing:p);function y(M){var A=e,I=n;return e=n=void 0,f=M,a=h.apply(I,A),a;}function O(M){return f=M,s=setTimeout(T,r),v?y(M):a;}function x(M){var A=M-o,I=M-f,b=r-A;return l?J0(b,i-I):b;}function m(M){var A=M-o,I=M-f;return o===void 0||A>=r||A<0||l&&I>=i;}function T(){var M=qe();if(m(M))return c(M);s=setTimeout(T,x(M));}function c(M){return s=void 0,p&&e?y(M):(e=n=void 0,a);}function d(){s!==void 0&&clearTimeout(s),f=0,e=o=n=s=void 0;}function u(){return s===void 0?a:c(qe());}function g(){var M=qe(),A=m(M);if(e=arguments,n=this,o=M,A){if(s===void 0)return O(o);if(l)return clearTimeout(s),s=setTimeout(T,r),y(o);}return s===void 0&&(s=setTimeout(T,r)),a;}return g.cancel=d,g.flush=u,g;}var Z0=Q0,k0=Z0,q0=ae,_0="Expected a function";function tg(h,r,t){var e=!0,n=!0;if(typeof h!="function")throw new TypeError(_0);return q0(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),k0(h,r,{leading:e,maxWait:r,trailing:n});}var eg=tg,rg=/* @__PURE__ */ye(eg);var ng=/*#__PURE__*/function(_qn){function ng(t){var _this88;_classCallCheck(this,ng);_this88=_callSuper(this,ng,[t]);nt(_this88,"combineUnitTime",600);nt(_this88,"combineTimerId");nt(_this88,"effectSelectNodeData",/* @__PURE__ */new Set());nt(_this88,"batchEraserWorks",/* @__PURE__ */new Set());nt(_this88,"batchEraserRemoveNodes",/* @__PURE__ */new Set());nt(_this88,"batchEraserCombine",rg(function(){var t=_this88.updateBatchEraserCombineNode(_this88.batchEraserWorks,_this88.batchEraserRemoveNodes);_this88.batchEraserWorks.clear(),_this88.batchEraserRemoveNodes.clear(),t.length&&_this88._post({render:t});},100,{leading:!1}));return _this88;}_inherits(ng,_qn);return _createClass(ng,[{key:"consumeDraw",value:function consumeDraw(t,e){var _this89=this;var n=t.op,i=t.workId;if(n!=null&&n.length&&i){var a=this.workShapes.get(i);if(!a)return;var s=a.toolsType;if(s===ht.LaserPen)return;var o=a.consume({data:t,isFullWork:!0});switch(s){case ht.Selector:o.type===ct.Select&&(o.selectIds&&e.runReverseSelectWork(o.selectIds),this.drawSelector(o));break;case ht.Eraser:o!=null&&o.rect&&this.drawEraser(o);break;case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:o&&(this.drawCount++,this.drawPencil(o));break;case ht.Pencil:this.combineTimerId||(this.combineTimerId=setTimeout(function(){_this89.combineTimerId=void 0,_this89.drawPencilCombine(i);},Math.floor(a.getWorkOptions().syncUnitTime||this.combineUnitTime/2))),o&&(this.drawCount++,this.drawPencil(o));break;}}}},{key:"consumeDrawAll",value:function consumeDrawAll(t,e){var a,s,o;this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0);var n=t.workId,i=t.scenePath;if(n){var f=this.workShapes.get(n);if(!f)return;var v=f.toolsType;if(v===ht.LaserPen)return;var l=this.workShapes.get(or),p=(a=l==null?void 0:l.selectIds)==null?void 0:a[0],y=f.consumeAll({data:t}),O=this.workShapeState.get(n);switch(v){case ht.Selector:y.selectIds&&p&&(s=y.selectIds)!=null&&s.includes(p)&&l.cursorBlur(),y.selectIds&&e.runReverseSelectWork(y.selectIds),this.drawSelector(_objectSpread(_objectSpread({},y),{},{scenePath:i})),(o=f.selectIds)!=null&&o.length?f.clearTmpPoints():this.clearWorkShapeNodeCache(n);break;case ht.Eraser:y!=null&&y.rect&&this.drawEraser(_objectSpread(_objectSpread({},y),{},{scenePath:i})),f.clearTmpPoints();break;case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:this.drawPencilFull(_objectSpread(_objectSpread({},y),{},{scenePath:i}),f.getWorkOptions(),O),this.drawCount=0,this.clearWorkShapeNodeCache(n);break;case ht.Pencil:y!=null&&y.rect&&(this.drawPencilFull(_objectSpread(_objectSpread({},y),{},{scenePath:i}),f.getWorkOptions(),O),this.drawCount=0),this.clearWorkShapeNodeCache(n);break;}}}},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(t,e){var a,s,n,i,o,f,v,l,p,y,O;return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:n=this.setFullWork(t),i=t.ops&&Ie(t.ops);if(!n){_context30.next=23;break;}o=(a=t.workId)==null?void 0:a.toString();if(o){_context30.next=5;break;}return _context30.abrupt("return");case 5:f=(s=this.vNodes.get(o))==null?void 0:s.rect;if(!(n.toolsType===ht.Image&&e)){_context30.next=13;break;}_context30.next=9;return n.consumeServiceAsync({scene:e,isFullWork:!0,replaceId:o});case 9:v=_context30.sent;l=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);_context30.next=20;break;case 13:if(!(n.toolsType===ht.Text)){_context30.next=19;break;}_context30.next=16;return n.consumeServiceAsync({isFullWork:!0,replaceId:o});case 16:v=_context30.sent;_context30.next=20;break;case 19:v=n.consumeService({op:i,isFullWork:!0,replaceId:o}),l=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);case 20:v=Ot(v,l);p=[],y=[];if(t.workId&&this.workShapes["delete"](t.workId),n.toolsType===ht.Text&&console.log("text-render",n.getWorkOptions(),v,t.willRefresh,this.fullLayer.children),v&&t.willRefresh&&(f&&p.push({rect:v,isClear:!0,clearCanvas:Mt.Bg,viewId:this.viewId}),p.push({rect:v,drawCanvas:Mt.Bg,viewId:this.viewId})),t.willSyncService&&y.push({opt:t.opt,toolsType:t.toolsType,type:ct.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),p.length||y.length){O={render:p,sp:y};this._post(O);}case 23:case"end":return _context30.stop();}},_callee28,this);}));function consumeFull(_x39,_x40){return _consumeFull.apply(this,arguments);}return consumeFull;}()},{key:"removeWork",value:function removeWork(t){var e=t.workId,n=e==null?void 0:e.toString();if(n){var i=this.removeNode(n);i&&this._post({render:[{rect:Bt(i),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(i),drawCanvas:Mt.Bg,viewId:this.viewId}]});}}},{key:"removeNode",value:function removeNode(t){var i;this.workShapes.has(t)&&this.clearWorkShapeNodeCache(t);var e;var n=this.vNodes.get(t);return n&&(this.fullLayer.getElementsByName(t).concat(((i=this.drawLayer)==null?void 0:i.getElementsByName(t))||[]).forEach(function(a){a.remove();}),e=Ot(e,n.rect),this.vNodes["delete"](t)),e;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(t){var e,n,i,a,_iterator36,_step36,s,o,f,v,l,p,y;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:e=t.op,n=t.viewId,i=t.dataType;if(!(e!=null&&e.length)){_context31.next=26;break;}_iterator36=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context31.prev=3;_iterator36.s();case 5:if((_step36=_iterator36.n()).done){_context31.next=13;break;}s=_step36.value;o=s.rect,f=s.name,v=s.toolsType,l=s.opt,p=e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y=e[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];if(!(v===ht.Text&&Bh([p,y],o)&&l.workState===Rt.Done)){_context31.next=11;break;}a=f;return _context31.abrupt("break",13);case 11:_context31.next=5;break;case 13:_context31.next=18;break;case 15:_context31.prev=15;_context31.t0=_context31["catch"](3);_iterator36.e(_context31.t0);case 18:_context31.prev=18;_iterator36.f();return _context31.finish(18);case 21:_context31.t1=a;if(!_context31.t1){_context31.next=26;break;}_context31.next=25;return this.blurSelector({viewId:n,msgType:ct.Select,dataType:i,isSync:!0});case 25:this._post({sp:[{type:ct.GetTextActive,toolsType:ht.Text,workId:a}]});case 26:case"end":return _context31.stop();}},_callee29,this,[[3,15,18,21]]);}));function checkTextActive(_x41){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(t){var _this90=this;var e,n,i;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:e=this.workShapes.get(wt.selectorId),n=t.workId,i=t.msgType;if(!(e&&n&&e.selectIds&&e.selectIds.includes(n.toString()))){_context32.next=8;break;}i===ct.RemoveNode?e.selectIds=e.selectIds.filter(function(a){return a!==n.toString();}):this.effectSelectNodeData.add(t);_context32.next=5;return new Promise(function(a){setTimeout(function(){a(!0);},0);});case 5:_context32.next=7;return this.runEffectSelectWork(!0).then(function(){var a;(a=_this90.effectSelectNodeData)==null||a.clear();});case 7:return _context32.abrupt("return");case 8:return _context32.abrupt("return",t);case 9:case"end":return _context32.stop();}},_callee30,this);}));function colloctEffectSelectWork(_x42){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(t){var _this91=this;var O,e,n,i,a,s,o,f,v,l,p,y;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:e=this.workShapes.get(wt.selectorId);if((O=e==null?void 0:e.selectIds)!=null&&O.length){_context33.next=3;break;}return _context33.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);a=i.updateSelectorOpt;s=i.willSerializeData;o=i.scene;_context33.next=10;return e==null?void 0:e.updateSelector({updateSelectorOpt:a,selectIds:e.selectIds,vNodes:this.vNodes,willSerializeData:s,worker:this,scene:o});case 10:f=_context33.sent;v=/* @__PURE__ */new Map();e.selectIds.forEach(function(x){var m=_this91.vNodes.get(x);if(m){var _T45=m.toolsType,_c36=m.op,d=m.opt;v.set(x,{opt:d,toolsType:_T45,ops:(_c36==null?void 0:_c36.length)&&qt(_c36)||void 0});}});l=[],p=[];f!=null&&f.rect&&l.push({rect:Bt(f.rect),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(f.rect),drawCanvas:Mt.Bg,viewId:this.viewId});y=n&&n({res:f,workShapeNode:e,param:i,postData:{render:l,sp:p},newServiceStore:v})||{render:l,sp:p};(y.render.length||y.sp.length)&&this._post(y);case 17:case"end":return _context33.stop();}},_callee31,this);}));function updateSelector(_x43){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(t){var i,e,n,a;return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:e=this.workShapes.get(wt.selectorId),n=e==null?void 0:e.blurSelector();if(this.clearWorkShapeNodeCache(wt.selectorId),((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(a){a.name===wt.selectorId&&a.remove();}),n){a=[];a.push(_objectSpread(_objectSpread({},n),{},{isSync:t==null?void 0:t.isSync})),this._post({render:(n==null?void 0:n.rect)&&[{rect:Bt(n.rect),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(n.rect),drawCanvas:Mt.Bg,viewId:this.viewId}],sp:a});}case 2:case"end":return _context34.stop();}},_callee32,this);}));function blurSelector(_x44){return _blurSelector.apply(this,arguments);}return blurSelector;}()},{key:"reRenderSelector",value:function reRenderSelector(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var a;var e=this.workShapes.get(wt.selectorId);if(!e)return;if(e&&!((a=e.selectIds)!=null&&a.length))return this.blurSelector();var n=e.oldSelectRect,i=e.reRenderSelector();if(i){var s=Ot(n,i)||i;this._post({render:[{rect:Bt(s),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(s),drawCanvas:Mt.Bg,viewId:this.viewId}],sp:[{type:ct.Select,selectIds:e.selectIds,selectRect:i,willSyncService:t,viewId:this.viewId,points:e.getChildrenPoints(),textOpt:e.textOpt,selectorColor:e.selectorColor,strokeColor:e.strokeColor,fillColor:e.fillColor,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,opt:e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt}]});}}},{key:"updateFullSelectWork",value:function updateFullSelectWork(t){var i,a,s,o,f,v,l;var e=this.workShapes.get(wt.selectorId),n=t.selectIds;if(!(n!=null&&n.length)){this.blurSelector(t);return;}if(!e){!this.setFullWork(t)&&t.workId&&((i=this.tmpWorkShapeNode)==null?void 0:i.toolsType)===ht.Selector&&this.setTmpWorkId(t.workId),this.updateFullSelectWork(t);return;}if(e&&n!=null&&n.length){var _e$updateSelectIds=e.updateSelectIds(n),p=_e$updateSelectIds.bgRect,y=_e$updateSelectIds.selectRect,O={render:[],sp:[]};p&&((a=O.render)==null||a.push({rect:Bt(p),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(p),drawCanvas:Mt.Bg,viewId:this.viewId})),(l=O.sp)==null||l.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((s=t.opt)==null?void 0:s.strokeColor)||e.selectorColor,strokeColor:((o=t.opt)==null?void 0:o.strokeColor)||e.strokeColor,fillColor:((f=t.opt)==null?void 0:f.fillColor)||e.fillColor,textOpt:((v=t.opt)==null?void 0:v.textOpt)||e.textOpt,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,type:ct.Select,selectRect:y,points:e.getChildrenPoints(),willSyncService:(t==null?void 0:t.willSyncService)||!1,opt:(t==null?void 0:t.willSyncService)&&e.getWorkOptions()||void 0,canLock:e.canLock,isLocked:e.isLocked,toolsTypes:e.toolsTypes,shapeOpt:e.shapeOpt})),this._post(O);}}},{key:"destroy",value:function destroy(){_get(_getPrototypeOf(ng.prototype),"destroy",this).call(this),this.effectSelectNodeData.clear(),this.batchEraserWorks.clear(),this.batchEraserRemoveNodes.clear();}},{key:"drawPencilCombine",value:function drawPencilCombine(t){var n,i,a;var e=(n=this.workShapes.get(t))==null?void 0:n.combineConsume();if(e){var s={render:[],drawCount:this.drawCount};if(e!=null&&e.rect){var o=Bt(e.rect);(i=s.render)==null||i.push({rect:o,isClear:!0,clearCanvas:Mt.Float,viewId:this.viewId}),(a=s.render)==null||a.push({rect:o,drawCanvas:Mt.Float,viewId:this.viewId});}this._post(s);}}},{key:"drawSelector",value:function drawSelector(t){var n;var e={render:[],sp:[t]};t.rect&&((n=e.render)==null||n.push({rect:Bt(t.rect),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(t.rect),drawCanvas:Mt.Bg,viewId:this.viewId})),this._post(e);}},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(t){var _this92=this;var n,i,e,_iterator37,_step37,a,s;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:e=[];if((n=t.newWorkDatas)!=null&&n.size){_iterator37=_createForOfIteratorHelper(t.newWorkDatas.values());try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){a=_step37.value;s=a.workId.toString();this.batchEraserWorks.add(s),e.push({type:ct.FullWork,workId:s,ops:qt(a.op),opt:a.opt,toolsType:a.toolsType,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}delete t.newWorkDatas;}(i=t.removeIds)==null||i.forEach(function(a){_this92.batchEraserRemoveNodes.add(a);}),e.push(t),this._post({sp:e}),this.batchEraserCombine();case 3:case"end":return _context35.stop();}},_callee33,this);}));function drawEraser(_x45){return _drawEraser.apply(this,arguments);}return drawEraser;}()},{key:"drawPencil",value:function drawPencil(t){this._post({drawCount:this.drawCount,sp:(t==null?void 0:t.op)&&[t]});}},{key:"drawPencilFull",value:function drawPencilFull(t,e,n){var s;var i=(n==null?void 0:n.willClear)||(e==null?void 0:e.isOpacity)||!1;!i&&t.rect&&(i=this.vNodes.hasRectIntersectRange(t.rect));var a={drawCount:1/0,render:[],sp:[t]};(s=a.render)==null||s.push({isClearAll:!0,clearCanvas:Mt.Float,viewId:this.viewId},{rect:t.rect,isClear:i,clearCanvas:Mt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:Mt.Bg,viewId:this.viewId}),this._post(a);}},{key:"updateBatchEraserCombineNode",value:function updateBatchEraserCombineNode(t,e){var _this93=this;var n=[];var i;var _iterator38=_createForOfIteratorHelper(e.keys()),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var a=_step38.value;this.fullLayer.getElementsByName(a).forEach(function(s){var o=s.getBoundingClientRect();i=Ot(i,{x:o.x-ie.SafeBorderPadding,y:o.y-ie.SafeBorderPadding,w:o.width+ie.SafeBorderPadding*2,h:o.height+ie.SafeBorderPadding*2}),s.remove();});}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return t.forEach(function(a){var s=_this93.vNodes.get(a);if(s)if(_this93.fullLayer.getElementsByName(a)[0])i=Ot(i,s.rect);else{var f=_this93.setFullWork(_objectSpread(_objectSpread({},s),{},{workId:a})),v=f&&f.consumeService({op:s.op,isFullWork:!0});v&&(s.rect=v,i=Ot(i,v));}}),i&&n.push({rect:i,isClear:!0,clearCanvas:Mt.Bg,viewId:this.viewId},{rect:i,drawCanvas:Mt.Bg,viewId:this.viewId}),n;}},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(t){var e,n,i,_iterator39,_step39,a,s,o,f;return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:_iterator39=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context36.prev=1;_iterator39.s();case 3:if((_step39=_iterator39.n()).done){_context36.next=23;break;}a=_step39.value;s=this.setFullWork(a);if(!s){_context36.next=21;break;}o=(e=s.getWorkId())==null?void 0:e.toString();if(!(s.toolsType===ht.Image)){_context36.next=13;break;}_context36.next=11;return s.consumeServiceAsync({scene:(i=(n=this.drawLayer)==null?void 0:n.parent)==null?void 0:i.parent,isFullWork:!0,replaceId:o});case 11:_context36.next=20;break;case 13:if(!(s.toolsType===ht.Text)){_context36.next=18;break;}_context36.next=16;return s.consumeServiceAsync({isFullWork:!0,replaceId:o});case 16:_context36.next=20;break;case 18:f=a.ops&&Ie(a.ops);s.consumeService({op:f,isFullWork:!0,replaceId:o}),a!=null&&a.updateNodeOpt&&s.updataOptService(a.updateNodeOpt);case 20:a.workId&&this.workShapes["delete"](a.workId);case 21:_context36.next=3;break;case 23:_context36.next=28;break;case 25:_context36.prev=25;_context36.t0=_context36["catch"](1);_iterator39.e(_context36.t0);case 28:_context36.prev=28;_iterator39.f();return _context36.finish(28);case 31:this.reRenderSelector(t);case 32:case"end":return _context36.stop();}},_callee34,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x46){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function cursorHover(t){var s;var e=t.opt,n=t.toolsType,i=t.point,a=this.setFullWork({workId:or,toolsType:n,opt:e});if(a&&i){var o=a.cursorHover(i),f={render:[]};o&&o.type===ct.CursorHover&&o.rect&&((s=f.render)==null||s.push({rect:Bt(o.rect),clearCanvas:Mt.Bg,isClear:!0,viewId:this.viewId},{rect:Bt(o.rect),drawCanvas:Mt.Bg,viewId:this.viewId}),this._post(f));}}}]);}(qn);var ig=/*#__PURE__*/function(){function ig(r){_classCallCheck(this,ig);nt(this,"viewId");nt(this,"vNodes");nt(this,"fullLayer");nt(this,"drawLayer");nt(this,"workShapes",/* @__PURE__ */new Map());nt(this,"selectorWorkShapes",/* @__PURE__ */new Map());nt(this,"animationId");nt(this,"willRunEffectSelectorIds",/* @__PURE__ */new Set());nt(this,"runEffectId");nt(this,"noAnimationRect");nt(this,"post");this.viewId=r.viewId,this.vNodes=r.vNodes,this.fullLayer=r.fullLayer,this.drawLayer=r.drawLayer,this.post=r.thread.post.bind(r.thread);}return _createClass(ig,[{key:"destroy",value:function destroy(){this.workShapes.clear(),this.selectorWorkShapes.clear(),this.willRunEffectSelectorIds.clear();}},{key:"consumeDraw",value:function consumeDraw(r){this.activeWorkShape(r),this.runAnimation();}},{key:"consumeFull",value:function consumeFull(r){this.activeWorkShape(r),this.runAnimation();}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){var _this94=this;this.workShapes.forEach(function(r,t){r.toolsType===ht.LaserPen?setTimeout(function(){_this94.workShapes["delete"](t);},2e3):_this94.workShapes["delete"](t);});}},{key:"runSelectWork",value:function runSelectWork(r){this.activeSelectorShape(r);var t=r.workId,e=t==null?void 0:t.toString();e&&this.willRunEffectSelectorIds.add(e),this.runEffect();}},{key:"setNodeKey",value:function setNodeKey(r,t,e){return r.toolsType=t,r.node=Sr({toolsType:t,toolsOpt:e,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),r;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(r){var _this95=this;r.forEach(function(t){_this95.selectorWorkShapes.forEach(function(e,n){var i;if((i=e.selectIds)!=null&&i.length){var a=e.selectIds.indexOf(t);a>-1&&(e.selectIds.splice(a,1),_this95.willRunEffectSelectorIds.add(n));}});}),this.willRunEffectSelectorIds.size&&this.runEffect();}},{key:"removeWork",value:function removeWork(r){var t=r.workId,e=t==null?void 0:t.toString();if(e){var n=this.workShapes.get(e);if(n){this.workShapes["delete"](e),this.removeNode(e,r,n==null?void 0:n.totalRect,!1);return;}this.removeNode(e,r);}}},{key:"removeSelectWork",value:function removeSelectWork(r){var t=r.workId,e=t==null?void 0:t.toString();e&&(this.activeSelectorShape(r),this.willRunEffectSelectorIds.add(e)),this.runEffect();}},{key:"removeNode",value:function removeNode(r,t,e){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;var s;r.indexOf(wt.selectorId)>-1&&this.removeSelectWork(t);var i=e;var a=(s=this.vNodes.get(r))==null?void 0:s.rect;a&&(i=Ot(a,i)),this.fullLayer.getElementsByName(r).forEach(function(o){o.remove();}),this.drawLayer.getElementsByName(r).forEach(function(o){o.remove();}),this.vNodes["delete"](r),i&&this.post({render:[{rect:Bt(i),isClear:!0,clearCanvas:n?Mt.Bg:Mt.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId},{rect:Bt(i),drawCanvas:n?Mt.Bg:Mt.ServiceFloat,workerType:n?void 0:Tt.Service,viewId:this.viewId}]});}},{key:"activeWorkShape",value:function activeWorkShape(r){var y,O,x,m;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,s=r.ops,o=r.op,f=r.useAnimation;if(!t)return;var v=t.toString(),l=(y=this.vNodes.get(v))==null?void 0:y.rect;if(!((O=this.workShapes)!=null&&O.has(v))){var _T46={toolsType:n,animationWorkData:o||[],animationIndex:0,type:i,updateNodeOpt:a,ops:s,useAnimation:_typeof(f)<"u"?f:_typeof(a==null?void 0:a.useAnimation)<"u"?a==null?void 0:a.useAnimation:!0,oldRect:l,isDiff:!1};n&&e&&(_T46=this.setNodeKey(_T46,n,e)),(x=this.workShapes)==null||x.set(v,_T46);}var p=(m=this.workShapes)==null?void 0:m.get(v);i&&(p.type=i),s&&(p.animationWorkData=Ie(s),p.ops=s),a&&(p.updateNodeOpt=a),o&&(p.isDiff=this.hasDiffData(p.animationWorkData||[],o,p.toolsType),p.animationWorkData=o),p.node&&p.node.getWorkId()!==v&&p.node.setWorkId(v),l&&(p.oldRect=l),n&&e&&(p.toolsType!==n&&n&&e&&this.setNodeKey(p,n,e),p.node&&p.node.setWorkOptions(e));}},{key:"hasDiffData",value:function hasDiffData(r,t,e){var n=r.length;if(t.length<n)return!0;switch(e){case ht.Pencil:{for(var i=0;i<n;i+=3)if(t[i]!==r[i]||t[i+1]!==r[i+1])return!0;break;}case ht.LaserPen:{for(var _i2=0;_i2<n;_i2+=2)if(t[_i2]!==r[_i2]||t[_i2+1]!==r[_i2+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(){var _this96=this;var n,i,a,s,o,f,v,l,p,y,O,x,m,T,c,d,u,g,M,A,I,b,E,L,D,R,C,W,r,t,e,_iterator40,_step40,_loop7;return _regeneratorRuntime().wrap(function _callee35$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:this.animationId=void 0;r=!1;t={render:[]},e=/* @__PURE__ */new Map();_iterator40=_createForOfIteratorHelper(this.workShapes.entries());_context38.prev=4;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var _step40$value,z,H,X,Z,_X3,_Z,_X4,_Z2,j,G,_X5,_Z3,_X6,_Z4,_j4,_G3,Q,tt,et,_tt3;return _regeneratorRuntime().wrap(function _loop7$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:_step40$value=_slicedToArray(_step40.value,2),z=_step40$value[0],H=_step40$value[1];_context37.t0=H.toolsType;_context37.next=_context37.t0===ht.Image?4:_context37.t0===ht.Text?11:_context37.t0===ht.Arrow?18:_context37.t0===ht.Straight?18:_context37.t0===ht.Rectangle?18:_context37.t0===ht.Ellipse?18:_context37.t0===ht.Star?18:_context37.t0===ht.Polygon?18:_context37.t0===ht.SpeechBalloon?18:_context37.t0===ht.Pencil?21:36;break;case 4:X=H.oldRect;X&&((n=t.render)==null||n.push({rect:X,isClear:!0,clearCanvas:Mt.Bg,viewId:_this96.viewId}));_context37.next=8;return(a=H.node)==null?void 0:a.consumeServiceAsync({isFullWork:!0,scene:(i=_this96.fullLayer.parent)==null?void 0:i.parent});case 8:Z=_context37.sent;_this96.selectorWorkShapes.forEach(function(j,G){var Q;(Q=j.selectIds)!=null&&Q.includes(z)&&(_this96.willRunEffectSelectorIds.add(G),_this96.noAnimationRect=Ot(_this96.noAnimationRect,X),_this96.noAnimationRect=Ot(_this96.noAnimationRect,Z),_this96.runEffect());}),_this96.workShapes["delete"](z),(s=t.render)==null||s.push({rect:Z,drawCanvas:Mt.Bg,viewId:_this96.viewId});return _context37.abrupt("break",36);case 11:if(!H.node){_context37.next=17;break;}_X3=H.oldRect;_context37.next=15;return H.node.consumeServiceAsync({isFullWork:!0,replaceId:z});case 15:_Z=_context37.sent;_this96.selectorWorkShapes.forEach(function(j,G){var Q;(Q=j.selectIds)!=null&&Q.includes(z)&&(_this96.willRunEffectSelectorIds.add(G),_this96.noAnimationRect=Ot(_this96.noAnimationRect,_X3),_this96.noAnimationRect=Ot(_this96.noAnimationRect,_Z),_this96.runEffect());}),(o=H.node)==null||o.clearTmpPoints(),_this96.workShapes["delete"](z),(f=t.render)==null||f.push({rect:_Z,drawCanvas:Mt.Bg,viewId:_this96.viewId});case 17:return _context37.abrupt("break",36);case 18:_X4=!!H.ops;if((v=H.animationWorkData)!=null&&v.length){_Z2=H.oldRect,j=H.node.oldRect;_Z2&&((l=t.render)==null||l.push({rect:_Z2,isClear:!0,clearCanvas:Mt.Bg,viewId:_this96.viewId}),(p=t.render)==null||p.push({rect:_Z2,drawCanvas:Mt.Bg,viewId:_this96.viewId})),j&&((y=t.render)==null||y.push({rect:j,isClear:!0,clearCanvas:Mt.ServiceFloat,viewId:_this96.viewId}));G=(O=H.node)==null?void 0:O.consumeService({op:H.animationWorkData,isFullWork:_X4});e.set(z,{workState:_Z2?H.ops?Rt.Done:Rt.Doing:Rt.Start,op:H.animationWorkData.filter(function(Q,tt){if(tt%3!==2)return!0;}).slice(-2)}),_X4?(_this96.selectorWorkShapes.forEach(function(Q,tt){var et;(et=Q.selectIds)!=null&&et.includes(z)&&(_this96.willRunEffectSelectorIds.add(tt),_this96.noAnimationRect=Ot(_this96.noAnimationRect,_Z2),_this96.noAnimationRect=Ot(_this96.noAnimationRect,j),_this96.noAnimationRect=Ot(_this96.noAnimationRect,G),_this96.runEffect());}),(x=H.node)==null||x.clearTmpPoints(),_this96.workShapes["delete"](z),(m=t.render)==null||m.push({rect:G,drawCanvas:Mt.Bg,viewId:_this96.viewId})):(T=t.render)==null||T.push({rect:G,drawCanvas:Mt.ServiceFloat,workerType:_X4?void 0:Tt.Service,viewId:_this96.viewId}),H.animationWorkData.length=0;}return _context37.abrupt("break",36);case 21:if(!(!H.useAnimation&&H.ops)){_context37.next=27;break;}_X5=(c=H.node)==null?void 0:c.consumeService({op:H.animationWorkData||[],isFullWork:!0,replaceId:z});_Z3=(d=H.node)==null?void 0:d.updataOptService(H.updateNodeOpt);_X5=Ot(_X5,_Z3),(u=t.render)==null||u.push({isClear:!0,rect:Ot(H.oldRect,_X5),clearCanvas:Mt.Bg,viewId:_this96.viewId}),(g=t.render)==null||g.push({rect:Ot(H.oldRect,_X5),drawCanvas:Mt.Bg,viewId:_this96.viewId}),_this96.selectorWorkShapes.forEach(function(j,G){var Q;(Q=j.selectIds)!=null&&Q.includes(z)&&(_this96.willRunEffectSelectorIds.add(G),_this96.noAnimationRect=Ot(_this96.noAnimationRect,_X5),_this96.runEffect());}),(M=H.node)==null||M.clearTmpPoints(),_this96.workShapes["delete"](z);_context37.next=35;break;case 27:if(!H.useAnimation){_context37.next=35;break;}if(!H.isDel){_context37.next=31;break;}(A=H.node)==null||A.clearTmpPoints(),_this96.workShapes["delete"](z);return _context37.abrupt("break",36);case 31:_X6=3,_Z4=_this96.computNextAnimationIndex(H,_X6),_j4=H.isDiff?0:Math.max(0,(H.animationIndex||0)-_X6),_G3=(H.animationWorkData||[]).slice(_j4,_Z4),Q=(b=(I=H.node)==null?void 0:I.getWorkId())==null?void 0:b.toString();if((H.animationIndex||0)<_Z4||H.isDiff){tt=(E=H.node)==null?void 0:E.consumeService({op:_G3,isFullWork:!1// replaceId: workId
|
|
457
|
+
});if((L=t.render)==null||L.push({rect:tt,drawCanvas:Mt.ServiceFloat,viewId:_this96.viewId}),H.animationIndex=_Z4,H.isDiff&&(H.isDiff=!1),_G3.length){et=_G3.filter(function(at,q){if(q%_X6!==_X6-1)return!0;}).slice(-2);e.set(z,{workState:_j4===0?Rt.Start:_Z4===((D=H.animationWorkData)==null?void 0:D.length)?Rt.Done:Rt.Doing,op:et});}}else if(H.ops){_tt3=(R=H.node)==null?void 0:R.consumeService({op:H.animationWorkData||[],isFullWork:!0,replaceId:Q});H.isDel=!0,(C=t.render)==null||C.push({isClear:!0,rect:_tt3,clearCanvas:Mt.ServiceFloat,viewId:_this96.viewId},{rect:_tt3,drawCanvas:Mt.ServiceFloat,viewId:_this96.viewId},{isClear:!0,rect:_tt3,clearCanvas:Mt.Bg,viewId:_this96.viewId},{rect:_tt3,drawCanvas:Mt.Bg,viewId:_this96.viewId}),e.set(z,{workState:Rt.Done,op:_G3.filter(function(et,at){if(at%_X6!==_X6-1)return!0;}).slice(-2)});}r=!0;return _context37.abrupt("break",36);case 35:return _context37.abrupt("break",36);case 36:case"end":return _context37.stop();}},_loop7);});_iterator40.s();case 7:if((_step40=_iterator40.n()).done){_context38.next=11;break;}return _context38.delegateYield(_loop7(),"t0",9);case 9:_context38.next=7;break;case 11:_context38.next=16;break;case 13:_context38.prev=13;_context38.t1=_context38["catch"](4);_iterator40.e(_context38.t1);case 16:_context38.prev=16;_iterator40.f();return _context38.finish(16);case 19:r&&this.runAnimation(),e.size&&(t.sp=[],e.forEach(function(z,H){var X;(X=t.sp)==null||X.push({type:ct.Cursor,uid:H.split(yr)[0],op:z.op,workState:z.workState,viewId:_this96.viewId});})),(W=t.render)!=null&&W.length&&this.post(t);case 20:case"end":return _context38.stop();}},_callee35,this,[[4,13,16,19]]);}));function animationDraw(){return _animationDraw.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var n;var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/(((n=r.node)==null?void 0:n.syncUnitTime)||1e3))*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length);}},{key:"runEffect",value:function runEffect(){this.runEffectId||(this.runEffectId=setTimeout(this.effectRunSelector.bind(this),0));}},{key:"effectRunSelector",value:function effectRunSelector(){var _this97=this;this.runEffectId=void 0;var r=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var i,a;var e=_this97.selectorWorkShapes.get(t),n=e&&e.selectIds&&((i=e.node)==null?void 0:i.selectServiceNode(t,e,!0));r=Ot(r,n),(a=e==null?void 0:e.selectIds)!=null&&a.length||_this97.selectorWorkShapes["delete"](t);}),r&&this.post({render:[{rect:Bt(r),isClear:!0,clearCanvas:Mt.Bg,viewId:this.viewId},{rect:Bt(r),drawCanvas:Mt.Bg,viewId:this.viewId}]}),this.willRunEffectSelectorIds.clear(),this.noAnimationRect=void 0;}},{key:"activeSelectorShape",value:function activeSelectorShape(r){var f,v,l;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.selectIds;if(!t)return;var s=t.toString();if(!((f=this.selectorWorkShapes)!=null&&f.has(s))){var p={toolsType:n,selectIds:a,type:i,opt:e};n&&e&&(p=this.setNodeKey(p,n,e)),(v=this.selectorWorkShapes)==null||v.set(s,p);}var o=(l=this.selectorWorkShapes)==null?void 0:l.get(s);i&&(o.type=i),o.node&&o.node.getWorkId()!==s&&o.node.setWorkId(s),o.selectIds=a||[];}}]);}();var sg=/*#__PURE__*/function(_qn2){function sg(t){var _this98;_classCallCheck(this,sg);_this98=_callSuper(this,sg,[t]);nt(_this98,"combineDrawTimer");return _this98;}_inherits(sg,_qn2);return _createClass(sg,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t){var i,a,e,n,s,o,f;return _regeneratorRuntime().wrap(function _callee36$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:e=this.setFullWork(t),n=t.ops&&Ie(t.ops);if(!e){_context39.next=18;break;}f=(i=e.getWorkId())==null?void 0:i.toString();if(!(e.toolsType===ht.Image)){_context39.next=9;break;}_context39.next=6;return e.consumeServiceAsync({isFullWork:!0,scene:(a=this.fullLayer.parent)==null?void 0:a.parent});case 6:s=_context39.sent;_context39.next=16;break;case 9:if(!(e.toolsType===ht.Text)){_context39.next=15;break;}_context39.next=12;return e.consumeServiceAsync({isFullWork:!0,replaceId:f,isDrawLabel:!0});case 12:s=_context39.sent;_context39.next=16;break;case 15:s=e.consumeService({op:n,isFullWork:!0,replaceId:f}),o=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId);return _context39.abrupt("return",Ot(s,o));case 18:case"end":return _context39.stop();}},_callee36,this);}));function runFullWork(_x47){return _runFullWork.apply(this,arguments);}return runFullWork;}()},{key:"runSelectWork",value:function runSelectWork(t){var n;var e=this.setFullWork(t);e&&(n=t.selectIds)!=null&&n.length&&t.workId&&e.selectServiceNode(t.workId.toString(),{selectIds:t.selectIds},!1);}},{key:"consumeDraw",value:function consumeDraw(t){var e=t.workId,n=this.workShapes.get(e);if(!n)return;var i=n.toolsType,a=n.consume({data:t,drawCount:this.drawCount,isFullWork:!0,isSubWorker:!0});switch(i){case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:{a&&(this.drawCount++,this.drawArrow(a));break;}case ht.Pencil:{a&&(this.drawCount++,this.drawPencil(a,e==null?void 0:e.toString()));break;}}}},{key:"consumeDrawAll",value:function consumeDrawAll(t){var e=t.workId;if(e){var n=this.workShapes.get(e);if(!n)return;switch(n.toolsType){case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Pencil:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:this.drawCount=0,this.fullLayer.removeAllChildren(),this.clearWorkShapeNodeCache(e);break;}}}},{key:"updateLabels",value:function updateLabels(t,e){t.children.forEach(function(n){if(n.tagName==="LABEL"){var i=n.name,_n$getBoundingClientR=n.getBoundingClientRect(),a=_n$getBoundingClientR.width,_t$worldScaling2=_slicedToArray(t.worldScaling,1),s=_t$worldScaling2[0],_e$opt=e.opt,o=_e$opt.underline,f=_e$opt.lineThrough;o&&t.getElementsByName("".concat(i,"_underline"))[0].attr({points:[0,0,a/s,0]}),f&&t.getElementsByName("".concat(i,"_lineThrough"))[0].attr({points:[0,0,a/s,0]});}});}},{key:"drawPencil",value:function drawPencil(t,e){this._post({drawCount:this.drawCount,render:[{rect:t==null?void 0:t.rect,workId:e,drawCanvas:Mt.Float,viewId:this.viewId}],sp:(t==null?void 0:t.op)&&[t]});}},{key:"drawArrow",value:function drawArrow(t){this._post({drawCount:this.drawCount,render:[{rect:(t==null?void 0:t.rect)&&Bt(t.rect),isClear:!0,clearCanvas:Mt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&Bt(t.rect),drawCanvas:Mt.Float,viewId:this.viewId}]});}}]);}(qn);var og=/*#__PURE__*/function(){function og(r){_classCallCheck(this,og);nt(this,"viewId");nt(this,"vNodes");nt(this,"topLayer");nt(this,"post");nt(this,"serviceWorkShapes",/* @__PURE__ */new Map());nt(this,"localWorkShapes",/* @__PURE__ */new Map());nt(this,"tmpOpt");nt(this,"tmpWorkShapeNode");nt(this,"animationId");this.viewId=r.viewId,this.vNodes=r.vNodes,this.topLayer=r.topLayer,this.post=r.thread.post.bind(r.thread);}return _createClass(og,[{key:"getWorkShape",value:function getWorkShape(r){return this.localWorkShapes.get(r);}},{key:"getTmpWorkShapeNode",value:function getTmpWorkShapeNode(){return this.tmpWorkShapeNode;}},{key:"setTmpWorkId",value:function setTmpWorkId(r){if(r&&this.tmpWorkShapeNode){this.tmpWorkShapeNode.setWorkId(r),this.localWorkShapes.set(r,{node:this.tmpWorkShapeNode,toolsType:this.tmpWorkShapeNode.toolsType,workState:Rt.Start}),this.tmpOpt&&this.setToolsOpt(this.tmpOpt);return;}}},{key:"setWorkOptions",value:function setWorkOptions(r,t){var n,i,a;((n=this.localWorkShapes.get(r))==null?void 0:n.node)||this.setTmpWorkId(r),(a=(i=this.localWorkShapes.get(r))==null?void 0:i.node)==null||a.setWorkOptions(t);}},{key:"createWorkShapeNode",value:function createWorkShapeNode(r){var t=r.toolsType;if(t===ht.LaserPen)return Sr(_objectSpread(_objectSpread({},r),{},{vNodes:this.vNodes,fullLayer:this.topLayer,drawLayer:this.topLayer}));}},{key:"clearAllWorkShapesCache",value:function clearAllWorkShapesCache(){this.localWorkShapes.forEach(function(r){var t;return(t=r.node)==null?void 0:t.clearTmpPoints();}),this.localWorkShapes.clear();}},{key:"setToolsOpt",value:function setToolsOpt(r){this.tmpOpt=r,this.tmpWorkShapeNode=this.createWorkShapeNode(r);}},{key:"consumeDraw",value:function consumeDraw(r){var t=r.workId,e=r.dataType;if(e===Tt.Service)this.activeServiceWorkShape(r);else{var n=this.localWorkShapes.get(t);if(!n)return;var i=n.node.consume({data:r,isFullWork:!1,isSubWorker:!0});i.rect&&(n.totalRect=Ot(i.rect,n.totalRect),n.result=i,n.workState=Rt.Doing,t&&this.localWorkShapes.set(t,n));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(r){var t=r.workId,e=r.dataType;if(e===Tt.Service)this.activeServiceWorkShape(r);else{var n=this.localWorkShapes.get(t);if(!n)return;var i=n.node.consumeAll({data:r});n.totalRect=Ot(i.rect,n.totalRect),n.result=i,n.workState=Rt.Done,t&&this.localWorkShapes.set(t,n);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(r,t,e){return r.toolsType=t,r.node=this.createWorkShapeNode({toolsType:t,toolsOpt:e}),r;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(r){var p,y;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,s=r.ops,o=r.op;if(!t)return;var f=t.toString(),v=(p=this.vNodes.get(f))==null?void 0:p.rect;if(!((y=this.serviceWorkShapes)!=null&&y.has(f))){var O={toolsType:n,animationWorkData:o||[],animationIndex:0,type:i,updateNodeOpt:a,ops:s,oldRect:v};n&&e&&(O=this.setNodeKey(O,n,e)),this.serviceWorkShapes.set(f,O);}var l=this.serviceWorkShapes.get(f);i&&(l.type=i),s&&(l.animationWorkData=Ie(s),l.ops=s),a&&(l.updateNodeOpt=a),o&&(l.animationWorkData=o),l.node&&l.node.getWorkId()!==f&&l.node.setWorkId(f),v&&(l.oldRect=v),n&&e&&(l.toolsType!==n&&n&&e&&this.setNodeKey(l,n,e),l.node&&l.node.setWorkOptions(e));}},{key:"computNextAnimationIndex",value:function computNextAnimationIndex(r,t){var n;var e=Math.floor((r.animationWorkData||[]).slice(r.animationIndex).length*32/t/(((n=r.node)==null?void 0:n.syncUnitTime)||1e3))*t;return Math.min((r.animationIndex||0)+(e||t),(r.animationWorkData||[]).length);}},{key:"animationDraw",value:function(){var _animationDraw2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(){var _this99=this;var a,s,o,f,r,t,e,n,i,_iterator41,_step41,_step41$value,v,l,y,O,x,m,_iterator42,_step42,_step42$value,_v8,_l8,p,_y8,_O2,_x48,_m12;return _regeneratorRuntime().wrap(function _callee37$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:this.animationId=void 0;r=!1;t=/* @__PURE__ */new Map(),e=[],n=[],i=[];_iterator41=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context40.prev=4;_iterator41.s();case 6:if((_step41=_iterator41.n()).done){_context40.next=20;break;}_step41$value=_slicedToArray(_step41.value,2),v=_step41$value[0],l=_step41$value[1];_context40.t0=l.toolsType;_context40.next=_context40.t0===ht.LaserPen?11:18;break;case 11:y=this.computNextAnimationIndex(l,8),O=Math.max(0,l.animationIndex||0),x=(l.animationWorkData||[]).slice(O,y);if((l.animationIndex||0)<y){m=(a=l.node)==null?void 0:a.consumeService({op:x,isFullWork:!1});l.totalRect=Ot(l.totalRect,m),l.animationIndex=y,x.length&&t.set(v,{workState:O===0?Rt.Start:y===((s=l.animationWorkData)==null?void 0:s.length)?Rt.Done:Rt.Doing,op:x.slice(-2)});}if(!(n.push({isClear:!0,rect:l.totalRect,clearCanvas:Mt.TopFloat,viewId:this.viewId}),e.push({rect:l.totalRect,drawCanvas:Mt.TopFloat,viewId:this.viewId}),l.isDel)){_context40.next=16;break;}(o=l.node)==null||o.clearTmpPoints(),this.serviceWorkShapes["delete"](v);return _context40.abrupt("break",18);case 16:l.ops&&l.animationIndex===((f=l.animationWorkData)==null?void 0:f.length)&&!l.isDel&&(this.topLayer.getElementsByName(v.toString())[0]||(l.isDel=!0,this.serviceWorkShapes.set(v,l))),r=!0;return _context40.abrupt("break",18);case 18:_context40.next=6;break;case 20:_context40.next=25;break;case 22:_context40.prev=22;_context40.t1=_context40["catch"](4);_iterator41.e(_context40.t1);case 25:_context40.prev=25;_iterator41.f();return _context40.finish(25);case 28:_iterator42=_createForOfIteratorHelper(this.localWorkShapes.entries());_context40.prev=29;_iterator42.s();case 31:if((_step42=_iterator42.n()).done){_context40.next=44;break;}_step42$value=_slicedToArray(_step42.value,2),_v8=_step42$value[0],_l8=_step42$value[1];p=_l8.result,_y8=_l8.toolsType,_O2=_l8.totalRect,_x48=_l8.isDel,_m12=_l8.workState;_context40.t2=_y8;_context40.next=_context40.t2===ht.LaserPen?37:42;break;case 37:if(!(_O2&&(n.push({isClear:!0,rect:_O2,clearCanvas:Mt.TopFloat,viewId:this.viewId}),e.push({rect:_O2,drawCanvas:Mt.TopFloat,viewId:this.viewId})),_x48)){_context40.next=40;break;}_l8.node.clearTmpPoints(),this.localWorkShapes["delete"](_v8),i.push({removeIds:[_v8.toString()],viewId:this.viewId,type:ct.RemoveNode});return _context40.abrupt("break",42);case 40:p&&((p.op||p.ops)&&i.push(p),_l8.result=void 0),!this.topLayer.getElementsByName(_v8.toString())[0]&&_m12===Rt.Done&&(_l8.isDel=!0,this.localWorkShapes.set(_v8,_l8)),r=!0;return _context40.abrupt("break",42);case 42:_context40.next=31;break;case 44:_context40.next=49;break;case 46:_context40.prev=46;_context40.t3=_context40["catch"](29);_iterator42.e(_context40.t3);case 49:_context40.prev=49;_iterator42.f();return _context40.finish(49);case 52:r&&this.runAnimation(),t.size&&t.forEach(function(v,l){i.push({type:ct.Cursor,uid:l.split(yr)[0],op:v.op,workState:v.workState,viewId:_this99.viewId});}),(e.length||n.length||i.length)&&this.post({render:[].concat(n,e),sp:i});case 53:case"end":return _context40.stop();}},_callee37,this,[[4,22,25,28],[29,46,49,52]]);}));function animationDraw(){return _animationDraw2.apply(this,arguments);}return animationDraw;}()},{key:"runAnimation",value:function runAnimation(){this.animationId||(this.animationId=requestAnimationFrame(this.animationDraw.bind(this)));}}]);}();var _n=/* @__PURE__ */function(h){return h.Full="full",h.Sub="sub",h;}(_n||{});var ag=/*#__PURE__*/function(){function ag(r,t){_classCallCheck(this,ag);nt(this,"_self");nt(this,"type");nt(this,"workThreadMap",/* @__PURE__ */new Map());this._self=r,this.type=t,this.register();}return _createClass(ag,[{key:"init",value:function init(r){var t=r.viewId,e=r.dpr,n=r.offscreenCanvasOpt,i=r.layerOpt,a=r.isSafari;if(!e||!n||!i)return;var s;this.type==="full"&&(s=new lg(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),this.type==="sub"&&(s=new cg(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),s&&a&&s.setIsSafari(a),s&&r.cameraOpt&&s.setCameraOpt(r.cameraOpt),s&&this.workThreadMap.set(t,s);}},{key:"register",value:function register(){var _this100=this;onmessage=function onmessage(r){var t=r.data;if(t){var _iterator43=_createForOfIteratorHelper(t.values()),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _e8=_step43.value;var n=_e8.msgType,i=_e8.viewId,a=_e8.tasksqueue,s=_e8.mainTasksqueueCount;if(n===ct.Init){_this100.init(_e8);continue;}if(n===ct.TasksQueue&&a!=null&&a.size&&s){var _iterator44=_createForOfIteratorHelper(_this100.workThreadMap.entries()),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var _step44$value=_slicedToArray(_step44.value,2),f=_step44$value[0],v=_step44$value[1];var l=a.get(f);l&&v.on(l,s);}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}continue;}if(i===qh){var _iterator45=_createForOfIteratorHelper(_this100.workThreadMap.values()),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var _f5=_step45.value;_f5.on(_e8),n===ct.Destroy&&_this100.workThreadMap["delete"](i);}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}continue;}var o=_this100.workThreadMap.get(i);o&&(o.on(_e8),n===ct.Destroy&&_this100.workThreadMap["delete"](i));}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}};}},{key:"post",value:function post(r,t){t?this._self.postMessage(r,t):this._self.postMessage(r);}}]);}();var lg=/*#__PURE__*/function(_kn){function lg(t,e,n){var _this101;_classCallCheck(this,lg);_this101=_callSuper(this,lg,[t,e]);nt(_this101,"serviceDrawLayer");nt(_this101,"localDrawLayer");nt(_this101,"snapshotFullLayer");nt(_this101,"methodBuilder");nt(_this101,"localWork");nt(_this101,"serviceWork");nt(_this101,"_post");_this101._post=n,_this101.serviceDrawLayer=_this101.createLayer("serviceDrawLayer",_this101.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:1e3})),_this101.localDrawLayer=_this101.createLayer("localDrawLayer",_this101.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:1e3}));var i={thread:_this101,viewId:_this101.viewId,vNodes:_this101.vNodes,fullLayer:_this101.fullLayer};_this101.localWork=new ng(_objectSpread(_objectSpread({},i),{},{drawLayer:_this101.localDrawLayer})),_this101.serviceWork=new ig(_objectSpread(_objectSpread({},i),{},{drawLayer:_this101.serviceDrawLayer})),_this101.methodBuilder=new x0([Lt.CopyNode,Lt.SetColorNode,Lt.DeleteNode,Lt.RotateNode,Lt.ScaleNode,Lt.TranslateNode,Lt.ZIndexNode,Lt.SetFontStyle,Lt.SetPoint,Lt.SetLock,Lt.SetShapeOpt]).registerForWorker(_this101.localWork,_this101.serviceWork,_this101.scene),_this101.vNodes.init(_this101.fullLayer);return _this101;}_inherits(lg,_kn);return _createClass(lg,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(){var _this102=this;var a,s,o,f,_this$combinePostData,t,e,n,v,_iterator46,_step46,l,p,i;return _regeneratorRuntime().wrap(function _callee38$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,e=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context41.next=28;break;}v=[];_iterator46=_createForOfIteratorHelper(t);_context41.prev=4;_iterator46.s();case 6:if((_step46=_iterator46.n()).done){_context41.next=19;break;}l=_step46.value;if(!l.rect){_context41.next=17;break;}if(!(l.drawCanvas&&(l.rect=this.safariFixRect(Xt(l.rect))),!l.rect)){_context41.next=11;break;}return _context41.abrupt("continue",17);case 11:if(!(l.drawCanvas&&l.rect)){_context41.next=16;break;}_context41.next=14;return this.getRectImageBitmap(l);case 14:p=_context41.sent;l.imageBitmap=p,n||(n=[]),n.push(p);case 16:v.push(l);case 17:_context41.next=6;break;case 19:_context41.next=24;break;case 21:_context41.prev=21;_context41.t0=_context41["catch"](4);_iterator46.e(_context41.t0);case 24:_context41.prev=24;_iterator46.f();return _context41.finish(24);case 27:e.render=v;case 28:i=(a=e.sp)==null?void 0:a.filter(function(v){return v.type!==ct.None||Object.keys(v).filter(function(l){return l==="type";}).length;});i!=null&&i.length&&(e.sp=i.map(function(v){return _objectSpread(_objectSpread({},v),{},{viewId:_this102.viewId});})),((s=e.sp)==null?void 0:s.length)===0&&delete e.sp,e.drawCount===void 0&&delete e.drawCount,e.workerTasksqueueCount===void 0&&delete e.workerTasksqueueCount,(e!=null&&e.drawCount||e!=null&&e.workerTasksqueueCount||(o=e.sp)!=null&&o.length||(f=e.render)!=null&&f.length)&&this._post(e,n);case 30:case"end":return _context41.stop();}},_callee38,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 _callee39(t,e){var n,i,a;return _regeneratorRuntime().wrap(function _callee39$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context42.next=2;break;}return _context42.abrupt("return");case 2:n=t.msgType,i=t.dataType,a=t.workId;_context42.t0=n;_context42.next=_context42.t0===ct.UpdateCamera?6:_context42.t0===ct.Select?10:_context42.t0===ct.UpdateNode?12:_context42.t0===ct.FullWork?12:_context42.t0===ct.RemoveNode?15:_context42.t0===ct.GetTextActive?18:_context42.t0===ct.CursorHover?20:22;break;case 6:_context42.next=8;return this.updateCamera(t);case 8:e&&this.post({workerTasksqueueCount:e});return _context42.abrupt("return");case 10:i===Tt.Service&&(a===wt.selectorId?this.localWork.updateFullSelectWork(t):this.serviceWork.runSelectWork(t));return _context42.abrupt("return");case 12:_context42.next=14;return this.consumeFull(i,t);case 14:return _context42.abrupt("return");case 15:_context42.next=17;return this.removeNode(t);case 17:return _context42.abrupt("return");case 18:this.checkTextActive(t);return _context42.abrupt("return");case 20:this.cursorHover(t);return _context42.abrupt("return");case 22:_context42.next=24;return _get(_getPrototypeOf(lg.prototype),"on",this).call(this,t);case 24:case"end":return _context42.stop();}},_callee39,this);}));function on(_x49,_x50){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(t){var e,n;return _regeneratorRuntime().wrap(function _callee40$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:e=t.dataType,n=t.workId;if(!(n===wt.selectorId)){_context43.next=4;break;}this.localWork.blurSelector(t);return _context43.abrupt("return");case 4:_context43.t0=e===Tt.Local;if(!_context43.t0){_context43.next=9;break;}this.localWork.removeWork(t);_context43.next=9;return this.localWork.colloctEffectSelectWork(t);case 9:_context43.t1=e===Tt.Service;if(!_context43.t1){_context43.next=14;break;}this.serviceWork.removeWork(t);_context43.next=14;return this.localWork.colloctEffectSelectWork(t);case 14:case"end":return _context43.stop();}},_callee40,this);}));function removeNode(_x51){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function checkTextActive(t){var e=t.dataType;e===Tt.Local&&this.localWork.checkTextActive(t);}},{key:"clearAll",value:function clearAll(){this.vNodes.clear(),_get(_getPrototypeOf(lg.prototype),"clearAll",this).call(this),this.localDrawLayer&&(this.localDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.localDrawLayer.removeAllChildren()),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.serviceDrawLayer.removeAllChildren()),this.post({render:[{isClearAll:!0,clearCanvas:Mt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:Mt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:Mt.Float,viewId:this.viewId}],sp:[{type:ct.Clear}]});}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(lg.prototype),"updateLayer",this).call(this,t),this.localDrawLayer&&(this.localDrawLayer.parent.setAttribute("width",e),this.localDrawLayer.parent.setAttribute("height",n),this.localDrawLayer.setAttribute("size",[e,n]),this.localDrawLayer.setAttribute("pos",[e*0.5,n*0.5])),this.serviceDrawLayer&&(this.serviceDrawLayer.parent.setAttribute("width",e),this.serviceDrawLayer.parent.setAttribute("height",n),this.serviceDrawLayer.setAttribute("size",[e,n]),this.serviceDrawLayer.setAttribute("pos",[e*0.5,n*0.5]));}},{key:"setCameraOpt",value:function setCameraOpt(t){this.cameraOpt=t;var e=t.scale,n=t.centerX,i=t.centerY,a=t.width,s=t.height;(a!==this.scene.width||s!==this.scene.height)&&this.updateScene({width:a,height:s}),this.fullLayer&&(this.fullLayer.setAttribute("scale",[e,e]),this.fullLayer.setAttribute("translate",[-n,-i])),this.localDrawLayer&&(this.localDrawLayer.setAttribute("scale",[e,e]),this.localDrawLayer.setAttribute("translate",[-n,-i])),this.serviceDrawLayer&&(this.serviceDrawLayer.setAttribute("scale",[e,e]),this.serviceDrawLayer.setAttribute("translate",[-n,-i]));}},{key:"getLayer",value:function getLayer(t){switch(t){case Mt.Bg:return this.fullLayer;case Mt.ServiceFloat:return this.serviceDrawLayer;case Mt.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 _callee41(t,e){var n;return _regeneratorRuntime().wrap(function _callee41$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:_context44.next=2;return this.localWork.colloctEffectSelectWork(e);case 2:n=_context44.sent;_context44.t0=n&&t===Tt.Local;if(!_context44.t0){_context44.next=7;break;}_context44.next=7;return this.localWork.consumeFull(n,this.scene);case 7:n&&t===Tt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context44.stop();}},_callee41,this);}));function consumeFull(_x52,_x53){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function consumeDraw(t,e){t===Tt.Local&&this.localWork.consumeDraw(e,this.serviceWork),t===Tt.Service&&this.serviceWork.consumeDraw(e);}},{key:"consumeDrawAll",value:function consumeDrawAll(t,e){t===Tt.Local&&this.localWork.consumeDrawAll(e,this.serviceWork);}},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(t){var _this103=this;var i,e,n,a,s,o,_iterator47,_step47,_step47$value,f,v;return _regeneratorRuntime().wrap(function _callee42$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!oe(this.cameraOpt,n))){_context45.next=17;break;}a=this.localWork.getWorkShape(or);a&&(i=a.selectIds)!=null&&i.length&&a.cursorBlur();s=!!this.localDrawLayer.children.length,o=!!this.serviceDrawLayer.children.length;this.setCameraOpt(n);this.localWork.workShapes.forEach(function(f,v){(f.toolsType===ht.Pencil||f.toolsType===ht.Arrow||f.toolsType===ht.Straight||f.toolsType===ht.Ellipse||f.toolsType===ht.Rectangle||f.toolsType===ht.Star||f.toolsType===ht.Polygon||f.toolsType===ht.SpeechBalloon||f.toolsType===ht.Text)&&_this103.localWork.workShapeState.set(v,{willClear:!0});});_context45.t0=this.vNodes.curNodeMap.size;if(!_context45.t0){_context45.next=13;break;}this.vNodes.updateNodesRect();_context45.next=12;return this.localWork.reRenderSelector();case 12:_context45.t0=this.serviceWork.selectorWorkShapes.size;case 13:if(!_context45.t0){_context45.next=16;break;}_iterator47=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){_step47$value=_slicedToArray(_step47.value,2),f=_step47$value[0],v=_step47$value[1];this.serviceWork.runSelectWork({workId:f,selectIds:v.selectIds,msgType:ct.Select,dataType:Tt.Service,viewId:this.viewId});}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}case 16:this.vNodes.hasRenderNodes()&&(s&&e.push({isClearAll:!0,clearCanvas:Mt.Float,viewId:this.viewId}),o&&e.push({isClearAll:!0,clearCanvas:Mt.ServiceFloat,viewId:this.viewId}),e.push({isClearAll:!0,clearCanvas:Mt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:Mt.Bg,viewId:this.viewId})),e.length&&this.post({render:e});case 17:case"end":return _context45.stop();}},_callee42,this);}));function updateCamera(_x54){return _updateCamera.apply(this,arguments);}return updateCamera;}()},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=t.rect,n=t.drawCanvas,i=e.x*this.dpr,a=e.y*this.dpr,s=e.w*this.dpr,o=e.h*this.dpr;return createImageBitmap(this.getOffscreen(n),i,a,s,o,{resizeQuality:"low"});}// private checkRightRectBoundingBox(rect:IRectType){
|
|
458
|
+
// return this.vNodes.combineIntersectRect(rect);
|
|
459
|
+
// }
|
|
460
|
+
},{key:"cursorHover",value:function cursorHover(t){this.localWork.cursorHover(t);}}]);}(kn);var cg=/*#__PURE__*/function(_kn2){function cg(t,e,n){var _this104;_classCallCheck(this,cg);_this104=_callSuper(this,cg,[t,e]);nt(_this104,"_post");nt(_this104,"topLayer");nt(_this104,"snapshotFullLayer");nt(_this104,"serviceWork");nt(_this104,"localWork");nt(_this104,"topLayerWork");_this104._post=n,_this104.topLayer=_this104.createLayer("topLayer",_this104.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:1500}));var i={thread:_this104,viewId:_this104.viewId,vNodes:_this104.vNodes,fullLayer:_this104.fullLayer,topLayer:_this104.topLayer};_this104.localWork=new sg(i),_this104.topLayerWork=new og(i),_this104.vNodes.init(_this104.fullLayer);return _this104;}_inherits(cg,_kn2);return _createClass(cg,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(){var _this105=this;var a,s,o,f,v,_this$combinePostData2,t,e,n,l,_iterator48,_step48,p,y,_iterator49,_step49,_l9,i;return _regeneratorRuntime().wrap(function _callee43$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,e=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context46.next=28;break;}l=[];_iterator48=_createForOfIteratorHelper(t);_context46.prev=4;_iterator48.s();case 6:if((_step48=_iterator48.n()).done){_context46.next=19;break;}p=_step48.value;if(!p.rect){_context46.next=17;break;}if(!(p.drawCanvas&&(p.rect=this.safariFixRect(Xt(p.rect))),!p.rect)){_context46.next=11;break;}return _context46.abrupt("continue",17);case 11:if(!(p.drawCanvas&&p.rect)){_context46.next=16;break;}_context46.next=14;return this.getRectImageBitmap(p);case 14:y=_context46.sent;p.imageBitmap=y,n||(n=[]),n.push(y);case 16:l.push(p);case 17:_context46.next=6;break;case 19:_context46.next=24;break;case 21:_context46.prev=21;_context46.t0=_context46["catch"](4);_iterator48.e(_context46.t0);case 24:_context46.prev=24;_iterator48.f();return _context46.finish(24);case 27:e.render=l;case 28:if((a=e.workIds)!=null&&a.size&&e.drawCount){_iterator49=_createForOfIteratorHelper(e.workIds.values());try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){_l9=_step49.value;this.fullLayer.getElementsByName(_l9).forEach(function(p){p.id&&e.drawCount&&Number(p.id)<e.drawCount&&p.remove();});}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}i=(s=e.sp)==null?void 0:s.filter(function(l){return l.type!==ct.None||Object.keys(l).filter(function(p){return p==="type";}).length;});i!=null&&i.length&&(e.sp=i.map(function(l){return _objectSpread(_objectSpread({},l),{},{viewId:_this105.viewId});})),((o=e.sp)==null?void 0:o.length)===0&&delete e.sp,e.drawCount===void 0&&delete e.drawCount,e.workerTasksqueueCount===void 0&&delete e.workerTasksqueueCount,((f=e.sp)!=null&&f.length||e.drawCount||(v=e==null?void 0:e.render)!=null&&v.length)&&(console.log("msg---layer--sub--000",this.fullLayer.children.map(function(l){return{name:l.name,id:l.id};}),this.fullLayer),this._post(e,n));case 31:case"end":return _context46.stop();}},_callee43,this,[[4,21,24,27]]);}));function combinePost(){return _combinePost2.apply(this,arguments);}return combinePost;}()},{key:"getLayer",value:function getLayer(t,e){if(e&&this.snapshotFullLayer)return this.snapshotFullLayer;switch(t){case Mt.TopFloat:return this.topLayer;default:return this.fullLayer;}}},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(t){var e,n,i,a,s,o;return _regeneratorRuntime().wrap(function _callee44$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:e=t.msgType,n=t.toolsType,i=t.opt,a=t.workId,s=t.dataType;_context47.t0=e;_context47.next=_context47.t0===ct.UpdateCamera?4:_context47.t0===ct.UpdateTools?7:_context47.t0===ct.CreateWork?12:_context47.t0===ct.FullWork?16:_context47.t0===ct.Snapshot?20:_context47.t0===ct.BoundingBox?27:34;break;case 4:_context47.next=6;return this.updateCamera(t);case 6:return _context47.abrupt("break",34);case 7:if(!(n===ht.LaserPen&&i)){_context47.next=11;break;}o={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(o);return _context47.abrupt("return");case 11:return _context47.abrupt("break",34);case 12:if(!(n===ht.LaserPen&&a&&i)){_context47.next=15;break;}this.topLayerWork.getTmpWorkShapeNode()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(a,i);return _context47.abrupt("return");case 15:return _context47.abrupt("break",34);case 16:if(!(n===ht.LaserPen)){_context47.next=19;break;}this.consumeDrawAll(s,t);return _context47.abrupt("return");case 19:return _context47.abrupt("break",34);case 20:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId==="mainView"?6e3:3e3}));_context47.t1=this.snapshotFullLayer;if(!_context47.t1){_context47.next=26;break;}_context47.next=25;return this.getSnapshot(t);case 25:this.snapshotFullLayer=void 0;case 26:return _context47.abrupt("return");case 27:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId==="mainView"?6e3:3e3}));_context47.t2=this.snapshotFullLayer;if(!_context47.t2){_context47.next=33;break;}_context47.next=32;return this.getBoundingRect(t);case 32:this.snapshotFullLayer=void 0;case 33:return _context47.abrupt("return");case 34:_context47.next=36;return _get(_getPrototypeOf(cg.prototype),"on",this).call(this,t);case 36:case"end":return _context47.stop();}},_callee44,this);}));function on(_x55){return _on3.apply(this,arguments);}return on;}()},{key:"getOffscreen",value:function getOffscreen(t,e){return this.getLayer(t,e).parent.canvas;}},{key:"consumeDraw",value:function consumeDraw(t,e){var n=e.op,i=e.workId;if(n!=null&&n.length&&i){if(this.localWork.workShapes.get(i)){this.localWork.consumeDraw(e);return;}if(this.topLayerWork.localWorkShapes.get(i)){this.topLayerWork.consumeDraw(e);return;}}}},{key:"consumeDrawAll",value:function consumeDrawAll(t,e){var n=e.ops,i=e.op,a=e.workId;if((n||i!=null&&i.length)&&a){if(this.localWork.workShapes.get(a)){this.localWork.consumeDrawAll(e);return;}if(this.topLayerWork.localWorkShapes.get(a)){this.topLayerWork.consumeDrawAll(e);return;}}}},{key:"clearAll",value:function clearAll(){this.vNodes.clear(),_get(_getPrototypeOf(cg.prototype),"clearAll",this).call(this),this.topLayer&&(this.topLayer.parent.children.forEach(function(t){t.name!=="viewport"&&t.remove();}),this.topLayer.removeAllChildren()),this.post({render:[{isClearAll:!0,clearCanvas:Mt.TopFloat,viewId:this.viewId}],sp:[{type:ct.Clear}]});}},{key:"getRectImageBitmap",value:function getRectImageBitmap(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=arguments.length>2?arguments[2]:undefined;var i=t.rect,a=t.drawCanvas,s=i.x*this.dpr,o=i.y*this.dpr,f=i.w*this.dpr,v=i.h*this.dpr;return createImageBitmap(this.getOffscreen(a,e),s,o,f,v,n);}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(cg.prototype),"updateLayer",this).call(this,t),this.topLayer&&(this.topLayer.parent.setAttribute("width",e),this.topLayer.parent.setAttribute("height",n),this.topLayer.setAttribute("size",[e,n]),this.topLayer.setAttribute("pos",[e*0.5,n*0.5])),this.snapshotFullLayer&&(this.snapshotFullLayer.parent.setAttribute("width",e),this.snapshotFullLayer.parent.setAttribute("height",n),this.snapshotFullLayer.setAttribute("size",[e,n]),this.snapshotFullLayer.setAttribute("pos",[e*0.5,n*0.5]));}},{key:"updateCamera",value:function(){var _updateCamera2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(t){var _this106=this;var e,n,i,_iterator50,_step50,_loop8;return _regeneratorRuntime().wrap(function _callee45$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!oe(this.cameraOpt,n))){_context49.next=22;break;}i=!!this.topLayerWork.localWorkShapes.size;if(!(this.setCameraOpt(n),i)){_context49.next=21;break;}e.push({isClearAll:!0,clearCanvas:Mt.TopFloat,viewId:this.viewId});_iterator50=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context49.prev=6;_loop8=/*#__PURE__*/_regeneratorRuntime().mark(function _loop8(){var _step50$value,a,s,o;return _regeneratorRuntime().wrap(function _loop8$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:_step50$value=_slicedToArray(_step50.value,2),a=_step50$value[0],s=_step50$value[1];if(s.totalRect){_this106.topLayer.getElementsByName(a.toString()).forEach(function(f){var v=f.getBoundingClientRect(),l=Bt({x:v.x,y:v.y,w:v.width,h:v.height});o=Ot(o,l);}),s.totalRect=o,_this106.topLayerWork.localWorkShapes.set(a,s);}case 2:case"end":return _context48.stop();}},_loop8);});_iterator50.s();case 9:if((_step50=_iterator50.n()).done){_context49.next=13;break;}return _context49.delegateYield(_loop8(),"t0",11);case 11:_context49.next=9;break;case 13:_context49.next=18;break;case 15:_context49.prev=15;_context49.t1=_context49["catch"](6);_iterator50.e(_context49.t1);case 18:_context49.prev=18;_iterator50.f();return _context49.finish(18);case 21:e.length&&this.post({render:e});case 22:case"end":return _context49.stop();}},_callee45,this,[[6,15,18,21]]);}));function updateCamera(_x56){return _updateCamera2.apply(this,arguments);}return updateCamera;}()},{key:"setCameraOpt",value:function setCameraOpt(t,e){this.cameraOpt=t;var n=t.scale,i=t.centerX,a=t.centerY,s=t.width,o=t.height;(s!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:s,height:o}),e?(e.setAttribute("scale",[n,n]),e.setAttribute("translate",[-i,-a])):(this.fullLayer.setAttribute("scale",[n,n]),this.fullLayer.setAttribute("translate",[-i,-a]),this.topLayer.setAttribute("scale",[n,n]),this.topLayer.setAttribute("translate",[-i,-a]));}},{key:"getSnapshot",value:function(){var _getSnapshot=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(t){var e,n,i,a,s,o,f,_i3,_Object$entries,_Object$entries$_i,l,p,y,O,v;return _regeneratorRuntime().wrap(function _callee46$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,s=t.h;if(!(e&&n&&i&&this.snapshotFullLayer)){_context50.next=27;break;}o=Xt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i3=0,_Object$entries=Object.entries(n);case 5:if(!(_i3<_Object$entries.length)){_context50.next=20;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i3],2),l=_Object$entries$_i[0],p=_Object$entries$_i[1];if(!(p!=null&&p.type)){_context50.next=17;break;}_context50.t0=p==null?void 0:p.type;_context50.next=_context50.t0===ct.UpdateNode?11:_context50.t0===ct.FullWork?11:17;break;case 11:y=p.opt;_context50.next=14;return this.localWork.runFullWork(_objectSpread(_objectSpread({},p),{},{opt:y,workId:l,msgType:ct.FullWork,dataType:Tt.Service,viewId:this.viewId}));case 14:O=_context50.sent;f=Ot(f,O);return _context50.abrupt("break",17);case 17:_i3++;_context50.next=5;break;case 20:a&&s&&(v={resizeWidth:a,resizeHeight:s});_context50.next=23;return new Promise(function(l){setTimeout(l,500);});case 23:_context50.next=25;return this.getSnapshotRender({scenePath:e,curCameraOpt:o,options:v});case 25:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;case 27:case"end":return _context50.stop();}},_callee46,this);}));function getSnapshot(_x57){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()// private willRenderSpecialLabel(willRenderMap:Map<string,BaseCollectorReducerAction>){
|
|
461
|
+
// for (const [key,value] of willRenderMap.entries()) {
|
|
462
|
+
// const labelGroup = this.snapshotFullLayer?.getElementsByName(key)[0] as Group;
|
|
463
|
+
// if (labelGroup && value.opt) {
|
|
464
|
+
// this.localWork.updateLabels(labelGroup, value);
|
|
465
|
+
// }
|
|
466
|
+
// }
|
|
467
|
+
// }
|
|
468
|
+
},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t){var s,o,e,n,i,a;return _regeneratorRuntime().wrap(function _callee47$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:e=t.scenePath,n=t.curCameraOpt,i=t.options;((s=this.snapshotFullLayer)==null?void 0:s.parent).render();_context51.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:Mt.None},!0,i);case 4:a=_context51.sent;a&&(this._post({sp:[{type:ct.Snapshot,scenePath:e,imageBitmap:a,viewId:this.viewId}]},[a]),a.close(),(o=this.snapshotFullLayer)==null||o.removeAllChildren(),this.setCameraOpt(n,this.fullLayer));case 6:case"end":return _context51.stop();}},_callee47,this);}));function getSnapshotRender(_x58){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t){var e,n,i,a,s,_i4,_Object$entries2,_Object$entries2$_i,o,f,v;return _regeneratorRuntime().wrap(function _callee48$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(e&&n&&i&&this.snapshotFullLayer)){_context52.next=20;break;}a=Xt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=this.snapshotFullLayer;_i4=0,_Object$entries2=Object.entries(n);case 5:if(!(_i4<_Object$entries2.length)){_context52.next=19;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i4],2),o=_Object$entries2$_i[0],f=_Object$entries2$_i[1];if(!(f!=null&&f.type)){_context52.next=16;break;}_context52.t0=f==null?void 0:f.type;_context52.next=_context52.t0===ct.UpdateNode?11:_context52.t0===ct.FullWork?11:16;break;case 11:_context52.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},f),{},{workId:o,msgType:ct.FullWork,dataType:Tt.Service,viewId:this.viewId}));case 13:v=_context52.sent;s=Ot(s,v);return _context52.abrupt("break",16);case 16:_i4++;_context52.next=5;break;case 19:s&&this.post({sp:[{type:ct.BoundingBox,scenePath:e,rect:s}]}),this.localWork.fullLayer=this.fullLayer,this.localWork.drawLayer=void 0,this.snapshotFullLayer.removeAllChildren(),this.setCameraOpt(a,this.fullLayer);case 20:case"end":return _context52.stop();}},_callee48,this);}));function getBoundingRect(_x59){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(kn);var fg=self;new ag(fg,_n.Full);
|