@netless/appliance-plugin 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -14
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-uIttd_.js +437 -0
- package/cdn/subWorker-4wkCzC.js +437 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +14 -13
- package/dist/collector/base.d.ts +3 -1
- package/dist/collector/collector.d.ts +5 -4
- package/dist/collector/eventCollector.d.ts +2 -1
- package/dist/collector/magixEventCollector.d.ts +30 -0
- package/dist/collector/types.d.ts +27 -7
- package/dist/component/textEditor/manager.d.ts +2 -2
- package/dist/component/textEditor/types.d.ts +0 -1
- package/dist/component/textEditor/view.d.ts +4 -1
- package/dist/core/const.d.ts +2 -0
- package/dist/core/enum.d.ts +12 -5
- package/dist/core/mainEngine.d.ts +31 -10
- package/dist/core/mainThread/base.d.ts +6 -2
- package/dist/core/mainThread/snapshotThread.d.ts +3 -3
- package/dist/core/mainThread/subLocalThread.d.ts +18 -10
- package/dist/core/mainThread/subServiceThread.d.ts +2 -1
- package/dist/core/mainThread/subTopThread.d.ts +15 -8
- package/dist/core/msgEvent/deleteNode/forMainThread.d.ts +1 -5
- package/dist/core/msgEvent/deleteNode/forWorker.d.ts +1 -5
- package/dist/core/msgEvent/scaleNode/forMain.d.ts +7 -6
- package/dist/core/msgEvent/setFont/forMain.d.ts +2 -1
- package/dist/core/msgEvent/translateNode/forMain.d.ts +0 -1
- package/dist/core/tools/arrow.d.ts +36 -7
- package/dist/core/tools/base.d.ts +22 -8
- package/dist/core/tools/ellipse.d.ts +36 -7
- package/dist/core/tools/eraser.d.ts +40 -4
- package/dist/core/tools/image.d.ts +9 -5
- package/dist/core/tools/laserPen.d.ts +34 -4
- package/dist/core/tools/pencil.d.ts +37 -4
- package/dist/core/tools/polygon.d.ts +36 -7
- package/dist/core/tools/rectangle.d.ts +36 -7
- package/dist/core/tools/selector.d.ts +52 -5
- package/dist/core/tools/speechBalloon.d.ts +36 -8
- package/dist/core/tools/star.d.ts +36 -7
- package/dist/core/tools/straight.d.ts +36 -7
- package/dist/core/tools/text.d.ts +20 -10
- package/dist/core/tools/utils.d.ts +6 -5
- package/dist/core/types.d.ts +1 -3
- package/dist/core/utils/index.d.ts +10 -0
- package/dist/core/utils/math.d.ts +9 -2
- package/dist/core/{mainThread/vNodeManager.d.ts → vNodeManager.d.ts} +10 -3
- package/dist/core/worker/base.d.ts +18 -16
- package/dist/core/worker/fullWorkerLocal.d.ts +18 -9
- package/dist/core/worker/fullWorkerService.d.ts +10 -9
- package/dist/core/worker/subWorkerLocal.d.ts +5 -8
- package/dist/core/worker/subWorkerTopLayer.d.ts +13 -9
- package/dist/core/worker/workerManager.d.ts +18 -10
- package/dist/cursors/index.d.ts +44 -18
- package/dist/displayer/floatBtns/del.d.ts +1 -1
- package/dist/displayer/floatBtns/lock.d.ts +1 -1
- package/dist/fullWorker.js +141 -157
- package/dist/index-BdHH_zhp.js +1 -0
- package/dist/index-RCWmSJU4.mjs +9601 -0
- package/dist/index-RcUgPE7z.mjs +5570 -0
- package/dist/index-a-uKt6aD.js +1 -0
- package/dist/plugin/applianceSinglePlugin.d.ts +1 -0
- package/dist/plugin/baseApplianceManager.d.ts +7 -1
- package/dist/plugin/baseViewContainerManager.d.ts +0 -3
- package/dist/plugin/const.d.ts +11 -1
- package/dist/plugin/displayerView.d.ts +3 -5
- package/dist/plugin/multi/containerManager.d.ts +2 -1
- package/dist/style.css +1 -1
- package/dist/subWorker.js +141 -157
- package/package.json +2 -3
- package/cdn/fullWorker-CIvt1j.js +0 -453
- package/cdn/subWorker-BE-0dg.js +0 -453
- package/dist/core/worker/vNodeManager.d.ts +0 -34
- package/dist/index-BcIJbozZ.js +0 -1
- package/dist/index-C1YKkWHE.mjs +0 -9090
- package/dist/index-ClJPZxV-.mjs +0 -5462
- package/dist/index-SsMz_ohn.js +0 -1
package/cdn/fullWorker-CIvt1j.js
DELETED
|
@@ -1,453 +0,0 @@
|
|
|
1
|
-
var _excluded=["toolsType"],_excluded2=["callback"],_excluded3=["render"],_excluded4=["render"];function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var 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 _n9=0,F=function F(){};return{s:F,n:function n(){return _n9>=r.length?{done:!0}:{done:!1,value:r[_n9++]};},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 ei=Object.defineProperty;var ri=function ri(h,r,t){return r in h?ei(h,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[r]=t;};var nt=function nt(h,r,t){return ri(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 ni(){this.__data__=[],this.size=0;}var ii=ni;function si(h,r){return h===r||h!==h&&r!==r;}var lr=si,oi=lr;function ai(h,r){for(var t=h.length;t--;)if(oi(h[t][0],r))return t;return-1;}var Ge=ai,li=Ge,ci=Array.prototype,fi=ci.splice;function ui(h){var r=this.__data__,t=li(r,h);if(t<0)return!1;var e=r.length-1;return t==e?r.pop():fi.call(r,t,1),--this.size,!0;}var hi=ui,di=Ge;function gi(h){var r=this.__data__,t=di(r,h);return t<0?void 0:r[t][1];}var pi=gi,vi=Ge;function mi(h){return vi(this.__data__,h)>-1;}var yi=mi,Si=Ge;function xi(h,r){var t=this.__data__,e=Si(t,h);return e<0?(++this.size,t.push([h,r])):t[e][1]=r,this;}var Ti=xi,Mi=ii,Oi=hi,Ei=pi,Pi=yi,Ai=Ti;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=Mi;Se.prototype["delete"]=Oi;Se.prototype.get=Ei;Se.prototype.has=Pi;Se.prototype.set=Ai;var He=Se,Ci=He;function Ri(){this.__data__=new Ci(),this.size=0;}var Ii=Ri;function Li(h){var r=this.__data__,t=r["delete"](h);return this.size=r.size,t;}var bi=Li;function Di(h){return this.__data__.get(h);}var wi=Di;function Ni(h){return this.__data__.has(h);}var Wi=Ni,Bi=_typeof(De)=="object"&&De&&De.Object===Object&&De,cn=Bi,Fi=cn,ji=(typeof self==="undefined"?"undefined":_typeof(self))=="object"&&self&&self.Object===Object&&self,Ui=Fi||ji||Function("return this")(),_t=Ui,zi=_t,$i=zi.Symbol,Ke=$i,Or=Ke,fn=Object.prototype,Gi=fn.hasOwnProperty,Hi=fn.toString,Ae=Or?Or.toStringTag:void 0;function Ki(h){var r=Gi.call(h,Ae),t=h[Ae];try{h[Ae]=void 0;var e=!0;}catch(_unused){}var n=Hi.call(h);return e&&(r?h[Ae]=t:delete h[Ae]),n;}var Vi=Ki,Yi=Object.prototype,Xi=Yi.toString;function Ji(h){return Xi.call(h);}var Qi=Ji,Er=Ke,Zi=Vi,ki=Qi,qi="[object Null]",_i="[object Undefined]",Pr=Er?Er.toStringTag:void 0;function ts(h){return h==null?h===void 0?_i:qi:Pr&&Pr in Object(h)?Zi(h):ki(h);}var fe=ts;function es(h){var r=_typeof(h);return h!=null&&(r=="object"||r=="function");}var ae=es,rs=fe,ns=ae,is="[object AsyncFunction]",ss="[object Function]",os="[object GeneratorFunction]",as="[object Proxy]";function ls(h){if(!ns(h))return!1;var r=rs(h);return r==ss||r==os||r==is||r==as;}var un=ls,cs=_t,fs=cs["__core-js_shared__"],us=fs,ke=us,Ar=function(){var h=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:"";}();function hs(h){return!!Ar&&Ar in h;}var ds=hs,gs=Function.prototype,ps=gs.toString;function vs(h){if(h!=null){try{return ps.call(h);}catch(_unused2){}try{return h+"";}catch(_unused3){}}return"";}var hn=vs,ms=un,ys=ds,Ss=ae,xs=hn,Ts=/[\\^$.*+?()[\]{}|]/g,Ms=/^\[object .+?Constructor\]$/,Os=Function.prototype,Es=Object.prototype,Ps=Os.toString,As=Es.hasOwnProperty,Cs=RegExp("^"+Ps.call(As).replace(Ts,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rs(h){if(!Ss(h)||ys(h))return!1;var r=ms(h)?Cs:Ms;return r.test(xs(h));}var Is=Rs;function Ls(h,r){return h==null?void 0:h[r];}var bs=Ls,Ds=Is,ws=bs;function Ns(h,r){var t=ws(h,r);return Ds(t)?t:void 0;}var ue=Ns,Ws=ue,Bs=_t,Fs=Ws(Bs,"Map"),cr=Fs,js=ue,Us=js(Object,"create"),Ve=Us,Cr=Ve;function zs(){this.__data__=Cr?Cr(null):{},this.size=0;}var $s=zs;function Gs(h){var r=this.has(h)&&delete this.__data__[h];return this.size-=r?1:0,r;}var Hs=Gs,Ks=Ve,Vs="__lodash_hash_undefined__",Ys=Object.prototype,Xs=Ys.hasOwnProperty;function Js(h){var r=this.__data__;if(Ks){var t=r[h];return t===Vs?void 0:t;}return Xs.call(r,h)?r[h]:void 0;}var Qs=Js,Zs=Ve,ks=Object.prototype,qs=ks.hasOwnProperty;function _s(h){var r=this.__data__;return Zs?r[h]!==void 0:qs.call(r,h);}var to=_s,eo=Ve,ro="__lodash_hash_undefined__";function no(h,r){var t=this.__data__;return this.size+=this.has(h)?0:1,t[h]=eo&&r===void 0?ro:r,this;}var io=no,so=$s,oo=Hs,ao=Qs,lo=to,co=io;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=so;xe.prototype["delete"]=oo;xe.prototype.get=ao;xe.prototype.has=lo;xe.prototype.set=co;var fo=xe,Rr=fo,uo=He,ho=cr;function go(){this.size=0,this.__data__={hash:new Rr(),map:new(ho||uo)(),string:new Rr()};}var po=go;function vo(h){var r=_typeof(h);return r=="string"||r=="number"||r=="symbol"||r=="boolean"?h!=="__proto__":h===null;}var mo=vo,yo=mo;function So(h,r){var t=h.__data__;return yo(r)?t[typeof r=="string"?"string":"hash"]:t.map;}var Ye=So,xo=Ye;function To(h){var r=xo(this,h)["delete"](h);return this.size-=r?1:0,r;}var Mo=To,Oo=Ye;function Eo(h){return Oo(this,h).get(h);}var Po=Eo,Ao=Ye;function Co(h){return Ao(this,h).has(h);}var Ro=Co,Io=Ye;function Lo(h,r){var t=Io(this,h),e=t.size;return t.set(h,r),this.size+=t.size==e?0:1,this;}var bo=Lo,Do=po,wo=Mo,No=Po,Wo=Ro,Bo=bo;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=Do;Te.prototype["delete"]=wo;Te.prototype.get=No;Te.prototype.has=Wo;Te.prototype.set=Bo;var dn=Te,Fo=He,jo=cr,Uo=dn,zo=200;function $o(h,r){var t=this.__data__;if(t instanceof Fo){var e=t.__data__;if(!jo||e.length<zo-1)return e.push([h,r]),this.size=++t.size,this;t=this.__data__=new Uo(e);}return t.set(h,r),this.size=t.size,this;}var Go=$o,Ho=He,Ko=Ii,Vo=bi,Yo=wi,Xo=Wi,Jo=Go;function Me(h){var r=this.__data__=new Ho(h);this.size=r.size;}Me.prototype.clear=Ko;Me.prototype["delete"]=Vo;Me.prototype.get=Yo;Me.prototype.has=Xo;Me.prototype.set=Jo;var gn=Me;function Qo(h,r){for(var t=-1,e=h==null?0:h.length;++t<e&&r(h[t],t,h)!==!1;);return h;}var Zo=Qo,ko=ue,qo=function(){try{var h=ko(Object,"defineProperty");return h({},"",{}),h;}catch(_unused4){}}(),_o=qo,Ir=_o;function ta(h,r,t){r=="__proto__"&&Ir?Ir(h,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):h[r]=t;}var pn=ta,ea=pn,ra=lr,na=Object.prototype,ia=na.hasOwnProperty;function sa(h,r,t){var e=h[r];(!(ia.call(h,r)&&ra(e,t))||t===void 0&&!(r in h))&&ea(h,r,t);}var vn=sa,oa=vn,aa=pn;function la(h,r,t,e){var n=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var o=r[i],s=e?e(t[o],h[o],o,t,h):void 0;s===void 0&&(s=h[o]),n?aa(t,o,s):oa(t,o,s);}return t;}var Xe=la;function ca(h,r){for(var t=-1,e=Array(h);++t<h;)e[t]=r(t);return e;}var fa=ca;function ua(h){return h!=null&&_typeof(h)=="object";}var re=ua,ha=fe,da=re,ga="[object Arguments]";function pa(h){return da(h)&&ha(h)==ga;}var va=pa,Lr=va,ma=re,mn=Object.prototype,ya=mn.hasOwnProperty,Sa=mn.propertyIsEnumerable,xa=Lr(/* @__PURE__ */function(){return arguments;}())?Lr:function(h){return ma(h)&&ya.call(h,"callee")&&!Sa.call(h,"callee");},Ta=xa,Ma=Array.isArray,Je=Ma,We={exports:{}};function Oa(){return!1;}var Ea=Oa;We.exports;(function(h,r){var t=_t,e=Ea,n=r&&!r.nodeType&&r,i=n&&!0&&h&&!h.nodeType&&h,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.isBuffer:void 0,f=s||e;h.exports=f;})(We,We.exports);var fr=We.exports,Pa=9007199254740991,Aa=/^(?:0|[1-9]\d*)$/;function Ca(h,r){var _r2;var t=_typeof(h);return r=(_r2=r)!==null&&_r2!==void 0?_r2:Pa,!!r&&(t=="number"||t!="symbol"&&Aa.test(h))&&h>-1&&h%1==0&&h<r;}var Ra=Ca,Ia=9007199254740991;function La(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=Ia;}var yn=La,ba=fe,Da=yn,wa=re,Na="[object Arguments]",Wa="[object Array]",Ba="[object Boolean]",Fa="[object Date]",ja="[object Error]",Ua="[object Function]",za="[object Map]",$a="[object Number]",Ga="[object Object]",Ha="[object RegExp]",Ka="[object Set]",Va="[object String]",Ya="[object WeakMap]",Xa="[object ArrayBuffer]",Ja="[object DataView]",Qa="[object Float32Array]",Za="[object Float64Array]",ka="[object Int8Array]",qa="[object Int16Array]",_a="[object Int32Array]",tl="[object Uint8Array]",el="[object Uint8ClampedArray]",rl="[object Uint16Array]",nl="[object Uint32Array]",Ft={};Ft[Qa]=Ft[Za]=Ft[ka]=Ft[qa]=Ft[_a]=Ft[tl]=Ft[el]=Ft[rl]=Ft[nl]=!0;Ft[Na]=Ft[Wa]=Ft[Xa]=Ft[Ba]=Ft[Ja]=Ft[Fa]=Ft[ja]=Ft[Ua]=Ft[za]=Ft[$a]=Ft[Ga]=Ft[Ha]=Ft[Ka]=Ft[Va]=Ft[Ya]=!1;function il(h){return wa(h)&&Da(h.length)&&!!Ft[ba(h)];}var sl=il;function ol(h){return function(r){return h(r);};}var ur=ol,Be={exports:{}};Be.exports;(function(h,r){var t=cn,e=r&&!r.nodeType&&r,n=e&&!0&&h&&!h.nodeType&&h,i=n&&n.exports===e,a=i&&t.process,o=function(){try{var s=n&&n.require&&n.require("util").types;return s||a&&a.binding&&a.binding("util");}catch(_unused5){}}();h.exports=o;})(Be,Be.exports);var hr=Be.exports,al=sl,ll=ur,br=hr,Dr=br&&br.isTypedArray,cl=Dr?ll(Dr):al,Sn=cl,fl=fa,ul=Ta,hl=Je,dl=fr,gl=Ra,pl=Sn,vl=Object.prototype,ml=vl.hasOwnProperty;function yl(h,r){var t=hl(h),e=!t&&ul(h),n=!t&&!e&&dl(h),i=!t&&!e&&!n&&pl(h),a=t||e||n||i,o=a?fl(h.length,String):[],s=o.length;for(var f in h)(r||ml.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
|
-
gl(f,s)))&&o.push(f);return o;}var xn=yl,Sl=Object.prototype;function xl(h){var r=h&&h.constructor,t=typeof r=="function"&&r.prototype||Sl;return h===t;}var dr=xl;function Tl(h,r){return function(t){return h(r(t));};}var Tn=Tl,Ml=Tn,Ol=Ml(Object.keys,Object),El=Ol,Pl=dr,Al=El,Cl=Object.prototype,Rl=Cl.hasOwnProperty;function Il(h){if(!Pl(h))return Al(h);var r=[];for(var t in Object(h))Rl.call(h,t)&&t!="constructor"&&r.push(t);return r;}var Ll=Il,bl=un,Dl=yn;function wl(h){return h!=null&&Dl(h.length)&&!bl(h);}var Mn=wl,Nl=xn,Wl=Ll,Bl=Mn;function Fl(h){return Bl(h)?Nl(h):Wl(h);}var gr=Fl,jl=Xe,Ul=gr;function zl(h,r){return h&&jl(r,Ul(r),h);}var $l=zl;function Gl(h){var r=[];if(h!=null)for(var t in Object(h))r.push(t);return r;}var Hl=Gl,Kl=ae,Vl=dr,Yl=Hl,Xl=Object.prototype,Jl=Xl.hasOwnProperty;function Ql(h){if(!Kl(h))return Yl(h);var r=Vl(h),t=[];for(var e in h)e=="constructor"&&(r||!Jl.call(h,e))||t.push(e);return t;}var Zl=Ql,kl=xn,ql=Zl,_l=Mn;function tc(h){return _l(h)?kl(h,!0):ql(h);}var pr=tc,ec=Xe,rc=pr;function nc(h,r){return h&&ec(r,rc(r),h);}var ic=nc,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,o=a?a.allocUnsafe:void 0;function s(f,p){if(p)return f.slice();var c=f.length,v=o?o(c):new f.constructor(c);return f.copy(v),v;}h.exports=s;})(Fe,Fe.exports);var sc=Fe.exports;function oc(h,r){var t=-1,e=h.length;for(r||(r=Array(e));++t<e;)r[t]=h[t];return r;}var ac=oc;function lc(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 cc=lc;function fc(){return[];}var On=fc,uc=cc,hc=On,dc=Object.prototype,gc=dc.propertyIsEnumerable,wr=Object.getOwnPropertySymbols,pc=wr?function(h){return h==null?[]:(h=Object(h),uc(wr(h),function(r){return gc.call(h,r);}));}:hc,vr=pc,vc=Xe,mc=vr;function yc(h,r){return vc(h,mc(h),r);}var Sc=yc;function xc(h,r){for(var t=-1,e=r.length,n=h.length;++t<e;)h[n+t]=r[t];return h;}var En=xc,Tc=Tn,Mc=Tc(Object.getPrototypeOf,Object),Pn=Mc,Oc=En,Ec=Pn,Pc=vr,Ac=On,Cc=Object.getOwnPropertySymbols,Rc=Cc?function(h){for(var r=[];h;)Oc(r,Pc(h)),h=Ec(h);return r;}:Ac,An=Rc,Ic=Xe,Lc=An;function bc(h,r){return Ic(h,Lc(h),r);}var Dc=bc,wc=En,Nc=Je;function Wc(h,r,t){var e=r(h);return Nc(h)?e:wc(e,t(h));}var Cn=Wc,Bc=Cn,Fc=vr,jc=gr;function Uc(h){return Bc(h,jc,Fc);}var Rn=Uc,zc=Cn,$c=An,Gc=pr;function Hc(h){return zc(h,Gc,$c);}var Kc=Hc,Vc=ue,Yc=_t,Xc=Vc(Yc,"DataView"),Jc=Xc,Qc=ue,Zc=_t,kc=Qc(Zc,"Promise"),qc=kc,_c=ue,tf=_t,ef=_c(tf,"Set"),rf=ef,nf=ue,sf=_t,of=nf(sf,"WeakMap"),af=of,er=Jc,rr=cr,nr=qc,ir=rf,sr=af,In=fe,Oe=hn,Nr="[object Map]",lf="[object Object]",Wr="[object Promise]",Br="[object Set]",Fr="[object WeakMap]",jr="[object DataView]",cf=Oe(er),ff=Oe(rr),uf=Oe(nr),hf=Oe(ir),df=Oe(sr),le=In;(er&&le(new er(new ArrayBuffer(1)))!=jr||rr&&le(new rr())!=Nr||nr&&le(nr.resolve())!=Wr||ir&&le(new ir())!=Br||sr&&le(new sr())!=Fr)&&(le=function le(h){var r=In(h),t=r==lf?h.constructor:void 0,e=t?Oe(t):"";if(e)switch(e){case cf:return jr;case ff:return Nr;case uf:return Wr;case hf:return Br;case df:return Fr;}return r;});var Qe=le,gf=Object.prototype,pf=gf.hasOwnProperty;function vf(h){var r=h.length,t=new h.constructor(r);return r&&typeof h[0]=="string"&&pf.call(h,"index")&&(t.index=h.index,t.input=h.input),t;}var mf=vf,yf=_t,Sf=yf.Uint8Array,Ln=Sf,Ur=Ln;function xf(h){var r=new h.constructor(h.byteLength);return new Ur(r).set(new Ur(h)),r;}var mr=xf,Tf=mr;function Mf(h,r){var t=r?Tf(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.byteLength);}var Of=Mf,Ef=/\w*$/;function Pf(h){var r=new h.constructor(h.source,Ef.exec(h));return r.lastIndex=h.lastIndex,r;}var Af=Pf,zr=Ke,$r=zr?zr.prototype:void 0,Gr=$r?$r.valueOf:void 0;function Cf(h){return Gr?Object(Gr.call(h)):{};}var Rf=Cf,If=mr;function Lf(h,r){var t=r?If(h.buffer):h.buffer;return new h.constructor(t,h.byteOffset,h.length);}var bf=Lf,Df=mr,wf=Of,Nf=Af,Wf=Rf,Bf=bf,Ff="[object Boolean]",jf="[object Date]",Uf="[object Map]",zf="[object Number]",$f="[object RegExp]",Gf="[object Set]",Hf="[object String]",Kf="[object Symbol]",Vf="[object ArrayBuffer]",Yf="[object DataView]",Xf="[object Float32Array]",Jf="[object Float64Array]",Qf="[object Int8Array]",Zf="[object Int16Array]",kf="[object Int32Array]",qf="[object Uint8Array]",_f="[object Uint8ClampedArray]",tu="[object Uint16Array]",eu="[object Uint32Array]";function ru(h,r,t){var e=h.constructor;switch(r){case Vf:return Df(h);case Ff:case jf:return new e(+h);case Yf:return wf(h,t);case Xf:case Jf:case Qf:case Zf:case kf:case qf:case _f:case tu:case eu:return Bf(h,t);case Uf:return new e();case zf:case Hf:return new e(h);case $f:return Nf(h);case Gf:return new e();case Kf:return Wf(h);}}var nu=ru,iu=ae,Hr=Object.create,su=/* @__PURE__ */function(){function h(){}return function(r){if(!iu(r))return{};if(Hr)return Hr(r);h.prototype=r;var t=new h();return h.prototype=void 0,t;};}(),ou=su,au=ou,lu=Pn,cu=dr;function fu(h){return typeof h.constructor=="function"&&!cu(h)?au(lu(h)):{};}var uu=fu,hu=Qe,du=re,gu="[object Map]";function pu(h){return du(h)&&hu(h)==gu;}var vu=pu,mu=vu,yu=ur,Kr=hr,Vr=Kr&&Kr.isMap,Su=Vr?yu(Vr):mu,xu=Su,Tu=Qe,Mu=re,Ou="[object Set]";function Eu(h){return Mu(h)&&Tu(h)==Ou;}var Pu=Eu,Au=Pu,Cu=ur,Yr=hr,Xr=Yr&&Yr.isSet,Ru=Xr?Cu(Xr):Au,Iu=Ru,Lu=gn,bu=Zo,Du=vn,wu=$l,Nu=ic,Wu=sc,Bu=ac,Fu=Sc,ju=Dc,Uu=Rn,zu=Kc,$u=Qe,Gu=mf,Hu=nu,Ku=uu,Vu=Je,Yu=fr,Xu=xu,Ju=ae,Qu=Iu,Zu=gr,ku=pr,qu=1,_u=2,th=4,bn="[object Arguments]",eh="[object Array]",rh="[object Boolean]",nh="[object Date]",ih="[object Error]",Dn="[object Function]",sh="[object GeneratorFunction]",oh="[object Map]",ah="[object Number]",wn="[object Object]",lh="[object RegExp]",ch="[object Set]",fh="[object String]",uh="[object Symbol]",hh="[object WeakMap]",dh="[object ArrayBuffer]",gh="[object DataView]",ph="[object Float32Array]",vh="[object Float64Array]",mh="[object Int8Array]",yh="[object Int16Array]",Sh="[object Int32Array]",xh="[object Uint8Array]",Th="[object Uint8ClampedArray]",Mh="[object Uint16Array]",Oh="[object Uint32Array]",Bt={};Bt[bn]=Bt[eh]=Bt[dh]=Bt[gh]=Bt[rh]=Bt[nh]=Bt[ph]=Bt[vh]=Bt[mh]=Bt[yh]=Bt[Sh]=Bt[oh]=Bt[ah]=Bt[wn]=Bt[lh]=Bt[ch]=Bt[fh]=Bt[uh]=Bt[xh]=Bt[Th]=Bt[Mh]=Bt[Oh]=!0;Bt[ih]=Bt[Dn]=Bt[hh]=!1;function Ne(h,r,t,e,n,i){var a,o=r&qu,s=r&_u,f=r&th;if(t&&(a=n?t(h,e,n,i):t(h)),a!==void 0)return a;if(!Ju(h))return h;var p=Vu(h);if(p){if(a=Gu(h),!o)return Bu(h,a);}else{var c=$u(h),v=c==Dn||c==sh;if(Yu(h))return Wu(h,o);if(c==wn||c==bn||v&&!n){if(a=s||v?{}:Ku(h),!o)return s?ju(h,Nu(a,h)):Fu(h,wu(a,h));}else{if(!Bt[c])return n?h:{};a=Hu(h,c,o);}}i||(i=new Lu());var S=i.get(h);if(S)return S;i.set(h,a),Qu(h)?h.forEach(function(m){a.add(Ne(m,r,t,m,h,i));}):Xu(h)&&h.forEach(function(m,T){a.set(T,Ne(m,r,t,T,h,i));});var O=f?s?zu:Uu:s?ku:Zu,x=p?void 0:O(h);return bu(x||h,function(m,T){x&&(T=m,m=h[T]),Du(a,T,Ne(m,r,t,T,h,i));}),a;}var Eh=Ne,Ph=Eh,Ah=1,Ch=4;function Rh(h){return Ph(h,Ah|Ch);}var Ih=Rh,Jt=/* @__PURE__ */ye(Ih),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.CameraChange="CameraChange",h.ActiveMethod="ActiveMethod",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||{}),Mt=/* @__PURE__ */function(h){return h[h.Local=1]="Local",h[h.Service=2]="Service",h[h.Worker=3]="Worker",h;}(Mt||{}),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||{}),Ce=/* @__PURE__ */function(h){return h.Webgl2="webgl2",h.Webgl="webgl",h.Canvas2d="2d",h;}(Ce||{}),xt=/* @__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;}(xt||{}),$t=/* @__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;}($t||{});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 Lh=/*#__PURE__*/function(_te){function Lh(){var _this;_classCallCheck(this,Lh);_this=_callSuper(this,Lh,arguments);nt(_this,"emitEventType",Lt.CopyNode);return _this;}_inherits(Lh,_te);return _createClass(Lh,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.FullWork&&n===Mt.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 bh={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),o=Math.cos(e);return new _(t.x+(n*o-i*a),t.y+(n*a+i*o));}/**
|
|
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=bh.easeInQuad(i/(e-1)),o=_.Lrp(r,t,a);o.z=Math.min(1,0.5+Math.abs(0.5-Dh(a))*0.65),n.push(o);}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 Dh=function Dh(h){return h<0.5?2*h*h:-1+(4-2*h)*h;};var Tt=/*#__PURE__*/function(_ref2){function Tt(){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,Tt);_this2=_callSuper(this,Tt,[r,t,e]),_this2.x=r,_this2.y=t,_this2.z=e,_this2.v=n,_this2.t=i,_this2.a=a;return _this2;}_inherits(Tt,_ref2);return _createClass(Tt,[{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,o={x:n.x,y:n.y};return new Tt(r,t,e,o,i,a);}},{key:"distance",value:function distance(r){return Tt.GetDistance(this,r);}},{key:"isNear",value:function isNear(r,t){return Tt.IsNear(this,r,t);}},{key:"getAngleByPoints",value:function getAngleByPoints(r,t){return Tt.GetAngleByPoints(r,this,t);}}],[{key:"Sub",value:function Sub(r,t){return new Tt(r.x-t.x,r.y-t.y);}},{key:"Add",value:function Add(r,t){return new Tt(r.x+t.x,r.y+t.y);}},{key:"GetDistance",value:function GetDistance(r,t){return Tt.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,o=e.y-t.y;var s=0;var f=Math.sqrt(n*n+a*a),p=Math.sqrt(i*i+o*o);if(f&&p){var c=n*i+a*o;s=Math.acos(c/(f*p)),s=s/Math.PI*180;var v=n*o-a*i;v=v>0?1:-1,s=180+v*s;}return s;}},{key:"IsNear",value:function IsNear(r,t,e){return Tt.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,o=Math.sin(e),s=Math.cos(e),f=Math.pow(10,n),p=Math.floor((t.x+(i*s-a*o))*f)/f,c=Math.floor((t.y+(i*o+a*s))*f)/f;return new Tt(p,c);}/**
|
|
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=Tt.Add(r,Tt.Sub(r,n).uni().per().mul(-t)),o=[];for(var s=1/e,f=s;f<=1;f+=s)o.push(Tt.RotWith(a,r,i*2*f));return o;}/**
|
|
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 o=1/n,s=o;s<=1;s+=o)a.push(Tt.RotWith(t,r,i*s));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,o=i-_e2;return{x:t,y:_e2,w:a,h:o};}return r||h;}function Wt(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(o){var _o$XY=_slicedToArray(o.XY,2),s=_o$XY[0],f=_o$XY[1];e=Math.min(e,s-r),n=Math.min(n,f-r),i=Math.max(i,s+r),a=Math.max(a,f+r);}),t.x=e,t.y=n,t.w=i-e,t.h=a-n,t;}function Re(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 wt(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 Ie(h,r){return{x:h.x+r[0],y:h.y+r[1],w:h.w,h:h.h};}function Nn(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),o=Math.PI*r/180,s=_.RotWith(t,a,o),f=_.RotWith(e,a,o),p=_.RotWith(n,a,o),c=_.RotWith(i,a,o);return[s,f,p,c];}function Wn(h,r){var t=Nn(h,r);return Wt(t);}function Bn(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),o=new _(r[0],r[1]),s=_.ScaleWOrigin(t,o,a),f=_.ScaleWOrigin(e,o,a),p=_.ScaleWOrigin(n,o,a),c=_.ScaleWOrigin(i,o,a);return Wt([s,f,p,c]);}function wh(h,r,t){var e=[];for(var n=0;n<h.length;n++){var i=h[n],a=new _(t[0],t[1]),o=_.ScaleWOrigin(i,a,r);e.push(o);}return e;}function Nh(h,r,t){var e=[];for(var n=0;n<h.length;n++){var i=h[n],a=Math.PI*t/180,o=_.RotWith(i,r,a);e.push(o);}return e;}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=Math.PI*t/180,o=_.RotWith(i,e,a);h[n]=o.x,h[n+1]=o.y;}}function Bh(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]),o=_.ScaleWOrigin(i,a,e);h[n]=o.x,h[n+1]=o.y;}}function Fh(h,r){return h[0]>=r.x&&h[0]<=r.x+r.w&&h[1]>=r.y&&h[1]<=r.y+r.h;}function Fn(h,r){var t=h<=r?1:h/r,e=r<=h?1:r/h;return[t,e];}var jh=function jh(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;},Uh=function Uh(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 zh=fe,$h=re,Gh="[object Number]";function Hh(h){return typeof h=="number"||$h(h)&&zh(h)==Gh;}var Kh=Hh,kt=/* @__PURE__ */ye(Kh);var Xt=/*#__PURE__*/function(){function Xt(r){_classCallCheck(this,Xt);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(Xt,[{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 o=a[0],s=r.pos,f=r.zIndex,p=r.scale,c=r.angle,v=r.translate,S={};kt(f)&&(S.zIndex=f),s&&(S.pos=[s[0],s[1]]),p&&(S.scale=p),c&&(S.rotate=c),v&&(S.translate=v),o.attr(S);var O=o==null?void 0:o.getBoundingClientRect();return O&&(t=Ot(t,{x:Math.floor(O.x-Xt.SafeBorderPadding),y:Math.floor(O.y-Xt.SafeBorderPadding),w:Math.floor(O.width+Xt.SafeBorderPadding*2),h:Math.floor(O.height+Xt.SafeBorderPadding*2)})),(i=this.vNodes)==null||i.setInfo(e,{rect:t,centerPos:s}),t;}}},{key:"replace",value:function replace(r,t,e){var o;var n=r.getElementsByName(t),i=n.length;if(i){if(i>1)for(var s=1;s<n.length;s++)n[s].remove();r.replaceChild(e,n[0]);}else r.append(e);this.fullLayer===r?(o=this.drawLayer)==null||o.getElementsByName(t).forEach(function(s){s.remove();}):this.fullLayer.getElementsByName(t).forEach(function(s){s.remove();});}}],[{key:"updateNodeOpt",value:function updateNodeOpt(r){var t=r.node,e=r.opt,n=r.vNodes,i=r.willSerializeData,a=r.targetNode,o=e.zIndex,s=e.translate,f=e.angle,p=e.box,c=e.boxScale,v=e.boxTranslate,S=e.pointMap;var O;var x=a&&Jt(a)||n.get(t.name);if(!x)return;kt(o)&&(t.setAttribute("zIndex",o),x.opt.zIndex=o);var m=t.parent;if(m){if(p&&v&&c){var T=x.rect,l=[];for(var L=0;L<x.op.length;L+=3)l.push(new Tt(x.op[L],x.op[L+1],x.op[L+2]));var d=Wt(l),u=[d.w*m.worldScaling[0],d.h*m.worldScaling[0]],g=[T.w-u[0],T.h-u[1]],M=[(T.w*c[0]-g[0])/u[0],(T.h*c[1]-g[1])/u[1]],A=[v[0]/m.worldScaling[0],v[1]/m.worldScaling[1]],R=x.op.map(function(L,D){var I=D%3;return I===0?L+A[0]:I===1?L+A[1]:L;}),b=[x.centerPos[0]+A[0],x.centerPos[1]+A[1]];Bh(R,b,M);var E=[];for(var _L=0;_L<R.length;_L+=3)E.push(new Tt(R[_L],R[_L+1],R[_L+2]));x.op=R,x.centerPos=b;}else if(s){if(t.setAttribute("translate",s),x.opt.translate=s,a){var _T=[s[0]*m.worldScaling[0],s[1]*m.worldScaling[1]];O=Ie(x.rect,_T),x.rect=O;}else{var _T2=Xt.getRectFromLayer(m,t.name);x.rect=_T2||x.rect;}}else if(kt(f))if(t.setAttribute("rotate",f),x.opt.rotate=f,a)O=Wn(x.rect,f),x.rect=O;else{var _T3=Xt.getRectFromLayer(m,t.name);x.rect=_T3||x.rect;}if(S){var _T4=S.get(t.name);if(_T4)for(var _l2=0,_d2=0;_l2<x.op.length;_l2+=3,_d2++)x.op[_l2]=_T4[_d2][0],x.op[_l2+1]=_T4[_d2][1];}if(i){if(s){var _T5=[s[0],s[1]],_l3=x.op.map(function(d,u){var g=u%3;return g===0?d+_T5[0]:g===1?d+_T5[1]:d;});x.op=_l3,x.centerPos=[x.centerPos[0]+_T5[0],x.centerPos[1]+_T5[1]],x!=null&&x.opt&&(x.opt.translate=void 0);}else if(kt(f)){var _T6=x.op;Wh(_T6,x.centerPos,f),x.op=_T6,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-Xt.SafeBorderPadding),y:Math.floor(n.y-Xt.SafeBorderPadding),w:Math.floor(n.width+Xt.SafeBorderPadding*2),h:Math.floor(n.height+Xt.SafeBorderPadding*2)};}}}]);}();nt(Xt,"SafeBorderPadding",10);var yt=Xt;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(o){return e[o];}.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 K;}),t.d(r,"helpers",function(){return W;}),t.d(r,"createElement",function(){return D;}),t.d(r,"isSpriteNode",function(){return I;}),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 o=t(219);t.d(r,"Block",function(){return o["default"];});var s=t(224);t.d(r,"Sprite",function(){return s["default"];});var f=t(226);t.d(r,"Path",function(){return f["default"];});var p=t(229);t.d(r,"Rect",function(){return p["default"];});var c=t(231);t.d(r,"Triangle",function(){return c["default"];});var v=t(236);t.d(r,"Parallel",function(){return v["default"];});var S=t(238);t.d(r,"Regular",function(){return S["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 l=t(232);t.d(r,"Polyline",function(){return l["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 R=t(290);t.d(r,"Scene",function(){return R["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,I=b["default"].isSpriteNode,C=b["default"].registerNode,W={parseColor:E.parseColor,sizeToPixel:L.sizeToPixel,toArray:L.toArray,toString:L.toString,toNumber:L.toNumber};var G;G="3.8.3";var K=G;},/* 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 o=t(6);t.d(r,"mat4",function(){return o;});var s=t(7);t.d(r,"quat",function(){return s;});var f=t(10);t.d(r,"quat2",function(){return f;});var p=t(11);t.d(r,"vec2",function(){return p;});var c=t(8);t.d(r,"vec3",function(){return c;});var v=t(9);t.d(r,"vec4",function(){return v;});},/* 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 s;}),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(p){n=p;}var o=Math.PI/180;function s(p){return p*o;}function f(p,c){return Math.abs(p-c)<=e*Math.max(1,Math.abs(p),Math.abs(c));}Math.hypot||(Math.hypot=function(){for(var p=0,c=arguments.length;c--;)p+=arguments[c]*arguments[c];return Math.sqrt(p);});},/* 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 o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return f;}),t.d(r,"transpose",function(){return p;}),t.d(r,"invert",function(){return c;}),t.d(r,"adjoint",function(){return v;}),t.d(r,"determinant",function(){return S;}),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 l;}),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 R;}),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 I;});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 o(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=1,C;}function s(C,W,G,K){var J=new e.ARRAY_TYPE(4);return J[0]=C,J[1]=W,J[2]=G,J[3]=K,J;}function f(C,W,G,K,J){return C[0]=W,C[1]=G,C[2]=K,C[3]=J,C;}function p(C,W){if(C===W){var G=W[1];C[1]=W[2],C[2]=G;}else C[0]=W[0],C[1]=W[2],C[2]=W[1],C[3]=W[3];return C;}function c(C,W){var G=W[0],K=W[1],J=W[2],Z=W[3],B=G*Z-J*K;return B?(B=1/B,C[0]=Z*B,C[1]=-K*B,C[2]=-J*B,C[3]=G*B,C):null;}function v(C,W){var G=W[0];return C[0]=W[3],C[1]=-W[1],C[2]=-W[2],C[3]=G,C;}function S(C){return C[0]*C[3]-C[2]*C[1];}function O(C,W,G){var K=W[0],J=W[1],Z=W[2],B=W[3],$=G[0],Q=G[1],et=G[2],tt=G[3];return C[0]=K*$+Z*Q,C[1]=J*$+B*Q,C[2]=K*et+Z*tt,C[3]=J*et+B*tt,C;}function x(C,W,G){var K=W[0],J=W[1],Z=W[2],B=W[3],$=Math.sin(G),Q=Math.cos(G);return C[0]=K*Q+Z*$,C[1]=J*Q+B*$,C[2]=K*-$+Z*Q,C[3]=J*-$+B*Q,C;}function m(C,W,G){var K=W[0],J=W[1],Z=W[2],B=W[3],$=G[0],Q=G[1];return C[0]=K*$,C[1]=J*$,C[2]=Z*Q,C[3]=B*Q,C;}function T(C,W){var G=Math.sin(W),K=Math.cos(W);return C[0]=K,C[1]=G,C[2]=-G,C[3]=K,C;}function l(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,G,K){return C[2]=K[2]/K[0],G[0]=K[0],G[1]=K[1],G[3]=K[3]-C[2]*G[1],[C,W,G];}function M(C,W,G){return C[0]=W[0]+G[0],C[1]=W[1]+G[1],C[2]=W[2]+G[2],C[3]=W[3]+G[3],C;}function A(C,W,G){return C[0]=W[0]-G[0],C[1]=W[1]-G[1],C[2]=W[2]-G[2],C[3]=W[3]-G[3],C;}function R(C,W){return C[0]===W[0]&&C[1]===W[1]&&C[2]===W[2]&&C[3]===W[3];}function b(C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=W[0],$=W[1],Q=W[2],et=W[3];return Math.abs(G-B)<=e.EPSILON*Math.max(1,Math.abs(G),Math.abs(B))&&Math.abs(K-$)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs($))&&Math.abs(J-Q)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(Q))&&Math.abs(Z-et)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(et));}function E(C,W,G){return C[0]=W[0]*G,C[1]=W[1]*G,C[2]=W[2]*G,C[3]=W[3]*G,C;}function L(C,W,G,K){return C[0]=W[0]+G[0]*K,C[1]=W[1]+G[1]*K,C[2]=W[2]+G[2]*K,C[3]=W[3]+G[3]*K,C;}var D=O,I=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 o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return f;}),t.d(r,"invert",function(){return p;}),t.d(r,"determinant",function(){return c;}),t.d(r,"multiply",function(){return v;}),t.d(r,"rotate",function(){return S;}),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 l;}),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 R;}),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 I=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(I[1]=0,I[2]=0,I[4]=0,I[5]=0),I[0]=1,I[3]=1,I;}function i(I){var C=new e.ARRAY_TYPE(6);return C[0]=I[0],C[1]=I[1],C[2]=I[2],C[3]=I[3],C[4]=I[4],C[5]=I[5],C;}function a(I,C){return I[0]=C[0],I[1]=C[1],I[2]=C[2],I[3]=C[3],I[4]=C[4],I[5]=C[5],I;}function o(I){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=0,I[5]=0,I;}function s(I,C,W,G,K,J){var Z=new e.ARRAY_TYPE(6);return Z[0]=I,Z[1]=C,Z[2]=W,Z[3]=G,Z[4]=K,Z[5]=J,Z;}function f(I,C,W,G,K,J,Z){return I[0]=C,I[1]=W,I[2]=G,I[3]=K,I[4]=J,I[5]=Z,I;}function p(I,C){var W=C[0],G=C[1],K=C[2],J=C[3],Z=C[4],B=C[5],$=W*J-G*K;return $?($=1/$,I[0]=J*$,I[1]=-G*$,I[2]=-K*$,I[3]=W*$,I[4]=(K*B-J*Z)*$,I[5]=(G*Z-W*B)*$,I):null;}function c(I){return I[0]*I[3]-I[1]*I[2];}function v(I,C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=C[4],$=C[5],Q=W[0],et=W[1],tt=W[2],ot=W[3],q=W[4],gt=W[5];return I[0]=G*Q+J*et,I[1]=K*Q+Z*et,I[2]=G*tt+J*ot,I[3]=K*tt+Z*ot,I[4]=G*q+J*gt+B,I[5]=K*q+Z*gt+$,I;}function S(I,C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=C[4],$=C[5],Q=Math.sin(W),et=Math.cos(W);return I[0]=G*et+J*Q,I[1]=K*et+Z*Q,I[2]=G*-Q+J*et,I[3]=K*-Q+Z*et,I[4]=B,I[5]=$,I;}function O(I,C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=C[4],$=C[5],Q=W[0],et=W[1];return I[0]=G*Q,I[1]=K*Q,I[2]=J*et,I[3]=Z*et,I[4]=B,I[5]=$,I;}function x(I,C,W){var G=C[0],K=C[1],J=C[2],Z=C[3],B=C[4],$=C[5],Q=W[0],et=W[1];return I[0]=G,I[1]=K,I[2]=J,I[3]=Z,I[4]=G*Q+J*et+B,I[5]=K*Q+Z*et+$,I;}function m(I,C){var W=Math.sin(C),G=Math.cos(C);return I[0]=G,I[1]=W,I[2]=-W,I[3]=G,I[4]=0,I[5]=0,I;}function T(I,C){return I[0]=C[0],I[1]=0,I[2]=0,I[3]=C[1],I[4]=0,I[5]=0,I;}function l(I,C){return I[0]=1,I[1]=0,I[2]=0,I[3]=1,I[4]=C[0],I[5]=C[1],I;}function d(I){return"mat2d("+I[0]+", "+I[1]+", "+I[2]+", "+I[3]+", "+I[4]+", "+I[5]+")";}function u(I){return Math.hypot(I[0],I[1],I[2],I[3],I[4],I[5],1);}function g(I,C,W){return I[0]=C[0]+W[0],I[1]=C[1]+W[1],I[2]=C[2]+W[2],I[3]=C[3]+W[3],I[4]=C[4]+W[4],I[5]=C[5]+W[5],I;}function M(I,C,W){return I[0]=C[0]-W[0],I[1]=C[1]-W[1],I[2]=C[2]-W[2],I[3]=C[3]-W[3],I[4]=C[4]-W[4],I[5]=C[5]-W[5],I;}function A(I,C,W){return I[0]=C[0]*W,I[1]=C[1]*W,I[2]=C[2]*W,I[3]=C[3]*W,I[4]=C[4]*W,I[5]=C[5]*W,I;}function R(I,C,W,G){return I[0]=C[0]+W[0]*G,I[1]=C[1]+W[1]*G,I[2]=C[2]+W[2]*G,I[3]=C[3]+W[3]*G,I[4]=C[4]+W[4]*G,I[5]=C[5]+W[5]*G,I;}function b(I,C){return I[0]===C[0]&&I[1]===C[1]&&I[2]===C[2]&&I[3]===C[3]&&I[4]===C[4]&&I[5]===C[5];}function E(I,C){var W=I[0],G=I[1],K=I[2],J=I[3],Z=I[4],B=I[5],$=C[0],Q=C[1],et=C[2],tt=C[3],ot=C[4],q=C[5];return Math.abs(W-$)<=e.EPSILON*Math.max(1,Math.abs(W),Math.abs($))&&Math.abs(G-Q)<=e.EPSILON*Math.max(1,Math.abs(G),Math.abs(Q))&&Math.abs(K-et)<=e.EPSILON*Math.max(1,Math.abs(K),Math.abs(et))&&Math.abs(J-tt)<=e.EPSILON*Math.max(1,Math.abs(J),Math.abs(tt))&&Math.abs(Z-ot)<=e.EPSILON*Math.max(1,Math.abs(Z),Math.abs(ot))&&Math.abs(B-q)<=e.EPSILON*Math.max(1,Math.abs(B),Math.abs(q));}var L=v,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 o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"set",function(){return f;}),t.d(r,"identity",function(){return p;}),t.d(r,"transpose",function(){return c;}),t.d(r,"invert",function(){return v;}),t.d(r,"adjoint",function(){return S;}),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 l;}),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 R;}),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 I;}),t.d(r,"multiplyScalar",function(){return C;}),t.d(r,"multiplyScalarAndAdd",function(){return W;}),t.d(r,"exactEquals",function(){return G;}),t.d(r,"equals",function(){return K;}),t.d(r,"mul",function(){return J;}),t.d(r,"sub",function(){return Z;});var e=t(2);function n(){var B=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(B[1]=0,B[2]=0,B[3]=0,B[5]=0,B[6]=0,B[7]=0),B[0]=1,B[4]=1,B[8]=1,B;}function i(B,$){return B[0]=$[0],B[1]=$[1],B[2]=$[2],B[3]=$[4],B[4]=$[5],B[5]=$[6],B[6]=$[8],B[7]=$[9],B[8]=$[10],B;}function a(B){var $=new e.ARRAY_TYPE(9);return $[0]=B[0],$[1]=B[1],$[2]=B[2],$[3]=B[3],$[4]=B[4],$[5]=B[5],$[6]=B[6],$[7]=B[7],$[8]=B[8],$;}function o(B,$){return B[0]=$[0],B[1]=$[1],B[2]=$[2],B[3]=$[3],B[4]=$[4],B[5]=$[5],B[6]=$[6],B[7]=$[7],B[8]=$[8],B;}function s(B,$,Q,et,tt,ot,q,gt,dt){var F=new e.ARRAY_TYPE(9);return F[0]=B,F[1]=$,F[2]=Q,F[3]=et,F[4]=tt,F[5]=ot,F[6]=q,F[7]=gt,F[8]=dt,F;}function f(B,$,Q,et,tt,ot,q,gt,dt,F){return B[0]=$,B[1]=Q,B[2]=et,B[3]=tt,B[4]=ot,B[5]=q,B[6]=gt,B[7]=dt,B[8]=F,B;}function p(B){return B[0]=1,B[1]=0,B[2]=0,B[3]=0,B[4]=1,B[5]=0,B[6]=0,B[7]=0,B[8]=1,B;}function c(B,$){if(B===$){var Q=$[1],et=$[2],tt=$[5];B[1]=$[3],B[2]=$[6],B[3]=Q,B[5]=$[7],B[6]=et,B[7]=tt;}else B[0]=$[0],B[1]=$[3],B[2]=$[6],B[3]=$[1],B[4]=$[4],B[5]=$[7],B[6]=$[2],B[7]=$[5],B[8]=$[8];return B;}function v(B,$){var Q=$[0],et=$[1],tt=$[2],ot=$[3],q=$[4],gt=$[5],dt=$[6],F=$[7],j=$[8],V=j*q-gt*F,X=-j*ot+gt*dt,N=F*ot-q*dt,z=Q*V+et*X+tt*N;return z?(z=1/z,B[0]=V*z,B[1]=(-j*et+tt*F)*z,B[2]=(gt*et-tt*q)*z,B[3]=X*z,B[4]=(j*Q-tt*dt)*z,B[5]=(-gt*Q+tt*ot)*z,B[6]=N*z,B[7]=(-F*Q+et*dt)*z,B[8]=(q*Q-et*ot)*z,B):null;}function S(B,$){var Q=$[0],et=$[1],tt=$[2],ot=$[3],q=$[4],gt=$[5],dt=$[6],F=$[7],j=$[8];return B[0]=q*j-gt*F,B[1]=tt*F-et*j,B[2]=et*gt-tt*q,B[3]=gt*dt-ot*j,B[4]=Q*j-tt*dt,B[5]=tt*ot-Q*gt,B[6]=ot*F-q*dt,B[7]=et*dt-Q*F,B[8]=Q*q-et*ot,B;}function O(B){var $=B[0],Q=B[1],et=B[2],tt=B[3],ot=B[4],q=B[5],gt=B[6],dt=B[7],F=B[8];return $*(F*ot-q*dt)+Q*(-F*tt+q*gt)+et*(dt*tt-ot*gt);}function x(B,$,Q){var et=$[0],tt=$[1],ot=$[2],q=$[3],gt=$[4],dt=$[5],F=$[6],j=$[7],V=$[8],X=Q[0],N=Q[1],z=Q[2],y=Q[3],P=Q[4],w=Q[5],U=Q[6],H=Q[7],Y=Q[8];return B[0]=X*et+N*q+z*F,B[1]=X*tt+N*gt+z*j,B[2]=X*ot+N*dt+z*V,B[3]=y*et+P*q+w*F,B[4]=y*tt+P*gt+w*j,B[5]=y*ot+P*dt+w*V,B[6]=U*et+H*q+Y*F,B[7]=U*tt+H*gt+Y*j,B[8]=U*ot+H*dt+Y*V,B;}function m(B,$,Q){var et=$[0],tt=$[1],ot=$[2],q=$[3],gt=$[4],dt=$[5],F=$[6],j=$[7],V=$[8],X=Q[0],N=Q[1];return B[0]=et,B[1]=tt,B[2]=ot,B[3]=q,B[4]=gt,B[5]=dt,B[6]=X*et+N*q+F,B[7]=X*tt+N*gt+j,B[8]=X*ot+N*dt+V,B;}function T(B,$,Q){var et=$[0],tt=$[1],ot=$[2],q=$[3],gt=$[4],dt=$[5],F=$[6],j=$[7],V=$[8],X=Math.sin(Q),N=Math.cos(Q);return B[0]=N*et+X*q,B[1]=N*tt+X*gt,B[2]=N*ot+X*dt,B[3]=N*q-X*et,B[4]=N*gt-X*tt,B[5]=N*dt-X*ot,B[6]=F,B[7]=j,B[8]=V,B;}function l(B,$,Q){var et=Q[0],tt=Q[1];return B[0]=et*$[0],B[1]=et*$[1],B[2]=et*$[2],B[3]=tt*$[3],B[4]=tt*$[4],B[5]=tt*$[5],B[6]=$[6],B[7]=$[7],B[8]=$[8],B;}function d(B,$){return B[0]=1,B[1]=0,B[2]=0,B[3]=0,B[4]=1,B[5]=0,B[6]=$[0],B[7]=$[1],B[8]=1,B;}function u(B,$){var Q=Math.sin($),et=Math.cos($);return B[0]=et,B[1]=Q,B[2]=0,B[3]=-Q,B[4]=et,B[5]=0,B[6]=0,B[7]=0,B[8]=1,B;}function g(B,$){return B[0]=$[0],B[1]=0,B[2]=0,B[3]=0,B[4]=$[1],B[5]=0,B[6]=0,B[7]=0,B[8]=1,B;}function M(B,$){return B[0]=$[0],B[1]=$[1],B[2]=0,B[3]=$[2],B[4]=$[3],B[5]=0,B[6]=$[4],B[7]=$[5],B[8]=1,B;}function A(B,$){var Q=$[0],et=$[1],tt=$[2],ot=$[3],q=Q+Q,gt=et+et,dt=tt+tt,F=Q*q,j=et*q,V=et*gt,X=tt*q,N=tt*gt,z=tt*dt,y=ot*q,P=ot*gt,w=ot*dt;return B[0]=1-V-z,B[3]=j-w,B[6]=X+P,B[1]=j+w,B[4]=1-F-z,B[7]=N-y,B[2]=X-P,B[5]=N+y,B[8]=1-F-V,B;}function R(B,$){var Q=$[0],et=$[1],tt=$[2],ot=$[3],q=$[4],gt=$[5],dt=$[6],F=$[7],j=$[8],V=$[9],X=$[10],N=$[11],z=$[12],y=$[13],P=$[14],w=$[15],U=Q*gt-et*q,H=Q*dt-tt*q,Y=Q*F-ot*q,k=et*dt-tt*gt,rt=et*F-ot*gt,it=tt*F-ot*dt,lt=j*y-V*z,ut=j*P-X*z,at=j*w-N*z,st=V*P-X*y,ft=V*w-N*y,vt=X*w-N*P,mt=U*vt-H*ft+Y*st+k*at-rt*ut+it*lt;return mt?(mt=1/mt,B[0]=(gt*vt-dt*ft+F*st)*mt,B[1]=(dt*at-q*vt-F*ut)*mt,B[2]=(q*ft-gt*at+F*lt)*mt,B[3]=(tt*ft-et*vt-ot*st)*mt,B[4]=(Q*vt-tt*at+ot*ut)*mt,B[5]=(et*at-Q*ft-ot*lt)*mt,B[6]=(y*it-P*rt+w*k)*mt,B[7]=(P*Y-z*it-w*H)*mt,B[8]=(z*rt-y*Y+w*U)*mt,B):null;}function b(B,$,Q){return B[0]=2/$,B[1]=0,B[2]=0,B[3]=0,B[4]=-2/Q,B[5]=0,B[6]=-1,B[7]=1,B[8]=1,B;}function E(B){return"mat3("+B[0]+", "+B[1]+", "+B[2]+", "+B[3]+", "+B[4]+", "+B[5]+", "+B[6]+", "+B[7]+", "+B[8]+")";}function L(B){return Math.hypot(B[0],B[1],B[2],B[3],B[4],B[5],B[6],B[7],B[8]);}function D(B,$,Q){return B[0]=$[0]+Q[0],B[1]=$[1]+Q[1],B[2]=$[2]+Q[2],B[3]=$[3]+Q[3],B[4]=$[4]+Q[4],B[5]=$[5]+Q[5],B[6]=$[6]+Q[6],B[7]=$[7]+Q[7],B[8]=$[8]+Q[8],B;}function I(B,$,Q){return B[0]=$[0]-Q[0],B[1]=$[1]-Q[1],B[2]=$[2]-Q[2],B[3]=$[3]-Q[3],B[4]=$[4]-Q[4],B[5]=$[5]-Q[5],B[6]=$[6]-Q[6],B[7]=$[7]-Q[7],B[8]=$[8]-Q[8],B;}function C(B,$,Q){return B[0]=$[0]*Q,B[1]=$[1]*Q,B[2]=$[2]*Q,B[3]=$[3]*Q,B[4]=$[4]*Q,B[5]=$[5]*Q,B[6]=$[6]*Q,B[7]=$[7]*Q,B[8]=$[8]*Q,B;}function W(B,$,Q,et){return B[0]=$[0]+Q[0]*et,B[1]=$[1]+Q[1]*et,B[2]=$[2]+Q[2]*et,B[3]=$[3]+Q[3]*et,B[4]=$[4]+Q[4]*et,B[5]=$[5]+Q[5]*et,B[6]=$[6]+Q[6]*et,B[7]=$[7]+Q[7]*et,B[8]=$[8]+Q[8]*et,B;}function G(B,$){return B[0]===$[0]&&B[1]===$[1]&&B[2]===$[2]&&B[3]===$[3]&&B[4]===$[4]&&B[5]===$[5]&&B[6]===$[6]&&B[7]===$[7]&&B[8]===$[8];}function K(B,$){var Q=B[0],et=B[1],tt=B[2],ot=B[3],q=B[4],gt=B[5],dt=B[6],F=B[7],j=B[8],V=$[0],X=$[1],N=$[2],z=$[3],y=$[4],P=$[5],w=$[6],U=$[7],H=$[8];return Math.abs(Q-V)<=e.EPSILON*Math.max(1,Math.abs(Q),Math.abs(V))&&Math.abs(et-X)<=e.EPSILON*Math.max(1,Math.abs(et),Math.abs(X))&&Math.abs(tt-N)<=e.EPSILON*Math.max(1,Math.abs(tt),Math.abs(N))&&Math.abs(ot-z)<=e.EPSILON*Math.max(1,Math.abs(ot),Math.abs(z))&&Math.abs(q-y)<=e.EPSILON*Math.max(1,Math.abs(q),Math.abs(y))&&Math.abs(gt-P)<=e.EPSILON*Math.max(1,Math.abs(gt),Math.abs(P))&&Math.abs(dt-w)<=e.EPSILON*Math.max(1,Math.abs(dt),Math.abs(w))&&Math.abs(F-U)<=e.EPSILON*Math.max(1,Math.abs(F),Math.abs(U))&&Math.abs(j-H)<=e.EPSILON*Math.max(1,Math.abs(j),Math.abs(H));}var J=x,Z=I;},/* 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 o;}),t.d(r,"set",function(){return s;}),t.d(r,"identity",function(){return f;}),t.d(r,"transpose",function(){return p;}),t.d(r,"invert",function(){return c;}),t.d(r,"adjoint",function(){return v;}),t.d(r,"determinant",function(){return S;}),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 l;}),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 R;}),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 I;}),t.d(r,"getScaling",function(){return C;}),t.d(r,"getRotation",function(){return W;}),t.d(r,"fromRotationTranslationScale",function(){return G;}),t.d(r,"fromRotationTranslationScaleOrigin",function(){return K;}),t.d(r,"fromQuat",function(){return J;}),t.d(r,"frustum",function(){return Z;}),t.d(r,"perspective",function(){return B;}),t.d(r,"perspectiveFromFieldOfView",function(){return $;}),t.d(r,"ortho",function(){return Q;}),t.d(r,"lookAt",function(){return et;}),t.d(r,"targetTo",function(){return tt;}),t.d(r,"str",function(){return ot;}),t.d(r,"frob",function(){return q;}),t.d(r,"add",function(){return gt;}),t.d(r,"subtract",function(){return dt;}),t.d(r,"multiplyScalar",function(){return F;}),t.d(r,"multiplyScalarAndAdd",function(){return j;}),t.d(r,"exactEquals",function(){return V;}),t.d(r,"equals",function(){return X;}),t.d(r,"mul",function(){return N;}),t.d(r,"sub",function(){return z;});var e=t(2);function n(){var y=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[11]=0,y[12]=0,y[13]=0,y[14]=0),y[0]=1,y[5]=1,y[10]=1,y[15]=1,y;}function i(y){var P=new e.ARRAY_TYPE(16);return P[0]=y[0],P[1]=y[1],P[2]=y[2],P[3]=y[3],P[4]=y[4],P[5]=y[5],P[6]=y[6],P[7]=y[7],P[8]=y[8],P[9]=y[9],P[10]=y[10],P[11]=y[11],P[12]=y[12],P[13]=y[13],P[14]=y[14],P[15]=y[15],P;}function a(y,P){return y[0]=P[0],y[1]=P[1],y[2]=P[2],y[3]=P[3],y[4]=P[4],y[5]=P[5],y[6]=P[6],y[7]=P[7],y[8]=P[8],y[9]=P[9],y[10]=P[10],y[11]=P[11],y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15],y;}function o(y,P,w,U,H,Y,k,rt,it,lt,ut,at,st,ft,vt,mt){var pt=new e.ARRAY_TYPE(16);return pt[0]=y,pt[1]=P,pt[2]=w,pt[3]=U,pt[4]=H,pt[5]=Y,pt[6]=k,pt[7]=rt,pt[8]=it,pt[9]=lt,pt[10]=ut,pt[11]=at,pt[12]=st,pt[13]=ft,pt[14]=vt,pt[15]=mt,pt;}function s(y,P,w,U,H,Y,k,rt,it,lt,ut,at,st,ft,vt,mt,pt){return y[0]=P,y[1]=w,y[2]=U,y[3]=H,y[4]=Y,y[5]=k,y[6]=rt,y[7]=it,y[8]=lt,y[9]=ut,y[10]=at,y[11]=st,y[12]=ft,y[13]=vt,y[14]=mt,y[15]=pt,y;}function f(y){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function p(y,P){if(y===P){var w=P[1],U=P[2],H=P[3],Y=P[6],k=P[7],rt=P[11];y[1]=P[4],y[2]=P[8],y[3]=P[12],y[4]=w,y[6]=P[9],y[7]=P[13],y[8]=U,y[9]=Y,y[11]=P[14],y[12]=H,y[13]=k,y[14]=rt;}else y[0]=P[0],y[1]=P[4],y[2]=P[8],y[3]=P[12],y[4]=P[1],y[5]=P[5],y[6]=P[9],y[7]=P[13],y[8]=P[2],y[9]=P[6],y[10]=P[10],y[11]=P[14],y[12]=P[3],y[13]=P[7],y[14]=P[11],y[15]=P[15];return y;}function c(y,P){var w=P[0],U=P[1],H=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],at=P[9],st=P[10],ft=P[11],vt=P[12],mt=P[13],pt=P[14],St=P[15],It=w*rt-U*k,Et=w*it-H*k,Pt=w*lt-Y*k,At=U*it-H*rt,Ct=U*lt-Y*rt,Gt=H*lt-Y*it,jt=ut*mt-at*vt,Ut=ut*pt-st*vt,zt=ut*St-ft*vt,Ht=at*pt-st*mt,Kt=at*St-ft*mt,Yt=st*St-ft*pt,bt=It*Yt-Et*Kt+Pt*Ht+At*zt-Ct*Ut+Gt*jt;return bt?(bt=1/bt,y[0]=(rt*Yt-it*Kt+lt*Ht)*bt,y[1]=(H*Kt-U*Yt-Y*Ht)*bt,y[2]=(mt*Gt-pt*Ct+St*At)*bt,y[3]=(st*Ct-at*Gt-ft*At)*bt,y[4]=(it*zt-k*Yt-lt*Ut)*bt,y[5]=(w*Yt-H*zt+Y*Ut)*bt,y[6]=(pt*Pt-vt*Gt-St*Et)*bt,y[7]=(ut*Gt-st*Pt+ft*Et)*bt,y[8]=(k*Kt-rt*zt+lt*jt)*bt,y[9]=(U*zt-w*Kt-Y*jt)*bt,y[10]=(vt*Ct-mt*Pt+St*It)*bt,y[11]=(at*Pt-ut*Ct-ft*It)*bt,y[12]=(rt*Ut-k*Ht-it*jt)*bt,y[13]=(w*Ht-U*Ut+H*jt)*bt,y[14]=(mt*Et-vt*At-pt*It)*bt,y[15]=(ut*At-at*Et+st*It)*bt,y):null;}function v(y,P){var w=P[0],U=P[1],H=P[2],Y=P[3],k=P[4],rt=P[5],it=P[6],lt=P[7],ut=P[8],at=P[9],st=P[10],ft=P[11],vt=P[12],mt=P[13],pt=P[14],St=P[15];return y[0]=rt*(st*St-ft*pt)-at*(it*St-lt*pt)+mt*(it*ft-lt*st),y[1]=-(U*(st*St-ft*pt)-at*(H*St-Y*pt)+mt*(H*ft-Y*st)),y[2]=U*(it*St-lt*pt)-rt*(H*St-Y*pt)+mt*(H*lt-Y*it),y[3]=-(U*(it*ft-lt*st)-rt*(H*ft-Y*st)+at*(H*lt-Y*it)),y[4]=-(k*(st*St-ft*pt)-ut*(it*St-lt*pt)+vt*(it*ft-lt*st)),y[5]=w*(st*St-ft*pt)-ut*(H*St-Y*pt)+vt*(H*ft-Y*st),y[6]=-(w*(it*St-lt*pt)-k*(H*St-Y*pt)+vt*(H*lt-Y*it)),y[7]=w*(it*ft-lt*st)-k*(H*ft-Y*st)+ut*(H*lt-Y*it),y[8]=k*(at*St-ft*mt)-ut*(rt*St-lt*mt)+vt*(rt*ft-lt*at),y[9]=-(w*(at*St-ft*mt)-ut*(U*St-Y*mt)+vt*(U*ft-Y*at)),y[10]=w*(rt*St-lt*mt)-k*(U*St-Y*mt)+vt*(U*lt-Y*rt),y[11]=-(w*(rt*ft-lt*at)-k*(U*ft-Y*at)+ut*(U*lt-Y*rt)),y[12]=-(k*(at*pt-st*mt)-ut*(rt*pt-it*mt)+vt*(rt*st-it*at)),y[13]=w*(at*pt-st*mt)-ut*(U*pt-H*mt)+vt*(U*st-H*at),y[14]=-(w*(rt*pt-it*mt)-k*(U*pt-H*mt)+vt*(U*it-H*rt)),y[15]=w*(rt*st-it*at)-k*(U*st-H*at)+ut*(U*it-H*rt),y;}function S(y){var P=y[0],w=y[1],U=y[2],H=y[3],Y=y[4],k=y[5],rt=y[6],it=y[7],lt=y[8],ut=y[9],at=y[10],st=y[11],ft=y[12],vt=y[13],mt=y[14],pt=y[15],St=P*k-w*Y,It=P*rt-U*Y,Et=P*it-H*Y,Pt=w*rt-U*k,At=w*it-H*k,Ct=U*it-H*rt,Gt=lt*vt-ut*ft,jt=lt*mt-at*ft,Ut=lt*pt-st*ft,zt=ut*mt-at*vt,Ht=ut*pt-st*vt,Kt=at*pt-st*mt;return St*Kt-It*Ht+Et*zt+Pt*Ut-At*jt+Ct*Gt;}function O(y,P,w){var U=P[0],H=P[1],Y=P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],at=P[8],st=P[9],ft=P[10],vt=P[11],mt=P[12],pt=P[13],St=P[14],It=P[15],Et=w[0],Pt=w[1],At=w[2],Ct=w[3];return y[0]=Et*U+Pt*rt+At*at+Ct*mt,y[1]=Et*H+Pt*it+At*st+Ct*pt,y[2]=Et*Y+Pt*lt+At*ft+Ct*St,y[3]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[4],Pt=w[5],At=w[6],Ct=w[7],y[4]=Et*U+Pt*rt+At*at+Ct*mt,y[5]=Et*H+Pt*it+At*st+Ct*pt,y[6]=Et*Y+Pt*lt+At*ft+Ct*St,y[7]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[8],Pt=w[9],At=w[10],Ct=w[11],y[8]=Et*U+Pt*rt+At*at+Ct*mt,y[9]=Et*H+Pt*it+At*st+Ct*pt,y[10]=Et*Y+Pt*lt+At*ft+Ct*St,y[11]=Et*k+Pt*ut+At*vt+Ct*It,Et=w[12],Pt=w[13],At=w[14],Ct=w[15],y[12]=Et*U+Pt*rt+At*at+Ct*mt,y[13]=Et*H+Pt*it+At*st+Ct*pt,y[14]=Et*Y+Pt*lt+At*ft+Ct*St,y[15]=Et*k+Pt*ut+At*vt+Ct*It,y;}function x(y,P,w){var U=w[0],H=w[1],Y=w[2],k,rt,it,lt,ut,at,st,ft,vt,mt,pt,St;return P===y?(y[12]=P[0]*U+P[4]*H+P[8]*Y+P[12],y[13]=P[1]*U+P[5]*H+P[9]*Y+P[13],y[14]=P[2]*U+P[6]*H+P[10]*Y+P[14],y[15]=P[3]*U+P[7]*H+P[11]*Y+P[15]):(k=P[0],rt=P[1],it=P[2],lt=P[3],ut=P[4],at=P[5],st=P[6],ft=P[7],vt=P[8],mt=P[9],pt=P[10],St=P[11],y[0]=k,y[1]=rt,y[2]=it,y[3]=lt,y[4]=ut,y[5]=at,y[6]=st,y[7]=ft,y[8]=vt,y[9]=mt,y[10]=pt,y[11]=St,y[12]=k*U+ut*H+vt*Y+P[12],y[13]=rt*U+at*H+mt*Y+P[13],y[14]=it*U+st*H+pt*Y+P[14],y[15]=lt*U+ft*H+St*Y+P[15]),y;}function m(y,P,w){var U=w[0],H=w[1],Y=w[2];return y[0]=P[0]*U,y[1]=P[1]*U,y[2]=P[2]*U,y[3]=P[3]*U,y[4]=P[4]*H,y[5]=P[5]*H,y[6]=P[6]*H,y[7]=P[7]*H,y[8]=P[8]*Y,y[9]=P[9]*Y,y[10]=P[10]*Y,y[11]=P[11]*Y,y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15],y;}function T(y,P,w,U){var H=U[0],Y=U[1],k=U[2],rt=Math.hypot(H,Y,k),it,lt,ut,at,st,ft,vt,mt,pt,St,It,Et,Pt,At,Ct,Gt,jt,Ut,zt,Ht,Kt,Yt,bt,Qt;return rt<e.EPSILON?null:(rt=1/rt,H*=rt,Y*=rt,k*=rt,it=Math.sin(w),lt=Math.cos(w),ut=1-lt,at=P[0],st=P[1],ft=P[2],vt=P[3],mt=P[4],pt=P[5],St=P[6],It=P[7],Et=P[8],Pt=P[9],At=P[10],Ct=P[11],Gt=H*H*ut+lt,jt=Y*H*ut+k*it,Ut=k*H*ut-Y*it,zt=H*Y*ut-k*it,Ht=Y*Y*ut+lt,Kt=k*Y*ut+H*it,Yt=H*k*ut+Y*it,bt=Y*k*ut-H*it,Qt=k*k*ut+lt,y[0]=at*Gt+mt*jt+Et*Ut,y[1]=st*Gt+pt*jt+Pt*Ut,y[2]=ft*Gt+St*jt+At*Ut,y[3]=vt*Gt+It*jt+Ct*Ut,y[4]=at*zt+mt*Ht+Et*Kt,y[5]=st*zt+pt*Ht+Pt*Kt,y[6]=ft*zt+St*Ht+At*Kt,y[7]=vt*zt+It*Ht+Ct*Kt,y[8]=at*Yt+mt*bt+Et*Qt,y[9]=st*Yt+pt*bt+Pt*Qt,y[10]=ft*Yt+St*bt+At*Qt,y[11]=vt*Yt+It*bt+Ct*Qt,P!==y&&(y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15]),y);}function l(y,P,w){var U=Math.sin(w),H=Math.cos(w),Y=P[4],k=P[5],rt=P[6],it=P[7],lt=P[8],ut=P[9],at=P[10],st=P[11];return P!==y&&(y[0]=P[0],y[1]=P[1],y[2]=P[2],y[3]=P[3],y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15]),y[4]=Y*H+lt*U,y[5]=k*H+ut*U,y[6]=rt*H+at*U,y[7]=it*H+st*U,y[8]=lt*H-Y*U,y[9]=ut*H-k*U,y[10]=at*H-rt*U,y[11]=st*H-it*U,y;}function d(y,P,w){var U=Math.sin(w),H=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[8],ut=P[9],at=P[10],st=P[11];return P!==y&&(y[4]=P[4],y[5]=P[5],y[6]=P[6],y[7]=P[7],y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15]),y[0]=Y*H-lt*U,y[1]=k*H-ut*U,y[2]=rt*H-at*U,y[3]=it*H-st*U,y[8]=Y*U+lt*H,y[9]=k*U+ut*H,y[10]=rt*U+at*H,y[11]=it*U+st*H,y;}function u(y,P,w){var U=Math.sin(w),H=Math.cos(w),Y=P[0],k=P[1],rt=P[2],it=P[3],lt=P[4],ut=P[5],at=P[6],st=P[7];return P!==y&&(y[8]=P[8],y[9]=P[9],y[10]=P[10],y[11]=P[11],y[12]=P[12],y[13]=P[13],y[14]=P[14],y[15]=P[15]),y[0]=Y*H+lt*U,y[1]=k*H+ut*U,y[2]=rt*H+at*U,y[3]=it*H+st*U,y[4]=lt*H-Y*U,y[5]=ut*H-k*U,y[6]=at*H-rt*U,y[7]=st*H-it*U,y;}function g(y,P){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=P[0],y[13]=P[1],y[14]=P[2],y[15]=1,y;}function M(y,P){return y[0]=P[0],y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=P[1],y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=P[2],y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function A(y,P,w){var U=w[0],H=w[1],Y=w[2],k=Math.hypot(U,H,Y),rt,it,lt;return k<e.EPSILON?null:(k=1/k,U*=k,H*=k,Y*=k,rt=Math.sin(P),it=Math.cos(P),lt=1-it,y[0]=U*U*lt+it,y[1]=H*U*lt+Y*rt,y[2]=Y*U*lt-H*rt,y[3]=0,y[4]=U*H*lt-Y*rt,y[5]=H*H*lt+it,y[6]=Y*H*lt+U*rt,y[7]=0,y[8]=U*Y*lt+H*rt,y[9]=H*Y*lt-U*rt,y[10]=Y*Y*lt+it,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y);}function R(y,P){var w=Math.sin(P),U=Math.cos(P);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=U,y[6]=w,y[7]=0,y[8]=0,y[9]=-w,y[10]=U,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function b(y,P){var w=Math.sin(P),U=Math.cos(P);return y[0]=U,y[1]=0,y[2]=-w,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=w,y[9]=0,y[10]=U,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function E(y,P){var w=Math.sin(P),U=Math.cos(P);return y[0]=U,y[1]=w,y[2]=0,y[3]=0,y[4]=-w,y[5]=U,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function L(y,P,w){var U=P[0],H=P[1],Y=P[2],k=P[3],rt=U+U,it=H+H,lt=Y+Y,ut=U*rt,at=U*it,st=U*lt,ft=H*it,vt=H*lt,mt=Y*lt,pt=k*rt,St=k*it,It=k*lt;return y[0]=1-(ft+mt),y[1]=at+It,y[2]=st-St,y[3]=0,y[4]=at-It,y[5]=1-(ut+mt),y[6]=vt+pt,y[7]=0,y[8]=st+St,y[9]=vt-pt,y[10]=1-(ut+ft),y[11]=0,y[12]=w[0],y[13]=w[1],y[14]=w[2],y[15]=1,y;}function D(y,P){var w=new e.ARRAY_TYPE(3),U=-P[0],H=-P[1],Y=-P[2],k=P[3],rt=P[4],it=P[5],lt=P[6],ut=P[7],at=U*U+H*H+Y*Y+k*k;return at>0?(w[0]=(rt*k+ut*U+it*Y-lt*H)*2/at,w[1]=(it*k+ut*H+lt*U-rt*Y)*2/at,w[2]=(lt*k+ut*Y+rt*H-it*U)*2/at):(w[0]=(rt*k+ut*U+it*Y-lt*H)*2,w[1]=(it*k+ut*H+lt*U-rt*Y)*2,w[2]=(lt*k+ut*Y+rt*H-it*U)*2),L(y,P,w),y;}function I(y,P){return y[0]=P[12],y[1]=P[13],y[2]=P[14],y;}function C(y,P){var w=P[0],U=P[1],H=P[2],Y=P[4],k=P[5],rt=P[6],it=P[8],lt=P[9],ut=P[10];return y[0]=Math.hypot(w,U,H),y[1]=Math.hypot(Y,k,rt),y[2]=Math.hypot(it,lt,ut),y;}function W(y,P){var w=new e.ARRAY_TYPE(3);C(w,P);var U=1/w[0],H=1/w[1],Y=1/w[2],k=P[0]*U,rt=P[1]*H,it=P[2]*Y,lt=P[4]*U,ut=P[5]*H,at=P[6]*Y,st=P[8]*U,ft=P[9]*H,vt=P[10]*Y,mt=k+ut+vt,pt=0;return mt>0?(pt=Math.sqrt(mt+1)*2,y[3]=0.25*pt,y[0]=(at-ft)/pt,y[1]=(st-it)/pt,y[2]=(rt-lt)/pt):k>ut&&k>vt?(pt=Math.sqrt(1+k-ut-vt)*2,y[3]=(at-ft)/pt,y[0]=0.25*pt,y[1]=(rt+lt)/pt,y[2]=(st+it)/pt):ut>vt?(pt=Math.sqrt(1+ut-k-vt)*2,y[3]=(st-it)/pt,y[0]=(rt+lt)/pt,y[1]=0.25*pt,y[2]=(at+ft)/pt):(pt=Math.sqrt(1+vt-k-ut)*2,y[3]=(rt-lt)/pt,y[0]=(st+it)/pt,y[1]=(at+ft)/pt,y[2]=0.25*pt),y;}function G(y,P,w,U){var H=P[0],Y=P[1],k=P[2],rt=P[3],it=H+H,lt=Y+Y,ut=k+k,at=H*it,st=H*lt,ft=H*ut,vt=Y*lt,mt=Y*ut,pt=k*ut,St=rt*it,It=rt*lt,Et=rt*ut,Pt=U[0],At=U[1],Ct=U[2];return y[0]=(1-(vt+pt))*Pt,y[1]=(st+Et)*Pt,y[2]=(ft-It)*Pt,y[3]=0,y[4]=(st-Et)*At,y[5]=(1-(at+pt))*At,y[6]=(mt+St)*At,y[7]=0,y[8]=(ft+It)*Ct,y[9]=(mt-St)*Ct,y[10]=(1-(at+vt))*Ct,y[11]=0,y[12]=w[0],y[13]=w[1],y[14]=w[2],y[15]=1,y;}function K(y,P,w,U,H){var Y=P[0],k=P[1],rt=P[2],it=P[3],lt=Y+Y,ut=k+k,at=rt+rt,st=Y*lt,ft=Y*ut,vt=Y*at,mt=k*ut,pt=k*at,St=rt*at,It=it*lt,Et=it*ut,Pt=it*at,At=U[0],Ct=U[1],Gt=U[2],jt=H[0],Ut=H[1],zt=H[2],Ht=(1-(mt+St))*At,Kt=(ft+Pt)*At,Yt=(vt-Et)*At,bt=(ft-Pt)*Ct,Qt=(1-(st+St))*Ct,Ee=(pt+It)*Ct,Pe=(vt+Et)*Gt,Tr=(pt-It)*Gt,Mr=(1-(st+mt))*Gt;return y[0]=Ht,y[1]=Kt,y[2]=Yt,y[3]=0,y[4]=bt,y[5]=Qt,y[6]=Ee,y[7]=0,y[8]=Pe,y[9]=Tr,y[10]=Mr,y[11]=0,y[12]=w[0]+jt-(Ht*jt+bt*Ut+Pe*zt),y[13]=w[1]+Ut-(Kt*jt+Qt*Ut+Tr*zt),y[14]=w[2]+zt-(Yt*jt+Ee*Ut+Mr*zt),y[15]=1,y;}function J(y,P){var w=P[0],U=P[1],H=P[2],Y=P[3],k=w+w,rt=U+U,it=H+H,lt=w*k,ut=U*k,at=U*rt,st=H*k,ft=H*rt,vt=H*it,mt=Y*k,pt=Y*rt,St=Y*it;return y[0]=1-at-vt,y[1]=ut+St,y[2]=st-pt,y[3]=0,y[4]=ut-St,y[5]=1-lt-vt,y[6]=ft+mt,y[7]=0,y[8]=st+pt,y[9]=ft-mt,y[10]=1-lt-at,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y;}function Z(y,P,w,U,H,Y,k){var rt=1/(w-P),it=1/(H-U),lt=1/(Y-k);return y[0]=Y*2*rt,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=Y*2*it,y[6]=0,y[7]=0,y[8]=(w+P)*rt,y[9]=(H+U)*it,y[10]=(k+Y)*lt,y[11]=-1,y[12]=0,y[13]=0,y[14]=k*Y*2*lt,y[15]=0,y;}function B(y,P,w,U,H){var Y=1/Math.tan(P/2),k;return y[0]=Y/w,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=Y,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[11]=-1,y[12]=0,y[13]=0,y[15]=0,H!=null&&H!==1/0?(k=1/(U-H),y[10]=(H+U)*k,y[14]=2*H*U*k):(y[10]=-1,y[14]=-2*U),y;}function $(y,P,w,U){var H=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/(H+Y);return y[0]=it,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=lt,y[6]=0,y[7]=0,y[8]=-((k-rt)*it*0.5),y[9]=(H-Y)*lt*0.5,y[10]=U/(w-U),y[11]=-1,y[12]=0,y[13]=0,y[14]=U*w/(w-U),y[15]=0,y;}function Q(y,P,w,U,H,Y,k){var rt=1/(P-w),it=1/(U-H),lt=1/(Y-k);return y[0]=-2*rt,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=-2*it,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=2*lt,y[11]=0,y[12]=(P+w)*rt,y[13]=(H+U)*it,y[14]=(k+Y)*lt,y[15]=1,y;}function et(y,P,w,U){var H,Y,k,rt,it,lt,ut,at,st,ft,vt=P[0],mt=P[1],pt=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(pt-Ct)<e.EPSILON?f(y):(ut=vt-Pt,at=mt-At,st=pt-Ct,ft=1/Math.hypot(ut,at,st),ut*=ft,at*=ft,st*=ft,H=It*st-Et*at,Y=Et*ut-St*st,k=St*at-It*ut,ft=Math.hypot(H,Y,k),ft?(ft=1/ft,H*=ft,Y*=ft,k*=ft):(H=0,Y=0,k=0),rt=at*k-st*Y,it=st*H-ut*k,lt=ut*Y-at*H,ft=Math.hypot(rt,it,lt),ft?(ft=1/ft,rt*=ft,it*=ft,lt*=ft):(rt=0,it=0,lt=0),y[0]=H,y[1]=rt,y[2]=ut,y[3]=0,y[4]=Y,y[5]=it,y[6]=at,y[7]=0,y[8]=k,y[9]=lt,y[10]=st,y[11]=0,y[12]=-(H*vt+Y*mt+k*pt),y[13]=-(rt*vt+it*mt+lt*pt),y[14]=-(ut*vt+at*mt+st*pt),y[15]=1,y);}function tt(y,P,w,U){var H=P[0],Y=P[1],k=P[2],rt=U[0],it=U[1],lt=U[2],ut=H-w[0],at=Y-w[1],st=k-w[2],ft=ut*ut+at*at+st*st;ft>0&&(ft=1/Math.sqrt(ft),ut*=ft,at*=ft,st*=ft);var vt=it*st-lt*at,mt=lt*ut-rt*st,pt=rt*at-it*ut;return ft=vt*vt+mt*mt+pt*pt,ft>0&&(ft=1/Math.sqrt(ft),vt*=ft,mt*=ft,pt*=ft),y[0]=vt,y[1]=mt,y[2]=pt,y[3]=0,y[4]=at*pt-st*mt,y[5]=st*vt-ut*pt,y[6]=ut*mt-at*vt,y[7]=0,y[8]=ut,y[9]=at,y[10]=st,y[11]=0,y[12]=H,y[13]=Y,y[14]=k,y[15]=1,y;}function ot(y){return"mat4("+y[0]+", "+y[1]+", "+y[2]+", "+y[3]+", "+y[4]+", "+y[5]+", "+y[6]+", "+y[7]+", "+y[8]+", "+y[9]+", "+y[10]+", "+y[11]+", "+y[12]+", "+y[13]+", "+y[14]+", "+y[15]+")";}function q(y){return Math.hypot(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]);}function gt(y,P,w){return y[0]=P[0]+w[0],y[1]=P[1]+w[1],y[2]=P[2]+w[2],y[3]=P[3]+w[3],y[4]=P[4]+w[4],y[5]=P[5]+w[5],y[6]=P[6]+w[6],y[7]=P[7]+w[7],y[8]=P[8]+w[8],y[9]=P[9]+w[9],y[10]=P[10]+w[10],y[11]=P[11]+w[11],y[12]=P[12]+w[12],y[13]=P[13]+w[13],y[14]=P[14]+w[14],y[15]=P[15]+w[15],y;}function dt(y,P,w){return y[0]=P[0]-w[0],y[1]=P[1]-w[1],y[2]=P[2]-w[2],y[3]=P[3]-w[3],y[4]=P[4]-w[4],y[5]=P[5]-w[5],y[6]=P[6]-w[6],y[7]=P[7]-w[7],y[8]=P[8]-w[8],y[9]=P[9]-w[9],y[10]=P[10]-w[10],y[11]=P[11]-w[11],y[12]=P[12]-w[12],y[13]=P[13]-w[13],y[14]=P[14]-w[14],y[15]=P[15]-w[15],y;}function F(y,P,w){return y[0]=P[0]*w,y[1]=P[1]*w,y[2]=P[2]*w,y[3]=P[3]*w,y[4]=P[4]*w,y[5]=P[5]*w,y[6]=P[6]*w,y[7]=P[7]*w,y[8]=P[8]*w,y[9]=P[9]*w,y[10]=P[10]*w,y[11]=P[11]*w,y[12]=P[12]*w,y[13]=P[13]*w,y[14]=P[14]*w,y[15]=P[15]*w,y;}function j(y,P,w,U){return y[0]=P[0]+w[0]*U,y[1]=P[1]+w[1]*U,y[2]=P[2]+w[2]*U,y[3]=P[3]+w[3]*U,y[4]=P[4]+w[4]*U,y[5]=P[5]+w[5]*U,y[6]=P[6]+w[6]*U,y[7]=P[7]+w[7]*U,y[8]=P[8]+w[8]*U,y[9]=P[9]+w[9]*U,y[10]=P[10]+w[10]*U,y[11]=P[11]+w[11]*U,y[12]=P[12]+w[12]*U,y[13]=P[13]+w[13]*U,y[14]=P[14]+w[14]*U,y[15]=P[15]+w[15]*U,y;}function V(y,P){return y[0]===P[0]&&y[1]===P[1]&&y[2]===P[2]&&y[3]===P[3]&&y[4]===P[4]&&y[5]===P[5]&&y[6]===P[6]&&y[7]===P[7]&&y[8]===P[8]&&y[9]===P[9]&&y[10]===P[10]&&y[11]===P[11]&&y[12]===P[12]&&y[13]===P[13]&&y[14]===P[14]&&y[15]===P[15];}function X(y,P){var w=y[0],U=y[1],H=y[2],Y=y[3],k=y[4],rt=y[5],it=y[6],lt=y[7],ut=y[8],at=y[9],st=y[10],ft=y[11],vt=y[12],mt=y[13],pt=y[14],St=y[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],zt=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(H-Pt)<=e.EPSILON*Math.max(1,Math.abs(H),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-zt)<=e.EPSILON*Math.max(1,Math.abs(ut),Math.abs(zt))&&Math.abs(at-Ht)<=e.EPSILON*Math.max(1,Math.abs(at),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(pt-Ee)<=e.EPSILON*Math.max(1,Math.abs(pt),Math.abs(Ee))&&Math.abs(St-Pe)<=e.EPSILON*Math.max(1,Math.abs(St),Math.abs(Pe));}var N=O,z=dt;},/* 7 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return o;}),t.d(r,"identity",function(){return s;}),t.d(r,"setAxisAngle",function(){return f;}),t.d(r,"getAxisAngle",function(){return p;}),t.d(r,"getAngle",function(){return c;}),t.d(r,"multiply",function(){return v;}),t.d(r,"rotateX",function(){return S;}),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 l;}),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 R;}),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 I;}),t.d(r,"set",function(){return C;}),t.d(r,"add",function(){return W;}),t.d(r,"mul",function(){return G;}),t.d(r,"scale",function(){return K;}),t.d(r,"dot",function(){return J;}),t.d(r,"lerp",function(){return Z;}),t.d(r,"length",function(){return B;}),t.d(r,"len",function(){return $;}),t.d(r,"squaredLength",function(){return Q;}),t.d(r,"sqrLen",function(){return et;}),t.d(r,"normalize",function(){return tt;}),t.d(r,"exactEquals",function(){return ot;}),t.d(r,"equals",function(){return q;}),t.d(r,"rotationTo",function(){return gt;}),t.d(r,"sqlerp",function(){return dt;}),t.d(r,"setAxes",function(){return F;});var e=t(2),n=t(5),i=t(8),a=t(9);function o(){var j=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(j[0]=0,j[1]=0,j[2]=0),j[3]=1,j;}function s(j){return j[0]=0,j[1]=0,j[2]=0,j[3]=1,j;}function f(j,V,X){X=X*0.5;var N=Math.sin(X);return j[0]=N*V[0],j[1]=N*V[1],j[2]=N*V[2],j[3]=Math.cos(X),j;}function p(j,V){var X=Math.acos(V[3])*2,N=Math.sin(X/2);return N>e.EPSILON?(j[0]=V[0]/N,j[1]=V[1]/N,j[2]=V[2]/N):(j[0]=1,j[1]=0,j[2]=0),X;}function c(j,V){var X=J(j,V);return Math.acos(2*X*X-1);}function v(j,V,X){var N=V[0],z=V[1],y=V[2],P=V[3],w=X[0],U=X[1],H=X[2],Y=X[3];return j[0]=N*Y+P*w+z*H-y*U,j[1]=z*Y+P*U+y*w-N*H,j[2]=y*Y+P*H+N*U-z*w,j[3]=P*Y-N*w-z*U-y*H,j;}function S(j,V,X){X*=0.5;var N=V[0],z=V[1],y=V[2],P=V[3],w=Math.sin(X),U=Math.cos(X);return j[0]=N*U+P*w,j[1]=z*U+y*w,j[2]=y*U-z*w,j[3]=P*U-N*w,j;}function O(j,V,X){X*=0.5;var N=V[0],z=V[1],y=V[2],P=V[3],w=Math.sin(X),U=Math.cos(X);return j[0]=N*U-y*w,j[1]=z*U+P*w,j[2]=y*U+N*w,j[3]=P*U-z*w,j;}function x(j,V,X){X*=0.5;var N=V[0],z=V[1],y=V[2],P=V[3],w=Math.sin(X),U=Math.cos(X);return j[0]=N*U+z*w,j[1]=z*U-N*w,j[2]=y*U+P*w,j[3]=P*U-y*w,j;}function m(j,V){var X=V[0],N=V[1],z=V[2];return j[0]=X,j[1]=N,j[2]=z,j[3]=Math.sqrt(Math.abs(1-X*X-N*N-z*z)),j;}function T(j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=Math.sqrt(X*X+N*N+z*z),w=Math.exp(y),U=P>0?w*Math.sin(P)/P:0;return j[0]=X*U,j[1]=N*U,j[2]=z*U,j[3]=w*Math.cos(P),j;}function l(j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=Math.sqrt(X*X+N*N+z*z),w=P>0?Math.atan2(P,y)/P:0;return j[0]=X*w,j[1]=N*w,j[2]=z*w,j[3]=0.5*Math.log(X*X+N*N+z*z+y*y),j;}function d(j,V,X){return l(j,V),K(j,j,X),T(j,j),j;}function u(j,V,X,N){var z=V[0],y=V[1],P=V[2],w=V[3],U=X[0],H=X[1],Y=X[2],k=X[3],rt,it,lt,ut,at;return it=z*U+y*H+P*Y+w*k,it<0&&(it=-it,U=-U,H=-H,Y=-Y,k=-k),1-it>e.EPSILON?(rt=Math.acos(it),lt=Math.sin(rt),ut=Math.sin((1-N)*rt)/lt,at=Math.sin(N*rt)/lt):(ut=1-N,at=N),j[0]=ut*z+at*U,j[1]=ut*y+at*H,j[2]=ut*P+at*Y,j[3]=ut*w+at*k,j;}function g(j){var V=e.RANDOM(),X=e.RANDOM(),N=e.RANDOM(),z=Math.sqrt(1-V),y=Math.sqrt(V);return j[0]=z*Math.sin(2*Math.PI*X),j[1]=z*Math.cos(2*Math.PI*X),j[2]=y*Math.sin(2*Math.PI*N),j[3]=y*Math.cos(2*Math.PI*N),j;}function M(j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=X*X+N*N+z*z+y*y,w=P?1/P:0;return j[0]=-X*w,j[1]=-N*w,j[2]=-z*w,j[3]=y*w,j;}function A(j,V){return j[0]=-V[0],j[1]=-V[1],j[2]=-V[2],j[3]=V[3],j;}function R(j,V){var X=V[0]+V[4]+V[8],N;if(X>0)N=Math.sqrt(X+1),j[3]=0.5*N,N=0.5/N,j[0]=(V[5]-V[7])*N,j[1]=(V[6]-V[2])*N,j[2]=(V[1]-V[3])*N;else{var z=0;V[4]>V[0]&&(z=1),V[8]>V[z*3+z]&&(z=2);var y=(z+1)%3,P=(z+2)%3;N=Math.sqrt(V[z*3+z]-V[y*3+y]-V[P*3+P]+1),j[z]=0.5*N,N=0.5/N,j[3]=(V[y*3+P]-V[P*3+y])*N,j[y]=(V[y*3+z]+V[z*3+y])*N,j[P]=(V[P*3+z]+V[z*3+P])*N;}return j;}function b(j,V,X,N){var z=0.5*Math.PI/180;V*=z,X*=z,N*=z;var y=Math.sin(V),P=Math.cos(V),w=Math.sin(X),U=Math.cos(X),H=Math.sin(N),Y=Math.cos(N);return j[0]=y*U*Y-P*w*H,j[1]=P*w*Y+y*U*H,j[2]=P*U*H-y*w*Y,j[3]=P*U*Y+y*w*H,j;}function E(j){return"quat("+j[0]+", "+j[1]+", "+j[2]+", "+j[3]+")";}var L=a.clone,D=a.fromValues,I=a.copy,C=a.set,W=a.add,G=v,K=a.scale,J=a.dot,Z=a.lerp,B=a.length,$=B,Q=a.squaredLength,et=Q,tt=a.normalize,ot=a.exactEquals,q=a.equals,gt=function(){var j=i.create(),V=i.fromValues(1,0,0),X=i.fromValues(0,1,0);return function(N,z,y){var P=i.dot(z,y);return P<-0.999999?(i.cross(j,V,z),i.len(j)<1e-6&&i.cross(j,X,z),i.normalize(j,j),f(N,j,Math.PI),N):P>0.999999?(N[0]=0,N[1]=0,N[2]=0,N[3]=1,N):(i.cross(j,z,y),N[0]=j[0],N[1]=j[1],N[2]=j[2],N[3]=1+P,tt(N,N));};}(),dt=function(){var j=o(),V=o();return function(X,N,z,y,P,w){return u(j,N,P,w),u(V,z,y,w),u(X,j,V,2*w*(1-w)),X;};}(),F=function(){var j=n.create();return function(V,X,N,z){return j[0]=N[0],j[3]=N[1],j[6]=N[2],j[1]=z[0],j[4]=z[1],j[7]=z[2],j[2]=-X[0],j[5]=-X[1],j[8]=-X[2],tt(V,R(V,j));};}();},/* 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 o;}),t.d(r,"copy",function(){return s;}),t.d(r,"set",function(){return f;}),t.d(r,"add",function(){return p;}),t.d(r,"subtract",function(){return c;}),t.d(r,"multiply",function(){return v;}),t.d(r,"divide",function(){return S;}),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 l;}),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 R;}),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 I;}),t.d(r,"hermite",function(){return C;}),t.d(r,"bezier",function(){return W;}),t.d(r,"random",function(){return G;}),t.d(r,"transformMat4",function(){return K;}),t.d(r,"transformMat3",function(){return J;}),t.d(r,"transformQuat",function(){return Z;}),t.d(r,"rotateX",function(){return B;}),t.d(r,"rotateY",function(){return $;}),t.d(r,"rotateZ",function(){return Q;}),t.d(r,"angle",function(){return et;}),t.d(r,"zero",function(){return tt;}),t.d(r,"str",function(){return ot;}),t.d(r,"exactEquals",function(){return q;}),t.d(r,"equals",function(){return gt;}),t.d(r,"sub",function(){return dt;}),t.d(r,"mul",function(){return F;}),t.d(r,"div",function(){return j;}),t.d(r,"dist",function(){return V;}),t.d(r,"sqrDist",function(){return X;}),t.d(r,"len",function(){return N;}),t.d(r,"sqrLen",function(){return z;}),t.d(r,"forEach",function(){return y;});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],H=P[2];return Math.hypot(w,U,H);}function o(P,w,U){var H=new e.ARRAY_TYPE(3);return H[0]=P,H[1]=w,H[2]=U,H;}function s(P,w){return P[0]=w[0],P[1]=w[1],P[2]=w[2],P;}function f(P,w,U,H){return P[0]=w,P[1]=U,P[2]=H,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 c(P,w,U){return P[0]=w[0]-U[0],P[1]=w[1]-U[1],P[2]=w[2]-U[2],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 S(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 l(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,H){return P[0]=w[0]+U[0]*H,P[1]=w[1]+U[1]*H,P[2]=w[2]+U[2]*H,P;}function g(P,w){var U=w[0]-P[0],H=w[1]-P[1],Y=w[2]-P[2];return Math.hypot(U,H,Y);}function M(P,w){var U=w[0]-P[0],H=w[1]-P[1],Y=w[2]-P[2];return U*U+H*H+Y*Y;}function A(P){var w=P[0],U=P[1],H=P[2];return w*w+U*U+H*H;}function R(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],H=w[1],Y=w[2],k=U*U+H*H+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 H=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-H*lt,P[2]=H*it-Y*rt,P;}function I(P,w,U,H){var Y=w[0],k=w[1],rt=w[2];return P[0]=Y+H*(U[0]-Y),P[1]=k+H*(U[1]-k),P[2]=rt+H*(U[2]-rt),P;}function C(P,w,U,H,Y,k){var rt=k*k,it=rt*(2*k-3)+1,lt=rt*(k-2)+k,ut=rt*(k-1),at=rt*(3-2*k);return P[0]=w[0]*it+U[0]*lt+H[0]*ut+Y[0]*at,P[1]=w[1]*it+U[1]*lt+H[1]*ut+Y[1]*at,P[2]=w[2]*it+U[2]*lt+H[2]*ut+Y[2]*at,P;}function W(P,w,U,H,Y,k){var rt=1-k,it=rt*rt,lt=k*k,ut=it*rt,at=3*k*it,st=3*lt*rt,ft=lt*k;return P[0]=w[0]*ut+U[0]*at+H[0]*st+Y[0]*ft,P[1]=w[1]*ut+U[1]*at+H[1]*st+Y[1]*ft,P[2]=w[2]*ut+U[2]*at+H[2]*st+Y[2]*ft,P;}function G(P,w){w=w||1;var U=e.RANDOM()*2*Math.PI,H=e.RANDOM()*2-1,Y=Math.sqrt(1-H*H)*w;return P[0]=Math.cos(U)*Y,P[1]=Math.sin(U)*Y,P[2]=H*w,P;}function K(P,w,U){var H=w[0],Y=w[1],k=w[2],rt=U[3]*H+U[7]*Y+U[11]*k+U[15];return rt=rt||1,P[0]=(U[0]*H+U[4]*Y+U[8]*k+U[12])/rt,P[1]=(U[1]*H+U[5]*Y+U[9]*k+U[13])/rt,P[2]=(U[2]*H+U[6]*Y+U[10]*k+U[14])/rt,P;}function J(P,w,U){var H=w[0],Y=w[1],k=w[2];return P[0]=H*U[0]+Y*U[3]+k*U[6],P[1]=H*U[1]+Y*U[4]+k*U[7],P[2]=H*U[2]+Y*U[5]+k*U[8],P;}function Z(P,w,U){var H=U[0],Y=U[1],k=U[2],rt=U[3],it=w[0],lt=w[1],ut=w[2],at=Y*ut-k*lt,st=k*it-H*ut,ft=H*lt-Y*it,vt=Y*ft-k*st,mt=k*at-H*ft,pt=H*st-Y*at,St=rt*2;return at*=St,st*=St,ft*=St,vt*=2,mt*=2,pt*=2,P[0]=it+at+vt,P[1]=lt+st+mt,P[2]=ut+ft+pt,P;}function B(P,w,U,H){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(H)-Y[2]*Math.sin(H),k[2]=Y[1]*Math.sin(H)+Y[2]*Math.cos(H),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function $(P,w,U,H){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(H)+Y[0]*Math.cos(H),k[1]=Y[1],k[2]=Y[2]*Math.cos(H)-Y[0]*Math.sin(H),P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function Q(P,w,U,H){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(H)-Y[1]*Math.sin(H),k[1]=Y[0]*Math.sin(H)+Y[1]*Math.cos(H),k[2]=Y[2],P[0]=k[0]+U[0],P[1]=k[1]+U[1],P[2]=k[2]+U[2],P;}function et(P,w){var U=P[0],H=P[1],Y=P[2],k=w[0],rt=w[1],it=w[2],lt=Math.sqrt(U*U+H*H+Y*Y),ut=Math.sqrt(k*k+rt*rt+it*it),at=lt*ut,st=at&&L(P,w)/at;return Math.acos(Math.min(Math.max(st,-1),1));}function tt(P){return P[0]=0,P[1]=0,P[2]=0,P;}function ot(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 gt(P,w){var U=P[0],H=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(H-rt)<=e.EPSILON*Math.max(1,Math.abs(H),Math.abs(rt))&&Math.abs(Y-it)<=e.EPSILON*Math.max(1,Math.abs(Y),Math.abs(it));}var dt=c,F=v,j=S,V=g,X=M,N=a,z=A,y=function(){var P=n();return function(w,U,H,Y,k,rt){var it,lt;for(U||(U=3),H||(H=0),Y?lt=Math.min(Y*U+H,w.length):lt=w.length,it=H;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 o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return f;}),t.d(r,"subtract",function(){return p;}),t.d(r,"multiply",function(){return c;}),t.d(r,"divide",function(){return v;}),t.d(r,"ceil",function(){return S;}),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 l;}),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 R;}),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 I;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat4",function(){return W;}),t.d(r,"transformQuat",function(){return G;}),t.d(r,"zero",function(){return K;}),t.d(r,"str",function(){return J;}),t.d(r,"exactEquals",function(){return Z;}),t.d(r,"equals",function(){return B;}),t.d(r,"sub",function(){return $;}),t.d(r,"mul",function(){return Q;}),t.d(r,"div",function(){return et;}),t.d(r,"dist",function(){return tt;}),t.d(r,"sqrDist",function(){return ot;}),t.d(r,"len",function(){return q;}),t.d(r,"sqrLen",function(){return gt;}),t.d(r,"forEach",function(){return dt;});var e=t(2);function n(){var F=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[3]=0),F;}function i(F){var j=new e.ARRAY_TYPE(4);return j[0]=F[0],j[1]=F[1],j[2]=F[2],j[3]=F[3],j;}function a(F,j,V,X){var N=new e.ARRAY_TYPE(4);return N[0]=F,N[1]=j,N[2]=V,N[3]=X,N;}function o(F,j){return F[0]=j[0],F[1]=j[1],F[2]=j[2],F[3]=j[3],F;}function s(F,j,V,X,N){return F[0]=j,F[1]=V,F[2]=X,F[3]=N,F;}function f(F,j,V){return F[0]=j[0]+V[0],F[1]=j[1]+V[1],F[2]=j[2]+V[2],F[3]=j[3]+V[3],F;}function p(F,j,V){return F[0]=j[0]-V[0],F[1]=j[1]-V[1],F[2]=j[2]-V[2],F[3]=j[3]-V[3],F;}function c(F,j,V){return F[0]=j[0]*V[0],F[1]=j[1]*V[1],F[2]=j[2]*V[2],F[3]=j[3]*V[3],F;}function v(F,j,V){return F[0]=j[0]/V[0],F[1]=j[1]/V[1],F[2]=j[2]/V[2],F[3]=j[3]/V[3],F;}function S(F,j){return F[0]=Math.ceil(j[0]),F[1]=Math.ceil(j[1]),F[2]=Math.ceil(j[2]),F[3]=Math.ceil(j[3]),F;}function O(F,j){return F[0]=Math.floor(j[0]),F[1]=Math.floor(j[1]),F[2]=Math.floor(j[2]),F[3]=Math.floor(j[3]),F;}function x(F,j,V){return F[0]=Math.min(j[0],V[0]),F[1]=Math.min(j[1],V[1]),F[2]=Math.min(j[2],V[2]),F[3]=Math.min(j[3],V[3]),F;}function m(F,j,V){return F[0]=Math.max(j[0],V[0]),F[1]=Math.max(j[1],V[1]),F[2]=Math.max(j[2],V[2]),F[3]=Math.max(j[3],V[3]),F;}function T(F,j){return F[0]=Math.round(j[0]),F[1]=Math.round(j[1]),F[2]=Math.round(j[2]),F[3]=Math.round(j[3]),F;}function l(F,j,V){return F[0]=j[0]*V,F[1]=j[1]*V,F[2]=j[2]*V,F[3]=j[3]*V,F;}function d(F,j,V,X){return F[0]=j[0]+V[0]*X,F[1]=j[1]+V[1]*X,F[2]=j[2]+V[2]*X,F[3]=j[3]+V[3]*X,F;}function u(F,j){var V=j[0]-F[0],X=j[1]-F[1],N=j[2]-F[2],z=j[3]-F[3];return Math.hypot(V,X,N,z);}function g(F,j){var V=j[0]-F[0],X=j[1]-F[1],N=j[2]-F[2],z=j[3]-F[3];return V*V+X*X+N*N+z*z;}function M(F){var j=F[0],V=F[1],X=F[2],N=F[3];return Math.hypot(j,V,X,N);}function A(F){var j=F[0],V=F[1],X=F[2],N=F[3];return j*j+V*V+X*X+N*N;}function R(F,j){return F[0]=-j[0],F[1]=-j[1],F[2]=-j[2],F[3]=-j[3],F;}function b(F,j){return F[0]=1/j[0],F[1]=1/j[1],F[2]=1/j[2],F[3]=1/j[3],F;}function E(F,j){var V=j[0],X=j[1],N=j[2],z=j[3],y=V*V+X*X+N*N+z*z;return y>0&&(y=1/Math.sqrt(y)),F[0]=V*y,F[1]=X*y,F[2]=N*y,F[3]=z*y,F;}function L(F,j){return F[0]*j[0]+F[1]*j[1]+F[2]*j[2]+F[3]*j[3];}function D(F,j,V,X){var N=V[0]*X[1]-V[1]*X[0],z=V[0]*X[2]-V[2]*X[0],y=V[0]*X[3]-V[3]*X[0],P=V[1]*X[2]-V[2]*X[1],w=V[1]*X[3]-V[3]*X[1],U=V[2]*X[3]-V[3]*X[2],H=j[0],Y=j[1],k=j[2],rt=j[3];return F[0]=Y*U-k*w+rt*P,F[1]=-(H*U)+k*y-rt*z,F[2]=H*w-Y*y+rt*N,F[3]=-(H*P)+Y*z-k*N,F;}function I(F,j,V,X){var N=j[0],z=j[1],y=j[2],P=j[3];return F[0]=N+X*(V[0]-N),F[1]=z+X*(V[1]-z),F[2]=y+X*(V[2]-y),F[3]=P+X*(V[3]-P),F;}function C(F,j){j=j||1;var V,X,N,z,y,P;do V=e.RANDOM()*2-1,X=e.RANDOM()*2-1,y=V*V+X*X;while(y>=1);do N=e.RANDOM()*2-1,z=e.RANDOM()*2-1,P=N*N+z*z;while(P>=1);var w=Math.sqrt((1-y)/P);return F[0]=j*V,F[1]=j*X,F[2]=j*N*w,F[3]=j*z*w,F;}function W(F,j,V){var X=j[0],N=j[1],z=j[2],y=j[3];return F[0]=V[0]*X+V[4]*N+V[8]*z+V[12]*y,F[1]=V[1]*X+V[5]*N+V[9]*z+V[13]*y,F[2]=V[2]*X+V[6]*N+V[10]*z+V[14]*y,F[3]=V[3]*X+V[7]*N+V[11]*z+V[15]*y,F;}function G(F,j,V){var X=j[0],N=j[1],z=j[2],y=V[0],P=V[1],w=V[2],U=V[3],H=U*X+P*z-w*N,Y=U*N+w*X-y*z,k=U*z+y*N-P*X,rt=-y*X-P*N-w*z;return F[0]=H*U+rt*-y+Y*-w-k*-P,F[1]=Y*U+rt*-P+k*-y-H*-w,F[2]=k*U+rt*-w+H*-P-Y*-y,F[3]=j[3],F;}function K(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=0,F;}function J(F){return"vec4("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+")";}function Z(F,j){return F[0]===j[0]&&F[1]===j[1]&&F[2]===j[2]&&F[3]===j[3];}function B(F,j){var V=F[0],X=F[1],N=F[2],z=F[3],y=j[0],P=j[1],w=j[2],U=j[3];return Math.abs(V-y)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(y))&&Math.abs(X-P)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(P))&&Math.abs(N-w)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(w))&&Math.abs(z-U)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(U));}var $=p,Q=c,et=v,tt=u,ot=g,q=M,gt=A,dt=function(){var F=n();return function(j,V,X,N,z,y){var P,w;for(V||(V=4),X||(X=0),N?w=Math.min(N*V+X,j.length):w=j.length,P=X;P<w;P+=V)F[0]=j[P],F[1]=j[P+1],F[2]=j[P+2],F[3]=j[P+3],z(F,F,y),j[P]=F[0],j[P+1]=F[1],j[P+2]=F[2],j[P+3]=F[3];return j;};}();},/* 10 */ /***/function(h,r,t){t.r(r),t.d(r,"create",function(){return a;}),t.d(r,"clone",function(){return o;}),t.d(r,"fromValues",function(){return s;}),t.d(r,"fromRotationTranslationValues",function(){return f;}),t.d(r,"fromRotationTranslation",function(){return p;}),t.d(r,"fromTranslation",function(){return c;}),t.d(r,"fromRotation",function(){return v;}),t.d(r,"fromMat4",function(){return S;}),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 l;}),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 R;}),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 I;}),t.d(r,"multiply",function(){return C;}),t.d(r,"mul",function(){return W;}),t.d(r,"scale",function(){return G;}),t.d(r,"dot",function(){return K;}),t.d(r,"lerp",function(){return J;}),t.d(r,"invert",function(){return Z;}),t.d(r,"conjugate",function(){return B;}),t.d(r,"length",function(){return $;}),t.d(r,"len",function(){return Q;}),t.d(r,"squaredLength",function(){return et;}),t.d(r,"sqrLen",function(){return tt;}),t.d(r,"normalize",function(){return ot;}),t.d(r,"str",function(){return q;}),t.d(r,"exactEquals",function(){return gt;}),t.d(r,"equals",function(){return dt;});var e=t(2),n=t(7),i=t(6);function a(){var F=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0,F[4]=0,F[5]=0,F[6]=0,F[7]=0),F[3]=1,F;}function o(F){var j=new e.ARRAY_TYPE(8);return j[0]=F[0],j[1]=F[1],j[2]=F[2],j[3]=F[3],j[4]=F[4],j[5]=F[5],j[6]=F[6],j[7]=F[7],j;}function s(F,j,V,X,N,z,y,P){var w=new e.ARRAY_TYPE(8);return w[0]=F,w[1]=j,w[2]=V,w[3]=X,w[4]=N,w[5]=z,w[6]=y,w[7]=P,w;}function f(F,j,V,X,N,z,y){var P=new e.ARRAY_TYPE(8);P[0]=F,P[1]=j,P[2]=V,P[3]=X;var w=N*0.5,U=z*0.5,H=y*0.5;return P[4]=w*X+U*V-H*j,P[5]=U*X+H*F-w*V,P[6]=H*X+w*j-U*F,P[7]=-w*F-U*j-H*V,P;}function p(F,j,V){var X=V[0]*0.5,N=V[1]*0.5,z=V[2]*0.5,y=j[0],P=j[1],w=j[2],U=j[3];return F[0]=y,F[1]=P,F[2]=w,F[3]=U,F[4]=X*U+N*w-z*P,F[5]=N*U+z*y-X*w,F[6]=z*U+X*P-N*y,F[7]=-X*y-N*P-z*w,F;}function c(F,j){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=j[0]*0.5,F[5]=j[1]*0.5,F[6]=j[2]*0.5,F[7]=0,F;}function v(F,j){return F[0]=j[0],F[1]=j[1],F[2]=j[2],F[3]=j[3],F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function S(F,j){var V=n.create();i.getRotation(V,j);var X=new e.ARRAY_TYPE(3);return i.getTranslation(X,j),p(F,V,X),F;}function O(F,j){return F[0]=j[0],F[1]=j[1],F[2]=j[2],F[3]=j[3],F[4]=j[4],F[5]=j[5],F[6]=j[6],F[7]=j[7],F;}function x(F){return F[0]=0,F[1]=0,F[2]=0,F[3]=1,F[4]=0,F[5]=0,F[6]=0,F[7]=0,F;}function m(F,j,V,X,N,z,y,P,w){return F[0]=j,F[1]=V,F[2]=X,F[3]=N,F[4]=z,F[5]=y,F[6]=P,F[7]=w,F;}var T=n.copy;function l(F,j){return F[0]=j[4],F[1]=j[5],F[2]=j[6],F[3]=j[7],F;}var d=n.copy;function u(F,j){return F[4]=j[0],F[5]=j[1],F[6]=j[2],F[7]=j[3],F;}function g(F,j){var V=j[4],X=j[5],N=j[6],z=j[7],y=-j[0],P=-j[1],w=-j[2],U=j[3];return F[0]=(V*U+z*y+X*w-N*P)*2,F[1]=(X*U+z*P+N*y-V*w)*2,F[2]=(N*U+z*w+V*P-X*y)*2,F;}function M(F,j,V){var X=j[0],N=j[1],z=j[2],y=j[3],P=V[0]*0.5,w=V[1]*0.5,U=V[2]*0.5,H=j[4],Y=j[5],k=j[6],rt=j[7];return F[0]=X,F[1]=N,F[2]=z,F[3]=y,F[4]=y*P+N*U-z*w+H,F[5]=y*w+z*P-X*U+Y,F[6]=y*U+X*w-N*P+k,F[7]=-X*P-N*w-z*U+rt,F;}function A(F,j,V){var X=-j[0],N=-j[1],z=-j[2],y=j[3],P=j[4],w=j[5],U=j[6],H=j[7],Y=P*y+H*X+w*z-U*N,k=w*y+H*N+U*X-P*z,rt=U*y+H*z+P*N-w*X,it=H*y-P*X-w*N-U*z;return n.rotateX(F,j,V),X=F[0],N=F[1],z=F[2],y=F[3],F[4]=Y*y+it*X+k*z-rt*N,F[5]=k*y+it*N+rt*X-Y*z,F[6]=rt*y+it*z+Y*N-k*X,F[7]=it*y-Y*X-k*N-rt*z,F;}function R(F,j,V){var X=-j[0],N=-j[1],z=-j[2],y=j[3],P=j[4],w=j[5],U=j[6],H=j[7],Y=P*y+H*X+w*z-U*N,k=w*y+H*N+U*X-P*z,rt=U*y+H*z+P*N-w*X,it=H*y-P*X-w*N-U*z;return n.rotateY(F,j,V),X=F[0],N=F[1],z=F[2],y=F[3],F[4]=Y*y+it*X+k*z-rt*N,F[5]=k*y+it*N+rt*X-Y*z,F[6]=rt*y+it*z+Y*N-k*X,F[7]=it*y-Y*X-k*N-rt*z,F;}function b(F,j,V){var X=-j[0],N=-j[1],z=-j[2],y=j[3],P=j[4],w=j[5],U=j[6],H=j[7],Y=P*y+H*X+w*z-U*N,k=w*y+H*N+U*X-P*z,rt=U*y+H*z+P*N-w*X,it=H*y-P*X-w*N-U*z;return n.rotateZ(F,j,V),X=F[0],N=F[1],z=F[2],y=F[3],F[4]=Y*y+it*X+k*z-rt*N,F[5]=k*y+it*N+rt*X-Y*z,F[6]=rt*y+it*z+Y*N-k*X,F[7]=it*y-Y*X-k*N-rt*z,F;}function E(F,j,V){var X=V[0],N=V[1],z=V[2],y=V[3],P=j[0],w=j[1],U=j[2],H=j[3];return F[0]=P*y+H*X+w*z-U*N,F[1]=w*y+H*N+U*X-P*z,F[2]=U*y+H*z+P*N-w*X,F[3]=H*y-P*X-w*N-U*z,P=j[4],w=j[5],U=j[6],H=j[7],F[4]=P*y+H*X+w*z-U*N,F[5]=w*y+H*N+U*X-P*z,F[6]=U*y+H*z+P*N-w*X,F[7]=H*y-P*X-w*N-U*z,F;}function L(F,j,V){var X=j[0],N=j[1],z=j[2],y=j[3],P=V[0],w=V[1],U=V[2],H=V[3];return F[0]=X*H+y*P+N*U-z*w,F[1]=N*H+y*w+z*P-X*U,F[2]=z*H+y*U+X*w-N*P,F[3]=y*H-X*P-N*w-z*U,P=V[4],w=V[5],U=V[6],H=V[7],F[4]=X*H+y*P+N*U-z*w,F[5]=N*H+y*w+z*P-X*U,F[6]=z*H+y*U+X*w-N*P,F[7]=y*H-X*P-N*w-z*U,F;}function D(F,j,V,X){if(Math.abs(X)<e.EPSILON)return O(F,j);var N=Math.hypot(V[0],V[1],V[2]);X=X*0.5;var z=Math.sin(X),y=z*V[0]/N,P=z*V[1]/N,w=z*V[2]/N,U=Math.cos(X),H=j[0],Y=j[1],k=j[2],rt=j[3];F[0]=H*U+rt*y+Y*w-k*P,F[1]=Y*U+rt*P+k*y-H*w,F[2]=k*U+rt*w+H*P-Y*y,F[3]=rt*U-H*y-Y*P-k*w;var it=j[4],lt=j[5],ut=j[6],at=j[7];return F[4]=it*U+at*y+lt*w-ut*P,F[5]=lt*U+at*P+ut*y-it*w,F[6]=ut*U+at*w+it*P-lt*y,F[7]=at*U-it*y-lt*P-ut*w,F;}function I(F,j,V){return F[0]=j[0]+V[0],F[1]=j[1]+V[1],F[2]=j[2]+V[2],F[3]=j[3]+V[3],F[4]=j[4]+V[4],F[5]=j[5]+V[5],F[6]=j[6]+V[6],F[7]=j[7]+V[7],F;}function C(F,j,V){var X=j[0],N=j[1],z=j[2],y=j[3],P=V[4],w=V[5],U=V[6],H=V[7],Y=j[4],k=j[5],rt=j[6],it=j[7],lt=V[0],ut=V[1],at=V[2],st=V[3];return F[0]=X*st+y*lt+N*at-z*ut,F[1]=N*st+y*ut+z*lt-X*at,F[2]=z*st+y*at+X*ut-N*lt,F[3]=y*st-X*lt-N*ut-z*at,F[4]=X*H+y*P+N*U-z*w+Y*st+it*lt+k*at-rt*ut,F[5]=N*H+y*w+z*P-X*U+k*st+it*ut+rt*lt-Y*at,F[6]=z*H+y*U+X*w-N*P+rt*st+it*at+Y*ut-k*lt,F[7]=y*H-X*P-N*w-z*U+it*st-Y*lt-k*ut-rt*at,F;}var W=C;function G(F,j,V){return F[0]=j[0]*V,F[1]=j[1]*V,F[2]=j[2]*V,F[3]=j[3]*V,F[4]=j[4]*V,F[5]=j[5]*V,F[6]=j[6]*V,F[7]=j[7]*V,F;}var K=n.dot;function J(F,j,V,X){var N=1-X;return K(j,V)<0&&(X=-X),F[0]=j[0]*N+V[0]*X,F[1]=j[1]*N+V[1]*X,F[2]=j[2]*N+V[2]*X,F[3]=j[3]*N+V[3]*X,F[4]=j[4]*N+V[4]*X,F[5]=j[5]*N+V[5]*X,F[6]=j[6]*N+V[6]*X,F[7]=j[7]*N+V[7]*X,F;}function Z(F,j){var V=et(j);return F[0]=-j[0]/V,F[1]=-j[1]/V,F[2]=-j[2]/V,F[3]=j[3]/V,F[4]=-j[4]/V,F[5]=-j[5]/V,F[6]=-j[6]/V,F[7]=j[7]/V,F;}function B(F,j){return F[0]=-j[0],F[1]=-j[1],F[2]=-j[2],F[3]=j[3],F[4]=-j[4],F[5]=-j[5],F[6]=-j[6],F[7]=j[7],F;}var $=n.length,Q=$,et=n.squaredLength,tt=et;function ot(F,j){var V=et(j);if(V>0){V=Math.sqrt(V);var X=j[0]/V,N=j[1]/V,z=j[2]/V,y=j[3]/V,P=j[4],w=j[5],U=j[6],H=j[7],Y=X*P+N*w+z*U+y*H;F[0]=X,F[1]=N,F[2]=z,F[3]=y,F[4]=(P-X*Y)/V,F[5]=(w-N*Y)/V,F[6]=(U-z*Y)/V,F[7]=(H-y*Y)/V;}return F;}function q(F){return"quat2("+F[0]+", "+F[1]+", "+F[2]+", "+F[3]+", "+F[4]+", "+F[5]+", "+F[6]+", "+F[7]+")";}function gt(F,j){return F[0]===j[0]&&F[1]===j[1]&&F[2]===j[2]&&F[3]===j[3]&&F[4]===j[4]&&F[5]===j[5]&&F[6]===j[6]&&F[7]===j[7];}function dt(F,j){var V=F[0],X=F[1],N=F[2],z=F[3],y=F[4],P=F[5],w=F[6],U=F[7],H=j[0],Y=j[1],k=j[2],rt=j[3],it=j[4],lt=j[5],ut=j[6],at=j[7];return Math.abs(V-H)<=e.EPSILON*Math.max(1,Math.abs(V),Math.abs(H))&&Math.abs(X-Y)<=e.EPSILON*Math.max(1,Math.abs(X),Math.abs(Y))&&Math.abs(N-k)<=e.EPSILON*Math.max(1,Math.abs(N),Math.abs(k))&&Math.abs(z-rt)<=e.EPSILON*Math.max(1,Math.abs(z),Math.abs(rt))&&Math.abs(y-it)<=e.EPSILON*Math.max(1,Math.abs(y),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-at)<=e.EPSILON*Math.max(1,Math.abs(U),Math.abs(at));}},/* 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 o;}),t.d(r,"set",function(){return s;}),t.d(r,"add",function(){return f;}),t.d(r,"subtract",function(){return p;}),t.d(r,"multiply",function(){return c;}),t.d(r,"divide",function(){return v;}),t.d(r,"ceil",function(){return S;}),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 l;}),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 R;}),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 I;}),t.d(r,"random",function(){return C;}),t.d(r,"transformMat2",function(){return W;}),t.d(r,"transformMat2d",function(){return G;}),t.d(r,"transformMat3",function(){return K;}),t.d(r,"transformMat4",function(){return J;}),t.d(r,"rotate",function(){return Z;}),t.d(r,"angle",function(){return B;}),t.d(r,"zero",function(){return $;}),t.d(r,"str",function(){return Q;}),t.d(r,"exactEquals",function(){return et;}),t.d(r,"equals",function(){return tt;}),t.d(r,"len",function(){return ot;}),t.d(r,"sub",function(){return q;}),t.d(r,"mul",function(){return gt;}),t.d(r,"div",function(){return dt;}),t.d(r,"dist",function(){return F;}),t.d(r,"sqrDist",function(){return j;}),t.d(r,"sqrLen",function(){return V;}),t.d(r,"forEach",function(){return X;});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 z=new e.ARRAY_TYPE(2);return z[0]=N[0],z[1]=N[1],z;}function a(N,z){var y=new e.ARRAY_TYPE(2);return y[0]=N,y[1]=z,y;}function o(N,z){return N[0]=z[0],N[1]=z[1],N;}function s(N,z,y){return N[0]=z,N[1]=y,N;}function f(N,z,y){return N[0]=z[0]+y[0],N[1]=z[1]+y[1],N;}function p(N,z,y){return N[0]=z[0]-y[0],N[1]=z[1]-y[1],N;}function c(N,z,y){return N[0]=z[0]*y[0],N[1]=z[1]*y[1],N;}function v(N,z,y){return N[0]=z[0]/y[0],N[1]=z[1]/y[1],N;}function S(N,z){return N[0]=Math.ceil(z[0]),N[1]=Math.ceil(z[1]),N;}function O(N,z){return N[0]=Math.floor(z[0]),N[1]=Math.floor(z[1]),N;}function x(N,z,y){return N[0]=Math.min(z[0],y[0]),N[1]=Math.min(z[1],y[1]),N;}function m(N,z,y){return N[0]=Math.max(z[0],y[0]),N[1]=Math.max(z[1],y[1]),N;}function T(N,z){return N[0]=Math.round(z[0]),N[1]=Math.round(z[1]),N;}function l(N,z,y){return N[0]=z[0]*y,N[1]=z[1]*y,N;}function d(N,z,y,P){return N[0]=z[0]+y[0]*P,N[1]=z[1]+y[1]*P,N;}function u(N,z){var y=z[0]-N[0],P=z[1]-N[1];return Math.hypot(y,P);}function g(N,z){var y=z[0]-N[0],P=z[1]-N[1];return y*y+P*P;}function M(N){var z=N[0],y=N[1];return Math.hypot(z,y);}function A(N){var z=N[0],y=N[1];return z*z+y*y;}function R(N,z){return N[0]=-z[0],N[1]=-z[1],N;}function b(N,z){return N[0]=1/z[0],N[1]=1/z[1],N;}function E(N,z){var y=z[0],P=z[1],w=y*y+P*P;return w>0&&(w=1/Math.sqrt(w)),N[0]=z[0]*w,N[1]=z[1]*w,N;}function L(N,z){return N[0]*z[0]+N[1]*z[1];}function D(N,z,y){var P=z[0]*y[1]-z[1]*y[0];return N[0]=N[1]=0,N[2]=P,N;}function I(N,z,y,P){var w=z[0],U=z[1];return N[0]=w+P*(y[0]-w),N[1]=U+P*(y[1]-U),N;}function C(N,z){z=z||1;var y=e.RANDOM()*2*Math.PI;return N[0]=Math.cos(y)*z,N[1]=Math.sin(y)*z,N;}function W(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[2]*w,N[1]=y[1]*P+y[3]*w,N;}function G(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[2]*w+y[4],N[1]=y[1]*P+y[3]*w+y[5],N;}function K(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[3]*w+y[6],N[1]=y[1]*P+y[4]*w+y[7],N;}function J(N,z,y){var P=z[0],w=z[1];return N[0]=y[0]*P+y[4]*w+y[12],N[1]=y[1]*P+y[5]*w+y[13],N;}function Z(N,z,y,P){var w=z[0]-y[0],U=z[1]-y[1],H=Math.sin(P),Y=Math.cos(P);return N[0]=w*Y-U*H+y[0],N[1]=w*H+U*Y+y[1],N;}function B(N,z){var y=N[0],P=N[1],w=z[0],U=z[1],H=Math.sqrt(y*y+P*P)*Math.sqrt(w*w+U*U),Y=H&&(y*w+P*U)/H;return Math.acos(Math.min(Math.max(Y,-1),1));}function $(N){return N[0]=0,N[1]=0,N;}function Q(N){return"vec2("+N[0]+", "+N[1]+")";}function et(N,z){return N[0]===z[0]&&N[1]===z[1];}function tt(N,z){var y=N[0],P=N[1],w=z[0],U=z[1];return Math.abs(y-w)<=e.EPSILON*Math.max(1,Math.abs(y),Math.abs(w))&&Math.abs(P-U)<=e.EPSILON*Math.max(1,Math.abs(P),Math.abs(U));}var ot=M,q=p,gt=c,dt=v,F=u,j=g,V=A,X=function(){var N=n();return function(z,y,P,w,U,H){var Y,k;for(y||(y=2),P||(P=0),w?k=Math.min(w*y+P,z.length):k=z.length,Y=P;Y<k;Y+=y)N[0]=z[Y],N[1]=z[Y+1],U(N,N,H),z[Y]=N[0],z[Y+1]=N[1];return z;};}();},/* 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 o=t(23);t.d(r,"parseFont",function(){return o["default"];});var s=t(31);t.d(r,"parseColor",function(){return s["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),o=t(25),s=t(40),f=t(56),p=t(29),c=t(59),v=t(21),S=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"),l=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 R(E,L,D,I){var C=E.createTexture(L.canvas),W=[[[0,0],[D,0],[D,I],[0,I],[0,0]]];W.closed=!0;var G=new f["default"]({contours:W});G.setTexture(C),E.setMeshData([G.meshData]),A(E),C["delete"](),L.clearRect(0,0,D,I),delete L._filter;}var b=/*#__PURE__*/function(){function b(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,b);var I=D.contextType;if(I||(typeof WebGL2RenderingContext=="function"?I="webgl2":typeof WebGLRenderingContext=="function"?I="webgl":I="2d"),!L.getContext){var C=L;L={getContext:function getContext(){return C;},width:D.width,height:D.height},C.canvas=L,I="2d";}if(this[M]=L,I!=="webgl"&&I!=="webgl2"&&I!=="2d")throw new Error("Unknown context type ".concat(I));if(D.contextType=I,this[d]=Object.assign({},O,D),I==="webgl"||I==="webgl2"){I==="webgl2"&&(this[d].webgl2=!0);var _C=new e["default"](L,this[d]);I==="webgl2"&&!_C.isWebGL2&&(D.contextType="webgl"),Object(S.createShaders)(_C),Object(S.applyShader)(_C),Object(S.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[l]=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[l];}},{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[l];if(this[T]){var _this$canvas=this.canvas,D=_this$canvas.width,I=_this$canvas.height;L.uniforms.viewMatrix=this.viewMatrix,L.uniforms.projectionMatrix=this.projectionMatrix,L.uniforms.u_resolution=[D,I];}}},{key:"updateResolution",value:function updateResolution(){var _this$canvas2=this.canvas,L=_this$canvas2.width,D=_this$canvas2.height,I=[// 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,I);this.projectionMatrix=W,this[T]&&this[T].gl.viewport(0,0,L,D);}},{key:"createTexture",value:function createTexture(L,D){return(this[T]||this[l]).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[l]).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,I=_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 G=v["default"].createText(L,{font:D,fillColor:I,strokeColor:C,strokeWidth:W});return{image:this.createTexture(G.image),rect:G.rect};}return{_img:{font:D,fillColor:I,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,I=_ref5.options;if(this[T]){var C=this[T].compileSync(D,L);return C._attribOpts=I,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,I=_ref6.options;return this.createProgram({vertex:L,fragment:D,options:I});}},{key:"useProgram",value:function useProgram(L){var D=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(this[T]){var I=Object.assign({},L._attribOpts,D);return this[T].useProgram(L,I);}throw new Error("Context 2D cannot use webgl program.");}},{key:"deleteTexture",value:function deleteTexture(L){return(this[T]||this[l]).deleteTexture(L);}},{key:"clear",value:function clear(){var _this$l;if(this[T]){var D=this[T].gl;D.clear(D.COLOR_BUFFER_BIT);}else(_this$l=this[l]).clear.apply(_this$l,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,I=_ref7$program===void 0?null:_ref7$program;var C=this[T]||this[l],W=I||L.program;if(this[T]){var G=C.gl;if(D&&G.clear(G.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 K=L.mesh.meshData,J=!!K.uniforms.u_texSampler,Z=!!K.uniforms.u_filterFlag,B=!!K.uniforms.u_radialGradientVector,$=L.hasCloudColor,Q=L.hasCloudFilter,et=!!K.uniforms.u_clipSampler;Object(S.applyCloudShader)(C,{hasTexture:J,hasFilter:Z,hasGradient:B,hasCloudColor:$,hasCloudFilter:Q,hasClipPath:et});}this[g](),C.setMeshData([L.meshData]),L.beforeRender&&L.beforeRender(G,L),A(C),L.afterRender&&L.afterRender(G,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,I=_ref8$program===void 0?null:_ref8$program;var C=this[T]||this[l];if(this[T]){var W=C.fbo,G=Object(a["default"])(this,L,I==null),K=C.gl;D&&K.clear(K.COLOR_BUFFER_BIT);var J=!Object(c.isUnitTransform)(this.globalTransformMatrix);this._drawCalls=0;var _iterator=_createForOfIteratorHelper(G),_step;try{var _loop=function _loop(){var Z=_step.value;_this3._drawCalls++;var B=I||Z.program;if(Z instanceof p["default"])_this3.drawMeshCloud(Z,{clear:D,program:B});else{var _this3$canvas=_this3.canvas,$=_this3$canvas.width,Q=_this3$canvas.height;if(Z.beforeRender&&Z.beforeRender(K,Z),Z.pass.length&&((!_this3.fbo||_this3.fbo.width!==$||_this3.fbo.height!==Q)&&(_this3.fbo={width:$,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)),!B&&Z.filterCanvas){Object(S.applyShader)(C,{hasTexture:!0});var et=_this3.filterContext;et||(et=v["default"].createCanvas($,Q).getContext("2d"),_this3.filterContext=et);var tt=L[Z.packIndex],ot=tt.filter,q=L[Z.packIndex+1],gt=L[Z.packIndex-1];(!gt||!gt.filterCanvas||gt.filter!==ot)&&(!q||!q.filterCanvas||q.filter!==ot)?(J?(et.save(),Object(o.drawMesh2D)(tt,et,!1),et.restore(),Object(o.applyFilter)(et,ot)):Object(o.drawMesh2D)(tt,et,!0),_this3[g](),R(C,et,$,Q)):(J&&et.save(),Object(o.drawMesh2D)(tt,et,!1),J&&et.restore(),(!q||!q.filterCanvas||tt.filter!==q.filter)&&(Object(o.applyFilter)(et,ot),_this3[g](),R(C,et,$,Q)));}else{if(B)C.program!==B&&_this3.useProgram(B,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});else{var _et=!!Z.uniforms.u_texSampler,_tt=!!Z.uniforms.u_filterFlag,_ot=!!Z.uniforms.u_radialGradientVector,_q=!!Z.uniforms.u_clipSampler;Object(S.applyShader)(C,{hasTexture:_et,hasFilter:_tt,hasGradient:_ot,hasClipPath:_q});}Z.filterCanvas&&console.warn("User program ignored some filter effects."),_this3[g](),C.setMeshData([Z]),A(C);}if(Z.pass.length){var _et2=Z.pass.length;Z.pass.forEach(function(tt,ot){tt.blend=Z.enableBlend,tt.setTexture(C.fbo.texture),ot===_et2-1?C.bindFBO(W):(_this3.fbo.swap(),C.bindFBO(_this3.fbo.target)),tt.program?C.useProgram(tt.program):(_this3.defaultPassProgram=_this3.defaultPassProgram||_this3.createPassProgram(),C.useProgram(_this3.defaultPassProgram)),C.setMeshData([tt.meshData]),K.clear(K.COLOR_BUFFER_BIT),A(C);});}Z.afterRender&&Z.afterRender(K,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 I=D.length;if(I<2)throw new TypeError("Failed to execute 'drawImage' on 'Renderer': 3 arguments required, but only ".concat(D.length+1," present."));if(I!==2&&I!==4&&I!==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;I===2?C=[D[0],D[1],L.width,L.height]:I===4?C=D:I===8&&(W=D.slice(0,4),C=D.slice(4));var G=this.createTexture(L),_this$canvas3=this.canvas,K=_this$canvas3.width,J=_this$canvas3.height,Z=new s["default"]();Z.rect(C[0],C[1],K,J);var B=new f["default"](Z,{width:K,height:J});B.setTexture(G,{rect:C,srcRect:W}),this.drawMeshes([B]),this.deleteTexture(G);}},{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 I=n.mat3.create();return I=n.mat3.translate(Array.of(0,0,0,0,0,0,0,0,0),I,[L,D]),this.globalTransform.apply(this,_toConsumableArray(I));}},{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],I=_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,I]),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,-I]),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),I=_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,[I,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,[-I,-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),I=_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,[I,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,[-I,-C]),this.globalTransform.apply(this,_toConsumableArray(W));}},{key:"transformPoint",value:function transformPoint(L,D,I){var C=this.globalTransformMatrix;I&&(C=n.mat3.multiply(Array.of(0,0,0,0,0,0,0,0,0),C,I));var W=L*C[0]+D*C[2]+C[4],G=L*C[1]+D*C[3]+C[5];return[W,G];}}]);}();},/* 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 S;});var e=t(16),n=t(17),i=t(18),a=t(19);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 s={};function f(O){var x=arguments.length>1&&arguments[1]!==undefined?arguments[1]:3;var m=[],T=O.length;for(var l=0;l<T;l++)l%x<2&&m.push(0.5*(O[l]+1));return m;}function p(O,x){var m=x._buffers;Object.values(m).forEach(function(T){O.deleteBuffer(T);}),x._buffers={};}function c(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 v={"int":"1i",ivec2:"2i",ivec3:"3i",ivec4:"4i","float":"1f",vec2:"2f",vec3:"3f",vec4:"4f",mat2:"Matrix2fv",mat3:"Matrix3fv",mat4:"Matrix4fv",sampler1D:"sampler1D",sampler2D:"sampler2D",sampler3D:"sampler3D",samplerCube:"samplerCube",sampler1DShadow:"sampler1DShadow",sampler2DShadow:"sampler2DShadow",sampler2DRect:"sampler2DRect",sampler2DRectShadow:"sampler2DRectShadow"};var S=/*#__PURE__*/function(){function S(x){var m=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,S);this.options=Object.assign({},S.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(S,[{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 l=this.gl,d=l.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(R){u=R;var b=M[m]!=null?M[m]:A.length;A[b]=R,c(l,R,b),M[m]||(M[m]=b,l.uniform1i(d,b)),g.options.autoUpdate&&g.update();},configurable:!1,enumerable:!0});}else{var _M=T.indexOf("Matrix")===0,_A=!_M&&/v$/.test(T),R=l["uniform".concat(T)].bind(l);Object.defineProperty(x.uniforms,m,{get:function get(){return u;},set:function set(b){u=b,typeof b=="number"&&(b=[b]),_M?R(d,!1,b):_A?R(d,b):R.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 l=m.positions,d=m.cells,u=m.instanceCount,g=m.cellsCount,M=m.attributes,A=m.uniforms,R=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,l,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,G=_ref16.divisor;if(E.bindBuffer(E.ARRAY_BUFFER,x._buffers[C]),E.bufferData(E.ARRAY_BUFFER,W,E.STATIC_DRAW),G!=null){var K=E.getAttribLocation(x,C);K>=0&&(E.enableVertexAttribArray(K),D.push(K),E.vertexAttribDivisor?E.vertexAttribDivisor(K,G):_this4.aia_ext&&_this4.aia_ext.vertexAttribDivisorANGLE(K,G));}}),A&&Object.entries(A).forEach(function(_ref17){var _ref18=_slicedToArray(_ref17,2),C=_ref18[0],W=_ref18[1];_this4.uniforms[C]=W;});var I;if(!d){var C=x._dimension;I=l.length/C;}if(x._enableTextures&&x._buffers.texCoordBuffer){var _C2=R||f(l,x._dimension);E.bindBuffer(E.ARRAY_BUFFER,x._buffers.texCoordBuffer),E.bufferData(E.ARRAY_BUFFER,S.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,I,u):_this4.aia_ext.drawArraysInstancedANGLE(L,0,I,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,I);});}},{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),p(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,l=_ref19.positions,d=_ref19.instanceCount,u=_ref19.cells,g=_ref19.cellsCount,M=_ref19.attributes,A=_ref19.uniforms,R=_ref19.textureCoord,b=_ref19.enableBlend;var E={positions:S.FLOAT(l),uniforms:A,enableBlend:!!b,textureCoord:S.FLOAT(R)};if(u&&(E.cells=S.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],I=_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 G=I.data||I;if(Array.isArray(G)&&(G=S[W](G)),L[D]={name:C,data:G},I.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=I.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 l=this.gl,d=Object(e.createProgram)(l,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),I=_D[1],C=_D[2],W=_D[3];I==="mat"&&(C=Math.pow(C,2)),d._buffers[W]=l.createBuffer(),d._attribute[W]={name:W,type:I,size:Number(C)||1};}}var R=/^\s*uniform\s+(\w+)\s+(\w+)(\[\d+\])?/mg;g=m.match(R)||[],g=g.concat(x.match(R)||[]),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],I=_L$slice2[1],C=_L$slice2[2];D=v[D],C=!!C,D.indexOf("Matrix")!==0&&C&&(D+="v"),_this6._declareUniform(d,I,D);}),d._buffers.verticesBuffer=l.createBuffer(),d._buffers.cellsBuffer=l.createBuffer();var b=l.getAttribLocation(d,this.options.vertexTextureCoord);return d._enableTextures=b>=0,d._enableTextures&&(d._buffers.texCoordBuffer=l.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 l=x._dimension;T.bindBuffer(T.ARRAY_BUFFER,x._buffers.verticesBuffer);var d=T.getAttribLocation(x,this.options.vertexPosition);if(T.vertexAttribPointer(d,l,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]||{},R=!!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],R,0,0),T.enableVertexAttribArray(L));}}),!x.meshData){var _u2=[[-1,-1,0,1].slice(0,l),[1,-1,0,1].slice(0,l),[1,1,0,1].slice(0,l),[-1,1,0,1].slice(0,l)],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 l(M){M=M.replace(/^\s*/mg,"");var A=[],R=M.match(/^#pragma\s+include\s+.*/mg);if(R){for(var b=0;b<R.length;b++){var L=R[b].match(/(?:<|")(.*)(?:>|")/);if(L){var D=L[0].indexOf("<")===0?"lib":"link";var I=L[1];if(I==="graph"&&(I="graphics"),T[I])A.push("/* included ".concat(I," */"));else if(T[I]=!0,D==="lib"){var C=l(s[I]);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=l(x),u=m?l(m):null;return this.createProgram(d,u);}},{key:"compile",value:function(){var _compile=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(x,m){var T,l,_l4,d,u;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_l4=function _l6(){_l4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(M){var A,R,b,L,D,I,C,_C3;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:M=M.replace(/^\s*/mg,"");A=[],R=M.match(/^#pragma\s+include\s+.*/mg);if(!R){_context2.next=32;break;}b=0;case 4:if(!(b<R.length)){_context2.next=31;break;}L=R[b].match(/(?:<|")(.*)(?:>|")/);if(!L){_context2.next=28;break;}D=L[0].indexOf("<")===0?"lib":"link";I=L[1];if(!(I==="graph"&&(I="graphics"),T[I])){_context2.next=13;break;}A.push("/* included ".concat(I," */"));_context2.next=28;break;case 13:if(!(T[I]=!0,D==="lib")){_context2.next=20;break;}_context2.next=16;return l(s[I]);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 S.fetchShader(I);case 23:_C3=_context2.sent;_context2.next=26;return l(_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 _l4.apply(this,arguments);};l=function _l5(_x4){return _l4.apply(this,arguments);};x=x||i["default"];T={};_context3.next=6;return l(x);case 6:d=_context3.sent;if(!m){_context3.next=13;break;}_context3.next=10;return l(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 S.fetchShader(x);case 3:x=_context4.sent;_context4.t0=m;if(!_context4.t0){_context4.next=9;break;}_context4.next=8;return S.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,l=_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,R=_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,R,0,u.RGBA,u.UNSIGNED_BYTE,null);else u.texImage2D(g,0,u.RGBA,A,R,0,u.RGBA,u.UNSIGNED_BYTE,null);return u.texParameteri(g,u.TEXTURE_MIN_FILTER,l),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:R},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 S.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,l=_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 R=0;R<x;R++){var b=this.createTexture();d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0+R,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&&!l&&(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)),l&&!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&&l&&(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 l=this.options.depth;l&&m.enable(m.DEPTH_TEST),this.gl.clear(this.gl.COLOR_BUFFER_BIT|(l?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(s,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);}}]);}();o(S,"defaultOptions",{preserveDrawingBuffer:!0,autoUpdate:!0,vertexPosition:"a_vertexPosition",vertexTextureCoord:"a_vertexTextureCoord",webgl2:!1}),o(S,"UBYTE",S.UNSIGNED_BYTE),o(S,"USHORT",S.UNSIGNED_SHORT),o(S,"fetchShader",e.fetchShader),o(S,"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 s;}),t.d(r,"fetchShader",function(){return p;}),t(1).glMatrix.setMatrixArrayType(Array);function e(c,v){var S=["webgl","experimental-webgl","webkit-3d","moz-webgl"];var O=null;for(var x=0;x<S.length;++x){try{O=c.getContext(S[x],v);}catch(_unused6){}if(O)break;}return O;}function n(c,v){var S=e(c,v);if(!S)throw new Error("Sorry, your browser doesn't support WebGL.");return S;}function i(c,v,S){var O=c.createShader(c.VERTEX_SHADER);if(c.shaderSource(O,v),c.compileShader(O),!c.getShaderParameter(O,c.COMPILE_STATUS)){var _T7="Vertex shader failed to compile. The error log is:".concat(c.getShaderInfoLog(O));throw new Error(_T7);}var x=c.createShader(c.FRAGMENT_SHADER);if(c.shaderSource(x,S),c.compileShader(x),!c.getShaderParameter(x,c.COMPILE_STATUS)){var _T8="Fragment shader failed to compile. The error log is:".concat(c.getShaderInfoLog(x));throw new Error(_T8);}var m=c.createProgram();if(c.attachShader(m,O),c.attachShader(m,x),c.linkProgram(m),!c.getProgramParameter(m,c.LINK_STATUS)){var _T9="Shader program failed to link. The error log is:".concat(c.getProgramInfoLog(m));throw new Error(_T9);}return c.deleteShader(O),c.deleteShader(x),m;}function a(c){var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Float32Array;var S=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;if(S&&!(S instanceof v))throw new TypeError("Wrong buffer type.");if(c==null||c instanceof v)return c;if(c[0]==null||c[0].length==null)return S?(S.set(c,0),S):new v(c);var O=c[0].length,x=c.length;S||(S=new v(O*x));var m=0;for(var _T10=0;_T10<x;_T10++)for(var _l7=0;_l7<O;_l7++)S[m++]=c[_T10][_l7];return S;}var o={};function s(c){var _ref28=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref28$useImageBitmap=_ref28.useImageBitmap,v=_ref28$useImageBitmap===void 0?!0:_ref28$useImageBitmap,_ref28$alias=_ref28.alias,S=_ref28$alias===void 0?null:_ref28$alias;if(!o[c]){if(typeof Image=="function"){var O=new Image();typeof c=="string"&&!((typeof location==="undefined"?"undefined":_typeof(location))=="object"&&/^file:/.test(location.href))&&!/^data:/.test(c)&&(O.crossOrigin="anonymous"),o[c]=new Promise(function(x){O.onload=function(){v&&typeof createImageBitmap=="function"?createImageBitmap(O,{imageOrientation:"flipY"}).then(function(m){o[c]=m,S&&(o[S]=m),x(m);}):(o[c]=O,S&&(o[S]=O),x(O));},O.src=c;}),S&&(o[S]=o[c]);}else if(typeof fetch=="function")return fetch(c,{method:"GET",mode:"cors",cache:"default"}).then(function(O){return O.blob();}).then(function(O){return createImageBitmap(O,{imageOrientation:"flipY"}).then(function(x){return o[c]=x,S&&(o[S]=x),x;});});}return o[c];}var f={};function p(_x7){return _p.apply(this,arguments);}function _p(){_p=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(c){var v,S;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:if(!f[c]){_context6.next=2;break;}return _context6.abrupt("return",f[c]);case 2:_context6.next=4;return fetch(c);case 4:v=_context6.sent;if(!(v.status>=200&&v.status<300)){_context6.next=10;break;}_context6.next=8;return v.text();case 8:S=_context6.sent;return _context6.abrupt("return",(f[c]=S,S));case 10:throw new Error("Shader loaded error.");case 11:case"end":return _context6.stop();}},_callee6);}));return _p.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(s,f){_classCallCheck(this,a);this.context=s.getContext("2d"),this.options=f,this[i]=[1,0,0,1,0,0];}return _createClass(a,[{key:"createTexture",value:function createTexture(s){return{_img:s};}},{key:"loadTexture",value:function(){var _loadTexture2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s){var f;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e["default"].loadImage(s,{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(s){return s;}},{key:"clear",value:function clear(s,f,p,c){var v=this.context;s=s||0,f=f||0,p=p||v.canvas.width-s,c=c||v.canvas.height-f,v.clearRect(s,f,p,c);}},{key:"drawMeshCloud",value:function drawMeshCloud(s){var _ref29=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref29$clear=_ref29.clear,f=_ref29$clear===void 0?!1:_ref29$clear;var p=[];for(var c=0;c<s.amount;c++){var v=s.getTransform(c);var S=s.getTextureFrame(c);S&&(S=S._img);var O=s.getFilter(c),_s$getCloudRGBA=s.getCloudRGBA(c),x=_s$getCloudRGBA.fill,m=_s$getCloudRGBA.stroke;p.push({mesh:s.mesh,_cloudOptions:[x,m,S,v,O]});}s.beforeRender&&s.beforeRender(this.context,s),this.drawMeshes(p,{clear:f,hook:!1}),s.afterRender&&s.afterRender(this.context,s);}},{key:"drawMeshes",value:function drawMeshes(s){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,p=_ref30$hook===void 0?!0:_ref30$hook;var c=this.context;f&&c.clearRect(0,0,c.canvas.width,c.canvas.height);var v=null;var _c$canvas=c.canvas,S=_c$canvas.width,O=_c$canvas.height,x=s.length;s.forEach(function(m,T){var _m$_cloudOptions,_this8$filterBuffer;var l,d,u,g,M;p&&m.beforeRender&&m.beforeRender(c,m),m._cloudOptions&&((_m$_cloudOptions=_slicedToArray(m._cloudOptions,5),l=_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 R=e["default"].createCanvas(S,O);R?_this8.filterBuffer=R.getContext("2d"):_this8.filterBuffer=!1;}v&&v!==A&&(Object(n.applyFilter)(_this8.filterBuffer,v),c.drawImage(_this8.filterBuffer.canvas,0,0,S,O),_this8.filterBuffer.clearRect(0,0,S,O),v=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,l,d,u,g),_this8.filterBuffer.restore(),T===x-1?(Object(n.applyFilter)(_this8.filterBuffer,A),c.drawImage(_this8.filterBuffer.canvas,0,0,S,O),_this8.filterBuffer.clearRect(0,0,S,O)):v=A):(c.save(),c.transform.apply(c,_toConsumableArray(_this8[i])),Object(n.drawMesh2D)(m,c,!1,l,d,u,g),c.restore()),p&&m.afterRender&&m.afterRender(c,m);});}},{key:"setTransform",value:function setTransform(s){this[i]=s;}}]);}();},/* 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 o={};function s(S,O){var x=S.style,m=S.variant,T=S.weight,l=S.stretch,d=S.size,u=S.pxLineHeight,g=S.family;return l==="normal"?"".concat(x," ").concat(m," ").concat(T," ").concat(d*O,"px/").concat(u*O,"px ").concat(g):"".concat(x," ").concat(m," ").concat(T," ").concat(l," ").concat(d*O,"px/").concat(u*O,"px ").concat(g);}function f(S,_ref31){var O=_ref31.font,x=_ref31.fillColor,m=_ref31.strokeColor,T=_ref31.strokeWidth,_ref31$ratio=_ref31.ratio,l=_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=[S,O,String(x),String(m),String(T)].join("###");var G=o[g];if(G)return G;}d||(d=c(1,1));var M=d.getContext("2d");M.save(),M.font=O;var _M$measureText=M.measureText(S),A=_M$measureText.width;M.restore();var R=Object(i["default"])(O),b=Math.max(R.pxLineHeight,R.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*l),E.height=Math.round(D*l),M.save(),M.font=s(R,l),M.textAlign="center",M.textBaseline="middle";var I=E.height*0.5+R.pxHeight*0.05*l,C=E.width*0.5;if(x){if(Array.isArray(x))x=Object(a["default"])(x);else if(x.vector){var _G;var _x9=x,K=_x9.vector,J=_x9.colors;K.length===6?_G=M.createRadialGradient.apply(M,_toConsumableArray(K)):_G=M.createLinearGradient.apply(M,_toConsumableArray(K)),J.forEach(function(_ref32){var Z=_ref32.offset,B=_ref32.color;_G.addColorStop(Z,B);}),x=_G;}M.fillStyle=x,M.fillText(S,C,I);}if(m){if(M.lineWidth=T*l,Array.isArray(m))m=Object(a["default"])(m);else if(m.vector){var _G2;var _m=m,_K=_m.vector,_J=_m.colors;_K.length===6?_G2=M.createRadialGradient.apply(M,_toConsumableArray(_K)):_G2=M.createLinearGradient.apply(M,_toConsumableArray(_K)),_J.forEach(function(_ref33){var Z=_ref33.offset,B=_ref33.color;_G2.addColorStop(Z,B);}),m=_G2;}M.strokeStyle=m,M.strokeText(S,C,I);}M.restore();var W={image:d,rect:[0,0,L,D]};return u&&(o[g]=W),W;}var p=!1;if((typeof navigator==="undefined"?"undefined":_typeof(navigator))=="object"&&typeof navigator.userAgent=="string"){var S=navigator.userAgent.toLowerCase().match(/chrome\/(\d+)/);S&&(p=Number(S[1])<70);}function c(S,O){var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var m=x.offscreen||!p&&x.offscreen!==!1;var T;return _typeof(e)<"u"&&typeof e.createCanvas=="function"?T=e.createCanvas(S,O,x):m&&typeof OffscreenCanvas=="function"?T=new OffscreenCanvas(S,O):(T=document.createElement("canvas"),T.width=S,T.height=O),T;}var v={createCanvas:c,createText:f,loadImage:n["default"].loadImage};r["default"]=v;}.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,l=_m2.size,d=_m2.unit;if(d==="pt")l/=0.75;else if(d==="pc")l*=16;else if(d==="in")l*=96;else if(d==="cm")l*=96/2.54;else if(d==="mm")l*=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);}l*=T,d==="ex"&&(l/=2);}else if(d==="q")l*=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;l*=_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"?l*=Math.max(_u5,g)/100:l*=Math.min(_u5,g)/100;}return l;}var n="bold|bolder|lighter|[1-9]00",i="italic|oblique",a="small-caps",o="ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",s="px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin|%",f="'([^']+)'|\"([^\"]+)\"|([\\w-]|[\u4E00-\u9FA5])+",p=new RegExp("(".concat(n,") +"),"i"),c=new RegExp("(".concat(i,") +"),"i"),v=new RegExp("(".concat(a,") +"),"i"),S=new RegExp("(".concat(o,") +"),"i"),O=new RegExp("([\\d\\.]+)("+s+")(?:\\/([\\d\\.]+)("+s+"))? *((?:"+f+")( *, *(?:"+f+"))*)");function x(m,T){var l=O.exec(m);if(!l)return;var d=parseFloat(l[3]),u={weight:"normal",style:"normal",stretch:"normal",variant:"normal",size:parseFloat(l[1]),unit:l[2],lineHeight:Number.isFinite(d)?d:void 0,lineHeightUnit:l[4],family:l[5].replace(/ *, */g,",")},g=m.substring(0,l.index),M=p.exec(g),A=c.exec(g),R=v.exec(g),b=S.exec(g);return M&&(u.weight=M[1]),A&&(u.style=A[1]),R&&(u.variant=R[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 o;}),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 o(p,c){var v=p.canvas;p.save(),p.filter=c,p.drawImage(v,0,0,v.width,v.height),p.restore();}function s(p,c){var v=/rgba\((\d+),(\d+),(\d+),(\d+)\)/;p=p.match(v).slice(1,5).map(Number),c=c.match(v).slice(1,5).map(Number);var S=[],O=c[3];for(var x=0;x<4;x++)S[x]=Object(a.mix)(p[x],c[x],O);return"rgba(".concat(S.join(),")");}function f(p,c){var v=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var S=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;c.save();var T=!1,l=!1;if(c.globalAlpha=p.getOpacity(),p._updateMatrix&&p.transformScale/p.contours.scale>1.5&&p.accurate(p.transformScale),p.lineWidth){var g=p.gradient&&p.gradient.stroke;if(g){var _g=g,M=_g.vector,A=_g.colors;if(M.length===6)g=c.createRadialGradient.apply(c,_toConsumableArray(M));else if(M.length===4)g=c.createLinearGradient.apply(c,_toConsumableArray(M));else if(M.length===3)g=c.createCircularGradient.apply(c,_toConsumableArray(M));else throw new TypeError("Invalid vector dimension.");A.forEach(function(_ref34){var R=_ref34.offset,b=_ref34.color;var E=Object(n["default"])(b);O&&(E=s(E,O)),g.addColorStop(R,E);}),c.strokeStyle=g,T=!0;}else p.strokeStyle&&(O?c.strokeStyle=s(p.strokeStyle,O):c.strokeStyle=p.strokeStyle,T=!0);}T&&(c.lineWidth=p.lineWidth,c.lineJoin=p.lineJoin,c.lineCap=p.lineCap,c.miterLimit=p.miterLimit,p.lineDash&&(c.setLineDash(p.lineDash),p.lineDashOffset&&(c.lineDashOffset=p.lineDashOffset)));var d=p.gradient&&p.gradient.fill;if(d){var _d3=d,_g2=_d3.vector,_M2=_d3.colors;if(_g2.length===6)d=c.createRadialGradient.apply(c,_toConsumableArray(_g2));else if(_g2.length===4)d=c.createLinearGradient.apply(c,_toConsumableArray(_g2));else if(_g2.length===3)d=c.createCircularGradient.apply(c,_toConsumableArray(_g2));else throw new TypeError("Invalid vector dimension.");_M2.forEach(function(_ref35){var A=_ref35.offset,R=_ref35.color;var b=Object(n["default"])(R);O&&(b=s(b,O)),d.addColorStop(A,b);}),c.fillStyle=d,l=!0;}else p.fillStyle&&(S?c.fillStyle=s(p.fillStyle,S):c.fillStyle=p.fillStyle,l=!0);if(m&&c.transform.apply(c,_toConsumableArray(m)),c.transform.apply(c,_toConsumableArray(p.transformMatrix)),p.clipPath){var _g3=p.clipPath,_M3=new Path2D(_g3);c.clip(_M3);}var u=p.contours.length;if(p.contours.forEach(function(g,M){var A=g.length,R=A>1&&e.vec2.equals(g[0],g[A-1]),b=M===u-1&&p.texture;if(g&&A>0){if(l||T||b){c.beginPath(),c.moveTo.apply(c,_toConsumableArray(g[0]));for(var E=1;E<A;E++)E===A-1&&R?c.closePath():c.lineTo.apply(c,_toConsumableArray(g[E]));}if(l&&c.fill(p.fillRule),b){c.save(),c.clip();var _p$texture=p.texture,_E=_p$texture.image,L=_p$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,I=_E2.fillColor,C=_E2.strokeColor,W=_E2.strokeWidth,G=_E2.text;!I&&!C&&(I="#000"),Array.isArray(I)&&(I=Object(n["default"])(I)),Array.isArray(C)&&(C=Object(n["default"])(C)),c.font=D;var _c$measureText=c.measureText(G),K=_c$measureText.width,J=Object(i["default"])(D),Z=Math.max(J.pxLineHeight,J.pxHeight*1.13);c.textAlign="center",c.textBaseline="middle";var B=L.rect,$=B[0]+Z*0.5+J.pxHeight*0.06,Q=B[1]+K*0.5;B[2]!=null&&c.scale(B[2]/K,B[3]/Z),I&&(c.fillStyle=I,c.fillText(G,Q,$)),C&&(c.lineWidth=W,c.strokeStyle=C,c.strokeText(G,Q,$));}else{var _D2=L.rect;var _I=L.srcRect;L.scale&&(_D2=[0,0,c.canvas.width,c.canvas.height]),L.rotated&&_D2&&(_D2=[-_D2[1],_D2[0],_D2[3],_D2[2]]),_I&&(_D2=_D2||[0,0,_I[2],_I[3]]),L.rotated&&(c.translate(0,_D2?_D2[2]:_E.width),c.rotate(-0.5*Math.PI)),_I?c.drawImage.apply(c,[_E].concat(_toConsumableArray(_I),_toConsumableArray(_D2))):_D2?c.drawImage.apply(c,[_E].concat(_toConsumableArray(_D2))):c.drawImage(_E,0,0);}c.restore();}T&&c.stroke();}}),c.restore(),v){var _g4=p.filter;_g4&&o(c,_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,o,s){var _ref36;return o>s&&(_ref36=[s,o],o=_ref36[0],s=_ref36[1],_ref36),a<o?o:a>s?s:a;}function n(a,o,s){return a*(1-s)+o*s;}function i(a,o){var _a2=_slicedToArray(a,2),s=_a2[0],f=_a2[1];return[s*o[0]+f*o[2]+o[4],s*o[1]+f*o[3]+o[5]];}},/* 27 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return s;});var e=t(28),n=t(29);t(1).glMatrix.setMatrixArrayType(Array);function i(f,p,c){var v=f.uniforms||{},S=p.uniforms||{};if(v.u_texSampler&&S.u_texSampler&&v.u_texSampler!==S.u_texSampler)return!1;var O=Object.keys(v),x=Object.keys(S),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 l=O.every(function(d){var u=v[d],g=S[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(l){if(v.u_texSampler&&!S.u_texSampler)p.setTexture(v.u_texSampler,{hidden:!0});else if(!v.u_texSampler&&S.u_texSampler)for(var d=0;d<c.length;d++)c[d].setTexture(S.u_texSampler,{hidden:!0});}return l;}var a={};function o(f,p){if(f.length){var c=Object(e["default"])(f,a);return c.enableBlend=p,f[0].filterCanvas&&(c.filterCanvas=!0),c.packIndex=f[0].packIndex,c.packLength=f.length,c.beforeRender=f[0].beforeRender,c.pass=f[0].pass,c.afterRender=f[f.length-1].afterRender,f.length=0,c;}}function s(f,p){var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var v,S,O,x,m,_T11,_l8,u,d,_u6,g;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:v=[],S=f.options.bufferSize;O=0,x=!1;m=0;case 3:if(!(m<p.length)){_context8.next=47;break;}_T11=p[m];if(!(_T11 instanceof n["default"])){_context8.next=16;break;}_context8.t0=v.length;if(!_context8.t0){_context8.next=10;break;}_context8.next=10;return o(v,x);case 10:O=0;x=!1;_context8.next=14;return _T11;case 14:_context8.next=44;break;case 16:_l8=_T11.meshData;if(_l8.clipPath&&!_l8.uniforms.u_clipSampler){u=f.createTexture(_l8.clipPath);_l8.uniforms.u_clipSampler=u;}d=0;if(!((!c||!_T11.canIgnore())&&_l8&&_l8.positions.length)){_context8.next=40;break;}_T11.packIndex=m;_u6=_T11.filterCanvas;if(!(d=_l8.positions.length,_u6||O+d>S)){_context8.next=31;break;}_context8.t1=v.length;if(!_context8.t1){_context8.next=27;break;}_context8.next=27;return o(v,x);case 27:O=0;x=!1;_context8.next=39;break;case 31:if(!O){_context8.next=39;break;}g=v[v.length-1];_context8.t2=g&&(g.filterCanvas||g.afterRender||_T11.beforeRender||g.pass.length||_T11.pass.length||g.program!==_T11.program||!i(g,_T11,v));if(!_context8.t2){_context8.next=39;break;}_context8.next=37;return o(v,x);case 37:O=0;x=!1;case 39:v.push(_T11),x=x||_T11.enableBlend,O+=d;case 40:_context8.t3=m===p.length-1&&v.length;if(!_context8.t3){_context8.next=44;break;}_context8.next=44;return o(v,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,o){var s=0,f=0,p=0,c=0,v=0,S=0,O=0;var x=a[0].program;for(var m=0;m<a.length;m++){var _T12=a[m].meshData;if(_T12){O+=_T12.positions.length;var _l9=_T12.positions[0].length;s+=_T12.positions.length*_l9,f+=_T12.cells.length*3,S+=_T12.attributes.a_color.length*4;var d=_T12.textureCoord;d&&(p+=d.length*d[0].length);var u=_T12.attributes.a_sourceRect;u&&(c+=u.length*4);var g=_T12.attributes.a_clipUV;g&&(v+=g.length*2);}}if((!o.positions||o.positions.length<s)&&(o.positions=new Float32Array(s)),(!o.cells||o.cells.length<f)&&(o.cells=new Uint16Array(f)),p&&(!o.textureCoord||o.textureCoord.length<p)&&(o.textureCoord=new Float32Array(p)),(!o.a_color||o.a_color.length<S)&&(o.a_color=new Uint8Array(S)),c&&(!o.a_sourceRect||o.a_sourceRect.length<c)&&(o.a_sourceRect=new Float32Array(c)),v&&(!o.a_clipUV||o.a_clipUV.length<v)&&(o.a_clipUV=new Float32Array(v)),x){var _m3=Object.entries(x._attribute),_T13=x._attribOpts||{};for(var _l10=0;_l10<_m3.length;_l10++){var _m3$_l=_slicedToArray(_m3[_l10],2),_d4=_m3$_l[0],_u7=_m3$_l[1];if(_d4!=="a_color"&&_d4!=="a_sourceRect"&&_u7!=="ignored"){var _g5=_T13[_d4]?_T13[_d4].type:"FLOAT",M=e[_g5],A=_u7.size*O;(!o[_d4]||o[_d4].length<A)&&(o[_d4]=new M(A));}}}return o;}function i(a,o){var s=[],f=[],p=[],c=[],v=[],S=[],O=0,x=0;var m=a[0]?a[0].uniforms||{}:{},T=a[0]?a[0].program:null;o&&(n(a,o),f=o.cells,s=o.positions,p=o.textureCoord,c=o.a_color,v=o.a_sourceRect,S=o.a_clipUV);var l=!1,d=!1;var u={};for(var M=0;M<a.length;M++){var A=a[M];if(A){var _s2,_c2,_v,_S,_p2;if(A.meshData&&(A=A.meshData),o){var b=A.positions;for(var E=0;E<b.length;E++){var L=b[E],D=3*(O+E);for(var I=0;I<L.length;I++)s[D+I]=L[I];}}else(_s2=s).push.apply(_s2,_toConsumableArray(A.positions));var R=A.cells;for(var _b2=0;_b2<R.length;_b2++){var _E3=R[_b2];if(o){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(o){var _b3=A.attributes.a_color;for(var _E4=0;_E4<_b3.length;_E4++){var _L3=_b3[_E4],_D3=4*(O+_E4);c[_D3]=_L3[0],c[_D3+1]=_L3[1],c[_D3+2]=_L3[2],c[_D3+3]=_L3[3];}}else(_c2=c).push.apply(_c2,_toConsumableArray(A.attributes.a_color));if(A.attributes.a_sourceRect)if(l=!0,o){var _b4=A.attributes.a_sourceRect;for(var _E5=0;_E5<_b4.length;_E5++){var _L4=_b4[_E5],_D4=4*(O+_E5);v[_D4]=_L4[0],v[_D4+1]=_L4[1],v[_D4+2]=_L4[2],v[_D4+3]=_L4[3];}}else(_v=v).push.apply(_v,_toConsumableArray(A.attributes.a_sourceRect));if(A.attributes.a_clipUV)if(d=!0,o){var _b5=A.attributes.a_clipUV;for(var _E6=0;_E6<_b5.length;_E6++){var _L5=_b5[_E6],_D5=2*(O+_E6);S[_D5]=_L5[0],S[_D5+1]=_L5[1];}}else(_S=S).push.apply(_S,_toConsumableArray(A.attributes.a_clipUV));if(A.textureCoord)if(o){var _b6=A.textureCoord;for(var _E7=0;_E7<_b6.length;_E7++){var _L6=_b6[_E7],_D6=3*(O+_E7);for(var _I2=0;_I2<_L6.length;_I2++)p[_D6+_I2]=_L6[_I2];}}else(_p2=p).push.apply(_p2,_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]=[],o){u[_L7]=o[_L7];var _I3=A.attributes[_L7],C=_I3[0].length;for(var W=0;W<_I3.length;W++){var G=_I3[W],K=C*(O+W);for(var J=0;J<G.length;J++)u[_L7][K+J]=G[J];}}else(_u$_L=u[_L7]).push.apply(_u$_L,_toConsumableArray(A.attributes[_L7]));}}O+=A.positions.length,x+=A.cells.length;}}u.a_color=c,l&&v&&v.length>0&&(u.a_sourceRect=v);var g={positions:s,cells:f,attributes:u,uniforms:m,cellsCount:x*3,program:T};return p&&p.length&&(g.textureCoord=p),d&&S.length>0&&(u.a_clipUV=S),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 o(u,g){var M=Object.keys(u);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(u);g&&(A=A.filter(function(R){return Object.getOwnPropertyDescriptor(u,R).enumerable;})),M.push.apply(M,A);}return M;}function s(u){for(var g=1;g<arguments.length;g++){var M=arguments[g]!=null?arguments[g]:{};g%2?o(Object(M),!0).forEach(function(A){f(u,A,M[A]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(M)):o(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 p=Symbol("mesh"),c=Symbol("count"),v=Symbol("blend"),S=Symbol("filter"),O=Symbol("textures"),x=Symbol("textureOptions"),m=Symbol("cloudColor"),T=Symbol("cloudFilter"),l=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),R=new Float32Array(4*u),b=new Float32Array(4*u),E=new Float32Array(4*u),L=new Float32Array(4*u),D=new Float32Array(4*u),I=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),R.set(g.color0,0),b.set(g.color1,0),E.set(g.color2,0),L.set(g.color3,0),D.set(g.color4,0),I.set(g.frameIndex,0),C.set(g.fillColor,0),W.set(g.strokeColor,0)),{bufferSize:u,transform0:M,transform1:A,color0:R,color1:b,color2:E,color3:L,color4:D,frameIndex:I,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[c]=g,this[p]=u,this[l]=d(M),this[O]=[],this[S]=[],this[m]=!1,this[T]=!1,this[v]=!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[c];for(var M=u;M<g;M++)this[l].transform0.set([1,0,0],M*3),this[l].transform1.set([0,1,0],M*3),this[l].frameIndex.set([-1],M),this[l].fillColor.set([0,0,0,0],M*4),this[l].strokeColor.set([0,0,0,0],M*4),this.setColorTransform(M,null);}},{key:"bufferSize",get:function get(){return this[l].bufferSize;}},{key:"mesh",get:function get(){return this[p];},set:function set(u){this[p]=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[S][u]=this[S][u]||[],this[S][u];}},{key:"getFilter",value:function getFilter(u){return this._getFilter(u).join(" ");}},{key:"enableBlend",get:function get(){return this[p].enableBlend||this[v];}},{key:"canIgnore",value:function canIgnore(){return this[p].canIgnore();}},{key:"delete",value:function _delete(u){if(u>=this[c]||u<0)throw new Error("Out of range.");var _this$l2=this[l],g=_this$l2.transform0,M=_this$l2.transform1,A=_this$l2.color0,R=_this$l2.color1,b=_this$l2.color2,E=_this$l2.color3,L=_this$l2.color4,D=_this$l2.frameIndex,I=_this$l2.fillColor,C=_this$l2.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),R.set(R.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),I.set(I.subarray(4*(u+1)),4*u),C.set(C.subarray(4*(u+1)),4*u);for(var W in this[S])W===u?delete this[S][W]:W>u&&(this[S][W-1]=this[S][W],delete this[S][W]);this[c]--;}},{key:"setColorTransform",value:function setColorTransform(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$l3=this[l],M=_this$l3.color0,A=_this$l3.color1,R=_this$l3.color2,b=_this$l3.color3,E=_this$l3.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),R.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[v]=this[v]||g[18]<1,this[T]=!0):(M.set([1,0,0,0],u),A.set([0,1,0,0],u),R.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[c]||u<0)throw new Error("Out of range.");u*=4;var _this$l4=this[l],g=_this$l4.color0,M=_this$l4.color1,A=_this$l4.color2,R=_this$l4.color3,b=_this$l4.color4;return[g[u],M[u],A[u],R[u],b[u],g[u+1],M[u+1],A[u+1],R[u+1],b[u+1],g[u+2],M[u+2],A[u+2],R[u+2],b[u+2],g[u+3],M[u+3],A[u+3],R[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[c]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].fillColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"setStrokeColor",value:function setStrokeColor(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");typeof g=="string"&&(g=Object(a["default"])(g)),g[3]>0&&(this[m]=!0),this[l].strokeColor.set(g.map(function(M){return Math.round(255*M);}),4*u);}},{key:"getCloudRGBA",value:function getCloudRGBA(u){if(u>=this[c]||u<0)throw new Error("Out of range.");u*=4;var _this$l5=this[l],g=_this$l5.fillColor,M=_this$l5.strokeColor,A=[g[u],g[u+1],g[u+2],g[u+3]],R=[M[u],M[u+1],M[u+2],M[u+3]];return A[3]/=255,R[3]/=255,{fill:"rgba(".concat(A.join(),")"),stroke:"rgba(".concat(R.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[c]||u<0)throw new Error("Out of range.");u*=3,g==null&&(g=[1,0,0,1,0,0]);var _this$l6=this[l],M=_this$l6.transform0,A=_this$l6.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[c]||u<0)throw new Error("Out of range.");u*=3;var _this$l7=this[l],g=_this$l7.transform0,M=_this$l7.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[l].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[p].setTexture(u[0],g),this[O]=u,this[x]=g;}},{key:"setFrameIndex",value:function setFrameIndex(u,g){if(u>=this[c]||u<0)throw new Error("Out of range.");var M=this[O].length;if(M<=0)throw new Error("No frames");this[l].frameIndex[u]=g%M;}},{key:"amount",get:function get(){return this[c];},set:function set(u){var g=this[c];u!==g&&(u>this[l].bufferSize&&(this[l]=d(Math.max(u,this[l].bufferSize+1e3),this[l])),this[c]=u,u>g&&this.initBuffer(g));}},{key:"meshData",get:function get(){var _this$p$meshData=this[p].meshData,u=_this$p$meshData.attributes,g=_this$p$meshData.cells,M=_this$p$meshData.positions,A=_this$p$meshData.textureCoord,R=_this$p$meshData.uniforms,b=this[O],E={attributes:s({},u),cells:g,positions:M,textureCoord:A,uniforms:s({},R),instanceCount:this[c],enableBlend:this.enableBlend};b.length&&b.forEach(function($,Q){E.uniforms["u_texFrame".concat(Q)]=$;});var _this$l8=this[l],L=_this$l8.transform0,D=_this$l8.transform1,I=_this$l8.color0,C=_this$l8.color1,W=_this$l8.color2,G=_this$l8.color3,K=_this$l8.color4,J=_this$l8.fillColor,Z=_this$l8.strokeColor,B=_this$l8.frameIndex;return this[p].uniforms.u_texSampler&&(E.attributes.a_frameIndex={data:B,divisor:1}),E.attributes.a_transform0={data:L,divisor:1},E.attributes.a_transform1={data:D,divisor:1},E.attributes.a_colorCloud0={data:I,divisor:1},E.attributes.a_colorCloud1={data:C,divisor:1},E.attributes.a_colorCloud2={data:W,divisor:1},E.attributes.a_colorCloud3={data:G,divisor:1},E.attributes.a_colorCloud4={data:K,divisor:1},this.hasCloudColor&&(E.attributes.a_fillCloudColor={data:J,divisor:1},E.attributes.a_strokeCloudColor={data:Z,divisor:1}),E;}},{key:"setProgram",value:function setProgram(u){this[p].setProgram(u);}},{key:"program",get:function get(){return this[p].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 R=e.mat2d.create();return R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[M,A]),R=e.mat2d.rotate(Array.of(0,0,0,0,0,0),R,g),R=e.mat2d.translate(Array.of(0,0,0,0,0,0),R,[-M,-A]),this.transform(u,R);}},{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],R=_ref45[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),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,-R]),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],R=_ref49[1];var b=e.mat2d.create();return b=e.mat2d.translate(Array.of(0,0,0,0,0,0),b,[A,R]),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,-R]),this.transform(u,b);}},{key:"isPointCollision",value:function isPointCollision(u,_ref50){var _this$p;var _ref51=_slicedToArray(_ref50,2),g=_ref51[0],M=_ref51[1];var A=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var R=this.getTransform(u),b=Object(i.transformPoint)([g,M],e.mat2d.invert(Array.of(0,0,0,0,0,0),R));return(_this$p=this[p]).isPointCollision.apply(_this$p,_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 o;}),t.d(r,"contrast",function(){return s;}),t.d(r,"invert",function(){return f;}),t.d(r,"sepia",function(){return p;}),t.d(r,"opacity",function(){return c;}),t.d(r,"hueRotate",function(){return v;});var e=t(26);t(1).glMatrix.setMatrixArrayType(Array);function n(S,O){var x=[],m=S[0],T=S[1],l=S[2],d=S[3],u=S[4],g=S[5],M=S[6],A=S[7],R=S[8],b=S[9],E=S[10],L=S[11],D=S[12],I=S[13],C=S[14],W=S[15],G=S[16],K=S[17],J=S[18],Z=S[19];var B=O[0],$=O[1],Q=O[2],et=O[3],tt=O[4];return x[0]=B*m+$*g+Q*E+et*W,x[1]=B*T+$*M+Q*L+et*G,x[2]=B*l+$*A+Q*D+et*K,x[3]=B*d+$*R+Q*I+et*J,x[4]=B*u+$*b+Q*C+et*Z+tt,B=O[5],$=O[6],Q=O[7],et=O[8],tt=O[9],x[5]=B*m+$*g+Q*E+et*W,x[6]=B*T+$*M+Q*L+et*G,x[7]=B*l+$*A+Q*D+et*K,x[8]=B*d+$*R+Q*I+et*J,x[9]=B*u+$*b+Q*C+et*Z+tt,B=O[10],$=O[11],Q=O[12],et=O[13],tt=O[14],x[10]=B*m+$*g+Q*E+et*W,x[11]=B*T+$*M+Q*L+et*G,x[12]=B*l+$*A+Q*D+et*K,x[13]=B*d+$*R+Q*I+et*J,x[14]=B*u+$*b+Q*C+et*Z+tt,B=O[15],$=O[16],Q=O[17],et=O[18],tt=O[19],x[15]=B*m+$*g+Q*E+et*W,x[16]=B*T+$*M+Q*L+et*G,x[17]=B*l+$*A+Q*D+et*K,x[18]=B*d+$*R+Q*I+et*J,x[19]=B*u+$*b+Q*C+et*Z+tt,x;}function i(S){S=Object(e.clamp)(0,1,S);var O=0.2126*S,x=0.7152*S,m=0.0722*S;return[O+1-S,x,m,0,0,O,x+1-S,m,0,0,O,x,m+1-S,0,0,0,0,0,1,0];}function a(S){return[S,0,0,0,0,0,S,0,0,0,0,0,S,0,0,0,0,0,1,0];}function o(S){var O=0.2126*(1-S),x=0.7152*(1-S),m=0.0722*(1-S);return[O+S,x,m,0,0,O,x+S,m,0,0,O,x,m+S,0,0,0,0,0,1,0];}function s(S){var O=0.5*(1-S);return[S,0,0,0,O,0,S,0,0,O,0,0,S,0,O,0,0,0,1,0];}function f(S){var O=1-2*S;return[O,0,0,0,S,0,O,0,0,S,0,0,O,0,S,0,0,0,1,0];}function p(S){return[1-0.607*S,0.769*S,0.189*S,0,0,0.349*S,1-0.314*S,0.168*S,0,0,0.272*S,0.534*S,1-0.869*S,0,0,0,0,0,1,0];}function c(S){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,S,0];}function v(S){var O=S/180*Math.PI,x=Math.cos(O),m=Math.sin(O),T=0.2126,l=0.7152,d=0.0722;return[T+x*(1-T)+m*-T,l+x*-l+m*-l,d+x*-d+m*(1-d),0,0,T+x*-T+m*0.143,l+x*(1-l)+m*0.14,d+x*-d+m*-0.283,0,0,T+x*-T+m*-(1-T),l+x*-l+m*l,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 o=n()(a);if(!o||!o.length)throw new TypeError("Invalid color value.");return[o[0]/255,o[1]/255,o[2]/255,o[3]];}},/* 32 */ /***/function(h,r,t){var e=t(33),n=t(37),i=t(39);h.exports=function(o){var s,f=e(o);return f.space?(s=Array(3),s[0]=i(f.values[0],0,255),s[1]=i(f.values[1],0,255),s[2]=i(f.values[2],0,255),f.space[0]==="h"&&(s=n.rgb(s)),s.push(i(f.alpha,0,1)),s):[];};},/* 33 */ /***/function(h,r,t){(function(e){var n=t(34),i=t(35),a=t(36);h.exports=s;var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function s(f){var p,c=[],v=1,S;if(typeof f=="string"){if(n[f])c=n[f].slice(),S="rgb";else if(f==="transparent")v=0,S="rgb",c=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(f)){var O=f.slice(1),x=O.length,m=x<=4;v=1,m?(c=[parseInt(O[0]+O[0],16),parseInt(O[1]+O[1],16),parseInt(O[2]+O[2],16)],x===4&&(v=parseInt(O[3]+O[3],16)/255)):(c=[parseInt(O[0]+O[1],16),parseInt(O[2]+O[3],16),parseInt(O[4]+O[5],16)],x===8&&(v=parseInt(O[6]+O[7],16)/255)),c[0]||(c[0]=0),c[1]||(c[1]=0),c[2]||(c[2]=0),S="rgb";}else if(p=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(f)){var T=p[1],l=T==="rgb",O=T.replace(/a$/,"");S=O;var x=O==="cmyk"?4:O==="gray"?1:3;c=p[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(o[M]!==void 0)return o[M];}return parseFloat(M);}),T===O&&c.push(1),v=l||c[x]===void 0?1:c[x],c=c.slice(0,x);}else f.length>10&&/[0-9](?:\s|\/)/.test(f)&&(c=f.match(/([0-9]+)/g).map(function(u){return parseFloat(u);}),S=f.match(/([a-z])/ig).join("").toLowerCase());}else if(!isNaN(f))S="rgb",c=[f>>>16,(f&65280)>>>8,f&255];else if(i(f)){var d=a(f.r,f.red,f.R,null);d!==null?(S="rgb",c=[d,a(f.g,f.green,f.G),a(f.b,f.blue,f.B)]):(S="hsl",c=[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)]),v=a(f.a,f.alpha,f.opacity,1),f.opacity!=null&&(v/=100);}else(Array.isArray(f)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(f))&&(c=[f[0],f[1],f[2]],S="rgb",v=f.length===4?f[3]:1);return{space:S,values:c,alpha:v};}}).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,o=n[2]/100,s,f,p,c,v;if(a===0)return v=o*255,[v,v,v];o<0.5?f=o*(1+a):f=o+a-o*a,s=2*o-f,c=[0,0,0];for(var S=0;S<3;S++)p=i+1/3*-(S-1),p<0?p++:p>1&&p--,6*p<1?v=s+(f-s)*6*p:2*p<1?v=f:3*p<2?v=s+(f-s)*(2/3-p)*6:v=s,c[S]=v*255;return c;}},e.hsl=function(n){var i=n[0]/255,a=n[1]/255,o=n[2]/255,s=Math.min(i,a,o),f=Math.max(i,a,o),p=f-s,c,v,S;return f===s?c=0:i===f?c=(a-o)/p:a===f?c=2+(o-i)/p:o===f&&(c=4+(i-a)/p),c=Math.min(c*60,360),c<0&&(c+=360),S=(s+f)/2,f===s?v=0:S<=0.5?v=p/(f+s):v=p/(2-f-s),[c,v*100,S*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),o=t(43),s=/* @__PURE__ */t.n(o),f=t(44),p=t(46),c=/* @__PURE__ */t.n(p),v=t(53),S=t(55);t(1).glMatrix.setMatrixArrayType(Array);var O=Symbol("contours"),x=Symbol("path"),m=Symbol("simplify"),T=Symbol("scale"),l=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"])(s()(this[x]));this[O]=c()(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,R){return[].concat(_toConsumableArray(A),_toConsumableArray(R));});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"])(s()(this[x])).map(function(_ref56){var _ref57=_toArray(_ref56),R=_ref57[0],b=_ref57.slice(1);var E=[R];for(var L=0;L<b.length;L+=2){var D=b[L]-g,I=b[L+1]-M;E.push(D,I);}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(v.getPointAtLength)(this[O],g):null;}},{key:"getTotalLength",value:function getTotalLength(){return this.contours?Object(v.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,R,b,E,L){var D=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;if(E+=b,L+=b,A<=0||R<=0||L===E)return;L<E&&(L=E+l+(L-E)%l),L-E>l&&(L=E+l);var I=L-E;I>=l&&(L-=1e-3);var C=this[x].length>0&&I<l?"L":"M";var W=Object(S.getPoint)(g,M,A,R,E),G=Object(S.getPoint)(g,M,A,R,L),K=+!D;var J=I>Math.PI?1:0;D&&(J=1-J),C+=W.join(" "),C+="A".concat(A," ").concat(R," 0 ").concat(J," ").concat(K," ").concat(G.join(" ")),I>=l&&(C+="Z"),this.addPath(C);}},{key:"arc",value:function arc(g,M,A,R,b){var E=arguments.length>5&&arguments[5]!==undefined?arguments[5]:0;return this.ellipse(g,M,A,A,0,R,b,E);}},{key:"arcTo",value:function arcTo(g,M,A,R,b,E,L){this[O]=null,this[x].push(["A",g,M,A,R,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,R,b,E){this[O]=null,this[x].push(["C",g,M,A,R,b,E]);}},{key:"quadraticCurveTo",value:function quadraticCurveTo(g,M,A,R){this[O]=null,this[x].push(["Q",g,M,A,R]);}},{key:"rect",value:function rect(g,M,A,R){var b="M".concat(g," ").concat(M,"L").concat(g+A," ").concat(M,"L").concat(g+A," ").concat(M+R,"L").concat(g," ").concat(M+R,"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(o){var s=[];return o.replace(e,function(f,p,c){var v=p.toLowerCase();for(c=a(c),v=="m"&&c.length>2&&(s.push([p].concat(c.splice(0,2))),v="l",p=p=="m"?"l":"L");;){if(c.length==t[v])return c.unshift(p),s.push(c);if(c.length<t[v])throw new Error("malformed path data");s.push([p].concat(c.splice(0,t[v])));}}),s;}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function a(o){var s=o.match(i);return s?s.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,o=n[0].slice(),s=n[0].slice(),f=1;f<i;++f)for(var p=n[f],c=0;c<a;++c){var v=p[c];o[c]=Math.min(o[c],v),s[c]=Math.max(s[c],v);}return[o,s];}},/* 43 */ /***/function(h,r){h.exports=t;function t(e){var n=0,i=0,a=0,o=0;return e.map(function(s){s=s.slice();var f=s[0],p=f.toUpperCase();if(f!=p)switch(s[0]=p,f){case"a":s[6]+=a,s[7]+=o;break;case"v":s[1]+=o;break;case"h":s[1]+=a;break;default:for(var c=1;c<s.length;)s[c++]+=a,s[c++]+=o;}switch(p){case"Z":a=n,o=i;break;case"H":a=s[1];break;case"V":o=s[1];break;case"M":a=n=s[1],o=i=s[2];break;default:a=s[s.length-2],o=s[s.length-1];}return s;});}},/* 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(o){for(var s,f=[],p=0,c=0,v=0,S=0,O=null,x=null,m=0,T=0,l=0,d=o.length;l<d;l++){var u=o[l],g=u[0];switch(g){case"M":v=u[1],S=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],I=_L8[1],C=_L8[2],W=_L8[3],G=_L8[4],K=_L8[5],J=_L8[6],Z=_L8[7];return{x1:C,y1:W,x2:G,y2:K,x:J,y:Z};});for(var A=0,R;A<M.length;A++)R=M[A],u=["C",R.x1,R.y1,R.x2,R.y2,R.x,R.y],A<M.length-1&&f.push(u);break;case"S":var b=m,E=T;(s=="C"||s=="S")&&(b+=b-p,E+=E-c),u=["C",b,E,u[1],u[2],u[3],u[4]];break;case"T":s=="Q"||s=="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,v,S);break;}s=g,m=u[u.length-2],T=u[u.length-1],u.length>4?(p=u[u.length-4],c=u[u.length-3]):(p=m,c=T),f.push(u);}return f;}function i(o,s,f,p){return["C",o,s,f,p,f,p];}function a(o,s,f,p,c,v){return["C",o/3+2/3*f,s/3+2/3*p,c/3+2/3*f,v/3+2/3*p,c,v];}},/* 45 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Math.PI*2;function n(s,f,p,c){var v=s*c-f*p<0?-1:1;var S=s*p+f*c;return S>1&&(S=1),S<-1&&(S=-1),v*Math.acos(S);}function i(s,f,p,c,v,S,O,x,m,T){var l=T*(s-p)/2+m*(f-c)/2,d=-m*(s-p)/2+T*(f-c)/2,u=O*O,g=x*x,M=l*l,A=d*d;var R=u*g-u*A-g*M;R<0&&(R=0),R/=u*A+g*M,R=Math.sqrt(R)*(v===S?-1:1);var b=R*O/x*d,E=R*-x/O*l,L=T*b-m*E+(s+p)/2,D=m*b+T*E+(f+c)/2,I=(l-b)/O,C=(d-E)/x,W=(-l-b)/O,G=(-d-E)/x,K=n(1,0,I,C);var J=n(I,C,W,G);return S===0&&J>0&&(J-=e),S===1&&J<0&&(J+=e),[L,D,K,J];}function a(s,f){var p=1.3333333333333333*Math.tan(f/4),c=Math.cos(s),v=Math.sin(s),S=Math.cos(s+f),O=Math.sin(s+f);return[c,v,c-v*p,v+c*p,S+O*p,O-S*p,S,O];}function o(s,f,p,c,v,S,O,x,m){var T=Math.sin(m*e/360),l=Math.cos(m*e/360),d=l*(s-p)/2+T*(f-c)/2,u=-T*(s-p)/2+l*(f-c)/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(s,f,p,c,v,S,O,x,T,l),A=[];var R=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(R,b)),R+=b;return A.map(function(L){for(var D=0;D<L.length;D+=2){var I=L[D+0],C=L[D+1];I*=O,C*=x;var W=l*I-T*C,G=T*I+l*C;L[D+0]=W+M[0],L[D+1]=G+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(c,v,S){return c[0]=v,c[1]=S,c;}var o=[0,0],s=[0,0],f=[0,0];function p(c,v,S,O){e(S,a(o,O[1],O[2]),a(s,O[3],O[4]),a(f,O[5],O[6]),v,c);}h.exports=function(v,S,O){var x=[],m=[],T=[0,0];return v.forEach(function(l,d,u){if(l[0]==="M")n(T,l.slice(1)),m.length>0&&(x.push(m),m=[]);else if(l[0]==="C")p(m,S,T,l),a(T,l[5],l[6]);else throw new Error("illegal type in SVG: "+l[0]);}),m.length>0&&x.push(m),x.map(function(l){return i(l,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,o=typeof i.epsilon=="number"?i.epsilon:11920929e-14,s=typeof i.pathEpsilon=="number"?i.pathEpsilon:1,f=typeof i.angleEpsilon=="number"?i.angleEpsilon:0.01,p=i.angleTolerance||0,c=i.cuspLimit||0;return function(x,m,T,l,d,u){u||(u=[]),d=typeof d=="number"?d:1;var g=s/d;return g*=g,v(x,m,T,l,u,g),u;};function v(O,x,m,T,l,d){l.push(t(O));var u=O[0],g=O[1],M=x[0],A=x[1],R=m[0],b=m[1],E=T[0],L=T[1];S(u,g,M,A,R,b,E,L,l,d,0),l.push(t(T));}function S(O,x,m,T,l,d,u,g,M,A,R){if(!(R>a)){var b=Math.PI,E=(O+m)/2,L=(x+T)/2,D=(m+l)/2,I=(T+d)/2,C=(l+u)/2,W=(d+g)/2,G=(E+D)/2,K=(L+I)/2,J=(D+C)/2,Z=(I+W)/2,B=(G+J)/2,$=(K+Z)/2;if(R>0){var Q=u-O,et=g-x,tt=Math.abs((m-u)*et-(T-g)*Q),ot=Math.abs((l-u)*et-(d-g)*Q),q,gt;if(tt>o&&ot>o){if((tt+ot)*(tt+ot)<=A*(Q*Q+et*et)){if(p<f){M.push(e(B,$));return;}var dt=Math.atan2(d-T,l-m);if(q=Math.abs(dt-Math.atan2(T-x,m-O)),gt=Math.abs(Math.atan2(g-d,u-l)-dt),q>=b&&(q=2*b-q),gt>=b&&(gt=2*b-gt),q+gt<p){M.push(e(B,$));return;}if(c!==0){if(q>c){M.push(e(m,T));return;}if(gt>c){M.push(e(l,d));return;}}}}else if(tt>o){if(tt*tt<=A*(Q*Q+et*et)){if(p<f){M.push(e(B,$));return;}if(q=Math.abs(Math.atan2(d-T,l-m)-Math.atan2(T-x,m-O)),q>=b&&(q=2*b-q),q<p){M.push(e(m,T)),M.push(e(l,d));return;}if(c!==0&&q>c){M.push(e(m,T));return;}}}else if(ot>o){if(ot*ot<=A*(Q*Q+et*et)){if(p<f){M.push(e(B,$));return;}if(q=Math.abs(Math.atan2(g-d,u-l)-Math.atan2(d-T,l-m)),q>=b&&(q=2*b-q),q<p){M.push(e(m,T)),M.push(e(l,d));return;}if(c!==0&&q>c){M.push(e(l,d));return;}}}else if(Q=B-(O+u)/2,et=$-(x+g)/2,Q*Q+et*et<=A){M.push(e(B,$));return;}}S(O,x,E,L,G,K,B,$,M,A,R+1),S(B,$,J,Z,C,W,u,g,M,A,R+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 o;}),t.d(r,"dot",function(){return s;}),t.d(r,"rotate",function(){return f;}),t.d(r,"cross",function(){return p;}),t.d(r,"sub",function(){return c;}),t.d(r,"add",function(){return v;}),t.d(r,"computeMiter",function(){return m;}),t.d(r,"normal",function(){return T;}),t.d(r,"direction",function(){return l;});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,o=e.vec2.scaleAndAdd,s=e.vec2.dot,f=e.vec2.rotate,p=e.vec2.cross,c=e.vec2.sub,v=e.vec2.add,S=e.vec2.normalize,O=e.vec2.set,x=i();function m(d,u,g,M,A){v(d,g,M),S(d,d),O(u,-d[1],d[0]),O(x,-g[1],g[0]);var R=A/s(u,x);return Math.abs(R);}function T(d,u){return O(d,-u[1],u[0]),d;}function l(d,u,g){return c(d,u,g),S(d,d),d;}},/* 50 */ /***/function(h,r,t){var e=t(51),n=t(52);h.exports=function(a,o){return a=e(a,o),a=n(a,o),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,o=n[0],s=[o],f,p=1,c=n.length;p<c;p++)f=n[p],t(f,o)>a&&(s.push(f),o=f);return o!==f&&s.push(f),s;};},/* 52 */ /***/function(h,r){function t(n,i,a){var o=i[0],s=i[1],f=a[0]-o,p=a[1]-s;if(f!==0||p!==0){var c=((n[0]-o)*f+(n[1]-s)*p)/(f*f+p*p);c>1?(o=a[0],s=a[1]):c>0&&(o+=f*c,s+=p*c);}return f=n[0]-o,p=n[1]-s,f*f+p*p;}function e(n,i,a,o,s){for(var f=o,p,c=i+1;c<a;c++){var v=t(n[c],n[i],n[a]);v>f&&(p=c,f=v);}f>o&&(p-i>1&&e(n,i,p,o,s),s.push(n[p]),a-p>1&&e(n,p,a,o,s));}h.exports=function(i,a){if(i.length<=1)return i;a=typeof a=="number"?a:1;var o=a*a,s=i.length-1,f=[i[0]];return e(i,0,s,o,f),f.push(i[s]),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 o;});var e=t(54);t(1).glMatrix.setMatrixArrayType(Array);function n(s){if(s.totalLength!=null)return s.totalLength;var f=0;return s.forEach(function(p){var c=p[0];for(var v=1;v<p.length;v++){var S=p[v];f+=Object(e.distance)(c,S),c=S;}}),s.totalLength=f,f;}function i(s,f){var p=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 c=n(s);if(f>=c){var S=s[s.length-1],O=S[S.length-2],x=S[S.length-1],m=Math.atan2(x[1]-O[1],x[0]-O[0]);return{current:s.map(function(T){return _toConsumableArray(T);}),point:{x:x[0],y:x[1],angle:m}};}var v=[];for(var _S2=0;_S2<s.length;_S2++){v[_S2]=[];var _O=s[_S2];var _x10=_O[0];for(var _m4=1;_m4<_O.length;_m4++){var _T14=_O[_m4],_l11=Object(e.distance)(_x10,_T14);if(f<_l11){var d=f/_l11,u=Math.atan2(_T14[1]-_x10[1],_T14[0]-_x10[0]),g={x:_x10[0]*(1-d)+_T14[0]*d,y:_x10[1]*(1-d)+_T14[1]*d,angle:u};if(v[_S2].push(_x10),f>0&&v[_S2].push([g.x,g.y]),!p)return{current:v,point:g};var M=[],A=_S2;for(;_S2<s.length;_S2++){for(M[_S2-A]=[],_S2===A&&M[0].push([g.x,g.y]);_m4<_O.length;_m4++)M[_S2-A].push(_O[_m4]);_m4=0;}return{current:v,point:g,rest:M};}f-=_l11,v[_S2].push(_x10),_x10=_T14;}}}function a(s,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(s.length<=0)return{x:0,y:0,angle:0};if(f<=0){var p=s[0][0],c=s[0][1],v=Math.atan2(c[1]-p[1],c[0]-p[0]);return{x:p[0],y:p[1],angle:v};}return i(s,f,!1).point;}function o(s,f,p){var c=0,v=f[0],S=s;var O=[],x=f.length;if(p>0){do p-=f[c%x],c++;while(p>0);p<0&&(v=-p,c--);}else if(p<0){c=-1;do p+=f[c%x+x-1],c--;while(p<0);p>=0&&(c++,v=f[c%x+x-1]-p);}do{var m=i(S,v);S=m.rest,++c%2&&O.push.apply(O,_toConsumableArray(m.current));var _T15=c%x;_T15<0&&(_T15+=x),v=f[_T15];}while(S);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,s,f,p){var _ref59=_slicedToArray(_ref58,3),i=_ref59[0],a=_ref59[1],o=_ref59[2];return i=i*2/s-1,a=1-a*2/f,Number.isFinite(p)?(o=o*2/p-1,[i,a,o]):[i,a];}function n(_ref60,_ref61){var _ref62=_slicedToArray(_ref60,3),i=_ref62[0],a=_ref62[1],_ref62$=_ref62[2],o=_ref62$===void 0?0:_ref62$;var _ref63=_slicedToArray(_ref61,3),s=_ref63[0],f=_ref63[1],_ref63$=_ref63[2],p=_ref63$===void 0?0:_ref63$;return Math.hypot(s-i,f-a,p-o);}},/* 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,o,s,f){f%=e,f<0&&(f+=e);var p=Math.tan(f);if(Math.abs(p)<1e5){var c=a-p*i,v=1/Math.pow(o,2)+Math.pow(p,2)/Math.pow(s,2);var S=-1;(f<=Math.PI/2||f>3*Math.PI/2)&&(S=1);var O=S*Math.sqrt(1/v)+i,x=p*O+c;return[O,x];}return f<Math.PI?[i,a+s]:[i,a-s];}},/* 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),o=t(28),s=t(24),f=t(30),p=t(59),c=t(53),v=t(60),S=/* @__PURE__ */t.n(v),O=t(46),x=/* @__PURE__ */t.n(O),m=t(31),T=t(40),l=t(21);t(1).glMatrix.setMatrixArrayType(Array);function d(X,N){if(X==null)return{};var z=u(X,N),y,P;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(X);for(P=0;P<w.length;P++)y=w[P],!(N.indexOf(y)>=0)&&Object.prototype.propertyIsEnumerable.call(X,y)&&(z[y]=X[y]);}return z;}function u(X,N){if(X==null)return{};var z={},y=Object.keys(X),P,w;for(w=0;w<y.length;w++)P=y[w],!(N.indexOf(P)>=0)&&(z[P]=X[P]);return z;}var g=Symbol("mesh"),M=Symbol("contours"),A=Symbol("stroke"),R=Symbol("fill"),b=Symbol("strokeColor"),E=Symbol("fillColor"),L=Symbol("transform"),D=Symbol("invertTransform"),I=Symbol("uniforms"),C=Symbol("texOptions"),W=Symbol("blend"),G=Symbol("applyTexture"),K=Symbol("applyTransform"),J=Symbol("applyGradientTransform"),Z=Symbol("applyProgram"),B=Symbol("gradient"),$=Symbol("filter"),Q=Symbol("opacity"),et=Symbol("program"),tt=Symbol("attributes"),ot=Symbol("pass"),q=Symbol("clipContext"),gt=Symbol("applyClipPath");function dt(X,N){var z=X[1][0]-X[0][0],y=X[1][1]-X[0][1],P=[];for(var w=0;w<N.length;w++){var U=N[w],H=[(U[0]-X[0][0])/z,1-(U[1]-X[0][1])/y];P.push(H);}return P;}function F(_ref64,_ref65,_ref66){var _ref67=_slicedToArray(_ref64,2),X=_ref67[0],N=_ref67[1];var _ref68=_slicedToArray(_ref65,4),z=_ref68[0],y=_ref68[1],P=_ref68[2],w=_ref68[3];var U=_ref66.scale;return U||(X/=P,N=1-N/w,X-=z,N+=y),[X,N,0];}function j(X,N,z){var y=x()(X,N,z);return y.path=X,y.simplify=z,y.scale=N,y;}var V=/*#__PURE__*/function(){function V(N){_classCallCheck(this,V);this[A]=null,this[R]=null,this[L]=[1,0,0,1,0,0],this[Q]=1,this[I]={},this[$]=[],this[W]=null,this[C]={},this.contours=N.contours,this[et]=null,this[tt]={},this[ot]=[];}return _createClass(V,[{key:"contours",get:function get(){return this[M];},set:function set(N){this[g]=null,this[M]=N;var z=N.scale;this.transformScale/z>1.5&&this.accurate(this.transformScale);}},{key:"setProgram",value:function setProgram(N){this[et]=N,this[g]&&this[Z](N);}},{key:"program",get:function get(){return this[et];}},{key:"setAttribute",value:function setAttribute(N,z){z==null?delete this[tt][N]:this[tt][N]=z;}},{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(z){z[2]=1/z[2]>0?N:-N;}),this[Q]=N;}},{key:"setClipPath",value:function setClipPath(N){this.clipPath=N,this[I].u_clipSampler&&this[I].u_clipSampler["delete"](),this.setUniforms({u_clipSampler:null}),this[g]&&delete this[g].attributes.a_clipUV,N&&this[g]&&this[gt]();}},{key:gt,value:function value(){if(this.clipPath){this[q]||(this[q]=l["default"].createCanvas(1,1));var _this$boundingBox=_slicedToArray(this.boundingBox,2),_this$boundingBox$=_slicedToArray(_this$boundingBox[0],2),N=_this$boundingBox$[0],z=_this$boundingBox$[1],_this$boundingBox$2=_slicedToArray(_this$boundingBox[1],2),y=_this$boundingBox$2[0],P=_this$boundingBox$2[1];y&&P&&(this[q].width=y-N,this[q].height=P-z);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,-z),w.fillStyle="white",w.fill(U),w.restore(),this[g].clipPath=this[q];var H=dt(this.boundingBox,this[g].position0);this[g].attributes.a_clipUV=H;}}},{key:"getPointAtLength",value:function getPointAtLength(N){return Object(c.getPointAtLength)(this[M],N);}},{key:"getTotalLength",value:function getTotalLength(){return Object(c.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 z=N.position0;if(z.length)N.boundingBox=i()(z);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[R]?this[R].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(s["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(s["default"])(this[E]):"";}},{key:"gradient",get:function get(){return this[B];}},{key:"texture",get:function get(){return this[I].u_texSampler?{image:this[I].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[I].u_colorMatrix!=null&&this[I].u_colorMatrix[18]<1||this[I].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[$].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[I];}},{key:"pass",get:function get(){return this[ot];}},{key:Z,value:function value(N){var z=this[tt],y=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],H=_P$w[1];if(U!=="a_color"&&U!=="a_sourceRect"&&H!=="ignored"){var Y=z[U];if(U==="uv"&&!Y){var k=this[g].boundingBox||i()(y);this[g].attributes[U]=dt(k,y);}else{this[g].attributes[U]=[];for(var _k=0;_k<y.length;_k++){var rt=y[_k];this[g].attributes[U].push(Y?Y(rt,w,y):Array(H.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[R]&&!this[A]&&this.setFill();var N=this[M],z={};if(N&&N.length){if(this[R])try{var w=S()(N,this[R]);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
|
-
},z.fill=w;}catch(_unused8){}if(this[A]){var _w=this[A].lineDash;var U=N;if(_w){var Y=this[A].lineDashOffset;U=Object(c.getDashContours)(N,_w,Y);}var H=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 S()([it]);});H.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);});})};}),z.stroke=Object(o["default"])(H);}}var y=Object(o["default"])([z.fill,z.stroke]);y.fillPointCount=z.fill?z.fill.positions.length:0,y.enableBlend=this.enableBlend,y.position0=y.positions.map(function(_ref69){var _ref70=_slicedToArray(_ref69,3),w=_ref70[0],U=_ref70[1],H=_ref70[2];return[w,U,H];}),y.uniforms=this[I],this[g]=y,this[I].u_texSampler&&this[G](y,this[C]);var P=this[L];Object(p.isUnitTransform)(P)||(this[K](y,P),this[I].u_radialGradientVector&&this[J]()),this.clipPath&&this[gt](),this[et]&&this[Z](this[et]);}return this._updateMatrix&&(this[g].matrix=this[L],this[K](this[g],this[L]),this[I].u_radialGradientVector&&this[J]()),this[g];}},{key:K,value:function value(N,z){var y=N.positions,P=N.position0;for(var w=0;w<y.length;w++){var _P$w2=_slicedToArray(P[w],2),U=_P$w2[0],H=_P$w2[1],Y=y[w];Y[0]=U*z[0]+H*z[2]+z[4],Y[1]=U*z[1]+H*z[3]+z[5];}this._updateMatrix=!1;}},{key:J,value:function value(){var N=this[L],z=_toConsumableArray(this._radialGradientVector);if(z){var _z=_slicedToArray(z,5),y=_z[0],P=_z[1],w=_z[3],U=_z[4];z[0]=y*N[0]+P*N[2]+N[4],z[1]=y*N[1]+P*N[3]+N[5],z[3]=w*N[0]+U*N[2]+N[4],z[4]=w*N[1]+U*N[3]+N[5],this[I].u_radialGradientVector=z;}}},{key:G,value:function value(N,z){function y(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[I].u_texSampler;if(!P)return;var _P$_img=P._img,w=_P$_img.width,U=_P$_img.height,H=z.srcRect;var Y=z.rect||[0,0];if(z.rotated&&(Y=[-Y[1],Y[0],Y[3],Y[2]]),Y[2]==null&&(Y[2]=H?H[2]:w),Y[3]==null&&(Y[3]=H?H[3]:U),z.hidden)N.textureCoord=N.positions.map(function(){return[-1,-1,-1];});else if(!N.textureCoord||!y(this[C].rect,z.rect)||this[C].hidden!==z.hidden||this[C].rotated!==z.rotated){var k=null;z.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(z.rotated){var at=rt*k[0]+it*k[2]+k[4],st=rt*k[1]+it*k[3]+k[5];rt=at;it=st;}var ut=F([rt,it],[Y[0]/Y[2],Y[1]/Y[3],Y[2],Y[3]],z);return z.repeat&&(ut[2]=1),ut;}return[-1,-1,-1];});}if(H){var _k2=[H[0]/w,H[1]/U,H[2]/w,H[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 y=this.contours.simplify,P=j(this.contours.path,2*N,y);this[g]=null,this[M]=P;}}},{key:"canIgnore",value:function canIgnore(){var N=this[A]==null||this[A].lineWidth===0||this[b][3]===0,z=this[R]==null||this[E][3]===0,y=this[I].u_radialGradientVector==null,P=this[I].u_texSampler==null;return this[Q]===0||this[et]==null&&N&&z&&y&&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,z=_ref73$cap===void 0?"butt":_ref73$cap,_ref73$join=_ref73.join,y=_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,H=_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:z,lineJoin:y,miterLimit:P,roundSegments:Y}),typeof w=="string"&&(w=Object(m["default"])(w)),this[b]=w,this[A].lineDash=U,this[A].lineDashOffset=H,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,z=_ref74$color===void 0?[0,0,0,0]:_ref74$color;return this[g]=null,this[R]={rule:N},typeof z=="string"&&(z=Object(m["default"])(z)),this[E]=z,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 z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(N&&N.image){var _N=N,y=_N.image,P=_N.rect;if(N=y,z.rect)for(var w=0;w<z.rect.length;w++)P[w]=z.rect[w];z.rect=P;}return this[R]||this.setFill(),this.setUniforms({u_texSampler:N}),this[g]&&this[G](this[g],z),this[C]=z,this;}},{key:"setCircularGradient",value:function setCircularGradient(){var _ref75=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref75.vector,z=_ref75.colors,_ref75$type=_ref75.type,y=_ref75$type===void 0?"fill":_ref75$type;if(N.length!==3)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:z,type:y});}},{key:"setLinearGradient",value:function setLinearGradient(){var _ref76=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref76.vector,z=_ref76.colors,_ref76$type=_ref76.type,y=_ref76$type===void 0?"fill":_ref76$type;if(N.length!==4)throw new TypeError("Invalid linearGradient.");this.setGradient({vector:N,colors:z,type:y});}},{key:"setRadialGradient",value:function setRadialGradient(){var _ref77=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},N=_ref77.vector,z=_ref77.colors,_ref77$type=_ref77.type,y=_ref77$type===void 0?"fill":_ref77$type;if(N.length!==6)throw new TypeError("Invalid radialGradient.");this.setGradient({vector:N,colors:z,type:y});}/**
|
|
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,z=_ref78.colors,_ref78$type=_ref78.type,y=_ref78$type===void 0?"fill":_ref78$type;z=z.map(function(_ref79){var U=_ref79.offset,H=_ref79.color;return typeof H=="string"&&(H=Object(m["default"])(H)),{offset:U,color:H};}),this[B]=this[B]||{},this[B][y]={vector:N,colors:z},z.sort(function(U,H){return U.offset-H.offset;});var P=[];z.forEach(function(_ref80){var U=_ref80.offset,H=_ref80.color;P.push.apply(P,[U].concat(_toConsumableArray(H)));});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[I].u_colorSteps=P,y==="fill"?this[I].u_gradientType=1:this[I].u_gradientType=0,this[J](),this;}},{key:"setUniforms",value:function setUniforms(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return Object.assign(this[I],N),this;}},{key:"setTransform",value:function setTransform(){var z=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,z)||(this[L]=N,delete this[D],this._updateMatrix=!0),this;}},{key:"transform",value:function transform(){var z=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),z,N),delete this[D],this._updateMatrix=!0,this;}},{key:"translate",value:function translate(N,z){var y=e.mat2d.create();return y=e.mat2d.translate(Array.of(0,0,0,0,0,0),y,[N,z]),this.transform.apply(this,_toConsumableArray(y));}},{key:"rotate",value:function rotate(N){var _ref81=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0,0],_ref82=_slicedToArray(_ref81,2),z=_ref82[0],y=_ref82[1];var P=e.mat2d.create();return P=e.mat2d.translate(Array.of(0,0,0,0,0,0),P,[z,y]),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,[-z,-y]),this.transform.apply(this,_toConsumableArray(P));}},{key:"scale",value:function scale(N){var z=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),y=_ref84[0],P=_ref84[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[y,P]),w=e.mat2d.scale(Array.of(0,0,0,0,0,0),w,[N,z]),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-y,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"skew",value:function skew(N){var z=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),y=_ref86[0],P=_ref86[1];var w=e.mat2d.create();return w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[y,P]),w=e.mat2d.multiply(Array.of(0,0,0,0,0,0),w,e.mat2d.fromValues(1,Math.tan(z),Math.tan(N),1,0,0)),w=e.mat2d.translate(Array.of(0,0,0,0,0,0),w,[-y,-P]),this.transform.apply(this,_toConsumableArray(w));}},{key:"clearFilter",value:function clearFilter(){return this.setColorTransform(null),this[$].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 z=this.uniforms.u_colorMatrix;for(var _len6=arguments.length,N=new Array(_len6),_key6=0;_key6<_len6;_key6++){N[_key6]=arguments[_key6];}return z?z=Object(f.multiply)(z,N):z=N,this.setColorTransform.apply(this,_toConsumableArray(z)),this;}},{key:"blur",value:function blur(N){return this[$].push("blur(".concat(N,"px)")),this;}},{key:"brightness",value:function brightness(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].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[$].push("contrast(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.contrast)(N)));}},{key:"dropShadow",value:function dropShadow(N,z){var y=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(s["default"])(P)),this[$].push("drop-shadow(".concat(N,"px ").concat(z,"px ").concat(y,"px ").concat(P,")")),this;}},{key:"grayscale",value:function grayscale(){var N=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return this[$].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[$].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[$].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[$].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[$].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[$].push("sepia(".concat(100*N,"%)")),this.transformColor.apply(this,_toConsumableArray(Object(f.sepia)(N)));}},{key:"url",value:function url(N){return this[$].push("url(".concat(N,")")),this;}},{key:"isPointCollision",value:function isPointCollision(N,z){var y=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"both";var P=this.meshData,w=P.positions,U=P.cells,H=this.invertMatrix,Y=H[0]*N+H[2]*z+H[4],k=H[1]*N+H[3]*z+H[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),at=_ref91[0],st=_ref91[1];var _ref92=_slicedToArray(_ref89,2),ft=_ref92[0],vt=_ref92[1];var mt=ft-at,pt=vt-st,St=((lt-at)*mt+(ut-st)*pt)/(Math.pow(mt,2)+Math.pow(pt,2));return St>=0&&St<=1;}for(var lt=0;lt<U.length;lt++){var ut=U[lt];if(y==="fill"&&ut[0]>=P.fillPointCount)break;if(y==="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),at=_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],pt=_ut$map2$3[1],St=Math.sign((N-at)*(vt-st)-(ft-at)*(z-st));if(St===0&&it([N,z],[at,st],[ft,vt]))return!0;var It=Math.sign((N-ft)*(pt-vt)-(mt-ft)*(z-vt));if(It===0&&it([N,z],[ft,vt],[mt,pt]))return!0;var Et=Math.sign((N-mt)*(st-pt)-(at-mt)*(z-pt));if(Et===0&&it([N,z],[mt,pt],[at,st])||St===1&&It===1&&Et===1||St===-1&&It===-1&&Et===-1)return!0;}return!1;}},{key:"isPointInFill",value:function isPointInFill(N,z){return this.isPointCollision(N,z,"fill");}},{key:"isPointInStroke",value:function isPointInStroke(N,z){return this.isPointCollision(N,z,"stroke");}},{key:"addPass",value:function addPass(N){var z=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var y=z.width,P=z.height,w=d(z,["width","height"]);var U=new T["default"]();U.rect(0,0,y,P);var H=new V(U,{width:y,height:P});H.setUniforms(w),H.setProgram(N),this[ot].push(H);}}]);}();},/* 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 p;});var e=t(49);t(1).glMatrix.setMatrixArrayType(Array);var n=Object(e.create)(),i=Object(e.create)(),a=Object(e.create)(),o=Object(e.create)(),s=Object(e.create)(),f=1e20;var p=/*#__PURE__*/function(){function p(){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,l=_ref93$lineCap===void 0?"butt":_ref93$lineCap,_ref93$roundSegments=_ref93.roundSegments,d=_ref93$roundSegments===void 0?20:_ref93$roundSegments;_classCallCheck(this,p);this.lineWidth=x,this.lineJoin=m,this.miterLimit=T,this.lineCap=l,this.roundSegments=d,this._normal=null;}return _createClass(p,[{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 l={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],R=x[_M4],b=x[_M4+1];this._seg(l,A,R,b,d,m);}return!m&&u==="round"&&S(l,this.roundSegments),[].concat(_toConsumableArray(l.left),_toConsumableArray(l.right.reverse()));}},{key:"_seg",value:function _seg(x,m,T,l,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||v(x,m,this._normal,d),!l)Object(e.normal)(this._normal,i),u?v(x,m,this._normal,d):v(x,T,this._normal,d);else{Object(e.direction)(a,l,T);var A=Object(e.computeMiter)(o,s,i,a,d);A=Math.min(A,f);var R=Object(e.dot)(o,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*R),c(x,n,R);var E=1/0;m&&(E=Math.min(E,Math.hypot(T[0]-m[0],T[1]-m[1]))),l&&(E=Math.min(E,Math.hypot(l[0]-T[0],l[1]-T[1])));var L=Math.max(d,Math.min(A,E));if(Object(e.scaleAndAdd)(n,T,s,L*R),c(x,n,-R),l)if(Object(e.normal)(n,a),Object(e.copy)(this._normal,n),Object(e.scaleAndAdd)(n,T,n,-d*R),M){var D=Object(e.clone)(n),I=R>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)(),I,C),G=Object(e.sub)(Object(e.create)(),D,C),K=Math.PI/this.roundSegments;for(var J=0;J<this.roundSegments&&(Object(e.rotate)(W,W,[0,0],R*K),Math.sign(Object(e.cross)(n,W,G)[2])===R);J++)Object(e.add)(n,W,C),c(x,n,R);c(x,D,R);}else c(x,n,R);}else v(x,T,s,A),Object(e.copy)(this._normal,s);}}}]);}();function c(O,x,m){m>0?O.left.push(Object(e.clone)(x)):O.right.push(Object(e.clone)(x));}function v(O,x,m,T){var l=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;Object(e.scaleAndAdd)(n,x,m,-T),c(O,n,-l),Object(e.scaleAndAdd)(n,x,m,T),c(O,n,l);}function S(_ref94,m){var O=_ref94.left,x=_ref94.right;var T=Object(e.create)(),l=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)(l,d,g);for(var M=1;M<=m;M++){var A=-1*Math.PI*M/m;Object(e.rotate)(T,l,[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)(l,d,g);for(var _M5=1;_M5<=m;_M5++){var _A2=-1*Math.PI*_M5/m;Object(e.rotate)(T,l,[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,l){return T.concat(l);});});var o=a.rule==="evenodd"?e.WINDING_ODD:e.WINDING_NONZERO;for(var s=e.tesselate(n({contours:i,windingRule:o,elementType:e.POLYGONS,polySize:3,vertexSize:2},a)),f=[],p=0;p<s.vertices.length;p+=a.vertexSize){var c=s.vertices.slice(p,p+a.vertexSize);f.push(c);}var v=[];for(p=0;p<s.elements.length;p+=3){var S=s.elements[p],O=s.elements[p+1],x=s.elements[p+2];v.push([S,O,x]);}return{positions:f,cells:v};};},/* 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(l){for(var d=l.debug||!1,u=new T(),g=0;g<l.contours.length;g++)u.addContour(l.vertexSize||2,l.contours[g]);return u.tesselate(l.windingRule||e.WINDING_ODD,l.elementType||e.POLYGONS,l.polySize||3,l.vertexSize||2,l.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(l){if(!l)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 o(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1;}function s(l){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=l;}s.prototype={get Rface(){return this.Sym.Lface;},set Rface(l){this.Sym.Lface=l;},get Dst(){return this.Sym.Org;},set Dst(l){this.Sym.Org=l;},get Oprev(){return this.Sym.Lnext;},set Oprev(l){this.Sym.Lnext=l;},get Lprev(){return this.Onext.Sym;},set Lprev(l){this.Onext.Sym=l;},get Dprev(){return this.Lnext.Sym;},set Dprev(l){this.Lnext.Sym=l;},get Rprev(){return this.Sym.Onext;},set Rprev(l){this.Sym.Onext=l;},get Dnext(){return/*this.Rprev*/this.Sym.Onext.Sym;},/* 3 pointers */set Dnext(l){this.Sym.Onext.Sym=l;},/* 3 pointers */get Rnext(){return/*this.Oprev*/this.Sym.Lnext.Sym;},/* 3 pointers */set Rnext(l){this.Sym.Lnext.Sym=l;}/* 3 pointers */};function f(){var l=new a(),d=new o(),u=new s(0),g=new s(1);l.next=l.prev=l,l.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=l,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_(l){var d=new s(0),u=new s(1);l.Sym.side<l.side&&(l=l.Sym);var g=l.Sym.next;return u.next=g,g.Sym.next=d,d.next=l,l.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_(l,d){var u=l.Onext,g=d.Onext;u.Sym.Lnext=d,g.Sym.Lnext=l,l.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_(l,d,u){var g=l;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_(l,d,u){var g=l;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_(l){l.Sym.side<l.side&&(l=l.Sym);var d=l.next,u=l.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_(l,d){var u=l.anEdge,g=u;do g.Org=d,g=g.Onext;while(g!==u);var M=l.prev,A=l.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_(l,d){var u=l.anEdge,g=u;do g.Lface=d,g=g.Lnext;while(g!==u);var M=l.prev,A=l.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 l=new a(),d=new a(),u=new o(),g=this.makeEdge_(this.eHead);return this.makeVertex_(l,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(l,d){var u=!1,g=!1;if(l!==d){if(d.Org!==l.Org&&(g=!0,this.killVertex_(d.Org,l.Org)),d.Lface!==l.Lface&&(u=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(d,l),!g){var M=new a();this.makeVertex_(M,d,l.Org),l.Org.anEdge=l;}if(!u){var A=new o();this.makeFace_(A,d,l.Lface),l.Lface.anEdge=l;}}},/* 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(l){var d=l.Sym,u=!1;if(l.Lface!==l.Rface&&(u=!0,this.killFace_(l.Lface,l.Rface)),l.Onext===l)this.killVertex_(l.Org,null);else if(l.Rface.anEdge=l.Oprev,l.Org.anEdge=l.Onext,this.splice_(l,l.Oprev),!u){var g=new o();this.makeFace_(g,l,l.Lface);}d.Onext===d?(this.killVertex_(d.Org,null),this.killFace_(d.Lface,null)):(l.Lface.anEdge=d.Oprev,d.Org.anEdge=d.Onext,this.splice_(d,d.Oprev)),this.killEdge_(l);},/******************** 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(l){var d=this.makeEdge_(l),u=d.Sym;this.splice_(d,l.Lnext),d.Org=l.Dst;var g=new a();return this.makeVertex_(g,u,d.Org),d.Lface=u.Lface=l.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(l,d){var u=this.addEdgeVertex(l),g=u.Sym;return this.splice_(l.Sym,l.Sym.Oprev),this.splice_(l.Sym,g),l.Dst=g.Org,g.Dst.anEdge=g.Sym,g.Rface=l.Rface,g.winding=l.winding,g.Sym.winding=l.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(l,d){var u=!1,g=this.makeEdge_(l),M=g.Sym;if(d.Lface!==l.Lface&&(u=!0,this.killFace_(d.Lface,l.Lface)),this.splice_(g,l.Lnext),this.splice_(M,d),g.Org=l.Dst,M.Org=d.Org,g.Lface=M.Lface=l.Lface,l.Lface.anEdge=M,!u){var A=new o();this.makeFace_(A,g,l.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(l){var d=l.anEdge,u,g,M,A,R;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=l.prev,R=l.next,R.prev=A,A.next=R;},countFaceVerts_:function countFaceVerts_(l){var d=l.anEdge,u=0;do u++,d=d.Lnext;while(d!==l.anEdge);return u;},//int tessMeshMergeConvexFaces( TESSmesh *mesh, int maxVertsPerFace )
|
|
164
|
-
mergeConvexFaces:function mergeConvexFaces(l){var d,u,g,M,A,R,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&&(R=this.countFaceVerts_(d),b=this.countFaceVerts_(M.Lface),R+b-2<=l&&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 l=this.fHead,d=this.vHead,u=this.eHead,g,M,A,R,b,E;for(M=l,M=l;(g=M.next)!==l;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),R=d,R=d;(A=R.next)!==d;R=A){i(A.prev===R),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===R&&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(l,d){return l.s===d.s&&l.t===d.t;},n.vertLeq=function(l,d){return l.s<d.s||l.s===d.s&&l.t<=d.t;},n.transLeq=function(l,d){return l.t<d.t||l.t===d.t&&l.s<=d.s;},n.edgeGoesLeft=function(l){return n.vertLeq(l.Dst,l.Org);},n.edgeGoesRight=function(l){return n.vertLeq(l.Org,l.Dst);},n.vertL1dist=function(l,d){return Math.abs(l.s-d.s)+Math.abs(l.t-d.t);},n.edgeEval=function(l,d,u){i(n.vertLeq(l,d)&&n.vertLeq(d,u));var g=d.s-l.s,M=u.s-d.s;return g+M>0?g<M?d.t-l.t+(l.t-u.t)*(g/(g+M)):d.t-u.t+(u.t-l.t)*(M/(g+M)):0;},n.edgeSign=function(l,d,u){i(n.vertLeq(l,d)&&n.vertLeq(d,u));var g=d.s-l.s,M=u.s-d.s;return g+M>0?(d.t-u.t)*g+(d.t-l.t)*M:0;},n.transEval=function(l,d,u){i(n.transLeq(l,d)&&n.transLeq(d,u));var g=d.t-l.t,M=u.t-d.t;return g+M>0?g<M?d.s-l.s+(l.s-u.s)*(g/(g+M)):d.s-u.s+(u.s-l.s)*(M/(g+M)):0;},n.transSign=function(l,d,u){i(n.transLeq(l,d)&&n.transLeq(d,u));var g=d.t-l.t,M=u.t-d.t;return g+M>0?(d.s-u.s)*g+(d.s-l.s)*M:0;},n.vertCCW=function(l,d,u){return l.s*(d.t-u.t)+d.s*(u.t-l.t)+u.s*(l.t-d.t)>=0;},n.interpolate=function(l,d,u,g){return l=l<0?0:l,u=u<0?0:u,l<=u?u===0?(d+g)/2:d+(g-d)*(l/(l+u)):g+(d-g)*(u/(l+u));},n.intersect=function(l,d,u,g,M){var A,R,b;n.vertLeq(l,d)||(b=l,l=d,d=b),n.vertLeq(u,g)||(b=u,u=g,g=b),n.vertLeq(l,u)||(b=l,l=u,u=b,b=d,d=g,g=b),n.vertLeq(u,d)?n.vertLeq(d,g)?(A=n.edgeEval(l,u,d),R=n.edgeEval(u,d,g),A+R<0&&(A=-A,R=-R),M.s=n.interpolate(A,u.s,R,d.s)):(A=n.edgeSign(l,u,d),R=-n.edgeSign(l,g,d),A+R<0&&(A=-A,R=-R),M.s=n.interpolate(A,u.s,R,g.s)):M.s=(u.s+d.s)/2,n.transLeq(l,d)||(b=l,l=d,d=b),n.transLeq(u,g)||(b=u,u=g,g=b),n.transLeq(l,u)||(b=l,l=u,u=b,b=d,d=g,g=b),n.transLeq(u,d)?n.transLeq(d,g)?(A=n.transEval(l,u,d),R=n.transEval(u,d,g),A+R<0&&(A=-A,R=-R),M.t=n.interpolate(A,u.t,R,d.t)):(A=n.transSign(l,u,d),R=-n.transSign(l,g,d),A+R<0&&(A=-A,R=-R),M.t=n.interpolate(A,u.t,R,g.t)):M.t=(u.t+d.t)/2;};function p(){this.key=null,this.next=null,this.prev=null;}function c(l,d){this.head=new p(),this.head.next=this.head,this.head.prev=this.head,this.frame=l,this.leq=d;}c.prototype={min:function min(){return this.head.next;},max:function max(){return this.head.prev;},insert:function insert(l){return this.insertBefore(this.head,l);},search:function search(l){var d=this.head;do d=d.next;while(d.key!==null&&!this.leq(this.frame,l,d.key));return d;},insertBefore:function insertBefore(l,d){do l=l.prev;while(l.key!==null&&!this.leq(this.frame,l.key,d));var u=new p();return u.key=d,u.next=l.next,l.next.prev=u,u.prev=l,l.next=u,u;},"delete":function _delete(l){l.next.prev=l.prev,l.prev.next=l.next;}};function v(){this.handle=null;}function S(){this.key=null,this.node=null;}function O(l,d){this.size=0,this.max=l,this.nodes=[],this.nodes.length=l+1;var u;for(u=0;u<this.nodes.length;u++)this.nodes[u]=new v();for(this.handles=[],this.handles.length=l+1,u=0;u<this.handles.length;u++)this.handles[u]=new S();this.initialized=!1,this.freeList=0,this.leq=d,this.nodes[1].handle=1,this.handles[1].key=null;}O.prototype={floatDown_:function floatDown_(l){var d=this.nodes,u=this.handles,g,M,A;for(g=d[l].handle;;){if(A=l<<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[l].handle=g,u[g].node=l;break;}d[l].handle=M,u[M].node=l,l=A;}},floatUp_:function floatUp_(l){var d=this.nodes,u=this.handles,g,M,A;for(g=d[l].handle;;){if(A=l>>1,M=d[A].handle,A===0||this.leq(u[M].key,u[g].key)){d[l].handle=g,u[g].node=l;break;}d[l].handle=M,u[M].node=l,l=A;}},init:function init(){for(var l=this.size;l>=1;--l)this.floatDown_(l);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(l){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 v();for(M=this.handles.length,this.handles.length=this.max+1,g=M;g<this.handles.length;g++)this.handles[g]=new S();}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=l,this.initialized&&this.floatUp_(d),u;},//PQkey pqHeapExtractMin( PriorityQHeap *pq )
|
|
167
|
-
extractMin:function extractMin(){var l=this.nodes,d=this.handles,u=l[1].handle,g=d[u].key;return this.size>0&&(l[1].handle=l[this.size].handle,d[l[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(l){var d=this.nodes,u=this.handles,g;i(l>=1&&l<=this.max&&u[l].key!==null),g=u[l].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[l].key=null,u[l].node=this.freeList,this.freeList=l;}};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(l){return l.nodeUp.prev.key;},m.regionAbove=function(l){return l.nodeUp.next.key;},m.debugEvent=function(l){},m.addWinding=function(l,d){l.winding+=d.winding,l.Sym.winding+=d.Sym.winding;},m.edgeLeq=function(l,d,u){var g=l.event,R,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 R=n.edgeEval(M.Dst,g,M.Org),b=n.edgeEval(A.Dst,g,A.Org);return R>=b;},m.deleteRegion=function(l,d){d.fixUpperEdge&&i(d.eUp.winding===0),d.eUp.activeRegion=null,l.dict["delete"](d.nodeUp);},m.fixUpperEdge=function(l,d,u){i(d.fixUpperEdge),l.mesh["delete"](d.eUp),d.fixUpperEdge=!1,d.eUp=u,u.activeRegion=d;},m.topLeftRegion=function(l,d){var u=d.eUp.Org,g;do d=m.regionAbove(d);while(d.eUp.Org===u);if(d.fixUpperEdge){if(g=l.mesh.connect(m.regionBelow(d).eUp.Sym,d.eUp.Lnext),g===null)return null;m.fixUpperEdge(l,d,g),d=m.regionAbove(d);}return d;},m.topRightRegion=function(l){var d=l.eUp.Dst;do l=m.regionAbove(l);while(l.eUp.Dst===d);return l;},m.addRegionBelow=function(l,d,u){var g=new x();return g.eUp=u,g.nodeUp=l.dict.insertBefore(d.nodeUp,g),g.fixUpperEdge=!1,g.sentinel=!1,g.dirty=!1,u.activeRegion=g,g;},m.isWindingInside=function(l,d){switch(l.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(l,d){d.windingNumber=m.regionAbove(d).windingNumber+d.eUp.winding,d.inside=m.isWindingInside(l,d.windingNumber);},m.finishRegion=function(l,d){var u=d.eUp,g=u.Lface;g.inside=d.inside,g.anEdge=u,m.deleteRegion(l,d);},m.finishLeftRegions=function(l,d,u){for(var g,R,M=null,A=d,R=d.eUp;A!==u;){if(A.fixUpperEdge=!1,M=m.regionBelow(A),g=M.eUp,g.Org!=R.Org){if(!M.fixUpperEdge){m.finishRegion(l,A);break;}g=l.mesh.connect(R.Lprev,g.Sym),m.fixUpperEdge(l,M,g);}R.Onext!==g&&(l.mesh.splice(g.Oprev,g),l.mesh.splice(R,g)),m.finishRegion(l,A),R=M.eUp,A=M;}return R;},m.addRightEdges=function(l,d,u,g,M,A){var R,b,E,L,D=!0;E=u;do i(n.vertLeq(E.Org,E.Dst)),m.addRegionBelow(l,d,E.Sym),E=E.Onext;while(E!==g);for(M===null&&(M=m.regionBelow(d).eUp.Rprev),b=d,L=M;R=m.regionBelow(b),E=R.eUp.Sym,E.Org===L.Org;)E.Onext!==L&&(l.mesh.splice(E.Oprev,E),l.mesh.splice(L.Oprev,E)),R.windingNumber=b.windingNumber-E.winding,R.inside=m.isWindingInside(l,R.windingNumber),b.dirty=!0,!D&&m.checkForRightSplice(l,b)&&(m.addWinding(E,L),m.deleteRegion(l,b),l.mesh["delete"](L)),D=!1,b=R,L=E;b.dirty=!0,i(b.windingNumber-E.winding===R.windingNumber),A&&m.walkDirtyRegions(l,b);},m.spliceMergeVertices=function(l,d,u){l.mesh.splice(d,u);},m.vertexWeights=function(l,d,u){var g=n.vertL1dist(d,l),M=n.vertL1dist(u,l),A=0.5*M/(g+M),R=0.5*g/(g+M);l.coords[0]+=A*d.coords[0]+R*u.coords[0],l.coords[1]+=A*d.coords[1]+R*u.coords[1],l.coords[2]+=A*d.coords[2]+R*u.coords[2];},m.getIntersectData=function(l,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(l,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&&(l.pq["delete"](g.Org.pqHandle),m.spliceMergeVertices(l,M.Oprev,g)):(l.mesh.splitEdge(M.Sym),l.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,l.mesh.splitEdge(g.Sym),l.mesh.splice(M.Oprev,g);}return!0;},m.checkForLeftSplice=function(l,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=l.mesh.splitEdge(g),l.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=l.mesh.splitEdge(M),l.mesh.splice(g.Lnext,M.Sym),A.Rface.inside=d.inside;}return!0;},m.checkForIntersect=function(l,d){var u=m.regionBelow(d),g=d.eUp,M=u.eUp,A=g.Org,R=M.Org,b=g.Dst,E=M.Dst,L,D,I=new a(),C,W;if(i(!n.vertEq(E,b)),i(n.edgeSign(b,l.event,A)<=0),i(n.edgeSign(E,l.event,R)>=0),i(A!==l.event&&R!==l.event),i(!d.fixUpperEdge&&!u.fixUpperEdge),A===R||(L=Math.min(A.t,b.t),D=Math.max(R.t,E.t),L>D))return!1;if(n.vertLeq(A,R)){if(n.edgeSign(E,A,R)>0)return!1;}else if(n.edgeSign(b,R,A)<0)return!1;return m.debugEvent(l),n.intersect(b,A,E,R,I),i(Math.min(A.t,b.t)<=I.t),i(I.t<=Math.max(R.t,E.t)),i(Math.min(E.s,b.s)<=I.s),i(I.s<=Math.max(R.s,A.s)),n.vertLeq(I,l.event)&&(I.s=l.event.s,I.t=l.event.t),C=n.vertLeq(A,R)?A:R,n.vertLeq(C,I)&&(I.s=C.s,I.t=C.t),n.vertEq(I,A)||n.vertEq(I,R)?(m.checkForRightSplice(l,d),!1):!n.vertEq(b,l.event)&&n.edgeSign(b,l.event,I)>=0||!n.vertEq(E,l.event)&&n.edgeSign(E,l.event,I)<=0?E===l.event?(l.mesh.splitEdge(g.Sym),l.mesh.splice(M.Sym,g),d=m.topLeftRegion(l,d),g=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),u),m.addRightEdges(l,d,g.Oprev,g,g,!0),!0):b===l.event?(l.mesh.splitEdge(M.Sym),l.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(l,u,null),m.addRightEdges(l,d,M.Onext,g.Rprev,W,!0),!0):(n.edgeSign(b,l.event,I)>=0&&(m.regionAbove(d).dirty=d.dirty=!0,l.mesh.splitEdge(g.Sym),g.Org.s=l.event.s,g.Org.t=l.event.t),n.edgeSign(E,l.event,I)<=0&&(d.dirty=u.dirty=!0,l.mesh.splitEdge(M.Sym),M.Org.s=l.event.s,M.Org.t=l.event.t),!1):(l.mesh.splitEdge(g.Sym),l.mesh.splitEdge(M.Sym),l.mesh.splice(M.Oprev,g),g.Org.s=I.s,g.Org.t=I.t,g.Org.pqHandle=l.pq.insert(g.Org),m.getIntersectData(l,g.Org,A,b,R,E),m.regionAbove(d).dirty=d.dirty=u.dirty=!0,!1);},m.walkDirtyRegions=function(l,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(l,d)&&(u.fixUpperEdge?(m.deleteRegion(l,u),l.mesh["delete"](M),u=m.regionBelow(d),M=u.eUp):d.fixUpperEdge&&(m.deleteRegion(l,d),l.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===l.event||M.Dst===l.event)){if(m.checkForIntersect(l,d))return;}else m.checkForRightSplice(l,d);g.Org===M.Org&&g.Dst===M.Dst&&(m.addWinding(M,g),m.deleteRegion(l,d),l.mesh["delete"](g),d=m.regionAbove(u));}},m.connectRightVertex=function(l,d,u){var g,M=u.Onext,A=m.regionBelow(d),R=d.eUp,b=A.eUp,E=!1;if(R.Dst!==b.Dst&&m.checkForIntersect(l,d),n.vertEq(R.Org,l.event)&&(l.mesh.splice(M.Oprev,R),d=m.topLeftRegion(l,d),M=m.regionBelow(d).eUp,m.finishLeftRegions(l,m.regionBelow(d),A),E=!0),n.vertEq(b.Org,l.event)&&(l.mesh.splice(u,b.Oprev),u=m.finishLeftRegions(l,A,null),E=!0),E){m.addRightEdges(l,d,u.Onext,M,M,!0);return;}n.vertLeq(b.Org,R.Org)?g=b.Oprev:g=R,g=l.mesh.connect(u.Lprev,g),m.addRightEdges(l,d,g,g.Onext,g.Onext,!1),g.Sym.activeRegion.fixUpperEdge=!0,m.walkDirtyRegions(l,d);},m.connectLeftDegenerate=function(l,d,u){var g,M,A,R,b;if(g=d.eUp,n.vertEq(g.Org,u)){i(!1/*TOLERANCE_NONZERO*/),m.spliceMergeVertices(l,g,u.anEdge);return;}if(!n.vertEq(g.Dst,u)){l.mesh.splitEdge(g.Sym),d.fixUpperEdge&&(l.mesh["delete"](g.Onext),d.fixUpperEdge=!1),l.mesh.splice(u.anEdge,g),m.sweepEvent(l,u);return;}i(!1/*TOLERANCE_NONZERO*/),d=m.topRightRegion(d),b=m.regionBelow(d),A=b.eUp.Sym,M=R=A.Onext,b.fixUpperEdge&&(i(M!==A),m.deleteRegion(l,b),l.mesh["delete"](A),A=M.Oprev),l.mesh.splice(u.anEdge,A),n.edgeGoesLeft(M)||(M=null),m.addRightEdges(l,d,A.Onext,R,M,!0);},m.connectLeftVertex=function(l,d){var u,g,M,A,R,b,E=new x();if(E.eUp=d.anEdge.Sym,u=l.dict.search(E).key,g=m.regionBelow(u),!!g){if(A=u.eUp,R=g.eUp,n.edgeSign(A.Dst,d,A.Org)===0){m.connectLeftDegenerate(l,u,d);return;}if(M=n.vertLeq(R.Dst,A.Dst)?u:g,u.inside||M.fixUpperEdge){if(M===u)b=l.mesh.connect(d.anEdge.Sym,A.Lnext);else{var L=l.mesh.connect(R.Dnext,d.anEdge);b=L.Sym;}M.fixUpperEdge?m.fixUpperEdge(l,M,b):m.computeWinding(l,m.addRegionBelow(l,u,b)),m.sweepEvent(l,d);}else m.addRightEdges(l,u,d.anEdge,d.anEdge,null,!0);}},m.sweepEvent=function(l,d){l.event=d,m.debugEvent(l);for(var u=d.anEdge;u.activeRegion===null;)if(u=u.Onext,u===d.anEdge){m.connectLeftVertex(l,d);return;}var g=m.topLeftRegion(l,u.activeRegion);i(g!==null);var M=m.regionBelow(g),A=M.eUp,R=m.finishLeftRegions(l,M,null);R.Onext===A?m.connectRightVertex(l,g,R):m.addRightEdges(l,g,R.Onext,A,A,!0);},m.addSentinel=function(l,d,u,g){var M=new x(),A=l.mesh.makeEdge();A.Org.s=u,A.Org.t=g,A.Dst.s=d,A.Dst.t=g,l.event=A.Dst,M.eUp=A,M.windingNumber=0,M.inside=!1,M.fixUpperEdge=!1,M.sentinel=!0,M.dirty=!1,M.nodeUp=l.dict.insert(M);},m.initEdgeDict=function(l){l.dict=new c(l,m.edgeLeq);var d=l.bmax[0]-l.bmin[0],u=l.bmax[1]-l.bmin[1],g=l.bmin[0]-d,M=l.bmax[0]+d,A=l.bmin[1]-u,R=l.bmax[1]+u;m.addSentinel(l,g,M,A),m.addSentinel(l,g,M,R);},m.doneEdgeDict=function(l){for(var d,u=0;(d=l.dict.min().key)!==null;)d.sentinel||(i(d.fixUpperEdge),i(++u===1)),i(d.windingNumber===0),m.deleteRegion(l,d);},m.removeDegenerateEdges=function(l){var d,u,g,M=l.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(l,g,d),l.mesh["delete"](d),d=g,g=d.Lnext),g.Lnext===d&&(g!==d&&((g===u||g===u.Sym)&&(u=u.next),l.mesh["delete"](g)),(d===u||d===u.Sym)&&(u=u.next),l.mesh["delete"](d));},m.initPriorityQ=function(l){var d,u,g,M=0;for(g=l.mesh.vHead,u=g.next;u!==g;u=u.next)M++;for(M+=8,d=l.pq=new O(M,n.vertLeq),g=l.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(l){l.pq=null;},m.removeDegenerateFaces=function(l,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),l.mesh["delete"](M));return!0;},m.computeInterior=function(l){var d,u;if(m.removeDegenerateEdges(l),!m.initPriorityQ(l))return!1;for(m.initEdgeDict(l);(d=l.pq.extractMin())!==null;){for(;u=l.pq.min(),!(u===null||!n.vertEq(u,d));)u=l.pq.extractMin(),m.spliceMergeVertices(l,d.anEdge,u.anEdge);m.sweepEvent(l,d);}return l.event=l.dict.min().key.eUp.Org,m.debugEvent(l),m.doneEdgeDict(l),m.donePriorityQ(l),m.removeDegenerateFaces(l,l.mesh)?(l.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_(l,d){return l[0]*d[0]+l[1]*d[1]+l[2]*d[2];},normalize_:function normalize_(l){var d=l[0]*l[0]+l[1]*l[1]+l[2]*l[2];i(d>0),d=Math.sqrt(d),l[0]/=d,l[1]/=d,l[2]/=d;},longAxis_:function longAxis_(l){var d=0;return Math.abs(l[1])>Math.abs(l[0])&&(d=1),Math.abs(l[2])>Math.abs(l[d])&&(d=2),d;},computeNormal_:function computeNormal_(l){var d,u,g,M,A,R,b=[0,0,0],E=[0,0,0],L=[0,0,0],D=[0,0,0],I=[0,0,0],C=[null,null,null],W=[null,null,null],G=this.mesh.vHead,K;for(d=G.next,K=0;K<3;++K)M=d.coords[K],E[K]=M,W[K]=d,b[K]=M,C[K]=d;for(d=G.next;d!==G;d=d.next)for(K=0;K<3;++K)M=d.coords[K],M<E[K]&&(E[K]=M,W[K]=d),M>b[K]&&(b[K]=M,C[K]=d);if(K=0,b[1]-E[1]>b[0]-E[0]&&(K=1),b[2]-E[2]>b[K]-E[K]&&(K=2),E[K]>=b[K]){l[0]=0,l[1]=0,l[2]=1;return;}for(R=0,u=W[K],g=C[K],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=G.next;d!==G;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],I[0]=L[1]*D[2]-L[2]*D[1],I[1]=L[2]*D[0]-L[0]*D[2],I[2]=L[0]*D[1]-L[1]*D[0],A=I[0]*I[0]+I[1]*I[1]+I[2]*I[2],A>R&&(R=A,l[0]=I[0],l[1]=I[1],l[2]=I[2]);R<=0&&(l[0]=l[1]=l[2]=0,l[this.longAxis_(L)]=1);},checkOrientation_:function checkOrientation_(){var l,d,u=this.mesh.fHead,g,M=this.mesh.vHead,A;for(l=0,d=u.next;d!==u;d=d.next)if(A=d.anEdge,!(A.winding<=0))do l+=(A.Org.s-A.Dst.s)*(A.Org.t+A.Dst.t),A=A.Lnext;while(A!==d.anEdge);if(l<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 l,d=this.mesh.vHead,u=[0,0,0],g,M,A,R,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,l=d.next;l!==d;l=l.next)l.s=this.dot_(l.coords,g),l.t=this.dot_(l.coords,M);for(b&&this.checkOrientation_(),R=!0,l=d.next;l!==d;l=l.next)R?(this.bmin[0]=this.bmax[0]=l.s,this.bmin[1]=this.bmax[1]=l.t,R=!1):(l.s<this.bmin[0]&&(this.bmin[0]=l.s),l.s>this.bmax[0]&&(this.bmax[0]=l.s),l.t<this.bmin[1]&&(this.bmin[1]=l.t),l.t>this.bmax[1]&&(this.bmax[1]=l.t));},addWinding_:function addWinding_(l,d){l.winding+=d.winding,l.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_(l,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=l.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=l.connect(u,u.Lprev);u=M.Sym;}u=u.Lnext;}for(i(g.Lnext!==u);g.Lnext.Lnext!==u;){var M=l.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_(l){var d,u;for(d=l.fHead.next;d!==l.fHead;d=u)if(u=d.next,d.inside&&!this.tessellateMonoRegion_(l,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_(l){var d,u;for(d=l.fHead.next;d!==l.fHead;d=u)u=d.next,d.inside||l.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_(l,d,u){var g,M;for(g=l.eHead.next;g!==l.eHead;g=M)M=g.next,g.Rface.inside!==g.Lface.inside?g.winding=g.Lface.inside?d:-d:u?l["delete"](g):g.winding=0;},getNeighbourFace_:function getNeighbourFace_(l){return!l.Rface||!l.Rface.inside?-1:l.Rface.n;},outputPolymesh_:function outputPolymesh_(l,d,u,g){var M,A,R,b=0,E=0,L,D;for(u>3&&l.mergeConvexFaces(u),M=l.vHead.next;M!==l.vHead;M=M.next)M.n=-1;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.n=-1,!!A.inside){R=A.anEdge,L=0;do M=R.Org,M.n===-1&&(M.n=E,E++),L++,R=R.Lnext;while(R!==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=l.vHead.next;M!==l.vHead;M=M.next)if(M.n!==-1){var I=M.n*g;this.vertices[I+0]=M.coords[0],this.vertices[I+1]=M.coords[1],g>2&&(this.vertices[I+2]=M.coords[2]),this.vertexIndices[M.n]=M.idx;}var C=0;for(A=l.fHead.next;A!==l.fHead;A=A.next)if(A.inside){R=A.anEdge,L=0;do M=R.Org,this.elements[C++]=M.n,L++,R=R.Lnext;while(R!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1;if(d===e.CONNECTED_POLYGONS){R=A.anEdge;do this.elements[C++]=this.getNeighbourFace_(R),R=R.Lnext;while(R!==A.anEdge);for(D=L;D<u;++D)this.elements[C++]=-1;}}},// void OutputContours( TESStesselator *tess, TESSmesh *mesh, int vertexSize )
|
|
234
|
-
outputContours_:function outputContours_(l,d){var u,g,M,A=0,R=0;for(this.vertexCount=0,this.elementCount=0,u=l.fHead.next;u!==l.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=l.fHead.next;u!==l.fHead;u=u.next)if(u.inside){R=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,R++,g=g.Lnext;while(g!==M);this.elements[L++]=A,this.elements[L++]=R,A+=R;}},addContour:function addContour(l,d){var u,g;for(this.mesh===null&&(this.mesh=new f()),l<2&&(l=2),l>3&&(l=3),u=null,g=0;g<d.length;g+=l)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],l>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(l,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=l,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 o in a)t.call(a,o)&&(n[o]=a[o]);}return n;}},/* 63 */ /***/function(h,r,t){t.r(r),t.d(r,"createShaders",function(){return s;}),t.d(r,"applyShader",function(){return f;}),t.d(r,"createCloudShaders",function(){return c;}),t.d(r,"applyCloudShader",function(){return v;});var e=t(64),n=t(65),i=t(66),a=t(67);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol("shaders");function s(S){S[o]=[];for(var O=0;O<16;O++){var x=[],m=!!(O&1),_T16=!!(O&2),_l12=!!(O&4),d=!!(O&8);m&&x.push("#define TEXTURE 1"),_T16&&x.push("#define FILTER 1"),_l12&&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;"),S[o][O]=[u+g.join("\n")+n["default"],u+e["default"]];}}function f(S){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 l=O|x<<1|m<<2|T<<3;var d=S[o][l];Array.isArray(d)&&(d=S.createProgram.apply(S,_toConsumableArray(d)),S[o][l]=d),S.program!==d&&S.useProgram(d,{a_color:{type:"UNSIGNED_BYTE",normalize:!0}});}var p=[];function c(S){for(var O=0;O<64;O++){var x=[],m=!!(O&1),_T17=!!(O&2),_l13=!!(O&4),d=!!(O&8),u=!!(O&16),g=!!(O&32);m&&x.push("#define TEXTURE 1"),_T17&&x.push("#define FILTER 1"),_l13&&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 R=0;R<12;R++)A.push("uniform sampler2D u_texFrame".concat(R,";"));}g&&A.push("uniform sampler2D u_clipSampler;"),p[O]=[M+A.join("\n")+a["default"],M+i["default"]];}}function v(S){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,l=_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|l<<4|d<<5;var g=p[u];Array.isArray(g)&&(g=S.createProgram.apply(S,_toConsumableArray(g)),p[u]=g),S.program!==g&&S.useProgram(g,{a_color:{type:"UNSIGNED_BYTE",normalize:!0},a_fillCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_strokeCloudColor:{type:"UNSIGNED_BYTE",normalize:!0},a_frameIndex:{type:"UNSIGNED_BYTE",normalize:!1}});}},/* 64 */ /***/function(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 o;}),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),s=_e$hrtime2[0],f=_e$hrtime2[1];return s*1e3+f*1e-6;}return Date.now?Date.now():(/* @__PURE__ */new Date()).getTime();}var a,o;_typeof(n)<"u"&&typeof n.requestAnimationFrame=="function"?(a=n.requestAnimationFrame,o=n.cancelAnimationFrame):(a=function a(s){return setTimeout(function(){s(i());},16);},o=function o(s){return clearTimeout(s);});}.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 o(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 s(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=[],p=!1,c,v=-1;function S(){!p||!c||(p=!1,c.length?f=c.concat(f):v=-1,f.length&&O());}function O(){if(!p){var T=o(S);p=!0;for(var l=f.length;l;){for(c=f,f=[];++v<l;)c&&c[v].run();v=-1,l=f.length;}c=null,p=!1,s(T);}}t.nextTick=function(T){var l=new Array(arguments.length-1);if(arguments.length>1)for(var d=1;d<arguments.length;d++)l[d-1]=arguments[d];f.push(new x(T,l)),f.length===1&&!p&&o(O);};function x(T,l){this.fun=T,this.array=l;}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 R;});var e=t(1),n=t(71),i=t(73),a=t(213),o=t(214),s=t(215),f=t(216);t(1).glMatrix.setMatrixArrayType(Array);function p(b,E){var L=Object.keys(b);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(b);E&&(D=D.filter(function(I){return Object.getOwnPropertyDescriptor(b,I).enumerable;})),L.push.apply(L,D);}return L;}function c(b){for(var E=1;E<arguments.length;E++){var L=arguments[E]!=null?arguments[E]:{};E%2?p(Object(L),!0).forEach(function(D){v(b,D,L[D]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(L)):p(Object(L)).forEach(function(D){Object.defineProperty(b,D,Object.getOwnPropertyDescriptor(L,D));});}return b;}function v(b,E,L){return E in b?Object.defineProperty(b,E,{value:L,enumerable:!0,configurable:!0,writable:!0}):b[E]=L,b;}var S=Symbol["for"]("spritejs_changedAttrs"),O=Symbol["for"]("spritejs_attributes"),x=Symbol("resolution"),m=Symbol("animations"),T=Symbol("eventListeners"),l=Symbol("captureEventListeners"),d=Symbol("filters"),u=Symbol("display"),g=Symbol("program"),M=Symbol("shaderAttrs"),A=Symbol("uniforms");var R=/*#__PURE__*/function(){function R(){var E=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,R);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[l]={};}return _createClass(R,[{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(I){I.baseTimeline=E.timeline,I.play(),I.finished.then(function(){L["delete"](I);});});var D=this.children;D&&D.forEach(function(I){I.activateAnimations&&I.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,I=_D8.capture,C=_D8.once,W=I?l: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[S];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 o["default"]||(E=new o["default"](E)),E.target=this;var L=E.type;L==="mousewheel"&&(L="wheel");var D=[this];var I=this.parent;for(;E.bubbles&&I;)D.push(I),I=I.parent;for(var C=D.length-1;C>=0;C--){var W=D[C],G=W[l]&&W[l][L];if(G&&G.length&&(E.currentTarget=W,G.forEach(function(_ref97){var K=_ref97.listener,J=_ref97.once;K.call(_this11,E),J&&D.removeEventListener(K);}),delete E.currentTarget),!E.bubbles&&E.cancelBubble)break;}if(!E.cancelBubble)for(var _C4=0;_C4<D.length;_C4++){var _W=D[_C4],_G3=_W[T]&&_W[T][L];if(_G3&&_G3.length&&(E.currentTarget=_W,_G3.forEach(function(_ref98){var K=_ref98.listener,J=_ref98.once;K.call(_this11,E),J&&D.removeEventListener(K);}),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(s.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 I=this[A];if(this[A]){var C={};Object.entries(I).forEach(function(_ref101){var _ref102=_slicedToArray(_ref101,2),W=_ref102[0],G=_ref102[1];typeof G=="function"&&(G=G(_this12,W)),C[W]=G;}),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?l: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,I=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getOffsetPosition",value:function getOffsetPosition(E,L){var D=e.mat2d.invert(Array.of(0,0,0,0,0,0),this.renderMatrix),I=E*D[0]+L*D[2]+D[4],C=E*D[1]+L*D[3]+D[5];return[I,C];}},{key:"getResolution",value:function getResolution(){return c({},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 I="both";return D==="visibleFill"&&(I="fill"),D==="visibleStroke"&&(I="stroke"),this.mesh.isPointCollision(E,L,I);}},{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(s.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,I=_this$x3.height;(D!==E||I!==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 I=L.capture?l:T;return this[I][E]&&(this[I][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?l:T;if(this[C][E]){var W=this[C][E];if(W)for(var G=0;G<W.length;G++){var K=W[G].listener;if(K===L){this[C][E].splice(G,1);break;}}}return this;}},{key:"transition",value:function transition(E){var L=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"linear";var D=this,I=Symbol("animation");L=L||"linear";var C=0;return _typeof(E)=="object"&&(C=E.delay||0,E=E.duration),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},I,null),"cancel",function cancel(){var W=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var G=this[I];G&&G.cancel(W);}),"end",function end(){var W=this[I];W&&(W.playState==="running"||W.playState==="pending")&&W.finish();}),"reverse",function reverse(){var W=this[I];if(W)if(W.playState==="running"||W.playState==="pending")W.playbackRate=-W.playbackRate;else{var G=W.timing.direction;W.timing.direction=G==="reverse"?"normal":"reverse",W.play();}return W.finished;}),"attr",function attr(W,G){return this.end(),typeof W=="string"&&(W=_defineProperty({},W,G)),Object.entries(W).forEach(function(_ref105){var _ref106=_slicedToArray(_ref105,2),K=_ref106[0],J=_ref106[1];typeof J=="function"&&(W[K]=J(D.attr(K)));}),this[I]=D.animate([W],{duration:E*1e3,delay:C*1e3,fill:"forwards",easing:L}),this[I].finished;});}},{key:"updateContours",value:function updateContours(){}}]);}();v(R,"Attr",n["default"]),a["default"].registerNode(R,"node");},/* 71 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return R;});var e=t(1),n=t(12),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_declareAlias"),s=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_attributes"),c=Symbol["for"]("spritejs_changedAttrs"),v=Symbol("subject"),S=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),I=_ref111[0],C=_ref111[1];if((E||L)&&(D=e.mat2d.translate(Array.of(0,0,0,0,0,0),D,[E,L])),I==="matrix")D=e.mat2d.multiply(D,D,C);else if(I==="offsetTranslate")D[4]+=C[0],D[5]+=C[1];else if(I==="offsetRotate")D=e.mat2d.rotate(Array.of(0,0,0,0,0,0),D,C);else if(I==="skew"){var _C5=_slicedToArray(C,2),W=_C5[0],G=_C5[1];D=e.mat2d.multiply(D,D,e.mat2d.fromValues(1,Math.tan(G),Math.tan(W),1,0,0));}else e.mat2d[I](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"),l=Symbol("transforms"),d=Symbol("changedAttrs"),u=Symbol("lastChangedAttr"),g=Symbol("offsetFigure");function M(b,E,L){var D=b[S][E];if(b[s](E,L,!1)||b[u]!==E){var C=b[l];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[v].onPropertyChange(E,L,D,b);}}function A(b){var E=b[g],L=b.offsetDistance*E.getTotalLength(),D=E.getPointAtLength(L);if(D){var I=b[l];var C=b.offsetRotate;C==="auto"?C=D.angle:C==="reverse"?C=Math.PI+D.angle:C=Math.PI*C/180,I.set("offsetRotate",C),I.set("offsetTranslate",[D.x,D.y]),b[T]=null;}}var R=/*#__PURE__*/function(){function R(E){var _this13=this;_classCallCheck(this,R);this[v]=E,this[S]={},this[T]=e.mat2d.fromValues(1,0,0,1,0,0),this[l]=/* @__PURE__ */new Map(),this[O]={},this[x]=[],Object.defineProperty(E,"transformMatrix",{get:function get(){return _this13[T]||(_this13[T]=m(_this13[l],_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[o]("class","pos"),this[d]=/* @__PURE__ */new Set(),this[g]=new n.Figure2D({scale:5,simplify:0});}return _createClass(R,[{key:c,get:function get(){var _this14=this;var E={};return _toConsumableArray(this[d]).forEach(function(L){E[L]=_this14[S][L];}),E;}},{key:p,get:function get(){var E=Object.assign({},this[S]);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[S],E);}},{key:o,value:function value(){var _this$x4;(_this$x4=this[x]).push.apply(_this$x4,arguments);}},{key:s,value:function value(E,L){var D=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var I=this[S][E],C=this[v];return L==null&&(L=this[O][E]),Object(i.compareValue)(I,L)?!1:(this[S][E]=L,this[d].has(E)&&this[d]["delete"](E),this[d].add(E),this[u]=E,D&&C.onPropertyChange(E,L,I,this),!0);}},{key:f,value:function value(E){return this[S][E];}},{key:"id",set:function set(E){this[s]("id",E);}},{key:"id",get:function get(){return this[f]("id");}},{key:"name",set:function set(E){this[s]("name",E);}},{key:"name",get:function get(){return this[f]("name");}},{key:"className",set:function set(E){this[s]("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[s]("x",Object(i.toNumber)(E));}},{key:"y",get:function get(){return this[f]("y");}},{key:"y",set:function set(E){this[s]("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[S].transform;if(this[s]("transform",E,!1)){var I=this[l];if(I.has("matrix")&&I["delete"]("matrix"),L)I.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 G=0;G<C.length;G++){var J=C[G].match(/^(matrix|translate|rotate|scale|skew)\(([^()]+)\)/);if(J){var _J2=_slicedToArray(J,3),Z=_J2[1],B=_J2[2];Z==="rotate"?B=Math.PI*parseFloat(B)/180:B=B.trim().split(/[\s,]+/).map(function($){return Object(i.toNumber)($);}),Z==="matrix"?W=e.mat2d.multiply(W,W,B):Z==="skew"?W=e.mat2d.multiply(W,W,e.mat2d.fromValues(1,Math.tan(B[1]),Math.tan(B[0]),1,0,0)):e.mat2d[Z](W,W,B),I.set("matrix",W);}}}else throw new TypeError("Invalid transform value.");}this[T]=null,this[v].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[s]("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[s]("opacity",E);}},{key:"zIndex",get:function get(){return this[f]("zIndex");}},{key:"zIndex",set:function set(E){E!=null&&(E=Number(E)),this[s]("zIndex",E);}},{key:"offsetPath",get:function get(){return this[f]("offsetPath");}},{key:"offsetPath",set:function set(E){this[s]("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[s]("offsetDistance",Object(i.toNumber)(E))&&A(this);}},{key:"offsetRotate",get:function get(){return this[f]("offsetRotate");}},{key:"offsetRotate",set:function set(E){this[s]("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[s]("pointerEvents",E);}},{key:"filter",get:function get(){return this[f]("filter");}},{key:"filter",set:function set(E){this[s]("filter",E);}},{key:"display",get:function get(){return this[f]("display");}},{key:"display",set:function set(E){this[s]("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[o].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[s].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[p];}},{key:"getChangedAttributes",value:function getChangedAttributes(E){return E[c];}}]);}();},/* 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 o;}),t(1).glMatrix.setMatrixArrayType(Array);function e(s,f){var p=s.trim().match(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/);p?s={size:parseFloat(p[1]),unit:p[2]}:s={size:parseFloat(s),unit:"px"};var _s3=s,c=_s3.size,v=_s3.unit;if(v==="pt")c/=0.75;else if(v==="pc")c*=16;else if(v==="in")c*=96;else if(v==="cm")c*=96/2.54;else if(v==="mm")c*=96/25.4;else if(v==="em"||v==="rem"||v==="ex"){if(!f&&typeof getComputedStyle=="function"&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var S=getComputedStyle(document.documentElement).fontSize;S?f=e(S,16):f=16;}c*=f,v==="ex"&&(c/=2);}else if(v==="q")c*=96/25.4/4;else if(v==="vw"||v==="vh"){if((typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _S3=v==="vw"?window.innerWidth||document.documentElement.clientWidth:window.innerHeight||document.documentElement.clientHeight;c*=_S3/100;}}else if((v==="vmax"||v==="vmin")&&(typeof document==="undefined"?"undefined":_typeof(document))<"u"){var _S4=window.innerWidth||document.documentElement.clientWidth,O=window.innerHeight||document.documentElement.clientHeight;v==="vmax"?c*=Math.max(_S4,O)/100:c*=Math.min(_S4,O)/100;}return c;}function n(s){return s==null?s:String(s);}function i(s){if(s==null)return s;if(typeof s=="string"&&(s=e(s)),!Number.isFinite(s))throw new TypeError("Invalid value");return s;}function a(s){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return s===""?null:(typeof s=="string"&&(s=s.split(/[\s,]+/g)),Array.isArray(s)&&(f&&(s=s.map(i)),s.length===1)?s[0]:s);}function o(s,f){if(Array.isArray(s)&&Array.isArray(f)){if(s.length!==f.length)return!1;for(var p=0;p<s.length;p++)if(s[p]!==f[p])return!1;return!0;}return s==null&&f==null||s===f;}},/* 73 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return v;});var e=t(74),n=t(32),i=/* @__PURE__ */t.n(n),a=t(68),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(){return s=Object.assign||function(S){for(var O=1;O<arguments.length;O++){var x=arguments[O];for(var m in x)Object.prototype.hasOwnProperty.call(x,m)&&(S[m]=x[m]);}return S;},s.apply(this,arguments);}function f(S){if(typeof S=="string"){if(S=S.trim(),/^[0-9.]+%$/.test(S))return parseFloat(S)/100;if(/^([\d.]+)(px|pt|pc|in|cm|mm|em|ex|rem|q|vw|vh|vmax|vmin)$/.test(S))return Object(o.sizeToPixel)(S);}return S;}function p(S,O,x,m,T){return typeof S=="string"&&(S=i()(S)),typeof O=="string"&&(O=i()(O)),e.Effects["default"](S,O,x,m,T);}function c(S,O,x,m,T){return e.Effects["default"](S,O,x,m,T);}e.Effects["default"]=function(S,O,x,m,T){return Array.isArray(S)&&Array.isArray(O)?S.map(function(l,d){return l+(x-m)/(T-m)*(O[d]-l);}):typeof S=="number"&&typeof O=="number"?S+(x-m)/(T-m)*(O-S):x-m>T-x?O:S;},e.Effects.fillColor=p,e.Effects.strokeColor=p,e.Effects.bgcolor=p,e.Effects.borderColor=p,e.Effects.text=c;var v=/*#__PURE__*/function(_e$Animator){function v(O,x,m){var _this15;_classCallCheck(this,v);var T=O.attr();Object.entries(T).forEach(function(_ref112){var _ref113=_slicedToArray(_ref112,2),l=_ref113[0],d=_ref113[1];T[l]=e.Effects[l]?d:f(d);}),x=x.map(function(l){var d=s({},l);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,v,[T,x,m]),_this15.target=O,_this15.setter=function(l,d){d.attr(l);};return _this15;}_inherits(v,_e$Animator);return _createClass(v,[{key:"playState",get:function get(){return this.target.parent?_get(_getPrototypeOf(v.prototype),"playState",this):"idle";}},{key:"finished",get:function get(){var _this16=this;return _get(_getPrototypeOf(v.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(v.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(v.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(v.prototype),"cancel",this).call(this)):(_get(_getPrototypeOf(v.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=p(e),i=t(187),a=p(i),o=t(188),s=t(190),f=p(s);function p(c){return c&&c.__esModule?c:{"default":c};}r.Animator=f["default"],r.Easings=o.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=l(e),i=t(133),a=l(i),o=t(141),s=l(o),f=t(164),p=l(f),c=t(170),v=l(c),S=t(171),O=l(S),x=t(175),m=l(x),T=t(186);function l(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"),R=(0,m["default"])("originTime"),b=(0,m["default"])("setTimer"),E=(0,m["default"])("parent"),L=function(){function D(I,C){(0,v["default"])(this,D),I instanceof D&&(C=I,I={}),I=(0,p["default"])({},u,I),C&&(this[E]=C);var W=I.nowtime||d;if(C)Object.defineProperty(this,"globalTime",{get:function get(){return C.currentTime;}});else{var G=W();Object.defineProperty(this,"globalTime",{get:function get(){return W()-G;}});}this[g]=[{globalTime:this.globalTime,localTime:-I.originTime,entropy:-I.originTime,playbackRate:I.playbackRate,globalEntropy:0}],this[E]&&(this[g][0].globalEntropy=this[E].entropy),this[R]=I.originTime,this[M]=I.playbackRate,this[A]=new s["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,G=W===void 0?this.currentTime:W,K=C.entropy,J=K===void 0?this.entropy:K,Z=C.playbackRate,B=Z===void 0?this.playbackRate:Z,$={globalTime:this.globalTime,localTime:G,entropy:J,playbackRate:B,globalEntropy:this.globalEntropy};this[g].push($);}},{key:"fork",value:function value(C){return new D(C,this);}},{key:"seekGlobalTime",value:function value(C){var W=this.seekTimeMark(C),G=this[g][W],K=G.entropy,J=G.playbackRate,Z=G.globalTime;return Z+(C-K)/Math.abs(J);}},{key:"seekLocalTime",value:function value(C){var W=this.seekTimeMark(C),G=this[g][W],K=G.localTime,J=G.entropy,Z=G.playbackRate;return Z>0?K+(C-J):K-(C-J);}},{key:"seekTimeMark",value:function value(C){var W=this[g],G=0,K=W.length-1;if(C<=W[G].entropy)return G;if(C>=W[K].entropy)return K;for(var J=Math.floor((G+K)/2);J>G&&J<K;){if(C===W[J].entropy)return J;C<W[J].entropy?K=J:C>W[J].entropy&&(G=J),J=Math.floor((G+K)/2);}return G;}},{key:"updateTimers",value:function value(){var C=this,W=[].concat((0,a["default"])(this[A]));W.forEach(function(G){var K=(0,n["default"])(G,2),J=K[0],Z=K[1];C[b](Z.handler,Z.time,J);});}},{key:"clearTimeout",value:function(I){function C(W){return I.apply(this,arguments);}return C.toString=function(){return I.toString();},C;}(function(I){var C=this[A].get(I);C&&C.timerID!=null&&(this[E]?this[E].clearTimeout(C.timerID):clearTimeout(C.timerID)),this[A]["delete"](I);})},{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(G){C.clearTimeout(G);});}/*
|
|
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},G=this,K=this[b](function J(){G[b](J,W,K),C();},W);return K;}},{key:b,value:function value(C,W){var G=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,m["default"])("timerID");W=(0,T.formatDelay)(W);var J=this[A].get(K),Z=void 0,B=null,$=void 0,Q=void 0;J?(this.clearTimeout(K),W.isEntropy?Z=(W.delay-(this.entropy-J.startEntropy))/Math.abs(this.playbackRate):Z=(W.delay-(this.currentTime-J.startTime))/this.playbackRate,$=J.startTime,Q=J.startEntropy):(Z=W.delay/(W.isEntropy?Math.abs(this.playbackRate):this.playbackRate),$=this.currentTime,Q=this.entropy);var et=this[E],tt=et?et.setTimeout.bind(et):setTimeout,ot=W.heading;return!et&&ot===!1&&Z<0&&(Z=1/0),(isFinite(Z)||et)&&(Z=Math.ceil(Z),tt!==setTimeout&&(Z={delay:Z,heading:ot}),B=tt(function(){G[A]["delete"](K),C();},Z)),this[A].set(K,{timerID:B,handler:C,time:W,startTime:$,startEntropy:Q}),K;}},{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,G=C.globalTime;return W+(this.globalTime-G)*this.playbackRate;},set:function set(C){var W=this,G=this.currentTime,K=C,J=this[A];this.markTime({time:C}),[].concat((0,a["default"])(J)).forEach(function(Z){var B=(0,n["default"])(Z,2),$=B[0],Q=B[1];if(J.has($)){var et=Q.time,tt=et.isEntropy,ot=et.delay,q=et.heading,gt=Q.handler,dt=Q.startTime;if(tt)ot===0&&(gt(),W.clearTimeout($));else{var F=dt+ot;(ot===0||q!==!1&&(K-G)*ot<=0||G<=F&&F<=K||G>=F&&F>=K)&&(gt(),W.clearTimeout($));}}}),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,G=C.globalEntropy;return W+Math.abs((this.globalEntropy-G)*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=o(e),i=t(129),a=o(i);function o(s){return s&&s.__esModule?s:{"default":s};}r["default"]=/* @__PURE__ */function(){function s(f,p){var c=[],v=!0,S=!1,O=void 0;try{for(var x=(0,a["default"])(f),m;!(v=(m=x.next()).done)&&(c.push(m.value),!(p&&c.length===p));v=!0);}catch(T){S=!0,O=T;}finally{try{!v&&x["return"]&&x["return"]();}finally{if(S)throw O;}}return c;}return function(f,p){if(Array.isArray(f))return f;if((0,n["default"])(Object(f)))return s(f,p);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"),o="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s<o.length;s++){var f=o[s],p=e[f],c=p&&p.prototype;c&&!c[a]&&n(c,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(o,s){this._t=a(o),this._i=0,this._k=s;},function(){var o=this._t,s=this._k,f=this._i++;return!o||f>=o.length?(this._t=void 0,n(1)):s=="keys"?n(0,f):s=="values"?n(0,o[f]):n(0,[f,o[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),o=t(83),s=t(107),f=t(121),p=t(123),c=t(122)("iterator"),v=!([].keys&&"next"in[].keys()),S="@@iterator",O="keys",x="values",m=function m(){return this;};h.exports=function(T,l,d,u,g,M,A){s(d,l,u);var R=function R(B){if(!v&&B in D)return D[B];switch(B){case O:return function(){return new d(this,B);};case x:return function(){return new d(this,B);};}return function(){return new d(this,B);};},b=l+" Iterator",E=g==x,L=!1,D=T.prototype,I=D[c]||D[S]||g&&D[g],C=I||R(g),W=g?E?R("entries"):C:void 0,G=l=="Array"&&D.entries||I,K,J,Z;if(G&&(Z=p(G.call(new T())),Z!==Object.prototype&&Z.next&&(f(Z,b,!0),!e&&typeof Z[c]!="function"&&a(Z,c,m))),E&&I&&I.name!==x&&(L=!0,C=function C(){return I.call(this);}),(!e||A)&&(v||L||!D[c])&&a(D,c,C),o[l]=C,o[b]=m,g)if(K={values:E?C:R(x),keys:M?C:R(O),entries:W},A)for(J in K)J in D||i(D,J,K[J]);else n(n.P+n.F*(v||L),l,K);return K;};},/* 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),o=t(105),s="prototype",f=function f(p,c,v){var S=p&f.F,O=p&f.G,x=p&f.S,m=p&f.P,T=p&f.B,l=p&f.W,d=O?n:n[c]||(n[c]={}),u=d[s],g=O?e:x?e[c]:(e[c]||{})[s],M,A,R;O&&(v=c);for(M in v)A=!S&&g&&g[M]!==void 0,!(A&&o(d,M))&&(R=A?g[M]:v[M],d[M]=O&&typeof g[M]!="function"?v[M]:T&&A?i(R,e):l&&g[M]==R?function(b){var E=function E(L,D,I){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,I);}return b.apply(this,arguments);};return E[s]=b[s],E;}(R):m&&typeof R=="function"?i(Function.call,R):R,m&&((d.virtual||(d.virtual={}))[M]=R,p&f.R&&u&&!u[M]&&a(u,M,R)));};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(o){return n.call(i,o);};case 2:return function(o,s){return n.call(i,o,s);};case 3:return function(o,s,f){return n.call(i,o,s,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,o){return e.f(i,a,n(1,o));}:function(i,a,o){return i[a]=o,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(s,f,p){if(e(s),f=i(f,!0),e(p),n)try{return a(s,f,p);}catch(_unused15){}if("get"in p||"set"in p)throw TypeError("Accessors not supported!");return"value"in p&&(s[f]=p.value),s;};},/* 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,o;if(i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n))||typeof(a=n.valueOf)=="function"&&!e(o=a.call(n))||!i&&typeof(a=n.toString)=="function"&&!e(o=a.call(n)))return o;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(o,s,f){o.prototype=e(a,{next:n(1,f)}),i(o,s+" Iterator");};},/* 108 */ /***/function(h,r,t){var e=t(97),n=t(109),i=t(119),a=t(116)("IE_PROTO"),o=function o(){},s="prototype",_f2=function f(){var p=t(102)("iframe"),c=i.length,v="<",S=">",O;for(p.style.display="none",t(120).appendChild(p),p.src="javascript:",O=p.contentWindow.document,O.open(),O.write(v+"script"+S+"document.F=Object"+v+"/script"+S),O.close(),_f2=O.F;c--;)delete _f2[s][i[c]];return _f2();};h.exports=Object.create||function(c,v){var S;return c!==null?(o[s]=e(c),S=new o(),o[s]=null,S[a]=c):S=_f2(),v===void 0?S:n(S,v);};},/* 109 */ /***/function(h,r,t){var e=t(96),n=t(97),i=t(110);h.exports=t(100)?Object.defineProperties:function(o,s){n(o);for(var f=i(s),p=f.length,c=0,v;p>c;)e.f(o,v=f[c++],s[v]);return o;};},/* 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(o,s){var f=n(o),p=0,c=[],v;for(v in f)v!=a&&e(f,v)&&c.push(v);for(;s.length>p;)e(f,v=s[p++])&&(~i(c,v)||c.push(v));return c;};},/* 112 */ /***/function(h,r,t){var e=t(84),n=t(113),i=t(115);h.exports=function(a){return function(o,s,f){var p=e(o),c=n(p.length),v=i(f,c),S;if(a&&s!=s){for(;c>v;)if(S=p[v++],S!=S)return!0;}else for(;c>v;v++)if((a||v in p)&&p[v]===s)return a||v||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,o){return a=e(a),a<0?n(a+o,0):i(a,o);};},/* 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(o,s){return a[o]||(a[o]=s!==void 0?s:{});})("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,o,s){a&&!n(a=s?a:a.prototype,i)&&e(a,i,{configurable:!0,value:o});};},/* 122 */ /***/function(h,r,t){var e=t(117)("wks"),n=t(118),i=t(91).Symbol,a=typeof i=="function",o=h.exports=function(s){return e[s]||(e[s]=a&&i[s]||(a?i:n)("Symbol."+s));};o.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(o){return o=n(o),e(o,i)?o[i]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o 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,o){var s=String(n(a)),f=e(o),p=s.length,c,v;return f<0||f>=p?i?"":void 0:(c=s.charCodeAt(f),c<55296||c>56319||f+1===p||(v=s.charCodeAt(f+1))<56320||v>57343?i?s.charAt(f):c:i?s.slice(f,f+2):(c-55296<<10)+(v-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 o=Object(a);return o[n]!==void 0||"@@iterator"in o||i.hasOwnProperty(e(o));};},/* 128 */ /***/function(h,r,t){var e=t(86),n=t(122)("toStringTag"),i=e(/* @__PURE__ */function(){return arguments;}())=="Arguments",a=function a(o,s){try{return o[s];}catch(_unused17){}};h.exports=function(o){var s,f,p;return o===void 0?"Undefined":o===null?"Null":typeof(f=a(s=Object(o),n))=="string"?f:i?e(s):(p=e(s))=="Object"&&typeof s.callee=="function"?"Arguments":p;};},/* 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 o=0,s=Array(a.length);o<a.length;o++)s[o]=a[o];return s;}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),o=t(138),s=t(113),f=t(139),p=t(132);n(n.S+n.F*!t(140)(function(c){Array.from(c);}),"Array",{// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
|
|
255
|
-
from:function from(v){var S=i(v),O=typeof this=="function"?this:Array,x=arguments.length,m=x>1?arguments[1]:void 0,T=m!==void 0,l=0,d=p(S),u,g,M,A;if(T&&(m=e(m,x>2?arguments[2]:void 0,2)),d!=null&&!(O==Array&&o(d)))for(A=d.call(S),g=new O();!(M=A.next()).done;l++)f(g,l,T?a(A,m,[M.value,l],!0):M.value);else for(u=s(S.length),g=new O(u);u>l;l++)f(g,l,T?m(S[l],l):S[l]);return g.length=l,g;}});},/* 137 */ /***/function(h,r,t){var e=t(97);h.exports=function(n,i,a,o){try{return o?i(e(a)[0],a[1]):i(a);}catch(f){var s=n["return"];throw s!==void 0&&e(s.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,o){a in i?e.f(i,a,n(0,o)):i[a]=o;};},/* 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,o){if(!o&&!n)return!1;var s=!1;try{var f=[7],p=f[e]();p.next=function(){return{done:s=!0};},f[e]=function(){return p;},a(f);}catch(_unused19){}return s;};},/* 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(o){var s=e.getEntry(n(this,i),o);return s&&s.v;},// 23.1.3.9 Map.prototype.set(key, value)
|
|
257
|
-
set:function set(o,s){return e.def(n(this,i),o===0?0:o,s);}},e,!0);},/* 145 */ /***/function(h,r,t){var e=t(96).f,n=t(108),i=t(146),a=t(93),o=t(147),s=t(148),f=t(88),p=t(82),c=t(149),v=t(100),S=t(150).fastKey,O=t(151),x=v?"_s":"size",m=function m(T,l){var d=S(l),u;if(d!=="F")return T._i[d];for(u=T._f;u;u=u.n)if(u.k==l)return u;};h.exports={getConstructor:function getConstructor(T,l,d,u){var g=T(function(M,A){o(M,g,l,"_i"),M._t=l,M._i=n(null),M._f=void 0,M._l=void 0,M[x]=0,A!=null&&s(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,l),R=A._i,b=A._f;b;b=b.n)b.r=!0,b.p&&(b.p=b.p.n=void 0),delete R[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,l),R=m(A,M);if(R){var b=R.n,E=R.p;delete A._i[R.i],R.r=!0,E&&(E.n=b),b&&(b.p=E),A._f==R&&(A._f=b),A._l==R&&(A._l=E),A[x]--;}return!!R;},// 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,l);for(var R=a(A,arguments.length>1?arguments[1]:void 0,3),b;b=b?b.n:this._f;)for(R(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,l),A);}}),v&&e(g.prototype,"size",{get:function get(){return O(this,l)[x];}}),g;},def:function def(T,l,d){var u=m(T,l),g,M;return u?u.v=d:(T._l=u={i:M=S(l,!0),// <- index
|
|
266
|
-
k:l,// <- 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,l,d){f(T,l,function(u,g){this._t=O(u,l),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,p(1)):g=="keys"?p(0,M.k):g=="values"?p(0,M.v):p(0,[M.k,M.v]);},d?"entries":"values",!d,!0),c(l);}};},/* 146 */ /***/function(h,r,t){var e=t(95);h.exports=function(n,i,a){for(var o in i)a&&n[o]?n[o]=i[o]:e(n,o,i[o]);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,c,t){var e=t(93),n=t(137),i=t(138),a=t(97),o=t(113),s=t(132),f={},p={},c=h.exports=function(v,S,O,x,m){var T=m?function(){return v;}:s(v),l=e(O,x,S?2:1),d=0,u,g,M,A;if(typeof T!="function")throw TypeError(v+" is not iterable!");if(i(T)){for(u=o(v.length);u>d;d++)if(A=S?l(a(g=v[d])[0],g[1]):l(v[d]),A===f||A===p)return A;}else for(M=T.call(v);!(g=M.next()).done;)if(A=n(M,l,g.value,S),A===f||A===p)return A;};c.BREAK=f,c.RETURN=p;},/* 149 */ /***/function(h,r,t){var e=t(91),n=t(92),i=t(96),a=t(100),o=t(122)("species");h.exports=function(s){var f=typeof n[s]=="function"?n[s]:e[s];a&&f&&!f[o]&&i.f(f,o,{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,o=0,s=Object.isExtensible||function(){return!0;},f=!t(101)(function(){return s(Object.preventExtensions({}));}),p=function p(x){a(x,e,{value:{i:"O"+ ++o,// object ID
|
|
272
|
-
w:{}// weak collections IDs
|
|
273
|
-
}});},c=function c(x,m){if(!n(x))return _typeof(x)=="symbol"?x:(typeof x=="string"?"S":"P")+x;if(!i(x,e)){if(!s(x))return"F";if(!m)return"E";p(x);}return x[e].i;},v=function v(x,m){if(!i(x,e)){if(!s(x))return!0;if(!m)return!1;p(x);}return x[e].w;},S=function S(x){return f&&O.NEED&&s(x)&&!i(x,e)&&p(x),x;},O=h.exports={KEY:e,NEED:!1,fastKey:c,getWeak:v,onFreeze:S};},/* 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),o=t(95),s=t(146),f=t(148),p=t(147),c=t(98),v=t(121),S=t(96).f,O=t(153)(0),x=t(100);h.exports=function(m,T,l,d,u,g){var M=e[m],A=M,R=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,R),s(A.prototype,l),i.NEED=!0):(A=T(function(L,D){p(L,A,m,"_c"),L._c=new M(),D!=null&&f(D,u,L[R],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")&&o(A.prototype,L,function(I,C){if(p(this,A,L),!D&&g&&!c(I))return L=="get"?void 0:!1;var W=this._c[L](I===0?0:I,C);return D?this:W;});}),g||S(A.prototype,"size",{get:function get(){return this._c.size;}})),v(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),o=t(154);h.exports=function(s,f){var p=s==1,c=s==2,v=s==3,S=s==4,O=s==6,x=s==5||O,m=f||o;return function(T,l,d){for(var u=i(T),g=n(u),M=e(l,d,3),A=a(g.length),R=0,b=p?m(T,A):c?m(T,0):void 0,E,L;A>R;R++)if((x||R in g)&&(E=g[R],L=M(E,R,u),s)){if(p)b[R]=L;else if(L)switch(s){case 3:return!0;case 5:return E;case 6:return R;case 2:b.push(E);}else if(S)return!1;}return O?-1:v||S?S: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 o;return n(a)&&(o=a.constructor,typeof o=="function"&&(o===Array||n(o.prototype))&&(o=void 0),e(o)&&(o=o[i],o===null&&(o=void 0))),o===void 0?Array:o;};},/* 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,o=new Array(a);a--;)o[a]=arguments[a];return new this(o);}});};},/* 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(o){e(e.S,o,{from:function from(f){var p=arguments[1],c,v,S,O;return n(this),c=p!==void 0,c&&n(p),f==null?new this():(v=[],c?(S=0,O=i(p,arguments[2],2),a(f,!1,function(x){v.push(O(x,S++));})):a(f,!1,v.push,v),new this(v));}});};},/* 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),o=t(124),s=t(85),f=Object.assign;h.exports=!f||t(101)(function(){var p={},c={},v=Symbol(),S="abcdefghijklmnopqrst";return p[v]=7,S.split("").forEach(function(O){c[O]=O;}),f({},p)[v]!=7||Object.keys(f({},c)).join("")!=S;})?function(c,v){for(var S=o(c),O=arguments.length,x=1,m=i.f,T=a.f;O>x;)for(var l=s(arguments[x++]),d=m?n(l).concat(m(l)):n(l),u=d.length,g=0,M;u>g;)M=d[g++],(!e||T.call(l,M))&&(S[M]=l[M]);return S;}: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(o,s){for(var f=0;f<s.length;f++){var p=s[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),(0,n["default"])(o,p.key,p);}}return function(o,s,f){return s&&a(o.prototype,s),f&&a(o,f),o;};}();},/* 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,o){return e.defineProperty(i,a,o);};},/* 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),o=t(106),s=t(150).KEY,f=t(101),p=t(117),c=t(121),v=t(118),S=t(122),O=t(178),x=t(179),m=t(180),T=t(156),l=t(97),d=t(98),u=t(124),g=t(84),M=t(103),A=t(104),R=t(108),b=t(181),E=t(183),L=t(168),D=t(96),I=t(110),C=E.f,W=D.f,G=b.f,_K2=e.Symbol,J=e.JSON,Z=J&&J.stringify,B="prototype",$=S("_hidden"),Q=S("toPrimitive"),et={}.propertyIsEnumerable,tt=p("symbol-registry"),ot=p("symbols"),q=p("op-symbols"),gt=Object[B],dt=typeof _K2=="function"&&!!L.f,F=e.QObject,j=!F||!F[B]||!F[B].findChild,V=i&&f(function(){return R(W({},"a",{get:function get(){return W(this,"a",{value:7}).a;}})).a!=7;})?function(at,st,ft){var vt=C(gt,st);vt&&delete gt[st],W(at,st,ft),vt&&at!==gt&&W(gt,st,vt);}:W,X=function X(at){var st=ot[at]=R(_K2[B]);return st._k=at,st;},N=dt&&_typeof(_K2.iterator)=="symbol"?function(at){return _typeof(at)=="symbol";}:function(at){return at instanceof _K2;},z=function z(st,ft,vt){return st===gt&&z(q,ft,vt),l(st),ft=M(ft,!0),l(vt),n(ot,ft)?(vt.enumerable?(n(st,$)&&st[$][ft]&&(st[$][ft]=!1),vt=R(vt,{enumerable:A(0,!1)})):(n(st,$)||W(st,$,A(1,{})),st[$][ft]=!0),V(st,ft,vt)):W(st,ft,vt);},y=function y(st,ft){l(st);for(var vt=m(ft=g(ft)),mt=0,pt=vt.length,St;pt>mt;)z(st,St=vt[mt++],ft[St]);return st;},P=function P(st,ft){return ft===void 0?R(st):y(R(st),ft);},w=function w(st){var ft=et.call(this,st=M(st,!0));return this===gt&&n(ot,st)&&!n(q,st)?!1:ft||!n(this,st)||!n(ot,st)||n(this,$)&&this[$][st]?ft:!0;},U=function U(st,ft){if(st=g(st),ft=M(ft,!0),!(st===gt&&n(ot,ft)&&!n(q,ft))){var vt=C(st,ft);return vt&&n(ot,ft)&&!(n(st,$)&&st[$][ft])&&(vt.enumerable=!0),vt;}},H=function H(st){for(var ft=G(g(st)),vt=[],mt=0,pt;ft.length>mt;)!n(ot,pt=ft[mt++])&&pt!=$&&pt!=s&&vt.push(pt);return vt;},Y=function Y(st){for(var ft=st===gt,vt=G(ft?q:g(st)),mt=[],pt=0,St;vt.length>pt;)n(ot,St=vt[pt++])&&(!ft||n(gt,St))&&mt.push(ot[St]);return mt;};dt||(_K2=function K(){if(this instanceof _K2)throw TypeError("Symbol is not a constructor!");var st=v(arguments.length>0?arguments[0]:void 0),ft=function ft(vt){this===gt&&ft.call(q,vt),n(this,$)&&n(this[$],st)&&(this[$][st]=!1),V(this,st,A(1,vt));};return i&&j&&V(gt,st,{configurable:!0,set:ft}),X(st);},o(_K2[B],"toString",function(){return this._k;}),E.f=U,D.f=z,t(182).f=b.f=H,t(169).f=w,L.f=Y,i&&!t(89)&&o(gt,"propertyIsEnumerable",w,!0),O.f=function(at){return X(S(at));}),a(a.G+a.W+a.F*!dt,{Symbol:_K2});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;)S(k[rt++]);for(var it=I(S.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(at){return n(tt,at+="")?tt[at]:tt[at]=_K2(at);},// 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 tt)if(tt[ft]===st)return ft;},useSetter:function useSetter(){j=!0;},useSimple:function useSimple(){j=!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:z,// 19.1.2.3 Object.defineProperties(O, Properties)
|
|
279
|
-
defineProperties:y,// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
|
|
280
|
-
getOwnPropertyDescriptor:U,// 19.1.2.7 Object.getOwnPropertyNames(O)
|
|
281
|
-
getOwnPropertyNames:H,// 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));}}),J&&a(a.S+a.F*(!dt||f(function(){var at=_K2();return Z([at])!="[null]"||Z({a:at})!="{}"||Z(Object(at))!="{}";})),"JSON",{stringify:function stringify(st){for(var ft=[st],vt=1,mt,pt;arguments.length>vt;)ft.push(arguments[vt++]);if(pt=mt=ft[1],!(!d(mt)&&st===void 0||N(st)))return T(mt)||(mt=function mt(St,It){if(typeof pt=="function"&&(It=pt.call(this,St,It)),!N(It))return It;}),ft[1]=mt,Z.apply(J,ft);}}),_K2[B][Q]||t(95)(_K2[B],Q,_K2[B].valueOf),c(_K2,"Symbol"),c(Math,"Math",!0),c(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),o=t(96).f;h.exports=function(s){var f=n.Symbol||(n.Symbol=i?{}:e.Symbol||{});s.charAt(0)!="_"&&!(s in f)&&o(f,s,{value:a.f(s)});};},/* 180 */ /***/function(h,r,t){var e=t(110),n=t(168),i=t(169);h.exports=function(a){var o=e(a),s=n.f;if(s)for(var f=s(a),p=i.f,c=0,v;f.length>c;)p.call(a,v=f[c++])&&o.push(v);return o;};},/* 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):[],o=function o(s){try{return n(s);}catch(_unused20){return a.slice();}};h.exports.f=function(f){return a&&i.call(f)=="[object Window]"?o(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),o=t(105),s=t(99),f=Object.getOwnPropertyDescriptor;r.f=t(100)?f:function(c,v){if(c=i(c),v=a(v,!0),s)try{return f(c,v);}catch(_unused21){}if(o(c,v))return n(!e.f.call(c,v),c[v]);};},/* 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,o,s){return typeof n=="number"&&typeof i=="number"?n+(a-o)/(s-o)*(i-n):a-o>s-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),o=t(141),s=f(o);function f(T){return T&&T.__esModule?T:{"default":T};}var p=t(189),c=new s["default"]();function v(){for(var T=arguments.length,l=Array(T),d=0;d<T;d++)l[d]=arguments[d];var u=c.get(l);return u||(u=p.apply(void 0,l),c.set(l,u),u);}function S(T){var l=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,R=M,b=(d-A)/(R-A),E=1/T,L=b/E;return l==="end"?L=Math.floor(L):L=Math.ceil(L),E*L*(R-A)+A;}}return 0;};}function O(T){var l=/^cubic-bezier\((.*)\)/,d=T.match(l);if(d){var u=d[1].trim();return u=u.split(",").map(function(E){return parseFloat(E.trim());}),v.apply(void 0,(0,a["default"])(u));}if(l=/^steps\((.*)\)/,d=T.match(l),d){var g=d[1].trim();g=g.split(",").map(function(E){return E.trim();});var M=g,A=(0,n["default"])(M,2),R=A[0],b=A[1];return S(parseInt(R,10),b);}return T;}var x={linear:function linear(l){return l;},ease:v(0.25,0.1,0.25,1),"ease-in":v(0.42,0,1,1),"ease-out":v(0,0,0.58,1),"ease-in-out":v(0.42,0,0.58,1),// 'step-start': function(p, frames){
|
|
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":S(1,"start"),"step-end":S(1,"end")};function m(T){return typeof T=="string"?x[T]?T=x[T]:T=O(T):T.type==="cubic-bezier"?T=v.apply(void 0,(0,a["default"])(T.value)):T.type==="steps"&&(T=S(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,o=1/(a-1),s=typeof Float32Array=="function";function f(T,l){return 1-3*l+3*T;}function p(T,l){return 3*l-6*T;}function c(T){return 3*T;}function v(T,l,d){return((f(l,d)*T+p(l,d))*T+c(l))*T;}function S(T,l,d){return 3*f(l,d)*T*T+2*p(l,d)*T+c(l);}function O(T,l,d,u,g){var M,A,R=0;do A=l+(d-l)/2,M=v(A,u,g)-T,M>0?d=A:l=A;while(Math.abs(M)>n&&++R<i);return A;}function x(T,l,d,u){for(var g=0;g<t;++g){var M=S(l,d,u);if(M===0)return l;var A=v(l,d,u)-T;l-=A/M;}return l;}function m(T){return T;}h.exports=function(l,d,u,g){if(!(0<=l&&l<=1&&0<=u&&u<=1))throw new Error("bezier x values must be in [0, 1] range");if(l===d&&u===g)return m;for(var M=s?new Float32Array(a):new Array(a),A=0;A<a;++A)M[A]=v(A*o,l,u);function R(b){for(var E=0,L=1,D=a-1;L!==D&&M[L]<=b;++L)E+=o;--L;var I=(b-M[L])/(M[L+1]-M[L]),C=E+I*o,W=S(C,l,u);return W>=e?x(b,C,l,u):W===0?C:O(b,E,E+o,l,u);}return function(E){return E===0?0:E===1?1:v(R(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),o=t(164),s=d(o),f=t(170),p=d(f),c=t(171),v=d(c),S=t(175),O=d(S),x=t(75),m=d(x),T=t(208),l=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"),R=(0,O["default"])("finishedDefer"),b=(0,O["default"])("effects"),E=(0,O["default"])("activeReadyTimer"),L=(0,O["default"])("activeFinishTimer"),D=(0,O["default"])("removeDefer"),I={delay:0,endDelay:0,fill:"auto",iterations:1,playbackRate:1,direction:"normal",easing:"linear",effect:null},C=function(){function W(G,K,J){var Z=this;if((0,p["default"])(this,W),Array.isArray(G)){var B=[G[0],G,K];G=B[0],K=B[1],J=B[2];}typeof J=="number"&&(J={duration:J}),this[u]=(0,s["default"])({},I,J),this[u].easing=(0,l.parseEasing)(this[u].easing),this[g]=(0,T.calculateFramesOffset)(K);var $=this[g][this[g].length-1];this[M]={},(0,a["default"])($).forEach(function(Q){Object.prototype.hasOwnProperty.call(G,Q)&&Q!=="easing"&&Q!=="offset"&&(Z[M][Q]=G[Q]);}),this[g]=this[g].map(function(Q){return(0,s["default"])({},Z[M],Q);}),this[g][0].offset!==0&&this[g].unshift((0,s["default"])({},this[M],{offset:0})),$.offset<1&&this[g].push((0,s["default"])({},$,{offset:1})),this[b]={},this.timeline=null;}return(0,v["default"])(W,[{key:"pause",value:function value(){this.timeline.playbackRate=0;}},{key:E,value:function value(){var K=this;this[A]&&!this[A].timerID&&(this.timeline.currentTime<0?this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),delete K[A];},{delay:-this.timeline.currentTime,heading:!1}):this[A].timerID=this.timeline.setTimeout(function(){K[A].resolve(),delete K[A];},{delay:0,isEntropy:!0}));}},{key:L,value:function value(){var K=this,J=this[u],Z=J.duration,B=J.iterations,$=J.endDelay,Q=Math.ceil(Z*B+$-this.timeline.currentTime)+1;this[R]&&!this[R].timerID&&(this[R].timerID=this.timeline.setTimeout(function(){K[R].resolve(),K[D](A),K[D](R);},{delay:Q,heading:!1}),this[R].reverseTimerID=this.timeline.setTimeout(function(){K[R].resolve(),K[D](A),K[D](R),K.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 K=this[u],J=K.delay,Z=K.playbackRate,B=K.timeline;this.timeline=new m["default"]({originTime:J,playbackRate:Z},B),this[E](),this[L]();}else this.playState==="paused"&&(this.timeline.playbackRate=this.playbackRate,this[E]());}},{key:D,value:function value(K){var J=this[K],Z=this.timeline;J&&Z&&(Z.clearTimeout(J.timerID),J.reverseTimerID&&Z.clearTimeout(J.reverseTimerID)),delete this[K];}},{key:"cancel",value:function value(){this[D](A),this[D](R),this.timeline=null;}},{key:"finish",value:function value(){this.timeline&&(this.timeline.currentTime=1/0/this.playbackRate),this[D](A),this[D](R);}},{key:"applyEffects",value:function value(K){return(0,s["default"])(this[b],K);}},{key:"playbackRate",get:function get(){return this[u].playbackRate;},set:function set(K){this.timeline&&(this.timeline.playbackRate=K),this[u].playbackRate=K;}},{key:"playState",get:function get(){var K=this.timeline,J=this[u],Z=J.iterations,B=J.duration,$=J.endDelay,Q="running";if(K==null)Q="idle";else if(K.paused)Q="paused";else if(K.currentTime<0)Q="pending";else{var et=K.currentTime-Z*B;et>0&&et<$?Q="pending":et>=$&&(Q="finished");}return Q;}},{key:"progress",get:function get(){if(!this.timeline)return 0;var K=this[u],J=K.duration,Z=K.iterations,B=this.timeline,$=this.playState,Q=void 0;if($==="idle")Q=0;else if($==="paused"&&B.currentTime<0)Q=0;else if($==="pending"){if(B.currentTime<0)Q=0;else{var et=B.seekLocalTime(Z*J);Q=(0,T.periodicity)(et,J)[1]/J;}}else($==="running"||$==="paused")&&(Q=(0,T.periodicity)(B.currentTime,J)[1]/J);return $==="finished"&&(Q=(0,T.periodicity)(Z,1)[1]),Q;}},{key:"frame",get:function get(){var K=this.playState,J=this[M],Z=this[u].fill;if(K==="idle")return J;var B=this.timeline.currentTime,$=this[g].slice(0),Q=(0,T.getProgress)(this.timeline,this[u],this.progress),et=Q.p,tt=Q.inverted,ot=J;return B<0&&K==="pending"?(Z==="backwards"||Z==="both")&&(ot=tt?$[$.length-1]:$[0]):(K!=="pending"&&K!=="finished"||Z==="forwards"||Z==="both")&&(ot=(0,T.getCurrentFrame)(this[u],$,this[b],et)),ot;}},{key:"timing",get:function get(){return this[u];}},{key:"effects",get:function get(){return this[b];}},{key:"baseTimeline",set:function set(K){this[u].timeline=K;},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[R]||(this[R]=(0,T.defer)(),this.timeline&&this[L]()),this[R].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),o=t(90),s=t(98),f=t(94),p=t(147),c=t(148),v=t(194),S=t(195).set,O=t(197)(),x=t(198),m=t(199),T=t(200),l=t(201),d="Promise",u=n.TypeError,g=n.process,M=g&&g.versions,A=M&&M.v8||"",_R=n[d],b=a(g)=="process",E=function E(){},L,D,I,C,W=D=x.f,G=!!function(){try{var tt=_R.resolve(1),ot=(tt.constructor={})[t(122)("species")]=function(q){q(E,E);};return(b||typeof PromiseRejectionEvent=="function")&&tt.then(E)instanceof ot&&A.indexOf("6.6")!==0&&T.indexOf("Chrome/66")===-1;}catch(_unused22){}}(),K=function K(tt){var ot;return s(tt)&&typeof(ot=tt.then)=="function"?ot:!1;},J=function J(tt,ot){if(!tt._n){tt._n=!0;var q=tt._c;O(function(){for(var gt=tt._v,dt=tt._s==1,F=0,j=function j(V){var X=dt?V.ok:V.fail,N=V.resolve,z=V.reject,y=V.domain,P,w,U;try{X?(dt||(tt._h==2&&$(tt),tt._h=1),X===!0?P=gt:(y&&y.enter(),P=X(gt),y&&(y.exit(),U=!0)),P===V.promise?z(u("Promise-chain cycle")):(w=K(P))?w.call(P,N,z):N(P)):z(gt);}catch(H){y&&!U&&y.exit(),z(H);}};q.length>F;)j(q[F++]);tt._c=[],tt._n=!1,ot&&!tt._h&&Z(tt);});}},Z=function Z(tt){S.call(n,function(){var ot=tt._v,q=B(tt),gt,dt,F;if(q&&(gt=m(function(){b?g.emit("unhandledRejection",ot,tt):(dt=n.onunhandledrejection)?dt({promise:tt,reason:ot}):(F=n.console)&&F.error&&F.error("Unhandled promise rejection",ot);}),tt._h=b||B(tt)?2:1),tt._a=void 0,q&>.e)throw gt.v;});},B=function B(tt){return tt._h!==1&&(tt._a||tt._c).length===0;},$=function $(tt){S.call(n,function(){var ot;b?g.emit("rejectionHandled",tt):(ot=n.onrejectionhandled)&&ot({promise:tt,reason:tt._v});});},Q=function Q(tt){var ot=this;ot._d||(ot._d=!0,ot=ot._w||ot,ot._v=tt,ot._s=2,ot._a||(ot._a=ot._c.slice()),J(ot,!0));},et=function et(tt){var ot=this,q;if(!ot._d){ot._d=!0,ot=ot._w||ot;try{if(ot===tt)throw u("Promise can't be resolved itself");(q=K(tt))?O(function(){var gt={_w:ot,_d:!1};try{q.call(tt,i(et,gt,1),i(Q,gt,1));}catch(dt){Q.call(gt,dt);}}):(ot._v=tt,ot._s=1,J(ot,!1));}catch(gt){Q.call({_w:ot,_d:!1},gt);}}};G||(_R=function R(ot){p(this,_R,d,"_h"),f(ot),L.call(this);try{ot(i(et,this,1),i(Q,this,1));}catch(q){Q.call(this,q);}},L=function L(ot){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)(_R.prototype,{// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
|
|
306
|
-
then:function then(ot,q){var gt=W(v(this,_R));return gt.ok=typeof ot=="function"?ot:!0,gt.fail=typeof q=="function"&&q,gt.domain=b?g.domain:void 0,this._c.push(gt),this._a&&this._a.push(gt),this._s&&J(this,!1),gt.promise;},// 25.4.5.1 Promise.prototype.catch(onRejected)
|
|
307
|
-
"catch":function _catch(tt){return this.then(void 0,tt);}}),I=function I(){var tt=new L();this.promise=tt,this.resolve=i(et,tt,1),this.reject=i(Q,tt,1);},x.f=W=function W(tt){return tt===_R||tt===C?new I(tt):D(tt);}),o(o.G+o.W+o.F*!G,{Promise:_R}),t(121)(_R,d),t(149)(d),C=t(92)[d],o(o.S+o.F*!G,d,{// 25.4.4.5 Promise.reject(r)
|
|
308
|
-
reject:function reject(ot){var q=W(this),gt=q.reject;return gt(ot),q.promise;}}),o(o.S+o.F*(e||!G),d,{// 25.4.4.6 Promise.resolve(x)
|
|
309
|
-
resolve:function resolve(ot){return l(e&&this===C?_R:this,ot);}}),o(o.S+o.F*!(G&&t(140)(function(tt){_R.all(tt)["catch"](E);})),d,{// 25.4.4.1 Promise.all(iterable)
|
|
310
|
-
all:function all(ot){var q=this,gt=W(q),dt=gt.resolve,F=gt.reject,j=m(function(){var V=[],X=0,N=1;c(ot,!1,function(z){var y=X++,P=!1;V.push(void 0),N++,q.resolve(z).then(function(w){P||(P=!0,V[y]=w,--N||dt(V));},F);}),--N||dt(V);});return j.e&&F(j.v),gt.promise;},// 25.4.4.4 Promise.race(iterable)
|
|
311
|
-
race:function race(ot){var q=this,gt=W(q),dt=gt.reject,F=m(function(){c(ot,!1,function(j){q.resolve(j).then(gt.resolve,dt);});});return F.e&&dt(F.v),gt.promise;}});},/* 194 */ /***/function(h,r,t){var e=t(97),n=t(94),i=t(122)("species");h.exports=function(a,o){var s=e(a).constructor,f;return s===void 0||(f=e(s)[i])==null?o:n(f);};},/* 195 */ /***/function(h,r,t){var e=t(93),n=t(196),i=t(120),a=t(102),o=t(91),s=o.process,f=o.setImmediate,p=o.clearImmediate,c=o.MessageChannel,v=o.Dispatch,S=0,O={},x="onreadystatechange",m,T,l,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||!p)&&(f=function f(M){for(var A=[],R=1;arguments.length>R;)A.push(arguments[R++]);return O[++S]=function(){n(typeof M=="function"?M:Function(M),A);},m(S),S;},p=function p(M){delete O[M];},t(86)(s)=="process"?m=function m(g){s.nextTick(e(d,g,1));}:v&&v.now?m=function m(g){v.now(e(d,g,1));}:c?(T=new c(),l=T.port2,T.port1.onmessage=u,m=e(l.postMessage,l,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(m=function m(g){o.postMessage(g+"","*");},o.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:p};},/* 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,o=e.Promise,s=t(86)(a)=="process";h.exports=function(){var f,p,c,v=function v(){var m,T;for(s&&(m=a.domain)&&m.exit();f;){T=f.fn,f=f.next;try{T();}catch(l){throw f?c():p=void 0,l;}}p=void 0,m&&m.enter();};if(s)c=function c(){a.nextTick(v);};else if(i&&!(e.navigator&&e.navigator.standalone)){var S=!0,O=document.createTextNode("");new i(v).observe(O,{characterData:!0}),c=function c(){O.data=S=!S;};}else if(o&&o.resolve){var x=o.resolve(void 0);c=function c(){x.then(v);};}else c=function c(){n.call(e,v);};return function(m){var T={fn:m,next:void 0};p&&(p.next=T),f||(f=T,c()),p=T;};};},/* 198 */ /***/function(h,r,t){var e=t(94);function n(i){var a,o;this.promise=new i(function(s,f){if(a!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");a=s,o=f;}),this.resolve=e(a),this.reject=e(o);}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,o){if(e(a),n(o)&&o.constructor===a)return o;var s=i.f(a),f=s.resolve;return f(o),s.promise;};},/* 202 */ /***/function(h,r,t){var e=t(90),n=t(92),i=t(91),a=t(194),o=t(201);e(e.P+e.R,"Promise",{"finally":function _finally(s){var f=a(this,n.Promise||i.Promise),p=typeof s=="function";return this.then(p?function(c){return o(f,s()).then(function(){return c;});}:s,p?function(c){return o(f,s()).then(function(){throw c;});}:s);}});},/* 203 */ /***/function(h,r,t){var e=t(90),n=t(198),i=t(199);e(e.S,"Promise",{"try":function _try(a){var o=n.f(this),s=i(a);return(s.e?o.reject:o.resolve)(s.v),o.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,o){var s=(n.Object||{})[a]||Object[a],f={};f[a]=o(s),e(e.S+e.F*i(function(){s(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),o=t(164),s=O(o),f=t(191),p=O(f);r.defer=x,r.periodicity=m,r.calculateFramesOffset=T,r.getProgress=l,r.getCurrentFrame=u;var c=t(188),v=t(187),S=O(v);function O(g){return g&&g.__esModule?g:{"default":g};}function x(){var g={};return g.promise=new p["default"](function(M,A){g.resolve=M,g.reject=A;}),g;}function m(g,M){var A=Math.floor(g/M),R=g-A*M;return R===0&&A>0&&(R=M,A--),[A,R];}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 R=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 I=(L.offset-R)/D,C=0;C<D-1;C++)g[b+C+1].offset=R+I*(C+1);R=L.offset,b=E;}if(L.easing!=null&&(L.easing=(0,c.parseEasing)(L.easing)),E>0){var W=g[E].easing!=null;g[E]=(0,s["default"])({},g[E-1],g[E]),W||delete g[E].easing;}}return g;}function l(g,M,A){var R=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(R/E);A===1&&D--,D%2^b==="alternate-reverse"&&(A=1-A,L=!0);}return{p:A,inverted:L};}function d(g,M,A,R){var b={};return(0,a["default"])(M).forEach(function(E){var L=(0,n["default"])(E,2),D=L[0],I=L[1];if(D!=="offset"&&D!=="easing"){var C=A[D]||A["default"],W=C(g[D],I,R,g.offset,M.offset);W!=null&&(b[D]=W);}}),b;}function u(g,M,A,R){var b=g.easing,E=g.effect;E||(A=(0,s["default"])({},S["default"],A));var L={};R=b(R,M);for(var D=1;D<M.length;D++){var I=M[D],C=I.offset;if(C>=R||D===M.length-1){var W=M[D-1],G=W.offset,K=W.easing,J=R;if(K){var Z=C-G;J=K((R-G)/Z)*Z+G;}E?L=E(W,I,J,G,C):L=d(W,I,A,J);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(o){return function(s){for(var f=i(s),p=n(f),c=p.length,v=0,S=[],O;c>v;)O=p[v++],(!e||a.call(f,O))&&S.push(o?[O,f[O]]:f[O]);return S;};};},/* 213 */ /***/function(h,r,t){t.r(r),t(1).glMatrix.setMatrixArrayType(Array);var e=/* @__PURE__ */new Map();function n(a){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=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 p=new f(o);return s.forEach(function(c){p.appendChild(c);}),p;}var i={registerNode:function registerNode(a,o){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:100;if(o=o.toLowerCase(),e.has(o))throw new TypeError("Cannot registerNode, ".concat(o," has been taken."));e.set(o,a),Object.defineProperties(a.prototype,{nodeType:{value:s},tagName:{value:o.toUpperCase()},nodeName:{value:o},ownerDocument:{value:i},namespaceURI:{value:"http://spritejs.com/".concat(o)}});},createElement:n,createElementNS:function createElementNS(a,o){return n(o);},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 o;}),t(1).glMatrix.setMatrixArrayType(Array);var e=Symbol("type"),n=Symbol("bubbles"),i=Symbol("originalEvent"),a=Symbol("detail");var o=/*#__PURE__*/function(){function o(f){var _ref116=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref116$bubbles=_ref116.bubbles,p=_ref116$bubbles===void 0?null:_ref116$bubbles;_classCallCheck(this,o);if(typeof f=="string"?(this[e]=f,this[n]=!!p):(this[e]=f.type,this[i]=f,this[n]=p!=null?!!p:!!f.bubbles,f.detail&&(this[a]=f.detail)),!this[e])throw new TypeError("Invalid event type.");this.cancelBubble=!1;}return _createClass(o,[{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 o=/^(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+$/i,s=a.match(/(?:(url|blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^()]*(?:\(.*\))*[^()]*)\))+?/ig),f=[];return s&&s.forEach(function(p){var c=p.match(o);if(!c)throw new TypeError("Invalid fitler string.");var _c3=_slicedToArray(c,3),v=_c3[1],S=_c3[2];v=v.toLowerCase(),S=S.trim().match(/([^( )]+|([^( )]+\(.*\)))(?=\s|$)/g).map(function(O,x){var m;return v==="url"||v==="drop-shadow"&&x===3?m=O:m=Object(e.toNumber)(O),/%$/.test(O)&&(m/=100),m;}),f.push({type:v,args:S});}),f;}function i(a,o){a.clearFilter(),o&&o.forEach(function(_ref117){var s=_ref117.type,f=_ref117.args;var p=s;p==="drop-shadow"?p="dropShadow":p==="hue-rotate"&&(p="hueRotate"),a[p].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"),o=n.getListeners("afterrender");a.length&&!i.beforeRender?i.beforeRender=function(s){n.dispatchEvent({type:"beforerender",detail:{context:s}});}:a.length||(i.beforeRender=null),o.length&&!i.afterRender?i.afterRender=function(s){n.dispatchEvent({type:"afterrender",detail:{context:s}});}:o.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 o=Symbol("amount"),s=Symbol("meshCloud");var f=/*#__PURE__*/function(_i$default){function f(c){var _this17;var v=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,f);_this17=_callSuper(this,f),_this17.meshNode=c,c.connect(_assertThisInitialized(_this17)),_this17[o]=v,_this17[s]=null;return _this17;}_inherits(f,_i$default);return _createClass(f,[{key:"meshCloud",get:function get(){var c=this.meshNode,v=this[o];return!this[s]&&c.mesh&&(this[s]=new e.MeshCloud(c.mesh,v)),this[s];}/* override */},{key:"isVisible",get:function get(){return!!this.meshNode&&this.meshNode.isVisible;}},{key:"amount",get:function get(){return this[o];},set:function set(c){this[o]=c,this[s]&&(this[s].amount=c);}},{key:"brightness",value:function brightness(c,v){this.meshCloud&&(this.meshCloud.brightness(c,v),this.forceUpdate());}},{key:"contrast",value:function contrast(c,v){this.meshCloud&&(this.meshCloud.contrast(c,v),this.forceUpdate());}},{key:"delete",value:function _delete(c){this.meshCloud&&(this.meshCloud["delete"](c),this[o]--,this.forceUpdate());}/* override */},{key:"draw",value:function draw(){var _this18=this;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(_get(_getPrototypeOf(f.prototype),"draw",this).call(this,c),this.meshCloud){if(this.program){this.meshCloud.setProgram(this.program);var v=this.shaderAttrs;v&&Object.entries(v).forEach(function(_ref118){var _ref119=_slicedToArray(_ref118,2),O=_ref119[0],x=_ref119[1];_this18.meshCloud.mesh.setAttribute(O,x);});var S=this.uniforms;if(this.uniforms){var O={};Object.entries(S).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),c.push(this.meshCloud);}return c;}},{key:"getTransform",value:function getTransform(c){if(this.meshCloud)return this.meshCloud.getTransform(c);}},{key:"grayscale",value:function grayscale(c,v){this.meshCloud&&(this.meshCloud.grayscale(c,v),this.forceUpdate());}},{key:"hueRotate",value:function hueRotate(c,v){this.meshCloud&&(this.meshCloud.hueRotate(c,v),this.forceUpdate());}},{key:"invert",value:function invert(c,v){this.meshCloud&&(this.meshCloud.invert(c,v),this.forceUpdate());}/* override */},{key:"isPointCollision",value:function isPointCollision(c,v){if(!this.meshCloud)return!1;var S=this.attributes.pointerEvents;if(S==="none"||S!=="all"&&!this.isVisible)return!1;var O="both";S==="visibleFill"&&(O="fill"),S==="visibleStroke"&&(O="stroke");for(var x=0;x<this[o];x++)if(!this.meshCloud.isPointCollision(x,[c,v],O))return!1;return!0;}},{key:"setOpacity",value:function setOpacity(c,v){this.meshCloud&&(this.meshCloud.opacity(c,v),this.forceUpdate());}},{key:"rotate",value:function rotate(c,v){var _ref122=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0],_ref123=_slicedToArray(_ref122,2),S=_ref123[0],O=_ref123[1];var x=Math.PI*v/180;if(this.meshCloud){var _this$meshNode$attrib=this.meshNode.attributes,m=_this$meshNode$attrib.x,_T18=_this$meshNode$attrib.y;this.meshCloud.rotate(c,x,[S+m,O+_T18]),this.forceUpdate();}}},{key:"saturate",value:function saturate(c,v){this.meshCloud&&(this.meshCloud.saturate(c,v),this.forceUpdate());}},{key:"scale",value:function scale(c,_ref124){var _ref125=_slicedToArray(_ref124,2),v=_ref125[0],_ref125$=_ref125[1],S=_ref125$===void 0?v:_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,_T19=_this$meshNode$attrib2.y,_l14=1e-5;Math.abs(v)<_l14&&(v=1/v>0?_l14:-_l14),Math.abs(S)<_l14&&(S=1/S>0?_l14:-_l14),this.meshCloud.scale(c,[v,S],[O+m,x+_T19]),this.forceUpdate();}}},{key:"setColorTransform",value:function setColorTransform(c,v){this.meshCloud&&(this.meshCloud.setColorTransform(c,v),this.forceUpdate());}},{key:"setFillColor",value:function setFillColor(c,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setFillColor(c,v),this.forceUpdate());}},{key:"sepia",value:function sepia(c,v){this.meshCloud&&(this.meshCloud.sepia(c,v),this.forceUpdate());}/* override */},{key:"setResolution",value:function setResolution(_ref128){var c=_ref128.width,v=_ref128.height;_get(_getPrototypeOf(f.prototype),"setResolution",this).call(this,{width:c,height:v}),this.meshNode.setResolution({width:c,height:v});}},{key:"setStrokeColor",value:function setStrokeColor(c,v){this.meshCloud&&(Array.isArray(v)&&(v=_toConsumableArray(v),v[0]/=255,v[1]/=255,v[2]/=255),this.meshCloud.setStrokeColor(c,v),this.forceUpdate());}},{key:"setTransform",value:function setTransform(c,v){this.meshCloud&&(this.meshCloud.setTransform(c,v),this.forceUpdate());}},{key:"skew",value:function skew(c,_ref129){var _ref130=_slicedToArray(_ref129,2),v=_ref130[0],_ref130$=_ref130[1],S=_ref130$===void 0?v:_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,_T20=_this$meshNode$attrib3.y;this.meshCloud.skew(c,[v,S],[O+m,x+_T20]),this.forceUpdate();}}},{key:"transform",value:function transform(c,v){this.meshCloud&&(this.meshCloud.transform(c,v),this.forceUpdate());}},{key:"transformColor",value:function transformColor(c,v){this.meshCloud&&(this.meshCloud.transformColor(c,v),this.forceUpdate());}},{key:"translate",value:function translate(c,_ref133){var _ref134=_slicedToArray(_ref133,2),v=_ref134[0],S=_ref134[1];this.meshCloud&&(this.meshCloud.translate(c,[v,S]),this.forceUpdate());}},{key:"updateMesh",value:function updateMesh(){this[s]&&(this[s].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 o;}),t.d(r,"createTexture",function(){return f;}),t.d(r,"deleteTexture",function(){return p;}),t.d(r,"drawTexture",function(){return v;}),t.d(r,"loadFrames",function(){return S;});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 o(_x11,_x12,_x13){return _o2.apply(this,arguments);}function _o2(){_o2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(O,x,m){var T,_O$attributes,_l15,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,_l15=_O$attributes.width,d=_O$attributes.height,u=_O$attributes.textureRect,g=O.textureImage;O.textureImage=T,m&&g!==T&&!u&&(_l15==null||d==null)&&O.updateContours(),O.forceUpdate();case 11:return _context9.abrupt("return",T);case 12:case"end":return _context9.stop();}},_callee9);}));return _o2.apply(this,arguments);}var s=Symbol("textureMap");function f(O,x){if(x[s]=x[s]||/* @__PURE__ */new Map(),x[s].has(O))return x[s].get(O);var m=x.createTexture(O);return!/^blob:/.test(O.src)&&typeof O.getContext!="function"&&x[s].set(O,m),m;}function p(O,x){if(x[s]&&x[s].has(O)){var m=x[s].get(O);return x.deleteTexture(m),x[s]["delete"](O),!0;}return!1;}var c=Symbol("textureContext");function v(O,x){var m=O.textureImage instanceof String?String(O.textureImage):O.textureImage,T=O.textureImageRotated,l=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(!l||O[c]&&O[c]!==d||l.image!==m||l.options.repeat!==M||!Object(n.compareValue)(l.options.rect,g)||!Object(n.compareValue)(l.options.srcRect,A)){var R=f(m,d);g?(g[0]+=u[0],g[1]+=u[1]):g=u;var b=null;l&&!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(b=x.uniforms.u_texSampler),x.setTexture(R,{rect:g,repeat:M,srcRect:A,rotated:T}),b&&b["delete"]&&b["delete"](),O[c]=d;}}else if(l){var _u8=null;!d[s].has(l.image)&&(!l.options||!l.options.hidden)&&(_u8=x.uniforms.u_texSampler),x.setTexture(null),_u8&&_u8["delete"]&&_u8["delete"]();}}function S(_x14,_x15){return _S5.apply(this,arguments);}function _S5(){_S5=_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),l=_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 R=[u,g,M,A];var b=d.rotated;b&&(R=[R[0],R[1],R[3],R[2]]),i[l]={image:m,sourceRect:R,rotated:b};}),m));case 12:case"end":return _context10.stop();}},_callee10);}));return _S5.apply(this,arguments);}},/* 219 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return S;});var e=t(1),n=t(12),i=t(70),a=t(220),o=t(221),s=t(222),f=t(213),p=t(223);t(1).glMatrix.setMatrixArrayType(Array);function c(O,x,m){return x in O?Object.defineProperty(O,x,{value:m,enumerable:!0,configurable:!0,writable:!0}):O[x]=m,O;}var v=Symbol("mesh");var S=/*#__PURE__*/function(_i$default2){function S(){var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,S);return _callSuper(this,S,[x]);}_inherits(S,_i$default2);return _createClass(S,[{key:"borderSize",get:function get(){var _this$attributes2=this.attributes,x=_this$attributes2.paddingTop,m=_this$attributes2.paddingRight,T=_this$attributes2.paddingBottom,l=_this$attributes2.paddingLeft,d=_this$attributes2.borderWidth,_this$contentSize=_slicedToArray(this.contentSize,2),u=_this$contentSize[0],g=_this$contentSize[1];return[l+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,l=_this$attributes3.paddingLeft,_this$contentSize2=_slicedToArray(this.contentSize,2),d=_this$contentSize2[0],u=_this$contentSize2[1];return[l+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,l=_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+l+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[v];if(m)m.box!==x&&(m.contours=x.contours,m.box=x);else{m=new n.Mesh2D(x),m.box=x;var _l16=this.attributes.bgcolor;if(Object(o.setFillColor)(m,{color:_l16}),this.hasBorder){var _this$attributes5=this.attributes,u=_this$attributes5.borderColor,g=_this$attributes5.borderWidth,M=_this$attributes5.borderDash,A=_this$attributes5.borderDashOffset;Object(o.setStrokeColor)(m,{color:u,lineWidth:g,lineDash:M,lineDashOffset:A});}this[v]=m;var d=this.attributes.clipPath;d&&this[v].setClipPath(d);}var _T21=this.opacity;return m.getOpacity()!==_T21&&m.setOpacity(_T21),(_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,l=_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[l+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],l=_this$originalClientR[3],d=this.attributes.padding;return[x+d[0],m+d[1],T-d[0]-d[2],l-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 _T22=this.attributes.borderWidth;_T22&&(m[0]=[m[0][0]-_T22,m[0][1]-_T22],m[1]=[m[1][0]+_T22,m[1][1]+_T22]);}return Object(p["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(S.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[v]&&x==="clipPath"&&this[v].setClipPath(m),this[v]&&x==="bgcolor"&&Object(o.setFillColor)(this[v],{color:m}),this[v]&&(x==="borderColor"||x==="borderWidth"||x==="borderDash"||x==="borderDashOffset")){var _this$attributes7=this.attributes,_l17=_this$attributes7.borderColor,d=_this$attributes7.borderWidth,u=_this$attributes7.borderDash,g=_this$attributes7.borderDashOffset;Object(o.setStrokeColor)(this[v],{color:_l17,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,l=_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,R=-m*g[1]+M;this.clientBox=new n.Figure2D(),Object(s.createRadiusBox)(this.clientBox,[A,R,d,u],l);}}]);}(i["default"]);c(S,"Attr",a["default"]),f["default"].registerNode(S,"block");},/* 220 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(71),n=t(72),i=t(221);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_setAttributeDefault"),f=Symbol["for"]("spritejs_declareAlias");var p=/*#__PURE__*/function(_e$default){function p(v){var _this19;_classCallCheck(this,p);_this19=_callSuper(this,p,[v]),_this19[s]({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(p,_e$default);return _createClass(p,[{key:"anchorX",get:function get(){return this[o]("anchorX");},set:function set(v){this[a]("anchorX",Object(n.toNumber)(v));}},{key:"anchorY",get:function get(){return this[o]("anchorY");},set:function set(v){this[a]("anchorY",Object(n.toNumber)(v));}},{key:"anchor",get:function get(){return[this.anchorX,this.anchorY];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.anchorX=v[0],this.anchorY=v[1];}},{key:"width",get:function get(){return this[o]("width");},set:function set(v){this[a]("width",Object(n.toNumber)(v));}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){this[a]("height",Object(n.toNumber)(v));}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}},{key:"borderWidth",get:function get(){return this[o]("borderWidth");},set:function set(v){this[a]("borderWidth",Object(n.toNumber)(v));}},{key:"borderColor",get:function get(){return this[o]("borderColor");},set:function set(v){this[a]("borderColor",Object(i.parseColor)(v));}},{key:"border",get:function get(){return[this.borderWidth,this.borderColor];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v]),this.borderWidth=v[0],v[1]!=null&&(this.borderColor=v[1]);}},{key:"borderDash",get:function get(){return this[o]("borderDash");},set:function set(v){v=Object(n.toArray)(v,!0),v!=null&&!Array.isArray(v)&&(v=[v]),this[a]("borderDash",v?v.map(n.toNumber):null);}},{key:"borderDashOffset",get:function get(){return this[o]("borderDashOffset");},set:function set(v){this[a]("borderDashOffset",Object(n.toNumber)(v));}},{key:"borderTopLeftRadius",get:function get(){return this[o]("borderTopLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopLeftRadius",v.map(n.toNumber));}},{key:"borderTopRightRadius",get:function get(){return this[o]("borderTopRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderTopRightRadius",v.map(n.toNumber));}},{key:"borderBottomRightRadius",get:function get(){return this[o]("borderBottomRightRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomRightRadius",v.map(n.toNumber));}},{key:"borderBottomLeftRadius",get:function get(){return this[o]("borderBottomLeftRadius");},set:function set(v){v=Object(n.toArray)(v,!0),Array.isArray(v)||(v=[v,v]),this[a]("borderBottomLeftRadius",v.map(n.toNumber));}},{key:"borderRadius",get:function get(){return[].concat(_toConsumableArray(this.borderTopLeftRadius),_toConsumableArray(this.borderTopRightRadius),_toConsumableArray(this.borderBottomRightRadius),_toConsumableArray(this.borderBottomLeftRadius));},set:function set(v){if(v=Object(n.toArray)(v),!Array.isArray(v))v=Array(8).fill(v);else if(v.length===2)v=[v[0],v[1],v[0],v[1],v[0],v[1],v[0],v[1]];else if(v.length===4)v=[v[0],v[1],v[2],v[3],v[0],v[1],v[2],v[3]];else if(v.length===6)v=[v[0],v[1],v[2],v[3],v[4],v[5],v[2],v[3]];else if(v.length!==8)throw new TypeError("Invalid borderRadius value.");this.borderTopLeftRadius=[v[0],v[1]],this.borderTopRightRadius=[v[2],v[3]],this.borderBottomRightRadius=[v[4],v[5]],this.borderBottomLeftRadius=[v[6],v[7]];}},{key:"bgcolor",get:function get(){return this[o]("bgcolor");},set:function set(v){this[a]("bgcolor",Object(i.parseColor)(v));}},{key:"paddingTop",get:function get(){return this[o]("paddingTop");},set:function set(v){this[a]("paddingTop",Object(n.toNumber)(v));}},{key:"paddingRight",get:function get(){return this[o]("paddingRight");},set:function set(v){this[a]("paddingRight",Object(n.toNumber)(v));}},{key:"paddingBottom",get:function get(){return this[o]("paddingBottom");},set:function set(v){this[a]("paddingBottom",Object(n.toNumber)(v));}},{key:"paddingLeft",get:function get(){return this[o]("paddingLeft");},set:function set(v){this[a]("paddingLeft",Object(n.toNumber)(v));}},{key:"padding",get:function get(){return[this.paddingTop,this.paddingRight,this.paddingBottom,this.paddingLeft];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)?v.length===2?v=[v[0],v[1],v[0],v[1]]:v.length===3&&(v=[v[0],v[1],v[2],v[1]]):v=[v,v,v,v],this.paddingTop=v[0],this.paddingRight=v[1],this.paddingBottom=v[2],this.paddingLeft=v[3];}},{key:"clipPath",get:function get(){return this[o]("clipPath");},set:function set(v){this[a]("clipPath",v);}},{key:"boxSizing",get:function get(){return this[o]("boxSizing");},set:function set(v){if(v!=null&&v!=="border-box"&&v!=="content-box")throw new TypeError("Invalid boxSizing type.");this[a]("boxSizing",v);}}]);}(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 o;}),t.d(r,"setFillColor",function(){return f;}),t.d(r,"setStrokeColor",function(){return p;}),t.d(r,"Color",function(){return c;});var e=t(32),n=/* @__PURE__ */t.n(e);t(1).glMatrix.setMatrixArrayType(Array);var i=/*#__PURE__*/function(){function i(_ref137){var S=_ref137.vector,O=_ref137.colors;_classCallCheck(this,i);if(!Array.isArray(S)||S.length!==4&&S.length!==6&&S.length!==3)throw new TypeError("Invalid gradient");this.vector=S,this.colors=O.map(function(_ref138){var x=_ref138.offset,m=_ref138.color;return{offset:x,color:o(m)};});}return _createClass(i,[{key:"toString",value:function toString(){return JSON.stringify({vector:this.vector,colors:this.colors});}}]);}();function a(v){return v instanceof i?!1:v==null?!0:n()(v)[3]===0;}function o(v){if(v==null||(v||(v="transparent"),v instanceof i))return v;var S=n()(v);if(!S||!S.length)throw new TypeError("Invalid color value.");return"rgba(".concat(S.join(),")");}function s(v,S,O){var x=v.boundingBox[0];if(O.vector){var m=O.vector,_T23=O.colors;m.length===4?(m=[m[0]+x[0],m[1]+x[1],m[2]+x[0],m[3]+x[1]],v.setLinearGradient({vector:m,colors:_T23,type:S})):m.length===3?(m=[m[0]+x[0],m[1]+x[1],m[2]],v.setCircularGradient({vector:m,colors:_T23,type:S})):(m=[m[0]+x[0],m[1]+x[1],m[2],m[3]+x[0],m[4]+x[1],m[5]],v.setRadialGradient({vector:m,colors:_T23,type:S}));}else v.gradient&&v.gradient[S]&&(delete v.gradient[S],delete v.uniforms.u_radialGradientVector);}function f(v,_ref139){var S=_ref139.color,_ref139$rule=_ref139.rule,O=_ref139$rule===void 0?"nonzero":_ref139$rule;return s(v,"fill",S),S.vector||v.setFill({color:S,rule:O}),v;}function p(v,_ref140){var S=_ref140.color,O=_ref140.lineWidth,x=_ref140.lineCap,m=_ref140.lineJoin,T=_ref140.lineDash,l=_ref140.lineDashOffset,d=_ref140.miterLimit,u=_ref140.roundSegments;s(v,"stroke",S),S.vector&&(S=[0,0,0,1]),v.setStroke({color:S,thickness:O,cap:x,join:m,miterLimit:d,lineDash:T,lineDashOffset:l,roundSegments:u});}var c=/*#__PURE__*/function(_Array){function c(){var _S6,_S7,_n2,_n3;var _this20;var S=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,c);return _possibleConstructorReturn(_this20,(Array.isArray(S)&&(_S6=S,_S7=_slicedToArray(_S6,4),S=_S7[0],O=_S7[1],x=_S7[2],m=_S7[3],_S6),typeof S=="string"&&((_n2=n()(S),_n3=_slicedToArray(_n2,4),S=_n3[0],O=_n3[1],x=_n3[2],m=_n3[3]),S/=255,O/=255,x/=255),_this20=_callSuper(this,c,[S,O,x,m]),_assertThisInitialized(_this20)));}_inherits(c,_Array);return _createClass(c,[{key:"r",get:function get(){return Math.round(this[0]*255);},set:function set(S){this[0]=S/255;}},{key:"g",get:function get(){return Math.round(this[1]*255);},set:function set(S){this[1]=S/255;}},{key:"b",get:function get(){return Math.round(this[2]*255);},set:function set(S){this[2]=S/255;}},{key:"a",get:function get(){return this[3];},set:function set(S){this[3]=S;}},{key:"hex",get:function get(){var S="0".concat(this.r.toString(16)).slice(-2),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(S).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(S){return typeof S=="string"&&(S=n()(S),S[0]/=255,S[1]/=255,S[2]/=255),this[0]=S[0],this[1]=S[1],this[2]=S[2],this[3]=S[3],this;}}]);}(/*#__PURE__*/_wrapNativeSuper(Array));},/* 222 */ /***/function(h,r,t){t.r(r),t.d(r,"createRadiusBox",function(){return n;}),t(1).glMatrix.setMatrixArrayType(Array);function e(i,a,o,s,f){var p=arguments.length>5&&arguments[5]!==undefined?arguments[5]:"leftTop";var c=0.5522848,v=s/2*c,S=f/2*c,O=a+s,x=o+f,m=a+s/2,T=o+f/2;p==="leftTop"?(i.moveTo(a,T),i.bezierCurveTo(a,T-S,m-v,o,m,o)):p==="rightTop"?i.bezierCurveTo(m+v,o,O,T-S,O,T):p==="rightBottom"?i.bezierCurveTo(O,T+S,m+v,x,m,x):p==="leftBottom"&&i.bezierCurveTo(m-v,x,a,T+S,a,T);}function n(i,_ref141,p){var _ref142=_slicedToArray(_ref141,4),a=_ref142[0],o=_ref142[1],s=_ref142[2],f=_ref142[3];if(!p||Array.isArray(p)&&p.every(function(c){return c===0;}))i.beginPath(),i.rect(a,o,s,f);else{typeof p=="number"&&(p=Array(8).fill(p));var _p$map=p.map(function(d,u){return u%2?Math.min(d,f/2):Math.min(d,s/2);}),_p$map2=_slicedToArray(_p$map,8),c=_p$map2[0],v=_p$map2[1],S=_p$map2[2],O=_p$map2[3],x=_p$map2[4],m=_p$map2[5],_T24=_p$map2[6],_l18=_p$map2[7];i.beginPath(),i.moveTo(a,o+v),e(i,a,o,c*2,v*2,"leftTop"),i.lineTo(a+s-S,o),e(i,a+s-S*2,o,S*2,O*2,"rightTop"),i.lineTo(a+s,o+f-m),e(i,a+s-x*2,o+f-m*2,x*2,m*2,"rightBottom"),i.lineTo(a+_T24,o+f),e(i,a,o+f-_l18*2,_T24*2,_l18*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),o=_e3$2[0],s=_e3$2[1],f=i*n[0]+a*n[2]+n[4],p=i*n[1]+a*n[3]+n[5],c=o*n[0]+a*n[2]+n[4],v=o*n[1]+a*n[3]+n[5],S=o*n[0]+s*n[2]+n[4],O=o*n[1]+s*n[3]+n[5],x=i*n[0]+s*n[2]+n[4],m=i*n[1]+s*n[3]+n[5],T=Math.min(f,c,S,x),l=Math.min(p,v,O,m),d=Math.max(f,c,S,x),u=Math.max(p,v,O,m);return{x:T,y:l,width:d-T,height:u-l,left:T,top:l,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 o(p,c,v){return c in p?Object.defineProperty(p,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[c]=v,p;}var s=Symbol("textureTask");var f=/*#__PURE__*/function(_n$default){function f(){var _this21;var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,f);typeof c=="string"&&(c={texture:c}),_this21=_callSuper(this,f,[c]);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),c=_get3[0],v=_get3[1];var _this$attributes9=this.attributes,S=_this$attributes9.width,O=_this$attributes9.height;if(S==null||O==null){var x=this.textureImage,m=this.attributes.textureRect,_T25=this.attributes.sourceRect;if(m)S==null&&(c=m[0]+m[2]),O==null&&(v=m[1]+m[3]);else if(_T25){var _l19=this.layer?this.layer.displayRatio:1;S==null&&(c=_T25[2]/_l19),O==null&&(v=_T25[3]/_l19);}else if(x){var _l20=this.layer?this.layer.displayRatio:1;S==null&&(c=x.width/_l20),O==null&&(v=x.height/_l20);}}return[c,v];}},{key:"textureImageReady",get:function get(){return this[s]||Promise.resolve();}/* override */},{key:"draw",value:function draw(){var c=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_get(_getPrototypeOf(f.prototype),"draw",this).call(this,c);var v=this.mesh;return v&&Object(e.drawTexture)(this,v),c;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(c,v,S){if(_get(_getPrototypeOf(f.prototype),"onPropertyChange",this).call(this,c,v,S),c==="texture"&&(this[s]=Object(e.applyTexture)(this,v,!0)),c==="textureRect"){var _this$attributes10=this.attributes,O=_this$attributes10.width,x=_this$attributes10.height;(O==null||x==null)&&this.updateContours();}}}]);}(n["default"]);o(f,"Attr",i["default"]),a["default"].registerNode(f,"sprite");},/* 225 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});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 o=/*#__PURE__*/function(_e$default2){function o(f){var _this22;_classCallCheck(this,o);_this22=_callSuper(this,o,[f]),_this22[n]({texture:void 0,textureRect:void 0,textureRepeat:!1,sourceRect:void 0});return _this22;}_inherits(o,_e$default2);return _createClass(o,[{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),o=t(228),s=t(221),f=t(218),p=t(213),c=t(223);t(1).glMatrix.setMatrixArrayType(Array);function v(x,m,T){return m in x?Object.defineProperty(x,m,{value:T,enumerable:!0,configurable:!0,writable:!0}):x[m]=T,x;}var S=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,l,_d5,u,g){var _i$a;var M=(_d5-u)/(g-u);if(M<=0)return T;if(M>=1)return l;var A=i.a._preprocessing(i.a.path2shapes(T),i.a.path2shapes(l)),R=(_i$a=i.a)._lerp.apply(_i$a,_toConsumableArray(A).concat([M]))[0];return R.reduce(function(E,L){return"".concat(E).concat(L.slice(2).join(" ")," ");},"M".concat(R[0][0]," ").concat(R[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 _T27;var _T26=this[S];if(_T26)_T26.path!==m&&(_T26.contours=m.contours,_T26.path=m);else{_T26=new e.Mesh2D(this.path),_T26.path=m;var d=this.attributes.fillColor,u=this.attributes.fillRule;d&&Object(s.setFillColor)(_T26,{color:d,rule:u});var g=this.attributes.lineWidth,M=this.attributes.strokeColor;if(M&&g>0){var _this$attributes11=this.attributes,R=_this$attributes11.lineCap,b=_this$attributes11.lineJoin,E=_this$attributes11.miterLimit,L=_this$attributes11.lineDash,D=_this$attributes11.lineDashOffset,I=_this$attributes11.roundSegments;Object(s.setStrokeColor)(_T26,{color:M,lineWidth:g,lineCap:R,lineJoin:b,miterLimit:E,lineDash:L,lineDashOffset:D,roundSegments:I});}this[S]=_T26;var A=this.attributes.clipPath;A&&this[S].setClipPath(A);}var _l21=this.opacity;return _T26.getOpacity()!==_l21&&_T26.setOpacity(_l21),(_T27=_T26).setTransform.apply(_T27,_toConsumableArray(this.renderMatrix)),_T26;}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(c["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 _T28=this.mesh.getPointAtLength(m);if(_T28)return[_T28.x,_T28.y];}return[0,0];}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,T,l){if(_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,m,T,l),(m==="d"||m==="normalize")&&this.updateContours(),this[S]&&(m==="fillColor"||m==="fillRule")){var _this$attributes12=this.attributes,d=_this$attributes12.fillColor,u=_this$attributes12.fillRule;Object(s.setFillColor)(this[S],{color:d,rule:u});}if(this[S]&&(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,R=_this$attributes14.lineDashOffset,b=_this$attributes14.miterLimit,E=_this$attributes14.roundSegments;Object(s.setStrokeColor)(this[S],{color:_d6,lineCap:g,lineJoin:M,lineWidth:_u9,lineDash:A,lineDashOffset:R,miterLimit:b,roundSegments:E});}}this[S]&&m==="clipPath"&&this[S].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"]);v(O,"Attr",o["default"]),p["default"].registerNode(O,"path");},/* 227 */ /***/function(h,r,t){(function(e,n){h.exports=n();})(this,function(){var e=/* @__PURE__ */function(){function L(D,I){var C=[],W=!0,G=!1,K=void 0;try{for(var J=D[Symbol.iterator](),Z;!(W=(Z=J.next()).done)&&(C.push(Z.value),!(I&&C.length===I));W=!0);}catch(B){G=!0,K=B;}finally{try{!W&&J["return"]&&J["return"]();}finally{if(G)throw K;}}return C;}return function(D,I){if(Array.isArray(D))return D;if(Symbol.iterator in Object(D))return L(D,I);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),n=Math.PI*2,i=function i(D,I,C,W,G,K,J){var Z=D.x,B=D.y;Z*=I,B*=C;var $=W*Z-G*B,Q=G*Z+W*B;return{x:$+K,y:Q+J};},a=function a(D,I){var C=1.3333333333333333*Math.tan(I/4),W=Math.cos(D),G=Math.sin(D),K=Math.cos(D+I),J=Math.sin(D+I);return[{x:W-G*C,y:G+W*C},{x:K+J*C,y:J-K*C},{x:K,y:J}];},o=function o(D,I,C,W){var G=D*W-I*C<0?-1:1,K=Math.sqrt(D*D+I*I),J=Math.sqrt(D*D+I*I),Z=D*C+I*W,B=Z/(K*J);return B>1&&(B=1),B<-1&&(B=-1),G*Math.acos(B);},s=function s(D,I,C,W,G,K,J,Z,B,$,Q,et){var tt=Math.pow(G,2),ot=Math.pow(K,2),q=Math.pow(Q,2),gt=Math.pow(et,2),dt=tt*ot-tt*gt-ot*q;dt<0&&(dt=0),dt/=tt*gt+ot*q,dt=Math.sqrt(dt)*(J===Z?-1:1);var F=dt*G/K*et,j=dt*-K/G*Q,V=$*F-B*j+(D+C)/2,X=B*F+$*j+(I+W)/2,N=(Q-F)/G,z=(et-j)/K,y=(-Q-F)/G,P=(-et-j)/K,w=o(1,0,N,z),U=o(N,z,y,P);return Z===0&&U>0&&(U-=n),Z===1&&U<0&&(U+=n),[V,X,w,U];},f=function f(D){var I=D.px,C=D.py,W=D.cx,G=D.cy,K=D.rx,J=D.ry,Z=D.xAxisRotation,B=Z===void 0?0:Z,$=D.largeArcFlag,Q=$===void 0?0:$,et=D.sweepFlag,tt=et===void 0?0:et,ot=[];if(K===0||J===0)return[];var q=Math.sin(B*n/360),gt=Math.cos(B*n/360),dt=gt*(I-W)/2+q*(C-G)/2,F=-q*(I-W)/2+gt*(C-G)/2;if(dt===0&&F===0)return[];K=Math.abs(K),J=Math.abs(J);var j=Math.pow(dt,2)/Math.pow(K,2)+Math.pow(F,2)/Math.pow(J,2);j>1&&(K*=Math.sqrt(j),J*=Math.sqrt(j));var V=s(I,C,W,G,K,J,Q,tt,q,gt,dt,F),X=e(V,4),N=X[0],z=X[1],y=X[2],P=X[3],w=Math.max(Math.ceil(Math.abs(P)/(n/4)),1);P/=w;for(var U=0;U<w;U++)ot.push(a(y,P)),y+=P;return ot.map(function(H){var Y=i(H[0],K,J,gt,q,N,z),k=Y.x,rt=Y.y,it=i(H[1],K,J,gt,q,N,z),lt=it.x,ut=it.y,at=i(H[2],K,J,gt,q,N,z),st=at.x,ft=at.y;return{x1:k,y1:rt,x2:lt,y2:ut,x:st,y:ft};});},p={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
|
-
*/},c=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function v(L){var D=[];return L.replace(c,function(I,C,W){var G=C.toLowerCase();for(W=O(W),G=="m"&&W.length>2&&(D.push([C].concat(W.splice(0,2))),G="l",C=C=="m"?"l":"L");;){if(W.length==p[G])return W.unshift(C),D.push(W);if(W.length<p[G])throw new Error("malformed path data");D.push([C].concat(W.splice(0,p[G])));}}),D;}var S=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function O(L){var D=L.match(S);return D?D.map(Number):[];}function x(L){var D=L[0][0],I=L[0][1],C=D,W=I;return L.forEach(function(G){var K=G[0],J=G[2],Z=G[4],B=G[6],$=G[1],Q=G[3],et=G[5],tt=G[7];D=Math.min(D,K,J,Z,B),I=Math.min(I,$,Q,et,tt),C=Math.max(C,K,J,Z,B),W=Math.max(W,$,Q,et,tt);}),[D,I,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 I=L[0],C=L[2],W=L[4],G=L[6],K=L[1],J=L[3],Z=L[5],B=L[7],$=D[0],Q=D[2],et=D[4],tt=D[6],ot=D[1],q=D[3],gt=D[5],dt=D[7];return Math.sqrt(Math.pow($-I,2)+Math.pow(ot-K,2))+Math.sqrt(Math.pow(Q-C,2)+Math.pow(q-J,2))+Math.sqrt(Math.pow(et-W,2)+Math.pow(gt-Z,2))+Math.sqrt(Math.pow(tt-G,2)+Math.pow(dt-B,2));}function l(L,D){var I=u(L.length),C=[];I.forEach(function(G){var K=0,J=0;G.forEach(function(Z){K+=T(L[Z],D[J++]);}),C.push({index:G,distance:K});}),C.sort(function(G,K){return G.distance-K.distance;});var W=[];return C[0].index.forEach(function(G){W.push(L[G]);}),W;}function d(L,D){var I=g(L.length),C=[];I.forEach(function(G){var K=0;G.forEach(function(J){K+=m(x(L[J]),x(D[J]));}),C.push({index:G,distance:K});}),C.sort(function(G,K){return G.distance-K.distance;});var W=[];return C[0].index.forEach(function(G){W.push(L[G]);}),W;}function u(L){for(var D=[],I=0;I<L;I++){for(var C=[],W=0;W<L;W++){var G=W+I;G>L-1&&(G-=L),C[G]=W;}D.push(C);}return D;}function g(L){for(var D=[],I=0;I<L;I++)D.push(I);return M(D);}function M(L){var D=[],I=[];function C(W){var G,K;for(G=0;G<W.length;G++)K=W.splice(G,1)[0],I.push(K),W.length==0&&D.push(I.slice()),C(W),W.splice(G,0,K),I.pop();return D;}return C(L);}var A={};A.parser=v,A.lerpCurve=function(L,D,I){return A.lerpPoints(L[0],L[1],D[0],D[1],I).concat(A.lerpPoints(L[2],L[3],D[2],D[3],I)).concat(A.lerpPoints(L[4],L[5],D[4],D[5],I)).concat(A.lerpPoints(L[6],L[7],D[6],D[7],I));},A.lerpPoints=function(L,D,I,C,W){return[L+(I-L)*W,D+(C-D)*W];},A.q2b=function(L,D,I,C,W,G){return[L,D,(L+2*I)/3,(D+2*C)/3,(W+2*I)/3,(G+2*C)/3,W,G];},A.path2shapes=function(L){for(var D=A.parser(L),I=0,C=0,W=0,G=D.length,K=[],J=null,Z=void 0,B=void 0,$=void 0,Q=void 0,et=void 0,tt=void 0,ot=void 0;W<G;W++){var q=D[W],gt=q[0],dt=D[W-1];switch(gt){case"m":et=K.length,K[et]=[],J=K[et],I=I+q[1],C=C+q[2];break;case"M":et=K.length,K[et]=[],J=K[et],I=q[1],C=q[2];break;case"l":J.push([I,C,I,C,I,C,I+q[1],C+q[2]]),I+=q[1],C+=q[2];break;case"L":J.push([I,C,q[1],q[2],q[1],q[2],q[1],q[2]]),I=q[1],C=q[2];break;case"h":J.push([I,C,I,C,I,C,I+q[1],C]),I+=q[1];break;case"H":J.push([I,C,q[1],C,q[1],C,q[1],C]),I=q[1];break;case"v":J.push([I,C,I,C,I,C,I,C+q[1]]),C+=q[1];break;case"V":J.push([I,C,I,q[1],I,q[1],I,q[1]]),C=q[1];break;case"C":J.push([I,C,q[1],q[2],q[3],q[4],q[5],q[6]]),I=q[5],C=q[6];break;case"S":dt[0]==="C"||dt[0]==="c"?J.push([I,C,I+dt[5]-dt[3],C+dt[6]-dt[4],q[1],q[2],q[3],q[4]]):(dt[0]==="S"||dt[0]==="s")&&J.push([I,C,I+dt[3]-dt[1],C+dt[4]-dt[2],q[1],q[2],q[3],q[4]]),I=q[3],C=q[4];break;case"c":J.push([I,C,I+q[1],C+q[2],I+q[3],C+q[4],I+q[5],C+q[6]]),I=I+q[5],C=C+q[6];break;case"s":dt[0]==="C"||dt[0]==="c"?J.push([I,C,I+dt[5]-dt[3],C+dt[6]-dt[4],I+q[1],C+q[2],I+q[3],C+q[4]]):(dt[0]==="S"||dt[0]==="s")&&J.push([I,C,I+dt[3]-dt[1],C+dt[4]-dt[2],I+q[1],C+q[2],I+q[3],C+q[4]]),I=I+q[3],C=C+q[4];break;case"a":tt=f({rx:q[1],ry:q[2],px:I,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:I+q[6],cy:C+q[7]}),ot=tt[tt.length-1],tt.forEach(function(F,j){j===0?J.push([I,C,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):J.push([tt[j-1].x,tt[j-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),I=ot.x,C=ot.y;break;case"A":tt=f({rx:q[1],ry:q[2],px:I,py:C,xAxisRotation:q[3],largeArcFlag:q[4],sweepFlag:q[5],cx:q[6],cy:q[7]}),ot=tt[tt.length-1],tt.forEach(function(F,j){j===0?J.push([I,C,F.x1,F.y1,F.x2,F.y2,F.x,F.y]):J.push([tt[j-1].x,tt[j-1].y,F.x1,F.y1,F.x2,F.y2,F.x,F.y]);}),I=ot.x,C=ot.y;break;case"Q":J.push(A.q2b(I,C,q[1],q[2],q[3],q[4])),I=q[3],C=q[4];break;case"q":J.push(A.q2b(I,C,I+q[1],C+q[2],q[3]+I,q[4]+C)),I+=q[3],C+=q[4];break;case"T":dt[0]==="Q"||dt[0]==="q"?($=I+dt[3]-dt[1],Q=C+dt[4]-dt[2],J.push(A.q2b(I,C,$,Q,q[1],q[2]))):(dt[0]==="T"||dt[0]==="t")&&(J.push(A.q2b(I,C,I+I-$,C+C-Q,q[1],q[2])),$=I+I-$,Q=C+C-Q),I=q[1],C=q[2];break;case"t":dt[0]==="Q"||dt[0]==="q"?($=I+dt[3]-dt[1],Q=C+dt[4]-dt[2],J.push(A.q2b(I,C,$,Q,I+q[1],C+q[2]))):(dt[0]==="T"||dt[0]==="t")&&(J.push(A.q2b(I,C,I+I-$,C+C-Q,I+q[1],C+q[2])),$=I+I-$,Q=C+C-Q),I+=q[1],C+=q[2];break;case"Z":Z=J[0][0],B=J[0][1],J.push([I,C,Z,B,Z,B,Z,B]);break;case"z":Z=J[0][0],B=J[0][1],J.push([I,C,Z,B,Z,B,Z,B]);break;}}return K;},A._upCurves=function(L,D){for(var I=0,C=0,W=L.length;I<D;I++)L.push(L[C].slice(0)),C++,C>W-1&&(C-=W);};function R(L,D,I,C,W,G,K,J,Z){return{left:b(L,D,I,C,W,G,K,J,Z),right:b(K,J,W,G,I,C,L,D,1-Z,!0)};}function b(L,D,I,C,W,G,K,J,Z,B){var $=(I-L)*Z+L,Q=(C-D)*Z+D,et=(W-I)*Z+I,tt=(G-C)*Z+C,ot=(K-W)*Z+W,q=(J-G)*Z+G,gt=(et-$)*Z+$,dt=(tt-Q)*Z+Q,F=(ot-et)*Z+et,j=(q-tt)*Z+tt,V=(F-gt)*Z+gt,X=(j-dt)*Z+dt;return B?[V,X,gt,dt,$,Q,L,D]:[L,D,$,Q,gt,dt,V,X];}A._splitCurves=function(L,D){for(var I=0,C=0;I<D;I++){var W=L[C],G=R(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,G.left,G.right),C+=2,C>=L.length-1&&(C=0);}};function E(L,D){for(var I=function I(G){var K=L[L.length-1],J=[];K.forEach(function(Z){J.push(Z.slice(0));}),L.push(J);},C=0;C<D;C++)I();}return A.lerp=function(L,D,I){return A._lerp(A.path2shapes(L),A.path2shapes(D),I);},A.MIM_CURVES_COUNT=100,A._preprocessing=function(L,D){var I=L.length,C=D.length,W=JSON.parse(JSON.stringify(L)),G=JSON.parse(JSON.stringify(D));return I>C?E(G,I-C):I<C&&E(W,C-I),W=d(W,G),W.forEach(function(K,J){var Z=K.length,B=G[J].length;Z>B?Z<A.MIM_CURVES_COUNT?(A._splitCurves(K,A.MIM_CURVES_COUNT-Z),A._splitCurves(G[J],A.MIM_CURVES_COUNT-B)):A._splitCurves(G[J],Z-B):Z<B&&(B<A.MIM_CURVES_COUNT?(A._splitCurves(K,A.MIM_CURVES_COUNT-Z),A._splitCurves(G[J],A.MIM_CURVES_COUNT-B)):A._splitCurves(K,B-Z));}),W.forEach(function(K,J){W[J]=l(K,G[J]);}),[W,G];},A._lerp=function(L,D,I){var C=[];return L.forEach(function(W,G){var K=[];W.forEach(function(J,Z){K.push(A.lerpCurve(J,D[G][Z],I));}),C.push(K);}),C;},A.animate=function(L){var D=A.path2shapes(L.from),I=A.path2shapes(L.to),C=A._preprocessing(D,I),W=/* @__PURE__ */new Date(),G=L.end||function(){},K=L.progress||function(){},J=L.begin||function(){},Z=L.easing||function(tt){return tt;},B=null,$=null,Q=L.time;J(D);var et=function tt(){var ot=/* @__PURE__ */new Date()-W;if(ot>=Q){$=I,K($,1),G($),cancelAnimationFrame(B);return;}var q=Z(ot/Q);$=A._lerp(C[0],C[1],q),K($,q),B=requestAnimationFrame(tt);};et();},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"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute");var f=/*#__PURE__*/function(_e$default3){function f(c){var _this24;_classCallCheck(this,f);_this24=_callSuper(this,f,[c]),_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[s]("d");},set:function set(c){this[o]("d",c);}},{key:"normalize",get:function get(){return this[s]("normalize");},set:function set(c){this[o]("normalize",!!c);}},{key:"fillColor",get:function get(){return this[s]("fillColor");},set:function set(c){this[o]("fillColor",Object(n.parseColor)(c));}},{key:"fillRule",get:function get(){return this[s]("fillRule");},set:function set(c){if(c!=null&&c!=="nonzero"&&c!=="evenodd")throw new TypeError("Invalid fill rule.");this[o]("fillRule",c);}},{key:"strokeColor",get:function get(){return this[s]("strokeColor");},set:function set(c){this[o]("strokeColor",Object(n.parseColor)(c));}},{key:"lineWidth",get:function get(){return this[s]("lineWidth");},set:function set(c){this[o]("lineWidth",Object(i.toNumber)(c));}},{key:"lineJoin",get:function get(){return this[s]("lineJoin");},set:function set(c){if(c!=null&&c!=="miter"&&c!=="bevel"&&c!=="round")throw new TypeError("Invalid lineJoin type.");this[o]("lineJoin",c);}},{key:"lineCap",get:function get(){return this[s]("lineCap");},set:function set(c){if(c!=null&&c!=="butt"&&c!=="square"&&c!=="round")throw new TypeError("Invalid lineCap type.");this[o]("lineCap",c);}},{key:"lineDash",get:function get(){return this[s]("lineDash");},set:function set(c){c=Object(i.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c]),this[o]("lineDash",c?c.map(i.toNumber):null);}},{key:"lineDashOffset",get:function get(){return this[s]("lineDashOffset");},set:function set(c){this[o]("lineDashOffset",Object(i.toNumber)(c));}},{key:"miterLimit",get:function get(){return this[s]("miterLimit");},set:function set(c){this[o]("miterLimit",Object(i.toNumber)(c));}},{key:"roundSegments",get:function get(){return this[s]("roundSegments");},set:function set(c){this[o]("roundSegments",c);}},{key:"texture",get:function get(){return this[s]("texture");},set:function set(c){this[o]("texture",c);}},{key:"textureRect",get:function get(){return this[s]("textureRect");},set:function set(c){this[o]("textureRect",c);}},{key:"sourceRect",get:function get(){return this[s]("sourceRect");},set:function set(c){this[o]("sourceRect",c);}},{key:"textureRepeat",get:function get(){return this[s]("textureRepeat");},set:function set(c){this[o]("textureRepeat",!!c);}},{key:"clipPath",get:function get(){return this[s]("clipPath");},set:function set(c){this[o]("clipPath",c);}}]);}(e["default"]);},/* 229 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(230);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default4){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default4);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes15=this.attributes,f=_this$attributes15.width,p=_this$attributes15.height;return f>0&&p>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"rect");},/* 230 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return p;});var e=t(228),n=t(72);t(1).glMatrix.setMatrixArrayType(Array);var i=Symbol["for"]("spritejs_setAttributeDefault"),a=Symbol["for"]("spritejs_setAttribute"),o=Symbol["for"]("spritejs_getAttribute"),s=Symbol["for"]("spritejs_declareAlias");function f(c){var v=c.width,S=c.height;return"M0 0L".concat(v," 0L").concat(v," ").concat(S,"L0 ").concat(S,"Z");}var p=/*#__PURE__*/function(_e$default5){function p(v){var _this25;_classCallCheck(this,p);_this25=_callSuper(this,p,[v]),_this25[i]({width:0,height:0/* size */}),_this25[s]("size");return _this25;}// readonly
|
|
326
|
-
_inherits(p,_e$default5);return _createClass(p,[{key:"d",get:function get(){return this[o]("d");},set:function set(v){}// eslint-disable-line no-empty-function
|
|
327
|
-
},{key:"width",get:function get(){return this[o]("width");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("width",v)){var S=f(this);this[a]("d",S);}}},{key:"height",get:function get(){return this[o]("height");},set:function set(v){if(v=Object(n.toNumber)(v),this[a]("height",v)){var S=f(this);this[a]("d",S);}}},{key:"size",get:function get(){return[this.width,this.height];},set:function set(v){v=Object(n.toArray)(v),Array.isArray(v)||(v=[v,v]),this.width=v[0],this.height=v[1];}}]);}(e["default"]);},/* 231 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(235);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default6){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default6);return _createClass(o,[{key:"isVisible",get:function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"triangle");},/* 232 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(233);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default7){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default7);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.points;return f.length>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"polyline");},/* 233 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(228),n=t(72),i=t(234);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function p(v){var S=v.points,O=v.smooth,x=v.smoothRange,m=v.close,T=[];for(var d=0;d<S.length;d+=2)T.push([S[d],S[d+1]]);var l="";return O?l=Object(i.makeSmoothCurveLine)(T,x):T.length&&(l="M".concat(T.map(function(d){return d.join(" ");}).join("L"))),l&&m&&(l+="Z"),l;}var c=/*#__PURE__*/function(_e$default8){function c(S){var _this26;_classCallCheck(this,c);_this26=_callSuper(this,c,[S]),_this26[a]({points:[],smooth:!1,smoothRange:[0],closeType:"none"// none | normal
|
|
328
|
-
/* close */}),_this26[f]("close");return _this26;}// readonly
|
|
329
|
-
_inherits(c,_e$default8);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(S){}// eslint-disable-line no-empty-function
|
|
330
|
-
},{key:"close",get:function get(){return this.closeType!=="none";},set:function set(S){S=S?"normal":"none",this.closeType=S;}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(S){if(S!=null&&S!=="none"&&S!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",S)){var O=p(this);this[o]("d",O);}}},{key:"smooth",get:function get(){return this[s]("smooth");},set:function set(S){if(this[o]("smooth",S)){var O=p(this);this[o]("d",O);}}},{key:"smoothRange",get:function get(){return this[s]("smoothRange");},set:function set(S){if(S&&!Array.isArray(S)&&(S=[S]),this[o]("smoothRange",S)&&this.smooth){var O=p(this);this[o]("d",O);}}},{key:"points",get:function get(){return this[s]("points");},set:function set(S){if(S=Object(n.toArray)(S),Array.isArray(S)&&(S=S.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[o]("points",S)){var O=p(this);this[o]("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 p=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0.168;var c=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0.168;var v,S,O,x;if((n[f].x===n[f+1].x||n[f].y===n[f+1].y)&&(p=0,c=0),f<1?(v=n[0].x+(n[1].x-n[0].x)*p,S=n[0].y+(n[1].y-n[0].y)*p):(v=n[f].x+(n[f+1].x-n[f-1].x)*p,S=n[f].y+(n[f+1].y-n[f-1].y)*p),f>n.length-3){var m=n.length-1;O=n[m].x-(n[m].x-n[m-1].x)*c,x=n[m].y-(n[m].y-n[m-1].y)*c;}else O=n[f+1].x-(n[f+2].x-n[f].x)*c,x=n[f+1].y-(n[f+2].y-n[f].y)*c;return[{x:v,y:S},{x:O,y:x}];}n=n.map(function(_ref143){var _ref144=_slicedToArray(_ref143,2),f=_ref144[0],p=_ref144[1];return{x:f,y:p};});var o="",s=0;return n.forEach(function(f,p){if(p===0)o+="M".concat(f.x," ").concat(f.y);else{for(;p>i[s];)s++;if(s%2){var _a3=a(p-1),_a4=_slicedToArray(_a3,2),c=_a4[0],v=_a4[1];o+="C".concat([c.x,c.y,v.x,v.y,f.x,f.y].join(" "));}else o+="L".concat(f.x," ").concat(f.y);}}),o;}},/* 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"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var _p$sides=_slicedToArray(p.sides,2),c=_p$sides[0],v=_p$sides[1];var S=p.angle%360;return S<0&&(S+=360),S=Math.PI*S/180,[0,0,c,0,v*Math.cos(S),v*Math.sin(S)];}var f=/*#__PURE__*/function(_e$default9){function f(c){var _this27;_classCallCheck(this,f);_this27=_callSuper(this,f,[c]),_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(c){}// eslint-disable-line no-empty-function
|
|
332
|
-
},{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[a]("sides",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 236 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(237);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default10){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default10);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var f=this.attributes.sides;return f[0]>0&&f[1]>0&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"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"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var _p$sides2=_slicedToArray(p.sides,2),c=_p$sides2[0],v=_p$sides2[1];var S=p.angle%360;S<0&&(S+=360),S=Math.PI*S/180;var O=v*Math.cos(S),x=v*Math.sin(S);return[0,0,c,0,O+c,x,O,x];}var f=/*#__PURE__*/function(_e$default11){function f(c){var _this28;_classCallCheck(this,f);_this28=_callSuper(this,f,[c]),_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(c){}// eslint-disable-line no-empty-function
|
|
334
|
-
},{key:"sides",get:function get(){return this[o]("sides");},set:function set(c){if(c=Object(n.toArray)(c,!0),c!=null&&!Array.isArray(c)&&(c=[c,c]),this[a]("sides",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"angle",get:function get(){return this[o]("angle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 238 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(239);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default12){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default12);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"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"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var c=p.edges,v=p.radius,S=p.offsetAngle,O=Math.PI*S/180-0.5*Math.PI;if(c<3||v<=0)return[];var x=[];for(var m=0;m<c;m++){var _T29=m*2*Math.PI/c+O,_l22=v*Math.cos(_T29),d=v*Math.sin(_T29);x.push(_l22,d);}return x;}var f=/*#__PURE__*/function(_e$default13){function f(c){var _this29;_classCallCheck(this,f);_this29=_callSuper(this,f,[c]),_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(c){}// eslint-disable-line no-empty-function
|
|
336
|
-
},{key:"edges",get:function get(){return this[o]("edges");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("edges",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"radius",get:function get(){return this[o]("radius");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("radius",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("offsetAngle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 240 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(232),n=t(213),i=t(241);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default14){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default14);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"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"),o=Symbol["for"]("spritejs_getAttribute");function s(p){var c=p.angles,v=p.innerRadius,S=p.outerRadius,O=p.offsetAngle,x=Math.PI*O/180-0.5*Math.PI;if(c<3||v<=0||S<=0)return[];var m=[];for(var _T30=0;_T30<c*2;_T30++){var _l23=_T30*Math.PI/c+x,d=_T30%2?v:S,u=d*Math.cos(_l23),g=d*Math.sin(_l23);m.push(u,g);}return m;}var f=/*#__PURE__*/function(_e$default15){function f(c){var _this30;_classCallCheck(this,f);_this30=_callSuper(this,f,[c]),_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(c){}// eslint-disable-line no-empty-function
|
|
338
|
-
},{key:"angles",get:function get(){return this[o]("angles");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("angles",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"innerRadius",get:function get(){return this[o]("innerRadius");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("innerRadius",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"outerRadius",get:function get(){return this[o]("outerRadius");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("outerRadius",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(c){c=Object(n.toArray)(c,!0),Array.isArray(c)||(c=[c,c]),this.innerRadius=c[0],this.outerRadius=c[1];}},{key:"offsetAngle",get:function get(){return this[o]("offsetAngle");},set:function set(c){if(c=Object(n.toNumber)(c),this[a]("offsetAngle",c)){var v=s(this);_set(_getPrototypeOf(f.prototype),"points",v,this,true);}}}]);}(e["default"]);},/* 242 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(243);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default16){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default16);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes16=this.attributes,f=_this$attributes16.radiusX,p=_this$attributes16.radiusY,c=_this$attributes16.startAngle,v=_this$attributes16.endAngle;return f>0&&p>0&&c!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ellipse");},/* 243 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function p(v){var S=v.radiusX,O=v.radiusY,x=v.startAngle,m=v.endAngle,T=v.direction,l=v.closeType,d=T==="anitclockwise",u=new e.Figure2D();return l==="sector"&&u.moveTo(0,0),u.ellipse(0,0,S,O,0,Math.PI*x/180,Math.PI*m/180,d),l!=="none"&&u.closePath(),u.path.reduce(function(A,R){return A+R.join(" ");},"");}var c=/*#__PURE__*/function(_n$default2){function c(S){var _this31;_classCallCheck(this,c);_this31=_callSuper(this,c,[S]),_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(c,_n$default2);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(S){}// eslint-disable-line no-empty-function
|
|
342
|
-
},{key:"radiusX",get:function get(){return this[s]("radiusX");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("radiusX",S)){var O=p(this);this[o]("d",O);}}},{key:"radiusY",get:function get(){return this[s]("radiusY");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("radiusY",S)){var O=p(this);this[o]("d",O);}}},{key:"radius",get:function get(){return[this.radiusX,this.radiusY];},set:function set(S){S=Object(i.toArray)(S,!0),Array.isArray(S)||(S=[S,S]),this.radiusX=S[0],this.radiusY=S[1];}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(S){S=Object(i.toArray)(S),Array.isArray(S)||(S=[S,S]),this.startAngle=S[0],this.endAngle=S[1];}},{key:"direction",get:function get(){return this[s]("direction");},set:function set(S){if(S!=null&&S!=="clockwise"&&S!=="anticlockwise")throw new TypeError("Invalid direction type.");this[o]("direction",S);}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("startAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("endAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"closeType",get:function get(){return this[s]("closeType");},set:function set(S){if(S!=null&&S!=="none"&&S!=="sector"&&S!=="normal")throw new TypeError("Invalid closeType type.");if(this[o]("closeType",S)){var O=p(this);this[o]("d",O);}}}]);}(n["default"]);},/* 244 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(242),n=t(213),i=t(245);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default17){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default17);return _createClass(o);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"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(o){o=Object(n.toNumber)(o),_set(_getPrototypeOf(i.prototype),"radiusX",o,this,true),_set(_getPrototypeOf(i.prototype),"radiusY",o,this,true);}}]);}(e["default"]);},/* 246 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});var e=t(226),n=t(213),i=t(247);t(1).glMatrix.setMatrixArrayType(Array);function a(s,f,p){return f in s?Object.defineProperty(s,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):s[f]=p,s;}var o=/*#__PURE__*/function(_e$default19){function o(){_classCallCheck(this,o);return _callSuper(this,o,arguments);}_inherits(o,_e$default19);return _createClass(o,[{key:"isVisible",get:/* override */function get(){var _this$attributes17=this.attributes,f=_this$attributes17.innerRadius,p=_this$attributes17.outerRadius,c=_this$attributes17.startAngle,v=_this$attributes17.endAngle;return(f>0||p>0)&&c!==v&&_get(_getPrototypeOf(o.prototype),"isVisible",this);}}]);}(e["default"]);a(o,"Attr",i["default"]),n["default"].registerNode(o,"ring");},/* 247 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(228),i=t(72);t(1).glMatrix.setMatrixArrayType(Array);var a=Symbol["for"]("spritejs_setAttributeDefault"),o=Symbol["for"]("spritejs_setAttribute"),s=Symbol["for"]("spritejs_getAttribute"),f=Symbol["for"]("spritejs_declareAlias");function p(v){var _ref145;var S=v.innerRadius,O=v.outerRadius,x=v.startAngle,m=v.endAngle;var T=new e.Figure2D();if(x=Math.PI*x/180,m=Math.PI*m/180,S>O&&(_ref145=[O,S],S=_ref145[0],O=_ref145[1],_ref145),S<=0&&T.moveTo(0,0),T.arc(0,0,O,x,m,!1),S>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,S,m,x,!0);}return T.closePath(),T.path.reduce(function(u,g){return u+g.join(" ");},"");}var c=/*#__PURE__*/function(_n$default3){function c(S){var _this32;_classCallCheck(this,c);_this32=_callSuper(this,c,[S]),_this32[a]({innerRadius:0,outerRadius:0,/* radius */startAngle:0,endAngle:360/* angle */}),_this32[f]("radius","angle");return _this32;}// readonly
|
|
343
|
-
_inherits(c,_n$default3);return _createClass(c,[{key:"d",get:function get(){return this[s]("d");},set:function set(S){}// eslint-disable-line no-empty-function
|
|
344
|
-
},{key:"innerRadius",get:function get(){return this[s]("innerRadius");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("innerRadius",S)){var O=p(this);this[o]("d",O);}}},{key:"outerRadius",get:function get(){return this[s]("outerRadius");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("outerRadius",S)){var O=p(this);this[o]("d",O);}}},{key:"radius",get:function get(){return[this.innerRadius,this.outerRadius];},set:function set(S){S=Object(i.toArray)(S,!0),Array.isArray(S)||(S=[S,S]),this.innerRadius=S[0],this.outerRadius=S[1];}},{key:"startAngle",get:function get(){return this[s]("startAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("startAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"endAngle",get:function get(){return this[s]("endAngle");},set:function set(S){if(S=Object(i.toNumber)(S),this[o]("endAngle",S)){var O=p(this);this[o]("d",O);}}},{key:"angle",get:function get(){return[this.startAngle,this.endAngle];},set:function set(S){S=Object(i.toArray)(S),Array.isArray(S)||(S=[S,S]),this.startAngle=S[0],this.endAngle=S[1];}}]);}(n["default"]);},/* 248 */ /***/function(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),o=t(213);t(1).glMatrix.setMatrixArrayType(Array);function s(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"),p=Symbol("textImageTask"),c=Symbol("textureContext"),v=Symbol("updateTextureRect"),S=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,l=_this$attributes18.width,d=_this$attributes18.height;if(l==null||d==null){var u=this[f];u&&(l==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[p]||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 _l24=this[f];if(_l24){var d=T.texture;if(!d||this[c]&&this[c]!==this.renderer||_l24.needsUpdate?(_l24.needsUpdate=!1,Object(n.deleteTexture)(_l24.image,this.renderer),d=Object(n.createTexture)(_l24.image,this.renderer),this[v]=!0):d=T.uniforms.u_texSampler,this[v]){var _l24$rect$slice=_l24.rect.slice(2),_l24$rect$slice2=_slicedToArray(_l24$rect$slice,2),u=_l24$rect$slice2[0],g=_l24$rect$slice2[1],_this$contentSize4=_slicedToArray(this.contentSize,2),M=_this$contentSize4[0],A=_this$contentSize4[1],R=this.attributes.textAlign,b=this.attributes.verticalAlign;var E=0;R==="center"?E=(M-u)/2:(R==="right"||R==="end")&&(E=M-u);var L=this.attributes.fontSize,D=this.attributes.lineHeight;var I=0;b==="top"?I=(L-D)/2:b==="bottom"&&(I=(D-L)/2);var _this$attributes19=this.attributes,C=_this$attributes19.paddingLeft,W=_this$attributes19.paddingTop,G=this.attributes.borderWidth;E+=C+G,I+=W+G;var _this$attributes20=this.attributes,K=_this$attributes20.anchorX,J=_this$attributes20.anchorY;E-=this.offsetSize[0]*K,I-=this.offsetSize[1]*J,T.setTexture(d,{rect:[E,I,u,g]}),this[v]=!1,this[c]=this.renderer;}}}return m;}/* override */},{key:"onPropertyChange",value:function onPropertyChange(m,T,l){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[v]=!0),_get(_getPrototypeOf(O.prototype),"onPropertyChange",this).call(this,m,T,l));}/* override */},{key:"updateContours",value:function updateContours(){_get(_getPrototypeOf(O.prototype),"updateContours",this).call(this),this[v]=!0;}},{key:"updateText",value:function updateText(){var _this34=this;this[p]||(this[p]=Promise.resolve().then(function(){_this34[p]=null;var _this34$attributes=_this34.attributes,m=_this34$attributes.text,T=_this34$attributes.font,l=_this34$attributes.fillColor,d=_this34$attributes.strokeColor,u=_this34$attributes.strokeWidth,g=_this34.layer?_this34.layer.displayRatio:1;return _this34[S]=_this34[S]||e.ENV.createCanvas(1,1),_this34[f]=e.ENV.createText(m,{font:T,fillColor:l,strokeColor:d,strokeWidth:u,parseFont:e.parseFont,ratio:g,textCanvas:_this34[S]}),_this34[f].needsUpdate=!0,_this34.updateContours(),_this34.forceUpdate(),_this34[f];}));}}]);}(i["default"]);s(O,"Attr",a["default"]),o["default"].registerNode(O,"label");},/* 249 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return c;});var e=t(12),n=t(72),i=t(221),a=t(220);t(1).glMatrix.setMatrixArrayType(Array);var o=Symbol["for"]("spritejs_setAttributeDefault"),s=Symbol["for"]("spritejs_setAttribute"),f=Symbol["for"]("spritejs_getAttribute"),p=Symbol["for"]("spritejs_declareAlias");var c=/*#__PURE__*/function(_a$default2){function c(S){var _this35;_classCallCheck(this,c);_this35=_callSuper(this,c,[S]),_this35[o]({text:"",fontSize:16,fontFamily:"Helvetica,Arial,sans-serif",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",lineHeight:"",/* font */textAlign:"left",strokeColor:void 0,strokeWidth:1,fillColor:void 0,verticalAlign:"middle"}),_this35[p]("font");return _this35;}_inherits(c,_a$default2);return _createClass(c,[{key:"text",get:function get(){return this[f]("text")||" ";},set:function set(S){this[s]("text",S);}},{key:"fontSize",get:function get(){return this[f]("fontSize");},set:function set(S){this[s]("fontSize",Object(n.toNumber)(S));}},{key:"fontFamily",get:function get(){return this[f]("fontFamily");},set:function set(S){this[s]("fontFamily",S);}},{key:"fontStyle",get:function get(){return this[f]("fontStyle");},set:function set(S){this[s]("fontStyle",S);}},{key:"fontVariant",get:function get(){return this[f]("fontVariant");},set:function set(S){this[s]("fontVariant",S);}},{key:"fontWeight",get:function get(){return this[f]("fontWeight");},set:function set(S){this[s]("fontWeight",S);}},{key:"fontStretch",get:function get(){return this[f]("fontStretch");},set:function set(S){this[s]("fontStretch",S);}},{key:"lineHeight",get:function get(){return this[f]("lineHeight")||this.fontSize;},set:function set(S){this[s]("lineHeight",Object(n.toNumber)(S));}},{key:"textAlign",get:function get(){return this[f]("textAlign");},set:function set(S){this[s]("textAlign",S);}},{key:"strokeColor",get:function get(){return this[f]("strokeColor");},set:function set(S){this[s]("strokeColor",Object(i.parseColor)(S));}},{key:"strokeWidth",get:function get(){return this[f]("strokeWidth");},set:function set(S){this[s]("strokeWidth",Object(n.toNumber)(S));}},{key:"verticalAlign",get:function get(){return this[f]("verticalAlign");},set:function set(S){this[s]("verticalAlign",S);}},{key:"fillColor",get:function get(){return this[f]("fillColor");},set:function set(S){this[s]("fillColor",Object(i.parseColor)(S));}},{key:"font",get:function get(){var S=this.fontStyle,O=this.fontVariant,x=this.fontWeight,m=this.fontStretch,T=this.fontSize,l=this.lineHeight,d=this.fontFamily;return"".concat(S," ").concat(O," ").concat(x," ").concat(m," ").concat(T,"px/").concat(l,"px ").concat(d);},set:function set(S){if(S==null)this.fontStyle=null,this.fontVariant=null,this.fontWeight=null,this.fontStretch=null,this.fontSize=null,this.lineHeight=null,this.fontFamily=null;else{var O=Object(e.parseFont)(S);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 S;});var e=t(12),n=t(219),i=t(251),a=t(213),o=t(252);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 f=Symbol("zOrder"),p=Symbol("ordered"),c=Symbol("children"),v=Symbol("sealed");var S=/*#__PURE__*/function(_n$default4){function S(){var _this36;var x=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,S);_this36=_callSuper(this,S,[x]),_this36[c]=[],_this36[p]=null,_this36[f]=0;return _this36;}_inherits(S,_n$default4);return _createClass(S,[{key:"childNodes",get:function get(){return this[c];}},{key:"children",get:function get(){return this[c];}},{key:"orderedChildren",get:function get(){return this[p]||(this[p]=_toConsumableArray(this[c]),this[p].sort(function(x,m){return x.zIndex-m.zIndex||x.zOrder-m.zOrder;})),this[p];}},{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[c].push(x),x.connect(this,this[f]++),this[p]&&(this[p].length&&x.zIndex<this[p][this[p].length-1].zIndex?this.reorder():this[p].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(S.prototype),"cloneNode",this).call(this);return x&&this[c].forEach(function(T){var l=T.cloneNode(x);m.appendChild(l);}),m;}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(x){var m=this.orderedChildren;for(var _T31=m.length-1;_T31>=0;_T31--)if(m[_T31].dispatchPointerEvent(x))return!0;return _get(_getPrototypeOf(S.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(S.prototype),"draw",this).call(this,x),!this[v]&&this.attributes.display!=="none"){var m=this.orderedChildren;for(var _T32=0;_T32<m.length;_T32++)m[_T32].draw(x);}return this.__cacheRenderMatrix=null,x;}},{key:"getElementById",value:function getElementById(x){return Object(o.querySelector)("#".concat(x),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(x){return Object(o.querySelectorAll)(".".concat(x),this);}},{key:"getElementsByName",value:function getElementsByName(x){return Object(o.querySelectorAll)("[name=\"".concat(x,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(x){return Object(o.querySelectorAll)(x,this);}},{key:"insertBefore",value:function insertBefore(x,m){if(m==null)return this.appendChild(x);x.remove();var T=this[c].indexOf(m);if(T<0)throw new Error("Invalid reference node.");var l=m.zOrder;for(var d=T;d<this[c].length;d++){var u=this[c][d].zOrder,g=this[c][d];delete g.zOrder,Object.defineProperty(g,"zOrder",{value:u+1,writable:!1,configurable:!0});}if(this[c].splice(T,0,x),x.connect(this,l),this[p])if(x.zIndex!==m.zIndex)this.reorder();else{var _d7=this[p].indexOf(m);this[p].splice(_d7,0,x);}return x;}},{key:"querySelector",value:function querySelector(x){return Object(o.querySelector)(x,this);}},{key:"querySelectorAll",value:function querySelectorAll(x){return Object(o.querySelectorAll)(x,this);}},{key:"replaceChild",value:function replaceChild(x,m){x.remove();var T=this[c].indexOf(m);if(T<0)throw new Error("Invalid reference node.");if(this[c][T]=x,x.connect(this,m.zOrder),this[p])if(x.zIndex!==m.zIndex)this.reorder();else{var _l25=this[p].indexOf(m);this[p][_l25]=x;}return m.disconnect(this),x;}},{key:"removeAllChildren",value:function removeAllChildren(){var x=this[c];for(var m=x.length-1;m>=0;m--)x[m].remove();}},{key:"removeChild",value:function removeChild(x){var m=this[c].indexOf(x);if(m>=0){if(this[c].splice(m,1),this[p]){var _T33=this[p].indexOf(x);this[p].splice(_T33,1);}return x.disconnect(this),x;}return null;}},{key:"reorder",value:function reorder(){this[p]=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 R=1;R<A.length;R+=2){var b=A[R],E=A[R+1];A[R]=b*u[0]+E*u[2]+u[4],A[R+1]=b*u[1]+E*u[3]+u[5];}g.push(A);}return g;}var m=this.orderedChildren,T=new e.Figure2D(),l=this.localMatrix;for(var d=0;d<m.length;d++){var u=m[d];if(u instanceof S&&(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[v]=!0,this.clientBox=T,{clientBox:T,localMatrix:l};}/* override */},{key:"setResolution",value:function setResolution(_ref146){var x=_ref146.width,m=_ref146.height;_get(_getPrototypeOf(S.prototype),"setResolution",this).call(this,{width:x,height:m}),this[c].forEach(function(T){T.setResolution({width:x,height:m});});}/* override */},{key:"updateContours",value:function updateContours(){this[v]||_get(_getPrototypeOf(S.prototype),"updateContours",this).call(this);}}]);}(n["default"]);s(S,"Attr",i["default"]),a["default"].registerNode(S,"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 v;}),t.d(r,"querySelector",function(){return S;}),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 o(m){return Array.from(m.childNodes||[]);}function s(m){return n["default"].isSpriteNode(m.nodeName)?m.parent||m.canvas||m.container:m.parentElement;}function f(m){var T=m.length,l,d,u;for(;--T>-1;){for(l=d=m[T],m[T]=null,u=!0;d;){if(m.indexOf(d)>-1){u=!1,m.splice(T,1);break;}d=s(d);}u&&(m[T]=l);}return m;}var p={isTag:a,existsOne:function existsOne(m,T){return T.some(function(l){return a(l)?m(l)||p.existsOne(m,o(l)):!1;});},getSiblings:function getSiblings(m){var T=s(m);return T&&o(T);},getChildren:o,getParent:s,getAttributeValue:function getAttributeValue(m,T){if(m.nodeType===1&&T==="class"||T==="id")return m[T];if(this.hasAttrib(m,T)){var _l26=m.attributes[T];return Array.isArray(_l26)&&(_l26="[".concat(_l26.join(),"]")),String(_l26);}},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,l){var d=null;for(var u=0,g=l.length;u<g&&!d;u++)if(T(l[u]))d=l[u];else{var M=o(l[u]);M&&M.length>0&&(d=m(T,M));}return d;},findAll:function m(T,l){var d=[];for(var u=0,g=l.length;u<g;u++){if(!a(l[u]))continue;T(l[u])&&d.push(l[u]);var M=o(l[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(o(T)):T.nodeType===3?T.nodeValue:n["default"].isSpriteNode(T.nodeName)?T.text:"";}};function c(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(l){var d=l.slice(1,-1).split("="),u=Object(e.parseColor)(d[1].replace(/['"]/g,""));return[l,"[".concat(d[0],"=\"").concat(u,"\"]")];}),T.forEach(function(_ref147){var _ref148=_slicedToArray(_ref147,2),l=_ref148[0],d=_ref148[1];m=m.replace(l,d);})),T=m.match(/\[\w+\s*=\s*['"]\[.+?\]['"]\]/g),T&&(T=T.map(function(l){var d=l.slice(1,-1).split("="),u=d[1].slice(2,-2).split(/,/g).map(function(g){return g.trim();});return[l,"[".concat(d[0],"=\"[").concat(u,"]\"]")];}),T.forEach(function(_ref149){var _ref150=_slicedToArray(_ref149,2),l=_ref150[0],d=_ref150[1];m=m.replace(l,d);})),m;}function v(m,T){return i.selectAll(c(m),T,{adapter:p});}function S(m,T){return i.selectOne(c(m),T,{adapter:p});}function O(m,T){return i.is(m,c(T),{adapter:p});}function x(m){return i.compile(c(m),{adapter:p});}},/* 253 */ /***/function(h,r,t){h.exports=x;var e=t(254),n=t(273).falseFunc,i=t(274);function a(m){return function(l,d,u){return d=d||{},d.adapter=d.adapter||e,m(l,d,u);};}var o=a(i),s=a(i.compileUnsafe);function f(m){return function(l,d,u){return u=u||{},u.adapter=u.adapter||e,typeof l!="function"&&(l=s(l,u,d)),l.shouldTestNextSiblings&&(d=c(u&&u.context||d,u.adapter)),Array.isArray(d)?d=u.adapter.removeSubsets(d):d=u.adapter.getChildren(d),m(l,d,u);};}function p(m,T){var l=T.getSiblings(m);if(!Array.isArray(l))return[];for(l=l.slice(0);l.shift()!==m;);return l;}function c(m,T){Array.isArray(m)||(m=[m]);for(var l=m.slice(0),d=0,u=m.length;d<u;d++){var g=p(l[d],T);l.push.apply(l,g);}return l;}var v=f(function(T,l,d){return T===n||!l||l.length===0?[]:d.adapter.findAll(T,l);}),S=f(function(T,l,d){return T===n||!l||l.length===0?null:d.adapter.findOne(T,l);});function O(m,T,l){return l=l||{},l.adapter=l.adapter||e,(typeof T=="function"?T:o(T,l))(m);}function x(m,T,l){return v(m,T,l);}x.compile=o,x.filters=i.Pseudos.filters,x.pseudos=i.Pseudos.pseudos,x.selectAll=v,x.selectOne=S,x.is=O,x.parse=o,x.iterate=v,x._compileUnsafe=s,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:o};function a(s,f){return s.children?s.children.map(function(p){return n(p,f);}).join(""):"";}function o(s){return Array.isArray(s)?s.map(o).join(""):i(s)?s.name==="br"?"\n":o(s.children):s.type===e.CDATA?o(s.children):s.type===e.Text?s.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 o(m,T){if(m){var l="",d;for(var u in m)d=m[u],l&&(l+=" "),T.xmlMode==="foreign"&&(u=i.attributeNames[u]||u),l+=u,(d!==null&&d!==""||T.xmlMode)&&(l+='="'+(T.decodeEntities?n.encodeXML(d):d.replace(/\"/g,"""))+'"');return l;}}var s={__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 l="",d=0;d<m.length;d++){var u=m[d];u.type==="root"?l+=f(u.children,T):e.isTag(u)?l+=c(u,T):u.type===e.Directive?l+=v(u):u.type===e.Comment?l+=x(u):u.type===e.CDATA?l+=O(u):l+=S(u,T);}return l;},p=["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"];function c(m,T){T.xmlMode==="foreign"&&(m.name=i.elementNames[m.name]||m.name,m.parent&&p.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 l="<"+m.name,d=o(m.attribs,T);return d&&(l+=" "+d),T.xmlMode&&(!m.children||m.children.length===0)?l+="/>":(l+=">",m.children&&(l+=f(m.children,T)),(!s[m.name]||T.xmlMode)&&(l+="</"+m.name+">")),l;}function v(m){return"<"+m.data+">";}function S(m,T){var l=m.data||"";return T.decodeEntities&&!(m.parent&&m.parent.name in a)&&(l=n.encodeXML(l)),l;}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(p,c){return(!c||c<=0?e.decodeXML:e.decodeHTML)(p);}r.decode=i;function a(p,c){return(!c||c<=0?e.decodeXML:e.decodeHTMLStrict)(p);}r.decodeStrict=a;function o(p,c){return(!c||c<=0?n.encodeXML:n.encodeHTML)(p);}r.encode=o;var s=t(266);Object.defineProperty(r,"encodeXML",{enumerable:!0,get:function get(){return s.encodeXML;}}),Object.defineProperty(r,"encodeHTML",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"escape",{enumerable:!0,get:function get(){return s.escape;}}),Object.defineProperty(r,"encodeHTML4",{enumerable:!0,get:function get(){return s.encodeHTML;}}),Object.defineProperty(r,"encodeHTML5",{enumerable:!0,get:function get(){return s.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(c){return c&&c.__esModule?c:{"default":c};};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)),o=e(t(264));r.decodeXML=s(a["default"]),r.decodeHTMLStrict=s(n["default"]);function s(c){var v=Object.keys(c).join("|"),S=p(c);v+="|#[xX][\\da-fA-F]+|#\\d+";var O=new RegExp("&(?:"+v+");","g");return function(x){return String(x).replace(O,S);};}var f=function f(c,v){return c<v?1:-1;};r.decodeHTML=function(){for(var c=Object.keys(i["default"]).sort(f),v=Object.keys(n["default"]).sort(f),S=0,O=0;S<v.length;S++)c[O]===v[S]?(v[S]+=";?",O++):v[S]+=";";var x=new RegExp("&(?:"+v.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),m=p(n["default"]);function T(l){return l.substr(-1)!==";"&&(l+=";"),m(l);}return function(l){return String(l).replace(x,T);};}();function p(c){return function(S){if(S.charAt(1)==="#"){var O=S.charAt(2);return O==="X"||O==="x"?o["default"](parseInt(S.substr(3),16)):o["default"](parseInt(S.substr(2),10));}return c[S.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 o="";return a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),o;}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=p(n["default"]),a=c(i);r.encodeXML=O(i,a);var o=e(t(261)),s=p(o["default"]),f=c(s);r.encodeHTML=O(s,f);function p(T){return Object.keys(T).sort().reduce(function(l,d){return l[T[d]]="&"+d+";",l;},{});}function c(T){for(var l=[],d=[],u=0,g=Object.keys(T);u<g.length;u++){var M=g[u];M.length===1?l.push("\\"+M):d.push(M);}l.sort();for(var A=0;A<l.length-1;A++){for(var R=A;R<l.length-1&&l[R].charCodeAt(1)+1===l[R+1].charCodeAt(1);)R+=1;var b=1+R-A;b<3||l.splice(A,b,l[A]+"-"+l[R]);}return d.unshift("["+l.join("")+"]"),new RegExp(d.join("|"),"g");}var v=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g;function S(T){return"&#x"+T.codePointAt(0).toString(16).toUpperCase()+";";}function O(T,l){return function(d){return d.replace(l,function(u){return T[u];}).replace(v,S);};}var x=c(i);function m(T){return T.replace(x,S).replace(v,S);}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 o=a.children;o[o.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:o,existsOne:s,findAll:f};function n(p,c,v,S){return Array.isArray(c)||(c=[c]),(typeof S!="number"||!isFinite(S))&&(S=1/0),i(p,c,v!==!1,S);}function i(p,c,v,S){for(var O=[],x,m=0,T=c.length;m<T&&!(p(c[m])&&(O.push(c[m]),--S<=0)||(x=c[m].children,v&&x&&x.length>0&&(x=i(p,x,v,S),O=O.concat(x),S-=x.length,S<=0)));m++);return O;}function a(p,c){for(var v=0,S=c.length;v<S;v++)if(p(c[v]))return c[v];return null;}function o(p,c){for(var v=null,S=0,O=c.length;S<O&&!v;S++)if(e(c[S]))p(c[S])?v=c[S]:c[S].children.length>0&&(v=o(p,c[S].children));else continue;return v;}function s(p,c){for(var v=0,S=c.length;v<S;v++)if(e(c[v])&&(p(c[v])||c[v].children.length>0&&s(p,c[v].children)))return!0;return!1;}function f(p,c){for(var v=[],S=c.slice();S.length;){var O=S.shift();e(O)&&(O.children&&O.children.length>0&&S.unshift.apply(S,O.children),p(O)&&v.push(O));}return v;}},/* 271 */ /***/function(h,r,t){var e=t(256),n=r.isTag=e.isTag;r.testElement=function(s,f){for(var p in s)if(s.hasOwnProperty(p)){if(p==="tag_name"){if(!n(f)||!s.tag_name(f.name))return!1;}else if(p==="tag_type"){if(!s.tag_type(f.type))return!1;}else if(p==="tag_contains"){if(n(f)||!s.tag_contains(f.data))return!1;}else if(!f.attribs||!s[p](f.attribs[p]))return!1;}return!0;};var i={tag_name:function tag_name(s){return typeof s=="function"?function(f){return n(f)&&s(f.name);}:s==="*"?n:function(f){return n(f)&&f.name===s;};},tag_type:function tag_type(s){return typeof s=="function"?function(f){return s(f.type);}:function(f){return f.type===s;};},tag_contains:function tag_contains(s){return typeof s=="function"?function(f){return!n(f)&&s(f.data);}:function(f){return!n(f)&&f.data===s;};}};function a(s,f){return typeof f=="function"?function(p){return p.attribs&&f(p.attribs[s]);}:function(p){return p.attribs&&p.attribs[s]===f;};}function o(s,f){return function(p){return s(p)||f(p);};}r.getElements=function(s,f,p,c){var v=Object.keys(s).map(function(S){var O=s[S];return S in i?i[S](O):a(S,O);});return v.length===0?[]:this.filter(v.reduce(o),f,p,c);},r.getElementById=function(s,f,p){return Array.isArray(f)||(f=[f]),this.findOne(a("id",s),f,p!==!1);},r.getElementsByTagName=function(s,f,p,c){return this.filter(i.tag_name(s),f,p,c);},r.getElementsByTagType=function(s,f,p,c){return this.filter(i.tag_type(s),f,p,c);};},/* 272 */ /***/function(h,r){r.removeSubsets=function(n){for(var i=n.length,a,o,s;--i>-1;){for(a=o=n[i],n[i]=null,s=!0;o;){if(n.indexOf(o)>-1){s=!1,n.splice(i,1);break;}o=o.parent;}s&&(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=[],o=[],s,f,p,c,v,S;if(n===i)return 0;for(s=n;s;)a.unshift(s),s=s.parent;for(s=i;s;)o.unshift(s),s=s.parent;for(S=0;a[S]===o[S];)S++;return S===0?t.DISCONNECTED:(f=a[S-1],p=f.children,c=a[S],v=o[S],p.indexOf(c)>p.indexOf(v)?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,o;for(n=n.slice();--i>-1;)a=n[i],o=n.indexOf(a),o>-1&&o<i&&n.splice(i,1);return n.sort(function(s,f){var p=e(s,f);return p&t.PRECEDING?-1:p&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=v;var e=t(275).parse,n=t(273),i=t(278),a=t(279),o=t(280),s=t(282),f=n.trueFunc,p=n.falseFunc,c=s.filters;function v(E,L,D){var I=O(E,L,D);return S(I,L);}function S(E,L){var D=L.adapter;return function(C){return D.isTag(C)&&E(C);};}function O(E,L,D){var I=e(E,L);return g(I,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"},l={type:"pseudo",name:"scope"},d={};function u(E,L,D){var I=L.adapter,C=!!D&&!!D.length&&D.every(function(W){return W===d||!!I.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(l);});}function g(E,L,D){E=E.filter(function(G){return G.length>0;}),E.forEach(i);var I=Array.isArray(D);D=L&&L.context||D,D&&!I&&(D=[D]),u(E,L,D);var C=!1,W=E.map(function(G){if(G[0]&&G[1]&&G[0].name==="scope"){var K=G[1].type;I&&K==="descendant"?G[1]=T:(K==="adjacent"||K==="sibling")&&(C=!0);}return A(G,L,D);}).reduce(R,p);return W.shouldTestNextSiblings=C,W;}function M(E){return a[E.type]<0;}function A(E,L,D){return E.reduce(function(I,C){if(I===p)return I;if(!(C.type in o))throw new Error("Rule type "+C.type+" is not supported by css-select");return o[C.type](I,C,L,D);},L&&L.rootFunc||f);}function R(E,L){return L===p||E===f?E:E===p||L===f?L:function(I){return E(I)||L(I);};}function b(E){return E.some(M);}c.not=function(E,L,D,I){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,I);return W===p?E:W===f?p:function(K){return!W(K)&&E(K);};},c.has=function(E,L,D){var I=D.adapter,C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),adapter:I},W=L.some(b)?[d]:null,G=g(L,C,W);return G===p?p:G===f?function(J){return I.getChildren(J).some(I.isTag)&&E(J);}:(G=S(G,D),W?function(J){return E(J)&&(W[0]=J,I.existsOne(G,I.getChildren(J)));}:function(J){return E(J)&&I.existsOne(G,I.getChildren(J));});},c.matches=function(E,L,D,I){var C={xmlMode:!!(D&&D.xmlMode),strict:!!(D&&D.strict),rootFunc:E,adapter:D.adapter};return g(L,C,I);},v.compileToken=g,v.compileUnsafe=O,v.Pseudos=s;},/* 275 */ /***/function(h,r,t){var e=this&&this.__createBinding||(Object.create?function(o,s,f,p){p===void 0&&(p=f),Object.defineProperty(o,p,{enumerable:!0,get:function get(){return s[f];}});}:function(o,s,f,p){p===void 0&&(p=f),o[p]=s[f];}),n=this&&this.__exportStar||function(o,s){for(var f in o)f!=="default"&&!s.hasOwnProperty(f)&&e(s,o,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"},o={">":"child","<":"parent","~":"sibling","+":"adjacent"},s={"#":["id","equals"],".":["class","element"]},f=/* @__PURE__ */new Set(["has","not","matches"]),p=/* @__PURE__ */new Set(["contains","icontains"]),c=/* @__PURE__ */new Set(['"',"'"]);function v(l,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 S(l){return l.replace(n,v);}function O(l){return l===" "||l==="\n"||l===" "||l==="\f"||l==="\r";}function x(l,d){var u=[];if(l=m(u,""+l,d),l!=="")throw new Error("Unmatched selector: "+l);return u;}function m(l,d,u){var g=[],M=!1;function A(){var Q=d.match(e);if(!Q)throw new Error("Expected name, found "+d);var et=Q[0];return d=d.substr(et.length),S(et);}function R(Q){for(;O(d.charAt(Q));)Q++;d=d.substr(Q);}function b(Q){for(var et=0;d.charAt(--Q)==="\\";)et++;return(et&1)===1;}for(R(0);d!=="";){var E=d.charAt(0);if(O(E))M=!0,R(1);else if(E in o)g.push({type:o[E]}),M=!1,R(1);else if(E===","){if(g.length===0)throw new Error("Empty sub-selector");l.push(g),g=[],M=!1,R(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 s){var L=s[E],D=L[0],I=L[1];d=d.substr(1),g.push({type:"attribute",name:D,action:I,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=S(C[1]);(!u||("lowerCaseAttributeNames"in u?u.lowerCaseAttributeNames:!u.xmlMode))&&(W=W.toLowerCase()),g.push({type:"attribute",name:W,action:a[C[2]],value:S(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 G=A().toLowerCase(),C=null;if(d.charAt(0)==="(")if(f.has(G)){var K=d.charAt(1),J=c.has(K);if(d=d.substr(J?2:1),C=[],d=m(C,d,u),J){if(d.charAt(0)!==K)throw new Error("Unmatched quotes in :"+G);d=d.substr(1);}if(d.charAt(0)!==")")throw new Error("Missing closing parenthesis in :"+G+" ("+d+")");d=d.substr(1);}else{for(var Z=1,B=1;B>0&&Z<d.length;Z++)d.charAt(Z)==="("&&!b(Z)?B++:d.charAt(Z)===")"&&!b(Z)&&B--;if(B)throw new Error("Parenthesis not matched");if(C=d.substr(1,Z-2),d=d.substr(Z),p.has(G)){var K=C.charAt(0);K===C.slice(-1)&&c.has(K)&&(C=C.slice(1,-1)),C=S(C);}}g.push({type:"pseudo",name:G,data:C});}else if(e.test(d)){var $=A();(!u||("lowerCaseTags"in u?u.lowerCaseTags:!u.xmlMode))&&($=$.toLowerCase()),g.push({type:"tag",name:$});}else return g.length&&g[g.length-1].type==="descendant"&&g.pop(),T(l,g),d;}return T(l,g),d;}function T(l,d){if(l.length>0&&d.length===0)throw new Error("Empty sub-selector");l.push(d);}},/* 277 */ /***/function(h,r,t){Object.defineProperty(r,"__esModule",{value:!0});var e={equals:"",element:"~",start:"^",end:"$",any:"*",not:"!",hyphen:"|"};function n(s){return s.map(i).join(", ");}r["default"]=n;function i(s){return s.map(a).join("");}function a(s){switch(s.type){case"child":return" > ";case"parent":return" < ";case"sibling":return" ~ ";case"adjacent":return" + ";case"descendant":return" ";case"universal":return"*";case"tag":return s.name;case"pseudo-element":return"::"+s.name;case"pseudo":return s.data===null?":"+s.name:typeof s.data=="string"?":"+s.name+"("+s.data+")":":"+s.name+"("+n(s.data)+")";case"attribute":return s.action==="exists"?"["+s.name+"]":s.name==="id"&&s.action==="equals"&&!s.ignoreCase?"#"+s.value:s.name==="class"&&s.action==="element"&&!s.ignoreCase?"."+s.value:"["+s.name+e[s.action]+"='"+s.value+"'"+(s.ignoreCase?"i":"")+"]";default:throw new Error("Unknown type");}}function o(s){return s;}},/* 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(o){for(var s=o.map(a),f=1;f<o.length;f++){var p=s[f];if(!(p<0))for(var c=f-1;c>=0&&p<s[c];c--){var v=o[c+1];o[c+1]=o[c],o[c]=v,s[c+1]=s[c],s[c]=p;}}}function a(o){var s=e[o.type];if(s===e.attribute)s=n[o.action],s===n.equals&&o.name==="id"&&(s=9),o.ignoreCase&&(s>>=1);else if(s===e.pseudo)if(!o.data)s=3;else if(o.name==="has"||o.name==="contains")s=0;else if(o.name==="matches"||o.name==="not"){s=0;for(var f=0;f<o.data.length;f++)if(o.data[f].length===1){var p=a(o.data[f][0]);if(p===0){s=0;break;}p>s&&(s=p);}o.data.length>1&&s>0&&(s-=1);}else s=1;return s;}},/* 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,o){var s=a.name,f=o.adapter;return function(c){return f.getName(c)===s&&i(c);};},//traversal
|
|
358
|
-
descendant:function descendant(i,a,o){var s=(typeof WeakSet==="undefined"?"undefined":_typeof(WeakSet))<"u"?/* @__PURE__ */new WeakSet():null,f=o.adapter;return function(c){for(var v=!1;!v&&(c=f.getParent(c));)(!s||!s.has(c))&&(v=i(c),!v&&s&&s.add(c));return v;};},_flexibleDescendant:function _flexibleDescendant(i,a,o){var s=o.adapter;return function(p){for(var c=i(p);!c&&(p=s.getParent(p));)c=i(p);return c;};},parent:function parent(i,a,o){if(o&&o.strict)throw new Error("Parent selector isn't part of CSS3");var s=o.adapter;return function(c){return s.getChildren(c).some(f);};function f(p){return s.isTag(p)&&i(p);}},child:function child(i,a,o){var s=o.adapter;return function(p){var c=s.getParent(p);return!!c&&i(c);};},sibling:function sibling(i,a,o){var s=o.adapter;return function(p){for(var c=s.getSiblings(p),v=0;v<c.length;v++)if(s.isTag(c[v])){if(c[v]===p)break;if(i(c[v]))return!0;}return!1;};},adjacent:function adjacent(i,a,o){var s=o.adapter;return function(p){for(var c=s.getSiblings(p),v,S=0;S<c.length;S++)if(s.isTag(c[S])){if(c[S]===p)break;v=c[S];}return!!v&&i(v);};},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,o,s){var f=o.name,p=o.value,c=s.adapter;return o.ignoreCase?(p=p.toLowerCase(),function(S){var O=c.getAttributeValue(S,f);return O!=null&&O.toLowerCase()===p&&a(S);}):function(S){return c.getAttributeValue(S,f)===p&&a(S);};},hyphen:function hyphen(a,o,s){var f=o.name,p=o.value,c=p.length,v=s.adapter;return o.ignoreCase?(p=p.toLowerCase(),function(O){var x=v.getAttributeValue(O,f);return x!=null&&(x.length===c||x.charAt(c)==="-")&&x.substr(0,c).toLowerCase()===p&&a(O);}):function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(0,c)===p&&(x.length===c||x.charAt(c)==="-")&&a(O);};},element:function element(a,o,s){var f=o.name,p=o.value,c=s.adapter;if(/\s/.test(p))return e;p=p.replace(n,"\\$&");var v="(?:^|\\s)"+p+"(?:$|\\s)",S=o.ignoreCase?"i":"",O=new RegExp(v,S);return function(m){var T=c.getAttributeValue(m,f);return T!=null&&O.test(T)&&a(m);};},exists:function exists(a,o,s){var f=o.name,p=s.adapter;return function(v){return p.hasAttrib(v,f)&&a(v);};},start:function start(a,o,s){var f=o.name,p=o.value,c=p.length,v=s.adapter;return c===0?e:o.ignoreCase?(p=p.toLowerCase(),function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(0,c).toLowerCase()===p&&a(O);}):function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(0,c)===p&&a(O);};},end:function end(a,o,s){var f=o.name,p=o.value,c=-p.length,v=s.adapter;return c===0?e:o.ignoreCase?(p=p.toLowerCase(),function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(c).toLowerCase()===p&&a(O);}):function(O){var x=v.getAttributeValue(O,f);return x!=null&&x.substr(c)===p&&a(O);};},any:function any(a,o,s){var f=o.name,p=o.value,c=s.adapter;if(p==="")return e;if(o.ignoreCase){var v=new RegExp(p.replace(n,"\\$&"),"i");return function(O){var x=c.getAttributeValue(O,f);return x!=null&&v.test(x)&&a(O);};}return function(O){var x=c.getAttributeValue(O,f);return x!=null&&x.indexOf(p)>=0&&a(O);};},not:function not(a,o,s){var f=o.name,p=o.value,c=s.adapter;return p===""?function(S){return!!c.getAttributeValue(S,f)&&a(S);}:o.ignoreCase?(p=p.toLowerCase(),function(S){var O=c.getAttributeValue(S,f);return O!=null&&O.toLowerCase()!==p&&a(S);}):function(S){return c.getAttributeValue(S,f)!==p&&a(S);};}};h.exports={compile:function compile(a,o,s){if(s&&s.strict&&(o.ignoreCase||o.action==="not"))throw new Error("Unsupported attribute selector");return i[o.action](a,o,s);},rules:i};},/* 282 */ /***/function(h,r,t){var e=t(283),n=t(273),i=t(281),a=n.trueFunc,o=n.falseFunc,s=i.rules.equals;function f(T,l){var d={name:T,value:l};return function(g,M,A){return s(g,d,A);};}function p(T,l){return function(d){return!!l.getParent(d)&&T(d);};}var c={contains:function contains(T,l,d){var u=d.adapter;return function(M){return T(M)&&u.getText(M).indexOf(l)>=0;};},icontains:function icontains(T,l,d){var u=l.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,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(T,g):function(A){for(var R=g.getSiblings(A),b=0,E=0;b<R.length;b++)if(g.isTag(R[b])){if(R[b]===A)break;E++;}return u(E)&&T(A);};},"nth-last-child":function nthLastChild(T,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(T,g):function(A){for(var R=g.getSiblings(A),b=0,E=R.length-1;E>=0;E--)if(g.isTag(R[E])){if(R[E]===A)break;b++;}return u(b)&&T(A);};},"nth-of-type":function nthOfType(T,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(T,g):function(A){for(var R=g.getSiblings(A),b=0,E=0;E<R.length;E++)if(g.isTag(R[E])){if(R[E]===A)break;g.getName(R[E])===g.getName(A)&&b++;}return u(b)&&T(A);};},"nth-last-of-type":function nthLastOfType(T,l,d){var u=e(l),g=d.adapter;return u===o?u:u===a?p(T,g):function(A){for(var R=g.getSiblings(A),b=0,E=R.length-1;E>=0;E--)if(g.isTag(R[E])){if(R[E]===A)break;g.getName(R[E])===g.getName(A)&&b++;}return u(b)&&T(A);};},//TODO determine the actual root element
|
|
360
|
-
root:function root(T,l,d){var u=d.adapter;return function(g){return!u.getParent(g)&&T(g);};},scope:function scope(T,l,d,u){var g=d.adapter;if(!u||u.length===0)return c.root(T,l,d);function M(A,R){return typeof g.equals=="function"?g.equals(A,R):A===R;}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,l,d){var u=d.adapter;return typeof u.isHovered=="function"?function(M){return T(M)&&u.isHovered(M);}:o;},visited:function visited(T,l,d){var u=d.adapter;return typeof u.isVisited=="function"?function(M){return T(M)&&u.isVisited(M);}:o;},active:function active(T,l,d){var u=d.adapter;return typeof u.isActive=="function"?function(M){return T(M)&&u.isActive(M);}:o;}};function v(T,l){for(var d=0;T&&d<T.length;d++)if(l.isTag(T[d]))return T[d];}var S={empty:function empty(T,l){return!l.getChildren(T).some(function(d){return l.isTag(d)||d.type==="text";});},"first-child":function firstChild(T,l){return v(l.getSiblings(T),l)===T;},"last-child":function lastChild(T,l){for(var d=l.getSiblings(T),u=d.length-1;u>=0;u--){if(d[u]===T)return!0;if(l.isTag(d[u]))break;}return!1;},"first-of-type":function firstOfType(T,l){for(var d=l.getSiblings(T),u=0;u<d.length;u++)if(l.isTag(d[u])){if(d[u]===T)return!0;if(l.getName(d[u])===l.getName(T))break;}return!1;},"last-of-type":function lastOfType(T,l){for(var d=l.getSiblings(T),u=d.length-1;u>=0;u--)if(l.isTag(d[u])){if(d[u]===T)return!0;if(l.getName(d[u])===l.getName(T))break;}return!1;},"only-of-type":function onlyOfType(T,l){for(var d=l.getSiblings(T),u=0,g=d.length;u<g;u++)if(l.isTag(d[u])){if(d[u]===T)continue;if(l.getName(d[u])===l.getName(T))return!1;}return!0;},"only-child":function onlyChild(T,l){for(var d=l.getSiblings(T),u=0;u<d.length;u++)if(l.isTag(d[u])&&d[u]!==T)return!1;return!0;},//:matches(a, area, link)[href]
|
|
363
|
-
link:function link(T,l){return l.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,l){if(l.hasAttrib(T,"selected"))return!0;if(l.getName(T)!=="option")return!1;var d=l.getParent(T);if(!d||l.getName(d)!=="select"||l.hasAttrib(d,"multiple"))return!1;for(var u=l.getChildren(d),g=!1,M=0;M<u.length;M++)if(l.isTag(u[M]))if(u[M]===T)g=!0;else if(g){if(l.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,l){return l.hasAttrib(T,"disabled");},enabled:function enabled(T,l){return!l.hasAttrib(T,"disabled");},//:matches(:matches(:radio, :checkbox)[checked], :selected) (TODO menuitem)
|
|
374
|
-
checked:function checked(T,l){return l.hasAttrib(T,"checked")||S.selected(T,l);},//:matches(input, select, textarea)[required]
|
|
375
|
-
required:function required(T,l){return l.hasAttrib(T,"required");},//:matches(input, select, textarea):not([required])
|
|
376
|
-
optional:function optional(T,l){return!l.hasAttrib(T,"required");},//jQuery extensions
|
|
377
|
-
//:not(:empty)
|
|
378
|
-
parent:function parent(T,l){return!S.empty(T,l);},//: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,l){var d=l.getName(T);return d==="button"||d==="input"&&l.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,l){var d;return l.getName(T)==="input"&&(!(d=l.getAttributeValue(T,"type"))||d.toLowerCase()==="text");}};function O(T){if((typeof Set==="undefined"?"undefined":_typeof(Set))<"u"){var l=new Set(T);return function(d,u){return l.has(u.getName(d));};}return function(d,u){return T.indexOf(u.getName(d))>=0;};}function x(T,l,d){if(d===null){if(T.length>2&&l!=="scope")throw new Error("pseudo-selector :"+l+" requires an argument");}else if(T.length===2)throw new Error("pseudo-selector :"+l+" 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,l,d,u){var g=l.name,M=l.data,A=d.adapter;if(d&&d.strict&&!m.test(g))throw new Error(":"+g+" isn't part of CSS3");if(typeof c[g]=="function")return c[g](T,M,d,u);if(typeof S[g]=="function"){var R=S[g];return x(R,g,M),R===o?R:T===a?function(E){return R(E,A,M);}:function(E){return R(E,A,M)&&T(E);};}else throw new Error("unmatched pseudo-class :"+g);},filters:c,pseudos:S};},/* 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(o){var s=o[0],f=o[1]-1;if(f<0&&s<=0)return i;if(s===-1)return function(c){return c<=f;};if(s===0)return function(c){return c===f;};if(s===1)return f<0?n:function(c){return c>=f;};var p=f%s;return p<0&&(p+=s),s>1?function(c){return c>=f&&c%s===p;}:(s*=-1,function(c){return c<=f&&c%s===p;});}},/* 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),o=t(250),s=t(213),f=t(218);t(1).glMatrix.setMatrixArrayType(Array);function p(A,R){if(A==null)return{};var b=c(A,R),E,L;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(A);for(L=0;L<D.length;L++)E=D[L],!(R.indexOf(E)>=0)&&Object.prototype.propertyIsEnumerable.call(A,E)&&(b[E]=A[E]);}return b;}function c(A,R){if(A==null)return{};var b={},E=Object.keys(A),L,D;for(D=0;D<E.length;D++)L=E[D],!(R.indexOf(L)>=0)&&(b[L]=A[L]);return b;}var v={antialias:!0,autoRender:!0,alpha:!0// for wx-miniprogram
|
|
383
|
-
},S=Symbol("autoRender"),O=Symbol("renderer"),x=Symbol("timeline"),m=Symbol("prepareRender"),T=Symbol("tickRender"),l=Symbol("pass"),d=Symbol("fbo"),u=Symbol("tickers"),g=Symbol("layerTransformInvert");var M=/*#__PURE__*/function(_o$default){function M(){var _this38;var R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this38=_callSuper(this,M),!R.canvas){var _this38$getResolution=_this38.getResolution(),D=_this38$getResolution.width,I=_this38$getResolution.height,C=e.ENV.createCanvas(D,I,{offscreen:!!R.offscreen,id:R.id,extra:R.extra});C.style&&(C.style.position="absolute"),C.dataset&&(C.dataset.layerId=R.id),C.contextType&&(R.contextType=C.contextType),R.canvas=C;}var b=R.canvas,E=Object.assign({},v,R);_this38[S]=E.autoRender,delete R.autoRender;var L=E.Renderer||e.Renderer;_this38[O]=new L(b,E),_this38.options=R,_this38.id=R.id,_this38[l]=[],_this38.setResolution(b),_this38.canvas=b,_this38[x]=new n.Timeline(),_this38.__mouseCapturedTarget=null,_this38[g]=null;return _assertThisInitialized(_this38);}_inherits(M,_o$default);return _createClass(M,[{key:"autoRender",get:function get(){return this[S];}},{key:"displayRatio",get:function get(){return this.parent&&this.parent.options?this.parent.options.displayRatio:1;}},{key:"height",get:function get(){var _this$getResolution=this.getResolution(),R=_this$getResolution.height;return R/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[l];}},{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,R=_this$parent$options.left,b=_this$parent$options.top;return[R,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(),R=_this$getResolution2.width;return R/this.displayRatio;}},{key:"localMatrix",get:function get(){var _this$attributes21=this.attributes,R=_this$attributes21.x,b=_this$attributes21.y;return[1,0,0,1,R,b];}},{key:"layerTransformInvert",get:function get(){if(this[g])return this[g];var R=this.transformMatrix;return R[0]===1&&R[1]===0&&R[2]===0&&R[3]===1&&R[4]===0&&R[5]===0?null:(this[g]=i.mat2d.invert(Array.of(0,0,0,0,0,0),R),this[g]);}},{key:"forceContextLoss",value:function forceContextLoss(){var R=this.renderer.glRenderer;if(R){var b=R.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]:{},R=_ref151.vertex,b=_ref151.fragment,E=_ref151.options,L=_ref151.uniforms;if(this.renderer.glRenderer){var _this$getResolution3=this.getResolution(),D=_this$getResolution3.width,I=_this$getResolution3.height,C=this.renderer.createPassProgram({vertex:R,fragment:b,options:E}),W=new e.Figure2D();W.rect(0,0,D/this.displayRatio,I/this.displayRatio);var G=new e.Mesh2D(W);return G.setUniforms(L),G.setProgram(C),this[l].push(G),this.forceUpdate(),G;}return null;}// delete unused texture to release memory.
|
|
387
|
-
},{key:"deleteTexture",value:function deleteTexture(R){return Object(f.deleteTexture)(R,this.renderer);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(R){var b=R.type;if(b==="mousedown"||b==="mouseup"||b==="mousemove"){var C=this.__mouseCapturedTarget;if(C){if(C.layer===this)return C.dispatchEvent(R),!0;this.__mouseCapturedTarget=null;}}var E,L;var D=this.layerTransformInvert;if(D){E=R.x,L=R.y;var _C6=D,W=_C6[0]*E+_C6[2]*L+_C6[4],G=_C6[1]*E+_C6[3]*L+_C6[5];delete R.x,delete R.y,delete R.layerX,delete R.layerY,Object.defineProperties(R,{layerX:{value:W,configurable:!0},layerY:{value:G,configurable:!0},x:{value:W,configurable:!0},y:{value:G,configurable:!0}});}var I=_get(_getPrototypeOf(M.prototype),"dispatchPointerEvent",this).call(this,R);return D&&Object.defineProperties(R,{layerX:{value:E,configurable:!0},layerY:{value:L,configurable:!0},x:{value:E,configurable:!0},y:{value:L,configurable:!0}}),I;}/* override */},{key:"forceUpdate",value:function forceUpdate(){var _this39=this;if(!this[m])if(this.parent&&this.parent.hasOffscreenCanvas){this.parent.forceUpdate();var R=null;var b=new Promise(function(E){R=E;});b._resolve=R,this[m]=b;}else{var _R2=null,_b8=null;var E=new Promise(function(L){_R2=L,_this39[S]&&(_b8=Object(a.requestAnimationFrame)(function(){delete E._requestID,_this39.render();}));});E._resolve=_R2,E._requestID=_b8,this[m]=E;}}},{key:"getFBO",value:function getFBO(){var R=this.renderer.glRenderer,_this$getResolution4=this.getResolution(),b=_this$getResolution4.width,E=_this$getResolution4.height;return R&&(!this[d]||this[d].width!==b||this[d].height!==E)?(this[d]={width:b,height:E,target:R.createFBO(),buffer:R.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 R=this.renderer,b=R.__globalTransformMatrix||R.globalTransformMatrix;R.__globalTransformMatrix=b;var E=i.mat2d.fromValues(1,0,0,1,0,0);R.setGlobalTransform.apply(R,_toConsumableArray(i.mat2d.multiply(E,b,this.transformMatrix)));}}/* override */},{key:"onPropertyChange",value:function onPropertyChange(R,b,E){if(_get(_getPrototypeOf(M.prototype),"onPropertyChange",this).call(this,R,b,E),R==="zIndex"&&(this.canvas.style.zIndex=b),R==="transform"||R==="translate"||R==="rotate"||R==="scale"||R==="skew"){var L=this[g];if(this[g]=null,this.updateGlobalTransform(),L&&!this.layerTransformInvert){var D=this.renderer,I=D.__globalTransformMatrix||D.globalTransformMatrix;D.setGlobalTransform.apply(D,_toConsumableArray(I));}}}},{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,R=_ref153$clear===void 0?!0:_ref153$clear;var b=this[l].length?this.getFBO():null;b&&this.renderer.glRenderer.bindFBO(b.target),R&&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[l].length,_this$getResolution5=this.getResolution(),I=_this$getResolution5.width,C=_this$getResolution5.height,W=[0,0,I/this.displayRatio,C/this.displayRatio];this[l].forEach(function(G,K){G.blend=!0,G.setTexture(b.target.texture,{rect:W}),K===D-1?L.bindFBO(null):(b.swap(),L.bindFBO(b.target)),_this40[O].clear(),_this40.renderer.drawMeshes([G]);});}this._prepareRenderFinished();}/* override */},{key:"setResolution",value:function setResolution(_ref154){var _this41=this;var R=_ref154.width,b=_ref154.height;var E=this.renderer,L=E.__globalTransformMatrix||E.globalTransformMatrix,D=L[4],I=L[5],C=L[0],_this$getResolution6=this.getResolution(),W=_this$getResolution6.width,G=_this$getResolution6.height;(W!==R||G!==b)&&(_get(_getPrototypeOf(M.prototype),"setResolution",this).call(this,{width:R,height:b}),this.canvas&&(this.canvas.width=R,this.canvas.height=b,E.updateResolution&&E.updateResolution()),this.attributes.size=[R,b],this[l].length&&this[l].forEach(function(B){var $=new e.Figure2D();$.rect(0,0,R/_this41.displayRatio,b/_this41.displayRatio),B.contours=$.contours;}));var _this$renderOffset=_slicedToArray(this.renderOffset,2),K=_this$renderOffset[0],J=_this$renderOffset[1],Z=this.displayRatio;(D!==K||I!==J||C!==Z)&&(E.setGlobalTransform(Z,0,0,Z,K,J),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 R=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=p(b,["duration"]);var D=this.timeline.fork(L),I=this;this[u]=this[u]||[],this[u].push({handler:R,duration:E});var C=function C(){var W=null,G=null;var K=function K(){var J=_this42[u].map(function(_ref155){var Z=_ref155.handler,B=_ref155.duration;var $=Math.min(1,D.currentTime/B);return{value:Z?Z(D.currentTime,$):null,p:$};});I[T]||(I[T]=Promise.resolve().then(function(){I[S]&&I.render(),delete I[T];for(var Z=J.length-1;Z>=0;Z--){var _J$Z=J[Z],B=_J$Z.value,$=_J$Z.p;(B===!1||$>=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 J=new Promise(function(Z){W=Z,G=Object(a.requestAnimationFrame)(K);});J._resolve=W,J._requestID=G,J._type="ticker",_this42[m]=J;}};C();}},{key:"toGlobalPos",value:function toGlobalPos(R,b){if(this.layerTransformInvert){var W=this.transformMatrix;R=W[0]*R+W[2]*b+W[4],b=W[1]*R+W[3]*b+W[5];}var _this$getResolution7=this.getResolution(),E=_this$getResolution7.width,L=_this$getResolution7.height,D=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*I[0]/E+D[0],b=b*I[1]/L+D[1];var C=this.displayRatio;return R*=C,b*=C,[R,b];}},{key:"toLocalPos",value:function toLocalPos(R,b){var _this$getResolution8=this.getResolution(),E=_this$getResolution8.width,L=_this$getResolution8.height,D=this.renderOffset,I=[this.canvas.clientWidth,this.canvas.clientHeight];R=R*E/I[0]-D[0],b=b*L/I[1]-D[1];var C=this.displayRatio;R/=C,b/=C;var W=this.layerTransformInvert;return W&&(R=W[0]*R+W[2]*b+W[4],b=W[1]*R+W[3]*b+W[5]),[R,b];}}]);}(o["default"]);s["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),o=t(72);t(1).glMatrix.setMatrixArrayType(Array);function s(T,l){if(T==null)return{};var d=f(T,l),u,g;if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);for(g=0;g<M.length;g++)u=M[g],!(l.indexOf(u)>=0)&&Object.prototype.propertyIsEnumerable.call(T,u)&&(d[u]=T[u]);}return d;}function f(T,l){if(T==null)return{};var d={},u=Object.keys(T),g,M;for(M=0;M<u.length;M++)g=u[M],!(l.indexOf(g)>=0)&&(d[g]=T[g]);return d;}function p(T,l,d){return l in T?Object.defineProperty(T,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):T[l]=d,T;}var c="http://www.w3.org/2000/svg",v=Symbol["for"]("spritejs_setAttribute"),S=Symbol("root"),O=Symbol("task");function x(T){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var d=T[S];if(d&&d.children[0]){var u=T.svg,g=T.layer?T.layer.displayRatio:1;if(!u.hasAttribute("data-original-width")){var R=u.getAttribute("width");R=R?Object(o.sizeToPixel)(R):300;var b=u.getAttribute("height");b=b?Object(o.sizeToPixel)(b):150,u.hasAttribute("viewBox")||u.setAttribute("viewBox","0 0 ".concat(Math.round(R)," ").concat(Math.round(b))),u.setAttribute("data-original-width",R),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,l&&T.attributes.flexible){var _R3=T.attributes.scale[0];if(M*=_R3,A*=_R3,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 R=d.innerHTML,b=new Blob([R],{type:"image/svg+xml"}),E=URL.createObjectURL(b),L=new Image();L.onload=function(){L.width&&L.height?(T.attributes[v]("texture",L),T.attributes.flexible&&(T.attributes.textureRect=null)):T.attributes[v]("texture",null);},L.src=E;}));}}var m=/*#__PURE__*/function(_e$default21){function m(){var _this43;var l=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,m);typeof l=="string"&&(l={svgText:l});var _l27=l,d=_l27.svgText,u=s(l,["svgText"]);if(_this43=_callSuper(this,m,[u]),_this43[S]=document.createElement("div"),d){_this43[S].innerHTML=d;var g=_this43[S].children[0];g?g.setAttribute("xmlns",c):(fetch(d).then(function(M){return M.text();}).then(function(M){_this43[S].innerHTML=M,(!_this43.observer||_this43.attributes.flexible)&&x(_assertThisInitialized(_this43));}),d=null);}if(!d){var _g7=document.createElementNS(c,"svg");_g7.setAttribute("xmlns",c),_this43[S].appendChild(_g7);}if(typeof MutationObserver=="function"){var _g8=new MutationObserver(function(M){x(_assertThisInitialized(_this43),!1);});_g8.observe(_this43[S],{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[S]?this[S].children[0]:null;}/* override */},{key:"setResolution",value:function setResolution(_ref156){var l=_ref156.width,d=_ref156.height;_get(_getPrototypeOf(m.prototype),"setResolution",this).call(this,{width:l,height:d}),x(this);}/* override */},{key:"dispatchPointerEvent",value:function dispatchPointerEvent(l){var d=_get(_getPrototypeOf(m.prototype),"dispatchPointerEvent",this).call(this,l);if(d&&this.attributes.passEvents&&typeof MouseEvent=="function"){var u=l.x,g=l.y;var _this$getOffsetPositi=this.getOffsetPosition(u,g),_this$getOffsetPositi2=_slicedToArray(_this$getOffsetPositi,2),M=_this$getOffsetPositi2[0],A=_this$getOffsetPositi2[1];var R=l.originalEvent,b=this.attributes.anchor,E=this.clientSize;M=(M+b[0]*E[0])/2,A=(A+b[1]*E[1])/2;var L=l.type;if(L===R.type){var D=null;if(R instanceof MouseEvent)D=new MouseEvent(L,{screenX:M,screenY:A,clientX:M,clientY:A,bubbles:R.bubbles,button:R.button,buttons:R.buttons,cancelBubble:R.cancelBubble,cancelable:R.cancelable,currentTarget:R.currentTarget,fromElement:R.fromElement,relatedTarget:R.relatedTarget,returnValue:R.returnValue,srcElement:R.srcElement,target:R.target,toElement:R.toElement,// view: originalEvent.view,
|
|
392
|
-
which:R.witch});else if(R instanceof TouchEvent){var I=null;var C=R.changedTouches||[R];for(var W=0;W<C.length;W++){var G=C[W];if(l.identifier===G.identifier){I=G;break;}}if(I){var _W3=new Touch({identifier:I.identifier,target:I.target,clientX:M,clientY:A,screenX:M,screenY:A,pageX:M,pageY:A,radiusX:I.radiusX,radiusY:I.radiusY,rotationAngle:I.rotationAngle,force:I.force});D=new TouchEvent(L,{cancelable:R.cancelable,bubbles:R.bubbles,composed:R.composed,touches:[_W3],targetTouches:[_W3],changedTouches:[_W3]});}}else D=R;D&&this.svg.dispatchEvent(D);}}return d;}},{key:"getElementById",value:function getElementById(l){return Object(a.querySelector)("#".concat(l),this);}},{key:"getElementsByClassName",value:function getElementsByClassName(l){return Object(a.querySelectorAll)(".".concat(l),this);}},{key:"getElementsByName",value:function getElementsByName(l){return Object(a.querySelectorAll)("[name=\"".concat(l,"\"]"),this);}},{key:"getElementsByTagName",value:function getElementsByTagName(l){return Object(a.querySelectorAll)(l,this);}},{key:"querySelector",value:function querySelector(l){return Object(a.querySelector)(l,this);}},{key:"querySelectorAll",value:function querySelectorAll(l){return Object(a.querySelectorAll)(l,this);}/* override */},{key:"onPropertyChange",value:function onPropertyChange(l,d,u){_get(_getPrototypeOf(m.prototype),"onPropertyChange",this).call(this,l,d,u),l==="flexible"&&x(this),this.attributes.flexible&&(l==="width"||l==="height"||l==="scale"||l==="transform")&&x(this);}}]);}(e["default"]);p(m,"Attr",n["default"]),i["default"].registerNode(m,"spritesvg");},/* 288 */ /***/function(h,r,t){t.r(r),t.d(r,"default",function(){return o;});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 o=/*#__PURE__*/function(_e$default22){function o(f){var _this44;_classCallCheck(this,o);_this44=_callSuper(this,o,[f]),_this44[a]({passEvents:!1,flexible:!1});return _this44;}// readonly
|
|
393
|
-
_inherits(o,_e$default22);return _createClass(o,[{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,p){var c=Object.keys(f);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(f);p&&(v=v.filter(function(S){return Object.getOwnPropertyDescriptor(f,S).enumerable;})),c.push.apply(c,v);}return c;}function i(f){for(var p=1;p<arguments.length;p++){var c=arguments[p]!=null?arguments[p]:{};p%2?n(Object(c),!0).forEach(function(v){a(f,v,c[v]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(c)):n(Object(c)).forEach(function(v){Object.defineProperty(f,v,Object.getOwnPropertyDescriptor(c,v));});}return f;}function a(f,p,c){return p in f?Object.defineProperty(f,p,{value:c,enumerable:!0,configurable:!0,writable:!0}):f[p]=c,f;}var o=Symbol("inited");var s=null;typeof Worker=="function"&&(s=/*#__PURE__*/function(_Worker){function s(f){var _this45;_classCallCheck(this,s);if(f.worker===!0&&(f.worker="./".concat(f.id,".worker.js")),_this45=_callSuper(this,s,[f.worker]),_this45.options=f,!f.canvas){var _this45$getResolution=_this45.getResolution(),p=_this45$getResolution.width,c=_this45$getResolution.height,v=e.ENV.createCanvas(p,c,{offscreen:!1});v.style&&(v.style.position="absolute"),v.dataset&&(v.dataset.layerId=f.id),f.canvas=v;}_this45.canvas=f.canvas;return _assertThisInitialized(_this45);}_inherits(s,_Worker);return _createClass(s,[{key:"id",get:function get(){return this.options.id;}},{key:"setResolution",value:function setResolution(_ref157){var f=_ref157.width,p=_ref157.height;if(this[o])this.postMessage({type:"resolution_change",width:f,height:p});else{this.canvas.width=f,this.canvas.height=p;var c=this.options,v=c.canvas.transferControlToOffscreen(),S=i({},c);delete S.container,S.canvas=v,this.postMessage({type:"create",options:S},[v]),this[o]=!0;}}},{key:"getResolution",value:function getResolution(){if(this.canvas){var _this$canvas6=this.canvas,f=_this$canvas6.width,p=_this$canvas6.height;return{width:f,height:p};}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,p){Object.defineProperty(this,"parent",{value:f,writable:!1,configurable:!0}),Object.defineProperty(this,"zOrder",{value:p,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"]=s;},/* 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),o=t(286),s=t(289),f=t(250),p=t(291),c=t(214),v=t(218),S=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(R,b){A.parent=R,Object.defineProperty(A,"zOrder",{value:b,writable:!1,configurable:!0});},A.disconnect=function(R){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,R){var b=A.children;var E=null;for(var L=0;L<b.length;L++){var D=b[L];if((R===D||E!=null)&&(E=D),E&&E!==R&&!E.offscreen)return E.canvas;}return null;}function T(A,R){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,I=A.displayRatio;A.renderer.drawImage(R.canvas,-b/I,-E/I,L/I,D/I);}var l={};function d(A){var R=["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 c["default"]("mouseleave");D.setOriginalEvent(E),_toConsumableArray(L).forEach(function(I){I.dispatchEvent(D);}),A[O].clear();}},{passive:!0}),R.forEach(function(E){b.addEventListener(E,function(L){var _A$options=A.options,D=_A$options.left,I=_A$options.top,C=_A$options.displayRatio,W=A.orderedChildren;Object(p["default"])(L,{offsetLeft:D,offsetTop:I,displayRatio:C}).forEach(function(K){var J=K.identifier;if(K.type==="touchmove"||K.type==="touchend"){var B=l[J];B&&B.dispatchEvent(K),K.type==="touchend"&&delete l[J];}else{for(var _B=W.length-1;_B>=0;_B--){var $=W[_B];if($.options.handleEvent!==!1){if($.dispatchPointerEvent(K)&&K.target!==$)break;K.cancelBubble=!1;}}if(K.target===W[0])for(var _B2=W.length-1;_B2>=0;_B2--){var _$=W[_B2];if(_$.options.handleEvent!==!1){K.target=_$;break;}}}var Z=K.target;if(K.type==="touchstart"&&(l[J]=K.target),K.type==="mousemove"){var _B3=A[O];var _$2;if(Z){var tt=Z.ancestors||[];_$2=/* @__PURE__ */new Set([Z].concat(_toConsumableArray(tt)));}else _$2=/* @__PURE__ */new Set();var Q=Object.entries(L);if(!_B3.has(Z)&&Z){var _tt2=new c["default"]("mouseenter");_tt2.setOriginalEvent(L),Q.forEach(function(_ref158){var _ref159=_slicedToArray(_ref158,2),q=_ref159[0],gt=_ref159[1];_tt2[q]=gt;}),_B3.add(Z),Z.dispatchEvent(_tt2);var ot=Z.ancestors;ot&&ot.forEach(function(q){q instanceof a["default"]&&!_B3.has(q)&&(_B3.add(q),q.dispatchEvent(_tt2));});}var et=new c["default"]("mouseleave");et.setOriginalEvent(L),Q.forEach(function(_ref160){var _ref161=_slicedToArray(_ref160,2),tt=_ref161[0],ot=_ref161[1];et[tt]=ot;}),_toConsumableArray(_B3).forEach(function(tt){_$2.has(tt)||(_B3["delete"](tt),tt.dispatchEvent(et));});}});},{passive:E!=="contextmenu"});});}function u(A,R){if(R&&R.style){var b=A.width,E=A.height,L=A.mode,D=A.container;var I=D.clientWidth,C=D.clientHeight;b=b||I,E=E||C,L==="static"?(R.style.width="".concat(b,"px"),R.style.height="".concat(E,"px")):(R.style.top="0",R.style.left="0",R.style.width="".concat(I,"px"),R.style.height="".concat(C,"px"),R.style.transform="",R.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 R=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,M);if(_this46=_callSuper(this,M),!R.container)if(typeof n.ENV.Container=="function")R.container=new n.ENV.Container(R.width||300,R.height||150);else throw new Error("No container specified.");if(_this46.container=R.container,_this46.container.style&&(_this46.container.style.overflow||(_this46.container.style.overflow="hidden"),_this46.container.style.position||(_this46.container.style.position="relative")),_this46.options=R,R.displayRatio=R.displayRatio||1,R.mode=R.mode||"scale",R.left=0,R.top=0,R.autoResize=R.autoResize!==!1,R.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(R),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(R){this.options.displayRatio!==R&&(this.options.displayRatio=R,this.resize());}},{key:"height",get:function get(){return this.options.height;},set:function set(R){this.options.height!==R&&(this.options.height=R,this.resize());}},{key:"mode",get:function get(){return this.options.mode;},set:function set(R){this.options.mode!==R&&(this.options.mode=R,this.resize());}},{key:"width",get:function get(){return this.options.width;}/* override */,set:function set(R){this.options.width!==R&&(this.options.width=R,this.resize());}},{key:"appendChild",value:function appendChild(R){!(R instanceof o["default"])&&!(R instanceof s["default"])&&x(R);var b=_get(_getPrototypeOf(M.prototype),"appendChild",this).call(this,R),E=R.canvas;return R.offscreen?this[g]++:this.container.appendChild(E),u(this.options,E),R.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(R,b){!(R instanceof o["default"])&&!(R instanceof s["default"])&&x(R);var E=_get(_getPrototypeOf(M.prototype),"insertBefore",this).call(this,R,b),L=R.canvas;if(!R.offscreen){var D=m(this,R);this.container.insertBefore(L,D);}return u(this.options,L),R.setResolution(this.getResolution()),E;}},{key:"layer",value:function layer(){var R=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=R;var E=this.orderedChildren;for(var I=0;I<E.length;I++)if(E[I].id===R)return E[I];var L=b.worker;var D;return L?D=new s["default"](b):D=new o["default"](b),this.appendChild(D),D;}},{key:"preload",value:function(){var _preload=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(){var _this48=this;var _len13,R,_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,R=new Array(_len13),_key13=0;_key13<_len13;_key13++){R[_key13]=_args12[_key13];}b=[],E=[],L=[];_loop2=/*#__PURE__*/_regeneratorRuntime().mark(function _loop2(D){var I,C,W,G;return _regeneratorRuntime().wrap(function _loop2$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:I=R[D];if(typeof I=="string")C=Object(v.loadTexture)(I);else if(Array.isArray(I))C=Object(v.loadFrames).apply(void 0,_toConsumableArray(I));else{W=I.id,G=I.src;C=Object(v.loadTexture)(G,W);}C instanceof Promise||(C=Promise.resolve(C)),E.push(C.then(function(W){b.push(W),L[D]=W;var G=new c["default"]({type:"preload",detail:{current:W,loaded:b,resources:R}});_this48.dispatchEvent(G);}));case 3:case"end":return _context11.stop();}},_loop2);});D=0;case 4:if(!(D<R.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(R){var b=_get(_getPrototypeOf(M.prototype),"removeChild",this).call(this,R);if(b){R._prepareRenderFinished&&R._prepareRenderFinished();var E=R.canvas;E&&E.remove&&E.remove(),R.offscreen&&this[g]--;}return b;}// for offscreen mode rendering
|
|
399
|
-
},{key:"render",value:function render(){var R=this.orderedChildren;var b=null;var E=[];for(var L=0;L<R.length;L++){var D=R[L],I=E.length>0;if(D instanceof o["default"]&&!D.offscreen){if(!D.autoRender)I&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);else if(b=D,I){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 s["default"]&&I&&(console.warn("Some offscreen canvas will not be rendered."),E.length=0);}}/* override */},{key:"replaceChild",value:function replaceChild(R,b){var E=_get(_getPrototypeOf(M.prototype),"replaceChild",this).call(this,R,b);b.canvas.remove&&b.canvas.remove(),b.offscreen&&this[g]--;var L=R.canvas;if(!R.offscreen){var D=m(this,R);this.container.insertBefore(L,D);}return u(this.options,L),R.setResolution(this.getResolution()),E;}},{key:"resize",value:function resize(){var R=this.options;this.children.forEach(function(b){u(R,b.canvas);}),this.setResolution(R),this.dispatchEvent({type:"resize"});}/* override */},{key:"setResolution",value:function setResolution(){var _R4,_b10;var _ref162=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},R=_ref162.width,b=_ref162.height;var E=this.container,L=E.clientWidth,D=E.clientHeight;(R==null||b==null)&&(R=(_R4=R)!==null&&_R4!==void 0?_R4:L,b=(_b10=b)!==null&&_b10!==void 0?_b10:D);var _this$options=this.options,I=_this$options.mode,C=_this$options.displayRatio;if(R*=C,b*=C,this.options.left=0,this.options.top=0,I==="stickyHeight"||I==="stickyLeft"||I==="stickyRight"){var W=R;R=L*b/D,I==="stickyHeight"&&(this.options.left=0.5*(R-W)),I==="stickyRight"&&(this.options.left=R-W);}else if(I==="stickyWidth"||I==="stickyTop"||I==="stickyBottom"){var _W4=b;b=D*R/L,I==="stickyWidth"&&(this.options.top=0.5*(b-_W4)),I==="stickyBottom"&&(this.options.top=b-_W4);}_get(_getPrototypeOf(M.prototype),"setResolution",this).call(this,{width:R,height:b});}},{key:"snapshot",value:function snapshot(){var _ref163=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref163$offscreen=_ref163.offscreen,R=_ref163$offscreen===void 0?!1:_ref163$offscreen,b=_ref163.layers;var E=R?"snapshotOffScreenCanvas":"snapshotCanvas",_this$getResolution9=this.getResolution(),L=_this$getResolution9.width,D=_this$getResolution9.height;this[E]=this[E]||n.ENV.createCanvas(L,D,{offscreen:R});var I=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 G=W.canvas;G&&G!==W&&I.drawImage(G,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 R=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var b=R.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,R));}catch(I){L(I);}},document.documentElement.appendChild(D);});}),S["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,o=_ref164$offsetLeft===void 0?0:_ref164$offsetLeft,_ref164$displayRatio=_ref164.displayRatio,s=_ref164$displayRatio===void 0?1:_ref164$displayRatio;var f,p;var c=[],_i$target$getBounding=i.target.getBoundingClientRect(),v=_i$target$getBounding.left,S=_i$target$getBounding.top,O=_i$target$getBounding.width,x=_i$target$getBounding.height,m=i.target.width,T=i.target.height,l=i.changedTouches||[i];for(var u=0;u<l.length;u++){var g=l[u],M=g.identifier,A=g.clientX,R=g.clientY;A!=null&&R!=null&&c.push({x:Math.round((A|0)-v),y:Math.round((R|0)-S),identifier:M});}c.length<=0&&c.push({x:f,y:p});var d=[];return c.forEach(function(u){u.x!=null&&u.y!=null&&(f=(u.x*m/O-o)/s,p=(u.y*T/x-a)/s);var g=new e["default"](i);Object.defineProperties(g,{layerX:{value:f,configurable:!0},layerY:{value:p,configurable:!0},originalX:{value:u.x},originalY:{value:u.y},x:{value:f,configurable:!0},y:{value:p,configurable:!0},identifier:{value:u.identifier}}),d.push(g);}),d;}}/******/]);Dt.version;Dt.Arc;Dt.Block;Dt.Cloud;Dt.Color;var Vh=Dt.Ellipse;Dt.Gradient;var ne=Dt.Group,Yh=Dt.Label;Dt.Layer;Dt.LayerWorker;Dt.Node;Dt.Parallel;var he=Dt.Path,ce=Dt.Polyline,or=Dt.Rect;Dt.Regular;Dt.Ring;var Xh=Dt.Scene,Jh=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,o=t-1;a<o;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 yr={exports:{}};yr.exports;(function(h){var r=function(){var t=String.fromCharCode,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={};function a(s,f){if(!i[s]){i[s]={};for(var p=0;p<s.length;p++)i[s][s.charAt(p)]=p;}return i[s][f];}var o={compressToBase64:function compressToBase64(s){if(s==null)return"";var f=o._compress(s,6,function(p){return e.charAt(p);});switch(f.length%4){default:case 0:return f;case 1:return f+"===";case 2:return f+"==";case 3:return f+"=";}},decompressFromBase64:function decompressFromBase64(s){return s==null?"":s==""?null:o._decompress(s.length,32,function(f){return a(e,s.charAt(f));});},compressToUTF16:function compressToUTF16(s){return s==null?"":o._compress(s,15,function(f){return t(f+32);})+" ";},decompressFromUTF16:function decompressFromUTF16(s){return s==null?"":s==""?null:o._decompress(s.length,16384,function(f){return s.charCodeAt(f)-32;});},//compress into uint8array (UCS-2 big endian format)
|
|
400
|
-
compressToUint8Array:function compressToUint8Array(s){for(var f=o.compress(s),p=new Uint8Array(f.length*2),c=0,v=f.length;c<v;c++){var S=f.charCodeAt(c);p[c*2]=S>>>8,p[c*2+1]=S%256;}return p;},//decompress from uint8array (UCS-2 big endian format)
|
|
401
|
-
decompressFromUint8Array:function decompressFromUint8Array(s){if(s==null)return o.decompress(s);for(var f=new Array(s.length/2),p=0,c=f.length;p<c;p++)f[p]=s[p*2]*256+s[p*2+1];var v=[];return f.forEach(function(S){v.push(t(S));}),o.decompress(v.join(""));},//compress into a string that is already URI encoded
|
|
402
|
-
compressToEncodedURIComponent:function compressToEncodedURIComponent(s){return s==null?"":o._compress(s,6,function(f){return n.charAt(f);});},//decompress from an output of compressToEncodedURIComponent
|
|
403
|
-
decompressFromEncodedURIComponent:function decompressFromEncodedURIComponent(s){return s==null?"":s==""?null:(s=s.replace(/ /g,"+"),o._decompress(s.length,32,function(f){return a(n,s.charAt(f));}));},compress:function compress(s){return o._compress(s,16,function(f){return t(f);});},_compress:function _compress(s,f,p){if(s==null)return"";var c,v,S={},O={},x="",m="",T="",l=2,d=3,u=2,g=[],M=0,A=0,R;for(R=0;R<s.length;R+=1)if(x=s.charAt(R),Object.prototype.hasOwnProperty.call(S,x)||(S[x]=d++,O[x]=!0),m=T+x,Object.prototype.hasOwnProperty.call(S,m))T=m;else{if(Object.prototype.hasOwnProperty.call(O,T)){if(T.charCodeAt(0)<256){for(c=0;c<u;c++)M=M<<1,A==f-1?(A=0,g.push(p(M)),M=0):A++;for(v=T.charCodeAt(0),c=0;c<8;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;}else{for(v=1,c=0;c<u;c++)M=M<<1|v,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=0;for(v=T.charCodeAt(0),c=0;c<16;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;}l--,l==0&&(l=Math.pow(2,u),u++),delete O[T];}else for(v=S[T],c=0;c<u;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;l--,l==0&&(l=Math.pow(2,u),u++),S[m]=d++,T=String(x);}if(T!==""){if(Object.prototype.hasOwnProperty.call(O,T)){if(T.charCodeAt(0)<256){for(c=0;c<u;c++)M=M<<1,A==f-1?(A=0,g.push(p(M)),M=0):A++;for(v=T.charCodeAt(0),c=0;c<8;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;}else{for(v=1,c=0;c<u;c++)M=M<<1|v,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=0;for(v=T.charCodeAt(0),c=0;c<16;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;}l--,l==0&&(l=Math.pow(2,u),u++),delete O[T];}else for(v=S[T],c=0;c<u;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;l--,l==0&&(l=Math.pow(2,u),u++);}for(v=2,c=0;c<u;c++)M=M<<1|v&1,A==f-1?(A=0,g.push(p(M)),M=0):A++,v=v>>1;for(;;)if(M=M<<1,A==f-1){g.push(p(M));break;}else A++;return g.join("");},decompress:function decompress(s){return s==null?"":s==""?null:o._decompress(s.length,32768,function(f){return s.charCodeAt(f);});},_decompress:function _decompress(s,f,p){var c=[],v=4,S=4,O=3,x="",m=[],T,l,d,u,g,M,A,R={val:p(0),position:f,index:1};for(T=0;T<3;T+=1)c[T]=T;for(d=0,g=Math.pow(2,2),M=1;M!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.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=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.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=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.index++)),d|=(u>0?1:0)*M,M<<=1;A=t(d);break;case 2:return"";}for(c[3]=A,l=A,m.push(A);;){if(R.index>s)return"";for(d=0,g=Math.pow(2,O),M=1;M!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.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=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.index++)),d|=(u>0?1:0)*M,M<<=1;c[S++]=t(d),A=S-1,v--;break;case 1:for(d=0,g=Math.pow(2,16),M=1;M!=g;)u=R.val&R.position,R.position>>=1,R.position==0&&(R.position=f,R.val=p(R.index++)),d|=(u>0?1:0)*M,M<<=1;c[S++]=t(d),A=S-1,v--;break;case 2:return m.join("");}if(v==0&&(v=Math.pow(2,O),O++),c[A])x=c[A];else if(A===S)x=l+l.charAt(0);else return null;m.push(x),c[S++]=l+x.charAt(0),v--,l=x,v==0&&(v=Math.pow(2,O),O++);}}};return o;}();h!=null?h.exports=r:(typeof angular==="undefined"?"undefined":_typeof(angular))<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return r;});})(yr);var jn=yr.exports;function Le(h){return JSON.parse(jn.decompress(h));}function qt(h){return jn.compress(JSON.stringify(h));}var Un=/*#__PURE__*/function(_yt){function Un(t){var _this50;_classCallCheck(this,Un);_this50=_callSuper(this,Un,[t]);nt(_this50,"canRotate",!0);nt(_this50,"scaleType",$t.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(Un,_yt);return _createClass(Un,[{key:"combineConsume",value:function combineConsume(){var o;var t=(o=this.workId)==null?void 0:o.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:Mt.Local};}},{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 _this51=this;var l;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=t.drawCount,s=t.replaceId;if(((l=e.op)==null?void 0:l.length)===0)return{type:ct.None};var f=e.workId,_this$transformData=this.transformData(e,!1),p=_this$transformData.tasks,c=_this$transformData.effects,v=_this$transformData.consumeIndex;this.syncIndex=Math.min(this.syncIndex,v,Math.max(0,this.tmpPoints.length-2));var S={name:f==null?void 0:f.toString(),id:o==null?void 0:o.toString()};var O,x=!1;var m=this.syncIndex;if(this.syncTimestamp===0&&(this.syncTimestamp=Date.now()),p.length&&(p[0].taskId-this.syncTimestamp>this.syncUnitTime&&(x=!0,this.syncTimestamp=p[0].taskId,this.syncIndex=this.tmpPoints.length),i||a)){var d=n?this.fullLayer:this.drawLayer||this.fullLayer;O=this.draw({attrs:S,tasks:p,effects:c,layer:d,replaceId:s});}if(i)return v>10&&this.tmpPoints.splice(0,v-10),{rect:O,type:ct.DrawWork,dataType:Mt.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:Mt.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 p,c;if(t.data){var _t$data=t.data,v=_t$data.op,S=_t$data.workState;v!=null&&v.length&&S===Rt.Done&&this.workOptions.strokeType===Vt.Stroke&&this.updateTempPointsWithPressureWhenDone(v);}var e=(p=this.workId)==null?void 0:p.toString();if(!e)return{type:ct.None};var n=this.transformDataAll(!0),i={name:e};var a;var o=this.fullLayer;n.length&&(a=this.draw({attrs:i,tasks:n,replaceId:e,layer:o}));var s=[];this.tmpPoints.map(function(v){s.push(v.x,v.y,_this52.computRadius(v.z,_this52.workOptions.thickness));}),this.syncTimestamp=0,delete this.workOptions.syncUnitTime;var f=qt(s);return(c=this.vNodes)==null||c.setInfo(e,{rect:a,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,o)}),{rect:a,type:ct.FullWork,dataType:Mt.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 p,c;var e=t.op,n=t.isFullWork,i=t.replaceId;this.tmpPoints.length=0;for(var v=0;v<e.length;v+=3){var S=new Tt(e[v],e[v+1],e[v+2]);if(this.tmpPoints.length>0){var O=this.tmpPoints[this.tmpPoints.length-1],x=_.Sub(S,O).uni();S.setv(x);}this.tmpPoints.push(S);}var a=this.transformDataAll(!1),o=(p=this.workId)==null?void 0:p.toString(),s={name:o};var f;if(o&&a.length){var _v2=n?this.fullLayer:this.drawLayer||this.fullLayer;f=this.draw({attrs:s,tasks:a,replaceId:i,layer:_v2}),(c=this.vNodes)==null||c.setInfo(o,{rect:f,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&yt.getCenterPos(f,_v2)});}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,o=t.layer,_this$workOptions=this.workOptions,s=_this$workOptions.strokeColor,f=_this$workOptions.strokeType,p=_this$workOptions.thickness,c=_this$workOptions.zIndex,v=_this$workOptions.scale,S=_this$workOptions.rotate,O=_this$workOptions.translate;a!=null&&a.size&&(a.forEach(function(u){var g;(g=o.getElementById(u+""))==null||g.remove();}),a.clear());var x;var m=[],T=o.worldPosition,l=o.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,R=_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?s:void 0,lineDash:f===Vt.Dotted&&!E?[1,p*2]:f===Vt.LongDotted&&!E?[p,p*2]:void 0,strokeColor:s,lineCap:f===Vt.Stroke||E?void 0:"round",lineWidth:f===Vt.Stroke||E?0:p};x=Ot(x,{x:Math.floor((R.x+g[0])*l[0]+T[0]-yt.SafeBorderPadding),y:Math.floor((R.y+g[1])*l[1]+T[1]-yt.SafeBorderPadding),w:Math.floor(R.w*l[0]+2*yt.SafeBorderPadding),h:Math.floor(R.h*l[1]+2*yt.SafeBorderPadding)}),m.push(L);}v&&(e.scale=v),S&&(e.rotate=S),O&&(e.translate=O);var d=new ne();if(x){this.centerPos=yt.getCenterPos(x,o),d.attr(_objectSpread(_objectSpread({},e),{},{normalize:!0,anchor:[0.5,0.5],bgcolor:f===Vt.Stroke?s:void 0,pos:this.centerPos,size:[(x.w-2*yt.SafeBorderPadding)/l[0],(x.h-2*yt.SafeBorderPadding)/l[1]],zIndex:c}));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(o,i||e.workId,d);}if(v||S||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:Wt(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],p=_t$f.point,c=_t$f.radius;var v=p.v;f===0&&t.length>1&&(v=t[f+1].point.v);var S=_.Per(v).mul(c);e.push(Tt.Sub(p,S)),n.push(Tt.Add(p,S));}var i=t[t.length-1],a=Tt.GetSemicircleStroke(i.point,e[e.length-1],-1,8),o=Tt.GetSemicircleStroke(t[0].point,n[0],-1,8),s=e.concat(a,n.reverse(),o);return{ps:s,rect:Wt(s)};}},{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:Tt.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,o=[];if(n!=null&&n.length&&i){var _this$workOptions2=this.workOptions,s=_this$workOptions2.strokeType,f=_this$workOptions2.thickness,p=/* @__PURE__ */new Set();a=s===Vt.Stroke?this.updateTempPointsWithPressure(n,f,p):this.updateTempPoints(n,f,p);var c=e?this.tmpPoints:this.tmpPoints.slice(a);return o=this.getTaskPoints(c,f),{tasks:o,effects:p,consumeIndex:a};}return{tasks:o,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 c;var n=[];if(t.length===0)return[];var i=0,a=t[0].x,o=t[0].y,s=[a,o],f=[],p=t[0].t;for(;i<t.length;){var v=t[i],S=v.x-a,O=v.y-o,x=v.z,m=e?this.computRadius(x,e):x;if(f.push({point:new Tt(S,O,x,t[i].v),radius:m}),i>0&&i<t.length-1){var _T34=t[i].getAngleByPoints(t[i-1],t[i+1]);if(_T34<90||_T34>270){var _l28=(c=f.pop())==null?void 0:c.point.clone();_l28&&n.push({taskId:p,pos:s,points:[].concat(_toConsumableArray(f),[{point:_l28,radius:m}])}),a=t[i].x,o=t[i].y,s=[a,o];var d=v.x-a,u=v.y-o;f=[{point:new Tt(d,u,x),radius:m}],p=Date.now();}}i++;}return n.push({taskId:p,pos:s,points:f}),n;}},{key:"updateTempPointsWithPressure",value:function updateTempPointsWithPressure(t,e,n){var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var f=0;f<t.length;f+=2){o=Math.min(o,a);var p=this.tmpPoints.length,c=new Tt(t[f],t[f+1]);if(p===0){this.tmpPoints.push(c);continue;}var v=p-1,S=this.tmpPoints[v],O=_.Sub(c,S).uni();if(c.isNear(S,e)){if(S.z<this.MAX_REPEAR){if(S.setz(Math.min(S.z+1,this.MAX_REPEAR)),o=Math.min(o,v),p>1){var _T35=p-1;for(;_T35>0;){var _l29=this.tmpPoints[_T35].distance(this.tmpPoints[_T35-1]),d=Math.max(this.tmpPoints[_T35].z-this.uniThickness*_l29,0);if(this.tmpPoints[_T35-1].z>=d)break;this.tmpPoints[_T35-1].setz(d),o=Math.min(o,_T35-1),_T35--;}}}else o=1/0;continue;}c.setv(O);var x=c.distance(S),m=Math.max(S.z-this.uniThickness*x,0);p>1&&_.Equals(O,S.v,0.02)&&(m>0||S.z<=0)&&(n&&S.t&&n.add(S.t),this.tmpPoints.pop(),o=Math.min(v,o)),c.setz(m),this.tmpPoints.push(c);}if(o===1/0)return this.tmpPoints.length;var s=a;if(o===a){s=Math.max(s-1,0);var _f3=this.tmpPoints[s].t;_f3&&(n==null||n.add(_f3));}else{var _f4=a-1;for(s=o;_f4>=0;){var _p3=this.tmpPoints[_f4].t;if(_p3&&(n==null||n.add(_p3),_f4<=o)){s=_f4,_f4=-1;break;}_f4--;}}return this.tmpPoints[s].setT(i),s;}},{key:"updateTempPoints",value:function updateTempPoints(t,e,n){var f;var i=Date.now(),a=this.tmpPoints.length;var o=a;for(var p=0;p<t.length;p+=2){var c=this.tmpPoints.length,v=new Tt(t[p],t[p+1]);if(c===0){this.tmpPoints.push(v);continue;}var S=c-1,O=this.tmpPoints[S],x=_.Sub(v,O).uni();if(v.isNear(O,e/2)){o=Math.min(S,o);continue;}_.Equals(x,O.v,0.02)&&(n&&O.t&&n.add(O.t),this.tmpPoints.pop(),o=Math.min(S,o)),v.setv(x),this.tmpPoints.push(v);}var s=a;if(o===a){s=Math.max(s-1,0);var _p4=this.tmpPoints[s].t;_p4&&(n==null||n.add(_p4));}else{var _p5=Math.min(a-1,o);for(s=o;_p5>=0;){var _c4=(f=this.tmpPoints[_p5])==null?void 0:f.t;if(_c4&&(n==null||n.add(_c4),_p5<=o)){s=_p5,_p5=-1;break;}_p5--;}}return this.tmpPoints[s].setT(i),s;}},{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 o=this.tmpPoints.length,s=new Tt(t[a],t[a+1]);if(o===0){this.tmpPoints.push(s);continue;}var f=o-1,p=this.tmpPoints[f],c=_.Sub(s,p).uni(),v=s.distance(p);if(o>1&&p.z===i)break;if(s.isNear(p,e/2)){if(n<3&&p.z<this.MAX_REPEAR&&(p.setz(Math.min(p.z+1,this.MAX_REPEAR)),o>1)){var O=o-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;}s.setv(c);var S=Math.max(p.z-this.uniThickness*v,i);o>1&&_.Equals(c,p.v,0.02)&&p.z<=0&&this.tmpPoints.pop(),s.setz(S),this.tmpPoints.push(s);}}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var s;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=i.get(e.name);return a&&(e.tagName==="GROUP"?jh(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)),(s=o==null?void 0:o.opt)!=null&&s.strokeColor&&(o.opt.strokeColor=a)),o&&i.setInfo(e.name,o),yt.updateNodeOpt(t);}}]);}(yt);var zn=/*#__PURE__*/function(_yt2){function zn(t){var _this54;_classCallCheck(this,zn);_this54=_callSuper(this,zn,[t]);nt(_this54,"toolsType",ht.LaserPen);nt(_this54,"canRotate",!1);nt(_this54,"scaleType",$t.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(zn,_yt2);return _createClass(zn,[{key:"combineConsume",value:function combineConsume(){}},{key:"setWorkOptions",value:function setWorkOptions(t){_get(_getPrototypeOf(zn.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,o=_this$workOptions3.strokeColor,s=_this$workOptions3.thickness,f=_this$workOptions3.strokeType,p=Wt(this.tmpPoints,s);var c=!1;var v=this.syncIndex,S=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,s*2]:f===Vt.LongDotted?[s,s*2]:void 0,strokeColor:o,lineCap:"round",lineWidth:s,anchor:[0.5,0.5]},x=this.getTaskPoints(S);if(x.length){var _T36=Date.now();_T36-this.syncTimestamp>this.syncUnitTime&&(c=!0,this.syncTimestamp=_T36,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(v).forEach(function(T){m.push(T.x,T.y);}),{rect:{x:p.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:p.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:p.w*this.fullLayer.worldScaling[0],h:p.h*this.fullLayer.worldScaling[1]},type:ct.DrawWork,dataType:Mt.Local,workId:c?i:void 0,op:c?m:void 0,index:c?v*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 o=this.tmpPoints.slice(this.consumeIndex);var s=o.length===1,_this$workOptions4=this.workOptions,f=_this$workOptions4.strokeColor,p=_this$workOptions4.thickness,c=_this$workOptions4.strokeType;if(s){var O=this.computDotStroke({point:o[0],radius:p/2});o=O.ps,e=O.rect;}else e=Wt(this.tmpPoints,p);var v={name:t==null?void 0:t.toString(),fillColor:s?f:void 0,opacity:1,lineDash:c===Vt.Dotted&&!s?[1,p*2]:c===Vt.LongDotted&&!s?[p,p*2]:void 0,strokeColor:f,lineCap:s?void 0:"round",lineWidth:s?0:p,anchor:[0.5,0.5]},S=this.getTaskPoints(o);S.length&&this.draw({attrs:v,tasks:S,isDot:s,layer:this.drawLayer||this.fullLayer});}var n=[];this.tmpPoints.forEach(function(o){n.push(o.x,o.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:Mt.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,o=_this$workOptions5.thickness,s=_this$workOptions5.strokeType;if(!e.length){var m=Wt(this.tmpPoints,o);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 p,c=this.tmpPoints.slice(f);var v=c.length===1;if(v){var _m6=this.computDotStroke({point:c[0],radius:o/2});c=_m6.ps,p=_m6.rect;}else p=Wt(this.tmpPoints,o);var S={name:(x=this.workId)==null?void 0:x.toString(),fillColor:v?a:void 0,opacity:1,lineDash:s===Vt.Dotted&&!v?[1,o*2]:s===Vt.LongDotted&&!v?[o,o*2]:void 0,strokeColor:a,lineCap:v?void 0:"round",lineWidth:v?0:o,anchor:[0.5,0.5]},O=this.getTaskPoints(c);if(O.length){var _m7=i?this.fullLayer:this.drawLayer||this.fullLayer;this.draw({attrs:S,tasks:O,isDot:v,replaceId:n,layer:_m7});}return{x:p.x*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],y:p.y*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1],w:p.w*this.fullLayer.worldScaling[0],h:p.h*this.fullLayer.worldScaling[1]};}},{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:Tt.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 Tt(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,o,_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,o=this.workOptions.duration;_iterator2=_createForOfIteratorHelper(n);_context14.prev=2;_loop3=/*#__PURE__*/_regeneratorRuntime().mark(function _loop3(){var s,f,p,c,v,_this55$workOptions,S,O,x,_a$getResolution,m,_T37;return _regeneratorRuntime().wrap(function _loop3$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:s=_step2.value;f=new he(),p=s.pos,c=s.points;i?v=me(c,!0):v=me(c,!1),f.attr(_objectSpread(_objectSpread({},e),{},{pos:p,d:v}));_this55$workOptions=_this55.workOptions,S=_this55$workOptions.vertex,O=_this55$workOptions.fragment;if(S&&O){x=a.renderer.createProgram({vertex:S,fragment:O}),_a$getResolution=a.getResolution(),m=_a$getResolution.width,_T37=_a$getResolution.height;f.setUniforms({u_time:0,u_resolution:[m,_T37]}),f.setProgram(x);}a.appendChild(f),f.transition(o).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,o=[i,a],s=[];for(;n<t.length;){var p=t[n],c=p.x-i,v=p.y-a;if(s.push(new Tt(c,v)),n>0&&n<t.length-1){var S=t[n].getAngleByPoints(t[n-1],t[n+1]);if(S<90||S>270){var O=(f=s.pop())==null?void 0:f.clone();O&&e.push({pos:o,points:[].concat(_toConsumableArray(s),[O])}),i=t[n].x,a=t[n].y,o=[i,a];var x=p.x-i,m=p.y-a;s=[new Tt(x,m)];}}n++;}return e.push({pos:o,points:s}),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 Qh=Ue;Ue.polyline=Ue;Ue.polygon=Zh;function Ue(h,r,t){var e=h.length,n=pe(h[0],r),i=[],a,o,s,f,p;for(t||(t=[]),a=1;a<e;a++){for(o=h[a-1],s=h[a],f=p=pe(s,r);;)if(n|f){if(n&f)break;n?(o=ar(o,s,n,r),n=pe(o,r)):(s=ar(o,s,f,r),f=pe(s,r));}else{i.push(o),f!==p?(i.push(s),a<e-1&&(t.push(i),i=[])):a===e-1&&i.push(s);break;}n=p;}return i.length&&t.push(i),t;}function Zh(h,r){var t,e,n,i,a,o,s;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++)o=h[a],s=!(pe(o,r)&e),s!==i&&t.push(ar(n,o,e,r)),s&&t.push(o),n=o,i=s;if(h=t,!h.length)break;}return t;}function ar(h,r,t,e){return t&8?[h[0]+(r[0]-h[0])*(e[3]-h[1])/(r[1]-h[1]),e[3]]:// top
|
|
404
|
-
t&4?[h[0]+(r[0]-h[0])*(e[1]-h[1])/(r[1]-h[1]),e[1]]:// bottom
|
|
405
|
-
t&2?[e[2],h[1]+(r[1]-h[1])*(e[2]-h[0])/(r[0]-h[0])]:// right
|
|
406
|
-
t&1?[e[0],h[1]+(r[1]-h[1])*(e[0]-h[0])/(r[0]-h[0])]:// left
|
|
407
|
-
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 kh=/* @__PURE__ */ye(Qh);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",$t.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],o=_ve$eraserSizes$this$2.width,s=_ve$eraserSizes$this$2.height,f=Math.min(o,s),p=Math.round(a/f);if(p>1){var c=[];for(var v=0;v<p;v++){var S=_.Mul(i,v*f);c.push(this.tmpPoints[0]+S.x,this.tmpPoints[1]+S.y);}return c.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,o=_ve$eraserSizes$this$3.height;return _.Dist(n,i)<Math.hypot(a,o)*0.5;}},{key:"cutPolyline",value:function cutPolyline(t,e){var n=[e],i=0;for(;i<t.length;){var s=t[i];if(s.length<2)break;n=a(n,s),i++;}return n;function a(s,f){var p=s;var _loop4=function _loop4(){var v=s[c],S=v.findIndex(function(O,x){return x<v.length-1?o([O,v[x+1]],[f[0],f[1]]):!1;});if(S!==-1&&S>-1){var O=[],x=v.slice(0,S+1);if(_.Equals(v[S],f[0])||x.push(f[0].clone().setz(v[S].z)),x.length>1&&O.push(x),S+f.length-1<v.length-1){var m=S+f.length-1,_T38=v.slice(m),_l30=f[f.length-1];_.Equals(v[m],_l30)||_T38.unshift(_l30.clone().setz(v[m].z)),_T38.length>1&&O.push(_T38);}return{v:(p.splice.apply(p,[c,1].concat(O)),p)};}},_ret;for(var c=0;c<s.length;c++){_ret=_loop4();if(_ret)return _ret.v;}return p;}function o(s,f){var p=_.Sub(s[1],s[0]),c=_.Sub(f[1],f[0]),v=_.Sub(f[0],s[0]);return Math.abs(_.Cpr(p,c))<0.1&&Math.abs(_.Cpr(p,v))<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(s,f,p){return!(f>0&&_this57.isSamePoint(s,p[f-1]));}),a=[];var o=0;for(;o<i.length;){var s=i[o],f=new _(s[0],s[1]);a.push(f),o++;}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 o;var _iterator3=_createForOfIteratorHelper(e.entries()),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),s=_step3$value[0],f=_step3$value[1];if(f.rect&&this.eraserRect&&this.eraserPolyline&&Re(this.eraserRect,f.rect)){var p=f.op,c=f.toolsType,v=this.isLineEraser(c,a),S=[],O=[];for(var m=0;m<p.length;m+=3){var _T39=new _(p[m]*this.worldScaling[0]+this.worldPosition[0],p[m+1]*this.worldScaling[1]+this.worldPosition[1],p[m+2]);O.push(_T39),S.push(new Tt(_T39.x,_T39.y));}var x=S.length&&Wt(S)||f.rect;if(Re(x,this.eraserRect)){if(O.length>1){var _m8=kh.polyline(O.map(function(T){return T.XY;}),this.eraserPolyline);if(_m8.length&&(n.add(f.name),!v)){var _T40=this.translateIntersect(_m8),_l31=this.cutPolyline(_T40,O);var _loop5=function _loop5(){var u="".concat(s,"_s_").concat(d),g=[];_l31[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<_l31.length;d++){_loop5();}}}else n.add(f.name);o=Ot(o,x);}}}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}return n.forEach(function(s){var f;return(f=_this58.vNodes)==null?void 0:f["delete"](s);}),o&&(o.x-=yt.SafeBorderPadding,o.y-=yt.SafeBorderPadding,o.w+=yt.SafeBorderPadding*2,o.h+=yt.SafeBorderPadding*2),o;}},{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 o=/* @__PURE__ */new Set(),s=/* @__PURE__ */new Map();if(!this.vNodes)return{type:ct.None};this.vNodes.setTarget();var f=this.getUnLockNodeMap(this.vNodes.getLastTarget());for(var p=0;p<i.length-1;p+=2){this.createEraserRect(i.slice(p,p+2));var c=this.remove({curNodeMap:f,removeIds:o,newWorkDatas:s});a=Ot(a,c);}if(this.vNodes.deleteLastTarget(),a&&o.size){var _iterator4=_createForOfIteratorHelper(s.keys()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _p6=_step4.value;o.has(_p6)&&s["delete"](_p6);}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}return{type:ct.RemoveNode,dataType:Mt.Local,rect:a,removeIds:_toConsumableArray(o),newWorkDatas:s};}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=Jt(t),i=this.serviceWork.selectorWorkShapes,a=this.serviceWork.workShapes;var _iterator5=_createForOfIteratorHelper(i.values()),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var o=_step5.value;if((e=o.selectIds)!=null&&e.length){var _iterator7=_createForOfIteratorHelper(o.selectIds),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var s=_step7.value;n["delete"](s);}}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 _o3=_step6.value;n["delete"](_o3);}}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 Sr="++",qh="selector",_h="all";var td="__lodash_hash_undefined__";function ed(h){return this.__data__.set(h,td),this;}var rd=ed;function nd(h){return this.__data__.has(h);}var id=nd,sd=dn,od=rd,ad=id;function ze(h){var r=-1,t=h==null?0:h.length;for(this.__data__=new sd();++r<t;)this.add(h[r]);}ze.prototype.add=ze.prototype.push=od;ze.prototype.has=ad;var ld=ze;function cd(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 fd=cd;function ud(h,r){return h.has(r);}var hd=ud,dd=ld,gd=fd,pd=hd,vd=1,md=2;function yd(h,r,t,e,n,i){var a=t&vd,o=h.length,s=r.length;if(o!=s&&!(a&&s>o))return!1;var f=i.get(h),p=i.get(r);if(f&&p)return f==r&&p==h;var c=-1,v=!0,S=t&md?new dd():void 0;for(i.set(h,r),i.set(r,h);++c<o;){var O=h[c],x=r[c];if(e)var m=a?e(x,O,c,r,h,i):e(O,x,c,h,r,i);if(m!==void 0){if(m)continue;v=!1;break;}if(S){if(!gd(r,function(T,l){if(!pd(S,l)&&(O===T||n(O,T,t,e,i)))return S.push(l);})){v=!1;break;}}else if(!(O===x||n(O,x,t,e,i))){v=!1;break;}}return i["delete"](h),i["delete"](r),v;}var $n=yd;function Sd(h){var r=-1,t=Array(h.size);return h.forEach(function(e,n){t[++r]=[n,e];}),t;}var xd=Sd;function Td(h){var r=-1,t=Array(h.size);return h.forEach(function(e){t[++r]=e;}),t;}var Md=Td,Jr=Ke,Qr=Ln,Od=lr,Ed=$n,Pd=xd,Ad=Md,Cd=1,Rd=2,Id="[object Boolean]",Ld="[object Date]",bd="[object Error]",Dd="[object Map]",wd="[object Number]",Nd="[object RegExp]",Wd="[object Set]",Bd="[object String]",Fd="[object Symbol]",jd="[object ArrayBuffer]",Ud="[object DataView]",Zr=Jr?Jr.prototype:void 0,qe=Zr?Zr.valueOf:void 0;function zd(h,r,t,e,n,i,a){switch(t){case Ud:if(h.byteLength!=r.byteLength||h.byteOffset!=r.byteOffset)return!1;h=h.buffer,r=r.buffer;case jd:return!(h.byteLength!=r.byteLength||!i(new Qr(h),new Qr(r)));case Id:case Ld:case wd:return Od(+h,+r);case bd:return h.name==r.name&&h.message==r.message;case Nd:case Bd:return h==r+"";case Dd:var o=Pd;case Wd:var s=e&Cd;if(o||(o=Ad),h.size!=r.size&&!s)return!1;var f=a.get(h);if(f)return f==r;e|=Rd,a.set(h,r);var p=Ed(o(h),o(r),e,n,i,a);return a["delete"](h),p;case Fd:if(qe)return qe.call(h)==qe.call(r);}return!1;}var $d=zd,kr=Rn,Gd=1,Hd=Object.prototype,Kd=Hd.hasOwnProperty;function Vd(h,r,t,e,n,i){var a=t&Gd,o=kr(h),s=o.length,f=kr(r),p=f.length;if(s!=p&&!a)return!1;for(var c=s;c--;){var v=o[c];if(!(a?v in r:Kd.call(r,v)))return!1;}var S=i.get(h),O=i.get(r);if(S&&O)return S==r&&O==h;var x=!0;i.set(h,r),i.set(r,h);for(var m=a;++c<s;){v=o[c];var T=h[v],l=r[v];if(e)var d=a?e(l,T,v,r,h,i):e(T,l,v,h,r,i);if(!(d===void 0?T===l||n(T,l,t,e,i):d)){x=!1;break;}m||(m=v=="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 Yd=Vd,_e=gn,Xd=$n,Jd=$d,Qd=Yd,qr=Qe,_r=Je,tn=fr,Zd=Sn,kd=1,en="[object Arguments]",rn="[object Array]",we="[object Object]",qd=Object.prototype,nn=qd.hasOwnProperty;function _d(h,r,t,e,n,i){var a=_r(h),o=_r(r),s=a?rn:qr(h),f=o?rn:qr(r);s=s==en?we:s,f=f==en?we:f;var p=s==we,c=f==we,v=s==f;if(v&&tn(h)){if(!tn(r))return!1;a=!0,p=!1;}if(v&&!p)return i||(i=new _e()),a||Zd(h)?Xd(h,r,t,e,n,i):Jd(h,r,s,t,e,n,i);if(!(t&kd)){var S=p&&nn.call(h,"__wrapped__"),O=c&&nn.call(r,"__wrapped__");if(S||O){var x=S?h.value():h,m=O?r.value():r;return i||(i=new _e()),n(x,m,t,e,i);}}return v?(i||(i=new _e()),Qd(h,r,t,e,n,i)):!1;}var t0=_d,e0=t0,sn=re;function Gn(h,r,t,e,n){return h===r?!0:h==null||r==null||!sn(h)&&!sn(r)?h!==h&&r!==r:e0(h,r,t,e,Gn,n);}var r0=Gn,n0=r0;function i0(h,r){return n0(h,r);}var s0=i0,oe=/* @__PURE__ */ye(s0);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",$t.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=Wt(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 Tt(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,o=t.isService,s=new ne({pos:[e.x,e.y],anchor:[0,0],size:[e.w,e.h],id:i,name:i,zIndex:1e3}),f=[];if(o){var p=new or({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(p);}n.forEach(function(p,c){var v=[p.rect.x+p.rect.w/2-e.x,p.rect.y+p.rect.h/2-e.y],S=new or({normalize:!0,pos:v,lineWidth:1,strokeColor:n.size>1?_this60.selectorColor||_this60.workOptions.strokeColor:void 0,width:p.rect.w,height:p.rect.h,id:"selector-".concat(c),name:"selector-".concat(c)});f.push(S);}),f&&s.append.apply(s,f),(a==null?void 0:a.parent).appendChild(s);}},{key:"draw",value:function draw(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var s,f;var a=n.intersectRect,o=n.subNodeMap;(f=(s=e.parent)==null?void 0:s.getElementById(t))==null||f.remove(),a&&this.drawSelector({drawRect:a,subNodeMap:o,selectorId:t,layer:e,isService:i});}},{key:"getSelecteorInfo",value:function getSelecteorInfo(t){this.scaleType=$t.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,o=i.canRotate,s=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=o,this.scaleType=s),s===$t.none&&(this.scaleType=s),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=$t.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===$t.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 o=0;o<i.length;o+=3)a.push([i[o],i[o+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 o=a.intersectRect;this.getSelecteorInfo(a.subNodeMap),this.draw(ee.selectorId,this.fullLayer,a),this.oldSelectRect=o;var s=this.getChildrenPoints();return{type:ct.Select,dataType:Mt.Local,rect:Ot(o,i),selectIds:a.selectIds,opt:this.workOptions,selectRect:o,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:s,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:Mt.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 o;var _this$vNodes$getRectI2=this.vNodes.getRectIntersectRange({x:i,y:a,w:0,h:0},!1),s=_this$vNodes$getRectI2.nodeRange,f=_toConsumableArray(s.values()).sort(function(p,c){return(c.opt.zIndex||0)-(p.opt.zIndex||0);});var _iterator9=_createForOfIteratorHelper(f),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _p7=_step9.value;var _c5=this.fullLayer.getElementsByName(_p7.name);if(kn(_c5).find(function(S){return S.isPointCollision(i,a);})){o=_p7;break;}}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}if(o){var p=o.name;if(!oe(this.oldSelectRect,o.rect)){var c=/* @__PURE__ */new Map([[p,o]]);this.getSelecteorInfo(c),this.draw(e,this.fullLayer,{intersectRect:o.rect,subNodeMap:c,selectIds:this.selectIds||[]},n);}this.selectIds=[p],this.oldSelectRect=o.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 o;var n;var i=(o=t.parent)==null?void 0:o.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,o,s,f,p,c,v,S,O,x,m,T,l,d,u,g,M,b,_iterator13,_step13,_b11,E,L,D,I,C,G,K,W,_G4,_K3,A,_b12,_E9,_E10,_E11,_E12,_E13,_E14,_E15,R;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,o=t.worker,s=t.offset,f=t.scene,p=t.isMainThread,c=this.fullLayer;if(c){_context15.next=3;break;}return _context15.abrupt("return");case 3:S=/* @__PURE__ */new Map(),O=e.box,x=e.workState,m=e.angle,T=e.translate;l=[0,0],d=[1,1],u=[0,0];if(!(O||T||kt(m))){_context15.next=9;break;}if(!(x===Rt.Start)){_context15.next=8;break;}return _context15.abrupt("return",(i.setTarget(),{type:ct.Select,dataType:Mt.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],l=[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=(c==null?void 0:c.getElementsByName(_b11))[0];if(!D){_context15.next=45;break;}I=_objectSpread({},e);C=void 0;if(!L){_context15.next=45;break;}if(C=g==null?void 0:g.get(_b11),C&&O){I.boxScale=d;G=[C.rect.x+C.rect.w/2,C.rect.y+C.rect.h/2],K=[G[0]-u[0],G[1]-u[1]];I.boxTranslate=[K[0]*(d[0]-1)+l[0]+(s&&s[0]||0),K[1]*(d[1]-1)+l[1]+(s&&s[1]||0)];}W=Zn(L);if(!(W==null||W.updateNodeOpt({node:D,opt:I,vNodes:i,willSerializeData:a,targetNode:C}),E&&o&&(// itemOpt.angle || itemOpt.translate || itemOpt.boxScale ||
|
|
408
|
-
a&&(I.angle||I.translate)||I.box&&I.workState!==Rt.Start||I.pointMap&&I.pointMap.has(_b11)||L===ht.Text&&(I.fontSize||I.translate||I.textInfos&&I.textInfos.get(_b11))||L===ht.Image&&(I.angle||I.translate||I.boxScale)||L===I.toolsType&&I.willRefresh))){_context15.next=44;break;}_G4=o.createWorkShapeNode({toolsType:L,toolsOpt:E.opt});_G4==null||_G4.setWorkId(_b11);_K3=void 0;if(!(L===ht.Image&&f)){_context15.next=35;break;}_context15.next=32;return _G4.consumeServiceAsync({isFullWork:!0,replaceId:_b11,scene:f,isMainThread:p});case 32:_K3=_context15.sent;_context15.next=42;break;case 35:if(!(L===ht.Text)){_context15.next=41;break;}_context15.next=38;return _G4.consumeServiceAsync({isFullWork:!0,replaceId:_b11});case 38:_K3=_context15.sent;_context15.next=42;break;case 41:_K3=_G4==null?void 0:_G4.consumeService({op:E.op,isFullWork:!0,replaceId:_b11});case 42:_K3&&(E.rect=_K3);D=(c==null?void 0:c.getElementsByName(_b11))[0];case 44:E&&(S.set(_b11,E),v=Ot(v,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(),g=void 0);A=v;if(!(M&&e.dir&&A&&!s)){_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(S),this.draw(ee.selectorId,c,{selectIds:n||[],subNodeMap:S,intersectRect:A});R=Ot(this.oldSelectRect,A);return _context15.abrupt("return",(this.oldSelectRect=A,{type:ct.Select,dataType:Mt.Local,selectRect:A,renderRect:v,rect:Ot(R,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:Mt.Local,rect:t,selectIds:[],willSyncService:!0};}},{key:"getRightServiceId",value:function getRightServiceId(t){return t.replace(Sr,"-");}},{key:"selectServiceNode",value:function selectServiceNode(t,e,n){var _this61=this;var i=e.selectIds,a=this.getRightServiceId(t),o=this.getSelectorRect(this.fullLayer,a);var s;var f=/* @__PURE__ */new Map();return i==null||i.forEach(function(p){var c=_this61.vNodes.get(p);c&&(s=Ot(s,c.rect),f.set(p,c));}),this.getSelecteorInfo(f),this.draw(a,this.fullLayer,{intersectRect:s,selectIds:i||[],subNodeMap:f},n),Ot(s,o);}},{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(o){return!t.includes(o);});if(n!=null&&n.length&&(e=this.unSelectedByIds(n)),t.length){var o=this.selectedByIds(t);e=Ot(e,o);}this.selectIds=t;var i=this.reRenderSelector();return{bgRect:e,selectRect:i};}},{key:"cursorHover",value:function cursorHover(t){var a,o;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:Mt.Local,rect:Ot(e,this.oldSelectRect),selectorColor:this.selectorColor,willSyncService:!1};if((o=this.selectIds)!=null&&o.length||(this.oldSelectRect=void 0),e&&!this.oldSelectRect)return this.cursorBlur(),{type:ct.CursorHover,dataType:Mt.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",qh),nt(ee,"selectorBorderId","selector-border");var Nt=ee;var Hn=/*#__PURE__*/function(_yt5){function Hn(t){var _this63;_classCallCheck(this,Hn);_this63=_callSuper(this,Hn,[t]);nt(_this63,"canRotate",!1);nt(_this63,"scaleType",$t.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(Hn,_yt5);return _createClass(Hn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x});}if(!i){var _x18=Date.now();return _x18-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x18,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;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 o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,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,o=_this$workOptions6.zIndex,s=_this$workOptions6.scale,f=_this$workOptions6.rotate,p=_this$workOptions6.translate,c=n.worldPosition,v=n.worldScaling,_this$computDrawPoint2=this.computDrawPoints(a),S=_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:S,fillColor:i,strokeColor:i,lineWidth:0,normalize:!0,zIndex:o};s&&(m.scale=s),f&&(m.rotate=f),p&&(m.translate=p);var T=new ce(m);if(this.replace(n,e,T),s||f||p){var _l32=T.getBoundingClientRect();return{x:Math.floor(_l32.x-yt.SafeBorderPadding),y:Math.floor(_l32.y-yt.SafeBorderPadding),w:Math.floor(_l32.width+yt.SafeBorderPadding*2),h:Math.floor(_l32.height+yt.SafeBorderPadding*2)};}return{x:Math.floor(O.x*v[0]+c[0]-yt.SafeBorderPadding),y:Math.floor(O.y*v[1]+c[1]-yt.SafeBorderPadding),w:Math.floor(O.w*v[0]+2*yt.SafeBorderPadding),h:Math.floor(O.h*v[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=Tt.Sub(this.tmpPoints[0],n),a=Tt.Add(this.tmpPoints[0],n),o=_.Mul(e,this.arrowTipWidth),s=_.Sub(this.tmpPoints[1],o),f=Tt.Sub(s,n),p=Tt.Add(s,n),c=_.Per(e).mul(t*1.5),v=Tt.Sub(s,c),S=Tt.Add(s,c),O=[i,f,v,this.tmpPoints[1],S,p,a];return{points:O.map(function(x){return Tt.Sub(x,_this64.tmpPoints[0]).XY;}).flat(1),rect:Wt(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=Tt.Sub(this.tmpPoints[0],n),a=Tt.Add(this.tmpPoints[0],n),o=[i,this.tmpPoints[1],a];return{points:o.map(function(s){return Tt.Sub(s,_this65.tmpPoints[0]).XY;}).flat(1),rect:Wt(o),isTriangle:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(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 s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var s;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(s=o==null?void 0:o.opt)!=null&&s.strokeColor&&(o.opt.strokeColor=a),o&&i.setInfo(e.name,o)),yt.updateNodeOpt(t);}}]);}(yt);var Kn=/*#__PURE__*/function(_yt6){function Kn(t){var _this66;_classCallCheck(this,Kn);_this66=_callSuper(this,Kn,[t]);nt(_this66,"canRotate",!1);nt(_this66,"scaleType",$t.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(Kn,_yt6);return _createClass(Kn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x,isDrawing:!0});}if(!i){var _x19=Date.now();return _x19-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x19,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;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 o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,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,o=_this$workOptions7.fillColor,s=_this$workOptions7.thickness,f=_this$workOptions7.zIndex,p=_this$workOptions7.scale,c=_this$workOptions7.rotate,v=_this$workOptions7.translate,S=n.worldScaling,_this$computDrawPoint3=this.computDrawPoints(s),O=_this$computDrawPoint3.radius,x=_this$computDrawPoint3.rect,m=_this$computDrawPoint3.pos,T={pos:m,name:e,id:e,radius:O,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0},l={name:e,id:e,zIndex:f,pos:m,anchor:[0.5,0.5],size:[x.w,x.h]};p&&(l.scale=p),c&&(l.rotate=c),v&&(l.translate=v);var d=new ne(l);if(i){var M=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:a,lineWidth:1,scale:[1/S[0],1/S[1]]});d.append(M);}var u=new Vh(_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=Wt(this.tmpPoints),n=Wt(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 Tt(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 s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,canRotate:this.canRotate,scaleType:this.scaleType,centerPos:yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var p,c;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=i.get(e.name);var f=e;return e.tagName==="GROUP"&&(f=e.children[0]),a&&(f.setAttribute("strokeColor",a),(p=s==null?void 0:s.opt)!=null&&p.strokeColor&&(s.opt.strokeColor=a)),o&&(o==="transparent"?f.setAttribute("fillColor","rgba(0,0,0,0)"):f.setAttribute("fillColor",o),(c=s==null?void 0:s.opt)!=null&&c.fillColor&&(s.opt.fillColor=o)),s&&i.setInfo(e.name,s),yt.updateNodeOpt(t);}}]);}(yt);var o0=fe,a0=re,l0="[object Boolean]";function c0(h){return h===!0||h===!1||a0(h)&&o0(h)==l0;}var f0=c0,se=/* @__PURE__ */ye(f0);var Vn=/*#__PURE__*/function(_yt7){function Vn(t){var _this67;_classCallCheck(this,Vn);_this67=_callSuper(this,Vn,[t]);nt(_this67,"canRotate",!0);nt(_this67,"scaleType",$t.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(Vn,_yt7);return _createClass(Vn,[{key:"transformData",value:function transformData(){var t=Wt(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 o=_step14.value;n.push(_construct(_,_toConsumableArray(o)));}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}var i=Wt(n,e),a=[i.x+i.w/2,i.y+i.h/2];return{rect:i,pos:a,points:n.map(function(o){return o.XY;}).flat(1)};}},{key:"consume",value:function consume(t){var x;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(x=e==null?void 0:e.workId)==null?void 0:x.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v=this.transformData();var S;if(i||a){var m=n?this.fullLayer:this.drawLayer||this.fullLayer;S=this.draw({ps:v,workId:o,layer:m,isDrawing:!0});}if(!i){var _m9=Date.now();return _m9-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_m9,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:v.flat(1),isSync:!0,index:0}):{type:ct.None};}var O=Ot(S,this.oldRect);return this.oldRect=S,{rect:O,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var p,c;var e=t.data,n=(p=e==null?void 0:e.workId)==null?void 0:p.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,o=this.draw({ps:i,workId:n,layer:a,isDrawing:!1});this.oldRect=o;var s=i.flat(1),f=qt(s);return(c=this.vNodes)==null||c.setInfo(n,{rect:o,op:s,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),{rect:o,type:ct.FullWork,dataType:Mt.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,o=t.replaceId,_this$workOptions8=this.workOptions,s=_this$workOptions8.strokeColor,f=_this$workOptions8.fillColor,p=_this$workOptions8.thickness,c=_this$workOptions8.zIndex,v=_this$workOptions8.scale,S=_this$workOptions8.rotate,O=_this$workOptions8.translate,x=_this$workOptions8.textOpt,m=n.worldPosition,T=n.worldScaling,_this$computDrawPoint4=this.computDrawPoints(a),l=_this$computDrawPoint4.points,d=_this$computDrawPoint4.rect,u=_this$computDrawPoint4.pos,g={close:!0,normalize:!0,points:l,lineWidth:p,fillColor:f!=="transparent"&&f||void 0,strokeColor:s,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:c,pos:u,anchor:[0.5,0.5],size:[d.w,d.h],scale:v,rotate:S,translate:O}),R=new ce(_objectSpread(_objectSpread({},g),{},{pos:[0,0]}));if(A.appendChild(R),i){var b=new he({d:"M-4,0H4M0,-4V4",normalize:!0,pos:[0,0],strokeColor:s,lineWidth:1,scale:[1/T[0],1/T[1]]});A.appendChild(b);}if(this.replace(n,o||e,A),v||S||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 Tt(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 p,c;var e=t.op,n=t.isFullWork,i=t.replaceId,a=(p=this.workId)==null?void 0:p.toString();if(!a)return;var o=[];for(var v=0;v<e.length;v+=3)o.push([e[v],e[v+1],e[v+2]]);var s=n?this.fullLayer:this.drawLayer||this.fullLayer,f=this.draw({ps:o,workId:a,layer:s,isDrawing:!1,replaceId:i});return this.oldRect=f,(c=this.vNodes)==null||c.setInfo(a,{rect:f,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:f&&yt.getCenterPos(f,s)}),f;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var T,l;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=n.fillColor,s=n.fontColor,f=n.fontBgColor,p=n.bold,c=n.italic,v=n.lineThrough,S=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)),o&&(o==="transparent"?m.setAttribute("fillColor","rgba(0,0,0,0)"):m.setAttribute("fillColor",o),(l=x==null?void 0:x.opt)!=null&&l.fillColor&&(x.opt.fillColor=o)),x!=null&&x.opt.textOpt){var d=x.opt.textOpt;s&&d.fontColor&&(d.fontColor=s),f&&d.fontBgColor&&(d.fontBgColor=f),p&&(d.bold=p),c&&(d.italic=c),se(v)&&(d.lineThrough=v),se(S)&&(d.underline=S),O&&(d.fontSize=O);}return x&&i.setInfo(e.name,x),yt.updateNodeOpt(t);}}]);}(yt);var Yn=/*#__PURE__*/function(_yt8){function Yn(t){var _this68;_classCallCheck(this,Yn);_this68=_callSuper(this,Yn,[t]);nt(_this68,"canRotate",!1);nt(_this68,"scaleType",$t.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(Yn,_yt8);return _createClass(Yn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x,isDrawing:!0});}if(!i){var _x20=Date.now();return _x20-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x20,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o// op: this.tmpPoints.map(c=>[...c.XY,0]).flat(1)
|
|
409
|
-
};}},{key:"consumeAll",value:function consumeAll(t){var f,p;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 o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,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,o=_this$workOptions9.fillColor,s=_this$workOptions9.thickness,f=_this$workOptions9.zIndex,p=_this$workOptions9.vertices,c=_this$workOptions9.innerVerticeStep,v=_this$workOptions9.innerRatio,S=_this$workOptions9.scale,O=_this$workOptions9.rotate,x=_this$workOptions9.translate,m=n.worldScaling,_this$computDrawPoint5=this.computDrawPoints(s,p,c,v),T=_this$computDrawPoint5.rect,l=_this$computDrawPoint5.pos,d=_this$computDrawPoint5.points,u={close:!0,points:d,lineWidth:s,fillColor:o!=="transparent"&&o||void 0,strokeColor:a,normalize:!0,lineJoin:"round"},g={name:e,id:e,zIndex:f,pos:l,anchor:[0.5,0.5],size:[T.w,T.h],className:"".concat(l[0],",").concat(l[1])};S&&(g.scale=S),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 R=M.getBoundingClientRect();return{x:Math.floor(R.x-yt.SafeBorderPadding),y:Math.floor(R.y-yt.SafeBorderPadding),w:Math.floor(R.width+yt.SafeBorderPadding*2),h:Math.floor(R.height+yt.SafeBorderPadding*2)};}},{key:"computDrawPoints",value:function computDrawPoints(t,e,n,i){var a=Wt(this.tmpPoints),o=[Math.floor(a.x+a.w/2),Math.floor(a.y+a.h/2)],s=Fn(a.w,a.h),f=Math.floor(Math.min(a.w,a.h)/2),p=i*f,c=[],v=2*Math.PI/e;for(var O=0;O<e;O++){var x=O*v-0.5*Math.PI;var m=void 0,_T41=void 0;O%n===1?(m=p*s[0]*Math.cos(x),_T41=p*s[1]*Math.sin(x)):(m=f*s[0]*Math.cos(x),_T41=f*s[1]*Math.sin(x),c.push(m,_T41)),c.push(m,_T41);}return{rect:Wt(this.tmpPoints,t),pos:o,points:c};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Tt.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 s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{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,o=n.fillColor,s=n.toolsType,f=n.vertices,p=n.innerVerticeStep,c=n.innerRatio,v=i.get(e.name),S=v==null?void 0:v.opt;var O=e;return e.tagName==="GROUP"&&(O=e.children[0]),a&&(O.setAttribute("strokeColor",a),S!=null&&S.strokeColor&&(S.strokeColor=a)),o&&(o==="transparent"?O.setAttribute("fillColor","rgba(0,0,0,0)"):O.setAttribute("fillColor",o),S!=null&&S.fillColor&&(S.fillColor=o)),s===ht.Star&&(f&&(S.vertices=f),p&&(S.innerVerticeStep=p),c&&(S.innerRatio=c)),v&&i.setInfo(e.name,_objectSpread(_objectSpread({},v),{},{opt:S})),yt.updateNodeOpt(t);}}]);}(yt);var Xn=/*#__PURE__*/function(_yt9){function Xn(t){var _this69;_classCallCheck(this,Xn);_this69=_callSuper(this,Xn,[t]);nt(_this69,"canRotate",!1);nt(_this69,"scaleType",$t.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(Xn,_yt9);return _createClass(Xn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x,isDrawing:!0});}if(!i){var _x21=Date.now();return _x21-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x21,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;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 o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,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,o=_this$workOptions10.fillColor,s=_this$workOptions10.thickness,f=_this$workOptions10.zIndex,p=_this$workOptions10.vertices,c=_this$workOptions10.scale,v=_this$workOptions10.rotate,S=_this$workOptions10.translate,O=n.worldScaling,_this$computDrawPoint6=this.computDrawPoints(s,p),x=_this$computDrawPoint6.rect,m=_this$computDrawPoint6.pos,T=_this$computDrawPoint6.points,l={close:!0,points:T,lineWidth:s,fillColor:o!=="transparent"&&o||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]};c&&(d.scale=c),v&&(d.rotate=v),S&&(d.translate=S);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({},l),{},{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=Wt(this.tmpPoints),i=[Math.floor(n.x+n.w/2),Math.floor(n.y+n.h/2)],a=Fn(n.w,n.h),o=Math.floor(Math.min(n.w,n.h)/2),s=[],f=2*Math.PI/e;for(var c=0;c<e;c++){var v=c*f-0.5*Math.PI,S=o*a[0]*Math.cos(v),O=o*a[1]*Math.sin(v);s.push(S,O);}return{rect:Wt(this.tmpPoints,t),pos:i,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Tt.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 s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{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,o=n.fillColor,s=n.toolsType,f=n.vertices,p=i.get(e.name),c=p==null?void 0:p.opt;var v=e;return e.tagName==="GROUP"&&(v=e.children[0]),a&&(v.setAttribute("strokeColor",a),c!=null&&c.strokeColor&&(c.strokeColor=a)),o&&(o==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",o),c!=null&&c.fillColor&&(c.fillColor=o)),s===ht.Polygon&&f&&(c.vertices=f),p&&i.setInfo(e.name,_objectSpread(_objectSpread({},p),{},{opt:c})),yt.updateNodeOpt(t);}}]);}(yt);var Zt=/*#__PURE__*/function(){function Zt(){_classCallCheck(this,Zt);}return _createClass(Zt,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],o=t[n+2],s=t[n+3];i&&a&&o&&s?e.push.apply(e,_toConsumableArray(Zt.getBezierPoints(r,i,a,o,s))):i&&a&&o?e.push.apply(e,_toConsumableArray(Zt.getBezierPoints(r,i,a,o))):i&&a?e.push.apply(e,_toConsumableArray(Zt.getBezierPoints(r,i,a))):i&&e.push(i);}return e;}/**
|
|
410
|
-
* @desc 获取点,这里可以设置点的个数
|
|
411
|
-
* @param {number} num 点个数
|
|
412
|
-
* @param {Vec2d} p1 点坐标
|
|
413
|
-
* @param {Vec2d} p2 点坐标
|
|
414
|
-
* @param {Vec2d} p3 点坐标
|
|
415
|
-
* @param {Vec2d} p4 点坐标
|
|
416
|
-
* 如果参数是 num, p1, p2 为一阶贝塞尔
|
|
417
|
-
* 如果参数是 num, p1, c1, p2 为二阶贝塞尔
|
|
418
|
-
* 如果参数是 num, p1, c1, c2, p2 为三阶贝塞尔
|
|
419
|
-
*/},{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 o=[];!n&&!i?a=Zt.oneBezier:n&&!i?a=Zt.twoBezier:n&&i&&(a=Zt.threeBezier);for(var s=0;s<r;s++)a&&o.push(a(s/r,t,e,n,i));return i?o.push(i):n&&o.push(n),o;}/**
|
|
420
|
-
* @desc 一阶贝塞尔
|
|
421
|
-
* @param {number} t 当前百分比
|
|
422
|
-
* @param {Vec2d} p1 起点坐标
|
|
423
|
-
* @param {Vec2d} p2 终点坐标
|
|
424
|
-
*/},{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);}/**
|
|
425
|
-
* @desc 二阶贝塞尔
|
|
426
|
-
* @param {number} t 当前百分比
|
|
427
|
-
* @param {Array} p1 起点坐标
|
|
428
|
-
* @param {Array} p2 终点坐标
|
|
429
|
-
* @param {Array} cp 控制点
|
|
430
|
-
*/},{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);}/**
|
|
431
|
-
* @desc 三阶贝塞尔
|
|
432
|
-
* @param {number} t 当前百分比
|
|
433
|
-
* @param {Array} p1 起点坐标
|
|
434
|
-
* @param {Array} p2 终点坐标
|
|
435
|
-
* @param {Array} cp1 控制点1
|
|
436
|
-
* @param {Array} cp2 控制点2
|
|
437
|
-
*/},{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,o=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,o);}}]);}();var Jn=/*#__PURE__*/function(_yt10){function Jn(t){var _this70;_classCallCheck(this,Jn);_this70=_callSuper(this,Jn,[t]);nt(_this70,"canRotate",!1);nt(_this70,"scaleType",$t.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(Jn,_yt10);return _createClass(Jn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x,isDrawing:!0});}if(!i){var _x22=Date.now();return _x22-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x22,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;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 o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,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,o=_this$workOptions11.thickness,s=_this$workOptions11.zIndex,f=_this$workOptions11.placement,p=_this$workOptions11.scale,c=_this$workOptions11.rotate,v=_this$workOptions11.translate,_this$computDrawPoint7=this.computDrawPoints(o,f),S=_this$computDrawPoint7.rect,O=_this$computDrawPoint7.pos,x=_this$computDrawPoint7.points,m={points:x.map(function(g){return g.XY;}),lineWidth:o,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:s,pos:O,anchor:[0.5,0.5],size:[S.w,S.h]};p&&(T.scale=p),c&&(T.rotate=c),v&&(T.translate=v);var l=new ne(T),d=new ce(_objectSpread(_objectSpread({},m),{},{pos:[0,0]}));l.append(d),this.replace(n,e,l);var u=l.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=Wt(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=Wt(this.tmpPoints),i=this.transformControlPoints(e),a=Math.floor(n.w*0.1),o=Math.floor(n.h*0.1),s=[],f=_.Add(i[0],new _(0,o,0)),p=_.Add(i[0],new _(a,0,0)),c=Zt.getBezierPoints(10,f,i[0],p),v=_.Sub(i[1],new _(a,0,0)),S=_.Add(i[1],new _(0,o,0)),O=Zt.getBezierPoints(10,v,i[1],S),x=_.Sub(i[2],new _(0,o,0)),m=_.Sub(i[2],new _(a,0,0)),T=Zt.getBezierPoints(10,x,i[2],m),l=_.Add(i[3],new _(a,0,0)),d=_.Sub(i[3],new _(0,o,0)),u=Zt.getBezierPoints(10,l,i[3],d),g=a*(1-this.ratio)*10,M=o*(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));s.push.apply(s,[E,L].concat(_toConsumableArray(u),_toConsumableArray(c),_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));s.push.apply(s,[_E16,_L9].concat(_toConsumableArray(u),_toConsumableArray(c),_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));s.push.apply(s,[_E17,_L10].concat(_toConsumableArray(u),_toConsumableArray(c),_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));s.push.apply(s,[_E18,_b16].concat(_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),[_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));s.push.apply(s,[_E19,_b17].concat(_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),[_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));s.push.apply(s,[_E20,_b18].concat(_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),[_L13]));break;}case"left":{var _b19=_.Add(i[0],new _(0,o*5-M/2,0)),_E21=_.Add(i[0],new _(-g,o*5,0)),_L14=_.Add(i[0],new _(0,o*5+M/2,0));s.push.apply(s,[_E21,_b19].concat(_toConsumableArray(c),_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),[_L14]));break;}case"leftTop":{var _b20=_.Add(i[0],new _(0,o*1.1,0)),_E22=_.Add(i[0],new _(-g,o*1.1+M/2,0)),_L15=_.Add(i[0],new _(0,o*1.1+M,0));s.push.apply(s,[_E22,_b20].concat(_toConsumableArray(c),_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),[_L15]));break;}case"leftBottom":{var _b21=_.Sub(i[3],new _(0,o*1.1+M,0)),_E23=_.Sub(i[3],new _(g,o*1.1+M/2,0)),_L16=_.Sub(i[3],new _(0,o*1.1,0));s.push.apply(s,[_E23,_b21].concat(_toConsumableArray(c),_toConsumableArray(O),_toConsumableArray(T),_toConsumableArray(u),[_L16]));break;}case"right":{var _b22=_.Add(i[1],new _(0,o*5-M/2,0)),_E24=_.Add(i[1],new _(g,o*5,0)),_L17=_.Add(i[1],new _(0,o*5+M/2,0));s.push.apply(s,[_E24,_L17].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(O),[_b22]));break;}case"rightTop":{var _b23=_.Add(i[1],new _(0,o*1.1,0)),_E25=_.Add(i[1],new _(g,o*1.1+M/2,0)),_L18=_.Add(i[1],new _(0,o*1.1+M,0));s.push.apply(s,[_E25,_L18].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(O),[_b23]));break;}case"rightBottom":{var _b24=_.Sub(i[2],new _(0,o*1.1+M,0)),_E26=_.Sub(i[2],new _(-g,o*1.1+M/2,0)),_L19=_.Sub(i[2],new _(0,o*1.1,0));s.push.apply(s,[_E26,_L19].concat(_toConsumableArray(T),_toConsumableArray(u),_toConsumableArray(c),_toConsumableArray(O),[_b24]));break;}}var A=Wt(this.tmpPoints,t),R=[Math.floor(A.x+A.w/2),Math.floor(A.y+A.h/2)];return{rect:A,pos:R,points:s};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(e[0],e[1]),i=this.tmpPoints[0],a=this.workOptions.thickness;if(i.isNear(n,a)||Tt.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 s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a,isDrawing:!1});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{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,o=n.fillColor,s=n.toolsType,f=n.placement,p=i.get(e.name),c=p==null?void 0:p.opt;var v=e;return e.tagName==="GROUP"&&(v=e.children[0]),a&&(v.setAttribute("strokeColor",a),c!=null&&c.strokeColor&&(c.strokeColor=a)),o&&(o==="transparent"?v.setAttribute("fillColor","rgba(0,0,0,0)"):v.setAttribute("fillColor",o),c!=null&&c.fillColor&&(c.fillColor=o)),s===ht.SpeechBalloon&&f&&(c.placement=f),p&&i.setInfo(e.name,_objectSpread(_objectSpread({},p),{},{opt:c})),yt.updateNodeOpt(t);}}]);}(yt);var be=/*#__PURE__*/function(_yt11){function be(t){var _this71;_classCallCheck(this,be);_this71=_callSuper(this,be,[t]);nt(_this71,"canRotate",!0);nt(_this71,"scaleType",$t.all);nt(_this71,"toolsType",ht.Image);nt(_this71,"tmpPoints",[]);nt(_this71,"workOptions");nt(_this71,"oldRect");_this71.workOptions=t.toolsOpt,_this71.scaleType=be.getScaleType(_this71.workOptions);return _this71;}_inherits(be,_yt11);return _createClass(be,[{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,o=t.isMainThread,_this$workOptions12=this.workOptions,s=_this$workOptions12.centerX,f=_this$workOptions12.centerY,p=_this$workOptions12.width,c=_this$workOptions12.height,v=_this$workOptions12.rotate,S=_this$workOptions12.zIndex,O=!!e.parent.gl,x={anchor:[0.5,0.5],pos:[s,f],name:n,size:[p,c],zIndex:S,rotate:!o&&!O&&180+(v||0)||v,// rotate,
|
|
438
|
-
texture:a},m=new Jh(x);this.replace(e,i||n,m);var T=m.getBoundingClientRect();if(T)return{x:Math.floor(T.x-yt.SafeBorderPadding),y:Math.floor(T.y-yt.SafeBorderPadding),w:Math.floor(T.width+yt.SafeBorderPadding*2),h:Math.floor(T.height+yt.SafeBorderPadding*2)};}},{key:"consumeService",value:function consumeService(){}},{key:"consumeServiceAsync",value:function(){var _consumeServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(t){var c,v,S,O,e,n,i,a,_this$workOptions13,o,s,f,p,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,o=_this$workOptions13.src,s=_this$workOptions13.uuid,f=((c=this.workId)==null?void 0:c.toString())||s,p=e?this.fullLayer:this.drawLayer||this.fullLayer;if(!o){_context16.next=7;break;}_context16.next=4;return i.preload({id:s,src:this.workOptions.src});case 4:x=_context16.sent;m=this.draw({workId:f,layer:p,replaceId:n,imageBitmap:x[0],isMainThread:a});return _context16.abrupt("return",(this.oldRect=f&&((S=(v=this.vNodes)==null?void 0:v.get(f))==null?void 0:S.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,p)}),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?$t.proportional:$t.all;}},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.translate,s=n.box,f=n.boxScale,p=n.boxTranslate,c=n.angle,v=n.isLocked,S=n.zIndex,O=a&&Jt(a)||i.get(e.name);if(!O)return;var x=e.parent;if(x){if(kt(S)&&(e.setAttribute("zIndex",S),O.opt.zIndex=S),se(v)&&(O.opt.locked=v),s&&p&&f){var _O$opt=O.opt,m=_O$opt.centerX,_T42=_O$opt.centerY,_l33=_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,R=Nn({x:m-_l33/2,y:_T42-d/2,w:_l33,h:d},g||0),b=wh(R,new _(m,_T42),A),E=Nh(b,new _(m,_T42),-(g||0)),L=Wt(E);O.opt.width=Math.round(L.w),O.opt.height=Math.round(L.h);var D=[p[0]/x.worldScaling[0],p[1]/x.worldScaling[1]];O.opt.centerX=m+D[0],O.opt.centerY=_T42+D[1];var I=[O.centerPos[0]+D[0],O.centerPos[1]+D[1]];if(O.centerPos=I,a){var C=Bn(O.rect,f);C=Ie(C,D),O.rect=C;}else{var _C7=yt.getRectFromLayer(x,e.name);O.rect=_C7||O.rect;}}else if(o){if(O.opt.centerX=O.opt.centerX+o[0],O.opt.centerY=O.opt.centerY+o[1],O.centerPos=[O.centerPos[0]+o[0],O.centerPos[1]+o[1]],a){var _m10=[o[0]*x.worldScaling[0],o[1]*x.worldScaling[1]],_T43=Ie(O.rect,_m10);O.rect=_T43;}else{var _m11=yt.getRectFromLayer(x,e.name);O.rect=_m11||O.rect;}}else if(kt(c))if(O.opt.rotate=c,O.scaleType=be.getScaleType(O.opt),a){var _m12=Wn(O.rect,c);O.rect=_m12;}else{var _m13=yt.getRectFromLayer(x,e.name);O.rect=_m13||O.rect;}return O&&i.setInfo(e.name,O),O==null?void 0:O.rect;}}}]);}(yt);var Qn=/*#__PURE__*/function(_yt12){function Qn(t){var _this72;_classCallCheck(this,Qn);_this72=_callSuper(this,Qn,[t]);nt(_this72,"canRotate",!1);nt(_this72,"scaleType",$t.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(Qn,_yt12);return _createClass(Qn,[{key:"consume",value:function consume(t){var O;var e=t.data,n=t.isFullWork,i=t.isSubWorker,a=t.isMainThread,o=(O=e==null?void 0:e.workId)==null?void 0:O.toString();if(!o)return{type:ct.None};var s=e.op,f=e.workState,p=s==null?void 0:s.length;if(!p||p<2)return{type:ct.None};var c;if(f===Rt.Start?(this.tmpPoints=[new Tt(s[0],s[1])],c=!1):c=this.updateTempPoints(s),!c)return{type:ct.None};var v;if(i||a){var x=n?this.fullLayer:this.drawLayer||this.fullLayer;v=this.draw({workId:o,layer:x});}if(!i){var _x24=Date.now();return _x24-this.syncTimestamp>this.syncUnitTime?(this.syncTimestamp=_x24,{type:ct.DrawWork,dataType:Mt.Local,workId:o,op:this.tmpPoints.map(function(m){return[].concat(_toConsumableArray(m.XY),[0]);}).flat(1),isSync:!0,index:0}):{type:ct.None};}var S=Ot(v,this.oldRect);return this.oldRect=v,{rect:S,type:ct.DrawWork,dataType:Mt.Local,workId:o};}},{key:"consumeAll",value:function consumeAll(t){var f,p;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 o=this.tmpPoints.map(function(c){return[].concat(_toConsumableArray(c.XY),[0]);}).flat(1),s=qt(o);return(p=this.vNodes)==null||p.setInfo(n,{rect:a,op:o,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:a&&yt.getCenterPos(a,i)}),{rect:a,type:ct.FullWork,dataType:Mt.Local,workId:n,ops:s,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,o=_this$workOptions14.zIndex,s=_this$workOptions14.scale,f=_this$workOptions14.rotate,p=_this$workOptions14.translate,c=n.worldPosition,v=n.worldScaling,_this$computDrawPoint8=this.computDrawPoints(a),S=_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:S,fillColor:i,strokeColor:i,lineWidth:0,className:"".concat(x[0],",").concat(x[1]),normalize:!0,zIndex:o};s&&(m.scale=s),f&&(m.rotate=f),p&&(m.translate=p);var T=new he(m);if(this.replace(n,e,T),f||s||p){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*v[0]+c[0]-yt.SafeBorderPadding),y:Math.floor(O.y*v[1]+c[1]-yt.SafeBorderPadding),w:Math.floor(O.w*v[0]+2*yt.SafeBorderPadding),h:Math.floor(O.h*v[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=Tt.Sub(this.tmpPoints[0],n),a=Tt.Add(this.tmpPoints[0],n),o=Tt.Sub(this.tmpPoints[1],n),s=Tt.Add(this.tmpPoints[1],n),f=Tt.GetSemicircleStroke(this.tmpPoints[1],o,-1,8),p=Tt.GetSemicircleStroke(this.tmpPoints[0],a,-1,8),c=[i,o].concat(_toConsumableArray(f),[s,a],_toConsumableArray(p));return{d:me(c,!0),rect:Wt(c),isDot:!1,pos:this.tmpPoints[0].XY};}},{key:"computDotPoints",value:function computDotPoints(t){var e=Tt.GetDotStroke(this.tmpPoints[0],t/2,8);return{d:me(e,!0),rect:Wt(e),isDot:!0,pos:this.tmpPoints[0].XY};}},{key:"updateTempPoints",value:function updateTempPoints(t){var e=t.slice(-2),n=new Tt(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 s,f;var e=t.op,n=t.isFullWork,i=(s=this.workId)==null?void 0:s.toString();if(!i)return;this.tmpPoints.length=0;for(var p=0;p<e.length;p+=3)this.tmpPoints.push(new Tt(e[p],e[p+1],e[p+2]));var a=n?this.fullLayer:this.drawLayer||this.fullLayer,o=this.draw({workId:i,layer:a});return this.oldRect=o,(f=this.vNodes)==null||f.setInfo(i,{rect:o,op:e,opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:o&&yt.getCenterPos(o,a)}),o;}},{key:"clearTmpPoints",value:function clearTmpPoints(){this.tmpPoints.length=0;}}],[{key:"updateNodeOpt",value:function updateNodeOpt(t){var s;var e=t.node,n=t.opt,i=t.vNodes,a=n.strokeColor,o=i.get(e.name);return a&&(e.setAttribute("strokeColor",a),e.setAttribute("fillColor",a),(s=o==null?void 0:o.opt)!=null&&s.strokeColor&&(o.opt.strokeColor=a)),o&&i.setInfo(e.name,o),yt.updateNodeOpt(t);}}]);}(yt);var Ze=/*#__PURE__*/function(_yt13){function Ze(t){var _this73;_classCallCheck(this,Ze);_this73=_callSuper(this,Ze,[t]);nt(_this73,"canRotate",!1);nt(_this73,"scaleType",$t.all);nt(_this73,"toolsType",ht.Text);nt(_this73,"tmpPoints",[]);nt(_this73,"workOptions");nt(_this73,"oldRect");_this73.workOptions=t.toolsOpt;return _this73;}_inherits(Ze,_yt13);return _createClass(Ze,[{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,o,s,f,p,c,v,S,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,o=_this$workOptions15.boxPoint,s=_this$workOptions15.zIndex,f=n.worldPosition,p=n.worldScaling;if(!(!o||!a)){_context17.next=3;break;}return _context17.abrupt("return");case 3:c={name:e,id:e,pos:[o[0]+a[0]/2,o[1]+a[1]/2],anchor:[0.5,0.5],size:a,zIndex:s// bgcolor:"rgba(109,212,0,0.5)"
|
|
439
|
-
},v=new ne(c),S={x:o[0],y:o[1],w:a[0],h:a[1]},O=new or({normalize:!0,pos:[0,0],size:a});if(!(v.append(O),i)){_context17.next=15;break;}_context17.t1=i;if(!_context17.t1){_context17.next=10;break;}_context17.next=9;return Ze.createLabels(this.workOptions,v,n);case 9:_context17.t1=_context17.sent;case 10:_context17.t0=_context17.t1;if(_context17.t0){_context17.next=13;break;}_context17.t0=[];case 13:x=_context17.t0;v.append.apply(v,_toConsumableArray(x));case 15:return _context17.abrupt("return",(this.replace(n,e,v),{x:Math.floor(S.x*p[0]+f[0]),y:Math.floor(S.y*p[1]+f[1]),w:Math.floor(S.w*p[0]),h:Math.floor(S.h*p[1])}));case 16: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,p,c,v,e,n,i,a,o,s;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&&((c=(p=this.vNodes)==null?void 0:p.get(i))==null?void 0:c.rect)||void 0;o=n?this.fullLayer:this.drawLayer||this.fullLayer;_context18.next=8;return this.draw({workId:e,layer:o,isDrawLabel:a||this.workOptions.workState===Rt.Done});case 8:s=_context18.sent;return _context18.abrupt("return",((v=this.vNodes)==null||v.setInfo(e,{rect:s,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:s&&yt.getCenterPos(s,o)}),s));case 10:case"end":return _context18.stop();}},_callee16,this);}));function consumeServiceAsync(_x26){return _consumeServiceAsync2.apply(this,arguments);}return consumeServiceAsync;}()},{key:"updataOptService",value:function updataOptService(){}},{key:"updataOptServiceAsync",value:function(){var _updataOptServiceAsync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(t){var S,O,e,n,i,a,o,s,f,p,c,v;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,o=t.italic,s=t.lineThrough,f=t.underline,p=t.zIndex,c=(S=this.vNodes)==null?void 0:S.get(e);if(c){_context19.next=5;break;}return _context19.abrupt("return");case 5:n&&(c.opt.fontColor=n),i&&(c.opt.fontBgColor=i),a&&(c.opt.bold=a),o&&(c.opt.italic=o),se(s)&&(c.opt.lineThrough=s),se(f)&&(c.opt.underline=f),kt(p)&&(c.opt.zIndex=p),this.oldRect=c.rect;_context19.next=8;return this.draw({workId:e,layer:this.fullLayer,isDrawLabel:this.workOptions.workState===Rt.Done});case 8:v=_context19.sent;return _context19.abrupt("return",((O=this.vNodes)==null||O.setInfo(e,{rect:v,op:[],opt:this.workOptions,toolsType:this.toolsType,scaleType:this.scaleType,canRotate:this.canRotate,centerPos:v&&yt.getCenterPos(v,this.fullLayer)}),v));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:"createLabels",value:function(){var _createLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(t,e,n){var i,a,o,s,f,p,c,v,S,O,x,m,T,l,d,u,g,M,A,R,b,E,D,_D9,L,_M6,_e$worldScaling,_A3,_R5,_i$_R5$getBoundingCli,_b25,_E27,_L20,_D10,_L21,_D11;return _regeneratorRuntime().wrap(function _callee18$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:i=[],a=t.text.split(","),o=a.length,s=t.fontSize,f=t.lineHeight,p=t.bold,c=t.textAlign,v=t.italic,S=t.boxSize,O=t.fontFamily,x=t.verticalAlign,m=t.fontColor,T=t.fontBgColor,l=t.underline,d=t.lineThrough,u=((n==null?void 0:n.parent).displayRatio||1)*((n==null?void 0:n.worldScaling[0])||1),g=s*u;for(M=0;M<o;M++){A=a[M],R=f||g*1.2;if(A){b={anchor:[0,0.5],text:A,fontSize:g,lineHeight:R,fontFamily:O,fontWeight:p,fillColor:m,bgcolor:T,textAlign:c,fontStyle:v,name:M.toString(),className:"label",scale:[1/u,1/u]},E=[0,0];if(x==="middle"){D=(o-1)/2;E[1]=(M-D)*(f||s*1.2);}if(c==="left"){_D9=S&&-S[0]/2||0;E[0]=v==="italic"&&_D9||_D9+5;}b.pos=E;L=new Yh(b);i.push(L);}}_context20.next=4;return new Promise(function(M){setTimeout(M,0);});case 4:if(!(l||d)){_context20.next=8;break;}_M6=[],_e$worldScaling=_slicedToArray(e.worldScaling,1),_A3=_e$worldScaling[0];for(_R5=0;_R5<i.length;_R5++){_i$_R5$getBoundingCli=i[_R5].getBoundingClientRect(),_b25=_i$_R5$getBoundingCli.width;if(_b25){_E27=i[_R5].getAttribute("pos");if(l){_L20={normalize:!1,pos:[_E27[0],_E27[1]+s/2],lineWidth:Math.floor(s/10),points:[0,0,_b25/_A3,0],strokeColor:m,name:"".concat(_R5,"_underline"),className:"underline"},_D10=new ce(_L20);_M6.push(_D10);}if(d){_L21={normalize:!1,pos:_E27,lineWidth:Math.floor(s/10),points:[0,0,_b25/_A3,0],strokeColor:m,name:"".concat(_R5,"_lineThrough"),className:"lineThrough"},_D11=new ce(_L21);_M6.push(_D11);}}}return _context20.abrupt("return",i.concat(_M6));case 8:return _context20.abrupt("return",i);case 9:case"end":return _context20.stop();}},_callee18);}));function createLabels(_x28,_x29,_x30){return _createLabels.apply(this,arguments);}return createLabels;}()},{key:"updateLabels",value:function(){var _updateLabels=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(t,e,n){var i,a,o;return _regeneratorRuntime().wrap(function _callee19$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:i=t.opt.fontSize,a=((n==null?void 0:n.parent).displayRatio||1)*((n==null?void 0:n.worldScaling[0])||1),o=i*a;e.children.forEach(function(s){s.tagName==="LABEL"&&(s.setAttribute("fontSize",o),s.setAttribute("scale",[1/a,1/a]),s.setAttribute("lineHeight",o*1.2));});case 2:case"end":return _context21.stop();}},_callee19);}));function updateLabels(_x31,_x32,_x33){return _updateLabels.apply(this,arguments);}return updateLabels;}()},{key:"updateNodeOpt",value:function updateNodeOpt(t){var e=t.node,n=t.opt,i=t.vNodes,a=t.targetNode,o=n.fontBgColor,s=n.fontColor,f=n.translate,p=n.box,c=n.boxScale,v=n.boxTranslate,S=n.bold,O=n.italic,x=n.lineThrough,m=n.underline,T=n.fontSize,l=n.textInfos,d=n.zIndex,u=a&&Jt(a)||i.get(e.name);if(!u)return;var g=e.parent;if(!g)return;var M=u.opt;if(kt(d)&&(e.setAttribute("zIndex",d),u.opt.zIndex=d),s&&M.fontColor&&(M.fontColor=s,e.children.forEach(function(A){A.tagName==="LABEL"?A.setAttribute("fillColor",s):A.tagName==="POLYLINE"&&A.setAttribute("strokeColor",s);})),o&&M.fontBgColor&&(M.fontBgColor=o,e.children.forEach(function(A){A.tagName==="LABEL"&&A.setAttribute("bgcolor",o);})),S&&(M.bold=S),O&&(M.italic=O),se(x)&&(M.lineThrough=x),se(m)&&(M.underline=m),T&&(M.fontSize=T),p&&v&&c){var A=l==null?void 0:l.get(e.name);if(A){var E=A.fontSize,L=A.boxSize;M.boxSize=L||M.boxSize,M.fontSize=E||M.fontSize;}var R=u.rect,b=Ie(Bn(R,c),v);M.boxPoint=b&&[(b.x-g.worldPosition[0])/g.worldScaling[0],(b.y-g.worldPosition[1])/g.worldScaling[1]];}else if(f&&M.boxPoint&&(M.boxPoint=[M.boxPoint[0]+f[0],M.boxPoint[1]+f[1]],u.centerPos=[u.centerPos[0]+f[0],u.centerPos[1]+f[1]],a)){var _A4=[f[0]/g.worldScaling[0],f[1]/g.worldScaling[1]];u.rect=Ie(u.rect,_A4);}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 Zn(h){switch(h){case ht.Arrow:return Hn;case ht.Pencil:return Un;case ht.Straight:return Qn;case ht.Ellipse:return Kn;case ht.Polygon:case ht.Triangle:return Xn;case ht.Star:case ht.Rhombus:return Yn;case ht.Rectangle:return Vn;case ht.SpeechBalloon:return Jn;case ht.Text:return Ze;case ht.LaserPen:return zn;case ht.Eraser:return ie;case ht.Selector:return Nt;case ht.Image:return be;}}function xr(h,r){var t=h.toolsType,e=_objectWithoutProperties(h,_excluded);switch(t){case ht.Arrow:return new Hn(e);case ht.Pencil:return new Un(e);case ht.Straight:return new Qn(e);case ht.Ellipse:return new Kn(e);case ht.Polygon:case ht.Triangle:return new Xn(e);case ht.Star:case ht.Rhombus:return new Yn(e);case ht.Rectangle:return new Vn(e);case ht.SpeechBalloon:return new Jn(e);case ht.Text:return new Ze(e);case ht.LaserPen:return new zn(e);case ht.Eraser:return new ie(e,r);case ht.Selector:return e.vNodes?new Nt(_objectSpread(_objectSpread({},e),{},{vNodes:e.vNodes,drawLayer:e.fullLayer})):void 0;case ht.Image:return new be(e);default:return;}}function kn(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 kn(_e6.children);_e6.tagName&&t.includes(_e6.tagName)&&r.push(_e6);}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}return r;}var u0=/*#__PURE__*/function(_te2){function u0(){var _this74;_classCallCheck(this,u0);_this74=_callSuper(this,u0,arguments);nt(_this74,"emitEventType",Lt.SetColorNode);return _this74;}_inherits(u0,_te2);return _createClass(u0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(t){var f,e,n,i,a,o,s;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,o=t.willSerializeData,s=t.textUpdateForWoker;_context22.t0=e===Nt.selectorId&&n;if(!_context22.t0){_context22.next=5;break;}_context22.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context22.stop();}},_callee20,this);}));function consumeForLocalWorker(_x34){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,o=e.isSync,s=e.textUpdateForWoker,f=n.render||[],p=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),c=_step16$value[0],v=_step16$value[1];s&&v.toolsType===ht.Text?p.push(_objectSpread(_objectSpread({},v),{},{workId:c,type:ct.TextUpdate,dataType:Mt.Local,willSyncService:!0})):p.push(_objectSpread(_objectSpread({},v),{},{workId:c,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}}return{render:f,sp:p};}}]);}(te);var h0=/*#__PURE__*/function(_te3){function h0(){var _this75;_classCallCheck(this,h0);_this75=_callSuper(this,h0,arguments);nt(_this75,"emitEventType",Lt.ZIndexNode);return _this75;}_inherits(h0,_te3);return _createClass(h0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee21$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context23.t0=e===Nt.selectorId&&n;if(!_context23.t0){_context23.next=5;break;}_context23.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context23.stop();}},_callee21,this);}));function consumeForLocalWorker(_x35){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,o=e.isSync,s=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),p=_step17$value[0],c=_step17$value[1];f.push(_objectSpread(_objectSpread({},c),{},{workId:p,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}}return{render:s,sp:f};}}]);}(te);var d0=/*#__PURE__*/function(_te4){function d0(){var _this76;_classCallCheck(this,d0);_this76=_callSuper(this,d0,arguments);nt(_this76,"emitEventType",Lt.TranslateNode);return _this76;}_inherits(d0,_te4);return _createClass(d0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(t){var p,c,e,n,i,a,o,s,f;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,o=t.willSerializeData,s=t.textUpdateForWoker,f=t.emitEventType;_context24.t0=e===Nt.selectorId&&n;if(!_context24.t0){_context24.next=9;break;}if(!(n.workState===Rt.Done&&n!=null&&n.translate&&(n.translate[0]||n.translate[1])||n.workState!==Rt.Done)){_context24.next=8;break;}_context24.next=6;return(p=this.localWork)==null?void 0:p.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,isSync:!0,textUpdateForWoker:s,emitEventType:f,scene:this.scene,callback:this.updateSelectorCallback});case 6:_context24.next=9;break;case 8:n.workState===Rt.Done&&((c=this.localWork)==null||c.vNodes.deleteLastTarget());case 9:case"end":return _context24.stop();}},_callee22,this);}));function consumeForLocalWorker(_x36){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,o=t.res,s=e.willSyncService,f=e.isSync,p=e.updateSelectorOpt,c=e.textUpdateForWoker,v=p.workState,S=n.render||[],O=n.sp||[];if(v===Rt.Start)return{sp:[],render:[]};var x=o==null?void 0:o.selectRect;if(s){v===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],_T44=_step18$value[1];c&&_T44.toolsType===ht.Text?O.push(_objectSpread(_objectSpread({},_T44),{},{workId:m,type:ct.TextUpdate,dataType:Mt.Local,willSyncService:!0})):O.push(_objectSpread(_objectSpread({},_T44),{},{workId:m,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}}return{render:S,sp:O};}}]);}(te);var g0=/*#__PURE__*/function(_te5){function g0(){var _this77;_classCallCheck(this,g0);_this77=_callSuper(this,g0,arguments);nt(_this77,"emitEventType",Lt.DeleteNode);return _this77;}_inherits(g0,_te5);return _createClass(g0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.RemoveNode){if(n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;if(n===Mt.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 o;var s=[],f=[],p=[];var _iterator19=_createForOfIteratorHelper(e),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var c=_step19.value;if(c===Nt.selectorId){var S=this.localWork.workShapes.get(Nt.selectorId);if(!S)return;var O=S.selectIds&&_toConsumableArray(S.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 _l34=this.commandDeleteText(m);_l34&&s.push(_l34);}o=Ot(o,this.localWork.removeNode(m)),p.push(m);}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}var x=S==null?void 0:S.updateSelectIds([]);o=Ot(o,x.bgRect),this.localWork.clearWorkShapeNodeCache(Nt.selectorId),this.localWork.workShapes["delete"](Nt.selectorId),s.push({type:ct.Select,selectIds:[],willSyncService:i});continue;}var v=this.commandDeleteText(c);v&&s.push(v),o=Ot(o,this.localWork.removeNode(c)),p.push(c);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}i&&s.push({type:ct.RemoveNode,removeIds:p}),o&&n&&f.push({rect:wt(o),clearCanvas:xt.Bg,isClear:!0,viewId:a},{rect:wt(o),drawCanvas:xt.Bg,viewId:a}),(f.length||s.length)&&this.localWork._post({render:f,sp:s});}},{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:Mt.Local};}}]);}(te);var p0=/*#__PURE__*/function(_te6){function p0(){var _this78;_classCallCheck(this,p0);_this78=_callSuper(this,p0,arguments);nt(_this78,"emitEventType",Lt.ScaleNode);return _this78;}_inherits(p0,_te6);return _createClass(p0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(t){var o,e,n,i,a;return _regeneratorRuntime().wrap(function _callee23$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willSyncService,a=t.willSerializeData;_context25.t0=e===Nt.selectorId&&n;if(!_context25.t0){_context25.next=5;break;}_context25.next=5;return(o=this.localWork)==null?void 0:o.updateSelector({updateSelectorOpt:n,willSyncService:i,willSerializeData:a,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback.bind(this)});case 5:case"end":return _context25.stop();}},_callee23,this);}));function consumeForLocalWorker(_x37){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,o=t.newServiceStore,s=e.updateSelectorOpt,f=e.willSyncService,p=e.willSerializeData,c=s.workState,v=n.render||[],S=n.sp||[],O=a==null?void 0:a.selectRect;if(c===Rt.Start)return{sp:[],render:[]};if(f){c===Rt.Doing&&S.push({type:ct.Select,selectIds:i.selectIds,selectRect:O,willSyncService:!0,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt}),p&&c===Rt.Done&&S.push({type:ct.Select,selectIds:i.selectIds,selectRect:O,willSyncService:!1,isSync:!0,points:i.getChildrenPoints(),textOpt:i.textOpt});var _iterator21=_createForOfIteratorHelper(o.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?S.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.TextUpdate,dataType:Mt.Local,willSyncService:!0})):S.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:!0}));}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}}return{render:v,sp:S};}}]);}(te);var v0=/*#__PURE__*/function(_te7){function v0(){var _this79;_classCallCheck(this,v0);_this79=_callSuper(this,v0,arguments);nt(_this79,"emitEventType",Lt.RotateNode);return _this79;}_inherits(v0,_te7);return _createClass(v0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(t){var f,e,n,i,a,o,s;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,o=t.willSerializeData,s=t.emitEventType;_context26.t0=e===Nt.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,willSerializeData:o,emitEventType:s,isSync:!0,scene:this.scene,callback:this.updateSelectorCallback});case 5:case"end":return _context26.stop();}},_callee24,this);}));function consumeForLocalWorker(_x38){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,o=t.newServiceStore,s=e.updateSelectorOpt,f=e.willSyncService,p=e.willSerializeData,c=e.isSync,v=s.workState,S=n.render||[],O=n.sp||[],x=a==null?void 0:a.selectRect;if(f){p&&v===Rt.Done&&O.push({type:ct.Select,selectIds:i.selectIds,selectRect:x,willSyncService:!0,isSync:c,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(o.entries()),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _step22$value=_slicedToArray(_step22.value,2),m=_step22$value[0],_T45=_step22$value[1];O.push(_objectSpread(_objectSpread({},_T45),{},{workId:m,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:c}));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}return{render:S,sp:O};}}]);}(te);var m0=/*#__PURE__*/function(_te8){function m0(){var _this80;_classCallCheck(this,m0);_this80=_callSuper(this,m0,arguments);nt(_this80,"emitEventType",Lt.SetFontStyle);return _this80;}_inherits(m0,_te8);return _createClass(m0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(t){var f,e,n,i,a,o,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,o=t.willSerializeData,s=t.textUpdateForWoker;_context27.t0=e===Nt.selectorId&&n;if(!_context27.t0){_context27.next=5;break;}_context27.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context27.stop();}},_callee25,this);}));function consumeForLocalWorker(_x39){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,o=t.res,s=e.willSyncService,f=e.isSync,p=e.updateSelectorOpt,c=e.textUpdateForWoker,v=n.render||[],S=n.sp||[],O=o==null?void 0:o.selectRect;if(s&&S){p.fontSize&&S.push({type:ct.Select,selectIds:a.selectIds,selectRect:O,willSyncService:s,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];c&&m.toolsType===ht.Text?S.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.TextUpdate,dataType:Mt.Local,willSyncService:!0})):S.push(_objectSpread(_objectSpread({},m),{},{workId:x,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}}return{render:v,sp:S};}}]);}(te);var y0=/*#__PURE__*/function(_te9){function y0(){var _this81;_classCallCheck(this,y0);_this81=_callSuper(this,y0,arguments);nt(_this81,"emitEventType",Lt.SetPoint);return _this81;}_inherits(y0,_te9);return _createClass(y0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(t){var f,e,n,i,a,o,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,o=t.willSerializeData,s=t.textUpdateForWoker;_context28.t0=e===Nt.selectorId&&n;if(!_context28.t0){_context28.next=5;break;}_context28.next=5;return(f=this.localWork)==null?void 0:f.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,emitEventType:this.emitEventType,willSerializeData:o,isSync:!0,textUpdateForWoker:s,callback:this.updateSelectorCallback});case 5:case"end":return _context28.stop();}},_callee26,this);}));function consumeForLocalWorker(_x40){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,o=t.res,s=e.willSyncService,f=e.isSync,p=n.render||[],c=n.sp||[],v=o==null?void 0:o.selectRect;if(s&&c){var _iterator24=_createForOfIteratorHelper(i.entries()),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _step24$value=_slicedToArray(_step24.value,2),S=_step24$value[0],O=_step24$value[1];c.push(_objectSpread(_objectSpread({},O),{},{workId:S,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}c.push({type:ct.Select,selectIds:a.selectIds,selectRect:v,willSyncService:s,isSync:f,points:a.getChildrenPoints()});}return{render:p,sp:c};}}]);}(te);var S0=/*#__PURE__*/function(_te10){function S0(){var _this82;_classCallCheck(this,S0);_this82=_callSuper(this,S0,arguments);nt(_this82,"emitEventType",Lt.SetLock);return _this82;}_inherits(S0,_te10);return _createClass(S0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee27$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context29.t0=e===Nt.selectorId&&n;if(!_context29.t0){_context29.next=5;break;}_context29.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context29.stop();}},_callee27,this);}));function consumeForLocalWorker(_x41){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,o=t.res,s=e.willSyncService,f=e.isSync,p=e.updateSelectorOpt,c=n.render||[],v=n.sp||[],S=o==null?void 0:o.selectRect;if(s&&v){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];v.push(_objectSpread(_objectSpread({},x),{},{workId:O,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:f}));}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}v.push({isLocked:p.isLocked,selectorColor:a.selectorColor,scaleType:a.scaleType,canRotate:a.canRotate,type:ct.Select,selectIds:a.selectIds,selectRect:S,willSyncService:s,isSync:f});}return{render:c,sp:v};}}]);}(te);var x0=/*#__PURE__*/function(_te11){function x0(){var _this83;_classCallCheck(this,x0);_this83=_callSuper(this,x0,arguments);nt(_this83,"emitEventType",Lt.SetShapeOpt);return _this83;}_inherits(x0,_te11);return _createClass(x0,[{key:"consume",value:function consume(t){var e=t.msgType,n=t.dataType,i=t.emitEventType;if(e===ct.UpdateNode&&n===Mt.Local&&i===this.emitEventType)return this.consumeForLocalWorker(t),!0;}},{key:"consumeForLocalWorker",value:function(){var _consumeForLocalWorker10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(t){var s,e,n,i,a,o;return _regeneratorRuntime().wrap(function _callee28$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:e=t.workId,n=t.updateNodeOpt,i=t.willRefreshSelector,a=t.willSyncService,o=t.willSerializeData;_context30.t0=e===Nt.selectorId&&n;if(!_context30.t0){_context30.next=5;break;}_context30.next=5;return(s=this.localWork)==null?void 0:s.updateSelector({updateSelectorOpt:n,willRefreshSelector:i,willSyncService:a,willSerializeData:o,callback:this.updateSelectorCallback});case 5:case"end":return _context30.stop();}},_callee28,this);}));function consumeForLocalWorker(_x42){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,o=e.isSync,s=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),p=_step26$value[0],c=_step26$value[1];f.push(_objectSpread(_objectSpread({},c),{},{workId:p,type:ct.UpdateNode,updateNodeOpt:{useAnimation:!1},isSync:o}));}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}}return{render:s,sp:f};}}]);}(te);var T0=/*#__PURE__*/function(){function T0(r){var _this84=this;_classCallCheck(this,T0);nt(this,"builders",/* @__PURE__ */new Map());this.builders=new Map(r.map(function(t){return[t,_this84.build(t)];}));}return _createClass(T0,[{key:"build",value:function build(r){switch(r){case Lt.TranslateNode:return new d0();case Lt.ZIndexNode:return new h0();case Lt.CopyNode:return new Lh();case Lt.SetColorNode:return new u0();case Lt.DeleteNode:return new g0();case Lt.ScaleNode:return new p0();case Lt.RotateNode:return new v0();case Lt.SetFontStyle:return new m0();case Lt.SetPoint:return new y0();case Lt.SetLock:return new S0();case Lt.SetShapeOpt:return new x0();}}},{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 $e="cursorhover";var M0=/*#__PURE__*/function(){function M0(r,t){_classCallCheck(this,M0);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(M0,[{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;Uh(t)&&(r=!0);}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return r;}},{key:"has",value:function has(r){return 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=Jt(t.rect)),t.op&&(e.op=Jt(t.op)),t.canRotate&&(e.canRotate=t.canRotate),t.scaleType&&(e.scaleType=t.scaleType),t.opt&&(e.opt=Jt(t.opt)),t.toolsType&&(e.toolsType=t.toolsType),t.centerPos&&(e.centerPos=Jt(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(Re(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(Re(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 i;var e=Zn(t.toolsType);if(t.toolsType===ht.Text){var a=(i=this.fullLayer)==null?void 0:i.getElementsByName(r)[0];a&&e.updateLabels(t,a,this.fullLayer);}return this.fullLayer&&(e==null?void 0:e.getRectFromLayer(this.fullLayer,r));}},{key:"updateNodesRect",value:function updateNodesRect(){var _iterator31=_createForOfIteratorHelper(this.curNodeMap.entries()),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _step31$value=_slicedToArray(_step31.value,2),r=_step31$value[0],t=_step31$value[1];var _e8=this.getNodeRectFormShape(r,t);_e8?(t.rect=_e8,this.curNodeMap.set(r,t)):this.curNodeMap["delete"](r);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}}},{key:"combineIntersectRect",value:function combineIntersectRect(r){var t=r;return this.curNodeMap.forEach(function(e){Re(t,e.rect)&&(t=Ot(t,e.rect));}),t;}},{key:"setTarget",value:function setTarget(){return this.targetNodeMap.push(Jt(this.curNodeMap)),this.targetNodeMap.length-1;}},{key:"getLastTarget",value:function getLastTarget(){return this.targetNodeMap[this.targetNodeMap.length-1];}},{key:"deleteLastTarget",value:function deleteLastTarget(){this.targetNodeMap.length&&(this.targetNodeMap.length=this.targetNodeMap.length-1);}},{key:"getTarget",value:function getTarget(r){return this.targetNodeMap[r];}},{key:"deleteTarget",value:function deleteTarget(r){this.targetNodeMap.length=r;}},{key:"clearTarget",value:function clearTarget(){this.targetNodeMap.length=0;}}]);}();var qn=/*#__PURE__*/function(){function qn(r,t){_classCallCheck(this,qn);nt(this,"viewId");nt(this,"fullLayer");nt(this,"vNodes");nt(this,"dpr");nt(this,"contextType");nt(this,"opt");nt(this,"cameraOpt");nt(this,"scene");nt(this,"isSafari",!1);nt(this,"combinePostMsg",/* @__PURE__ */new Set());nt(this,"workerTaskId");nt(this,"protectedTask");if(this.viewId=r,this.opt=t,this.dpr=t.dpr,this.contextType=this.getSupportContextType(),!this.contextType)throw new Error("Sorry, your browser doesn't support canvas context type 2d or webgl");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 M0(r,this.scene);}return _createClass(qn,[{key:"setIsSafari",value:function setIsSafari(r){this.isSafari=r;}},{key:"on",value:function(){var _on=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(r){var t,e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee29$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:t=r.msgType,e=r.toolsType,n=r.opt,i=r.workId,a=r.workState,o=r.dataType;_context31.t0=t;_context31.next=_context31.t0===ct.Destroy?4:_context31.t0===ct.Clear?6:_context31.t0===ct.UpdateTools?8:_context31.t0===ct.CreateWork?10:_context31.t0===ct.DrawWork?12:14;break;case 4:this.destroy();return _context31.abrupt("break",14);case 6:this.clearAll();return _context31.abrupt("break",14);case 8:if(e&&n){s={toolsType:e,toolsOpt:n};this.localWork.setToolsOpt(s);}return _context31.abrupt("break",14);case 10:i&&n&&(!this.localWork.getTmpWorkShapeNode()&&e&&this.setToolsOpt({toolsType:e,toolsOpt:n}),this.setWorkOpt({workId:i,toolsOpt:n}));return _context31.abrupt("break",14);case 12:a===Rt.Done&&o===Mt.Local?this.consumeDrawAll(o,r):this.consumeDraw(o,r);return _context31.abrupt("break",14);case 14:case"end":return _context31.stop();}},_callee29,this);}));function on(_x43){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:"getSupportContextType",value:function getSupportContextType(){var r=new OffscreenCanvas(100,100),t=this.viewId==="mainView"?[Ce.Webgl2,Ce.Webgl,Ce.Canvas2d]:[Ce.Canvas2d];for(var _i2=0,_t3=t;_i2<_t3.length;_i2++){var _e9=_t3[_i2];if(r.getContext(_e9))return _e9;}}},{key:"createScene",value:function createScene(r){var t=r.width,e=r.height,n=new OffscreenCanvas(t,e);r.contextType&&delete r.contextType;var i=new Xh(_objectSpread(_objectSpread({container:n,displayRatio:this.dpr,depth:!1,desynchronized:!0,failIfMajorPerformanceCaveat:!0},r),{},{contextType:this.contextType,id:this.viewId}));return i.setAttribute("id",this.viewId),i;}},{key:"createLayer",value:function createLayer(r,t,e){var n=e.width,i=e.height,a="offscreen-".concat(r),o=t.layer(a,e),s=new ne({anchor:[0.5,0.5],pos:[n*0.5,i*0.5],size:[n,i],name:"viewport",id:r});return o.append(s),s;}},{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.toString(),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 _this85=this;var i,a;this.workerTaskId=void 0;var r=[],t=[];var e;var n=/* @__PURE__ */new Set();var _iterator32=_createForOfIteratorHelper(this.combinePostMsg.values()),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var o=_step32.value;if((i=o.render)!=null&&i.length){var _iterator33=_createForOfIteratorHelper(o.render),_step33;try{var _loop6=function _loop6(){var s=_step33.value;var f=!1;if(s.workId&&n.add(s.workId),s.isClearAll&&(s.rect=_this85.getSceneRect(),s.isClear=!0,delete s.isClearAll),s.drawCanvas){var p=_this85.getLayer(s.drawCanvas);if(!p)return 1;// continue
|
|
440
|
-
if(p.parent.render(),s.isDrawAll){var c=_this85.getSceneRect(),_this85$vNodes$getRec=_this85.vNodes.getRectIntersectRange(c,!1),v=_this85$vNodes$getRec.rectRange;s.rect=v,delete s.isDrawAll;}}var _iterator34=_createForOfIteratorHelper(r),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _p9=_step34.value;if(s.viewId===_p9.viewId){s.isClear&&_p9.clearCanvas&&_p9.isClear&&_p9.clearCanvas===s.clearCanvas&&(_p9.rect=Ot(_p9.rect,s.rect),f=!0),_p9.drawCanvas&&_p9.drawCanvas===s.drawCanvas&&(_p9.rect=Ot(_p9.rect,s.rect),f=!0);continue;}}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}if(!f)if(s.isClear&&!s.drawCanvas){var _p8=r.find(function(c){return c.drawCanvas===s.clearCanvas&&oe(c.rect,s.rect);});_p8!=null&&_p8.rect&&(_p8.rect=wt(_p8.rect,2)),r.unshift(s);}else s.drawCanvas&&!s.clearCanvas&&s.rect&&r.find(function(p){return p.isClear&&p.clearCanvas===s.drawCanvas&&oe(p.rect,s.rect);})&&(s.rect=wt(s.rect,2)),r.push(s);};for(_iterator33.s();!(_step33=_iterator33.n()).done;){if(_loop6())continue;}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}}if((a=o.sp)!=null&&a.length){var _iterator35=_createForOfIteratorHelper(o.sp),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var s=_step35.value;var f=!1;var _iterator36=_createForOfIteratorHelper(t),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var p=_step36.value;if(oe(s,p)){f=!0;break;}}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}f||t.push(s);}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}kt(o.drawCount)&&(e=o.drawCount);}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}return this.combinePostMsg.clear(),{render:r,sp:t,drawCount:e,workIds:n};}},{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 _n=/*#__PURE__*/function(){function _n(r){_classCallCheck(this,_n);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,"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(_n,[{key:"destroy",value:function destroy(){this.workShapeState.clear(),this.workShapes.clear();}},{key:"getWorkShapes",value:function getWorkShapes(){return this.workShapes;}},{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 xr(_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,e;(t=this.getWorkShape(r))==null||t.clearTmpPoints(),this.workShapes["delete"](r),this.workShapeState["delete"](r),((e=this.tmpWorkShapeNode)==null?void 0:e.getWorkId())===r&&this.setTmpWorkId(void 0);}},{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.toString(),a=t&&this.workShapes.get(i)||this.createWorkShapeNode({toolsOpt:e,toolsType:n,workId:i});return a?(a.setWorkId(i),this.workShapes.set(i,a),a):void 0;}}// abstract consumeDraw(data:IWorkerMessage): IMainMessage | undefined;
|
|
441
|
-
// abstract consumeDrawAll(data:IWorkerMessage): IMainMessage | undefined;
|
|
442
|
-
}]);}();var O0=_t,E0=function E0(){return O0.Date.now();},P0=E0,A0=/\s/;function C0(h){for(var r=h.length;r--&&A0.test(h.charAt(r)););return r;}var R0=C0,I0=R0,L0=/^\s+/;function b0(h){return h&&h.slice(0,I0(h)+1).replace(L0,"");}var D0=b0,w0=fe,N0=re,W0="[object Symbol]";function B0(h){return _typeof(h)=="symbol"||N0(h)&&w0(h)==W0;}var F0=B0,j0=D0,on=ae,U0=F0,an=NaN,z0=/^[-+]0x[0-9a-f]+$/i,$0=/^0b[01]+$/i,G0=/^0o[0-7]+$/i,H0=parseInt;function K0(h){if(typeof h=="number")return h;if(U0(h))return an;if(on(h)){var r=typeof h.valueOf=="function"?h.valueOf():h;h=on(r)?r+"":r;}if(typeof h!="string")return h===0?h:+h;h=j0(h);var t=$0.test(h);return t||G0.test(h)?H0(h.slice(2),t?2:8):z0.test(h)?an:+h;}var V0=K0,Y0=ae,tr=P0,ln=V0,X0="Expected a function",J0=Math.max,Q0=Math.min;function Z0(h,r,t){var e,n,i,a,o,s,f=0,p=!1,c=!1,v=!0;if(typeof h!="function")throw new TypeError(X0);r=ln(r)||0,Y0(t)&&(p=!!t.leading,c="maxWait"in t,i=c?J0(ln(t.maxWait)||0,r):i,v="trailing"in t?!!t.trailing:v);function S(M){var A=e,R=n;return e=n=void 0,f=M,a=h.apply(R,A),a;}function O(M){return f=M,o=setTimeout(T,r),p?S(M):a;}function x(M){var A=M-s,R=M-f,b=r-A;return c?Q0(b,i-R):b;}function m(M){var A=M-s,R=M-f;return s===void 0||A>=r||A<0||c&&R>=i;}function T(){var M=tr();if(m(M))return l(M);o=setTimeout(T,x(M));}function l(M){return o=void 0,v&&e?S(M):(e=n=void 0,a);}function d(){o!==void 0&&clearTimeout(o),f=0,e=s=n=o=void 0;}function u(){return o===void 0?a:l(tr());}function g(){var M=tr(),A=m(M);if(e=arguments,n=this,s=M,A){if(o===void 0)return O(s);if(c)return clearTimeout(o),o=setTimeout(T,r),S(s);}return o===void 0&&(o=setTimeout(T,r)),a;}return g.cancel=d,g.flush=u,g;}var k0=Z0,q0=k0,_0=ae,tg="Expected a function";function eg(h,r,t){var e=!0,n=!0;if(typeof h!="function")throw new TypeError(tg);return _0(t)&&(e="leading"in t?!!t.leading:e,n="trailing"in t?!!t.trailing:n),q0(h,r,{leading:e,maxWait:r,trailing:n});}var rg=eg,ng=/* @__PURE__ */ye(rg);var ig=/*#__PURE__*/function(_n7){function ig(t){var _this86;_classCallCheck(this,ig);_this86=_callSuper(this,ig,[t]);nt(_this86,"combineUnitTime",600);nt(_this86,"combineTimerId");nt(_this86,"effectSelectNodeData",/* @__PURE__ */new Set());nt(_this86,"batchEraserWorks",/* @__PURE__ */new Set());nt(_this86,"batchEraserRemoveNodes",/* @__PURE__ */new Set());nt(_this86,"batchEraserCombine",ng(function(){var t=_this86.updateBatchEraserCombineNode(_this86.batchEraserWorks,_this86.batchEraserRemoveNodes);_this86.batchEraserWorks.clear(),_this86.batchEraserRemoveNodes.clear(),t.length&&_this86._post({render:t});},100,{leading:!1}));return _this86;}_inherits(ig,_n7);return _createClass(ig,[{key:"consumeDraw",value:function consumeDraw(t,e){var _this87=this;var n=t.op,i=t.workId;if(n!=null&&n.length&&i){var a=this.workShapes.get(i.toString());if(!a)return;var o=a.toolsType;if(o===ht.LaserPen)return;var s=a.consume({data:t,isFullWork:!0});switch(o){case ht.Selector:s.type===ct.Select&&(s.selectIds&&e.runReverseSelectWork(s.selectIds),this.drawSelector(s));break;case ht.Eraser:s!=null&&s.rect&&this.drawEraser(s);break;case ht.Arrow:case ht.Straight:case ht.Ellipse:case ht.Rectangle:case ht.Star:case ht.Polygon:case ht.SpeechBalloon:s&&(this.drawCount++,this.drawPencil(s));break;case ht.Pencil:this.combineTimerId||(this.combineTimerId=setTimeout(function(){_this87.combineTimerId=void 0,_this87.drawPencilCombine(i.toString());},Math.floor(a.getWorkOptions().syncUnitTime||this.combineUnitTime/2))),s&&(this.drawCount++,this.drawPencil(s));break;}}}},{key:"consumeDrawAll",value:function consumeDrawAll(t,e){var a,o,s;this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0);var n=t.workId,i=t.scenePath;if(n){var f=n.toString(),p=this.workShapes.get(f);if(!p)return;var c=p.toolsType;if(c===ht.LaserPen)return;var v=this.workShapes.get($e),S=(a=v==null?void 0:v.selectIds)==null?void 0:a[0],O=p.consumeAll({data:t}),x=this.workShapeState.get(f);switch(c){case ht.Selector:O.selectIds&&S&&(o=O.selectIds)!=null&&o.includes(S)&&v.cursorBlur(),O.selectIds&&e.runReverseSelectWork(O.selectIds),this.drawSelector(_objectSpread(_objectSpread({},O),{},{scenePath:i})),(s=p.selectIds)!=null&&s.length?p.clearTmpPoints():this.clearWorkShapeNodeCache(f);break;case ht.Eraser:O!=null&&O.rect&&this.drawEraser(_objectSpread(_objectSpread({},O),{},{scenePath:i})),p.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({},O),{},{scenePath:i}),p.getWorkOptions(),x),this.drawCount=0,this.clearWorkShapeNodeCache(f);break;case ht.Pencil:O!=null&&O.rect&&(this.drawPencilFull(_objectSpread(_objectSpread({},O),{},{scenePath:i}),p.getWorkOptions(),x),this.drawCount=0),this.clearWorkShapeNodeCache(f);break;}}}},{key:"workShapesDone",value:function workShapesDone(t,e){var _iterator37=_createForOfIteratorHelper(this.workShapes.keys()),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var n=_step37.value;this.consumeDrawAll({workId:n,scenePath:t,viewId:this.viewId,msgType:ct.DrawWork,dataType:Mt.Local},e);}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}}},{key:"consumeFull",value:function(){var _consumeFull=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(t,e){var a,o,n,i,s,f,p,c,v,S,O;return _regeneratorRuntime().wrap(function _callee30$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:n=this.setFullWork(t),i=t.ops&&Le(t.ops);if(!n){_context32.next=23;break;}s=(a=t.workId)==null?void 0:a.toString();if(s){_context32.next=5;break;}return _context32.abrupt("return");case 5:f=(o=this.vNodes.get(s))==null?void 0:o.rect;if(!(n.toolsType===ht.Image&&e)){_context32.next=13;break;}_context32.next=9;return n.consumeServiceAsync({scene:e,isFullWork:!0,replaceId:s});case 9:p=_context32.sent;c=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);_context32.next=20;break;case 13:if(!(n.toolsType===ht.Text)){_context32.next=19;break;}_context32.next=16;return n.consumeServiceAsync({isFullWork:!0,replaceId:s});case 16:p=_context32.sent;_context32.next=20;break;case 19:p=n.consumeService({op:i,isFullWork:!0,replaceId:s}),c=(t==null?void 0:t.updateNodeOpt)&&n.updataOptService(t.updateNodeOpt);case 20:p=Ot(p,c);v=[],S=[];if(t.workId&&this.workShapes["delete"](t.workId.toString()),p&&t.willRefresh&&(f&&v.push({rect:p,isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId}),v.push({rect:p,drawCanvas:xt.Bg,viewId:this.viewId})),t.willSyncService&&S.push({opt:t.opt,toolsType:t.toolsType,type:ct.FullWork,workId:t.workId,ops:t.ops,updateNodeOpt:t.updateNodeOpt,viewId:this.viewId}),v.length||S.length){O={render:v,sp:S};this._post(O);}case 23:case"end":return _context32.stop();}},_callee30,this);}));function consumeFull(_x44,_x45){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);if(i){var a=[];a.push({rect:wt(i),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(i),drawCanvas:xt.Bg,viewId:this.viewId}),a.length&&this._post({render:a});}}}},{key:"removeNode",value:function removeNode(t){var n;var e=this.vNodes.get(t);return e&&((n=this.fullLayer)==null||n.getElementsByName(t).forEach(function(i){i.remove();}),this.vNodes["delete"](t)),this.clearWorkShapeNodeCache(t),e==null?void 0:e.rect;}},{key:"checkTextActive",value:function(){var _checkTextActive=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(t){var e,n,i,a,_iterator38,_step38,o,s,f,p,c,v,S;return _regeneratorRuntime().wrap(function _callee31$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:e=t.op,n=t.viewId,i=t.dataType;if(!(e!=null&&e.length)){_context33.next=26;break;}_iterator38=_createForOfIteratorHelper(this.vNodes.curNodeMap.values());_context33.prev=3;_iterator38.s();case 5:if((_step38=_iterator38.n()).done){_context33.next=13;break;}o=_step38.value;s=o.rect,f=o.name,p=o.toolsType,c=o.opt,v=e[0]*this.fullLayer.worldScaling[0]+this.fullLayer.worldPosition[0],S=e[1]*this.fullLayer.worldScaling[1]+this.fullLayer.worldPosition[1];if(!(p===ht.Text&&Fh([v,S],s)&&c.workState===Rt.Done)){_context33.next=11;break;}a=f;return _context33.abrupt("break",13);case 11:_context33.next=5;break;case 13:_context33.next=18;break;case 15:_context33.prev=15;_context33.t0=_context33["catch"](3);_iterator38.e(_context33.t0);case 18:_context33.prev=18;_iterator38.f();return _context33.finish(18);case 21:_context33.t1=a;if(!_context33.t1){_context33.next=26;break;}_context33.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 _context33.stop();}},_callee31,this,[[3,15,18,21]]);}));function checkTextActive(_x46){return _checkTextActive.apply(this,arguments);}return checkTextActive;}()},{key:"colloctEffectSelectWork",value:function(){var _colloctEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(t){var _this88=this;var e,n,i;return _regeneratorRuntime().wrap(function _callee32$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:e=this.workShapes.get(Nt.selectorId),n=t.workId,i=t.msgType;if(!(e&&n&&e.selectIds&&e.selectIds.includes(n.toString()))){_context34.next=8;break;}i===ct.RemoveNode?e.selectIds=e.selectIds.filter(function(a){return a!==n.toString();}):this.effectSelectNodeData.add(t);_context34.next=5;return new Promise(function(a){setTimeout(function(){a(!0);},0);});case 5:_context34.next=7;return this.runEffectSelectWork(!0).then(function(){var a;(a=_this88.effectSelectNodeData)==null||a.clear();});case 7:return _context34.abrupt("return");case 8:return _context34.abrupt("return",t);case 9:case"end":return _context34.stop();}},_callee32,this);}));function colloctEffectSelectWork(_x47){return _colloctEffectSelectWork.apply(this,arguments);}return colloctEffectSelectWork;}()},{key:"updateSelector",value:function(){var _updateSelector2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(t){var _this89=this;var O,e,n,i,a,o,s,f,p,c,v,S;return _regeneratorRuntime().wrap(function _callee33$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:e=this.workShapes.get(Nt.selectorId);if((O=e==null?void 0:e.selectIds)!=null&&O.length){_context35.next=3;break;}return _context35.abrupt("return");case 3:n=t.callback;i=_objectWithoutProperties(t,_excluded2);a=i.updateSelectorOpt;o=i.willSerializeData;s=i.scene;_context35.next=10;return e==null?void 0:e.updateSelector({updateSelectorOpt:a,selectIds:e.selectIds,vNodes:this.vNodes,willSerializeData:o,worker:this,scene:s});case 10:f=_context35.sent;p=/* @__PURE__ */new Map();e.selectIds.forEach(function(x){var m=_this89.vNodes.get(x);if(m){var _T46=m.toolsType,_l35=m.op,d=m.opt;p.set(x,{opt:d,toolsType:_T46,ops:(_l35==null?void 0:_l35.length)&&qt(_l35)||void 0});}});c=[],v=[];f!=null&&f.rect&&c.push({rect:wt(f.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(f.rect),drawCanvas:xt.Bg,viewId:this.viewId});S=n&&n({res:f,workShapeNode:e,param:i,postData:{render:c,sp:v},newServiceStore:p})||{render:c,sp:v};(S.render.length||S.sp.length)&&this._post(S);case 17:case"end":return _context35.stop();}},_callee33,this);}));function updateSelector(_x48){return _updateSelector2.apply(this,arguments);}return updateSelector;}()},{key:"blurSelector",value:function(){var _blurSelector=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(t){var i,e,n,a;return _regeneratorRuntime().wrap(function _callee34$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:e=this.workShapes.get(Nt.selectorId),n=e==null?void 0:e.blurSelector();if(this.clearWorkShapeNodeCache(Nt.selectorId),((i=this.fullLayer)==null?void 0:i.parent).children.forEach(function(a){a.name===Nt.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:wt(n.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(n.rect),drawCanvas:xt.Bg,viewId:this.viewId}],sp:a});}case 2:case"end":return _context36.stop();}},_callee34,this);}));function blurSelector(_x49){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(Nt.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 o=Ot(n,i)||i;this._post({render:[{rect:wt(o),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(o),drawCanvas:xt.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,o,s,f,p,c;var e=this.workShapes.get(Nt.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.toString()),this.updateFullSelectWork(t);return;}if(e&&n!=null&&n.length){var _e$updateSelectIds=e.updateSelectIds(n),v=_e$updateSelectIds.bgRect,S=_e$updateSelectIds.selectRect,O={render:[],sp:[]};v&&((a=O.render)==null||a.push({rect:wt(v),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(v),drawCanvas:xt.Bg,viewId:this.viewId})),(c=O.sp)==null||c.push(_objectSpread(_objectSpread({},t),{},{selectorColor:((o=t.opt)==null?void 0:o.strokeColor)||e.selectorColor,strokeColor:((s=t.opt)==null?void 0:s.strokeColor)||e.strokeColor,fillColor:((f=t.opt)==null?void 0:f.fillColor)||e.fillColor,textOpt:((p=t.opt)==null?void 0:p.textOpt)||e.textOpt,canTextEdit:e.canTextEdit,canRotate:e.canRotate,scaleType:e.scaleType,type:ct.Select,selectRect:S,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(){this.combineTimerId&&(clearTimeout(this.combineTimerId),this.combineTimerId=void 0),_get(_getPrototypeOf(ig.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 o={render:[],drawCount:this.drawCount};if(e!=null&&e.rect){var s=wt(e.rect);(i=o.render)==null||i.push({rect:s,isClear:!0,clearCanvas:xt.Float,viewId:this.viewId}),(a=o.render)==null||a.push({rect:s,drawCanvas:xt.Float,viewId:this.viewId});}this._post(o);}}},{key:"drawSelector",value:function drawSelector(t){var n;var e={render:[],sp:[t]};t.rect&&((n=e.render)==null||n.push({rect:wt(t.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(t.rect),drawCanvas:xt.Bg,viewId:this.viewId})),this._post(e);}},{key:"drawEraser",value:function(){var _drawEraser=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(t){var _this90=this;var n,i,e,_iterator39,_step39,a,o;return _regeneratorRuntime().wrap(function _callee35$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:e=[];if((n=t.newWorkDatas)!=null&&n.size){_iterator39=_createForOfIteratorHelper(t.newWorkDatas.values());try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){a=_step39.value;o=a.workId.toString();this.batchEraserWorks.add(o),e.push({type:ct.FullWork,workId:o,ops:qt(a.op),opt:a.opt,toolsType:a.toolsType,updateNodeOpt:{useAnimation:!1}});}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}delete t.newWorkDatas;}(i=t.removeIds)==null||i.forEach(function(a){_this90.batchEraserRemoveNodes.add(a);}),e.push(t),this._post({sp:e}),this.batchEraserCombine();case 3:case"end":return _context37.stop();}},_callee35,this);}));function drawEraser(_x50){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 o;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]};(o=a.render)==null||o.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId},{rect:t.rect,isClear:i,clearCanvas:xt.Bg,viewId:this.viewId},{rect:t.rect,drawCanvas:xt.Bg,viewId:this.viewId}),this._post(a);}},{key:"updateBatchEraserCombineNode",value:function updateBatchEraserCombineNode(t,e){var _this91=this;var n=[];var i;var _iterator40=_createForOfIteratorHelper(e.keys()),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var a=_step40.value;this.fullLayer.getElementsByName(a).forEach(function(o){var s=o.getBoundingClientRect();i=Ot(i,{x:s.x-ie.SafeBorderPadding,y:s.y-ie.SafeBorderPadding,w:s.width+ie.SafeBorderPadding*2,h:s.height+ie.SafeBorderPadding*2}),o.remove();});}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}return t.forEach(function(a){var o=_this91.vNodes.get(a);if(o)if(_this91.fullLayer.getElementsByName(a)[0])i=Ot(i,o.rect);else{var f=_this91.setFullWork(_objectSpread(_objectSpread({},o),{},{workId:a})),p=f&&f.consumeService({op:o.op,isFullWork:!0});p&&(o.rect=p,i=Ot(i,p));}}),i&&n.push({rect:i,isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:i,drawCanvas:xt.Bg,viewId:this.viewId}),n;}},{key:"runEffectSelectWork",value:function(){var _runEffectSelectWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(t){var e,n,i,_iterator41,_step41,a,o,s,f;return _regeneratorRuntime().wrap(function _callee36$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:_iterator41=_createForOfIteratorHelper(this.effectSelectNodeData.values());_context38.prev=1;_iterator41.s();case 3:if((_step41=_iterator41.n()).done){_context38.next=23;break;}a=_step41.value;o=this.setFullWork(a);if(!o){_context38.next=21;break;}s=(e=o.getWorkId())==null?void 0:e.toString();if(!(o.toolsType===ht.Image)){_context38.next=13;break;}_context38.next=11;return o.consumeServiceAsync({scene:(i=(n=this.drawLayer)==null?void 0:n.parent)==null?void 0:i.parent,isFullWork:!0,replaceId:s});case 11:_context38.next=20;break;case 13:if(!(o.toolsType===ht.Text)){_context38.next=18;break;}_context38.next=16;return o.consumeServiceAsync({isFullWork:!0,replaceId:s});case 16:_context38.next=20;break;case 18:f=a.ops&&Le(a.ops);o.consumeService({op:f,isFullWork:!0,replaceId:s}),a!=null&&a.updateNodeOpt&&o.updataOptService(a.updateNodeOpt);case 20:a.workId&&this.workShapes["delete"](a.workId.toString());case 21:_context38.next=3;break;case 23:_context38.next=28;break;case 25:_context38.prev=25;_context38.t0=_context38["catch"](1);_iterator41.e(_context38.t0);case 28:_context38.prev=28;_iterator41.f();return _context38.finish(28);case 31:this.reRenderSelector(t);case 32:case"end":return _context38.stop();}},_callee36,this,[[1,25,28,31]]);}));function runEffectSelectWork(_x51){return _runEffectSelectWork.apply(this,arguments);}return runEffectSelectWork;}()},{key:"cursorHover",value:function cursorHover(t){var o;var e=t.opt,n=t.toolsType,i=t.point,a=this.setFullWork({workId:$e,toolsType:n,opt:e});if(a&&i){var s=a.cursorHover(i),f={render:[]};s&&s.type===ct.CursorHover&&s.rect&&((o=f.render)==null||o.push({rect:wt(s.rect),clearCanvas:xt.Bg,isClear:!0,viewId:this.viewId},{rect:wt(s.rect),drawCanvas:xt.Bg,viewId:this.viewId}),this._post(f));}}}]);}(_n);var sg=/*#__PURE__*/function(){function sg(r){_classCallCheck(this,sg);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(sg,[{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 _this92=this;this.workShapes.forEach(function(r,t){r.toolsType===ht.LaserPen?setTimeout(function(){_this92.workShapes["delete"](t);},2e3):_this92.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=xr({toolsType:t,toolsOpt:e,vNodes:this.vNodes,fullLayer:this.fullLayer,drawLayer:this.drawLayer},this),r;}},{key:"runReverseSelectWork",value:function runReverseSelectWork(r){var _this93=this;r.forEach(function(t){_this93.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),_this93.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 o;r.indexOf(Nt.selectorId)>-1&&this.removeSelectWork(t);var i=e;var a=(o=this.vNodes.get(r))==null?void 0:o.rect;a&&(i=Ot(a,i)),this.fullLayer.getElementsByName(r).forEach(function(s){s.remove();}),this.drawLayer.getElementsByName(r).forEach(function(s){s.remove();}),this.vNodes["delete"](r),i&&this.post({render:[{rect:wt(i),isClear:!0,clearCanvas:n?xt.Bg:xt.ServiceFloat,workerType:n?void 0:Mt.Service,viewId:this.viewId},{rect:wt(i),drawCanvas:n?xt.Bg:xt.ServiceFloat,workerType:n?void 0:Mt.Service,viewId:this.viewId}]});}},{key:"activeWorkShape",value:function activeWorkShape(r){var S,O,x,m;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op,f=r.useAnimation;if(!t)return;var p=t.toString(),c=(S=this.vNodes.get(p))==null?void 0:S.rect;if(!((O=this.workShapes)!=null&&O.has(p))){var _T47={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,useAnimation:_typeof(f)<"u"?f:_typeof(a==null?void 0:a.useAnimation)<"u"?a==null?void 0:a.useAnimation:!0,oldRect:c,isDiff:!1};n&&e&&(_T47=this.setNodeKey(_T47,n,e)),(x=this.workShapes)==null||x.set(p,_T47);}var v=(m=this.workShapes)==null?void 0:m.get(p);i&&(v.type=i),o&&(v.animationWorkData=Le(o),v.ops=o),a&&(v.updateNodeOpt=a),s&&(v.isDiff=this.hasDiffData(v.animationWorkData||[],s,v.toolsType),v.animationWorkData=s),v.node&&v.node.getWorkId()!==p&&v.node.setWorkId(p),c&&(v.oldRect=c),n&&e&&(v.toolsType!==n&&n&&e&&this.setNodeKey(v,n,e),v.node&&v.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 _i3=0;_i3<n;_i3+=2)if(t[_i3]!==r[_i3]||t[_i3+1]!==r[_i3+1])return!0;break;}}return!1;}},{key:"animationDraw",value:function(){var _animationDraw=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(){var _this94=this;var n,i,a,o,s,f,p,c,v,S,O,x,m,T,l,d,u,g,M,A,R,b,E,L,D,I,C,W,G,K,J,r,t,e,_iterator42,_step42,_loop7;return _regeneratorRuntime().wrap(function _callee37$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:this.animationId=void 0;r=!1;t={render:[]},e=/* @__PURE__ */new Map();_iterator42=_createForOfIteratorHelper(this.workShapes.entries());_context40.prev=4;_loop7=/*#__PURE__*/_regeneratorRuntime().mark(function _loop7(){var _step42$value,Z,B,$,Q,_$3,_Q,_$4,_Q2,et,tt,_$5,_Q3,_$6,_Q4,_et3,_tt3,ot,q,gt,_q2;return _regeneratorRuntime().wrap(function _loop7$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:_step42$value=_slicedToArray(_step42.value,2),Z=_step42$value[0],B=_step42$value[1];_context39.t0=B.toolsType;_context39.next=_context39.t0===ht.Image?4:_context39.t0===ht.Text?11:_context39.t0===ht.Arrow?19:_context39.t0===ht.Straight?19:_context39.t0===ht.Rectangle?19:_context39.t0===ht.Ellipse?19:_context39.t0===ht.Star?19:_context39.t0===ht.Polygon?19:_context39.t0===ht.SpeechBalloon?19:_context39.t0===ht.Pencil?22:37;break;case 4:$=B.oldRect;$&&((n=t.render)==null||n.push({rect:$,isClear:!0,clearCanvas:xt.Bg,viewId:_this94.viewId}),(i=t.render)==null||i.push({rect:$,drawCanvas:xt.Bg,viewId:_this94.viewId}));_context39.next=8;return(o=B.node)==null?void 0:o.consumeServiceAsync({isFullWork:!0,scene:(a=_this94.fullLayer.parent)==null?void 0:a.parent});case 8:Q=_context39.sent;_this94.selectorWorkShapes.forEach(function(et,tt){var ot;(ot=et.selectIds)!=null&&ot.includes(Z)&&(_this94.willRunEffectSelectorIds.add(tt),_this94.noAnimationRect=Ot(_this94.noAnimationRect,$),_this94.noAnimationRect=Ot(_this94.noAnimationRect,Q),_this94.runEffect());}),_this94.workShapes["delete"](Z),(s=t.render)==null||s.push({rect:Q,drawCanvas:xt.Bg,viewId:_this94.viewId});return _context39.abrupt("break",37);case 11:if(!B.node){_context39.next=18;break;}_$3=B.oldRect;_$3&&((f=t.render)==null||f.push({rect:_$3,isClear:!0,clearCanvas:xt.Bg,viewId:_this94.viewId}),(p=t.render)==null||p.push({rect:_$3,drawCanvas:xt.Bg,viewId:_this94.viewId}));_context39.next=16;return B.node.consumeServiceAsync({isFullWork:!0,replaceId:Z});case 16:_Q=_context39.sent;_this94.selectorWorkShapes.forEach(function(et,tt){var ot;(ot=et.selectIds)!=null&&ot.includes(Z)&&(_this94.willRunEffectSelectorIds.add(tt),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_$3),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_Q),_this94.runEffect());}),(c=B.node)==null||c.clearTmpPoints(),_this94.workShapes["delete"](Z),(v=t.render)==null||v.push({rect:_Q,drawCanvas:xt.Bg,viewId:_this94.viewId});case 18:return _context39.abrupt("break",37);case 19:_$4=!!B.ops;if((S=B.animationWorkData)!=null&&S.length){_Q2=B.oldRect,et=B.node.oldRect;_Q2&&((O=t.render)==null||O.push({rect:_Q2,isClear:!0,clearCanvas:xt.Bg,viewId:_this94.viewId}),(x=t.render)==null||x.push({rect:_Q2,drawCanvas:xt.Bg,viewId:_this94.viewId})),et&&((m=t.render)==null||m.push({rect:et,isClear:!0,clearCanvas:xt.ServiceFloat,viewId:_this94.viewId}));tt=(T=B.node)==null?void 0:T.consumeService({op:B.animationWorkData,isFullWork:_$4});e.set(Z,{workState:_Q2?B.ops?Rt.Done:Rt.Doing:Rt.Start,op:B.animationWorkData.filter(function(ot,q){if(q%3!==2)return!0;}).slice(-2)}),_$4?(_this94.selectorWorkShapes.forEach(function(ot,q){var gt;(gt=ot.selectIds)!=null&>.includes(Z)&&(_this94.willRunEffectSelectorIds.add(q),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_Q2),_this94.noAnimationRect=Ot(_this94.noAnimationRect,et),_this94.noAnimationRect=Ot(_this94.noAnimationRect,tt),_this94.runEffect());}),(l=B.node)==null||l.clearTmpPoints(),_this94.workShapes["delete"](Z),(d=t.render)==null||d.push({rect:tt,drawCanvas:xt.Bg,viewId:_this94.viewId})):(u=t.render)==null||u.push({rect:tt,drawCanvas:xt.ServiceFloat,workerType:_$4?void 0:Mt.Service,viewId:_this94.viewId}),B.animationWorkData.length=0;}return _context39.abrupt("break",37);case 22:if(!(!B.useAnimation&&B.ops)){_context39.next=28;break;}_$5=(g=B.node)==null?void 0:g.consumeService({op:B.animationWorkData||[],isFullWork:!0,replaceId:Z});_Q3=(M=B.node)==null?void 0:M.updataOptService(B.updateNodeOpt);_$5=Ot(_$5,_Q3),(A=t.render)==null||A.push({isClear:!0,rect:Ot(B.oldRect,_$5),clearCanvas:xt.Bg,viewId:_this94.viewId}),(R=t.render)==null||R.push({rect:Ot(B.oldRect,_$5),drawCanvas:xt.Bg,viewId:_this94.viewId}),_this94.selectorWorkShapes.forEach(function(et,tt){var ot;(ot=et.selectIds)!=null&&ot.includes(Z)&&(_this94.willRunEffectSelectorIds.add(tt),_this94.noAnimationRect=Ot(_this94.noAnimationRect,_$5),_this94.runEffect());}),(b=B.node)==null||b.clearTmpPoints(),_this94.workShapes["delete"](Z);_context39.next=36;break;case 28:if(!B.useAnimation){_context39.next=36;break;}if(!B.isDel){_context39.next=32;break;}(E=B.node)==null||E.clearTmpPoints(),_this94.workShapes["delete"](Z);return _context39.abrupt("break",37);case 32:_$6=3,_Q4=_this94.computNextAnimationIndex(B,_$6),_et3=B.isDiff?0:Math.max(0,(B.animationIndex||0)-_$6),_tt3=(B.animationWorkData||[]).slice(_et3,_Q4),ot=(D=(L=B.node)==null?void 0:L.getWorkId())==null?void 0:D.toString();if((B.animationIndex||0)<_Q4||B.isDiff){q=(I=B.node)==null?void 0:I.consumeService({op:_tt3,isFullWork:!1});if((C=t.render)==null||C.push({rect:q,drawCanvas:xt.ServiceFloat,viewId:_this94.viewId}),B.animationIndex=_Q4,B.isDiff&&(B.isDiff=!1),_tt3.length){gt=_tt3.filter(function(dt,F){if(F%_$6!==_$6-1)return!0;}).slice(-2);e.set(Z,{workState:_et3===0?Rt.Start:_Q4===((W=B.animationWorkData)==null?void 0:W.length)?Rt.Done:Rt.Doing,op:gt});}}else if(B.ops){_q2=(G=B.node)==null?void 0:G.consumeService({op:B.animationWorkData||[],isFullWork:!0,replaceId:ot});B.isDel=!0,(K=t.render)==null||K.push({isClear:!0,rect:_q2,clearCanvas:xt.ServiceFloat,viewId:_this94.viewId},{rect:_q2,drawCanvas:xt.ServiceFloat,viewId:_this94.viewId},{isClear:!0,rect:_q2,clearCanvas:xt.Bg,viewId:_this94.viewId},{rect:_q2,drawCanvas:xt.Bg,viewId:_this94.viewId}),e.set(Z,{workState:Rt.Done,op:_tt3.filter(function(gt,dt){if(dt%_$6!==_$6-1)return!0;}).slice(-2)});}r=!0;return _context39.abrupt("break",37);case 36:return _context39.abrupt("break",37);case 37:case"end":return _context39.stop();}},_loop7);});_iterator42.s();case 7:if((_step42=_iterator42.n()).done){_context40.next=11;break;}return _context40.delegateYield(_loop7(),"t0",9);case 9:_context40.next=7;break;case 11:_context40.next=16;break;case 13:_context40.prev=13;_context40.t1=_context40["catch"](4);_iterator42.e(_context40.t1);case 16:_context40.prev=16;_iterator42.f();return _context40.finish(16);case 19:r&&this.runAnimation(),e.size&&(t.sp=[],e.forEach(function(Z,B){var $;($=t.sp)==null||$.push({type:ct.Cursor,uid:B.split(Sr)[0],op:Z.op,workState:Z.workState,viewId:_this94.viewId});})),(J=t.render)!=null&&J.length&&this.post(t);case 20:case"end":return _context40.stop();}},_callee37,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 _this95=this;this.runEffectId=void 0;var r=this.noAnimationRect;this.willRunEffectSelectorIds.forEach(function(t){var i,a;var e=_this95.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||_this95.selectorWorkShapes["delete"](t);}),r&&this.post({render:[{rect:wt(r),isClear:!0,clearCanvas:xt.Bg,viewId:this.viewId},{rect:wt(r),drawCanvas:xt.Bg,viewId:this.viewId}]}),this.willRunEffectSelectorIds.clear(),this.noAnimationRect=void 0;}},{key:"activeSelectorShape",value:function activeSelectorShape(r){var f,p,c;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.selectIds;if(!t)return;var o=t.toString();if(!((f=this.selectorWorkShapes)!=null&&f.has(o))){var v={toolsType:n,selectIds:a,type:i,opt:e};n&&e&&(v=this.setNodeKey(v,n,e)),(p=this.selectorWorkShapes)==null||p.set(o,v);}var s=(c=this.selectorWorkShapes)==null?void 0:c.get(o);i&&(s.type=i),s.node&&s.node.getWorkId()!==o&&s.node.setWorkId(o),s.selectIds=a||[];}}]);}();var og=/*#__PURE__*/function(_n8){function og(t){var _this96;_classCallCheck(this,og);_this96=_callSuper(this,og,[t]);nt(_this96,"combineDrawTimer");return _this96;}_inherits(og,_n8);return _createClass(og,[{key:"runFullWork",value:function(){var _runFullWork=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(t){var i,a,e,n,o,s,f;return _regeneratorRuntime().wrap(function _callee38$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:e=this.setFullWork(t),n=t.ops&&Le(t.ops);if(!e){_context41.next=18;break;}f=(i=e.getWorkId())==null?void 0:i.toString();if(!(e.toolsType===ht.Image)){_context41.next=9;break;}_context41.next=6;return e.consumeServiceAsync({isFullWork:!0,scene:(a=this.fullLayer.parent)==null?void 0:a.parent});case 6:o=_context41.sent;_context41.next=16;break;case 9:if(!(e.toolsType===ht.Text)){_context41.next=15;break;}_context41.next=12;return e.consumeServiceAsync({isFullWork:!0,replaceId:f,isDrawLabel:!0});case 12:o=_context41.sent;_context41.next=16;break;case 15:o=e.consumeService({op:n,isFullWork:!0,replaceId:f}),s=(t==null?void 0:t.updateNodeOpt)&&e.updataOptService(t.updateNodeOpt);case 16:t.workId&&this.workShapes["delete"](t.workId.toString());return _context41.abrupt("return",Ot(o,s));case 18:case"end":return _context41.stop();}},_callee38,this);}));function runFullWork(_x52){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:"workShapesDone",value:function workShapesDone(){var _iterator43=_createForOfIteratorHelper(this.workShapes.keys()),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var t=_step43.value;this.clearWorkShapeNodeCache(t);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}this.fullLayer.removeAllChildren();}},{key:"consumeDraw",value:function consumeDraw(t){var e=t.workId,n=e&&this.workShapes.get(e.toString());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=e.toString(),i=this.workShapes.get(n);if(!i)return;switch(i.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(n);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$worldScaling=_slicedToArray(t.worldScaling,1),o=_t$worldScaling[0],_e$opt=e.opt,s=_e$opt.underline,f=_e$opt.lineThrough;s&&t.getElementsByName("".concat(i,"_underline"))[0].attr({points:[0,0,a/o,0]}),f&&t.getElementsByName("".concat(i,"_lineThrough"))[0].attr({points:[0,0,a/o,0]});}});}},{key:"removeWork",value:function removeWork(t){var e=t.workId,n=e==null?void 0:e.toString();if(n){var i=this.removeNode(n);if(i){var a=[];a.push({rect:wt(i),clearCanvas:xt.Float,isClear:!0,viewId:this.viewId},{rect:wt(i),drawCanvas:xt.Float,viewId:this.viewId}),this._post({render:a});}}}},{key:"removeNode",value:function removeNode(t){var e=this.workShapes.has(t);var n;return e&&(this.fullLayer.getElementsByName(t).forEach(function(i){var a=i.getBoundingClientRect();n=Ot(n,{x:a.x-yt.SafeBorderPadding,y:a.y-yt.SafeBorderPadding,w:a.width+yt.SafeBorderPadding*2,h:a.height+yt.SafeBorderPadding*2}),i.remove();}),n&&this.clearWorkShapeNodeCache(t)),n;}},{key:"drawPencil",value:function drawPencil(t,e){this._post({drawCount:this.drawCount,render:[{rect:t==null?void 0:t.rect,workId:e,drawCanvas:xt.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)&&wt(t.rect),isClear:!0,clearCanvas:xt.Float,viewId:this.viewId},{rect:(t==null?void 0:t.rect)&&wt(t.rect),drawCanvas:xt.Float,viewId:this.viewId}]});}}]);}(_n);var ag=/*#__PURE__*/function(){function ag(r){_classCallCheck(this,ag);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(ag,[{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 xr(_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===Mt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consume({data:r,isFullWork:!1,isSubWorker:!0});a.rect&&(i.totalRect=Ot(a.rect,i.totalRect),i.result=a,i.workState=Rt.Doing,n&&this.localWorkShapes.set(n,i));}this.runAnimation();}},{key:"consumeDrawAll",value:function consumeDrawAll(r){var t=r.workId,e=r.dataType;if(e===Mt.Service)this.activeServiceWorkShape(r);else{var n=t==null?void 0:t.toString(),i=n&&this.localWorkShapes.get(n);if(!i)return;var a=i.node.consumeAll({data:r});i.totalRect=Ot(a.rect,i.totalRect),i.result=a,i.workState=Rt.Done,n&&this.localWorkShapes.set(n,i);}this.runAnimation();}},{key:"destroy",value:function destroy(){this.serviceWorkShapes.clear(),this.localWorkShapes.clear();}},{key:"setNodeKey",value:function setNodeKey(r,t,e){return r.toolsType=t,r.node=this.createWorkShapeNode({toolsType:t,toolsOpt:e}),r;}},{key:"activeServiceWorkShape",value:function activeServiceWorkShape(r){var v,S;var t=r.workId,e=r.opt,n=r.toolsType,i=r.type,a=r.updateNodeOpt,o=r.ops,s=r.op;if(!t)return;var f=t.toString(),p=(v=this.vNodes.get(f))==null?void 0:v.rect;if(!((S=this.serviceWorkShapes)!=null&&S.has(f))){var O={toolsType:n,animationWorkData:s||[],animationIndex:0,type:i,updateNodeOpt:a,ops:o,oldRect:p};n&&e&&(O=this.setNodeKey(O,n,e)),this.serviceWorkShapes.set(f,O);}var c=this.serviceWorkShapes.get(f);i&&(c.type=i),o&&(c.animationWorkData=Le(o),c.ops=o),a&&(c.updateNodeOpt=a),s&&(c.animationWorkData=s),c.node&&c.node.getWorkId()!==f&&c.node.setWorkId(f),p&&(c.oldRect=p),n&&e&&(c.toolsType!==n&&n&&e&&this.setNodeKey(c,n,e),c.node&&c.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 _callee39(){var _this97=this;var a,o,s,f,r,t,e,n,i,_iterator44,_step44,_step44$value,p,c,S,O,x,m,_iterator45,_step45,_step45$value,_p10,_c6,v,_S8,_O2,_x53,_m14;return _regeneratorRuntime().wrap(function _callee39$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:this.animationId=void 0;r=!1;t=/* @__PURE__ */new Map(),e=[],n=[],i=[];_iterator44=_createForOfIteratorHelper(this.serviceWorkShapes.entries());_context42.prev=4;_iterator44.s();case 6:if((_step44=_iterator44.n()).done){_context42.next=20;break;}_step44$value=_slicedToArray(_step44.value,2),p=_step44$value[0],c=_step44$value[1];_context42.t0=c.toolsType;_context42.next=_context42.t0===ht.LaserPen?11:18;break;case 11:S=this.computNextAnimationIndex(c,8),O=Math.max(0,c.animationIndex||0),x=(c.animationWorkData||[]).slice(O,S);if((c.animationIndex||0)<S){m=(a=c.node)==null?void 0:a.consumeService({op:x,isFullWork:!1});c.totalRect=Ot(c.totalRect,m),c.animationIndex=S,x.length&&t.set(p,{workState:O===0?Rt.Start:S===((o=c.animationWorkData)==null?void 0:o.length)?Rt.Done:Rt.Doing,op:x.slice(-2)});}if(!(n.push({isClear:!0,rect:c.totalRect,clearCanvas:xt.TopFloat,viewId:this.viewId}),e.push({rect:c.totalRect,drawCanvas:xt.TopFloat,viewId:this.viewId}),c.isDel)){_context42.next=16;break;}(s=c.node)==null||s.clearTmpPoints(),this.serviceWorkShapes["delete"](p);return _context42.abrupt("break",18);case 16:c.ops&&c.animationIndex===((f=c.animationWorkData)==null?void 0:f.length)&&!c.isDel&&(this.topLayer.getElementsByName(p.toString())[0]||(c.isDel=!0,this.serviceWorkShapes.set(p,c))),r=!0;return _context42.abrupt("break",18);case 18:_context42.next=6;break;case 20:_context42.next=25;break;case 22:_context42.prev=22;_context42.t1=_context42["catch"](4);_iterator44.e(_context42.t1);case 25:_context42.prev=25;_iterator44.f();return _context42.finish(25);case 28:_iterator45=_createForOfIteratorHelper(this.localWorkShapes.entries());_context42.prev=29;_iterator45.s();case 31:if((_step45=_iterator45.n()).done){_context42.next=44;break;}_step45$value=_slicedToArray(_step45.value,2),_p10=_step45$value[0],_c6=_step45$value[1];v=_c6.result,_S8=_c6.toolsType,_O2=_c6.totalRect,_x53=_c6.isDel,_m14=_c6.workState;_context42.t2=_S8;_context42.next=_context42.t2===ht.LaserPen?37:42;break;case 37:if(!(_O2&&(n.push({isClear:!0,rect:_O2,clearCanvas:xt.TopFloat,viewId:this.viewId}),e.push({rect:_O2,drawCanvas:xt.TopFloat,viewId:this.viewId})),_x53)){_context42.next=40;break;}_c6.node.clearTmpPoints(),this.localWorkShapes["delete"](_p10),i.push({removeIds:[_p10.toString()],viewId:this.viewId,type:ct.RemoveNode});return _context42.abrupt("break",42);case 40:v&&((v.op||v.ops)&&i.push(v),_c6.result=void 0),!this.topLayer.getElementsByName(_p10.toString())[0]&&_m14===Rt.Done&&(_c6.isDel=!0,this.localWorkShapes.set(_p10,_c6)),r=!0;return _context42.abrupt("break",42);case 42:_context42.next=31;break;case 44:_context42.next=49;break;case 46:_context42.prev=46;_context42.t3=_context42["catch"](29);_iterator45.e(_context42.t3);case 49:_context42.prev=49;_iterator45.f();return _context42.finish(49);case 52:r&&this.runAnimation(),t.size&&t.forEach(function(p,c){i.push({type:ct.Cursor,uid:c.split(Sr)[0],op:p.op,workState:p.workState,viewId:_this97.viewId});}),(e.length||n.length||i.length)&&this.post({render:[].concat(n,e),sp:i});case 53:case"end":return _context42.stop();}},_callee39,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 ti=/* @__PURE__ */function(h){return h.Full="full",h.Sub="sub",h;}(ti||{});var lg=/*#__PURE__*/function(){function lg(r,t){_classCallCheck(this,lg);nt(this,"_self");nt(this,"type");nt(this,"workThreadMap",/* @__PURE__ */new Map());this._self=r,this.type=t,this.register();}return _createClass(lg,[{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 o;this.type==="full"&&(o=new cg(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),this.type==="sub"&&(o=new fg(t,{dpr:e,offscreenCanvasOpt:n,layerOpt:i},this.post.bind(this))),o&&a&&o.setIsSafari(a),o&&r.cameraOpt&&o.setCameraOpt(r.cameraOpt),o&&this.workThreadMap.set(t,o);}},{key:"register",value:function register(){var _this98=this;onmessage=/*#__PURE__*/function(){var _ref165=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(r){var t,_iterator46,_step46,_e10,n,i,a,o,_iterator47,_step47,_step47$value,f,p,c,_iterator48,_step48,_f5,s;return _regeneratorRuntime().wrap(function _callee40$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:t=r.data;if(!t){_context43.next=50;break;}_iterator46=_createForOfIteratorHelper(t.values());_context43.prev=3;_iterator46.s();case 5:if((_step46=_iterator46.n()).done){_context43.next=42;break;}_e10=_step46.value;n=_e10.msgType,i=_e10.viewId,a=_e10.tasksqueue,o=_e10.mainTasksqueueCount;if(!(n===ct.Init)){_context43.next=11;break;}_this98.init(_e10);return _context43.abrupt("continue",40);case 11:if(!(n===ct.TasksQueue&&a!=null&&a.size)){_context43.next=34;break;}_iterator47=_createForOfIteratorHelper(_this98.workThreadMap.entries());_context43.prev=13;_iterator47.s();case 15:if((_step47=_iterator47.n()).done){_context43.next=24;break;}_step47$value=_slicedToArray(_step47.value,2),f=_step47$value[0],p=_step47$value[1];c=a.get(f);_context43.t0=c;if(!_context43.t0){_context43.next=22;break;}_context43.next=22;return p.on(c);case 22:_context43.next=15;break;case 24:_context43.next=29;break;case 26:_context43.prev=26;_context43.t1=_context43["catch"](13);_iterator47.e(_context43.t1);case 29:_context43.prev=29;_iterator47.f();return _context43.finish(29);case 32:_this98.type==="full"&&kt(o)&&_this98.post({workerTasksqueueCount:o});return _context43.abrupt("continue",40);case 34:if(!(i===_h)){_context43.next=38;break;}_iterator48=_createForOfIteratorHelper(_this98.workThreadMap.values());try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){_f5=_step48.value;_f5.on(_e10),n===ct.Destroy&&_this98.workThreadMap["delete"](i);}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}return _context43.abrupt("continue",40);case 38:s=_this98.workThreadMap.get(i);s&&(s.on(_e10),n===ct.Destroy&&_this98.workThreadMap["delete"](i));case 40:_context43.next=5;break;case 42:_context43.next=47;break;case 44:_context43.prev=44;_context43.t2=_context43["catch"](3);_iterator46.e(_context43.t2);case 47:_context43.prev=47;_iterator46.f();return _context43.finish(47);case 50:case"end":return _context43.stop();}},_callee40,null,[[3,44,47,50],[13,26,29,32]]);}));return function onmessage(_x54){return _ref165.apply(this,arguments);};}();}},{key:"post",value:function post(r,t){t?this._self.postMessage(r,t):this._self.postMessage(r);}}]);}();var cg=/*#__PURE__*/function(_qn){function cg(t,e,n){var _this99;_classCallCheck(this,cg);_this99=_callSuper(this,cg,[t,e]);nt(_this99,"serviceDrawLayer");nt(_this99,"localDrawLayer");nt(_this99,"snapshotFullLayer");nt(_this99,"methodBuilder");nt(_this99,"localWork");nt(_this99,"serviceWork");nt(_this99,"_post");_this99._post=n,_this99.serviceDrawLayer=_this99.createLayer("serviceDrawLayer",_this99.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:1e3})),_this99.localDrawLayer=_this99.createLayer("localDrawLayer",_this99.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:1e3}));var i={thread:_this99,viewId:_this99.viewId,vNodes:_this99.vNodes,fullLayer:_this99.fullLayer};_this99.localWork=new ig(_objectSpread(_objectSpread({},i),{},{drawLayer:_this99.localDrawLayer})),_this99.serviceWork=new sg(_objectSpread(_objectSpread({},i),{},{drawLayer:_this99.serviceDrawLayer})),_this99.methodBuilder=new T0([Lt.CopyNode,Lt.SetColorNode,Lt.DeleteNode,Lt.RotateNode,Lt.ScaleNode,Lt.TranslateNode,Lt.ZIndexNode,Lt.SetFontStyle,Lt.SetPoint,Lt.SetLock,Lt.SetShapeOpt]).registerForWorker(_this99.localWork,_this99.serviceWork,_this99.scene),_this99.vNodes.init(_this99.fullLayer);return _this99;}_inherits(cg,_qn);return _createClass(cg,[{key:"combinePost",value:function(){var _combinePost=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(){var _this100=this;var a,o,s,f,_this$combinePostData,t,e,n,p,_iterator49,_step49,c,v,i;return _regeneratorRuntime().wrap(function _callee41$(_context44){while(1)switch(_context44.prev=_context44.next){case 0:_this$combinePostData=this.combinePostData(),t=_this$combinePostData.render,e=_objectWithoutProperties(_this$combinePostData,_excluded3);if(!(t!=null&&t.length)){_context44.next=28;break;}p=[];_iterator49=_createForOfIteratorHelper(t);_context44.prev=4;_iterator49.s();case 6:if((_step49=_iterator49.n()).done){_context44.next=19;break;}c=_step49.value;if(!c.rect){_context44.next=17;break;}if(!(c.drawCanvas&&(c.rect=this.safariFixRect(Jt(c.rect))),!c.rect)){_context44.next=11;break;}return _context44.abrupt("continue",17);case 11:if(!(c.drawCanvas&&c.rect&&c.rect.w>0&&c.rect.h>0)){_context44.next=16;break;}_context44.next=14;return this.getRectImageBitmap(c);case 14:v=_context44.sent;c.imageBitmap=v,n||(n=[]),n.push(v);case 16:p.push(c);case 17:_context44.next=6;break;case 19:_context44.next=24;break;case 21:_context44.prev=21;_context44.t0=_context44["catch"](4);_iterator49.e(_context44.t0);case 24:_context44.prev=24;_iterator49.f();return _context44.finish(24);case 27:e.render=p;case 28:i=(a=e.sp)==null?void 0:a.filter(function(p){return p.type!==ct.None||Object.keys(p).filter(function(c){return c==="type";}).length;});i!=null&&i.length&&(e.sp=i.map(function(p){return _objectSpread(_objectSpread({},p),{},{viewId:_this100.viewId});})),((o=e.sp)==null?void 0:o.length)===0&&delete e.sp,e.drawCount===void 0&&delete e.drawCount,(e!=null&&e.drawCount||(s=e.sp)!=null&&s.length||(f=e.render)!=null&&f.length)&&this._post(e,n);case 30:case"end":return _context44.stop();}},_callee41,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 _callee42(t){var e,n,i;return _regeneratorRuntime().wrap(function _callee42$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:if(!this.methodBuilder.consumeForWorker(t)){_context45.next=2;break;}return _context45.abrupt("return");case 2:e=t.msgType,n=t.dataType,i=t.workId;_context45.t0=e;_context45.next=_context45.t0===ct.UpdateCamera?6:_context45.t0===ct.Select?9:_context45.t0===ct.UpdateNode?11:_context45.t0===ct.FullWork?11:_context45.t0===ct.RemoveNode?14:_context45.t0===ct.GetTextActive?17:_context45.t0===ct.CursorHover?19:21;break;case 6:_context45.next=8;return this.updateCamera(t);case 8:return _context45.abrupt("return");case 9:n===Mt.Service&&(i===Nt.selectorId?this.localWork.updateFullSelectWork(t):this.serviceWork.runSelectWork(t));return _context45.abrupt("return");case 11:_context45.next=13;return this.consumeFull(n,t);case 13:return _context45.abrupt("return");case 14:_context45.next=16;return this.removeNode(t);case 16:return _context45.abrupt("return");case 17:this.checkTextActive(t);return _context45.abrupt("return");case 19:this.cursorHover(t);return _context45.abrupt("return");case 21:_context45.next=23;return _get(_getPrototypeOf(cg.prototype),"on",this).call(this,t);case 23:case"end":return _context45.stop();}},_callee42,this);}));function on(_x55){return _on2.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(t){var e,n;return _regeneratorRuntime().wrap(function _callee43$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:e=t.dataType,n=t.workId;if(!(n===Nt.selectorId)){_context46.next=4;break;}this.localWork.blurSelector(t);return _context46.abrupt("return");case 4:_context46.t0=e===Mt.Local;if(!_context46.t0){_context46.next=9;break;}this.localWork.removeWork(t);_context46.next=9;return this.localWork.colloctEffectSelectWork(t);case 9:_context46.t1=e===Mt.Service;if(!_context46.t1){_context46.next=14;break;}this.serviceWork.removeWork(t);_context46.next=14;return this.localWork.colloctEffectSelectWork(t);case 14:case"end":return _context46.stop();}},_callee43,this);}));function removeNode(_x56){return _removeNode.apply(this,arguments);}return removeNode;}()},{key:"checkTextActive",value:function checkTextActive(t){var e=t.dataType;e===Mt.Local&&this.localWork.checkTextActive(t);}},{key:"clearAll",value:function clearAll(){this.vNodes.clear(),_get(_getPrototypeOf(cg.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:xt.Bg,viewId:this.viewId},{isClearAll:!0,clearCanvas:xt.ServiceFloat,viewId:this.viewId},{isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}],sp:[{type:ct.Clear}]});}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(cg.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,o=t.height;(a!==this.scene.width||o!==this.scene.height)&&this.updateScene({width:a,height:o}),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 xt.Bg:return this.fullLayer;case xt.ServiceFloat:return this.serviceDrawLayer;case xt.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 _callee44(t,e){var n;return _regeneratorRuntime().wrap(function _callee44$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:_context47.next=2;return this.localWork.colloctEffectSelectWork(e);case 2:n=_context47.sent;_context47.t0=n&&t===Mt.Local;if(!_context47.t0){_context47.next=7;break;}_context47.next=7;return this.localWork.consumeFull(n,this.scene);case 7:n&&t===Mt.Service&&this.serviceWork.consumeFull(n);case 8:case"end":return _context47.stop();}},_callee44,this);}));function consumeFull(_x57,_x58){return _consumeFull2.apply(this,arguments);}return consumeFull;}()},{key:"consumeDraw",value:function consumeDraw(t,e){t===Mt.Local&&this.localWork.consumeDraw(e,this.serviceWork),t===Mt.Service&&this.serviceWork.consumeDraw(e);}},{key:"consumeDrawAll",value:function consumeDrawAll(t,e){t===Mt.Local&&this.localWork.consumeDrawAll(e,this.serviceWork);}},{key:"updateCamera",value:function(){var _updateCamera=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(t){var _this101=this;var a,e,n,i,o,s,f,_iterator50,_step50,_step50$value,p,c;return _regeneratorRuntime().wrap(function _callee45$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:e=[],n=t.cameraOpt,i=t.scenePath;if(!(n&&!oe(this.cameraOpt,n))){_context48.next=20;break;}o=this.localWork.getWorkShape($e);o&&(a=o.selectIds)!=null&&a.length&&o.cursorBlur();s=!!this.localDrawLayer.children.length;f=!!this.serviceDrawLayer.children.length;i&&_toConsumableArray(this.localWork.getWorkShapes().keys()).filter(function(c){return c!==$e;}).length&&(this.localWork.workShapesDone(i,this.serviceWork),s=!0);this.setCameraOpt(n);this.localWork.workShapes.forEach(function(p,c){(p.toolsType===ht.Pencil||p.toolsType===ht.Arrow||p.toolsType===ht.Straight||p.toolsType===ht.Ellipse||p.toolsType===ht.Rectangle||p.toolsType===ht.Star||p.toolsType===ht.Polygon||p.toolsType===ht.SpeechBalloon||p.toolsType===ht.Text)&&_this101.localWork.workShapeState.set(c,{willClear:!0});});_context48.t0=this.vNodes.curNodeMap.size;if(!_context48.t0){_context48.next=16;break;}this.vNodes.clearTarget();this.vNodes.updateNodesRect();_context48.next=15;return this.localWork.reRenderSelector();case 15:_context48.t0=this.serviceWork.selectorWorkShapes.size;case 16:if(!_context48.t0){_context48.next=19;break;}_iterator50=_createForOfIteratorHelper(this.serviceWork.selectorWorkShapes.entries());try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){_step50$value=_slicedToArray(_step50.value,2),p=_step50$value[0],c=_step50$value[1];this.serviceWork.runSelectWork({workId:p,selectIds:c.selectIds,msgType:ct.Select,dataType:Mt.Service,viewId:this.viewId});}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}case 19:s&&e.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}),f&&e.push({isClearAll:!0,clearCanvas:xt.ServiceFloat,viewId:this.viewId}),this.vNodes.hasRenderNodes()&&e.push({isClearAll:!0,clearCanvas:xt.Bg,viewId:this.viewId},{isDrawAll:!0,drawCanvas:xt.Bg,viewId:this.viewId}),e.length&&this.post({render:e});case 20:case"end":return _context48.stop();}},_callee45,this);}));function updateCamera(_x59){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,o=e.w*this.dpr||1,s=e.h*this.dpr||1;return createImageBitmap(this.getOffscreen(n),i,a,o,s,{resizeQuality:"low"});}// private checkRightRectBoundingBox(rect:IRectType){
|
|
443
|
-
// return this.vNodes.combineIntersectRect(rect);
|
|
444
|
-
// }
|
|
445
|
-
},{key:"cursorHover",value:function cursorHover(t){this.localWork.cursorHover(t);}}]);}(qn);var fg=/*#__PURE__*/function(_qn2){function fg(t,e,n){var _this102;_classCallCheck(this,fg);_this102=_callSuper(this,fg,[t,e]);nt(_this102,"_post");nt(_this102,"topLayer");nt(_this102,"snapshotFullLayer");nt(_this102,"serviceWork");nt(_this102,"localWork");nt(_this102,"topLayerWork");_this102._post=n,_this102.topLayer=_this102.createLayer("topLayer",_this102.scene,_objectSpread(_objectSpread({},e.layerOpt),{},{bufferSize:1500}));var i={thread:_this102,viewId:_this102.viewId,vNodes:_this102.vNodes,fullLayer:_this102.fullLayer,topLayer:_this102.topLayer};_this102.localWork=new og(i),_this102.topLayerWork=new ag(i),_this102.vNodes.init(_this102.fullLayer);return _this102;}_inherits(fg,_qn2);return _createClass(fg,[{key:"combinePost",value:function(){var _combinePost2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(){var _this103=this;var a,o,s,f,p,_this$combinePostData2,t,e,n,c,_iterator51,_step51,v,S,_iterator52,_step52,_c7,i;return _regeneratorRuntime().wrap(function _callee46$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:_this$combinePostData2=this.combinePostData(),t=_this$combinePostData2.render,e=_objectWithoutProperties(_this$combinePostData2,_excluded4);if(!(t!=null&&t.length)){_context49.next=28;break;}c=[];_iterator51=_createForOfIteratorHelper(t);_context49.prev=4;_iterator51.s();case 6:if((_step51=_iterator51.n()).done){_context49.next=19;break;}v=_step51.value;if(!v.rect){_context49.next=17;break;}if(!(v.drawCanvas&&(v.rect=this.safariFixRect(Jt(v.rect))),!v.rect)){_context49.next=11;break;}return _context49.abrupt("continue",17);case 11:if(!(v.drawCanvas&&v.rect&&v.rect.w>0&&v.rect.h>0)){_context49.next=16;break;}_context49.next=14;return this.getRectImageBitmap(v);case 14:S=_context49.sent;v.imageBitmap=S,n||(n=[]),n.push(S);case 16:c.push(v);case 17:_context49.next=6;break;case 19:_context49.next=24;break;case 21:_context49.prev=21;_context49.t0=_context49["catch"](4);_iterator51.e(_context49.t0);case 24:_context49.prev=24;_iterator51.f();return _context49.finish(24);case 27:e.render=c;case 28:if((a=e.workIds)!=null&&a.size&&e.drawCount){_iterator52=_createForOfIteratorHelper(e.workIds.values());try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){_c7=_step52.value;this.fullLayer.getElementsByName(_c7).forEach(function(v){v.id&&e.drawCount&&Number(v.id)<e.drawCount&&v.remove();});}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}}i=(o=e.sp)==null?void 0:o.filter(function(c){return c.type!==ct.None||Object.keys(c).filter(function(v){return v==="type";}).length;});i!=null&&i.length&&(e.sp=i.map(function(c){return _objectSpread(_objectSpread({},c),{},{viewId:_this103.viewId});})),((s=e.sp)==null?void 0:s.length)===0&&delete e.sp,e.drawCount===void 0&&delete e.drawCount,((f=e.sp)!=null&&f.length||e.drawCount||(p=e==null?void 0:e.render)!=null&&p.length)&&this._post(e,n);case 31:case"end":return _context49.stop();}},_callee46,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 xt.TopFloat:return this.topLayer;default:return this.fullLayer;}}},{key:"on",value:function(){var _on3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(t){var e,n,i,a,o,s;return _regeneratorRuntime().wrap(function _callee47$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:e=t.msgType,n=t.toolsType,i=t.opt,a=t.workId,o=t.dataType;_context50.t0=e;_context50.next=_context50.t0===ct.UpdateCamera?4:_context50.t0===ct.UpdateTools?7:_context50.t0===ct.CreateWork?12:_context50.t0===ct.RemoveNode?16:_context50.t0===ct.FullWork?19:_context50.t0===ct.Snapshot?23:_context50.t0===ct.BoundingBox?30:37;break;case 4:_context50.next=6;return this.updateCamera(t);case 6:return _context50.abrupt("break",37);case 7:if(!(n===ht.LaserPen&&i)){_context50.next=11;break;}s={toolsType:n,toolsOpt:i};this.topLayerWork.setToolsOpt(s);return _context50.abrupt("return");case 11:return _context50.abrupt("break",37);case 12:if(!(n===ht.LaserPen&&a&&i)){_context50.next=15;break;}this.topLayerWork.getTmpWorkShapeNode()||this.topLayerWork.setToolsOpt({toolsType:n,toolsOpt:i}),this.topLayerWork.setWorkOptions(a.toString(),i);return _context50.abrupt("return");case 15:return _context50.abrupt("break",37);case 16:_context50.next=18;return this.removeNode(t);case 18:return _context50.abrupt("return");case 19:if(!(n===ht.LaserPen)){_context50.next=22;break;}this.consumeDrawAll(o,t);return _context50.abrupt("return");case 22:return _context50.abrupt("break",37);case 23:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId==="mainView"?6e3:3e3}));_context50.t1=this.snapshotFullLayer;if(!_context50.t1){_context50.next=29;break;}_context50.next=28;return this.getSnapshot(t);case 28:this.snapshotFullLayer=void 0;case 29:return _context50.abrupt("return");case 30:this.snapshotFullLayer=this.createLayer("snapshotFullLayer",this.scene,_objectSpread(_objectSpread({},this.opt.layerOpt),{},{bufferSize:this.viewId==="mainView"?6e3:3e3}));_context50.t2=this.snapshotFullLayer;if(!_context50.t2){_context50.next=36;break;}_context50.next=35;return this.getBoundingRect(t);case 35:this.snapshotFullLayer=void 0;case 36:return _context50.abrupt("return");case 37:_context50.next=39;return _get(_getPrototypeOf(fg.prototype),"on",this).call(this,t);case 39:case"end":return _context50.stop();}},_callee47,this);}));function on(_x60){return _on3.apply(this,arguments);}return on;}()},{key:"removeNode",value:function(){var _removeNode2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(t){var e;return _regeneratorRuntime().wrap(function _callee48$(_context51){while(1)switch(_context51.prev=_context51.next){case 0:e=t.dataType;e===Mt.Local&&this.localWork.removeWork(t);case 2:case"end":return _context51.stop();}},_callee48,this);}));function removeNode(_x61){return _removeNode2.apply(this,arguments);}return removeNode;}()},{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.toString())){this.localWork.consumeDraw(e);return;}if(this.topLayerWork.localWorkShapes.get(i.toString())){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.toString())){this.localWork.consumeDrawAll(e);return;}if(this.topLayerWork.localWorkShapes.get(a.toString())){this.topLayerWork.consumeDrawAll(e);return;}}}},{key:"clearAll",value:function clearAll(){this.vNodes.clear(),_get(_getPrototypeOf(fg.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:xt.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,o=i.x*this.dpr,s=i.y*this.dpr,f=i.w*this.dpr||1,p=i.h*this.dpr||1;return createImageBitmap(this.getOffscreen(a,e),o,s,f,p,n);}},{key:"updateLayer",value:function updateLayer(t){var e=t.width,n=t.height;_get(_getPrototypeOf(fg.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 _callee49(t){var _this104=this;var e,n,i,a,_iterator53,_step53,_loop8;return _regeneratorRuntime().wrap(function _callee49$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:e=[],n=t.cameraOpt;if(!(n&&!oe(this.cameraOpt,n))){_context53.next=22;break;}i=!!this.topLayerWork.localWorkShapes.size,a=!!this.localWork.getWorkShapes().size;if(!(a&&this.localWork.workShapesDone(),this.setCameraOpt(n),a&&e.push({isClearAll:!0,clearCanvas:xt.Float,viewId:this.viewId}),i)){_context53.next=21;break;}e.push({isClearAll:!0,clearCanvas:xt.TopFloat,viewId:this.viewId});_iterator53=_createForOfIteratorHelper(this.topLayerWork.localWorkShapes.entries());_context53.prev=6;_loop8=/*#__PURE__*/_regeneratorRuntime().mark(function _loop8(){var _step53$value,o,s,f;return _regeneratorRuntime().wrap(function _loop8$(_context52){while(1)switch(_context52.prev=_context52.next){case 0:_step53$value=_slicedToArray(_step53.value,2),o=_step53$value[0],s=_step53$value[1];if(s.totalRect){_this104.topLayer.getElementsByName(o.toString()).forEach(function(p){var c=p.getBoundingClientRect(),v=wt({x:c.x,y:c.y,w:c.width,h:c.height});f=Ot(f,v);}),s.totalRect=f,_this104.topLayerWork.localWorkShapes.set(o,s);}case 2:case"end":return _context52.stop();}},_loop8);});_iterator53.s();case 9:if((_step53=_iterator53.n()).done){_context53.next=13;break;}return _context53.delegateYield(_loop8(),"t0",11);case 11:_context53.next=9;break;case 13:_context53.next=18;break;case 15:_context53.prev=15;_context53.t1=_context53["catch"](6);_iterator53.e(_context53.t1);case 18:_context53.prev=18;_iterator53.f();return _context53.finish(18);case 21:e.length&&this.post({render:e});case 22:case"end":return _context53.stop();}},_callee49,this,[[6,15,18,21]]);}));function updateCamera(_x62){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,o=t.width,s=t.height;(o!==this.scene.width||s!==this.scene.height)&&this.updateScene({width:o,height:s}),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 _callee50(t){var e,n,i,a,o,s,f,_i4,_Object$entries,_Object$entries$_i,c,v,S,O,p;return _regeneratorRuntime().wrap(function _callee50$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt,a=t.w,o=t.h;if(!(e&&n&&i&&this.snapshotFullLayer)){_context54.next=27;break;}s=Jt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i4=0,_Object$entries=Object.entries(n);case 5:if(!(_i4<_Object$entries.length)){_context54.next=20;break;}_Object$entries$_i=_slicedToArray(_Object$entries[_i4],2),c=_Object$entries$_i[0],v=_Object$entries$_i[1];if(!(v!=null&&v.type)){_context54.next=17;break;}_context54.t0=v==null?void 0:v.type;_context54.next=_context54.t0===ct.UpdateNode?11:_context54.t0===ct.FullWork?11:17;break;case 11:S=v.opt;_context54.next=14;return this.localWork.runFullWork(_objectSpread(_objectSpread({},v),{},{opt:S,workId:c,msgType:ct.FullWork,dataType:Mt.Service,viewId:this.viewId}));case 14:O=_context54.sent;f=Ot(f,O);return _context54.abrupt("break",17);case 17:_i4++;_context54.next=5;break;case 20:a&&o&&(p={resizeWidth:a,resizeHeight:o});_context54.next=23;return new Promise(function(c){setTimeout(c,500);});case 23:_context54.next=25;return this.getSnapshotRender({scenePath:e,curCameraOpt:s,options:p});case 25:this.localWork.fullLayer=this.fullLayer;this.localWork.drawLayer=void 0;case 27:case"end":return _context54.stop();}},_callee50,this);}));function getSnapshot(_x63){return _getSnapshot.apply(this,arguments);}return getSnapshot;}()// private willRenderSpecialLabel(willRenderMap:Map<string,BaseCollectorReducerAction>){
|
|
446
|
-
// for (const [key,value] of willRenderMap.entries()) {
|
|
447
|
-
// const labelGroup = this.snapshotFullLayer?.getElementsByName(key)[0] as Group;
|
|
448
|
-
// if (labelGroup && value.opt) {
|
|
449
|
-
// this.localWork.updateLabels(labelGroup, value);
|
|
450
|
-
// }
|
|
451
|
-
// }
|
|
452
|
-
// }
|
|
453
|
-
},{key:"getSnapshotRender",value:function(){var _getSnapshotRender=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee51(t){var o,s,e,n,i,a;return _regeneratorRuntime().wrap(function _callee51$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:e=t.scenePath,n=t.curCameraOpt,i=t.options;((o=this.snapshotFullLayer)==null?void 0:o.parent).render();_context55.next=4;return this.getRectImageBitmap({rect:this.getSceneRect(),drawCanvas:xt.None},!0,i);case 4:a=_context55.sent;a&&(this._post({sp:[{type:ct.Snapshot,scenePath:e,imageBitmap:a,viewId:this.viewId}]},[a]),a.close(),(s=this.snapshotFullLayer)==null||s.removeAllChildren(),this.setCameraOpt(n,this.fullLayer));case 6:case"end":return _context55.stop();}},_callee51,this);}));function getSnapshotRender(_x64){return _getSnapshotRender.apply(this,arguments);}return getSnapshotRender;}()},{key:"getBoundingRect",value:function(){var _getBoundingRect=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(t){var e,n,i,a,o,_i5,_Object$entries2,_Object$entries2$_i,s,f,p;return _regeneratorRuntime().wrap(function _callee52$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:e=t.scenePath,n=t.scenes,i=t.cameraOpt;if(!(e&&n&&i&&this.snapshotFullLayer)){_context56.next=20;break;}a=Jt(this.cameraOpt);this.setCameraOpt(i,this.snapshotFullLayer),this.localWork.fullLayer=this.snapshotFullLayer,this.localWork.drawLayer=void 0;_i5=0,_Object$entries2=Object.entries(n);case 5:if(!(_i5<_Object$entries2.length)){_context56.next=19;break;}_Object$entries2$_i=_slicedToArray(_Object$entries2[_i5],2),s=_Object$entries2$_i[0],f=_Object$entries2$_i[1];if(!(f!=null&&f.type)){_context56.next=16;break;}_context56.t0=f==null?void 0:f.type;_context56.next=_context56.t0===ct.UpdateNode?11:_context56.t0===ct.FullWork?11:16;break;case 11:_context56.next=13;return this.localWork.runFullWork(_objectSpread(_objectSpread({},f),{},{workId:s,msgType:ct.FullWork,dataType:Mt.Service,viewId:this.viewId}));case 13:p=_context56.sent;o=Ot(o,p);return _context56.abrupt("break",16);case 16:_i5++;_context56.next=5;break;case 19:o&&this.post({sp:[{type:ct.BoundingBox,scenePath:e,rect:o}]}),this.localWork.fullLayer=this.fullLayer,this.localWork.drawLayer=void 0,this.snapshotFullLayer.removeAllChildren(),this.setCameraOpt(a,this.fullLayer);case 20:case"end":return _context56.stop();}},_callee52,this);}));function getBoundingRect(_x65){return _getBoundingRect.apply(this,arguments);}return getBoundingRect;}()}]);}(qn);var ug=self;new lg(ug,ti.Full);
|